diff --git a/.github/workflows/lint_pr.yml b/.github/workflows/lint_pr.yml new file mode 100644 index 0000000..3d571a2 --- /dev/null +++ b/.github/workflows/lint_pr.yml @@ -0,0 +1,22 @@ +name: Lint PR Changed Files +on: + # by adding a schedule task to this workflow we will automatically + # begin serializing read-only runs and handling them. The cron job + # below is set to run every 15 minutes, GitHub will ignore anything + # under 10 minutes and run every 10 minutes anyway. + schedule: + - cron: '*/30 * * * *' + pull_request: + types: + - opened + - synchronize + - closed +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: bradennapier/eslint-plus-action@v3.4.0 + with: + reportIgnoredFiles: true + reportWarningsAsErrors: true diff --git a/.github/workflows/pull_request_ci.yml b/.github/workflows/pull_request_ci.yml index 7a01f07..fff69c1 100644 --- a/.github/workflows/pull_request_ci.yml +++ b/.github/workflows/pull_request_ci.yml @@ -9,14 +9,15 @@ jobs: strategy: matrix: - node-version: [10.x, 12.x, 14.x] + node: [10.x, 12.x, 14.x] steps: - uses: actions/checkout@v2 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v1 + - name: Use Node.js ${{ matrix.node }} + uses: actions/setup-node@v2.0.0 with: - node-version: ${{ matrix.node-version }} + node-version: ${{ matrix.node }} + check-latest: true - name: npm install, build, and test run: | yarn install --pure-lockfile diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ffa889a..9e271db 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,7 +11,7 @@ jobs: - name: Checkout uses: actions/checkout@v2 - name: Setup Node.js - uses: actions/setup-node@v1 + uses: actions/setup-node@v2.0.0 with: node-version: 12 - name: Install dependencies diff --git a/README.md b/README.md index aa97f86..5309d95 100644 --- a/README.md +++ b/README.md @@ -48,6 +48,7 @@ - Provide import patterns that restrict imports of certain files based on location. - Ensure imports meet the expected guidelines within your repo. - Adapted from VSCode's rule `code-import-patterns`. +- Works with configured `paths` from your `tsconfig.json` - Provide custom eslint messaging for each pattern if needed. - Useful in monorepos and most Typescript projects which utilize incremental builds. @@ -59,10 +60,6 @@ module.exports = { root: true, parser: '@typescript-eslint/parser', - parserOptions: { - project: './tsconfig.lint.json', - sourceType: 'module', - }, rules: { 'ts-import/patterns': [ 'error', @@ -95,13 +92,10 @@ module.exports = { }, ], }, - plugins: ['ts-import'], - settings: { - 'import/resolver': { - typescript: { - directory: 'tsconfig.lint.json', - }, - }, - }, + plugins: ['ts-import'] } ``` + +## Special Thanks + +- While originally utilizing custom logic, we since borrowed the resolving method used by [eslint-import-resolver-typescript](https://github.com/alexgorbatchev/eslint-import-resolver-typescript). diff --git a/package.json b/package.json index 938f001..2d2b1b4 100644 --- a/package.json +++ b/package.json @@ -34,40 +34,48 @@ "test": "echo Tests TODO" }, "peerDependencies": { - "eslint": "^7.2.0", - "typescript": "^3.9.5" + "eslint": ">= 6 < 8", + "typescript": ">= 3" }, "dependencies": { - "@zerollup/ts-helpers": "^1.7.18", + "debug": "^4.1.1", + "fast-glob": "^3.2.4", + "is-glob": "^4.0.1", "minimatch": "^3.0.4", + "resolve": "^1.17.0", + "tsconfig-paths": "^3.9.0", "tslib": "^2.0.0" }, "devDependencies": { "@semantic-release/changelog": "^5.0.1", "@semantic-release/git": "^9.0.0", "@semantic-release/npm": "^7.0.5", + "@types/debug": "^4.1.5", "@types/eslint": "^7.2.0", - "@typescript-eslint/eslint-plugin": "^3.3.0", - "@typescript-eslint/parser": "^3.3.0", - "@typescript-eslint/experimental-utils": "^3.3.0", + "@types/is-glob": "^4.0.1", + "@types/minimatch": "^3.0.3", + "@types/resolve": "^1.17.1", + "@typescript-eslint/eslint-plugin": "^3.6.1", + "@typescript-eslint/experimental-utils": "^3.6.1", + "@typescript-eslint/parser": "^3.6.1", "commitizen": "^4.1.2", - "eslint": "^7.2.0", + "eslint": "^7.4.0", "eslint-config-airbnb-base": "^14.2.0", "eslint-config-prettier": "^6.11.0", "eslint-import-resolver-typescript": "^2.0.0", - "eslint-plugin-flowtype": "^5.1.3", - "eslint-plugin-import": "^2.21.2", + "eslint-plugin-flowtype": "^5.2.0", + "eslint-plugin-import": "^2.22.0", "eslint-plugin-prettier": "^3.1.4", "eslint-plugin-promise": "^4.2.1", - "gh-pages": "^3.0.0", + "gh-pages": "^3.1.0", "git-cz": "^4.7.0", "husky": "^4.2.5", "lint-staged": "^10.2.11", "prettier": "^2.0.5", "rimraf": "^3.0.2", - "semantic-release": "^17.0.8", + "semantic-release": "^17.1.1", "ts-node": "^8.10.2", - "typescript": "^3.9.5" + "typescript": "^3.9.6" }, "files": [ "lib/", @@ -84,25 +92,6 @@ "path": "git-cz" } }, - "release": { - "branches": [ - "master", - { - "name": "next", - "prerelease": "rc" - } - ], - "verifyConditions": [ - "@semantic-release/changelog", - "@semantic-release/npm", - "@semantic-release/git" - ], - "prepare": [ - "@semantic-release/changelog", - "@semantic-release/npm", - "@semantic-release/git" - ] - }, "lint-staged": { "src/**/*.{ts,tsx}": [ "eslint --fix" diff --git a/release.config.js b/release.config.js new file mode 100644 index 0000000..b63024d --- /dev/null +++ b/release.config.js @@ -0,0 +1,26 @@ +module.exports = { + plugins: [ + [ + '@semantic-release/commit-analyzer', + { + preset: 'conventionalcommits', + }, + ], + [ + '@semantic-release/release-notes-generator', + { + preset: 'conventionalcommits', + }, + ], + '@semantic-release/npm', + [ + // commits the changed files to git + '@semantic-release/git', + { + assets: ['package.json'], + }, + ], + // creates the github release + '@semantic-release/github', + ], +}; diff --git a/src/configPaths.ts b/src/configPaths.ts new file mode 100644 index 0000000..0b9943f --- /dev/null +++ b/src/configPaths.ts @@ -0,0 +1,207 @@ +/* eslint-disable no-nested-ternary */ +import path from 'path'; + +import { + ConfigLoaderSuccessResult, + createMatchPath, + loadConfig, + ConfigLoaderResult, +} from 'tsconfig-paths'; +import { sync as globSync } from 'fast-glob'; +import isGlob from 'is-glob'; +import { isCore, sync } from 'resolve'; +import debug from 'debug'; + +const log = debug('eslint-plugin-ts-import'); + +const extensions = ['.ts', '.tsx', '.d.ts'].concat( + Object.keys(require.extensions), + '.jsx', +); + +export const interfaceVersion = 2; + +export interface TsResolverOptions { + alwaysTryTypes?: boolean; + directory?: string | string[]; +} + +/** + * @param {string} source the module to resolve; i.e './some-module' + * @param {string} file the importing file's full path; i.e. '/usr/local/bin/file.js' + */ +export function resolve( + source: string, + file: string, + options: TsResolverOptions | null, +): { + found: boolean; + path?: string | null; +} { + // eslint-disable-next-line no-param-reassign + options = options || {}; + + log('looking for:', source); + + // don't worry about core node modules + if (isCore(source)) { + log('matched core:', source); + + return { + found: true, + path: null, + }; + } + + initMappers(options); + const mappedPath = getMappedPath(source, file); + if (mappedPath) { + log('matched ts path:', mappedPath); + } + + // note that even if we map the path, we still need to do a final resolve + let foundNodePath: string | null | undefined; + try { + foundNodePath = sync(mappedPath || source, { + extensions, + basedir: path.dirname(path.resolve(file)), + packageFilter, + }); + } catch (err) { + foundNodePath = null; + } + + // naive attempt at @types/* resolution, + // if path is neither absolute nor relative + if ( + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + (/\.jsx?$/.test(foundNodePath!) || + (options.alwaysTryTypes && !foundNodePath)) && + !/^@types[/\\]/.test(source) && + !path.isAbsolute(source) && + !source.startsWith('.') + ) { + const definitelyTyped = resolve( + `@types${path.sep}${mangleScopedPackage(source)}`, + file, + options, + ); + if (definitelyTyped.found) { + return definitelyTyped; + } + } + + if (foundNodePath) { + log('matched node path:', foundNodePath); + + return { + found: true, + path: foundNodePath, + }; + } + + log("didn't find ", source); + + return { + found: false, + }; +} + +function packageFilter(pkg: Record) { + // eslint-disable-next-line no-param-reassign + pkg.main = + pkg.types || pkg.typings || pkg.module || pkg['jsnext:main'] || pkg.main; + return pkg; +} + +let mappersBuildForOptions: TsResolverOptions; +let mappers: + | Array<(source: string, file: string) => string | undefined> + | undefined; + +/** + * @param {string} source the module to resolve; i.e './some-module' + * @param {string} file the importing file's full path; i.e. '/usr/local/bin/file.js' + * @returns The mapped path of the module or undefined + */ +function getMappedPath(source: string, file: string) { + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + const paths = mappers! + .map((mapper) => mapper(source, file)) + .filter((filePath) => !!filePath); + + if (paths.length > 1) { + log('found multiple matching ts paths:', paths); + } + + return paths[0]; +} + +function initMappers(options: TsResolverOptions) { + if (mappers && mappersBuildForOptions === options) { + return; + } + + const isArrayOfStrings = (array?: string | string[]) => + Array.isArray(array) && array.every((o) => typeof o === 'string'); + + const configPaths = + typeof options.directory === 'string' + ? [options.directory] + : isArrayOfStrings(options.directory) + ? options.directory + : [process.cwd()]; + + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + mappers = configPaths! + // turn glob patterns into paths + .reduce( + (paths, fpath) => paths.concat(isGlob(fpath) ? globSync(fpath) : fpath), + [], + ) + .map(loadConfig) + .filter(isConfigLoaderSuccessResult) + .map((configLoaderResult) => { + const matchPath = createMatchPath( + configLoaderResult.absoluteBaseUrl, + configLoaderResult.paths, + ); + + return (source: string, file: string) => { + // exclude files that are not part of the config base url + if (!file.includes(configLoaderResult.absoluteBaseUrl)) { + return undefined; + } + + // look for files based on setup tsconfig "paths" + return matchPath(source, undefined, undefined, extensions); + }; + }); + + mappersBuildForOptions = options; +} + +function isConfigLoaderSuccessResult( + configLoaderResult: ConfigLoaderResult, +): configLoaderResult is ConfigLoaderSuccessResult { + if (configLoaderResult.resultType !== 'success') { + // this can happen if the user has problems with their tsconfig + // or if it's valid, but they don't have baseUrl set + log('failed to init tsconfig-paths:', configLoaderResult.message); + return false; + } + return true; +} + +/** + * For a scoped package, we must look in `@types/foo__bar` instead of `@types/@foo/bar`. + */ +function mangleScopedPackage(moduleName: string) { + if (moduleName.startsWith('@')) { + const replaceSlash = moduleName.replace(path.sep, '__'); + if (replaceSlash !== moduleName) { + return replaceSlash.slice(1); // Take off the "@" + } + } + return moduleName; +} diff --git a/src/importHelpers.ts b/src/importHelpers.ts deleted file mode 100644 index b09af4c..0000000 --- a/src/importHelpers.ts +++ /dev/null @@ -1,118 +0,0 @@ -// import path from 'path'; -// eslint-disable-next-line import/no-extraneous-dependencies -import { ImportPathsResolver } from '@zerollup/ts-helpers'; -import ts from 'typescript'; - -export interface Config { - /** - Disable plugin path resolving for given paths keys - @default undefined - */ - exclude?: string[] | undefined; - - /** - * Disable path rewriting for generated d.ts - * - * @default false - */ - disableForDeclarations?: boolean; - - /** - * Try to load min.js and .js versions of each mapped import: for use ts without bundler - * @default false - */ - tryLoadJs?: boolean; -} - -export const defaultConfig: Config = {}; - -type FileExists = Partial>; - -export type EmitHost = FileExists; - -export type Program = ts.Program & FileExists; - -export type TransformationContext = ts.TransformationContext & { - getEmitHost?: () => EmitHost; -}; - -type ExtractElement = T extends Array ? T[number] : T; - -export type CustomTransformer = { - [Key in keyof ts.CustomTransformers]: ExtractElement< - ts.CustomTransformers[Key] - >; -}; - -const fileExistsParts = ['.min.js', '.js'] as const; - -const tsParts = [ - '.ts', - '.d.ts', - '.tsx', - '/index.ts', - '/index.tsx', - '/index.d.ts', - '', -] as const; - -export class ImportPathInternalResolver { - protected resolver: ImportPathsResolver; - - protected emitHost: EmitHost | undefined; - - constructor(protected program: Program, protected config: Config = {}) { - const { paths, baseUrl } = program.getCompilerOptions(); - this.resolver = new ImportPathsResolver({ - paths, - baseUrl, - exclude: config.exclude, - }); - // this.emitHost = program.getEmitHost - // ? program.getEmitHost() - // : undefined; - } - - fileExists(file: string) { - const { program, emitHost } = this; - if (program?.fileExists) { - return program.fileExists(file); - } - if (emitHost?.fileExists) { - return emitHost.fileExists(file); - } - - return true; - } - - resolveImport( - oldImport: string, - currentDir: string, - ): string | undefined | void { - const { config } = this; - const newImports = this.resolver.getImportSuggestions( - oldImport, - currentDir, - ); - - if (!newImports) { - return; - } - - for (const newImport of newImports) { - for (const part of tsParts) { - if (this.fileExists(`${newImport}${part}`)) { - return newImport; - } - } - - if (config.tryLoadJs) { - for (const ext of fileExistsParts) { - if (this.fileExists(`${newImport}${ext}`)) { - return `${newImport}${ext}`; - } - } - } - } - } -} diff --git a/src/rules/patterns.ts b/src/rules/patterns.ts index 46127c4..03a5b2b 100644 --- a/src/rules/patterns.ts +++ b/src/rules/patterns.ts @@ -6,14 +6,18 @@ // type-only import - fixed by https://github.com/benmosher/eslint-plugin-import/pull/1820 // eslint-disable-next-line import/no-extraneous-dependencies import type { TSESTree } from '@typescript-eslint/experimental-utils'; +import debug from 'debug'; import * as eslint from 'eslint'; import * as fpath from 'path'; + import minimatch from 'minimatch'; -import { ImportPathInternalResolver } from '../importHelpers'; import { createImportRuleListener } from '../utils'; +import { resolve } from '../configPaths'; + +const log = debug('eslint-plugin-ts-import'); interface ImportPatternsConfig { target: string; @@ -24,8 +28,6 @@ interface ImportPatternsConfig { } export default class ImportPatternsRule implements eslint.Rule.RuleModule { - private importResolver: ImportPathInternalResolver | undefined; - readonly meta: eslint.Rule.RuleMetaData = { messages: { badImportCustomMessage: "{{message}} (allowed: '{{allowed}}')", @@ -39,12 +41,6 @@ export default class ImportPatternsRule implements eslint.Rule.RuleModule { create(context: eslint.Rule.RuleContext): eslint.Rule.RuleListener { const configs = context.options; - // this.pathResolver = new tsHelpers.ImportPathsResolver( - // context.parserServices.program.getCompilerOptions(), - // ); - this.importResolver = new ImportPathInternalResolver( - context.parserServices.program, - ); for (const config of configs) { if (minimatch(context.getFilename(), config.target)) { return createImportRuleListener((node, value) => @@ -79,35 +75,15 @@ export default class ImportPatternsRule implements eslint.Rule.RuleModule { allowed = config.allowed; } - let importPath = - this.importResolver && this.importResolver.resolveImport(path, dirName); + const importPath = resolve(path, fileName, null).path; - if (importPath) { - importPath = fpath.resolve(importPath); - } + let matched = + config.modules !== false && importPath?.includes('node_modules'); - let matched = false; - - // check node_modules match first and allow unless set to false - if (config.modules !== false && !relativePath) { - if (importPath && importPath.includes('node_modules/')) { - // confirmed - matched = true; - } else { - // this should rarely occur since we should have resolved with typescript - try { - require.resolve(path, { - paths: [dirName], - }); - matched = true; - } catch { - // '/users/shared/development/projects/@auroradao/project9/src/node_modules/sequelize/types/index.d.ts' - // failed to find as a node_module - } - } - } + log('Initial Matched? ', { importPath, matched }); if (!matched) { + log('Checking: ', { path, importPath, allowed }); for (const pattern of allowed) { if (!relativePath && pattern === path) { // direct match diff --git a/yarn.lock b/yarn.lock index 879d481..7f8d6b3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -287,6 +287,11 @@ resolved "https://registry.yarnpkg.com/@types/color-name/-/color-name-1.1.1.tgz#1c1261bbeaa10a8055bbc5d8ab84b7b2afc846a0" integrity sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ== +"@types/debug@^4.1.5": + version "4.1.5" + resolved "https://registry.yarnpkg.com/@types/debug/-/debug-4.1.5.tgz#b14efa8852b7768d898906613c23f688713e02cd" + integrity sha512-Q1y515GcOdTHgagaVFhHnIFQ38ygs/kmxdNpvpou+raI9UO3YZcHDngBSYKQklcKlvA7iuQlmIKbzvmxcOE9CQ== + "@types/eslint-visitor-keys@^1.0.0": version "1.0.0" resolved "https://registry.yarnpkg.com/@types/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz#1ee30d79544ca84d68d4b3cdb0af4f205663dd2d" @@ -305,6 +310,11 @@ resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.44.tgz#980cc5a29a3ef3bea6ff1f7d021047d7ea575e21" integrity sha512-iaIVzr+w2ZJ5HkidlZ3EJM8VTZb2MJLCjw3V+505yVts0gRC4UMvjw0d1HPtGqI/HQC/KdsYtayfzl+AXY2R8g== +"@types/is-glob@^4.0.1": + version "4.0.1" + resolved "https://registry.yarnpkg.com/@types/is-glob/-/is-glob-4.0.1.tgz#a93eec1714172c8eb3225a1cc5eb88c2477b7d00" + integrity sha512-k3RS5HyBPu4h+5hTmIEfPB2rl5P3LnGdQEZrV2b9OWTJVtsUQ2VBcedqYKGqxvZqle5UALUXdSfVA8nf3HfyWQ== + "@types/json-schema@*": version "7.0.5" resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.5.tgz#dcce4430e64b443ba8945f0290fb564ad5bac6dd" @@ -320,11 +330,21 @@ resolved "https://registry.yarnpkg.com/@types/json5/-/json5-0.0.29.tgz#ee28707ae94e11d2b827bcbe5270bcea7f3e71ee" integrity sha1-7ihweulOEdK4J7y+UnC86n8+ce4= +"@types/minimatch@^3.0.3": + version "3.0.3" + resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.3.tgz#3dca0e3f33b200fc7d1139c0cd96c1268cadfd9d" + integrity sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA== + "@types/minimist@^1.2.0": version "1.2.0" resolved "https://registry.yarnpkg.com/@types/minimist/-/minimist-1.2.0.tgz#69a23a3ad29caf0097f06eda59b361ee2f0639f6" integrity sha1-aaI6OtKcrwCX8G7aWbNh7i8GOfY= +"@types/node@*": + version "14.0.23" + resolved "https://registry.yarnpkg.com/@types/node/-/node-14.0.23.tgz#676fa0883450ed9da0bb24156213636290892806" + integrity sha512-Z4U8yDAl5TFkmYsZdFPdjeMa57NOvnaf1tljHzhouaPEp7LCj2JKkejpI1ODviIAQuW4CcQmxkQ77rnLsOOoKw== + "@types/node@>= 8": version "14.0.11" resolved "https://registry.yarnpkg.com/@types/node/-/node-14.0.11.tgz#61d4886e2424da73b7b25547f59fdcb534c165a3" @@ -340,61 +360,77 @@ resolved "https://registry.yarnpkg.com/@types/parse-json/-/parse-json-4.0.0.tgz#2f8bb441434d163b35fb8ffdccd7138927ffb8c0" integrity sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA== +"@types/resolve@^1.17.1": + version "1.17.1" + resolved "https://registry.yarnpkg.com/@types/resolve/-/resolve-1.17.1.tgz#3afd6ad8967c77e4376c598a82ddd58f46ec45d6" + integrity sha512-yy7HuzQhj0dhGpD8RLXSZWEkLsV9ibvxvi6EiJ3bkqLAO1RGo0WbkWQiwpRlSFymTJRz0d3k5LM3kkx8ArDbLw== + dependencies: + "@types/node" "*" + "@types/retry@^0.12.0": version "0.12.0" resolved "https://registry.yarnpkg.com/@types/retry/-/retry-0.12.0.tgz#2b35eccfcee7d38cd72ad99232fbd58bffb3c84d" integrity sha512-wWKOClTTiizcZhXnPY4wikVAwmdYHp8q6DmC+EJUzAMsycb7HB32Kh9RN4+0gExjmPmZSAQjgURXIGATPegAvA== -"@typescript-eslint/eslint-plugin@^3.3.0": - version "3.3.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-3.3.0.tgz#89518e5c5209a349bde161c3489b0ec187ae5d37" - integrity sha512-Ybx/wU75Tazz6nU2d7nN6ll0B98odoiYLXwcuwS5WSttGzK46t0n7TPRQ4ozwcTv82UY6TQoIvI+sJfTzqK9dQ== +"@typescript-eslint/eslint-plugin@^3.6.1": + version "3.6.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-3.6.1.tgz#5ced8fd2087fbb83a76973dea4a0d39d9cb4a642" + integrity sha512-06lfjo76naNeOMDl+mWG9Fh/a0UHKLGhin+mGaIw72FUMbMGBkdi/FEJmgEDzh4eE73KIYzHWvOCYJ0ak7nrJQ== dependencies: - "@typescript-eslint/experimental-utils" "3.3.0" + "@typescript-eslint/experimental-utils" "3.6.1" + debug "^4.1.1" functional-red-black-tree "^1.0.1" regexpp "^3.0.0" semver "^7.3.2" tsutils "^3.17.1" -"@typescript-eslint/experimental-utils@3.3.0", "@typescript-eslint/experimental-utils@^3.3.0": - version "3.3.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-3.3.0.tgz#d72a946e056a83d4edf97f3411cceb639b0b8c87" - integrity sha512-d4pGIAbu/tYsrPrdHCQ5xfadJGvlkUxbeBB56nO/VGmEDi/sKmfa5fGty5t5veL1OyJBrUmSiRn1R1qfVDydrg== +"@typescript-eslint/experimental-utils@3.6.1", "@typescript-eslint/experimental-utils@^3.6.1": + version "3.6.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-3.6.1.tgz#b5a2738ebbceb3fa90c5b07d50bb1225403c4a54" + integrity sha512-oS+hihzQE5M84ewXrTlVx7eTgc52eu+sVmG7ayLfOhyZmJ8Unvf3osyFQNADHP26yoThFfbxcibbO0d2FjnYhg== dependencies: "@types/json-schema" "^7.0.3" - "@typescript-eslint/typescript-estree" "3.3.0" + "@typescript-eslint/types" "3.6.1" + "@typescript-eslint/typescript-estree" "3.6.1" eslint-scope "^5.0.0" eslint-utils "^2.0.0" -"@typescript-eslint/parser@^3.3.0": - version "3.3.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-3.3.0.tgz#fcae40012ded822aa8b2739a1a03a4e3c5bbb7bb" - integrity sha512-a7S0Sqn/+RpOOWTcaLw6RD4obsharzxmgMfdK24l364VxuBODXjuJM7ImCkSXEN7oz52aiZbXSbc76+2EsE91w== +"@typescript-eslint/parser@^3.6.1": + version "3.6.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-3.6.1.tgz#216e8adf4ee9c629f77c985476a2ea07fb80e1dc" + integrity sha512-SLihQU8RMe77YJ/jGTqOt0lMq7k3hlPVfp7v/cxMnXA9T0bQYoMDfTsNgHXpwSJM1Iq2aAJ8WqekxUwGv5F67Q== dependencies: "@types/eslint-visitor-keys" "^1.0.0" - "@typescript-eslint/experimental-utils" "3.3.0" - "@typescript-eslint/typescript-estree" "3.3.0" + "@typescript-eslint/experimental-utils" "3.6.1" + "@typescript-eslint/types" "3.6.1" + "@typescript-eslint/typescript-estree" "3.6.1" eslint-visitor-keys "^1.1.0" -"@typescript-eslint/typescript-estree@3.3.0": - version "3.3.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-3.3.0.tgz#841ffed25c29b0049ebffb4c2071268a34558a2a" - integrity sha512-3SqxylENltEvJsjjMSDCUx/edZNSC7wAqifUU1Ywp//0OWEZwMZJfecJud9XxJ/40rAKEbJMKBOQzeOjrLJFzQ== +"@typescript-eslint/types@3.6.1": + version "3.6.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-3.6.1.tgz#87600fe79a1874235d3cc1cf5c7e1a12eea69eee" + integrity sha512-NPxd5yXG63gx57WDTW1rp0cF3XlNuuFFB5G+Kc48zZ+51ZnQn9yjDEsjTPQ+aWM+V+Z0I4kuTFKjKvgcT1F7xQ== + +"@typescript-eslint/typescript-estree@3.6.1": + version "3.6.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-3.6.1.tgz#a5c91fcc5497cce7922ff86bc37d5e5891dcdefa" + integrity sha512-G4XRe/ZbCZkL1fy09DPN3U0mR6SayIv1zSeBNquRFRk7CnVLgkC2ZPj8llEMJg5Y8dJ3T76SvTGtceytniaztQ== dependencies: + "@typescript-eslint/types" "3.6.1" + "@typescript-eslint/visitor-keys" "3.6.1" debug "^4.1.1" - eslint-visitor-keys "^1.1.0" glob "^7.1.6" is-glob "^4.0.1" lodash "^4.17.15" semver "^7.3.2" tsutils "^3.17.1" -"@zerollup/ts-helpers@^1.7.18": - version "1.7.18" - resolved "https://registry.yarnpkg.com/@zerollup/ts-helpers/-/ts-helpers-1.7.18.tgz#747177f6d5abc06c3a0f5dffe7362d365cf0391d" - integrity sha512-S9zN+y+i5yN/evfWquzSO3lubqPXIsPQf6p9OiPMpRxDx/0totPLF39XoRw48Dav5dSvbIE8D2eAPpXXJxvKwg== +"@typescript-eslint/visitor-keys@3.6.1": + version "3.6.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-3.6.1.tgz#5c57a7772f4dd623cfeacc219303e7d46f963b37" + integrity sha512-qC8Olwz5ZyMTZrh4Wl3K4U6tfms0R/mzU4/5W3XeUZptVraGVmbptJbn6h2Ey6Rb3hOs3zWoAUebZk8t47KGiQ== dependencies: - resolve "^1.12.0" + eslint-visitor-keys "^1.1.0" JSONStream@^1.0.4, JSONStream@^1.3.4, JSONStream@^1.3.5: version "1.3.5" @@ -482,7 +518,7 @@ ansi-escapes@^3.2.0: resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-3.2.0.tgz#8780b98ff9dbf5638152d1f1fe5c1d7b4442976b" integrity sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ== -ansi-escapes@^4.2.1, ansi-escapes@^4.3.0, ansi-escapes@^4.3.1: +ansi-escapes@^4.3.0, ansi-escapes@^4.3.1: version "4.3.1" resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-4.3.1.tgz#a5c47cc43181f1f38ffd7076837700d395522a61" integrity sha512-JWF7ocqNrp8u9oqpgV+wH5ftbt+cfvv+PTjOvKLT3AdYly/LmORARfEVT1iyjwN+4MqE5UmVKoAdIBqeoCHgLA== @@ -952,14 +988,6 @@ chalk@2.4.2, chalk@^2.0.0, chalk@^2.0.1, chalk@^2.3.2, chalk@^2.4.1, chalk@^2.4. escape-string-regexp "^1.0.5" supports-color "^5.3.0" -chalk@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-3.0.0.tgz#3f73c2bf526591f574cc492c51e2456349f844e4" - integrity sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg== - dependencies: - ansi-styles "^4.1.0" - supports-color "^7.1.0" - chalk@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.0.0.tgz#6e98081ed2d17faab615eb52ac66ec1fe6209e72" @@ -1199,6 +1227,11 @@ commitizen@^4.0.3, commitizen@^4.1.2: strip-bom "4.0.0" strip-json-comments "3.0.1" +commondir@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b" + integrity sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs= + compare-func@^1.3.1: version "1.3.4" resolved "https://registry.yarnpkg.com/compare-func/-/compare-func-1.3.4.tgz#6b07c4c5e8341119baf44578085bda0f4a823516" @@ -1822,18 +1855,18 @@ eslint-module-utils@^2.6.0: debug "^2.6.9" pkg-dir "^2.0.0" -eslint-plugin-flowtype@^5.1.3: - version "5.1.3" - resolved "https://registry.yarnpkg.com/eslint-plugin-flowtype/-/eslint-plugin-flowtype-5.1.3.tgz#0c63694463b0e8b296975649d637dd39fdf9e877" - integrity sha512-UU+BbIxBflqJ171yxbd/HcOktCmOdhXbchIVIq/yBvKpLZXvfzNDOyJGcnuQYLaH840hdoIdU/bqxhoW6I0rIQ== +eslint-plugin-flowtype@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-flowtype/-/eslint-plugin-flowtype-5.2.0.tgz#a4bef5dc18f9b2bdb41569a4ab05d73805a3d261" + integrity sha512-z7ULdTxuhlRJcEe1MVljePXricuPOrsWfScRXFhNzVD5dmTHWjIF57AxD0e7AbEoLSbjSsaA5S+hCg43WvpXJQ== dependencies: lodash "^4.17.15" string-natural-compare "^3.0.1" -eslint-plugin-import@^2.21.2: - version "2.21.2" - resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.21.2.tgz#8fef77475cc5510801bedc95f84b932f7f334a7c" - integrity sha512-FEmxeGI6yaz+SnEB6YgNHlQK1Bs2DKLM+YF+vuTk5H8J9CLbJLtlPvRFgZZ2+sXiKAlN5dpdlrWOjK8ZoZJpQA== +eslint-plugin-import@^2.22.0: + version "2.22.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.22.0.tgz#92f7736fe1fde3e2de77623c838dd992ff5ffb7e" + integrity sha512-66Fpf1Ln6aIS5Gr/55ts19eUuoDhAbZgnr6UxK5hbDx6l/QgQgx61AePq+BV4PP2uXQFClgMVzep5zZ94qqsxg== dependencies: array-includes "^3.1.1" array.prototype.flat "^1.2.3" @@ -1881,10 +1914,10 @@ eslint-visitor-keys@^1.1.0, eslint-visitor-keys@^1.2.0: resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-1.2.0.tgz#74415ac884874495f78ec2a97349525344c981fa" integrity sha512-WFb4ihckKil6hu3Dp798xdzSfddwKKU3+nGniKF6HfeW6OLd2OUDEPP7TcHtB5+QXOKg2s6B2DaMPE1Nn/kxKQ== -eslint@^7.2.0: - version "7.2.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.2.0.tgz#d41b2e47804b30dbabb093a967fb283d560082e6" - integrity sha512-B3BtEyaDKC5MlfDa2Ha8/D6DsS4fju95zs0hjS3HdGazw+LNayai38A25qMppK37wWGWNYSPOR6oYzlz5MHsRQ== +eslint@^7.4.0: + version "7.4.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.4.0.tgz#4e35a2697e6c1972f9d6ef2b690ad319f80f206f" + integrity sha512-gU+lxhlPHu45H3JkEGgYhWhkR9wLHHEXC9FbWFnTlEkbKyZKWgWRLgf61E8zWmBuI6g5xKBph9ltg3NtZMVF8g== dependencies: "@babel/code-frame" "^7.0.0" ajv "^6.10.0" @@ -1892,6 +1925,7 @@ eslint@^7.2.0: cross-spawn "^7.0.2" debug "^4.0.1" doctrine "^3.0.0" + enquirer "^2.3.5" eslint-scope "^5.1.0" eslint-utils "^2.0.0" eslint-visitor-keys "^1.2.0" @@ -1905,7 +1939,6 @@ eslint@^7.2.0: ignore "^4.0.6" import-fresh "^3.0.0" imurmurhash "^0.1.4" - inquirer "^7.0.0" is-glob "^4.0.0" js-yaml "^3.13.1" json-stable-stringify-without-jsonify "^1.0.1" @@ -2102,6 +2135,18 @@ fast-glob@^3.1.1: micromatch "^4.0.2" picomatch "^2.2.1" +fast-glob@^3.2.4: + version "3.2.4" + resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.4.tgz#d20aefbf99579383e7f3cc66529158c9b98554d3" + integrity sha512-kr/Oo6PX51265qeuCYsyGypiO5uJFgBS0jksyG7FUeCyQzNwYnzrNIMR1NXfkZXsMYXYLRAHgISHBz8gQcxKHQ== + dependencies: + "@nodelib/fs.stat" "^2.0.2" + "@nodelib/fs.walk" "^1.2.3" + glob-parent "^5.1.0" + merge2 "^1.3.0" + micromatch "^4.0.2" + picomatch "^2.2.1" + fast-json-stable-stringify@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" @@ -2184,6 +2229,15 @@ fill-range@^7.0.1: dependencies: to-regex-range "^5.0.1" +find-cache-dir@^3.3.1: + version "3.3.1" + resolved "https://registry.yarnpkg.com/find-cache-dir/-/find-cache-dir-3.3.1.tgz#89b33fad4a4670daa94f855f7fbe31d6d84fe880" + integrity sha512-t2GDMt3oGC/v+BMwzmllWDuJF/xcDtE5j/fCGbqDD7OLuJkj0cfh1YSA5VKPvwMeLFLNDBkwOKZ2X85jGLVftQ== + dependencies: + commondir "^1.0.1" + make-dir "^3.0.2" + pkg-dir "^4.1.0" + find-node-modules@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/find-node-modules/-/find-node-modules-2.0.0.tgz#5db1fb9e668a3d451db3d618cd167cdd59e41b69" @@ -2452,15 +2506,16 @@ getpass@^0.1.1: dependencies: assert-plus "^1.0.0" -gh-pages@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/gh-pages/-/gh-pages-3.0.0.tgz#65f3ccd424bfbc7906f31c4bdb524a1147fa8da2" - integrity sha512-oaOfVcrSwnqoWUgZ6cmCDM6mUuWyOSG+SHjqxGBawN0F3SKaF5NwbeYDG+w2RNXO2HJ/5Iam4o7dP5NAtoHuwQ== +gh-pages@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/gh-pages/-/gh-pages-3.1.0.tgz#ec3ed0f6a6e3fc3d888758fa018f08191c96bd55" + integrity sha512-3b1rly9kuf3/dXsT8+ZxP0UhNLOo1CItj+3e31yUVcaph/yDsJ9RzD7JOw5o5zpBTJVQLlJAASNkUfepi9fe2w== dependencies: async "^2.6.1" commander "^2.18.0" email-addresses "^3.0.1" filenamify-url "^1.0.0" + find-cache-dir "^3.3.1" fs-extra "^8.1.0" globby "^6.1.0" @@ -2924,25 +2979,6 @@ inquirer@6.5.0: strip-ansi "^5.1.0" through "^2.3.6" -inquirer@^7.0.0: - version "7.2.0" - resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-7.2.0.tgz#63ce99d823090de7eb420e4bb05e6f3449aa389a" - integrity sha512-E0c4rPwr9ByePfNlTIB8z51kK1s2n6jrHuJeEHENl/sbq2G/S1auvibgEwNR4uSyiU+PiYHqSwsgGiXjG8p5ZQ== - dependencies: - ansi-escapes "^4.2.1" - chalk "^3.0.0" - cli-cursor "^3.1.0" - cli-width "^2.0.0" - external-editor "^3.0.3" - figures "^3.0.0" - lodash "^4.17.15" - mute-stream "0.0.8" - run-async "^2.4.0" - rxjs "^6.5.3" - string-width "^4.1.0" - strip-ansi "^6.0.0" - through "^2.3.6" - into-stream@^5.0.0: version "5.1.1" resolved "https://registry.yarnpkg.com/into-stream/-/into-stream-5.1.1.tgz#f9a20a348a11f3c13face22763f2d02e127f4db8" @@ -3781,6 +3817,13 @@ make-dir@^1.0.0: dependencies: pify "^3.0.0" +make-dir@^3.0.2: + version "3.1.0" + resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-3.1.0.tgz#415e967046b3a7f1d185277d84aa58203726a13f" + integrity sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw== + dependencies: + semver "^6.0.0" + make-error@^1.1.1: version "1.3.6" resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2" @@ -4062,7 +4105,7 @@ mute-stream@0.0.7: resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab" integrity sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s= -mute-stream@0.0.8, mute-stream@~0.0.4: +mute-stream@~0.0.4: version "0.0.8" resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.8.tgz#1630c42b2251ff81e2a283de96a5497ea92e5e0d" integrity sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA== @@ -4896,7 +4939,7 @@ pkg-dir@^2.0.0: dependencies: find-up "^2.1.0" -pkg-dir@^4.2.0: +pkg-dir@^4.1.0, pkg-dir@^4.2.0: version "4.2.0" resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-4.2.0.tgz#f099133df7ede422e81d1d8448270eeb3e4261f3" integrity sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ== @@ -5408,7 +5451,7 @@ rimraf@^3.0.2: dependencies: glob "^7.1.3" -run-async@^2.2.0, run-async@^2.4.0: +run-async@^2.2.0: version "2.4.1" resolved "https://registry.yarnpkg.com/run-async/-/run-async-2.4.1.tgz#8440eccf99ea3e70bd409d49aab88e10c189a455" integrity sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ== @@ -5425,7 +5468,7 @@ run-queue@^1.0.0, run-queue@^1.0.3: dependencies: aproba "^1.1.1" -rxjs@^6.4.0, rxjs@^6.5.3, rxjs@^6.5.5: +rxjs@^6.4.0, rxjs@^6.5.5: version "6.5.5" resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.5.5.tgz#c5c884e3094c8cfee31bf27eb87e54ccfc87f9ec" integrity sha512-WfQI+1gohdf0Dai/Bbmk5L5ItH5tYqm3ki2c5GdWhKjalzjg93N3avFjVStyZZz+A2Em+ZxKH5bNghw9UeylGQ== @@ -5454,10 +5497,10 @@ safe-regex@^1.1.0: resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== -semantic-release@^17.0.8: - version "17.0.8" - resolved "https://registry.yarnpkg.com/semantic-release/-/semantic-release-17.0.8.tgz#68b80461fdd8eb445228ae23fd9e85857a50ae3f" - integrity sha512-9KcdidiJ4xchrJXxPdaDQVlybgX0xTeKyVjRySYk5u9GpjibXD7E5F8cB0BvFLMDmMyrkCwcem0kFiaLD2VNPg== +semantic-release@^17.1.1: + version "17.1.1" + resolved "https://registry.yarnpkg.com/semantic-release/-/semantic-release-17.1.1.tgz#d9775968e841b2b7c5020559e4481aea8520ca75" + integrity sha512-9H+207eynBJElrQBHySZm+sIEoJeUhPA2zU4cdlY1QSInd2lnE8GRD2ALry9EassE22c9WW+aCREwBhro5AIIg== dependencies: "@semantic-release/commit-analyzer" "^8.0.0" "@semantic-release/error" "^2.2.0" @@ -6332,10 +6375,10 @@ typedarray@^0.0.6: resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= -typescript@^3.9.5: - version "3.9.5" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.9.5.tgz#586f0dba300cde8be52dd1ac4f7e1009c1b13f36" - integrity sha512-hSAifV3k+i6lEoCJ2k6R2Z/rp/H3+8sdmcn5NrS3/3kE7+RyZXm9aqvxWqjEXHAd8b0pShatpcdMTvEdvAJltQ== +typescript@^3.9.6: + version "3.9.6" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.9.6.tgz#8f3e0198a34c3ae17091b35571d3afd31999365a" + integrity sha512-Pspx3oKAPJtjNwE92YS05HQoY7z2SFyOpHo9MqJor3BXAGNaPUs83CuVp9VISFkSjyRfiTpmKuAYGJB7S7hOxw== uglify-js@^3.1.4: version "3.9.4"