From ced65918b16f46c383496a9b4bd43eca8a76baf6 Mon Sep 17 00:00:00 2001 From: Brad Zacher Date: Mon, 6 Jul 2020 10:59:10 -0700 Subject: [PATCH 1/6] fix(eslint-plugin): [space-before-function-paren] incorrect handling of abstract methods (#2275) Fixes #2274 --- .../src/rules/space-before-function-paren.ts | 18 +++++++++++------- .../rules/space-before-function-paren.test.ts | 13 +++++++++++++ 2 files changed, 24 insertions(+), 7 deletions(-) diff --git a/packages/eslint-plugin/src/rules/space-before-function-paren.ts b/packages/eslint-plugin/src/rules/space-before-function-paren.ts index f06327e2dd59..e2ccfa5182db 100644 --- a/packages/eslint-plugin/src/rules/space-before-function-paren.ts +++ b/packages/eslint-plugin/src/rules/space-before-function-paren.ts @@ -76,9 +76,10 @@ export default util.createRule({ | TSESTree.ArrowFunctionExpression | TSESTree.FunctionDeclaration | TSESTree.FunctionExpression - | TSESTree.TSAbstractMethodDefinition, + | TSESTree.TSEmptyBodyFunctionExpression + | TSESTree.TSDeclareFunction, ): boolean { - if ('id' in node && node.id != null) { + if (node.id != null) { return true; } @@ -102,7 +103,8 @@ export default util.createRule({ | TSESTree.ArrowFunctionExpression | TSESTree.FunctionDeclaration | TSESTree.FunctionExpression - | TSESTree.TSAbstractMethodDefinition, + | TSESTree.TSEmptyBodyFunctionExpression + | TSESTree.TSDeclareFunction, ): FuncOption { if (node.type === AST_NODE_TYPES.ArrowFunctionExpression) { // Always ignore non-async functions and arrow functions without parens, e.g. async foo => bar @@ -116,7 +118,7 @@ export default util.createRule({ return overrideConfig.named ?? baseConfig; // `generator-star-spacing` should warn anonymous generators. E.g. `function* () {}` - } else if (!('generator' in node) || node.generator === false) { + } else if (!node.generator) { return overrideConfig.anonymous ?? baseConfig; } @@ -133,7 +135,8 @@ export default util.createRule({ | TSESTree.ArrowFunctionExpression | TSESTree.FunctionDeclaration | TSESTree.FunctionExpression - | TSESTree.TSAbstractMethodDefinition, + | TSESTree.TSEmptyBodyFunctionExpression + | TSESTree.TSDeclareFunction, ): void { const functionConfig = getConfigForFunction(node); @@ -165,7 +168,7 @@ export default util.createRule({ } else if ( !hasSpacing && functionConfig === 'always' && - (!node.typeParameters || ('id' in node && node != null)) + (!node.typeParameters || node.id) ) { context.report({ node, @@ -180,7 +183,8 @@ export default util.createRule({ ArrowFunctionExpression: checkFunction, FunctionDeclaration: checkFunction, FunctionExpression: checkFunction, - TSAbstractMethodDefinition: checkFunction, + TSEmptyBodyFunctionExpression: checkFunction, + TSDeclareFunction: checkFunction, }; }, }); diff --git a/packages/eslint-plugin/tests/rules/space-before-function-paren.test.ts b/packages/eslint-plugin/tests/rules/space-before-function-paren.test.ts index 5de3b0e6378d..13c68b88bc79 100644 --- a/packages/eslint-plugin/tests/rules/space-before-function-paren.test.ts +++ b/packages/eslint-plugin/tests/rules/space-before-function-paren.test.ts @@ -153,6 +153,19 @@ ruleTester.run('space-before-function-paren', rule, { code: 'abstract class Foo { constructor() {} abstract method() }', options: ['never'], }, + { + code: 'abstract class Foo { constructor() {} abstract method() }', + options: [{ anonymous: 'always', named: 'never' }], + }, + 'function foo ();', + { + code: 'function foo();', + options: ['never'], + }, + { + code: 'function foo();', + options: [{ anonymous: 'always', named: 'never' }], + }, ], invalid: [ From 00ac9c3ccaad27bab08ec3c3a104f612bb593df5 Mon Sep 17 00:00:00 2001 From: Brad Zacher Date: Mon, 6 Jul 2020 11:12:20 -0700 Subject: [PATCH 2/6] fix(eslint-plugin): [prefer-literal-enum-member] allow negative numbers (#2277) --- .../src/rules/prefer-literal-enum-member.ts | 25 +++++++--- .../rules/prefer-literal-enum-member.test.ts | 48 +++++++++++++++++++ 2 files changed, 66 insertions(+), 7 deletions(-) diff --git a/packages/eslint-plugin/src/rules/prefer-literal-enum-member.ts b/packages/eslint-plugin/src/rules/prefer-literal-enum-member.ts index 8f95fd5946b5..4377b29dc8f9 100644 --- a/packages/eslint-plugin/src/rules/prefer-literal-enum-member.ts +++ b/packages/eslint-plugin/src/rules/prefer-literal-enum-member.ts @@ -1,7 +1,7 @@ import { AST_NODE_TYPES } from '@typescript-eslint/experimental-utils'; import { createRule } from '../util'; -export default createRule<[], 'notLiteral'>({ +export default createRule({ name: 'prefer-literal-enum-member', meta: { type: 'suggestion', @@ -22,15 +22,26 @@ export default createRule<[], 'notLiteral'>({ return { TSEnumMember(node): void { // If there is no initializer, then this node is just the name of the member, so ignore. + if (node.initializer == null) { + return; + } + // any old literal + if (node.initializer.type === AST_NODE_TYPES.Literal) { + return; + } + // -1 and +1 if ( - node.initializer != null && - node.initializer.type !== AST_NODE_TYPES.Literal + node.initializer.type === AST_NODE_TYPES.UnaryExpression && + ['+', '-'].includes(node.initializer.operator) && + node.initializer.argument.type === AST_NODE_TYPES.Literal ) { - context.report({ - node: node.id, - messageId: 'notLiteral', - }); + return; } + + context.report({ + node: node.id, + messageId: 'notLiteral', + }); }, }; }, diff --git a/packages/eslint-plugin/tests/rules/prefer-literal-enum-member.test.ts b/packages/eslint-plugin/tests/rules/prefer-literal-enum-member.test.ts index 4e309edc3572..1f5efac80279 100644 --- a/packages/eslint-plugin/tests/rules/prefer-literal-enum-member.test.ts +++ b/packages/eslint-plugin/tests/rules/prefer-literal-enum-member.test.ts @@ -23,6 +23,16 @@ enum ValidNumber { } `, ` +enum ValidNumber { + A = -42, +} + `, + ` +enum ValidNumber { + A = +42, +} + `, + ` enum ValidNull { A = null, } @@ -121,6 +131,44 @@ enum InvalidExpression { }, { code: ` +enum InvalidExpression { + A = delete 2, + B = -a, + C = void 2, + D = ~2, + E = !0, +} + `, + errors: [ + { + messageId: 'notLiteral', + line: 3, + column: 3, + }, + { + messageId: 'notLiteral', + line: 4, + column: 3, + }, + { + messageId: 'notLiteral', + line: 5, + column: 3, + }, + { + messageId: 'notLiteral', + line: 6, + column: 3, + }, + { + messageId: 'notLiteral', + line: 7, + column: 3, + }, + ], + }, + { + code: ` const variable = 'Test'; enum InvalidVariable { A = 'TestStr', From 742b679339e5a16be684ba8949af3c773bfe6c04 Mon Sep 17 00:00:00 2001 From: Bill Barry Date: Wed, 8 Jul 2020 02:24:56 -0400 Subject: [PATCH 3/6] docs: add note about node support (#2282) --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index d327f2d355b2..f1f6f77c6460 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,7 @@ - [Package Versions](#package-versions) - [Supported TypeScript Version](#supported-typescript-version) - [Supported ESLint version](#supported-eslint-version) +- [Supported Node version](#supported-node-version) - [License](#license) - [Contributors](#contributors) - [Contributing Guide](#contributing-guide) @@ -250,6 +251,10 @@ If you use a non-supported version of TypeScript, the parser will log a warning See the value of `eslint` declared in `@typescript-eslint/eslint-plugin`'s [package.json](./packages/eslint-plugin/package.json). +## Supported Node version + +This project makes an effort to support Active LTS and Maintenance LTS release statuses of Node according to [Node's release document](https://nodejs.org/en/about/releases/). Support for specific Current status releases are considered periodically. + ## License TypeScript ESLint inherits from the the original TypeScript ESLint Parser license, as the majority of the work began there. It is licensed under a permissive BSD 2-clause license. From 98ab010fb7fca884984bb4200fd806ecee8071b6 Mon Sep 17 00:00:00 2001 From: Karishnu Poddar Date: Fri, 10 Jul 2020 12:47:02 +0530 Subject: [PATCH 4/6] fix(eslint-plugin): [switch-exhaustiveness-check] handle special characters in enum keys (#2207) --- .../src/rules/switch-exhaustiveness-check.ts | 40 ++++++- .../rules/switch-exhaustiveness-check.test.ts | 111 ++++++++++++++++++ 2 files changed, 149 insertions(+), 2 deletions(-) diff --git a/packages/eslint-plugin/src/rules/switch-exhaustiveness-check.ts b/packages/eslint-plugin/src/rules/switch-exhaustiveness-check.ts index d9e14bcf3316..d8a7750efbaa 100644 --- a/packages/eslint-plugin/src/rules/switch-exhaustiveness-check.ts +++ b/packages/eslint-plugin/src/rules/switch-exhaustiveness-check.ts @@ -32,6 +32,25 @@ export default createRule({ const sourceCode = context.getSourceCode(); const service = getParserServices(context); const checker = service.program.getTypeChecker(); + const compilerOptions = service.program.getCompilerOptions(); + + function requiresQuoting(name: string): boolean { + if (name.length === 0) { + return true; + } + + if (!ts.isIdentifierStart(name.charCodeAt(0), compilerOptions.target)) { + return true; + } + + for (let i = 1; i < name.length; i += 1) { + if (!ts.isIdentifierPart(name.charCodeAt(i), compilerOptions.target)) { + return true; + } + } + + return false; + } function getNodeType(node: TSESTree.Node): ts.Type { const tsNode = service.esTreeNodeToTSNodeMap.get(node); @@ -42,6 +61,7 @@ export default createRule({ fixer: TSESLint.RuleFixer, node: TSESTree.SwitchStatement, missingBranchTypes: Array, + symbolName?: string, ): TSESLint.RuleFix | null { const lastCase = node.cases.length > 0 ? node.cases[node.cases.length - 1] : null; @@ -67,7 +87,17 @@ export default createRule({ continue; } - const caseTest = checker.typeToString(missingBranchType); + const missingBranchName = missingBranchType.getSymbol()?.escapedName; + let caseTest = checker.typeToString(missingBranchType); + + if ( + symbolName && + (missingBranchName || missingBranchName === '') && + requiresQuoting(missingBranchName.toString()) + ) { + caseTest = `${symbolName}['${missingBranchName}']`; + } + const errorMessage = `Not implemented yet: ${caseTest} case`; missingCases.push( @@ -101,6 +131,7 @@ export default createRule({ function checkSwitchExhaustive(node: TSESTree.SwitchStatement): void { const discriminantType = getNodeType(node.discriminant); + const symbolName = discriminantType.getSymbol()?.escapedName; if (discriminantType.isUnion()) { const unionTypes = unionTypeParts(discriminantType); @@ -139,7 +170,12 @@ export default createRule({ { messageId: 'addMissingCases', fix(fixer): TSESLint.RuleFix | null { - return fixSwitch(fixer, node, missingBranchTypes); + return fixSwitch( + fixer, + node, + missingBranchTypes, + symbolName?.toString(), + ); }, }, ], diff --git a/packages/eslint-plugin/tests/rules/switch-exhaustiveness-check.test.ts b/packages/eslint-plugin/tests/rules/switch-exhaustiveness-check.test.ts index 3eb47fb6eb94..415afc20fc1c 100644 --- a/packages/eslint-plugin/tests/rules/switch-exhaustiveness-check.test.ts +++ b/packages/eslint-plugin/tests/rules/switch-exhaustiveness-check.test.ts @@ -483,6 +483,117 @@ function test(value: T): number { case 1: { throw new Error('Not implemented yet: 1 case') } case 2: { throw new Error('Not implemented yet: 2 case') } } +} + `.trimRight(), + }, + ], + }, + ], + }, + { + // keys include special characters + code: ` +export enum Enum { + 'test-test' = 'test-test', + 'test' = 'test', +} + +function test(arg: Enum): string { + switch (arg) { + } +} + `.trimRight(), + errors: [ + { + messageId: 'switchIsNotExhaustive', + suggestions: [ + { + messageId: 'addMissingCases', + output: noFormat` +export enum Enum { + 'test-test' = 'test-test', + 'test' = 'test', +} + +function test(arg: Enum): string { + switch (arg) { + case Enum['test-test']: { throw new Error('Not implemented yet: Enum['test-test'] case') } + case Enum.test: { throw new Error('Not implemented yet: Enum.test case') } + } +} + `.trimRight(), + }, + ], + }, + ], + }, + { + // keys include empty string + code: ` +export enum Enum { + '' = 'test-test', + 'test' = 'test', +} + +function test(arg: Enum): string { + switch (arg) { + } +} + `.trimRight(), + errors: [ + { + messageId: 'switchIsNotExhaustive', + suggestions: [ + { + messageId: 'addMissingCases', + output: noFormat` +export enum Enum { + '' = 'test-test', + 'test' = 'test', +} + +function test(arg: Enum): string { + switch (arg) { + case Enum['']: { throw new Error('Not implemented yet: Enum[''] case') } + case Enum.test: { throw new Error('Not implemented yet: Enum.test case') } + } +} + `.trimRight(), + }, + ], + }, + ], + }, + { + // keys include number as first character + code: ` +export enum Enum { + '9test' = 'test-test', + 'test' = 'test', +} + +function test(arg: Enum): string { + switch (arg) { + } +} + `.trimRight(), + errors: [ + { + messageId: 'switchIsNotExhaustive', + suggestions: [ + { + messageId: 'addMissingCases', + output: noFormat` +export enum Enum { + '9test' = 'test-test', + 'test' = 'test', +} + +function test(arg: Enum): string { + switch (arg) { + case Enum['9test']: { throw new Error('Not implemented yet: Enum['9test'] case') } + case Enum.test: { throw new Error('Not implemented yet: Enum.test case') } + } } `.trimRight(), }, From 3a187cafb7302a3c05de0e6a236dd142a5e2d741 Mon Sep 17 00:00:00 2001 From: YeonJuan Date: Mon, 13 Jul 2020 12:53:16 +0900 Subject: [PATCH 5/6] fix(eslint-plugin): [no-unnecessary-condition] handle computed member access (#2288) --- .../src/rules/no-unnecessary-condition.ts | 33 +++- .../rules/no-unnecessary-condition.test.ts | 171 ++++++++++++++++++ 2 files changed, 203 insertions(+), 1 deletion(-) diff --git a/packages/eslint-plugin/src/rules/no-unnecessary-condition.ts b/packages/eslint-plugin/src/rules/no-unnecessary-condition.ts index 1147957a20cb..0103919e14ae 100644 --- a/packages/eslint-plugin/src/rules/no-unnecessary-condition.ts +++ b/packages/eslint-plugin/src/rules/no-unnecessary-condition.ts @@ -24,6 +24,7 @@ import { isIdentifier, isTypeAnyType, isTypeUnknownType, + getTypeName, } from '../util'; // Truthiness utilities @@ -435,6 +436,33 @@ export default createRule({ return false; } + function isNullablePropertyType( + objType: ts.Type, + propertyType: ts.Type, + ): boolean { + if (propertyType.isUnion()) { + return propertyType.types.some(type => + isNullablePropertyType(objType, type), + ); + } + if (propertyType.isNumberLiteral() || propertyType.isStringLiteral()) { + const propType = checker.getTypeOfPropertyOfType( + objType, + propertyType.value.toString(), + ); + if (propType) { + return isNullableType(propType, { allowUndefined: true }); + } + } + const typeName = getTypeName(checker, propertyType); + return !!( + (typeName === 'string' && + checker.getIndexInfoOfType(objType, ts.IndexKind.String)) || + (typeName === 'number' && + checker.getIndexInfoOfType(objType, ts.IndexKind.Number)) + ); + } + // Checks whether a member expression is nullable or not regardless of it's previous node. // Example: // ``` @@ -450,10 +478,13 @@ export default createRule({ const property = node.property; if (prevType.isUnion() && isIdentifier(property)) { const isOwnNullable = prevType.types.some(type => { + if (node.computed) { + const propertyType = getNodeType(node.property); + return isNullablePropertyType(type, propertyType); + } const propType = checker.getTypeOfPropertyOfType(type, property.name); return propType && isNullableType(propType, { allowUndefined: true }); }); - return ( !isOwnNullable && isNullableType(prevType, { allowUndefined: true }) ); diff --git a/packages/eslint-plugin/tests/rules/no-unnecessary-condition.test.ts b/packages/eslint-plugin/tests/rules/no-unnecessary-condition.test.ts index 81bc96874b84..ce65e717fa0c 100644 --- a/packages/eslint-plugin/tests/rules/no-unnecessary-condition.test.ts +++ b/packages/eslint-plugin/tests/rules/no-unnecessary-condition.test.ts @@ -398,6 +398,53 @@ type Bar = { baz: null | string | { qux: string } }; declare const foo: { fooOrBar: Foo | Bar } | null; foo?.fooOrBar?.baz?.qux; `, + ` +type Foo = { [key: string]: string } | null; +declare const foo: Foo; + +const key = '1'; +foo?.[key]?.trim(); + `, + ` +type Foo = { [key: string]: string; foo: 'foo'; bar: 'bar' } | null; +type Key = 'bar' | 'foo'; +declare const foo: Foo; +declare const key: Key; + +foo?.[key].trim(); + `, + ` +interface Outer { + inner?: { + [key: string]: string | undefined; + }; +} + +function Foo(outer: Outer, key: string): number | undefined { + return outer.inner?.[key]?.charCodeAt(0); +} + `, + ` +interface Outer { + inner?: { + [key: string]: string | undefined; + bar: 'bar'; + }; +} +type Foo = 'foo'; + +function Foo(outer: Outer, key: Foo): number | undefined { + return outer.inner?.[key]?.charCodeAt(0); +} + `, + ` +type Foo = { [key: string]: string; foo: 'foo'; bar: 'bar' } | null; +type Key = 'bar' | 'foo' | 'baz'; +declare const foo: Foo; +declare const key: Key; + +foo?.[key]?.trim(); + `, ], invalid: [ // Ensure that it's checking in all the right places @@ -1196,5 +1243,129 @@ foo?.fooOrBar.baz?.qux; }, ], }, + { + code: ` +type Foo = { [key: string]: string; foo: 'foo'; bar: 'bar' } | null; +type Key = 'bar' | 'foo'; +declare const foo: Foo; +declare const key: Key; + +foo?.[key]?.trim(); + `, + output: ` +type Foo = { [key: string]: string; foo: 'foo'; bar: 'bar' } | null; +type Key = 'bar' | 'foo'; +declare const foo: Foo; +declare const key: Key; + +foo?.[key].trim(); + `, + errors: [ + { + messageId: 'neverOptionalChain', + line: 7, + endLine: 7, + column: 11, + endColumn: 13, + }, + ], + }, + { + code: ` +type Foo = { [key: string]: string; foo: 'foo'; bar: 'bar' } | null; +declare const foo: Foo; +const key = 'bar'; +foo?.[key]?.trim(); + `, + output: ` +type Foo = { [key: string]: string; foo: 'foo'; bar: 'bar' } | null; +declare const foo: Foo; +const key = 'bar'; +foo?.[key].trim(); + `, + errors: [ + { + messageId: 'neverOptionalChain', + line: 5, + endLine: 5, + column: 11, + endColumn: 13, + }, + ], + }, + { + code: ` +interface Outer { + inner?: { + [key: string]: string | undefined; + bar: 'bar'; + }; +} + +export function test(outer: Outer): number | undefined { + const key = 'bar'; + return outer.inner?.[key]?.charCodeAt(0); +} + `, + output: ` +interface Outer { + inner?: { + [key: string]: string | undefined; + bar: 'bar'; + }; +} + +export function test(outer: Outer): number | undefined { + const key = 'bar'; + return outer.inner?.[key].charCodeAt(0); +} + `, + errors: [ + { + messageId: 'neverOptionalChain', + line: 11, + endLine: 11, + column: 28, + endColumn: 30, + }, + ], + }, + { + code: ` +interface Outer { + inner?: { + [key: string]: string | undefined; + bar: 'bar'; + }; +} +type Bar = 'bar'; + +function Foo(outer: Outer, key: Bar): number | undefined { + return outer.inner?.[key]?.charCodeAt(0); +} + `, + output: ` +interface Outer { + inner?: { + [key: string]: string | undefined; + bar: 'bar'; + }; +} +type Bar = 'bar'; + +function Foo(outer: Outer, key: Bar): number | undefined { + return outer.inner?.[key].charCodeAt(0); +} + `, + errors: [ + { + messageId: 'neverOptionalChain', + line: 11, + endLine: 11, + column: 28, + endColumn: 30, + }, + ], + }, ], }); From adcee02d779f1faade877cb4a2692af5141ef09f Mon Sep 17 00:00:00 2001 From: James Henry Date: Mon, 13 Jul 2020 17:02:20 +0000 Subject: [PATCH 6/6] chore: publish v3.6.1 --- CHANGELOG.md | 14 ++++++++++++++ lerna.json | 2 +- packages/eslint-plugin-internal/CHANGELOG.md | 8 ++++++++ packages/eslint-plugin-internal/package.json | 4 ++-- packages/eslint-plugin-tslint/CHANGELOG.md | 8 ++++++++ packages/eslint-plugin-tslint/package.json | 6 +++--- packages/eslint-plugin/CHANGELOG.md | 14 ++++++++++++++ packages/eslint-plugin/package.json | 4 ++-- packages/experimental-utils/CHANGELOG.md | 8 ++++++++ packages/experimental-utils/package.json | 6 +++--- packages/parser/CHANGELOG.md | 8 ++++++++ packages/parser/package.json | 10 +++++----- packages/scope-manager/CHANGELOG.md | 8 ++++++++ packages/scope-manager/package.json | 8 ++++---- packages/shared-fixtures/CHANGELOG.md | 8 ++++++++ packages/shared-fixtures/package.json | 2 +- packages/types/CHANGELOG.md | 8 ++++++++ packages/types/package.json | 2 +- packages/typescript-estree/CHANGELOG.md | 8 ++++++++ packages/typescript-estree/package.json | 8 ++++---- packages/visitor-keys/CHANGELOG.md | 8 ++++++++ packages/visitor-keys/package.json | 4 ++-- 22 files changed, 128 insertions(+), 28 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ae2d6ac88510..5dc48f91bc2b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,20 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [3.6.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.6.0...v3.6.1) (2020-07-13) + + +### Bug Fixes + +* **eslint-plugin:** [no-unnecessary-condition] handle computed member access ([#2288](https://github.com/typescript-eslint/typescript-eslint/issues/2288)) ([3a187ca](https://github.com/typescript-eslint/typescript-eslint/commit/3a187cafb7302a3c05de0e6a236dd142a5e2d741)) +* **eslint-plugin:** [prefer-literal-enum-member] allow negative numbers ([#2277](https://github.com/typescript-eslint/typescript-eslint/issues/2277)) ([00ac9c3](https://github.com/typescript-eslint/typescript-eslint/commit/00ac9c3ccaad27bab08ec3c3a104f612bb593df5)) +* **eslint-plugin:** [space-before-function-paren] incorrect handling of abstract methods ([#2275](https://github.com/typescript-eslint/typescript-eslint/issues/2275)) ([ced6591](https://github.com/typescript-eslint/typescript-eslint/commit/ced65918b16f46c383496a9b4bd43eca8a76baf6)), closes [#2274](https://github.com/typescript-eslint/typescript-eslint/issues/2274) +* **eslint-plugin:** [switch-exhaustiveness-check] handle special characters in enum keys ([#2207](https://github.com/typescript-eslint/typescript-eslint/issues/2207)) ([98ab010](https://github.com/typescript-eslint/typescript-eslint/commit/98ab010fb7fca884984bb4200fd806ecee8071b6)) + + + + + # [3.6.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.5.0...v3.6.0) (2020-07-06) diff --git a/lerna.json b/lerna.json index 3cdd9d61405e..71aca392e447 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "3.6.0", + "version": "3.6.1", "npmClient": "yarn", "useWorkspaces": true, "stream": true diff --git a/packages/eslint-plugin-internal/CHANGELOG.md b/packages/eslint-plugin-internal/CHANGELOG.md index ce050cf30378..6216d01c508d 100644 --- a/packages/eslint-plugin-internal/CHANGELOG.md +++ b/packages/eslint-plugin-internal/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. +## [3.6.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.6.0...v3.6.1) (2020-07-13) + +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal + + + + + # [3.6.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.5.0...v3.6.0) (2020-07-06) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal diff --git a/packages/eslint-plugin-internal/package.json b/packages/eslint-plugin-internal/package.json index 0907aafd1b80..f428ba71d541 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": "3.6.0", + "version": "3.6.1", "private": true, "main": "dist/index.js", "scripts": { @@ -13,7 +13,7 @@ "typecheck": "tsc -p tsconfig.json --noEmit" }, "dependencies": { - "@typescript-eslint/experimental-utils": "3.6.0", + "@typescript-eslint/experimental-utils": "3.6.1", "prettier": "*" } } diff --git a/packages/eslint-plugin-tslint/CHANGELOG.md b/packages/eslint-plugin-tslint/CHANGELOG.md index 81ed76ab7b4c..064a8f6902a6 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. +## [3.6.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.6.0...v3.6.1) (2020-07-13) + +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint + + + + + # [3.6.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.5.0...v3.6.0) (2020-07-06) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint diff --git a/packages/eslint-plugin-tslint/package.json b/packages/eslint-plugin-tslint/package.json index 1b11aad35965..dd5019ec4508 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": "3.6.0", + "version": "3.6.1", "main": "dist/index.js", "typings": "src/index.ts", "description": "TSLint wrapper plugin for ESLint", @@ -32,7 +32,7 @@ "typecheck": "tsc -p tsconfig.json --noEmit" }, "dependencies": { - "@typescript-eslint/experimental-utils": "3.6.0", + "@typescript-eslint/experimental-utils": "3.6.1", "lodash": "^4.17.15" }, "peerDependencies": { @@ -42,6 +42,6 @@ }, "devDependencies": { "@types/lodash": "^4.14.149", - "@typescript-eslint/parser": "3.6.0" + "@typescript-eslint/parser": "3.6.1" } } diff --git a/packages/eslint-plugin/CHANGELOG.md b/packages/eslint-plugin/CHANGELOG.md index 8051b80392b5..194624594b9a 100644 --- a/packages/eslint-plugin/CHANGELOG.md +++ b/packages/eslint-plugin/CHANGELOG.md @@ -3,6 +3,20 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [3.6.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.6.0...v3.6.1) (2020-07-13) + + +### Bug Fixes + +* **eslint-plugin:** [no-unnecessary-condition] handle computed member access ([#2288](https://github.com/typescript-eslint/typescript-eslint/issues/2288)) ([3a187ca](https://github.com/typescript-eslint/typescript-eslint/commit/3a187cafb7302a3c05de0e6a236dd142a5e2d741)) +* **eslint-plugin:** [prefer-literal-enum-member] allow negative numbers ([#2277](https://github.com/typescript-eslint/typescript-eslint/issues/2277)) ([00ac9c3](https://github.com/typescript-eslint/typescript-eslint/commit/00ac9c3ccaad27bab08ec3c3a104f612bb593df5)) +* **eslint-plugin:** [space-before-function-paren] incorrect handling of abstract methods ([#2275](https://github.com/typescript-eslint/typescript-eslint/issues/2275)) ([ced6591](https://github.com/typescript-eslint/typescript-eslint/commit/ced65918b16f46c383496a9b4bd43eca8a76baf6)), closes [#2274](https://github.com/typescript-eslint/typescript-eslint/issues/2274) +* **eslint-plugin:** [switch-exhaustiveness-check] handle special characters in enum keys ([#2207](https://github.com/typescript-eslint/typescript-eslint/issues/2207)) ([98ab010](https://github.com/typescript-eslint/typescript-eslint/commit/98ab010fb7fca884984bb4200fd806ecee8071b6)) + + + + + # [3.6.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.5.0...v3.6.0) (2020-07-06) diff --git a/packages/eslint-plugin/package.json b/packages/eslint-plugin/package.json index 1547b3d95157..de52adf9b044 100644 --- a/packages/eslint-plugin/package.json +++ b/packages/eslint-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/eslint-plugin", - "version": "3.6.0", + "version": "3.6.1", "description": "TypeScript plugin for ESLint", "keywords": [ "eslint", @@ -42,7 +42,7 @@ "typecheck": "tsc -p tsconfig.json --noEmit" }, "dependencies": { - "@typescript-eslint/experimental-utils": "3.6.0", + "@typescript-eslint/experimental-utils": "3.6.1", "debug": "^4.1.1", "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 2c9cc15b7aff..23ef9aaf3468 100644 --- a/packages/experimental-utils/CHANGELOG.md +++ b/packages/experimental-utils/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. +## [3.6.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.6.0...v3.6.1) (2020-07-13) + +**Note:** Version bump only for package @typescript-eslint/experimental-utils + + + + + # [3.6.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.5.0...v3.6.0) (2020-07-06) **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 74a9004ce2fc..bdf57f06f9f3 100644 --- a/packages/experimental-utils/package.json +++ b/packages/experimental-utils/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/experimental-utils", - "version": "3.6.0", + "version": "3.6.1", "description": "(Experimental) Utilities for working with TypeScript + ESLint together", "keywords": [ "eslint", @@ -40,8 +40,8 @@ }, "dependencies": { "@types/json-schema": "^7.0.3", - "@typescript-eslint/types": "3.6.0", - "@typescript-eslint/typescript-estree": "3.6.0", + "@typescript-eslint/types": "3.6.1", + "@typescript-eslint/typescript-estree": "3.6.1", "eslint-scope": "^5.0.0", "eslint-utils": "^2.0.0" }, diff --git a/packages/parser/CHANGELOG.md b/packages/parser/CHANGELOG.md index 6dd2906e4c34..872a5b59d8f2 100644 --- a/packages/parser/CHANGELOG.md +++ b/packages/parser/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. +## [3.6.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.6.0...v3.6.1) (2020-07-13) + +**Note:** Version bump only for package @typescript-eslint/parser + + + + + # [3.6.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.5.0...v3.6.0) (2020-07-06) **Note:** Version bump only for package @typescript-eslint/parser diff --git a/packages/parser/package.json b/packages/parser/package.json index f2d1576fed76..fc22cd42d8dd 100644 --- a/packages/parser/package.json +++ b/packages/parser/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/parser", - "version": "3.6.0", + "version": "3.6.1", "description": "An ESLint custom parser which leverages TypeScript ESTree", "main": "dist/index.js", "types": "dist/index.d.ts", @@ -44,14 +44,14 @@ }, "dependencies": { "@types/eslint-visitor-keys": "^1.0.0", - "@typescript-eslint/experimental-utils": "3.6.0", - "@typescript-eslint/types": "3.6.0", - "@typescript-eslint/typescript-estree": "3.6.0", + "@typescript-eslint/experimental-utils": "3.6.1", + "@typescript-eslint/types": "3.6.1", + "@typescript-eslint/typescript-estree": "3.6.1", "eslint-visitor-keys": "^1.1.0" }, "devDependencies": { "@types/glob": "^7.1.1", - "@typescript-eslint/shared-fixtures": "3.6.0", + "@typescript-eslint/shared-fixtures": "3.6.1", "glob": "*" }, "peerDependenciesMeta": { diff --git a/packages/scope-manager/CHANGELOG.md b/packages/scope-manager/CHANGELOG.md index 1191cc8da765..cbc30126a389 100644 --- a/packages/scope-manager/CHANGELOG.md +++ b/packages/scope-manager/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. +## [3.6.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.6.0...v3.6.1) (2020-07-13) + +**Note:** Version bump only for package @typescript-eslint/scope-manager + + + + + # [3.6.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.5.0...v3.6.0) (2020-07-06) **Note:** Version bump only for package @typescript-eslint/scope-manager diff --git a/packages/scope-manager/package.json b/packages/scope-manager/package.json index c9d9b849d9b4..568d9c6edca9 100644 --- a/packages/scope-manager/package.json +++ b/packages/scope-manager/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/scope-manager", - "version": "3.6.0", + "version": "3.6.1", "description": "TypeScript scope analyser for ESLint", "keywords": [ "eslint", @@ -38,13 +38,13 @@ "typecheck": "tsc -p tsconfig.json --noEmit" }, "dependencies": { - "@typescript-eslint/types": "3.6.0", - "@typescript-eslint/visitor-keys": "3.6.0" + "@typescript-eslint/types": "3.6.1", + "@typescript-eslint/visitor-keys": "3.6.1" }, "devDependencies": { "@types/jest-specific-snapshot": "^0.5.4", "@types/mkdirp": "^1.0.0", - "@typescript-eslint/typescript-estree": "3.6.0", + "@typescript-eslint/typescript-estree": "3.6.1", "glob": "^7.1.6", "jest-specific-snapshot": "^3.0.0", "make-dir": "^3.1.0", diff --git a/packages/shared-fixtures/CHANGELOG.md b/packages/shared-fixtures/CHANGELOG.md index 5a5551971d3b..ee2395cfaa64 100644 --- a/packages/shared-fixtures/CHANGELOG.md +++ b/packages/shared-fixtures/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. +## [3.6.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.6.0...v3.6.1) (2020-07-13) + +**Note:** Version bump only for package @typescript-eslint/shared-fixtures + + + + + # [3.6.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.5.0...v3.6.0) (2020-07-06) **Note:** Version bump only for package @typescript-eslint/shared-fixtures diff --git a/packages/shared-fixtures/package.json b/packages/shared-fixtures/package.json index 835422a5c96e..fe05b33b2af4 100644 --- a/packages/shared-fixtures/package.json +++ b/packages/shared-fixtures/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/shared-fixtures", - "version": "3.6.0", + "version": "3.6.1", "private": true, "scripts": { "build": "tsc -b tsconfig.build.json", diff --git a/packages/types/CHANGELOG.md b/packages/types/CHANGELOG.md index 84e9cb6803c5..67f16da2e19d 100644 --- a/packages/types/CHANGELOG.md +++ b/packages/types/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. +## [3.6.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.6.0...v3.6.1) (2020-07-13) + +**Note:** Version bump only for package @typescript-eslint/types + + + + + # [3.6.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.5.0...v3.6.0) (2020-07-06) **Note:** Version bump only for package @typescript-eslint/types diff --git a/packages/types/package.json b/packages/types/package.json index ef8209c1adc6..f2fed8bd8ff0 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/types", - "version": "3.6.0", + "version": "3.6.1", "description": "Types for the TypeScript-ESTree AST spec", "keywords": [ "eslint", diff --git a/packages/typescript-estree/CHANGELOG.md b/packages/typescript-estree/CHANGELOG.md index 49679224bd52..8acd36793a99 100644 --- a/packages/typescript-estree/CHANGELOG.md +++ b/packages/typescript-estree/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. +## [3.6.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.6.0...v3.6.1) (2020-07-13) + +**Note:** Version bump only for package @typescript-eslint/typescript-estree + + + + + # [3.6.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.5.0...v3.6.0) (2020-07-06) **Note:** Version bump only for package @typescript-eslint/typescript-estree diff --git a/packages/typescript-estree/package.json b/packages/typescript-estree/package.json index 0a6d8c9bda6c..a6205294db06 100644 --- a/packages/typescript-estree/package.json +++ b/packages/typescript-estree/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/typescript-estree", - "version": "3.6.0", + "version": "3.6.1", "description": "A parser that converts TypeScript source code into an ESTree compatible form", "main": "dist/index.js", "types": "dist/index.d.ts", @@ -40,8 +40,8 @@ "typecheck": "tsc -p tsconfig.json --noEmit" }, "dependencies": { - "@typescript-eslint/types": "3.6.0", - "@typescript-eslint/visitor-keys": "3.6.0", + "@typescript-eslint/types": "3.6.1", + "@typescript-eslint/visitor-keys": "3.6.1", "debug": "^4.1.1", "glob": "^7.1.6", "is-glob": "^4.0.1", @@ -60,7 +60,7 @@ "@types/lodash": "^4.14.149", "@types/semver": "^7.1.0", "@types/tmp": "^0.2.0", - "@typescript-eslint/shared-fixtures": "3.6.0", + "@typescript-eslint/shared-fixtures": "3.6.1", "tmp": "^0.2.1", "typescript": "*" }, diff --git a/packages/visitor-keys/CHANGELOG.md b/packages/visitor-keys/CHANGELOG.md index d7cb5e4f7408..55db691bbdd9 100644 --- a/packages/visitor-keys/CHANGELOG.md +++ b/packages/visitor-keys/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. +## [3.6.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.6.0...v3.6.1) (2020-07-13) + +**Note:** Version bump only for package @typescript-eslint/visitor-keys + + + + + # [3.6.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.5.0...v3.6.0) (2020-07-06) **Note:** Version bump only for package @typescript-eslint/visitor-keys diff --git a/packages/visitor-keys/package.json b/packages/visitor-keys/package.json index 13ca2d81037a..0a4e9e164fa0 100644 --- a/packages/visitor-keys/package.json +++ b/packages/visitor-keys/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/visitor-keys", - "version": "3.6.0", + "version": "3.6.1", "description": "Visitor keys used to help traverse the TypeScript-ESTree AST", "keywords": [ "eslint", @@ -39,7 +39,7 @@ "eslint-visitor-keys": "^1.1.0" }, "devDependencies": { - "@typescript-eslint/types": "3.6.0" + "@typescript-eslint/types": "3.6.1" }, "funding": { "type": "opencollective",