From 3a15413d87a3429ebf19af2cc5db76c9e7ffe4e7 Mon Sep 17 00:00:00 2001 From: Brad Zacher Date: Tue, 24 Dec 2019 10:59:30 +1030 Subject: [PATCH 1/7] feat: add internal eslint plugin for repo-specific lint rules (#1373) There's a few things I want to enforce internally. Save us from having to communicate these things in PR reviews. ensuring people don't do import ts from 'typescript' in packages. this breaks compat with users that don't use allowSyntheticDefaultImports ensuring people don't accidentally do import {} from '@typescript-eslint/typescript-estree' from the plugins, where the package isn't a dependency. this breaks encapsulation, and will cause problems if we move things around in future Adding this in now reduces the barrier to entry, meaning we can easily add rules to warn against patterns we see people do in the future. --- .eslintrc.js | 24 ++++-- .vscode/launch.json | 16 ++++ packages/eslint-plugin-internal/README.md | 5 ++ .../eslint-plugin-internal/jest.config.js | 13 +++ packages/eslint-plugin-internal/package.json | 18 +++++ packages/eslint-plugin-internal/src/index.ts | 5 ++ .../eslint-plugin-internal/src/rules/index.ts | 7 ++ .../src/rules/no-typescript-default-import.ts | 80 +++++++++++++++++++ .../src/rules/no-typescript-estree-import.ts | 52 ++++++++++++ .../src/util/createRule.ts | 11 +++ .../eslint-plugin-internal/src/util/index.ts | 1 + .../tests/RuleTester.ts | 22 +++++ .../no-typescript-default-import.test.ts | 45 +++++++++++ .../tests/rules/no-typescript-estree.test.ts | 43 ++++++++++ .../tsconfig.build.json | 13 +++ packages/eslint-plugin-internal/tsconfig.json | 8 ++ .../eslint-plugin/src/rules/await-thenable.ts | 2 +- .../src/rules/no-for-in-array.ts | 2 +- .../src/rules/no-misused-promises.ts | 2 +- .../src/rules/no-unnecessary-condition.ts | 12 +-- .../src/rules/no-unnecessary-qualifier.ts | 2 +- .../rules/no-unnecessary-type-arguments.ts | 2 +- .../rules/no-unnecessary-type-assertion.ts | 2 +- .../src/rules/no-unused-vars-experimental.ts | 2 +- .../src/rules/prefer-includes.ts | 2 +- .../src/rules/prefer-nullish-coalescing.ts | 2 +- .../src/rules/prefer-readonly.ts | 2 +- .../src/rules/require-array-sort-compare.ts | 2 +- .../eslint-plugin/src/rules/require-await.ts | 2 +- .../src/rules/restrict-plus-operands.ts | 2 +- .../rules/restrict-template-expressions.ts | 2 +- .../eslint-plugin/src/rules/return-await.ts | 4 +- .../src/rules/strict-boolean-expressions.ts | 2 +- .../eslint-plugin/src/rules/unbound-method.ts | 2 +- packages/eslint-plugin/src/util/types.ts | 2 +- packages/experimental-utils/package.json | 1 - .../typescript-estree/src/convert-comments.ts | 2 +- packages/typescript-estree/src/convert.ts | 2 +- .../WatchCompilerHostOfConfigFile.ts | 2 +- .../create-program/createDefaultProgram.ts | 2 +- .../create-program/createIsolatedProgram.ts | 2 +- .../src/create-program/createSourceFile.ts | 2 +- .../src/create-program/createWatchProgram.ts | 2 +- .../src/create-program/shared.ts | 2 +- packages/typescript-estree/src/node-utils.ts | 2 +- packages/typescript-estree/src/parser.ts | 2 +- .../src/semantic-or-syntactic-errors.ts | 2 +- .../src/ts-estree/ts-nodes.ts | 2 +- .../typescript-estree/tests/lib/convert.ts | 2 +- .../tests/lib/semanticInfo.ts | 2 +- yarn.lock | 6 +- 51 files changed, 401 insertions(+), 47 deletions(-) create mode 100644 packages/eslint-plugin-internal/README.md create mode 100644 packages/eslint-plugin-internal/jest.config.js create mode 100644 packages/eslint-plugin-internal/package.json create mode 100644 packages/eslint-plugin-internal/src/index.ts create mode 100644 packages/eslint-plugin-internal/src/rules/index.ts create mode 100644 packages/eslint-plugin-internal/src/rules/no-typescript-default-import.ts create mode 100644 packages/eslint-plugin-internal/src/rules/no-typescript-estree-import.ts create mode 100644 packages/eslint-plugin-internal/src/util/createRule.ts create mode 100644 packages/eslint-plugin-internal/src/util/index.ts create mode 100644 packages/eslint-plugin-internal/tests/RuleTester.ts create mode 100644 packages/eslint-plugin-internal/tests/rules/no-typescript-default-import.test.ts create mode 100644 packages/eslint-plugin-internal/tests/rules/no-typescript-estree.test.ts create mode 100644 packages/eslint-plugin-internal/tsconfig.build.json create mode 100644 packages/eslint-plugin-internal/tsconfig.json diff --git a/.eslintrc.js b/.eslintrc.js index f505a7f012eb..4aa35ae4305f 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -6,6 +6,7 @@ module.exports = { 'jest', 'import', 'eslint-comments', + '@typescript-eslint/internal', ], env: { es6: true, @@ -117,6 +118,11 @@ module.exports = { 'import/no-self-import': 'error', // Require modules with a single export to use a default export 'import/prefer-default-export': 'off', // we want everything to be named + + // + // Internal repo rules + // + '@typescript-eslint/internal/no-typescript-default-import': 'error', }, parserOptions: { sourceType: 'module', @@ -127,8 +133,10 @@ module.exports = { tsconfigRootDir: __dirname, }, overrides: [ + // all test files { files: [ + 'packages/eslint-plugin-internal/tests/**/*.test.ts', 'packages/eslint-plugin-tslint/tests/**/*.ts', 'packages/eslint-plugin/tests/**/*.test.ts', 'packages/parser/tests/**/*.ts', @@ -138,6 +146,7 @@ module.exports = { 'jest/globals': true, }, rules: { + 'eslint-plugin/no-identical-tests': 'error', 'jest/no-disabled-tests': 'warn', 'jest/no-focused-tests': 'error', 'jest/no-alias-methods': 'error', @@ -152,26 +161,31 @@ module.exports = { 'jest/valid-expect': 'error', }, }, + // plugin source files { files: [ - 'packages/eslint-plugin/tests/**/*.test.ts', - 'packages/eslint-plugin-tslint/tests/**/*.spec.ts', + 'packages/eslint-plugin-internal/**/*.ts', + 'packages/eslint-plugin-tslint/**/*.ts', + 'packages/eslint-plugin/**/*.ts', ], rules: { - 'eslint-plugin/no-identical-tests': 'error', + '@typescript-eslint/internal/no-typescript-estree-import': 'error', }, }, + // rule source files { files: [ - 'packages/eslint-plugin/src/rules/**/*.ts', - 'packages/eslint-plugin/src/configs/**/*.ts', + 'packages/eslint-plugin-internal/src/rules/**/*.ts', 'packages/eslint-plugin-tslint/src/rules/**/*.ts', + 'packages/eslint-plugin/src/configs/**/*.ts', + 'packages/eslint-plugin/src/rules/**/*.ts', ], rules: { // specifically for rules - default exports makes the tooling easier 'import/no-default-export': 'off', }, }, + // tools and tests { files: ['**/tools/**/*.ts', '**/tests/**/*.ts'], rules: { diff --git a/.vscode/launch.json b/.vscode/launch.json index 6552aae66136..9f1633f32aba 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -20,6 +20,22 @@ "console": "integratedTerminal", "internalConsoleOptions": "neverOpen" }, + { + "type": "node", + "request": "launch", + "name": "Jest Test Current eslint-plugin-internal Rule", + "cwd": "${workspaceFolder}/packages/eslint-plugin-internal/", + "program": "${workspaceFolder}/node_modules/jest/bin/jest.js", + "args": [ + "--runInBand", + "--no-coverage", + // needs the '' around it so that the () are properly handled + "'tests/(.+/)?${fileBasenameNoExtension}'" + ], + "sourceMaps": true, + "console": "integratedTerminal", + "internalConsoleOptions": "neverOpen" + }, { "type": "node", "request": "launch", diff --git a/packages/eslint-plugin-internal/README.md b/packages/eslint-plugin-internal/README.md new file mode 100644 index 000000000000..bf6ed0bbe384 --- /dev/null +++ b/packages/eslint-plugin-internal/README.md @@ -0,0 +1,5 @@ +# `eslint-plugin-internal` + +This is just a collection of internal lint rules to help enforce some guidelines specific to this repository. + +These are not intended to be used externally. diff --git a/packages/eslint-plugin-internal/jest.config.js b/packages/eslint-plugin-internal/jest.config.js new file mode 100644 index 000000000000..b64d433b01aa --- /dev/null +++ b/packages/eslint-plugin-internal/jest.config.js @@ -0,0 +1,13 @@ +'use strict'; + +module.exports = { + testEnvironment: 'node', + transform: { + '^.+\\.tsx?$': 'ts-jest', + }, + testRegex: './tests/.+\\.test\\.ts$', + collectCoverage: false, + collectCoverageFrom: ['src/**/*.{js,jsx,ts,tsx}'], + moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node'], + coverageReporters: ['text-summary', 'lcov'], +}; diff --git a/packages/eslint-plugin-internal/package.json b/packages/eslint-plugin-internal/package.json new file mode 100644 index 000000000000..d8c69d15f6fa --- /dev/null +++ b/packages/eslint-plugin-internal/package.json @@ -0,0 +1,18 @@ +{ + "name": "@typescript-eslint/eslint-plugin-internal", + "version": "2.13.0", + "private": true, + "main": "dist/index.js", + "scripts": { + "build": "tsc -b tsconfig.build.json", + "clean": "tsc -b tsconfig.build.json --clean", + "format": "prettier --write \"./**/*.{ts,js,json,md}\" --ignore-path ../../.prettierignore", + "lint": "eslint . --ext .js,.ts --ignore-path='../../.eslintignore'", + "test": "jest --coverage", + "typecheck": "tsc -p tsconfig.json --noEmit" + }, + "dependencies": { + "@typescript-eslint/experimental-utils": "2.13.0" + }, + "devDependencies": {} +} diff --git a/packages/eslint-plugin-internal/src/index.ts b/packages/eslint-plugin-internal/src/index.ts new file mode 100644 index 000000000000..0802acef98a8 --- /dev/null +++ b/packages/eslint-plugin-internal/src/index.ts @@ -0,0 +1,5 @@ +import rules from './rules'; + +export = { + rules, +}; diff --git a/packages/eslint-plugin-internal/src/rules/index.ts b/packages/eslint-plugin-internal/src/rules/index.ts new file mode 100644 index 000000000000..800c448e041b --- /dev/null +++ b/packages/eslint-plugin-internal/src/rules/index.ts @@ -0,0 +1,7 @@ +import noTypescriptDefaultImport from './no-typescript-default-import'; +import noTypescriptEstreeImport from './no-typescript-estree-import'; + +export default { + 'no-typescript-default-import': noTypescriptDefaultImport, + 'no-typescript-estree-import': noTypescriptEstreeImport, +}; diff --git a/packages/eslint-plugin-internal/src/rules/no-typescript-default-import.ts b/packages/eslint-plugin-internal/src/rules/no-typescript-default-import.ts new file mode 100644 index 000000000000..ff4e35dc4f60 --- /dev/null +++ b/packages/eslint-plugin-internal/src/rules/no-typescript-default-import.ts @@ -0,0 +1,80 @@ +import { + TSESTree, + AST_NODE_TYPES, +} from '@typescript-eslint/experimental-utils'; +import { createRule } from '../util'; + +/* +We have `allowSyntheticDefaultImports` turned on in this project, so there are two problems that arise: +- TypeScript's auto import will suggest `import ts = require('typescript');` if you type `ts` +- VSCode's suggestion feature will suggest changing `import * as ts from 'typescript'` to `import ts from 'typescript'` + +In order to keep compatibility with a wide range of consumers, some of whom don't use `allowSyntheticDefaultImports`, we should +always use either: +- `import * as ts from 'typescript';` +- `import { SyntaxKind } from 'typescript';` +*/ + +export default createRule({ + name: 'no-typescript-default-import', + meta: { + type: 'problem', + docs: { + description: + "Enforces that packages rules don't do `import ts from 'typescript';`", + category: 'Possible Errors', + recommended: 'error', + }, + fixable: 'code', + schema: [], + messages: { + noTSDefaultImport: [ + "Do not use the default import for typescript. Doing so will cause the package's type definitions to do the same.", + "This causes errors for consumers if they don't use the allowSyntheticDefaultImports compiler option.", + ].join('\n'), + }, + }, + defaultOptions: [], + create(context) { + return { + 'ImportDeclaration > ImportDefaultSpecifier'( + node: TSESTree.ImportDefaultSpecifier, + ): void { + const importStatement = node.parent as TSESTree.ImportDeclaration; + if (importStatement.source.value === 'typescript') { + context.report({ + node, + messageId: 'noTSDefaultImport', + fix(fixer) { + if (importStatement.specifiers.length === 1) { + return fixer.replaceText(node, '* as ts'); + } + + return null; + }, + }); + } + }, + 'TSImportEqualsDeclaration > TSExternalModuleReference'( + node: TSESTree.TSExternalModuleReference, + ): void { + const parent = node.parent as TSESTree.TSImportEqualsDeclaration; + if ( + node.expression.type === AST_NODE_TYPES.Literal && + node.expression.value === 'typescript' + ) { + context.report({ + node, + messageId: 'noTSDefaultImport', + fix(fixer) { + return fixer.replaceText( + parent, + "import * as ts from 'typescript';", + ); + }, + }); + } + }, + }; + }, +}); diff --git a/packages/eslint-plugin-internal/src/rules/no-typescript-estree-import.ts b/packages/eslint-plugin-internal/src/rules/no-typescript-estree-import.ts new file mode 100644 index 000000000000..2a879c142094 --- /dev/null +++ b/packages/eslint-plugin-internal/src/rules/no-typescript-estree-import.ts @@ -0,0 +1,52 @@ +import { createRule } from '../util'; + +const TSESTREE_NAME = '@typescript-eslint/typescript-estree'; +const UTILS_NAME = '@typescript-eslint/experimental-utils'; + +/* +Typescript will not error if people use typescript-estree within eslint-plugin. +This is because it's an indirect dependency. +We don't want people to import it, instead we want them to import from the utils package. +*/ + +export default createRule({ + name: 'no-typescript-estree-import', + meta: { + type: 'problem', + docs: { + description: `Enforces that eslint-plugin rules don't require anything from ${TSESTREE_NAME}`, + category: 'Possible Errors', + recommended: 'error', + }, + fixable: 'code', + schema: [], + messages: { + dontImportTSEStree: [ + `Don't import from ${TSESTREE_NAME}. Everything you need should be available in ${UTILS_NAME}.`, + `${TSESTREE_NAME} is an indirect dependency of this package, and thus should not be used directly.`, + ].join('\n'), + }, + }, + defaultOptions: [], + create(context) { + return { + ImportDeclaration(node): void { + if ( + typeof node.source.value === 'string' && + node.source.value.startsWith(TSESTREE_NAME) + ) { + context.report({ + node, + messageId: 'dontImportTSEStree', + fix(fixer) { + return fixer.replaceTextRange( + [node.source.range[0] + 1, node.source.range[1] - 1], + UTILS_NAME, + ); + }, + }); + } + }, + }; + }, +}); diff --git a/packages/eslint-plugin-internal/src/util/createRule.ts b/packages/eslint-plugin-internal/src/util/createRule.ts new file mode 100644 index 000000000000..24c630d52450 --- /dev/null +++ b/packages/eslint-plugin-internal/src/util/createRule.ts @@ -0,0 +1,11 @@ +import { ESLintUtils } from '@typescript-eslint/experimental-utils'; + +// note - cannot migrate this to an import statement because it will make TSC copy the package.json to the dist folder +const version = require('../../package.json').version; + +const createRule = ESLintUtils.RuleCreator( + name => + `https://github.com/typescript-eslint/typescript-eslint/blob/v${version}/packages/eslint-plugin-internal/src/rules/${name}.ts`, +); + +export { createRule }; diff --git a/packages/eslint-plugin-internal/src/util/index.ts b/packages/eslint-plugin-internal/src/util/index.ts new file mode 100644 index 000000000000..cd13da0f5cd3 --- /dev/null +++ b/packages/eslint-plugin-internal/src/util/index.ts @@ -0,0 +1 @@ +export * from './createRule'; diff --git a/packages/eslint-plugin-internal/tests/RuleTester.ts b/packages/eslint-plugin-internal/tests/RuleTester.ts new file mode 100644 index 000000000000..daef7ec9a8be --- /dev/null +++ b/packages/eslint-plugin-internal/tests/RuleTester.ts @@ -0,0 +1,22 @@ +import { TSESLint, ESLintUtils } from '@typescript-eslint/experimental-utils'; + +const { batchedSingleLineTests } = ESLintUtils; + +const parser = '@typescript-eslint/parser'; + +type RuleTesterConfig = Omit & { + parser: typeof parser; +}; +class RuleTester extends TSESLint.RuleTester { + // as of eslint 6 you have to provide an absolute path to the parser + // but that's not as clean to type, this saves us trying to manually enforce + // that contributors require.resolve everything + constructor(options: RuleTesterConfig) { + super({ + ...options, + parser: require.resolve(options.parser), + }); + } +} + +export { RuleTester, batchedSingleLineTests }; diff --git a/packages/eslint-plugin-internal/tests/rules/no-typescript-default-import.test.ts b/packages/eslint-plugin-internal/tests/rules/no-typescript-default-import.test.ts new file mode 100644 index 000000000000..3c8db9e66510 --- /dev/null +++ b/packages/eslint-plugin-internal/tests/rules/no-typescript-default-import.test.ts @@ -0,0 +1,45 @@ +import rule from '../../src/rules/no-typescript-default-import'; +import { RuleTester, batchedSingleLineTests } from '../RuleTester'; + +const ruleTester = new RuleTester({ + parser: '@typescript-eslint/parser', + parserOptions: { + sourceType: 'module', + }, +}); + +ruleTester.run('no-typescript-default-import', rule, { + valid: [ + "import { foo } from 'typescript';", + "import ts from 'nottypescript';", + "import * as foo from 'typescript';", + 'import ts = foo;', + "import ts = require('nottypescript');", + ], + invalid: batchedSingleLineTests({ + code: ` +import ts from 'typescript'; +import ts, { SyntaxKind } from 'typescript'; +import ts = require('typescript'); + `, + output: ` +import * as ts from 'typescript'; +import ts, { SyntaxKind } from 'typescript'; +import * as ts from 'typescript'; + `, + errors: [ + { + messageId: 'noTSDefaultImport', + line: 2, + }, + { + messageId: 'noTSDefaultImport', + line: 3, + }, + { + messageId: 'noTSDefaultImport', + line: 4, + }, + ], + }), +}); diff --git a/packages/eslint-plugin-internal/tests/rules/no-typescript-estree.test.ts b/packages/eslint-plugin-internal/tests/rules/no-typescript-estree.test.ts new file mode 100644 index 000000000000..a76e03b7c1d5 --- /dev/null +++ b/packages/eslint-plugin-internal/tests/rules/no-typescript-estree.test.ts @@ -0,0 +1,43 @@ +import rule from '../../src/rules/no-typescript-estree-import'; +import { RuleTester, batchedSingleLineTests } from '../RuleTester'; + +const ruleTester = new RuleTester({ + parser: '@typescript-eslint/parser', + parserOptions: { + sourceType: 'module', + }, +}); + +ruleTester.run('no-typescript-estree-import', rule, { + valid: [ + 'import { foo } from "@typescript-eslint/experimental-utils";', + 'import foo from "@typescript-eslint/experimental-utils";', + 'import * as foo from "@typescript-eslint/experimental-utils";', + ], + invalid: batchedSingleLineTests({ + code: ` +import { foo } from "@typescript-eslint/typescript-estree"; +import foo from "@typescript-eslint/typescript-estree"; +import * as foo from "@typescript-eslint/typescript-estree"; + `, + output: ` +import { foo } from "@typescript-eslint/experimental-utils"; +import foo from "@typescript-eslint/experimental-utils"; +import * as foo from "@typescript-eslint/experimental-utils"; + `, + errors: [ + { + messageId: 'dontImportTSEStree', + line: 2, + }, + { + messageId: 'dontImportTSEStree', + line: 3, + }, + { + messageId: 'dontImportTSEStree', + line: 4, + }, + ], + }), +}); diff --git a/packages/eslint-plugin-internal/tsconfig.build.json b/packages/eslint-plugin-internal/tsconfig.build.json new file mode 100644 index 000000000000..b40961d2d9a1 --- /dev/null +++ b/packages/eslint-plugin-internal/tsconfig.build.json @@ -0,0 +1,13 @@ +{ + "extends": "../../tsconfig.base.json", + "compilerOptions": { + // specifically disable declarations for the plugin + "declaration": false, + "declarationMap": false, + "outDir": "./dist", + "rootDir": "./src", + "resolveJsonModule": true + }, + "include": ["src", "typings"], + "references": [{ "path": "../experimental-utils/tsconfig.build.json" }] +} diff --git a/packages/eslint-plugin-internal/tsconfig.json b/packages/eslint-plugin-internal/tsconfig.json new file mode 100644 index 000000000000..6fddcebe2ae5 --- /dev/null +++ b/packages/eslint-plugin-internal/tsconfig.json @@ -0,0 +1,8 @@ +{ + "extends": "./tsconfig.build.json", + "compilerOptions": { + "composite": false, + "rootDir": "." + }, + "include": ["src", "typings", "tests"] +} diff --git a/packages/eslint-plugin/src/rules/await-thenable.ts b/packages/eslint-plugin/src/rules/await-thenable.ts index 94dc75cf78d7..f5b06b683f46 100644 --- a/packages/eslint-plugin/src/rules/await-thenable.ts +++ b/packages/eslint-plugin/src/rules/await-thenable.ts @@ -1,5 +1,5 @@ import * as tsutils from 'tsutils'; -import ts from 'typescript'; +import * as ts from 'typescript'; import * as util from '../util'; diff --git a/packages/eslint-plugin/src/rules/no-for-in-array.ts b/packages/eslint-plugin/src/rules/no-for-in-array.ts index db15d310457c..b93665069c71 100644 --- a/packages/eslint-plugin/src/rules/no-for-in-array.ts +++ b/packages/eslint-plugin/src/rules/no-for-in-array.ts @@ -1,4 +1,4 @@ -import ts from 'typescript'; +import * as ts from 'typescript'; import * as util from '../util'; export default util.createRule({ diff --git a/packages/eslint-plugin/src/rules/no-misused-promises.ts b/packages/eslint-plugin/src/rules/no-misused-promises.ts index 50d6cf9201a5..5326129780cf 100644 --- a/packages/eslint-plugin/src/rules/no-misused-promises.ts +++ b/packages/eslint-plugin/src/rules/no-misused-promises.ts @@ -1,6 +1,6 @@ import { TSESLint, TSESTree } from '@typescript-eslint/experimental-utils'; import * as tsutils from 'tsutils'; -import ts from 'typescript'; +import * as ts from 'typescript'; import * as util from '../util'; diff --git a/packages/eslint-plugin/src/rules/no-unnecessary-condition.ts b/packages/eslint-plugin/src/rules/no-unnecessary-condition.ts index 5c884f4506ca..ba77f30e1f9f 100644 --- a/packages/eslint-plugin/src/rules/no-unnecessary-condition.ts +++ b/packages/eslint-plugin/src/rules/no-unnecessary-condition.ts @@ -3,7 +3,7 @@ import { AST_NODE_TYPES, AST_TOKEN_TYPES, } from '@typescript-eslint/experimental-utils'; -import ts, { TypeFlags } from 'typescript'; +import * as ts from 'typescript'; import { isTypeFlagSet, unionTypeParts, @@ -139,13 +139,15 @@ export default createRule({ unionTypeParts(type).some(part => isTypeFlagSet( part, - TypeFlags.Any | TypeFlags.Unknown | ts.TypeFlags.TypeParameter, + ts.TypeFlags.Any | + ts.TypeFlags.Unknown | + ts.TypeFlags.TypeParameter, ), ) ) { return; } - const messageId = isTypeFlagSet(type, TypeFlags.Never) + const messageId = isTypeFlagSet(type, ts.TypeFlags.Never) ? 'never' : !isPossiblyTruthy(type) ? 'alwaysFalsy' @@ -161,10 +163,10 @@ export default createRule({ function checkNodeForNullish(node: TSESTree.Node): void { const type = getNodeType(node); // Conditional is always necessary if it involves `any` or `unknown` - if (isTypeFlagSet(type, TypeFlags.Any | TypeFlags.Unknown)) { + if (isTypeFlagSet(type, ts.TypeFlags.Any | ts.TypeFlags.Unknown)) { return; } - const messageId = isTypeFlagSet(type, TypeFlags.Never) + const messageId = isTypeFlagSet(type, ts.TypeFlags.Never) ? 'never' : !isPossiblyNullish(type) ? 'neverNullish' diff --git a/packages/eslint-plugin/src/rules/no-unnecessary-qualifier.ts b/packages/eslint-plugin/src/rules/no-unnecessary-qualifier.ts index dbf07b46848d..f489fd3c3318 100644 --- a/packages/eslint-plugin/src/rules/no-unnecessary-qualifier.ts +++ b/packages/eslint-plugin/src/rules/no-unnecessary-qualifier.ts @@ -2,7 +2,7 @@ import { AST_NODE_TYPES, TSESTree, } from '@typescript-eslint/experimental-utils'; -import ts from 'typescript'; +import * as ts from 'typescript'; import * as tsutils from 'tsutils'; import * as util from '../util'; diff --git a/packages/eslint-plugin/src/rules/no-unnecessary-type-arguments.ts b/packages/eslint-plugin/src/rules/no-unnecessary-type-arguments.ts index c5c439c7bd0f..3ccca4f74a04 100644 --- a/packages/eslint-plugin/src/rules/no-unnecessary-type-arguments.ts +++ b/packages/eslint-plugin/src/rules/no-unnecessary-type-arguments.ts @@ -1,6 +1,6 @@ import { TSESTree } from '@typescript-eslint/experimental-utils'; import * as tsutils from 'tsutils'; -import ts from 'typescript'; +import * as ts from 'typescript'; import * as util from '../util'; import { findFirstResult } from '../util'; diff --git a/packages/eslint-plugin/src/rules/no-unnecessary-type-assertion.ts b/packages/eslint-plugin/src/rules/no-unnecessary-type-assertion.ts index 29f98bdedf00..542e937f5307 100644 --- a/packages/eslint-plugin/src/rules/no-unnecessary-type-assertion.ts +++ b/packages/eslint-plugin/src/rules/no-unnecessary-type-assertion.ts @@ -10,7 +10,7 @@ import { isTypeFlagSet, isVariableDeclaration, } from 'tsutils'; -import ts from 'typescript'; +import * as ts from 'typescript'; import * as util from '../util'; type Options = [ diff --git a/packages/eslint-plugin/src/rules/no-unused-vars-experimental.ts b/packages/eslint-plugin/src/rules/no-unused-vars-experimental.ts index 1f75e1f026f0..359397efdc73 100644 --- a/packages/eslint-plugin/src/rules/no-unused-vars-experimental.ts +++ b/packages/eslint-plugin/src/rules/no-unused-vars-experimental.ts @@ -1,7 +1,7 @@ /* eslint-disable no-fallthrough */ import { TSESTree } from '@typescript-eslint/experimental-utils'; -import ts from 'typescript'; +import * as ts from 'typescript'; import * as util from '../util'; export type Options = [ diff --git a/packages/eslint-plugin/src/rules/prefer-includes.ts b/packages/eslint-plugin/src/rules/prefer-includes.ts index 9577420fb9e1..0cd54d6c7869 100644 --- a/packages/eslint-plugin/src/rules/prefer-includes.ts +++ b/packages/eslint-plugin/src/rules/prefer-includes.ts @@ -4,7 +4,7 @@ import { } from '@typescript-eslint/experimental-utils'; import { getStaticValue } from 'eslint-utils'; import { AST as RegExpAST, parseRegExpLiteral } from 'regexpp'; -import ts from 'typescript'; +import * as ts from 'typescript'; import { createRule, getParserServices } from '../util'; export default createRule({ diff --git a/packages/eslint-plugin/src/rules/prefer-nullish-coalescing.ts b/packages/eslint-plugin/src/rules/prefer-nullish-coalescing.ts index e0beb74c79c6..805f17d4f60c 100644 --- a/packages/eslint-plugin/src/rules/prefer-nullish-coalescing.ts +++ b/packages/eslint-plugin/src/rules/prefer-nullish-coalescing.ts @@ -4,7 +4,7 @@ import { TSESLint, TSESTree, } from '@typescript-eslint/experimental-utils'; -import ts from 'typescript'; +import * as ts from 'typescript'; import * as util from '../util'; export type Options = [ diff --git a/packages/eslint-plugin/src/rules/prefer-readonly.ts b/packages/eslint-plugin/src/rules/prefer-readonly.ts index 4620d89cde4a..d2aa135b99f4 100644 --- a/packages/eslint-plugin/src/rules/prefer-readonly.ts +++ b/packages/eslint-plugin/src/rules/prefer-readonly.ts @@ -1,5 +1,5 @@ import * as tsutils from 'tsutils'; -import ts from 'typescript'; +import * as ts from 'typescript'; import * as util from '../util'; import { typeIsOrHasBaseType } from '../util'; import { diff --git a/packages/eslint-plugin/src/rules/require-array-sort-compare.ts b/packages/eslint-plugin/src/rules/require-array-sort-compare.ts index 1d220702e04b..580b36f591d6 100644 --- a/packages/eslint-plugin/src/rules/require-array-sort-compare.ts +++ b/packages/eslint-plugin/src/rules/require-array-sort-compare.ts @@ -1,5 +1,5 @@ import { TSESTree } from '@typescript-eslint/experimental-utils'; -import ts from 'typescript'; +import * as ts from 'typescript'; import * as util from '../util'; export default util.createRule({ diff --git a/packages/eslint-plugin/src/rules/require-await.ts b/packages/eslint-plugin/src/rules/require-await.ts index 4db47f9e075b..53c43e7a6b93 100644 --- a/packages/eslint-plugin/src/rules/require-await.ts +++ b/packages/eslint-plugin/src/rules/require-await.ts @@ -4,7 +4,7 @@ import { } from '@typescript-eslint/experimental-utils'; import baseRule from 'eslint/lib/rules/require-await'; import * as tsutils from 'tsutils'; -import ts from 'typescript'; +import * as ts from 'typescript'; import * as util from '../util'; type Options = util.InferOptionsTypeFromRule; diff --git a/packages/eslint-plugin/src/rules/restrict-plus-operands.ts b/packages/eslint-plugin/src/rules/restrict-plus-operands.ts index c41587a169ac..f07e624eeb23 100644 --- a/packages/eslint-plugin/src/rules/restrict-plus-operands.ts +++ b/packages/eslint-plugin/src/rules/restrict-plus-operands.ts @@ -1,5 +1,5 @@ import { TSESTree } from '@typescript-eslint/experimental-utils'; -import ts from 'typescript'; +import * as ts from 'typescript'; import * as util from '../util'; type Options = [ diff --git a/packages/eslint-plugin/src/rules/restrict-template-expressions.ts b/packages/eslint-plugin/src/rules/restrict-template-expressions.ts index 199664036c99..efedc786b512 100644 --- a/packages/eslint-plugin/src/rules/restrict-template-expressions.ts +++ b/packages/eslint-plugin/src/rules/restrict-template-expressions.ts @@ -2,7 +2,7 @@ import { TSESTree, AST_NODE_TYPES, } from '@typescript-eslint/experimental-utils'; -import ts from 'typescript'; +import * as ts from 'typescript'; import * as util from '../util'; type Options = [ diff --git a/packages/eslint-plugin/src/rules/return-await.ts b/packages/eslint-plugin/src/rules/return-await.ts index 6594007651cc..762d697fdbb5 100644 --- a/packages/eslint-plugin/src/rules/return-await.ts +++ b/packages/eslint-plugin/src/rules/return-await.ts @@ -3,7 +3,7 @@ import { TSESTree, } from '@typescript-eslint/experimental-utils'; import * as tsutils from 'tsutils'; -import ts, { SyntaxKind } from 'typescript'; +import * as ts from 'typescript'; import * as util from '../util'; export default util.createRule({ @@ -59,7 +59,7 @@ export default util.createRule({ ): void { let child: ts.Node; - const isAwait = expression.kind === SyntaxKind.AwaitExpression; + const isAwait = expression.kind === ts.SyntaxKind.AwaitExpression; if (isAwait) { child = expression.getChildAt(1); diff --git a/packages/eslint-plugin/src/rules/strict-boolean-expressions.ts b/packages/eslint-plugin/src/rules/strict-boolean-expressions.ts index 1b0d0de9462c..e33b9c8a39e6 100644 --- a/packages/eslint-plugin/src/rules/strict-boolean-expressions.ts +++ b/packages/eslint-plugin/src/rules/strict-boolean-expressions.ts @@ -2,7 +2,7 @@ import { TSESTree, AST_NODE_TYPES, } from '@typescript-eslint/experimental-utils'; -import ts from 'typescript'; +import * as ts from 'typescript'; import * as tsutils from 'tsutils'; import * as util from '../util'; diff --git a/packages/eslint-plugin/src/rules/unbound-method.ts b/packages/eslint-plugin/src/rules/unbound-method.ts index 16ee4787760b..ac4dd6b28de3 100644 --- a/packages/eslint-plugin/src/rules/unbound-method.ts +++ b/packages/eslint-plugin/src/rules/unbound-method.ts @@ -3,7 +3,7 @@ import { TSESTree, } from '@typescript-eslint/experimental-utils'; import * as tsutils from 'tsutils'; -import ts from 'typescript'; +import * as ts from 'typescript'; import * as util from '../util'; //------------------------------------------------------------------------------ diff --git a/packages/eslint-plugin/src/util/types.ts b/packages/eslint-plugin/src/util/types.ts index 6a3644acbb54..e53bfb355314 100644 --- a/packages/eslint-plugin/src/util/types.ts +++ b/packages/eslint-plugin/src/util/types.ts @@ -3,7 +3,7 @@ import { isUnionOrIntersectionType, unionTypeParts, } from 'tsutils'; -import ts from 'typescript'; +import * as ts from 'typescript'; /** * @param type Type being checked by name. diff --git a/packages/experimental-utils/package.json b/packages/experimental-utils/package.json index 279e8d06bca2..8cd63e5bfef1 100644 --- a/packages/experimental-utils/package.json +++ b/packages/experimental-utils/package.json @@ -26,7 +26,6 @@ }, "license": "MIT", "main": "dist/index.js", - "types": "dist/index.d.ts", "scripts": { "build": "tsc -b tsconfig.build.json", "clean": "tsc -b tsconfig.build.json --clean", diff --git a/packages/typescript-estree/src/convert-comments.ts b/packages/typescript-estree/src/convert-comments.ts index a82d9941dbd3..753e82f7b558 100644 --- a/packages/typescript-estree/src/convert-comments.ts +++ b/packages/typescript-estree/src/convert-comments.ts @@ -1,4 +1,4 @@ -import * as ts from 'typescript'; // leave this as * as ts so people using util package don't need syntheticDefaultImports +import * as ts from 'typescript'; import { forEachComment } from 'tsutils/util/util'; import { getLocFor } from './node-utils'; import { TSESTree } from './ts-estree'; diff --git a/packages/typescript-estree/src/convert.ts b/packages/typescript-estree/src/convert.ts index af48546d7f8d..f65ac54867aa 100644 --- a/packages/typescript-estree/src/convert.ts +++ b/packages/typescript-estree/src/convert.ts @@ -1,6 +1,6 @@ // There's lots of funny stuff due to the typing of ts.Node /* eslint-disable @typescript-eslint/no-explicit-any */ -import * as ts from 'typescript'; // leave this as * as ts so people using util package don't need syntheticDefaultImports +import * as ts from 'typescript'; import { canContainDirective, createError, diff --git a/packages/typescript-estree/src/create-program/WatchCompilerHostOfConfigFile.ts b/packages/typescript-estree/src/create-program/WatchCompilerHostOfConfigFile.ts index 7fb4663b985c..471a6d6b6fe6 100644 --- a/packages/typescript-estree/src/create-program/WatchCompilerHostOfConfigFile.ts +++ b/packages/typescript-estree/src/create-program/WatchCompilerHostOfConfigFile.ts @@ -2,7 +2,7 @@ // They have been trimmed down to only include the relevant bits // We use some special internal TS apis to help us do our parsing flexibly -import * as ts from 'typescript'; // leave this as * as ts so people using util package don't need syntheticDefaultImports +import * as ts from 'typescript'; // https://github.com/microsoft/TypeScript/blob/b84e65db4ea5c39dbaa2ccd6594efe4653318251/src/compiler/watchUtilities.ts#L6-L18 interface DirectoryStructureHost { diff --git a/packages/typescript-estree/src/create-program/createDefaultProgram.ts b/packages/typescript-estree/src/create-program/createDefaultProgram.ts index 383d10bd43d3..11a6638d711c 100644 --- a/packages/typescript-estree/src/create-program/createDefaultProgram.ts +++ b/packages/typescript-estree/src/create-program/createDefaultProgram.ts @@ -1,6 +1,6 @@ import debug from 'debug'; import path from 'path'; -import * as ts from 'typescript'; // leave this as * as ts so people using util package don't need syntheticDefaultImports +import * as ts from 'typescript'; import { Extra } from '../parser-options'; import { getTsconfigPath, diff --git a/packages/typescript-estree/src/create-program/createIsolatedProgram.ts b/packages/typescript-estree/src/create-program/createIsolatedProgram.ts index 296aee2e5ba0..c6c74b8c5ab9 100644 --- a/packages/typescript-estree/src/create-program/createIsolatedProgram.ts +++ b/packages/typescript-estree/src/create-program/createIsolatedProgram.ts @@ -1,5 +1,5 @@ import debug from 'debug'; -import * as ts from 'typescript'; // leave this as * as ts so people using util package don't need syntheticDefaultImports +import * as ts from 'typescript'; import { Extra } from '../parser-options'; import { ASTAndProgram, diff --git a/packages/typescript-estree/src/create-program/createSourceFile.ts b/packages/typescript-estree/src/create-program/createSourceFile.ts index d1ab5f98d21a..70820c1d2172 100644 --- a/packages/typescript-estree/src/create-program/createSourceFile.ts +++ b/packages/typescript-estree/src/create-program/createSourceFile.ts @@ -1,5 +1,5 @@ import debug from 'debug'; -import * as ts from 'typescript'; // leave this as * as ts so people using util package don't need syntheticDefaultImports +import * as ts from 'typescript'; import { Extra } from '../parser-options'; import { getScriptKind } from './shared'; diff --git a/packages/typescript-estree/src/create-program/createWatchProgram.ts b/packages/typescript-estree/src/create-program/createWatchProgram.ts index 73dc8ec426e6..72b5535c5783 100644 --- a/packages/typescript-estree/src/create-program/createWatchProgram.ts +++ b/packages/typescript-estree/src/create-program/createWatchProgram.ts @@ -1,6 +1,6 @@ import debug from 'debug'; import fs from 'fs'; -import * as ts from 'typescript'; // leave this as * as ts so people using util package don't need syntheticDefaultImports +import * as ts from 'typescript'; import { Extra } from '../parser-options'; import { WatchCompilerHostOfConfigFile } from './WatchCompilerHostOfConfigFile'; import { diff --git a/packages/typescript-estree/src/create-program/shared.ts b/packages/typescript-estree/src/create-program/shared.ts index 1ba44449867d..b828478073e2 100644 --- a/packages/typescript-estree/src/create-program/shared.ts +++ b/packages/typescript-estree/src/create-program/shared.ts @@ -1,5 +1,5 @@ import path from 'path'; -import * as ts from 'typescript'; // leave this as * as ts so people using util package don't need syntheticDefaultImports +import * as ts from 'typescript'; import { Extra } from '../parser-options'; interface ASTAndProgram { diff --git a/packages/typescript-estree/src/node-utils.ts b/packages/typescript-estree/src/node-utils.ts index f9abf8cca233..1995bbf57c56 100644 --- a/packages/typescript-estree/src/node-utils.ts +++ b/packages/typescript-estree/src/node-utils.ts @@ -1,5 +1,5 @@ import unescape from 'lodash.unescape'; -import * as ts from 'typescript'; // leave this as * as ts so people using util package don't need syntheticDefaultImports +import * as ts from 'typescript'; import { AST_NODE_TYPES, AST_TOKEN_TYPES, TSESTree } from './ts-estree'; const SyntaxKind = ts.SyntaxKind; diff --git a/packages/typescript-estree/src/parser.ts b/packages/typescript-estree/src/parser.ts index 27a10024dc8b..882249b6bdd5 100644 --- a/packages/typescript-estree/src/parser.ts +++ b/packages/typescript-estree/src/parser.ts @@ -1,5 +1,5 @@ import semver from 'semver'; -import * as ts from 'typescript'; // leave this as * as ts so people using util package don't need syntheticDefaultImports +import * as ts from 'typescript'; import { sync as globSync } from 'glob'; import isGlob from 'is-glob'; import { astConverter } from './ast-converter'; diff --git a/packages/typescript-estree/src/semantic-or-syntactic-errors.ts b/packages/typescript-estree/src/semantic-or-syntactic-errors.ts index d2b61efc856d..f8a6e5be4671 100644 --- a/packages/typescript-estree/src/semantic-or-syntactic-errors.ts +++ b/packages/typescript-estree/src/semantic-or-syntactic-errors.ts @@ -1,4 +1,4 @@ -import * as ts from 'typescript'; // leave this as * as ts so people using util package don't need syntheticDefaultImports +import * as ts from 'typescript'; interface SemanticOrSyntacticError extends ts.Diagnostic { message: string; diff --git a/packages/typescript-estree/src/ts-estree/ts-nodes.ts b/packages/typescript-estree/src/ts-estree/ts-nodes.ts index fbf10048157e..eb99af207807 100644 --- a/packages/typescript-estree/src/ts-estree/ts-nodes.ts +++ b/packages/typescript-estree/src/ts-estree/ts-nodes.ts @@ -1,4 +1,4 @@ -import * as ts from 'typescript'; // leave this as * as ts so people using util package don't need syntheticDefaultImports +import * as ts from 'typescript'; export type TSNode = ts.Node & ( diff --git a/packages/typescript-estree/tests/lib/convert.ts b/packages/typescript-estree/tests/lib/convert.ts index 71158dfb8256..e4217be7d222 100644 --- a/packages/typescript-estree/tests/lib/convert.ts +++ b/packages/typescript-estree/tests/lib/convert.ts @@ -1,7 +1,7 @@ // deeplyCopy is private internal /* eslint-disable @typescript-eslint/no-explicit-any */ import { Converter } from '../../src/convert'; -import ts from 'typescript'; +import * as ts from 'typescript'; describe('convert', () => { function convertCode(code: string): ts.SourceFile { diff --git a/packages/typescript-estree/tests/lib/semanticInfo.ts b/packages/typescript-estree/tests/lib/semanticInfo.ts index 05e65137db43..3a99890c401f 100644 --- a/packages/typescript-estree/tests/lib/semanticInfo.ts +++ b/packages/typescript-estree/tests/lib/semanticInfo.ts @@ -1,7 +1,7 @@ import { readFileSync } from 'fs'; import glob from 'glob'; import { extname, join, resolve } from 'path'; -import ts from 'typescript'; +import * as ts from 'typescript'; import { TSESTreeOptions } from '../../src/parser-options'; import { createSnapshotTestBlock, diff --git a/yarn.lock b/yarn.lock index d32b5a041415..154b6b2e23ab 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7949,9 +7949,9 @@ typedarray@^0.0.6: integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= typescript@*, "typescript@>=3.2.1 <3.8.0", typescript@^3.7.2: - version "3.7.2" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.7.2.tgz#27e489b95fa5909445e9fef5ee48d81697ad18fb" - integrity sha512-ml7V7JfiN2Xwvcer+XAf2csGO1bPBdRbFCkYBczNZggrBZ9c7G3riSUeJmqEU5uOtXNPMhE3n+R4FA/3YOAWOQ== + version "3.7.4" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.7.4.tgz#1743a5ec5fef6a1fa9f3e4708e33c81c73876c19" + integrity sha512-A25xv5XCtarLwXpcDNZzCGvW2D1S3/bACratYBx2sax8PefsFhlYmkQicKHvpYflFS8if4zne5zT5kpJ7pzuvw== uglify-js@^3.1.4: version "3.6.0" From f40639e13361fff4c50945a390a6e1da70ff5180 Mon Sep 17 00:00:00 2001 From: Armano Date: Tue, 24 Dec 2019 03:35:34 +0100 Subject: [PATCH 2/7] fix(eslint-plugin): type assertion in rule no-extra-parens (#1376) --- .../src/rules/no-extra-parens.ts | 13 ++-- .../tests/rules/no-extra-parens.test.ts | 64 ++++++++++++++++++- 2 files changed, 72 insertions(+), 5 deletions(-) diff --git a/packages/eslint-plugin/src/rules/no-extra-parens.ts b/packages/eslint-plugin/src/rules/no-extra-parens.ts index 38c5e3134cf6..d4fe9afd54be 100644 --- a/packages/eslint-plugin/src/rules/no-extra-parens.ts +++ b/packages/eslint-plugin/src/rules/no-extra-parens.ts @@ -35,21 +35,26 @@ export default util.createRule({ const rule = rules.BinaryExpression as (n: typeof node) => void; // makes the rule think it should skip the left or right - if (util.isTypeAssertion(node.left)) { + const isLeftTypeAssertion = util.isTypeAssertion(node.left); + const isRightTypeAssertion = util.isTypeAssertion(node.right); + if (isLeftTypeAssertion && isRightTypeAssertion) { + return; // ignore + } + if (isLeftTypeAssertion) { return rule({ ...node, left: { ...node.left, - type: AST_NODE_TYPES.BinaryExpression as any, + type: AST_NODE_TYPES.SequenceExpression as any, }, }); } - if (util.isTypeAssertion(node.right)) { + if (isRightTypeAssertion) { return rule({ ...node, right: { ...node.right, - type: AST_NODE_TYPES.BinaryExpression as any, + type: AST_NODE_TYPES.SequenceExpression as any, }, }); } diff --git a/packages/eslint-plugin/tests/rules/no-extra-parens.test.ts b/packages/eslint-plugin/tests/rules/no-extra-parens.test.ts index 6d84149efb8d..29afab88ec55 100644 --- a/packages/eslint-plugin/tests/rules/no-extra-parens.test.ts +++ b/packages/eslint-plugin/tests/rules/no-extra-parens.test.ts @@ -23,7 +23,6 @@ for (a in b, c); for (a in b); `, }), - `t.true((me.get as SinonStub).calledWithExactly('/foo', other));`, ...batchedSingleLineTests({ code: ` while ((foo = bar())) {} @@ -120,6 +119,27 @@ typeof (a); }), ...batchedSingleLineTests({ code: ` +const x = (1 as 1) | (1 as 1); +const x = (<1>1) | (<1>1); +const x = (1 as 1) | 2; +const x = (1 as 1) + 2 + 2; +const x = 1 + 1 + (2 as 2); +const x = 1 | (2 as 2); +const x = (<1>1) | 2; +const x = 1 | (<2>2); +t.true((me.get as SinonStub).calledWithExactly('/foo', other)); +t.true((me.get).calledWithExactly('/foo', other)); +(requestInit.headers as Headers).get('Cookie'); +( requestInit.headers).get('Cookie'); + `, + parserOptions: { + ecmaFeatures: { + jsx: false, + }, + }, + }), + ...batchedSingleLineTests({ + code: ` [a as b]; () => (1 as 1); x = a as b; @@ -155,6 +175,48 @@ switch (foo) { case 1: case (2 as 2): break; default: break; } }, ], }), + ...batchedSingleLineTests({ + code: ` +[a]; +() => (<1>1); +x = a; +const x = (<1>1) | 2; +const x = 1 | (<2>2); +const x = await (>foo); +const res2 = (fn)(); +(x) ? 1 : 0; +x ? (<1>1) : 2; +x ? 1 : (<2>2); +while (foo) {}; +do {} while (foo); +for (let i of ([])) {} +for (let i in ({})) {} +for ((<1>1);;) {} +for (;(<1>1);) {} +for (;;(<1>1)) {} +if (<1>1) {} +const x = (<1>1).toString(); +new (<1>1)(); +const x = { ...(<1>1), ...{} }; +throw (<1>1); +throw 1; +const x = !(<1>1); +const x = (<1>1)++; +function *x() { yield (<1>1); yield 1; } +switch (foo) { case 1: case (<2>2): break; default: break; } + `, + parserOptions: { + ecmaFeatures: { + jsx: false, + }, + }, + options: [ + 'all', + { + nestedBinaryExpressions: false, + }, + ], + }), ], invalid: [ From cba6a2a8063744f835febcd1a6fbf9f93c6962d2 Mon Sep 17 00:00:00 2001 From: Armano Date: Tue, 24 Dec 2019 06:42:37 +0100 Subject: [PATCH 3/7] fix(typescript-estree): visit typeParameters in OptionalCallExpr (#1377) --- .../lib/__snapshots__/typescript.ts.snap | 99 +++ ...onal-call-expression-type-arguments.src.ts | 2 + .../create-program/createDefaultProgram.ts | 2 +- packages/typescript-estree/src/parser.ts | 6 +- .../typescript-estree/src/visitor-keys.ts | 2 +- .../semantic-diagnostics-enabled.ts.snap | 2 + .../lib/__snapshots__/typescript.ts.snap | 621 ++++++++++++++++++ 7 files changed, 729 insertions(+), 5 deletions(-) create mode 100644 packages/shared-fixtures/fixtures/typescript/expressions/optional-call-expression-type-arguments.src.ts diff --git a/packages/parser/tests/lib/__snapshots__/typescript.ts.snap b/packages/parser/tests/lib/__snapshots__/typescript.ts.snap index 219470cc7b44..03506477a626 100644 --- a/packages/parser/tests/lib/__snapshots__/typescript.ts.snap +++ b/packages/parser/tests/lib/__snapshots__/typescript.ts.snap @@ -40807,6 +40807,105 @@ Object { } `; +exports[`typescript fixtures/expressions/optional-call-expression-type-arguments.src 1`] = ` +Object { + "$id": 3, + "block": Object { + "range": Array [ + 0, + 35, + ], + "type": "Program", + }, + "childScopes": Array [ + Object { + "$id": 2, + "block": Object { + "range": Array [ + 0, + 35, + ], + "type": "Program", + }, + "childScopes": Array [], + "functionExpressionScope": false, + "isStrict": true, + "references": Array [ + Object { + "$id": 0, + "from": Object { + "$ref": 2, + }, + "identifier": Object { + "name": "foo", + "range": Array [ + 0, + 3, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + Object { + "$id": 1, + "from": Object { + "$ref": 2, + }, + "identifier": Object { + "name": "foo", + "range": Array [ + 15, + 18, + ], + "type": "Identifier", + }, + "kind": "r", + "resolved": null, + "writeExpr": undefined, + }, + ], + "throughReferences": Array [ + Object { + "$ref": 0, + }, + Object { + "$ref": 1, + }, + ], + "type": "module", + "upperScope": Object { + "$ref": 3, + }, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 2, + }, + "variables": Array [], + }, + ], + "functionExpressionScope": false, + "isStrict": false, + "references": Array [], + "throughReferences": Array [ + Object { + "$ref": 0, + }, + Object { + "$ref": 1, + }, + ], + "type": "global", + "upperScope": null, + "variableMap": Object {}, + "variableScope": Object { + "$ref": 3, + }, + "variables": Array [], +} +`; + exports[`typescript fixtures/expressions/tagged-template-expression-type-arguments.src 1`] = ` Object { "$id": 2, diff --git a/packages/shared-fixtures/fixtures/typescript/expressions/optional-call-expression-type-arguments.src.ts b/packages/shared-fixtures/fixtures/typescript/expressions/optional-call-expression-type-arguments.src.ts new file mode 100644 index 000000000000..5cb45f68a4c9 --- /dev/null +++ b/packages/shared-fixtures/fixtures/typescript/expressions/optional-call-expression-type-arguments.src.ts @@ -0,0 +1,2 @@ +foo?.bar(); +foo?.bar(); diff --git a/packages/typescript-estree/src/create-program/createDefaultProgram.ts b/packages/typescript-estree/src/create-program/createDefaultProgram.ts index 11a6638d711c..0db0d1fc699d 100644 --- a/packages/typescript-estree/src/create-program/createDefaultProgram.ts +++ b/packages/typescript-estree/src/create-program/createDefaultProgram.ts @@ -12,7 +12,7 @@ const log = debug('typescript-eslint:typescript-estree:createDefaultProgram'); /** * @param code The code of the file being linted - * @param options The config object + * @param extra The config object * @param extra.tsconfigRootDir The root directory for relative tsconfig paths * @param extra.projects Provided tsconfig paths * @returns If found, returns the source file corresponding to the code and the containing program diff --git a/packages/typescript-estree/src/parser.ts b/packages/typescript-estree/src/parser.ts index 882249b6bdd5..82755ef99079 100644 --- a/packages/typescript-estree/src/parser.ts +++ b/packages/typescript-estree/src/parser.ts @@ -51,8 +51,8 @@ interface ASTAndProgram { /** * @param code The code of the file being linted - * @param options The config object - * @param shouldProvideParserServices True iff the program should be attempted to be calculated from provided tsconfig files + * @param shouldProvideParserServices True if the program should be attempted to be calculated from provided tsconfig files + * @param shouldCreateDefaultProgram True if the program should be created from compiler host * @returns Returns a source file and program corresponding to the linted code */ function getProgramAndAST( @@ -366,7 +366,7 @@ function parseAndGenerateServices( )!; /** - * Determine whether or not two-way maps of converted AST nodes should be preserved + * Determine whatever or not two-way maps of converted AST nodes should be preserved * during the conversion process */ const shouldPreserveNodeMaps = diff --git a/packages/typescript-estree/src/visitor-keys.ts b/packages/typescript-estree/src/visitor-keys.ts index d7ee3ed356fc..a3622fc4713f 100644 --- a/packages/typescript-estree/src/visitor-keys.ts +++ b/packages/typescript-estree/src/visitor-keys.ts @@ -43,7 +43,7 @@ export const visitorKeys = eslintVisitorKeys.unionWith({ BigIntLiteral: [], ClassProperty: ['decorators', 'key', 'typeAnnotation', 'value'], Decorator: ['expression'], - OptionalCallExpression: eslintVisitorKeys.KEYS.CallExpression, + OptionalCallExpression: ['callee', 'typeParameters', 'arguments'], OptionalMemberExpression: eslintVisitorKeys.KEYS.MemberExpression, TSAbstractClassProperty: ['decorators', 'key', 'typeAnnotation', 'value'], TSAbstractKeyword: [], diff --git a/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap index 7ec1f11ce8c5..1b81d29c0842 100644 --- a/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap +++ b/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.ts.snap @@ -2502,6 +2502,8 @@ exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" e exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/expressions/new-expression-type-arguments.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/expressions/optional-call-expression-type-arguments.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/expressions/tagged-template-expression-type-arguments.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/namespaces-and-modules/ambient-module-declaration-with-import.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; diff --git a/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap index 2616eb70237d..a439478f2a98 100644 --- a/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap +++ b/packages/typescript-estree/tests/lib/__snapshots__/typescript.ts.snap @@ -137287,6 +137287,627 @@ Object { } `; +exports[`typescript fixtures/expressions/optional-call-expression-type-arguments.src 1`] = ` +Object { + "body": Array [ + Object { + "expression": Object { + "arguments": Array [], + "callee": Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "object": Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "name": "foo", + "range": Array [ + 0, + 3, + ], + "type": "Identifier", + }, + "optional": true, + "property": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "name": "bar", + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + }, + "range": Array [ + 0, + 8, + ], + "type": "OptionalMemberExpression", + }, + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "optional": false, + "range": Array [ + 0, + 13, + ], + "type": "OptionalCallExpression", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "TSTypeReference", + "typeName": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "A", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, + }, + ], + "range": Array [ + 8, + 11, + ], + "type": "TSTypeParameterInstantiation", + }, + }, + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 14, + ], + "type": "ExpressionStatement", + }, + Object { + "expression": Object { + "arguments": Array [], + "callee": Object { + "computed": false, + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "object": Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "name": "foo", + "range": Array [ + 15, + 18, + ], + "type": "Identifier", + }, + "optional": true, + "property": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 2, + }, + }, + "name": "bar", + "range": Array [ + 20, + 23, + ], + "type": "Identifier", + }, + "range": Array [ + 15, + 23, + ], + "type": "OptionalMemberExpression", + }, + "loc": Object { + "end": Object { + "column": 18, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "optional": false, + "range": Array [ + 15, + 33, + ], + "type": "OptionalCallExpression", + "typeParameters": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "range": Array [ + 24, + 30, + ], + "type": "TSNumberKeyword", + }, + ], + "range": Array [ + 23, + 31, + ], + "type": "TSTypeParameterInstantiation", + }, + }, + "loc": Object { + "end": Object { + "column": 19, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 15, + 34, + ], + "type": "ExpressionStatement", + }, + ], + "loc": Object { + "end": Object { + "column": 0, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 35, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 3, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 3, + "line": 1, + }, + }, + "range": Array [ + 3, + 5, + ], + "type": "Punctuator", + "value": "?.", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 5, + "line": 1, + }, + }, + "range": Array [ + 5, + 8, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + "value": "A", + }, + Object { + "loc": Object { + "end": Object { + "column": 11, + "line": 1, + }, + "start": Object { + "column": 10, + "line": 1, + }, + }, + "range": Array [ + 10, + 11, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 11, + "line": 1, + }, + }, + "range": Array [ + 11, + 12, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 1, + }, + "start": Object { + "column": 12, + "line": 1, + }, + }, + "range": Array [ + 12, + 13, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "range": Array [ + 13, + 14, + ], + "type": "Punctuator", + "value": ";", + }, + Object { + "loc": Object { + "end": Object { + "column": 3, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 15, + 18, + ], + "type": "Identifier", + "value": "foo", + }, + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 2, + }, + "start": Object { + "column": 3, + "line": 2, + }, + }, + "range": Array [ + 18, + 20, + ], + "type": "Punctuator", + "value": "?.", + }, + Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 2, + }, + "start": Object { + "column": 5, + "line": 2, + }, + }, + "range": Array [ + 20, + 23, + ], + "type": "Identifier", + "value": "bar", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 2, + }, + "start": Object { + "column": 8, + "line": 2, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": "<", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 9, + "line": 2, + }, + }, + "range": Array [ + 24, + 30, + ], + "type": "Identifier", + "value": "number", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "range": Array [ + 30, + 31, + ], + "type": "Punctuator", + "value": ">", + }, + Object { + "loc": Object { + "end": Object { + "column": 17, + "line": 2, + }, + "start": Object { + "column": 16, + "line": 2, + }, + }, + "range": Array [ + 31, + 32, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 2, + }, + "start": Object { + "column": 17, + "line": 2, + }, + }, + "range": Array [ + 32, + 33, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 2, + }, + "start": Object { + "column": 18, + "line": 2, + }, + }, + "range": Array [ + 33, + 34, + ], + "type": "Punctuator", + "value": ";", + }, + ], + "type": "Program", +} +`; + exports[`typescript fixtures/expressions/tagged-template-expression-type-arguments.src 1`] = ` Object { "body": Array [ From 6a6bde01a0fe405f9d186788781cc2fa9cb37145 Mon Sep 17 00:00:00 2001 From: Armano Date: Thu, 26 Dec 2019 03:14:01 +0100 Subject: [PATCH 4/7] refactor: TypeParameter parsing and no-unnec-type-args rule (#1381) --- .../rules/no-unnecessary-type-arguments.ts | 65 ++++++------------- .../no-unnecessary-type-arguments.test.ts | 36 ++++++++++ packages/typescript-estree/src/convert.ts | 40 +++++++++--- 3 files changed, 86 insertions(+), 55 deletions(-) diff --git a/packages/eslint-plugin/src/rules/no-unnecessary-type-arguments.ts b/packages/eslint-plugin/src/rules/no-unnecessary-type-arguments.ts index 3ccca4f74a04..d3f14037d537 100644 --- a/packages/eslint-plugin/src/rules/no-unnecessary-type-arguments.ts +++ b/packages/eslint-plugin/src/rules/no-unnecessary-type-arguments.ts @@ -4,15 +4,6 @@ import * as ts from 'typescript'; import * as util from '../util'; import { findFirstResult } from '../util'; -interface ArgsAndParams { - typeArguments: ts.NodeArray; - typeParameters: readonly ts.TypeParameterDeclaration[]; -} - -type ExtendingClassLikeDeclaration = ts.ClassLikeDeclaration & { - heritageClauses: ts.NodeArray; -}; - type ParameterCapableTSNode = | ts.CallExpression | ts.NewExpression @@ -43,65 +34,52 @@ export default util.createRule<[], MessageIds>({ create(context) { const parserServices = util.getParserServices(context); const checker = parserServices.program.getTypeChecker(); + const sourceCode = context.getSourceCode(); function checkTSArgsAndParameters( esParameters: TSESTree.TSTypeParameterInstantiation, - { typeArguments, typeParameters }: ArgsAndParams, + typeParameters: readonly ts.TypeParameterDeclaration[], ): void { // Just check the last one. Must specify previous type parameters if the last one is specified. - const i = typeArguments.length - 1; - const arg = typeArguments[i]; + const i = esParameters.params.length - 1; + const arg = esParameters.params[i]; const param = typeParameters[i]; // TODO: would like checker.areTypesEquivalent. https://github.com/Microsoft/TypeScript/issues/13502 if ( - param.default === undefined || - param.default.getText() !== arg.getText() + !param.default || + param.default.getText() !== sourceCode.getText(arg) ) { return; } context.report({ + node: arg, + messageId: 'unnecessaryTypeParameter', fix: fixer => fixer.removeRange( i === 0 - ? [typeArguments.pos - 1, typeArguments.end + 1] - : [typeArguments[i - 1].end, arg.end], + ? esParameters.range + : [esParameters.params[i - 1].range[1], arg.range[1]], ), - messageId: 'unnecessaryTypeParameter', - node: esParameters.params[i], }); } return { TSTypeParameterInstantiation(node): void { - const parentDeclaration = parserServices.esTreeNodeToTSNodeMap.get< - ExtendingClassLikeDeclaration | ParameterCapableTSNode - >(node.parent!); - - const expression = tsutils.isClassLikeDeclaration(parentDeclaration) - ? parentDeclaration.heritageClauses[0].types[0] - : parentDeclaration; + const expression = parserServices.esTreeNodeToTSNodeMap.get< + ParameterCapableTSNode + >(node); - const argsAndParams = getArgsAndParameters(expression, checker); - if (argsAndParams !== undefined) { - checkTSArgsAndParameters(node, argsAndParams); + const typeParameters = getTypeParametersFromNode(expression, checker); + if (typeParameters) { + checkTSArgsAndParameters(node, typeParameters); } }, }; }, }); -function getArgsAndParameters( - node: ParameterCapableTSNode, - checker: ts.TypeChecker, -): ArgsAndParams | undefined { - const typeParameters = getTypeParametersFromNode(node, checker); - return typeParameters === undefined - ? undefined - : { typeArguments: node.typeArguments!, typeParameters }; -} - function getTypeParametersFromNode( node: ParameterCapableTSNode, checker: ts.TypeChecker, @@ -126,14 +104,11 @@ function getTypeParametersFromType( checker: ts.TypeChecker, ): readonly ts.TypeParameterDeclaration[] | undefined { const symAtLocation = checker.getSymbolAtLocation(type); - if (symAtLocation === undefined) { + if (!symAtLocation) { return undefined; } const sym = getAliasedSymbol(symAtLocation, checker); - if (sym === undefined || sym.declarations === undefined) { - return undefined; - } return findFirstResult(sym.declarations, decl => tsutils.isClassLikeDeclaration(decl) || @@ -149,8 +124,8 @@ function getTypeParametersFromCall( checker: ts.TypeChecker, ): readonly ts.TypeParameterDeclaration[] | undefined { const sig = checker.getResolvedSignature(node); - const sigDecl = sig === undefined ? undefined : sig.getDeclaration(); - if (sigDecl === undefined) { + const sigDecl = sig?.getDeclaration(); + if (!sigDecl) { return ts.isNewExpression(node) ? getTypeParametersFromType(node.expression, checker) : undefined; @@ -162,7 +137,7 @@ function getTypeParametersFromCall( function getAliasedSymbol( symbol: ts.Symbol, checker: ts.TypeChecker, -): ts.Symbol | undefined { +): ts.Symbol { return tsutils.isSymbolFlagSet(symbol, ts.SymbolFlags.Alias) ? checker.getAliasedSymbol(symbol) : symbol; diff --git a/packages/eslint-plugin/tests/rules/no-unnecessary-type-arguments.test.ts b/packages/eslint-plugin/tests/rules/no-unnecessary-type-arguments.test.ts index b22d123cbcb5..df79528403df 100644 --- a/packages/eslint-plugin/tests/rules/no-unnecessary-type-arguments.test.ts +++ b/packages/eslint-plugin/tests/rules/no-unnecessary-type-arguments.test.ts @@ -14,6 +14,12 @@ const ruleTester = new RuleTester({ ruleTester.run('no-unnecessary-type-arguments', rule, { valid: [ + `f<>();`, + `f();`, + `class Foo extends Bar<> {}`, + `class Foo extends Bar {}`, + `class Foo implements Bar<> {}`, + `class Foo implements Bar {}`, `function f() { } f();`, `function f() { } @@ -60,6 +66,14 @@ ruleTester.run('no-unnecessary-type-arguments', rule, { `class Foo {} const foo = new Foo();`, `type Foo = import('foo').Foo;`, + `class Bar {} + class Foo extends Bar {}`, + `interface Bar {} + class Foo implements Bar {}`, + `class Bar {} + class Foo extends Bar {}`, + `interface Bar {} + class Foo implements Bar {}`, ], invalid: [ { @@ -141,5 +155,27 @@ ruleTester.run('no-unnecessary-type-arguments', rule, { output: `class Foo {} const foo = new Foo();`, }, + { + code: `interface Bar {} + class Foo implements Bar {}`, + errors: [ + { + messageId: 'unnecessaryTypeParameter', + }, + ], + output: `interface Bar {} + class Foo implements Bar {}`, + }, + { + code: `class Bar {} + class Foo extends Bar {}`, + errors: [ + { + messageId: 'unnecessaryTypeParameter', + }, + ], + output: `class Bar {} + class Foo extends Bar {}`, + }, ], }); diff --git a/packages/typescript-estree/src/convert.ts b/packages/typescript-estree/src/convert.ts index f65ac54867aa..4a5d4accb408 100644 --- a/packages/typescript-estree/src/convert.ts +++ b/packages/typescript-estree/src/convert.ts @@ -300,20 +300,21 @@ export class Converter { /** * Converts a ts.Node's typeArguments to TSTypeParameterInstantiation node - * @param typeArguments ts.Node typeArguments + * @param typeArguments ts.NodeArray typeArguments + * @param node parent used to create this node * @returns TypeParameterInstantiation node */ private convertTypeArgumentsToTypeParameters( typeArguments: ts.NodeArray, + node: ts.Node, ): TSESTree.TSTypeParameterInstantiation { const greaterThanToken = findNextToken(typeArguments, this.ast, this.ast)!; - return { + return this.createNode(node, { type: AST_NODE_TYPES.TSTypeParameterInstantiation, range: [typeArguments.pos - 1, greaterThanToken.end], - loc: getLocFor(typeArguments.pos - 1, greaterThanToken.end, this.ast), params: typeArguments.map(typeArgument => this.convertType(typeArgument)), - }; + }); } /** @@ -386,7 +387,7 @@ export class Converter { if ('typeArguments' in node) { result.typeParameters = node.typeArguments && 'pos' in node.typeArguments - ? this.convertTypeArgumentsToTypeParameters(node.typeArguments) + ? this.convertTypeArgumentsToTypeParameters(node.typeArguments, node) : null; } if ('typeParameters' in node) { @@ -1296,7 +1297,10 @@ export class Converter { return this.createNode(node, { type: AST_NODE_TYPES.TaggedTemplateExpression, typeParameters: node.typeArguments - ? this.convertTypeArgumentsToTypeParameters(node.typeArguments) + ? this.convertTypeArgumentsToTypeParameters( + node.typeArguments, + node, + ) : undefined, tag: this.convertChild(node.tag), quasi: this.convertChild(node.template), @@ -1440,6 +1444,7 @@ export class Converter { if (superClass.types[0] && superClass.types[0].typeArguments) { result.superTypeParameters = this.convertTypeArgumentsToTypeParameters( superClass.types[0].typeArguments, + superClass.types[0], ); } } @@ -1781,6 +1786,7 @@ export class Converter { if (node.typeArguments) { result.typeParameters = this.convertTypeArgumentsToTypeParameters( node.typeArguments, + node, ); } return result; @@ -1798,6 +1804,7 @@ export class Converter { if (node.typeArguments) { result.typeParameters = this.convertTypeArgumentsToTypeParameters( node.typeArguments, + node, ); } return result; @@ -1958,7 +1965,10 @@ export class Converter { openingElement: this.createNode(node, { type: AST_NODE_TYPES.JSXOpeningElement, typeParameters: node.typeArguments - ? this.convertTypeArgumentsToTypeParameters(node.typeArguments) + ? this.convertTypeArgumentsToTypeParameters( + node.typeArguments, + node, + ) : undefined, selfClosing: true, name: this.convertJSXTagName(node.tagName, node), @@ -1976,7 +1986,10 @@ export class Converter { return this.createNode(node, { type: AST_NODE_TYPES.JSXOpeningElement, typeParameters: node.typeArguments - ? this.convertTypeArgumentsToTypeParameters(node.typeArguments) + ? this.convertTypeArgumentsToTypeParameters( + node.typeArguments, + node, + ) : undefined, selfClosing: false, name: this.convertJSXTagName(node.tagName, node), @@ -2081,7 +2094,10 @@ export class Converter { type: AST_NODE_TYPES.TSTypeReference, typeName: this.convertType(node.typeName), typeParameters: node.typeArguments - ? this.convertTypeArgumentsToTypeParameters(node.typeArguments) + ? this.convertTypeArgumentsToTypeParameters( + node.typeArguments, + node, + ) : undefined, }); } @@ -2362,6 +2378,7 @@ export class Converter { if (node.typeArguments) { result.typeParameters = this.convertTypeArgumentsToTypeParameters( node.typeArguments, + node, ); } return result; @@ -2454,7 +2471,10 @@ export class Converter { parameter: this.convertChild(node.argument), qualifier: this.convertChild(node.qualifier), typeParameters: node.typeArguments - ? this.convertTypeArgumentsToTypeParameters(node.typeArguments) + ? this.convertTypeArgumentsToTypeParameters( + node.typeArguments, + node, + ) : null, }); From 8bf6879e530fb539a1777ffffbfc7b166c3f4a2f Mon Sep 17 00:00:00 2001 From: Teppei Sato Date: Sat, 28 Dec 2019 10:14:21 +0900 Subject: [PATCH 5/7] docs(eslint-plugin): [no-throw-literal] wrong link (#1384) --- packages/eslint-plugin/docs/rules/no-throw-literal.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/eslint-plugin/docs/rules/no-throw-literal.md b/packages/eslint-plugin/docs/rules/no-throw-literal.md index a88720311552..9f87cffb34f8 100644 --- a/packages/eslint-plugin/docs/rules/no-throw-literal.md +++ b/packages/eslint-plugin/docs/rules/no-throw-literal.md @@ -81,4 +81,4 @@ throw new CustomError(); --- -Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/master/docs/rules/camelcase.md) +Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/master/docs/rules/no-throw-literal.md) From b1c8c0a5889f0db1a96e90b512288553f68cc7ee Mon Sep 17 00:00:00 2001 From: Armano Date: Sun, 29 Dec 2019 05:32:15 +0100 Subject: [PATCH 6/7] chore: migrate markdown-spellcheck to cspell (#1386) --- .cspell.json | 90 +++ .spelling | 126 ---- .vscode/extensions.json | 3 +- CONTRIBUTING.md | 1 + package.json | 5 +- .../docs/rules/consistent-type-assertions.md | 2 +- .../docs/rules/member-delimiter-style.md | 2 +- .../docs/rules/no-floating-promises.md | 2 +- .../docs/rules/no-unused-vars-experimental.md | 2 +- .../docs/rules/prefer-readonly.md | 2 +- packages/eslint-plugin/docs/rules/typedef.md | 4 +- .../src/rules/member-delimiter-style.ts | 2 +- .../src/rules/no-extra-parens.ts | 2 +- .../src/rules/no-magic-numbers.ts | 2 +- .../rules/no-unnecessary-type-assertion.ts | 2 +- .../src/rules/no-unused-vars-experimental.ts | 2 +- .../src/rules/no-use-before-define.ts | 2 +- .../src/rules/prefer-optional-chain.ts | 2 +- .../eslint-plugin/src/rules/require-await.ts | 2 +- .../tests/rules/indent/indent-eslint.test.ts | 4 +- .../rules/prefer-nullish-coalescing.test.ts | 2 +- .../src/eslint-utils/deepMerge.ts | 2 +- packages/experimental-utils/src/index.ts | 2 +- .../src/ts-eslint-scope/Scope.ts | 2 +- .../experimental-utils/src/ts-eslint/Rule.ts | 2 +- .../src/ts-eslint/RuleTester.ts | 2 +- packages/parser/src/analyze-scope.ts | 2 +- .../tests/ast-alignment/fixtures-to-test.ts | 2 +- .../tests/ast-alignment/utils.ts | 2 +- .../tests/lib/persistentParse.ts | 2 +- yarn.lock | 541 ++++++++++++------ 31 files changed, 480 insertions(+), 340 deletions(-) create mode 100644 .cspell.json delete mode 100644 .spelling diff --git a/.cspell.json b/.cspell.json new file mode 100644 index 000000000000..b3e10009914b --- /dev/null +++ b/.cspell.json @@ -0,0 +1,90 @@ +{ + "version": "0.1", + "language": "en", + "ignorePaths": [ + "**/coverage/**", + "**/node_modules/**", + "**/dist/**", + "**/fixtures/**", + "**/**/CHANGELOG.md", + "**/**/CONTRIBUTORS.md", + "**/**/ROADMAP.md", + "**/*.json" + ], + "dictionaries": [ + "typescript", + "softwareTerms", + "node", + "en_US", + "npm", + "misc", + "filetypes" + ], + "ignoreRegExpList": [ + "/```[\\w\\W]*?```/", + "/~~~[\\w\\W]*?~~~/", + "/``[\\w\\W]*?``/", + "/`[^`]*`/", + "/\\.\\/docs\\/rules\\/[^.]*.md/", + "/@typescript-eslint\\/[a-z-]+/", + "/\\.all-contributorsrc/", + "/TS[^\\s]+/" + ], + "words": [ + "ASTs", + "Airbnb", + "Airbnb's", + "Codecov", + "Crockford", + "errored", + "IDE's", + "IIFE", + "IIFEs", + "OOM", + "OOMs", + "Premade", + "ROADMAP", + "autofix", + "autofixers", + "backticks", + "bigint", + "blockless", + "codebases", + "declarators", + "destructure", + "destructured", + "erroring", + "espree", + "estree", + "linebreaks", + "necroing", + "nullish", + "parameterised", + "performant", + "pluggable", + "postprocess", + "prettier's", + "reimplement", + "resync", + "ruleset", + "rulesets", + "superset", + "thenables", + "tsconfigs", + "tsutils", + "typedef", + "typedefs", + "unfixable", + "unprefixed" + ], + "overrides": [ + { + "filename": "**/*.{ts,js}", + "ignoreRegExpList": ["/@[a-z]+/", "/#(end)?region/"], + "includeRegExpList": [ + "/\\/\\*[\\s\\S]*?\\*\\/|([^\\\\:]|^)\\/\\/.*$/", + "/(\\/\\/[^\\n\\r]*[\\n\\r]+)/" + ] + } + ] +} diff --git a/.spelling b/.spelling deleted file mode 100644 index 8acf2e674fe3..000000000000 --- a/.spelling +++ /dev/null @@ -1,126 +0,0 @@ -# markdown-spellcheck spelling configuration file -# Format - lines beginning # are comments -# global dictionary is at the start, file overrides afterwards -# one word per line, to define a file override use ' - filename' -# where filename is relative to this configuration file -1000s -1pm -30s -A11y -Airbnb -Airbnb's -ands -API -APIs -ASI -AST -ASTs -async -autofixers -backticks -boolean -booleans -camelCase -camelCasing -CLI -codebase -codebases -CommonJS -config -configs -const -Crockford -declarators -destructure -destructured -destructuring -e.g. -enum -enums -ES2015 -ES2016 -ES5 -ES6 -ESLint -ESLint's -eslintrc.js -ESTree -fallthrough -falsy -filenames -heavy_check_mark -i.e. -IIFE -IIFEs -ing -jQuery -JS -JSCS -JSHint -JSON -JSX -linebreak -linters -MDN -monorepo -monorepos -multiline -namespace -namespaces -natively -necroing -NodeJS -npm -nullish -OOM -OOMs -onboard -OSS -package.json -Palantir -PascalCase -PascalCased -performant -pluggable -pre-ES6 -pre-parse -pre-releases -premade -README -readonly -realtime -RegExp#exec -reimplement -repo -roadmap -ruleset -rulesets -runtime -searchable -String#match -substring -substrings -superset -supertype -syntaxes -thenable -thought_balloon -timelines -TODO -transpile -truthy -tsconfig -tsconfig.json -tsconfigs -TSLint -typecheck -typechecker -typechecking -TypeScript -typings -unfixable -unprefixed -untyped -VSCode -Vue -whitespace diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 0a2e1c827047..33430df8759e 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -2,7 +2,8 @@ "recommendations": [ "esbenp.prettier-vscode", "dbaeumer.vscode-eslint", - "editorconfig.editorconfig" + "editorconfig.editorconfig", + "streetsidesoftware.code-spell-checker" ], "unwantedRecommendations": ["hookyqr.beautify", "dbaeumer.jshint"] } diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 37ca0a15534a..bb3db1264208 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -52,6 +52,7 @@ We have a sophisticated CI process setup which gets run on every PR. You must pa - You can run `yarn lint` in any package or in the root. - If you have made changes to any markdown documentation, ensure there are no spelling errors - You can run `yarn check:spelling` in the root. + - Or if you are using vscode, you can use [`Code Spell Checker`](https://marketplace.visualstudio.com/items?itemName=streetsidesoftware.code-spell-checker) plugin. - If you have made changes within the `eslint-plugin` package, ensure the configs and documentation are valid. - You can run `yarn check:configs` and `yarn check:docs` in the root, or in the `eslint-plugin` folder. diff --git a/package.json b/package.json index 47aa94d20a74..8255719940d2 100644 --- a/package.json +++ b/package.json @@ -22,8 +22,7 @@ "cz": "git-cz", "check:docs": "lerna run check:docs", "check:configs": "lerna run check:configs", - "check:spelling": "yarn check:spelling-interactive -r", - "check:spelling-interactive": "mdspell '**/*.md' '!**/node_modules/**/*.md' '!**/CHANGELOG.md' '!**/CONTRIBUTORS.md' '!**/ROADMAP.md' --ignore-numbers --en-us", + "check:spelling": "cspell --config=.cspell.json **/*.{md,ts,js}", "generate-contributors": "yarn ts-node --transpile-only ./tools/generate-contributors.ts && yarn all-contributors generate", "format": "prettier --write \"./**/*.{ts,js,json,md}\"", "format-check": "prettier --list-different \"./**/*.{ts,js,json,md}\"", @@ -58,6 +57,7 @@ "@types/jest": "^24.0.23", "@types/node": "^12.12.7", "all-contributors-cli": "^6.11.0", + "cspell": "^4.0.43", "cz-conventional-changelog": "^3.0.2", "eslint": "^6.7.0", "eslint-plugin-eslint-comments": "^3.1.2", @@ -69,7 +69,6 @@ "jest": "^24.9.0", "lerna": "^3.18.4", "lint-staged": "^9.4.3", - "markdown-spellcheck": "^1.3.1", "opencollective-postinstall": "^2.0.2", "prettier": "^1.19.1", "ts-jest": "^24.0.0", diff --git a/packages/eslint-plugin/docs/rules/consistent-type-assertions.md b/packages/eslint-plugin/docs/rules/consistent-type-assertions.md index 1041d2bae84b..c943f5a9ba14 100644 --- a/packages/eslint-plugin/docs/rules/consistent-type-assertions.md +++ b/packages/eslint-plugin/docs/rules/consistent-type-assertions.md @@ -32,7 +32,7 @@ This option defines the expected assertion style. Valid values for `assertionSty - `angle-bracket` will enforce that you always use `...` - `never` will enforce that you do not do any type assertions. -Most code bases will want to enforce not using `angle-bracket` style because it conflicts with JSX syntax, and is confusing when paired with with generic syntax. +Most codebases will want to enforce not using `angle-bracket` style because it conflicts with JSX syntax, and is confusing when paired with with generic syntax. Some codebases like to go for an extra level of type safety, and ban assertions altogether via the `never` option. diff --git a/packages/eslint-plugin/docs/rules/member-delimiter-style.md b/packages/eslint-plugin/docs/rules/member-delimiter-style.md index 07f339665e23..3504220fdcd5 100644 --- a/packages/eslint-plugin/docs/rules/member-delimiter-style.md +++ b/packages/eslint-plugin/docs/rules/member-delimiter-style.md @@ -32,7 +32,7 @@ type Bar = { } ``` -- Linebreak (none) style. +- Line break (none) style. ```ts diff --git a/packages/eslint-plugin/docs/rules/no-floating-promises.md b/packages/eslint-plugin/docs/rules/no-floating-promises.md index 350ffa80a94a..64e6accb45de 100644 --- a/packages/eslint-plugin/docs/rules/no-floating-promises.md +++ b/packages/eslint-plugin/docs/rules/no-floating-promises.md @@ -45,7 +45,7 @@ The rule accepts an options object with the following properties: ```ts type Options = { - // if true, checking void expresions will be skipped + // if true, checking void expressions will be skipped ignoreVoid?: boolean; }; diff --git a/packages/eslint-plugin/docs/rules/no-unused-vars-experimental.md b/packages/eslint-plugin/docs/rules/no-unused-vars-experimental.md index 18d08304bc3e..bf2f245fe139 100644 --- a/packages/eslint-plugin/docs/rules/no-unused-vars-experimental.md +++ b/packages/eslint-plugin/docs/rules/no-unused-vars-experimental.md @@ -79,7 +79,7 @@ Examples of valid code based on the unchangeable compiler settings import _UnusedDefault, { _UnusedNamed } from 'foo'; export function foo(_unusedProp: string) {} export class Foo<_UnusedGeneric> {} -const { prop: _unusedDesctructure } = foo; +const { prop: _unusedDestructure } = foo; ``` ## `ignoreArgsIfArgsAfterAreUsed` diff --git a/packages/eslint-plugin/docs/rules/prefer-readonly.md b/packages/eslint-plugin/docs/rules/prefer-readonly.md index 8aad12befe44..8f238b1adfd2 100644 --- a/packages/eslint-plugin/docs/rules/prefer-readonly.md +++ b/packages/eslint-plugin/docs/rules/prefer-readonly.md @@ -17,7 +17,7 @@ class Container { public constructor( onlyModifiedInConstructor: number, - // Private parameter properties can also be marked as reaodnly + // Private parameter properties can also be marked as readonly private neverModifiedParameter: string, ) { this.onlyModifiedInConstructor = onlyModifiedInConstructor; diff --git a/packages/eslint-plugin/docs/rules/typedef.md b/packages/eslint-plugin/docs/rules/typedef.md index 1efd2fa04378..38d25ac1d6a5 100644 --- a/packages/eslint-plugin/docs/rules/typedef.md +++ b/packages/eslint-plugin/docs/rules/typedef.md @@ -157,7 +157,7 @@ function logsSize(size): void { console.log(size); } -const doublesSize = function(size): numeber { +const doublesSize = function(size): number { return size * 2; }; @@ -185,7 +185,7 @@ function logsSize(size: number): void { console.log(size); } -const doublesSize = function(size: number): numeber { +const doublesSize = function(size: number): number { return size * 2; }; diff --git a/packages/eslint-plugin/src/rules/member-delimiter-style.ts b/packages/eslint-plugin/src/rules/member-delimiter-style.ts index 7440159286f8..98781d2b8641 100644 --- a/packages/eslint-plugin/src/rules/member-delimiter-style.ts +++ b/packages/eslint-plugin/src/rules/member-delimiter-style.ts @@ -43,7 +43,7 @@ const definition = { singleline: { type: 'object', properties: { - // note can't have "none" for single line delimiter as it's invlaid syntax + // note can't have "none" for single line delimiter as it's invalid syntax delimiter: { enum: ['semi', 'comma'] }, requireLast: { type: 'boolean' }, }, diff --git a/packages/eslint-plugin/src/rules/no-extra-parens.ts b/packages/eslint-plugin/src/rules/no-extra-parens.ts index d4fe9afd54be..9398385a3af7 100644 --- a/packages/eslint-plugin/src/rules/no-extra-parens.ts +++ b/packages/eslint-plugin/src/rules/no-extra-parens.ts @@ -1,4 +1,4 @@ -// anys are required to work around manipulating the AST in weird ways +// any is required to work around manipulating the AST in weird ways /* eslint-disable @typescript-eslint/no-explicit-any */ import { diff --git a/packages/eslint-plugin/src/rules/no-magic-numbers.ts b/packages/eslint-plugin/src/rules/no-magic-numbers.ts index e3597cf83485..bf5cfdaa93fc 100644 --- a/packages/eslint-plugin/src/rules/no-magic-numbers.ts +++ b/packages/eslint-plugin/src/rules/no-magic-numbers.ts @@ -79,7 +79,7 @@ export default util.createRule({ /** * Checks if the node grandparent is a Typescript union type and its parent is a type alias declaration * @param node the node to be validated. - * @returns true if the node grandparent is a Typescript untion type and its parent is a type alias declaration + * @returns true if the node grandparent is a Typescript union type and its parent is a type alias declaration * @private */ function isGrandparentTSUnionType(node: TSESTree.Node): boolean { diff --git a/packages/eslint-plugin/src/rules/no-unnecessary-type-assertion.ts b/packages/eslint-plugin/src/rules/no-unnecessary-type-assertion.ts index 542e937f5307..61cbbcb99b9c 100644 --- a/packages/eslint-plugin/src/rules/no-unnecessary-type-assertion.ts +++ b/packages/eslint-plugin/src/rules/no-unnecessary-type-assertion.ts @@ -156,7 +156,7 @@ export default util.createRule({ const type = util.getConstrainedTypeAtLocation(checker, node); if (declarationType === type) { // possibly used before assigned, so just skip it - // better to false negative and skip it, than false postiive and fix to compile erroring code + // better to false negative and skip it, than false positive and fix to compile erroring code // // no better way to figure this out right now // https://github.com/Microsoft/TypeScript/issues/31124 diff --git a/packages/eslint-plugin/src/rules/no-unused-vars-experimental.ts b/packages/eslint-plugin/src/rules/no-unused-vars-experimental.ts index 359397efdc73..dc3f25494298 100644 --- a/packages/eslint-plugin/src/rules/no-unused-vars-experimental.ts +++ b/packages/eslint-plugin/src/rules/no-unused-vars-experimental.ts @@ -244,7 +244,7 @@ export default util.createRule({ } function handleDestructure(parent: ts.BindingPattern): void { - // the entire desctructure is unused + // the entire destructure is unused // note that this case only ever triggers for simple, single-level destructured objects // i.e. these will not trigger it: // - const {a:_a, b, c: {d}} = z; diff --git a/packages/eslint-plugin/src/rules/no-use-before-define.ts b/packages/eslint-plugin/src/rules/no-use-before-define.ts index 5dad2a490d93..e3d5cb81437b 100644 --- a/packages/eslint-plugin/src/rules/no-use-before-define.ts +++ b/packages/eslint-plugin/src/rules/no-use-before-define.ts @@ -248,7 +248,7 @@ export default util.createRule({ const variable = reference.resolved; // Skips when the reference is: - // - initialization's. + // - initializations. // - referring to an undefined variable. // - referring to a global environment variable (there're no identifiers). // - located preceded by the variable (except in initializers). diff --git a/packages/eslint-plugin/src/rules/prefer-optional-chain.ts b/packages/eslint-plugin/src/rules/prefer-optional-chain.ts index 5f8ef5bc0585..e0740c2e913c 100644 --- a/packages/eslint-plugin/src/rules/prefer-optional-chain.ts +++ b/packages/eslint-plugin/src/rules/prefer-optional-chain.ts @@ -228,7 +228,7 @@ export default util.createRule({ } /** - * Gets a normalised representation of the given MemberExpression + * Gets a normalized representation of the given MemberExpression */ function getMemberExpressionText( node: TSESTree.MemberExpression | TSESTree.OptionalMemberExpression, diff --git a/packages/eslint-plugin/src/rules/require-await.ts b/packages/eslint-plugin/src/rules/require-await.ts index 53c43e7a6b93..ed28a105430c 100644 --- a/packages/eslint-plugin/src/rules/require-await.ts +++ b/packages/eslint-plugin/src/rules/require-await.ts @@ -48,7 +48,7 @@ export default util.createRule({ 'ArrowFunctionExpression[async = true]'( node: TSESTree.ArrowFunctionExpression, ): void { - // If body type is not BlockStatment, we need to check the return type here + // If body type is not BlockStatement, we need to check the return type here if (node.body.type !== AST_NODE_TYPES.BlockStatement) { const expression = parserServices.esTreeNodeToTSNodeMap.get( node.body, diff --git a/packages/eslint-plugin/tests/rules/indent/indent-eslint.test.ts b/packages/eslint-plugin/tests/rules/indent/indent-eslint.test.ts index e0515e869c95..e27a037074f2 100644 --- a/packages/eslint-plugin/tests/rules/indent/indent-eslint.test.ts +++ b/packages/eslint-plugin/tests/rules/indent/indent-eslint.test.ts @@ -2838,7 +2838,7 @@ ruleTester.run('indent', rule, { options: [2, { SwitchCase: 1 }], }, - // Template curlies + // Template literals { code: unIndent` \`foo\${ @@ -7851,7 +7851,7 @@ ruleTester.run('indent', rule, { ]), }, - // Template curlies + // Template literals { code: unIndent` \`foo\${ diff --git a/packages/eslint-plugin/tests/rules/prefer-nullish-coalescing.test.ts b/packages/eslint-plugin/tests/rules/prefer-nullish-coalescing.test.ts index 015f7988fe17..6a12c6d2138f 100644 --- a/packages/eslint-plugin/tests/rules/prefer-nullish-coalescing.test.ts +++ b/packages/eslint-plugin/tests/rules/prefer-nullish-coalescing.test.ts @@ -394,7 +394,7 @@ a && b || c ?? d; ], })), - // should not false postivie for functions inside conditional tests + // should not false positive for functions inside conditional tests ...nullishTypeInvalidTest((nullish, type) => ({ code: ` declare const x: ${type} | ${nullish}; diff --git a/packages/experimental-utils/src/eslint-utils/deepMerge.ts b/packages/experimental-utils/src/eslint-utils/deepMerge.ts index b11083014c6c..3603b662a9cb 100644 --- a/packages/experimental-utils/src/eslint-utils/deepMerge.ts +++ b/packages/experimental-utils/src/eslint-utils/deepMerge.ts @@ -1,7 +1,7 @@ type ObjectLike = Record; /** - * Check if the variable contains an object stricly rejecting arrays + * Check if the variable contains an object strictly rejecting arrays * @param obj an object * @returns `true` if obj is an object */ diff --git a/packages/experimental-utils/src/index.ts b/packages/experimental-utils/src/index.ts index c9bde462d14b..5a1fdb90bad8 100644 --- a/packages/experimental-utils/src/index.ts +++ b/packages/experimental-utils/src/index.ts @@ -8,7 +8,7 @@ export { ESLintUtils, JSONSchema, TSESLint, TSESLintScope }; // for convenience's sake - export the types directly from here so consumers // don't need to reference/install both packages in their code -// NOTE - this uses hard links inside ts-estree to avoid initing the entire package +// NOTE - this uses hard links inside ts-estree to avoid initialization of entire package // via its main file (which imports typescript at runtime). // Not every eslint-plugin written in typescript requires typescript at runtime. export { diff --git a/packages/experimental-utils/src/ts-eslint-scope/Scope.ts b/packages/experimental-utils/src/ts-eslint-scope/Scope.ts index 6ec3f1ab88d2..bd6455d7020e 100644 --- a/packages/experimental-utils/src/ts-eslint-scope/Scope.ts +++ b/packages/experimental-utils/src/ts-eslint-scope/Scope.ts @@ -98,7 +98,7 @@ interface Scope { /** * returns this scope has materialized arguments * @method Scope#isArgumentsMaterialized - * @returns {boolean} arguemnts materialized + * @returns {boolean} arguments materialized */ isArgumentsMaterialized(): boolean; diff --git a/packages/experimental-utils/src/ts-eslint/Rule.ts b/packages/experimental-utils/src/ts-eslint/Rule.ts index fcc0e11ae701..da84f47a2b9d 100644 --- a/packages/experimental-utils/src/ts-eslint/Rule.ts +++ b/packages/experimental-utils/src/ts-eslint/Rule.ts @@ -229,7 +229,7 @@ interface RuleContext< report(descriptor: ReportDescriptor): void; } -// This isn't the correct signature, but it makes it easier to do custom unions within reusable listneers +// This isn't the correct signature, but it makes it easier to do custom unions within reusable listeners // never will break someone's code unless they specifically type the function argument type RuleFunction = (node: T) => void; diff --git a/packages/experimental-utils/src/ts-eslint/RuleTester.ts b/packages/experimental-utils/src/ts-eslint/RuleTester.ts index ce3fa87096f4..ce441603bf1c 100644 --- a/packages/experimental-utils/src/ts-eslint/RuleTester.ts +++ b/packages/experimental-utils/src/ts-eslint/RuleTester.ts @@ -23,7 +23,7 @@ interface SuggestionOutput { messageId: TMessageIds; data?: Record; /** - * NOTE: Suggestions will be applied as a stand-alone change, without triggering multipass fixes. + * NOTE: Suggestions will be applied as a stand-alone change, without triggering multi-pass fixes. * Each individual error has its own suggestion, so you have to show the correct, _isolated_ output for each suggestion. */ output: string; diff --git a/packages/parser/src/analyze-scope.ts b/packages/parser/src/analyze-scope.ts index 25cc0dfa27ee..4e680373d774 100644 --- a/packages/parser/src/analyze-scope.ts +++ b/packages/parser/src/analyze-scope.ts @@ -377,7 +377,7 @@ class Referencer extends TSESLintScope.Referencer { const upperScope = this.currentScope(); const { id, typeParameters, params, returnType } = node; - // Ignore this if other overloadings have already existed. + // Ignore this if other overload have already existed. if (id) { const variable = upperScope.set.get(id.name); const defs = variable?.defs; diff --git a/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts b/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts index d59033400c17..fec14747c464 100644 --- a/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts +++ b/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts @@ -260,7 +260,7 @@ tester.addFixturePatternConfig('javascript/modules', { 'error-delete', 'invalid-await', 'invalid-export-named-default', - // babel does not recognise these as modules + // babel does not recognize these as modules 'export-named-as-default', 'export-named-as-specifier', 'export-named-as-specifiers', diff --git a/packages/typescript-estree/tests/ast-alignment/utils.ts b/packages/typescript-estree/tests/ast-alignment/utils.ts index a902ca6257e7..78b7df66fe67 100644 --- a/packages/typescript-estree/tests/ast-alignment/utils.ts +++ b/packages/typescript-estree/tests/ast-alignment/utils.ts @@ -1,4 +1,4 @@ -// bablyon types are something we don't really care about +// babel types are something we don't really care about /* eslint-disable @typescript-eslint/no-explicit-any */ import { AST_NODE_TYPES } from '../../src/ts-estree'; import isPlainObject from 'lodash.isplainobject'; diff --git a/packages/typescript-estree/tests/lib/persistentParse.ts b/packages/typescript-estree/tests/lib/persistentParse.ts index 502245977bdc..8d52f3825878 100644 --- a/packages/typescript-estree/tests/lib/persistentParse.ts +++ b/packages/typescript-estree/tests/lib/persistentParse.ts @@ -188,7 +188,7 @@ describe('persistent parse', () => { /* If the includes ends in a slash, typescript will ask for watchers ending in a slash. - These tests ensure the normalisation code works as expected in this case. + These tests ensure the normalization of code works as expected in this case. */ describe('includes ending in a slash', () => { const tsConfigExcludeBar = { diff --git a/yarn.lock b/yarn.lock index 154b6b2e23ab..8ce1cf0d491b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1593,11 +1593,6 @@ all-contributors-cli@^6.11.0: request "^2.72.0" yargs "^14.0.0" -ansi-escapes@^1.1.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-1.4.0.tgz#d3a8a83b319aa67793662b13e761c7911422306e" - integrity sha1-06ioOzGapneTZisT52HHkRQiMG4= - ansi-escapes@^3.0.0, ansi-escapes@^3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-3.2.0.tgz#8780b98ff9dbf5638152d1f1fe5c1d7b4442976b" @@ -1741,7 +1736,7 @@ array-includes@^3.0.3: define-properties "^1.1.2" es-abstract "^1.7.0" -array-union@^1.0.1, array-union@^1.0.2: +array-union@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/array-union/-/array-union-1.0.2.tgz#9a34410e4f4e3da23dea375be5be70f24778ec39" integrity sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk= @@ -1800,13 +1795,6 @@ async-limiter@~1.0.0: resolved "https://registry.yarnpkg.com/async-limiter/-/async-limiter-1.0.1.tgz#dd379e94f0db8310b08291f9d64c3209766617fd" integrity sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ== -async@^2.1.4: - version "2.6.3" - resolved "https://registry.yarnpkg.com/async/-/async-2.6.3.tgz#d72625e2344a3656e3a3ad4fa749fa83299d82ff" - integrity sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg== - dependencies: - lodash "^4.17.14" - async@^3.0.1: version "3.1.0" resolved "https://registry.yarnpkg.com/async/-/async-3.1.0.tgz#42b3b12ae1b74927b5217d8c0016baaf62463772" @@ -2186,13 +2174,6 @@ clean-stack@^2.0.0: resolved "https://registry.yarnpkg.com/clean-stack/-/clean-stack-2.2.0.tgz#ee8472dbb129e727b31e8a10a427dee9dfe4008b" integrity sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A== -cli-cursor@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-1.0.2.tgz#64da3f7d56a54412e59794bd62dc35295e8f2987" - integrity sha1-ZNo/fValRBLll5S9Ytw1KV6PKYc= - dependencies: - restore-cursor "^1.0.1" - cli-cursor@^2.0.0, cli-cursor@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-2.1.0.tgz#b35dac376479facc3e94747d41d0d0f5238ffcb5" @@ -2296,11 +2277,18 @@ commander@^2.12.1, commander@^2.20.0, commander@~2.20.0: resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.1.tgz#3863ce3ca92d0831dcf2a102f5fb4b5926afd0f9" integrity sha512-cCuLsMhJeWQ/ZpsFTbE765kvVfoeSddc4nU3up4fV+fDBcfUXnbITJ+JzhkdjzOqhURjZgujxaioam4RM9yGUg== -commander@^2.8.1: +commander@^2.20.3: version "2.20.3" resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33" integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ== +comment-json@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/comment-json/-/comment-json-1.1.3.tgz#6986c3330fee0c4c9e00c2398cd61afa5d8f239e" + integrity sha1-aYbDMw/uDEyeAMI5jNYa+l2PI54= + dependencies: + json-parser "^1.0.0" + commitizen@^4.0.3: version "4.0.3" resolved "https://registry.yarnpkg.com/commitizen/-/commitizen-4.0.3.tgz#c19a4213257d0525b85139e2f36db7cc3b4f6dae" @@ -2340,7 +2328,7 @@ concat-map@0.0.1: resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= -concat-stream@^1.4.7, concat-stream@^1.5.0: +concat-stream@^1.5.0: version "1.6.2" resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.2.tgz#904bdf194cd3122fc675c77fc4ac3d4ff0fd1a34" integrity sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw== @@ -2368,6 +2356,18 @@ config-chain@^1.1.11: ini "^1.3.4" proto-list "~1.2.1" +configstore@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/configstore/-/configstore-5.0.0.tgz#37de662c7a49b5fe8dbcf8f6f5818d2d81ed852b" + integrity sha512-eE/hvMs7qw7DlcB5JPRnthmrITuHMmACUJAp89v6PT6iOqzoLS7HRWhBtuHMlhNHo2AhUSA/3Dh1bKNJHcublQ== + dependencies: + dot-prop "^5.1.0" + graceful-fs "^4.1.2" + make-dir "^3.0.0" + unique-string "^2.0.0" + write-file-atomic "^3.0.0" + xdg-basedir "^4.0.0" + console-control-strings@^1.0.0, console-control-strings@~1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" @@ -2531,14 +2531,6 @@ cosmiconfig@^5.1.0, cosmiconfig@^5.2.0, cosmiconfig@^5.2.1: js-yaml "^3.13.1" parse-json "^4.0.0" -create-thenable@~1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/create-thenable/-/create-thenable-1.0.2.tgz#e2031720ccc9575d8cfa31f5c146e762a80c0534" - integrity sha1-4gMXIMzJV12M+jH1wUbnYqgMBTQ= - dependencies: - object.omit "~2.0.0" - unique-concat "~0.2.2" - cross-spawn@^6.0.0, cross-spawn@^6.0.5: version "6.0.5" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4" @@ -2550,6 +2542,260 @@ cross-spawn@^6.0.0, cross-spawn@^6.0.5: shebang-command "^1.2.0" which "^1.2.9" +crypto-random-string@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/crypto-random-string/-/crypto-random-string-2.0.0.tgz#ef2a7a966ec11083388369baa02ebead229b30d5" + integrity sha512-v1plID3y9r/lPhviJ1wrXpLeyUIGAZ2SHNYTEapm7/8A9nLPoyvVp3RK/EPFqn5kEznyWgYZNsRtYYIWbuG8KA== + +cspell-dict-bash@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/cspell-dict-bash/-/cspell-dict-bash-1.0.3.tgz#e3cf0e2dbe56f18c68a16c3eb8037d418e88c3cd" + integrity sha512-pEGuoZXhgqhpmmvdEoNY/XYDrypI37y0Z09VgKTHEblzTHo++vLyd4Z8r1SY3kJ2eQejduz4IL7ZGXqgtEp2vw== + dependencies: + configstore "^5.0.0" + +cspell-dict-companies@^1.0.20: + version "1.0.20" + resolved "https://registry.yarnpkg.com/cspell-dict-companies/-/cspell-dict-companies-1.0.20.tgz#75c76f6128cebdcfd8c89a0d62e37635f4a1cefe" + integrity sha512-LpDV5YMNV0vG8/LA4S8bbHNwaxI3gHTsCe0XZSGMRFlxO3bWWhi3Il3KB3pdDArDaopTGZKCMXDQsYFy5WHhQA== + dependencies: + configstore "^5.0.0" + +cspell-dict-cpp@^1.1.26: + version "1.1.26" + resolved "https://registry.yarnpkg.com/cspell-dict-cpp/-/cspell-dict-cpp-1.1.26.tgz#67e3f8d26ec2c49d305b086013935f0b0fade2e0" + integrity sha512-ywY7X6UzC5BC7fQhyRAwZHurl52GjwnY6D2wG57JJ/bcT5IsJOWpLAjHORtUH2AcCp6BSAKR6wxl6/bqSuKHJw== + dependencies: + configstore "^5.0.0" + +cspell-dict-django@^1.0.14: + version "1.0.14" + resolved "https://registry.yarnpkg.com/cspell-dict-django/-/cspell-dict-django-1.0.14.tgz#f75b0fd28b61f9fcd32f9fe04a2abc3bba1b9af9" + integrity sha512-HG/hzldjx2SCOCNP8R4Va3rsiDtOItPhIc6FAKaqp8+6upaCkZmu0QU4RUobbWOyUkZX/WUX5jJRrlj5ZMBjyg== + dependencies: + configstore "^5.0.0" + +cspell-dict-dotnet@^1.0.14: + version "1.0.14" + resolved "https://registry.yarnpkg.com/cspell-dict-dotnet/-/cspell-dict-dotnet-1.0.14.tgz#780c3143d340e3211be27df7cfd2d9d1f82b24c5" + integrity sha512-gTuh94tNAVMS4XmVCK2AsFgKp2mXBk2b8+f2GLCw2K8HY6QUHlvOJg051JJrZABRW/lAoquKZuqssSo9B1mgng== + dependencies: + configstore "^5.0.0" + +cspell-dict-elixir@^1.0.13: + version "1.0.13" + resolved "https://registry.yarnpkg.com/cspell-dict-elixir/-/cspell-dict-elixir-1.0.13.tgz#f3d08b27d2ee2a25fcae5050820d5680028e95d5" + integrity sha512-KWDO4NeV3QuMlZxSWpN0sPiFN4GE5AzlDi75eSKRvq/f1+pxgxgXQ5zLNPnDbr2EOSJBV34paZwI+7PvCiTTgA== + dependencies: + configstore "^5.0.0" + +cspell-dict-en-gb@^1.1.14: + version "1.1.16" + resolved "https://registry.yarnpkg.com/cspell-dict-en-gb/-/cspell-dict-en-gb-1.1.16.tgz#75155e43c21e972ac2f60117b69fd53b5701335f" + integrity sha512-PBzHF40fVj+6Adm3dV3/uhkE2Ptu8W+WJ28socBDDpEfedFMwnC0rpxvAgmKJlLc0OYsn07/yzRnt9srisNrLg== + dependencies: + configstore "^5.0.0" + +cspell-dict-en_us@^1.2.23: + version "1.2.24" + resolved "https://registry.yarnpkg.com/cspell-dict-en_us/-/cspell-dict-en_us-1.2.24.tgz#a30026dfcc2e614f0dd09cd2e6fa033a01152eab" + integrity sha512-EINpnko8JlKGod64Sx5JYZHmUH1rNYaE90ALgqlnWins/t2MEi3ma5u0I7Ghh+/RiNRlcNErrVJxYb2xpeqiJg== + dependencies: + configstore "^5.0.0" + +cspell-dict-fonts@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/cspell-dict-fonts/-/cspell-dict-fonts-1.0.5.tgz#df96979e07d68cd186fe20eae0113e939d880c4f" + integrity sha512-R9A/MVDzqEQbwXaZhmNJ7bSzzkH5YSJ5UDr3wDRk7FXzNNcuJ4J9WRbkDjCDnoVfg0kCx0FeEp0fme+PbLTeng== + dependencies: + configstore "^5.0.0" + +cspell-dict-fullstack@^1.0.21: + version "1.0.22" + resolved "https://registry.yarnpkg.com/cspell-dict-fullstack/-/cspell-dict-fullstack-1.0.22.tgz#54122342ff408082f904c6c20e3facb36df0762c" + integrity sha512-k8Op1ltkgKnMTTo/kgkywE0htwi+3EtYrPPWk+mD9o3IFgC6yLKA89Tkrd0kEEPR3qJvC4gQJmGJns6Y25v0Zg== + dependencies: + configstore "^5.0.0" + +cspell-dict-golang@^1.1.14: + version "1.1.14" + resolved "https://registry.yarnpkg.com/cspell-dict-golang/-/cspell-dict-golang-1.1.14.tgz#5567d823a3e58b8f4c783bea185e95580008d47e" + integrity sha512-V9TQQjoTgdLTpLNczEjoF+BO+CkdmuZlD6J71SCT8sczSP0FLz4QkL1MpqiL0lhdnbtASsjs+oCF53Y+dWdh9g== + dependencies: + configstore "^5.0.0" + +cspell-dict-haskell@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/cspell-dict-haskell/-/cspell-dict-haskell-1.0.4.tgz#98a3a00fb72d39f3b94aa019fac7ed86ab73dbd8" + integrity sha512-Wy5EE446icPbsi8bLqSCOtxS5Z6QDLGNBvz6Nh+yvuLf7Nb8mU6NQmfSYH/yMfJoVGa5bpcmv8pQtJV4I2E5Tg== + dependencies: + configstore "^5.0.0" + +cspell-dict-html-symbol-entities@^1.0.13: + version "1.0.13" + resolved "https://registry.yarnpkg.com/cspell-dict-html-symbol-entities/-/cspell-dict-html-symbol-entities-1.0.13.tgz#41b770fa08f82b20f9e3c7f234a320bbb1dee851" + integrity sha512-u8BARt4r5rdUee7Yw6ejsD69WLib9l+pyBr4UUIZovhCUccddm2LkS9GDJUqWtCf/frZpoTnmpuW/NPWVVG6pQ== + dependencies: + configstore "^5.0.0" + +cspell-dict-java@^1.0.12: + version "1.0.12" + resolved "https://registry.yarnpkg.com/cspell-dict-java/-/cspell-dict-java-1.0.12.tgz#d0220153984a0ccf6bbd69617f324ab11ce4a3fe" + integrity sha512-9pg5IrCEZGlWLgv8qGjxzzca19egfBYrbnuiWhJNLbBGBOTWrwYjFqbLQtMJReXUtWikWLY0KCzRZlCGusr7bw== + dependencies: + configstore "^5.0.0" + +cspell-dict-latex@^1.0.13: + version "1.0.13" + resolved "https://registry.yarnpkg.com/cspell-dict-latex/-/cspell-dict-latex-1.0.13.tgz#cdbbc2ebda7b82d44a3574d53b6f5b9a6d0644bb" + integrity sha512-UZqGJQ82mkzseqdF7kWXIrA07VD91W7rWx16DCThDBMohOsFdvCymUUgr0pM90FuqmldSiD+Gi1FayDSyPdNtQ== + dependencies: + configstore "^5.0.0" + +cspell-dict-lorem-ipsum@^1.0.10: + version "1.0.10" + resolved "https://registry.yarnpkg.com/cspell-dict-lorem-ipsum/-/cspell-dict-lorem-ipsum-1.0.10.tgz#3828f43b4df35b258d5d31e4e539c2f6d3f3ce14" + integrity sha512-UlboQ3xH+D3l+hemLO4J5yz8EM60SH91f1dJIy2s94AeePZXtwYh1hTFM5dEsXI2CAQkfTu3ZdPWflLsInPfrA== + dependencies: + configstore "^5.0.0" + +cspell-dict-php@^1.0.13: + version "1.0.13" + resolved "https://registry.yarnpkg.com/cspell-dict-php/-/cspell-dict-php-1.0.13.tgz#83cdab21e52d036303b321bf9bca27a9820661a6" + integrity sha512-RP5XST+hWEqWxlLISS3sXxsQa2YXOWx8X5LcxQHvEGdb1hMNypXxw9V53th7S+hfUTPKJrbUIzckYZp4j8TS4A== + dependencies: + configstore "^5.0.0" + +cspell-dict-powershell@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/cspell-dict-powershell/-/cspell-dict-powershell-1.0.5.tgz#e5b8207e16bf1e030c26059cf8b16979a8c4be12" + integrity sha512-vO4rdojQsmNHvzPdJT/rU2xw03uzs1x7+JJijufDSR+vf277KeQHCUV4+YTm4U7/33XDcPEgYJPT7uhzyjOqmA== + dependencies: + configstore "^5.0.0" + +cspell-dict-python@^1.0.19: + version "1.0.19" + resolved "https://registry.yarnpkg.com/cspell-dict-python/-/cspell-dict-python-1.0.19.tgz#5d9322917a9945ee11de39fbb416ad293cfdba8a" + integrity sha512-u1jU+4kNn/ds/Wm+oSNy8ZfR6ebK7otNJnxRKXehJfbWWxTbK+vyJF5MThS4osub7fI1FZKW4nPrPjYWIqDevA== + dependencies: + configstore "^5.0.0" + +cspell-dict-ruby@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/cspell-dict-ruby/-/cspell-dict-ruby-1.0.3.tgz#bbda30306af9c9274b8848005d9f73f1d3513651" + integrity sha512-uFxUyGj9SRASfnd75lcpkoNvMYHNWmqkFmS9ZruL61M1RmFx9eekuEY74nK11qsb/E4o6yPtGAQH4SrotF9SwQ== + dependencies: + configstore "^5.0.0" + +cspell-dict-rust@^1.0.12: + version "1.0.12" + resolved "https://registry.yarnpkg.com/cspell-dict-rust/-/cspell-dict-rust-1.0.12.tgz#323eedd0137d8019df08f02d9c1956d9778d0baa" + integrity sha512-bMt70/aQL2OcadZRtWfPIF/mHWX9JNOGq92UUU2ka+9C3OPBP/TuyYiHhUWt67y/CoIyEQ7/5uAtjX8paLf14w== + dependencies: + configstore "^5.0.0" + +cspell-dict-scala@^1.0.11: + version "1.0.11" + resolved "https://registry.yarnpkg.com/cspell-dict-scala/-/cspell-dict-scala-1.0.11.tgz#42533b2c850fe6eb64946708fd19e66824b842a7" + integrity sha512-bmAQjapvcceJaiwGTkBd9n2L9GaqpmFDKe5S19WQDsWqjFiDwQ+r47td3TU7yWjOLPqp72h9X/XGzDJFvQEPcg== + dependencies: + configstore "^5.0.0" + +cspell-dict-software-terms@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/cspell-dict-software-terms/-/cspell-dict-software-terms-1.0.5.tgz#dad030d4fd59a696fc8f1d323d47ac5b825a9773" + integrity sha512-sFkij2gLxml+yDJZYoUCgj/iaWG8rXOfKzQYE2ON3kA9N+x2xfO1nGOEMukkoRggRhXee1TWV0bJ6Wqekl/Clg== + dependencies: + configstore "^5.0.0" + +cspell-dict-typescript@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/cspell-dict-typescript/-/cspell-dict-typescript-1.0.3.tgz#89d540fdca9c5e22416b42084f737ffe169eaf42" + integrity sha512-j6sVvLUuPCTw5Iqc1D1zB3mWJQTMNshEOmChJfz8vFeBMbu7oj61rLbnhnn2x8kXguKmWN5jhhKnsBIp++jRZA== + dependencies: + configstore "^5.0.0" + +cspell-glob@^0.1.13: + version "0.1.13" + resolved "https://registry.yarnpkg.com/cspell-glob/-/cspell-glob-0.1.13.tgz#9e52d21eb13d89b250f84c759931ebe6ff310071" + integrity sha512-0C4Im4cfFz7oKZjECsnWx9pfk1c1/i8BQr4WMjBokEnTBxA6Idg3S8lff3CdXokK4H0HbO+rxLHx7aQvHA27ag== + dependencies: + micromatch "^4.0.2" + +cspell-io@^4.0.19: + version "4.0.19" + resolved "https://registry.yarnpkg.com/cspell-io/-/cspell-io-4.0.19.tgz#2c432c14fa6d2296c08afe300a00d7cebea095a3" + integrity sha512-ZDIDDNWtvGi0bCNE8v5Q6pD49raCFxGZkfAsWjs8Q+4FT1X1BiyjNlvEO1csPTxhC9o+MlCkhdpxEnv+QZZCBQ== + dependencies: + iconv-lite "^0.4.24" + iterable-to-stream "^1.0.1" + +cspell-lib@^4.1.13: + version "4.1.13" + resolved "https://registry.yarnpkg.com/cspell-lib/-/cspell-lib-4.1.13.tgz#6db3d05e47feba29a34682c2f1a8b44c900ee308" + integrity sha512-s3gdPOQyqOW//bW9efdXWasqaOGjwj7jVoRLvLocN13Ls8Em2TAr33r6+sKTYkiOXBlTdUZuU5tDNWJjqkdrBw== + dependencies: + comment-json "^1.1.3" + configstore "^5.0.0" + cspell-dict-bash "^1.0.3" + cspell-dict-companies "^1.0.20" + cspell-dict-cpp "^1.1.26" + cspell-dict-django "^1.0.14" + cspell-dict-dotnet "^1.0.14" + cspell-dict-elixir "^1.0.13" + cspell-dict-en-gb "^1.1.14" + cspell-dict-en_us "^1.2.23" + cspell-dict-fonts "^1.0.5" + cspell-dict-fullstack "^1.0.21" + cspell-dict-golang "^1.1.14" + cspell-dict-haskell "^1.0.4" + cspell-dict-html-symbol-entities "^1.0.13" + cspell-dict-java "^1.0.12" + cspell-dict-latex "^1.0.13" + cspell-dict-lorem-ipsum "^1.0.10" + cspell-dict-php "^1.0.13" + cspell-dict-powershell "^1.0.5" + cspell-dict-python "^1.0.19" + cspell-dict-ruby "^1.0.3" + cspell-dict-rust "^1.0.12" + cspell-dict-scala "^1.0.11" + cspell-dict-software-terms "^1.0.5" + cspell-dict-typescript "^1.0.3" + cspell-io "^4.0.19" + cspell-trie-lib "^4.1.7" + cspell-util-bundle "^4.0.8" + fs-extra "^8.1.0" + gensequence "^3.0.1" + vscode-uri "^2.1.1" + +cspell-trie-lib@^4.1.7: + version "4.1.7" + resolved "https://registry.yarnpkg.com/cspell-trie-lib/-/cspell-trie-lib-4.1.7.tgz#7f3f182cc2e886d4f84fb9ddb23f0a1cf3387122" + integrity sha512-iO9ntmF4lR1iSoxuLFnhR59Jvf99B2D6D/zgmxV5JmfPTXA4SrU3VjaIBAHmyafAT+qy3akaYOmGoyj8auIHfg== + dependencies: + gensequence "^3.0.1" + +cspell-util-bundle@^4.0.8: + version "4.0.8" + resolved "https://registry.yarnpkg.com/cspell-util-bundle/-/cspell-util-bundle-4.0.8.tgz#e1646aa275b9ac27b51cf45a96556e7cc0b98b82" + integrity sha512-sybpmdyE5VZ2jH7q7toAIwXE2w3wp5Db09OXIrdav1t9wy7kCwUaEqYQtn4hqTM5+9HehDkSg0+lDvTuKKbhNg== + +cspell@^4.0.43: + version "4.0.43" + resolved "https://registry.yarnpkg.com/cspell/-/cspell-4.0.43.tgz#2467936f880b2700382f5dd59ed210cc7e4d0ba8" + integrity sha512-msnehTsodBA7XX/lnEdQPC2jqhvdsb7Mqd/Ps2OSNmN0nS1fHYAC9wx2hD5E6wRCfsCmxxcaW0s1VXi0v26ujQ== + dependencies: + chalk "^2.4.2" + commander "^2.20.3" + comment-json "^1.1.3" + cspell-glob "^0.1.13" + cspell-lib "^4.1.13" + fs-extra "^8.1.0" + gensequence "^3.0.1" + get-stdin "^7.0.0" + glob "^7.1.6" + minimatch "^3.0.4" + cssom@0.3.x, "cssom@>= 0.3.2 < 0.4.0": version "0.3.8" resolved "https://registry.yarnpkg.com/cssom/-/cssom-0.3.8.tgz#9f1276f5b2b463f2114d3f2c75250af8c1a36f4a" @@ -2865,6 +3111,13 @@ dot-prop@^4.2.0: dependencies: is-obj "^1.0.0" +dot-prop@^5.1.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/dot-prop/-/dot-prop-5.2.0.tgz#c34ecc29556dc45f1f4c22697b6f4904e0cc4fcb" + integrity sha512-uEUyaDKoSQ1M4Oq8l45hSE26SnTxL6snNnqvK/VWx5wJhmff5z0FUVJDKDanor/6w3kzE3i7XZOk+7wC0EXr1A== + dependencies: + is-obj "^2.0.0" + duplexer@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/duplexer/-/duplexer-0.1.1.tgz#ace6ff808c1ce66b57d1ebf97977acb02334cfc1" @@ -3113,6 +3366,11 @@ espree@^6.1.2: acorn-jsx "^5.1.0" eslint-visitor-keys "^1.1.0" +esprima@^2.7.0: + version "2.7.3" + resolved "https://registry.yarnpkg.com/esprima/-/esprima-2.7.3.tgz#96e3b70d5779f6ad49cd032673d1c312767ba581" + integrity sha1-luO3DVd59q1JzQMmc9HDEnZ7pYE= + esprima@^3.1.3: version "3.1.3" resolved "https://registry.yarnpkg.com/esprima/-/esprima-3.1.3.tgz#fdca51cee6133895e3c88d535ce49dbff62a4633" @@ -3198,11 +3456,6 @@ execa@^2.0.3: signal-exit "^3.0.2" strip-final-newline "^2.0.0" -exit-hook@^1.0.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/exit-hook/-/exit-hook-1.1.1.tgz#f05ca233b48c05d54fff07765df8507e95c02ff8" - integrity sha1-8FyiM7SMBdVP/wd2XfhQfpXAL/g= - exit@^0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" @@ -3255,20 +3508,11 @@ extend-shallow@^3.0.0, extend-shallow@^3.0.2: assign-symbols "^1.0.0" is-extendable "^1.0.1" -extend@^3.0.0, extend@~3.0.2: +extend@~3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g== -external-editor@^1.1.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-1.1.1.tgz#12d7b0db850f7ff7e7081baf4005700060c4600b" - integrity sha1-Etew24UPf/fnCBuvQAVwAGDEYAs= - dependencies: - extend "^3.0.0" - spawn-sync "^1.0.15" - tmp "^0.0.29" - external-editor@^3.0.3: version "3.1.0" resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-3.1.0.tgz#cb03f740befae03ea4d283caed2741a83f335495" @@ -3360,7 +3604,7 @@ figgy-pudding@^3.4.1, figgy-pudding@^3.5.1: resolved "https://registry.yarnpkg.com/figgy-pudding/-/figgy-pudding-3.5.1.tgz#862470112901c727a0e495a80744bd5baa1d6790" integrity sha512-vNKxJHTEKNThjfrdJwHc7brvM6eVevuO5nTj6ez8ZQ1qbXTvGthucRF7S4vf2cr71QVnT70V34v0S1DyQsti0w== -figures@^1.3.5, figures@^1.7.0: +figures@^1.7.0: version "1.7.0" resolved "https://registry.yarnpkg.com/figures/-/figures-1.7.0.tgz#cbe1e3affcf1cd44b80cadfed28dc793a9701d2e" integrity sha1-y+Hjr/zxzUS4DK3+0o3Hk6lwHS4= @@ -3481,18 +3725,11 @@ flush-write-stream@^1.0.0: inherits "^2.0.3" readable-stream "^2.3.6" -for-in@^1.0.1, for-in@^1.0.2: +for-in@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" integrity sha1-gQaNKVqBQuwKxybG4iAMMPttXoA= -for-own@^0.1.4: - version "0.1.5" - resolved "https://registry.yarnpkg.com/for-own/-/for-own-0.1.5.tgz#5265c681a4f294dabbf17c9509b6763aa84510ce" - integrity sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4= - dependencies: - for-in "^1.0.1" - forever-agent@~0.6.1: version "0.6.1" resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" @@ -3590,6 +3827,11 @@ genfun@^5.0.0: resolved "https://registry.yarnpkg.com/genfun/-/genfun-5.0.0.tgz#9dd9710a06900a5c4a5bf57aca5da4e52fe76537" integrity sha512-KGDOARWVga7+rnB3z9Sd2Letx515owfk0hSxHGuqjANb1M+x2bGZGqHLiozPsYMdM2OubeMni/Hpwmjq6qIUhA== +gensequence@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/gensequence/-/gensequence-3.0.1.tgz#eb7dbc800fc02e65499a222f2fafc0ba0d0553ca" + integrity sha512-7yfgY5sMmsZP74N6eWjX2MPwecbfpYdJS0MmxZz+7iWPV566XunxPlmcNaSXW8BpVsXk36sYQCcEaJxVmFeLnQ== + get-caller-file@^2.0.1: version "2.0.5" resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" @@ -3809,17 +4051,6 @@ globby@^10.0.1: merge2 "^1.2.3" slash "^3.0.0" -globby@^6.1.0: - version "6.1.0" - resolved "https://registry.yarnpkg.com/globby/-/globby-6.1.0.tgz#f5a6d70e8395e21c858fb0489d64df02424d506c" - integrity sha1-9abXDoOV4hyFj7BInWTfAkJNUGw= - dependencies: - array-union "^1.0.1" - glob "^7.0.3" - object-assign "^4.0.1" - pify "^2.0.0" - pinkie-promise "^2.0.0" - globby@^9.2.0: version "9.2.0" resolved "https://registry.yarnpkg.com/globby/-/globby-9.2.0.tgz#fd029a706c703d29bdd170f4b6db3a3f7a7cb63d" @@ -3989,11 +4220,6 @@ humanize-ms@^1.2.1: dependencies: ms "^2.0.0" -hunspell-spellchecker@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/hunspell-spellchecker/-/hunspell-spellchecker-1.0.2.tgz#a10b0bd2fa00a65ab62a4c6b734ce496d318910e" - integrity sha1-oQsL0voAplq2Kkxrc0zkltMYkQ4= - husky@^3.0.9: version "3.0.9" resolved "https://registry.yarnpkg.com/husky/-/husky-3.0.9.tgz#a2c3e9829bfd6b4957509a9500d2eef5dbfc8044" @@ -4142,26 +4368,6 @@ inquirer@6.5.0: strip-ansi "^5.1.0" through "^2.3.6" -inquirer@^1.0.0: - version "1.2.3" - resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-1.2.3.tgz#4dec6f32f37ef7bb0b2ed3f1d1a5c3f545074918" - integrity sha1-TexvMvN+97sLLtPx0aXD9UUHSRg= - dependencies: - ansi-escapes "^1.1.0" - chalk "^1.0.0" - cli-cursor "^1.0.1" - cli-width "^2.0.0" - external-editor "^1.1.0" - figures "^1.3.5" - lodash "^4.3.0" - mute-stream "0.0.6" - pinkie-promise "^2.0.0" - run-async "^2.2.0" - rx "^4.1.0" - string-width "^1.0.1" - strip-ansi "^3.0.0" - through "^2.3.6" - inquirer@^6.2.0, inquirer@^6.2.1: version "6.5.2" resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-6.5.2.tgz#ad50942375d036d327ff528c08bd5fab089928ca" @@ -4372,6 +4578,11 @@ is-obj@^1.0.0, is-obj@^1.0.1: resolved "https://registry.yarnpkg.com/is-obj/-/is-obj-1.0.1.tgz#3e4729ac1f5fde025cd7d83a896dab9f4f67db0f" integrity sha1-PkcprB9f3gJc19g6iW2rn09n2w8= +is-obj@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-obj/-/is-obj-2.0.0.tgz#473fb05d973705e3fd9620545018ca8e22ef4982" + integrity sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w== + is-observable@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/is-observable/-/is-observable-1.1.0.tgz#b3e986c8f44de950867cab5403f5a3465005975e" @@ -4463,7 +4674,7 @@ is-text-path@^2.0.0: dependencies: text-extensions "^2.0.0" -is-typedarray@~1.0.0: +is-typedarray@^1.0.0, is-typedarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" integrity sha1-5HnICFjfDBsR3dppQPlgEfzaSpo= @@ -4568,6 +4779,11 @@ istanbul-reports@^2.2.6: dependencies: handlebars "^4.1.2" +iterable-to-stream@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/iterable-to-stream/-/iterable-to-stream-1.0.1.tgz#37e86baacf6b1a0e9233dad4eb526d0423d08bf3" + integrity sha512-O62gD5ADMUGtJoOoM9U6LQ7i4byPXUNoHJ6mqsmkQJcom331ZJGDApWgDESWyBMEHEJRjtHozgIiTzYo9RU4UA== + jest-changed-files@^24.9.0: version "24.9.0" resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-24.9.0.tgz#08d8c15eb79a7fa3fc98269bc14b451ee82f8039" @@ -4927,7 +5143,7 @@ jest@^24.9.0: resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== -js-yaml@^3.10.0, js-yaml@^3.13.1: +js-yaml@^3.13.1: version "3.13.1" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.13.1.tgz#aff151b30bfdfa8e49e05da22e7415e9dfa37847" integrity sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw== @@ -4991,6 +5207,13 @@ json-parse-better-errors@^1.0.0, json-parse-better-errors@^1.0.1: resolved "https://registry.yarnpkg.com/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz#bb867cfb3450e69107c131d1c514bab3dc8bcaa9" integrity sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw== +json-parser@^1.0.0: + version "1.1.5" + resolved "https://registry.yarnpkg.com/json-parser/-/json-parser-1.1.5.tgz#e62ec5261d1a6a5fc20e812a320740c6d9005677" + integrity sha1-5i7FJh0aal/CDoEqMgdAxtkAVnc= + dependencies: + esprima "^2.7.0" + json-schema-traverse@^0.4.1: version "0.4.1" resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" @@ -5319,7 +5542,7 @@ lodash@4.17.14: resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.14.tgz#9ce487ae66c96254fe20b599f21b6816028078ba" integrity sha512-mmKYbW3GLuJeX+iGP+Y7Gp1AiGHGbXHCOh/jZmrawMmsE7MS4znI3RL2FsjbqOyMayHInjOeykW7PEajUk1/xw== -lodash@4.17.15, lodash@^4.11.2, lodash@^4.17.11, lodash@^4.17.12, lodash@^4.17.13, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.2.1, lodash@^4.3.0: +lodash@4.17.15, lodash@^4.11.2, lodash@^4.17.11, lodash@^4.17.12, lodash@^4.17.13, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.2.1: version "4.17.15" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548" integrity sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A== @@ -5394,6 +5617,13 @@ make-dir@^2.1.0: pify "^4.0.1" semver "^5.6.0" +make-dir@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-3.0.0.tgz#1b5f39f6b9270ed33f9f054c5c0f84304989f801" + integrity sha512-grNJDhb8b1Jm1qeqW5R/O63wUo4UXo2v2HMic6YT9i/HBlF93S8jkMgH7yugvY9ABDShH4VZMn8I+U8+fCNegw== + dependencies: + semver "^6.0.0" + make-error@1.x, make-error@^1.1.1: version "1.3.5" resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.5.tgz#efe4e81f6db28cadd605c70f29c831b58ef776c8" @@ -5445,26 +5675,6 @@ map-visit@^1.0.0: dependencies: object-visit "^1.0.0" -markdown-spellcheck@^1.3.1: - version "1.3.1" - resolved "https://registry.yarnpkg.com/markdown-spellcheck/-/markdown-spellcheck-1.3.1.tgz#e901b04631e759ad8903470db3261013c2712602" - integrity sha512-9uyovbDg3Kh2H89VDtqOkXKS9wuRgpLvOHXzPYWMR71tHQZWt2CAf28EIpXNhkFqqoEjXYAx+fXLuKufApYHRQ== - dependencies: - async "^2.1.4" - chalk "^2.0.1" - commander "^2.8.1" - globby "^6.1.0" - hunspell-spellchecker "^1.0.2" - inquirer "^1.0.0" - js-yaml "^3.10.0" - marked "^0.3.5" - sinon-as-promised "^4.0.0" - -marked@^0.3.5: - version "0.3.19" - resolved "https://registry.yarnpkg.com/marked/-/marked-0.3.19.tgz#5d47f709c4c9fc3c216b6d46127280f40b39d790" - integrity sha512-ea2eGWOqNxPcXv8dyERdSr/6FmzvWwzjMxpfGB/sbMccXoct+xY+YukPD+QTUZwyvK7BZwcr4m21WBOW41pAkg== - marked@^0.7.0: version "0.7.0" resolved "https://registry.yarnpkg.com/marked/-/marked-0.7.0.tgz#b64201f051d271b1edc10a04d1ae9b74bb8e5c0e" @@ -5700,11 +5910,6 @@ multimatch@^3.0.0: arrify "^1.0.1" minimatch "^3.0.4" -mute-stream@0.0.6: - version "0.0.6" - resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.6.tgz#48962b19e169fd1dfc240b3f1e7317627bbc47db" - integrity sha1-SJYrGeFp/R38JAs/HnMXYnu8R9s= - mute-stream@0.0.7: version "0.0.7" resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab" @@ -5746,11 +5951,6 @@ nanomatch@^1.2.9: snapdragon "^0.8.1" to-regex "^3.0.1" -native-promise-only@~0.8.1: - version "0.8.1" - resolved "https://registry.yarnpkg.com/native-promise-only/-/native-promise-only-0.8.1.tgz#20a318c30cb45f71fe7adfbf7b21c99c1472ef11" - integrity sha1-IKMYwwy0X3H+et+/eyHJnBRy7xE= - natural-compare@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" @@ -6017,14 +6217,6 @@ object.getownpropertydescriptors@^2.0.3: define-properties "^1.1.2" es-abstract "^1.5.1" -object.omit@~2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/object.omit/-/object.omit-2.0.1.tgz#1a9c744829f39dbb858c76ca3579ae2a54ebd1fa" - integrity sha1-Gpx0SCnznbuFjHbKNXmuKlTr0fo= - dependencies: - for-own "^0.1.4" - is-extendable "^0.1.1" - object.pick@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/object.pick/-/object.pick-1.3.0.tgz#87a10ac4c1694bd2e1cbf53591a66141fb5dd747" @@ -6054,11 +6246,6 @@ once@^1.3.0, once@^1.3.1, once@^1.4.0: dependencies: wrappy "1" -onetime@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/onetime/-/onetime-1.1.0.tgz#a1f7838f8314c516f05ecefcbc4ccfe04b4ed789" - integrity sha1-ofeDj4MUxRbwXs78vEzP4EtO14k= - onetime@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/onetime/-/onetime-2.0.1.tgz#067428230fd67443b2794b22bba528b6867962d4" @@ -6123,12 +6310,7 @@ os-name@^3.1.0: macos-release "^2.2.0" windows-release "^3.1.0" -os-shim@^0.1.2: - version "0.1.3" - resolved "https://registry.yarnpkg.com/os-shim/-/os-shim-0.1.3.tgz#6b62c3791cf7909ea35ed46e17658bb417cb3917" - integrity sha1-a2LDeRz3kJ6jXtRuF2WLtBfLORc= - -os-tmpdir@^1.0.0, os-tmpdir@~1.0.1, os-tmpdir@~1.0.2: +os-tmpdir@^1.0.0, os-tmpdir@~1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" integrity sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ= @@ -6954,14 +7136,6 @@ resolve@1.x, resolve@^1.1.6, resolve@^1.10.0, resolve@^1.11.0, resolve@^1.3.2, r dependencies: path-parse "^1.0.6" -restore-cursor@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-1.0.1.tgz#34661f46886327fed2991479152252df92daa541" - integrity sha1-NGYfRohjJ/7SmRR5FSJS35LapUE= - dependencies: - exit-hook "^1.0.0" - onetime "^1.0.0" - restore-cursor@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-2.0.0.tgz#9f7ee287f82fd326d4fd162923d62129eee0dfaf" @@ -7048,11 +7222,6 @@ run-queue@^1.0.0, run-queue@^1.0.3: dependencies: aproba "^1.1.1" -rx@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/rx/-/rx-4.1.0.tgz#a5f13ff79ef3b740fe30aa803fb09f98805d4782" - integrity sha1-pfE/957zt0D+MKqAP7CfmIBdR4I= - rxjs@^6.3.3, rxjs@^6.4.0: version "6.5.3" resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.5.3.tgz#510e26317f4db91a7eb1de77d9dd9ba0a4899a3a" @@ -7173,14 +7342,6 @@ signal-exit@^3.0.0, signal-exit@^3.0.2: resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" integrity sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0= -sinon-as-promised@^4.0.0: - version "4.0.3" - resolved "https://registry.yarnpkg.com/sinon-as-promised/-/sinon-as-promised-4.0.3.tgz#c0545b1685fd813588a4ed697012487ed11d151b" - integrity sha1-wFRbFoX9gTWIpO1pcBJIftEdFRs= - dependencies: - create-thenable "~1.0.0" - native-promise-only "~0.8.1" - sisteransi@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/sisteransi/-/sisteransi-1.0.3.tgz#98168d62b79e3a5e758e27ae63c4a053d748f4eb" @@ -7312,14 +7473,6 @@ source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.1: resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== -spawn-sync@^1.0.15: - version "1.0.15" - resolved "https://registry.yarnpkg.com/spawn-sync/-/spawn-sync-1.0.15.tgz#b00799557eb7fb0c8376c29d44e8a1ea67e57476" - integrity sha1-sAeZVX63+wyDdsKdROih6mfldHY= - dependencies: - concat-stream "^1.4.7" - os-shim "^0.1.2" - spdx-correct@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.1.0.tgz#fb83e504445268f154b074e218c87c003cd31df4" @@ -7738,13 +7891,6 @@ through@2, "through@>=2.2.7 <3", through@^2.3.4, through@^2.3.6: resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" integrity sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU= -tmp@^0.0.29: - version "0.0.29" - resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.29.tgz#f25125ff0dd9da3ccb0c2dd371ee1288bb9128c0" - integrity sha1-8lEl/w3Z2jzLDC3Tce4SiLuRKMA= - dependencies: - os-tmpdir "~1.0.1" - tmp@^0.0.33: version "0.0.33" resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9" @@ -7943,6 +8089,13 @@ type-fest@^0.8.1: resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.8.1.tgz#09e249ebde851d3b1e48d27c105444667f17b83d" integrity sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA== +typedarray-to-buffer@^3.1.5: + version "3.1.5" + resolved "https://registry.yarnpkg.com/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz#a97ee7a9ff42691b9f783ff1bc5112fe3fca9080" + integrity sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q== + dependencies: + is-typedarray "^1.0.0" + typedarray@^0.0.6: version "0.0.6" resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" @@ -7981,11 +8134,6 @@ union-value@^1.0.0: is-extendable "^0.1.1" set-value "^2.0.1" -unique-concat@~0.2.2: - version "0.2.2" - resolved "https://registry.yarnpkg.com/unique-concat/-/unique-concat-0.2.2.tgz#9210f9bdcaacc5e1e3929490d7c019df96f18712" - integrity sha1-khD5vcqsxeHjkpSQ18AZ35bxhxI= - unique-filename@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/unique-filename/-/unique-filename-1.1.1.tgz#1d69769369ada0583103a1e6ae87681b56573230" @@ -8000,6 +8148,13 @@ unique-slug@^2.0.0: dependencies: imurmurhash "^0.1.4" +unique-string@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/unique-string/-/unique-string-2.0.0.tgz#39c6451f81afb2749de2b233e3f7c5e8843bd89d" + integrity sha512-uNaeirEPvpZWSgzwsPGtU2zVSTrn/8L5q/IexZmH0eH6SA73CmAA5U4GwORTxQAZs95TAXLNqeLoPPNO5gZfWg== + dependencies: + crypto-random-string "^2.0.0" + universal-user-agent@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/universal-user-agent/-/universal-user-agent-4.0.0.tgz#27da2ec87e32769619f68a14996465ea1cb9df16" @@ -8091,6 +8246,11 @@ verror@1.10.0: core-util-is "1.0.2" extsprintf "^1.2.0" +vscode-uri@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/vscode-uri/-/vscode-uri-2.1.1.tgz#5aa1803391b6ebdd17d047f51365cf62c38f6e90" + integrity sha512-eY9jmGoEnVf8VE8xr5znSah7Qt1P/xsCdErz+g8HYZtJ7bZqKH5E3d+6oVNm1AC/c6IHUDokbmVXKOi4qPAC9A== + w3c-hr-time@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/w3c-hr-time/-/w3c-hr-time-1.0.1.tgz#82ac2bff63d950ea9e3189a58a65625fedf19045" @@ -8233,6 +8393,16 @@ write-file-atomic@^2.0.0, write-file-atomic@^2.3.0, write-file-atomic@^2.4.2: imurmurhash "^0.1.4" signal-exit "^3.0.2" +write-file-atomic@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-3.0.1.tgz#558328352e673b5bb192cf86500d60b230667d4b" + integrity sha512-JPStrIyyVJ6oCSz/691fAjFtefZ6q+fP6tm+OS4Qw6o+TGQxNp1ziY2PgS+X/m0V8OWhZiO/m4xSj+Pr4RrZvw== + dependencies: + imurmurhash "^0.1.4" + is-typedarray "^1.0.0" + signal-exit "^3.0.2" + typedarray-to-buffer "^3.1.5" + write-json-file@^2.2.0: version "2.3.0" resolved "https://registry.yarnpkg.com/write-json-file/-/write-json-file-2.3.0.tgz#2b64c8a33004d54b8698c76d585a77ceb61da32f" @@ -8279,6 +8449,11 @@ ws@^5.2.0: dependencies: async-limiter "~1.0.0" +xdg-basedir@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/xdg-basedir/-/xdg-basedir-4.0.0.tgz#4bc8d9984403696225ef83a1573cbbcb4e79db13" + integrity sha512-PSNhEJDejZYV7h50BohL09Er9VaIefr2LMAf3OEmpCkjOi34eYyQYAXUTjEQtZJTKcF0E2UKTh+osDLsgNim9Q== + xml-name-validator@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/xml-name-validator/-/xml-name-validator-3.0.0.tgz#6ae73e06de4d8c6e47f9fb181f78d648ad457c6a" From 05964763b6e1f4bbb0f54db9995f5ad02e2c8d9c Mon Sep 17 00:00:00 2001 From: James Henry Date: Mon, 30 Dec 2019 18:01:27 +0000 Subject: [PATCH 7/7] chore: publish v2.14.0 --- CHANGELOG.md | 17 +++++++++++++++++ lerna.json | 2 +- packages/eslint-plugin-internal/CHANGELOG.md | 11 +++++++++++ packages/eslint-plugin-internal/package.json | 7 +++---- packages/eslint-plugin-tslint/CHANGELOG.md | 8 ++++++++ packages/eslint-plugin-tslint/package.json | 6 +++--- packages/eslint-plugin/CHANGELOG.md | 16 ++++++++++++++++ packages/eslint-plugin/package.json | 4 ++-- packages/experimental-utils/CHANGELOG.md | 11 +++++++++++ packages/experimental-utils/package.json | 4 ++-- packages/parser/CHANGELOG.md | 11 +++++++++++ packages/parser/package.json | 8 ++++---- packages/shared-fixtures/CHANGELOG.md | 11 +++++++++++ packages/shared-fixtures/package.json | 2 +- packages/typescript-estree/CHANGELOG.md | 16 ++++++++++++++++ packages/typescript-estree/package.json | 4 ++-- 16 files changed, 119 insertions(+), 19 deletions(-) create mode 100644 packages/eslint-plugin-internal/CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md index f3d23525651f..6f008a8e461c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,23 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [2.14.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.13.0...v2.14.0) (2019-12-30) + + +### Bug Fixes + +* **eslint-plugin:** type assertion in rule no-extra-parens ([#1376](https://github.com/typescript-eslint/typescript-eslint/issues/1376)) ([f40639e](https://github.com/typescript-eslint/typescript-eslint/commit/f40639e)) +* **typescript-estree:** visit typeParameters in OptionalCallExpr ([#1377](https://github.com/typescript-eslint/typescript-eslint/issues/1377)) ([cba6a2a](https://github.com/typescript-eslint/typescript-eslint/commit/cba6a2a)) + + +### Features + +* add internal eslint plugin for repo-specific lint rules ([#1373](https://github.com/typescript-eslint/typescript-eslint/issues/1373)) ([3a15413](https://github.com/typescript-eslint/typescript-eslint/commit/3a15413)) + + + + + # [2.13.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.12.0...v2.13.0) (2019-12-23) diff --git a/lerna.json b/lerna.json index 597f3b6dcb0c..10c3ad308134 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "2.13.0", + "version": "2.14.0", "npmClient": "yarn", "useWorkspaces": true, "stream": true diff --git a/packages/eslint-plugin-internal/CHANGELOG.md b/packages/eslint-plugin-internal/CHANGELOG.md new file mode 100644 index 000000000000..dfc1e0a77238 --- /dev/null +++ b/packages/eslint-plugin-internal/CHANGELOG.md @@ -0,0 +1,11 @@ +# Change Log + +All notable changes to this project will be documented in this file. +See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. + +# [2.14.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.13.0...v2.14.0) (2019-12-30) + + +### Features + +* add internal eslint plugin for repo-specific lint rules ([#1373](https://github.com/typescript-eslint/typescript-eslint/issues/1373)) ([3a15413](https://github.com/typescript-eslint/typescript-eslint/commit/3a15413)) diff --git a/packages/eslint-plugin-internal/package.json b/packages/eslint-plugin-internal/package.json index d8c69d15f6fa..5b960acef3c0 100644 --- a/packages/eslint-plugin-internal/package.json +++ b/packages/eslint-plugin-internal/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/eslint-plugin-internal", - "version": "2.13.0", + "version": "2.14.0", "private": true, "main": "dist/index.js", "scripts": { @@ -12,7 +12,6 @@ "typecheck": "tsc -p tsconfig.json --noEmit" }, "dependencies": { - "@typescript-eslint/experimental-utils": "2.13.0" - }, - "devDependencies": {} + "@typescript-eslint/experimental-utils": "2.14.0" + } } diff --git a/packages/eslint-plugin-tslint/CHANGELOG.md b/packages/eslint-plugin-tslint/CHANGELOG.md index e5eb511430e6..2493b23fbc8e 100644 --- a/packages/eslint-plugin-tslint/CHANGELOG.md +++ b/packages/eslint-plugin-tslint/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [2.14.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.13.0...v2.14.0) (2019-12-30) + +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint + + + + + # [2.13.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.12.0...v2.13.0) (2019-12-23) diff --git a/packages/eslint-plugin-tslint/package.json b/packages/eslint-plugin-tslint/package.json index 5e983b2bcca5..70fcea181282 100644 --- a/packages/eslint-plugin-tslint/package.json +++ b/packages/eslint-plugin-tslint/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/eslint-plugin-tslint", - "version": "2.13.0", + "version": "2.14.0", "main": "dist/index.js", "typings": "src/index.ts", "description": "TSLint wrapper plugin for ESLint", @@ -31,7 +31,7 @@ "typecheck": "tsc -p tsconfig.json --noEmit" }, "dependencies": { - "@typescript-eslint/experimental-utils": "2.13.0", + "@typescript-eslint/experimental-utils": "2.14.0", "lodash.memoize": "^4.1.2" }, "peerDependencies": { @@ -41,6 +41,6 @@ }, "devDependencies": { "@types/lodash.memoize": "^4.1.4", - "@typescript-eslint/parser": "2.13.0" + "@typescript-eslint/parser": "2.14.0" } } diff --git a/packages/eslint-plugin/CHANGELOG.md b/packages/eslint-plugin/CHANGELOG.md index 5e7d8a0a996b..19b45ab9e82d 100644 --- a/packages/eslint-plugin/CHANGELOG.md +++ b/packages/eslint-plugin/CHANGELOG.md @@ -3,6 +3,22 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [2.14.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.13.0...v2.14.0) (2019-12-30) + + +### Bug Fixes + +* **eslint-plugin:** type assertion in rule no-extra-parens ([#1376](https://github.com/typescript-eslint/typescript-eslint/issues/1376)) ([f40639e](https://github.com/typescript-eslint/typescript-eslint/commit/f40639e)) + + +### Features + +* add internal eslint plugin for repo-specific lint rules ([#1373](https://github.com/typescript-eslint/typescript-eslint/issues/1373)) ([3a15413](https://github.com/typescript-eslint/typescript-eslint/commit/3a15413)) + + + + + # [2.13.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.12.0...v2.13.0) (2019-12-23) diff --git a/packages/eslint-plugin/package.json b/packages/eslint-plugin/package.json index c276473e88bf..449adb762db6 100644 --- a/packages/eslint-plugin/package.json +++ b/packages/eslint-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/eslint-plugin", - "version": "2.13.0", + "version": "2.14.0", "description": "TypeScript plugin for ESLint", "keywords": [ "eslint", @@ -40,7 +40,7 @@ "typecheck": "tsc -p tsconfig.json --noEmit" }, "dependencies": { - "@typescript-eslint/experimental-utils": "2.13.0", + "@typescript-eslint/experimental-utils": "2.14.0", "eslint-utils": "^1.4.3", "functional-red-black-tree": "^1.0.1", "regexpp": "^3.0.0", diff --git a/packages/experimental-utils/CHANGELOG.md b/packages/experimental-utils/CHANGELOG.md index 3175f78a32b9..6fae6018c5fd 100644 --- a/packages/experimental-utils/CHANGELOG.md +++ b/packages/experimental-utils/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [2.14.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.13.0...v2.14.0) (2019-12-30) + + +### Features + +* add internal eslint plugin for repo-specific lint rules ([#1373](https://github.com/typescript-eslint/typescript-eslint/issues/1373)) ([3a15413](https://github.com/typescript-eslint/typescript-eslint/commit/3a15413)) + + + + + # [2.13.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.12.0...v2.13.0) (2019-12-23) **Note:** Version bump only for package @typescript-eslint/experimental-utils diff --git a/packages/experimental-utils/package.json b/packages/experimental-utils/package.json index 8cd63e5bfef1..995f9452df89 100644 --- a/packages/experimental-utils/package.json +++ b/packages/experimental-utils/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/experimental-utils", - "version": "2.13.0", + "version": "2.14.0", "description": "(Experimental) Utilities for working with TypeScript + ESLint together", "keywords": [ "eslint", @@ -36,7 +36,7 @@ }, "dependencies": { "@types/json-schema": "^7.0.3", - "@typescript-eslint/typescript-estree": "2.13.0", + "@typescript-eslint/typescript-estree": "2.14.0", "eslint-scope": "^5.0.0" }, "peerDependencies": { diff --git a/packages/parser/CHANGELOG.md b/packages/parser/CHANGELOG.md index a3b442dab032..da92fe57ddd2 100644 --- a/packages/parser/CHANGELOG.md +++ b/packages/parser/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [2.14.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.13.0...v2.14.0) (2019-12-30) + + +### Bug Fixes + +* **typescript-estree:** visit typeParameters in OptionalCallExpr ([#1377](https://github.com/typescript-eslint/typescript-eslint/issues/1377)) ([cba6a2a](https://github.com/typescript-eslint/typescript-eslint/commit/cba6a2a)) + + + + + # [2.13.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.12.0...v2.13.0) (2019-12-23) diff --git a/packages/parser/package.json b/packages/parser/package.json index a3dcc64af5b3..f7e59d93d783 100644 --- a/packages/parser/package.json +++ b/packages/parser/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/parser", - "version": "2.13.0", + "version": "2.14.0", "description": "An ESLint custom parser which leverages TypeScript ESTree", "main": "dist/parser.js", "types": "dist/parser.d.ts", @@ -43,13 +43,13 @@ }, "dependencies": { "@types/eslint-visitor-keys": "^1.0.0", - "@typescript-eslint/experimental-utils": "2.13.0", - "@typescript-eslint/typescript-estree": "2.13.0", + "@typescript-eslint/experimental-utils": "2.14.0", + "@typescript-eslint/typescript-estree": "2.14.0", "eslint-visitor-keys": "^1.1.0" }, "devDependencies": { "@types/glob": "^7.1.1", - "@typescript-eslint/shared-fixtures": "2.13.0", + "@typescript-eslint/shared-fixtures": "2.14.0", "glob": "*" }, "peerDependenciesMeta": { diff --git a/packages/shared-fixtures/CHANGELOG.md b/packages/shared-fixtures/CHANGELOG.md index 8edd6d2a8e28..e48d107de649 100644 --- a/packages/shared-fixtures/CHANGELOG.md +++ b/packages/shared-fixtures/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [2.14.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.13.0...v2.14.0) (2019-12-30) + + +### Bug Fixes + +* **typescript-estree:** visit typeParameters in OptionalCallExpr ([#1377](https://github.com/typescript-eslint/typescript-eslint/issues/1377)) ([cba6a2a](https://github.com/typescript-eslint/typescript-eslint/commit/cba6a2a)) + + + + + # [2.13.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.12.0...v2.13.0) (2019-12-23) diff --git a/packages/shared-fixtures/package.json b/packages/shared-fixtures/package.json index 9bdffdd04d50..ceb51bc56a62 100644 --- a/packages/shared-fixtures/package.json +++ b/packages/shared-fixtures/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/shared-fixtures", - "version": "2.13.0", + "version": "2.14.0", "private": true, "scripts": { "build": "tsc -b tsconfig.build.json", diff --git a/packages/typescript-estree/CHANGELOG.md b/packages/typescript-estree/CHANGELOG.md index 2e61d9b42a41..beeed3ee12db 100644 --- a/packages/typescript-estree/CHANGELOG.md +++ b/packages/typescript-estree/CHANGELOG.md @@ -3,6 +3,22 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [2.14.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.13.0...v2.14.0) (2019-12-30) + + +### Bug Fixes + +* **typescript-estree:** visit typeParameters in OptionalCallExpr ([#1377](https://github.com/typescript-eslint/typescript-eslint/issues/1377)) ([cba6a2a](https://github.com/typescript-eslint/typescript-eslint/commit/cba6a2a)) + + +### Features + +* add internal eslint plugin for repo-specific lint rules ([#1373](https://github.com/typescript-eslint/typescript-eslint/issues/1373)) ([3a15413](https://github.com/typescript-eslint/typescript-eslint/commit/3a15413)) + + + + + # [2.13.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.12.0...v2.13.0) (2019-12-23) diff --git a/packages/typescript-estree/package.json b/packages/typescript-estree/package.json index 116293b04650..c20b6a390254 100644 --- a/packages/typescript-estree/package.json +++ b/packages/typescript-estree/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/typescript-estree", - "version": "2.13.0", + "version": "2.14.0", "description": "A parser that converts TypeScript source code into an ESTree compatible form", "main": "dist/parser.js", "types": "dist/parser.d.ts", @@ -59,7 +59,7 @@ "@types/lodash.unescape": "^4.0.4", "@types/semver": "^6.2.0", "@types/tmp": "^0.1.0", - "@typescript-eslint/shared-fixtures": "2.13.0", + "@typescript-eslint/shared-fixtures": "2.14.0", "lodash.isplainobject": "4.0.6", "tmp": "^0.1.0", "typescript": "*"