diff --git a/CHANGELOG.md b/CHANGELOG.md index 89df8be6ee07..9221aa382dd0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,19 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [5.36.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.36.1...v5.36.2) (2022-09-05) + + +### Bug Fixes + +* **eslint-plugin:** [no-extra-parens] handle generic ts array type. ([#5550](https://github.com/typescript-eslint/typescript-eslint/issues/5550)) ([0d6a190](https://github.com/typescript-eslint/typescript-eslint/commit/0d6a190c56fb3489f9f554b9035a008e29cc08ec)) +* **scope-manager:** correct handling for class static blocks ([#5580](https://github.com/typescript-eslint/typescript-eslint/issues/5580)) ([35bb8dd](https://github.com/typescript-eslint/typescript-eslint/commit/35bb8ddac1b46397f6447c1a6e1e4e1774dd7957)) +* **typescript-estree:** don't double add decorators to a parameter property's parameter ([#5582](https://github.com/typescript-eslint/typescript-eslint/issues/5582)) ([863694c](https://github.com/typescript-eslint/typescript-eslint/commit/863694cbc71b5158ca6a018de8707c9f9fbc22c3)) + + + + + ## [5.36.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.36.0...v5.36.1) (2022-08-30) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 8be7d260525d..8da67fb31f76 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -9,8 +9,8 @@ Thanks goes to these wonderful people:
James Henry

Brad Zacher

Armano
-
Josh Goldberg

Oleksandr T.
+
Josh Goldberg

Michaël De Boey
@@ -20,8 +20,8 @@ Thanks goes to these wonderful people:
Sosuke Suzuki
-
Nicholas C. Zakas

Joshua Chen
+
Nicholas C. Zakas

Jed Fox

YeonJuan

Rafael Santana
@@ -51,11 +51,11 @@ Thanks goes to these wonderful people:
Simen Bekkhus

Kanitkorn Sujautra

cherryblossom
-
Daniil Dubrava

Zzzen
+
Anix
-
Anix
+
Daniil Dubrava

Pete Gonzalez

ldrick

Susisu
@@ -76,17 +76,17 @@ Thanks goes to these wonderful people:
ulrichb
+
Juan García
+
Bryan Mishkin

Daniel Cassidy

Daniel Nixon

Denys Kniazevych
-
Dimitri Mitropoulos
-
Ian MacLeod
+
Dimitri Mitropoulos
+
Ian MacLeod

James Garbutt

Jonathan Delgado
-
Philipp A.
-
Pig Fang
diff --git a/docs/README.md b/docs/README.md index 23cbcd84ffa8..0cc743de8d8a 100644 --- a/docs/README.md +++ b/docs/README.md @@ -10,7 +10,7 @@ These steps will get you running ESLint with our recommended rules on your TypeS ### Step 1: Installation -First, install the required packages for [ESLint](https://eslint.io), [TypeScript](https://typescriptlang.org), and this plugin: +First, install the required packages for [ESLint](https://eslint.org), [TypeScript](https://typescriptlang.org), and this plugin: ```bash npm2yarn npm install --save-dev @typescript-eslint/parser @typescript-eslint/eslint-plugin eslint typescript diff --git a/lerna.json b/lerna.json index 852983c2357b..47f726f4f903 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "5.36.1", + "version": "5.36.2", "npmClient": "yarn", "useWorkspaces": true, "stream": true diff --git a/packages/ast-spec/CHANGELOG.md b/packages/ast-spec/CHANGELOG.md index 120161610817..4324dcc737c1 100644 --- a/packages/ast-spec/CHANGELOG.md +++ b/packages/ast-spec/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. +## [5.36.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.36.1...v5.36.2) (2022-09-05) + +**Note:** Version bump only for package @typescript-eslint/ast-spec + + + + + ## [5.36.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.36.0...v5.36.1) (2022-08-30) **Note:** Version bump only for package @typescript-eslint/ast-spec diff --git a/packages/ast-spec/package.json b/packages/ast-spec/package.json index 9ea10a7a0b4e..730b45b97e6b 100644 --- a/packages/ast-spec/package.json +++ b/packages/ast-spec/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/ast-spec", - "version": "5.36.1", + "version": "5.36.2", "description": "TypeScript-ESTree AST spec", "private": true, "keywords": [ diff --git a/packages/eslint-plugin-internal/CHANGELOG.md b/packages/eslint-plugin-internal/CHANGELOG.md index 46367af0339f..c7e3660b9825 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. +## [5.36.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.36.1...v5.36.2) (2022-09-05) + +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal + + + + + ## [5.36.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.36.0...v5.36.1) (2022-08-30) **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 471c2fbbdac4..f576807a9019 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": "5.36.1", + "version": "5.36.2", "private": true, "main": "dist/index.js", "scripts": { @@ -14,8 +14,8 @@ }, "dependencies": { "@types/prettier": "*", - "@typescript-eslint/scope-manager": "5.36.1", - "@typescript-eslint/utils": "5.36.1", + "@typescript-eslint/scope-manager": "5.36.2", + "@typescript-eslint/utils": "5.36.2", "prettier": "*" } } diff --git a/packages/eslint-plugin-tslint/CHANGELOG.md b/packages/eslint-plugin-tslint/CHANGELOG.md index 45ec73bdee53..492b83732ed8 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. +## [5.36.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.36.1...v5.36.2) (2022-09-05) + +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint + + + + + ## [5.36.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.36.0...v5.36.1) (2022-08-30) **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 fba19249f813..e5378423b436 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": "5.36.1", + "version": "5.36.2", "main": "dist/index.js", "typings": "src/index.ts", "description": "TSLint wrapper plugin for ESLint", @@ -38,7 +38,7 @@ "typecheck": "tsc -p tsconfig.json --noEmit" }, "dependencies": { - "@typescript-eslint/utils": "5.36.1", + "@typescript-eslint/utils": "5.36.2", "lodash": "^4.17.21" }, "peerDependencies": { @@ -48,6 +48,6 @@ }, "devDependencies": { "@types/lodash": "*", - "@typescript-eslint/parser": "5.36.1" + "@typescript-eslint/parser": "5.36.2" } } diff --git a/packages/eslint-plugin/CHANGELOG.md b/packages/eslint-plugin/CHANGELOG.md index 4c1662e6034c..9a633cf18456 100644 --- a/packages/eslint-plugin/CHANGELOG.md +++ b/packages/eslint-plugin/CHANGELOG.md @@ -3,6 +3,18 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [5.36.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.36.1...v5.36.2) (2022-09-05) + + +### Bug Fixes + +* **eslint-plugin:** [no-extra-parens] handle generic ts array type. ([#5550](https://github.com/typescript-eslint/typescript-eslint/issues/5550)) ([0d6a190](https://github.com/typescript-eslint/typescript-eslint/commit/0d6a190c56fb3489f9f554b9035a008e29cc08ec)) +* **scope-manager:** correct handling for class static blocks ([#5580](https://github.com/typescript-eslint/typescript-eslint/issues/5580)) ([35bb8dd](https://github.com/typescript-eslint/typescript-eslint/commit/35bb8ddac1b46397f6447c1a6e1e4e1774dd7957)) + + + + + ## [5.36.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.36.0...v5.36.1) (2022-08-30) **Note:** Version bump only for package @typescript-eslint/eslint-plugin diff --git a/packages/eslint-plugin/docs/rules/no-throw-literal.md b/packages/eslint-plugin/docs/rules/no-throw-literal.md index 6a017d5ac4be..9fb71fcbe493 100644 --- a/packages/eslint-plugin/docs/rules/no-throw-literal.md +++ b/packages/eslint-plugin/docs/rules/no-throw-literal.md @@ -94,7 +94,7 @@ throw new CustomError(); This rule adds the following options: ```ts -interface Options extends BaseNoShadowOptions { +interface Options { /** * Whether to always allow throwing values typed as `any`. */ @@ -107,7 +107,6 @@ interface Options extends BaseNoShadowOptions { } const defaultOptions: Options = { - ...baseNoShadowDefaultOptions, allowThrowingAny: false, allowThrowingUnknown: false, }; diff --git a/packages/eslint-plugin/package.json b/packages/eslint-plugin/package.json index 65b611f33877..5f7a73df247a 100644 --- a/packages/eslint-plugin/package.json +++ b/packages/eslint-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/eslint-plugin", - "version": "5.36.1", + "version": "5.36.2", "description": "TypeScript plugin for ESLint", "keywords": [ "eslint", @@ -44,9 +44,9 @@ "typecheck": "tsc -p tsconfig.json --noEmit" }, "dependencies": { - "@typescript-eslint/scope-manager": "5.36.1", - "@typescript-eslint/type-utils": "5.36.1", - "@typescript-eslint/utils": "5.36.1", + "@typescript-eslint/scope-manager": "5.36.2", + "@typescript-eslint/type-utils": "5.36.2", + "@typescript-eslint/utils": "5.36.2", "debug": "^4.3.4", "functional-red-black-tree": "^1.0.1", "ignore": "^5.2.0", diff --git a/packages/eslint-plugin/src/rules/no-extra-parens.ts b/packages/eslint-plugin/src/rules/no-extra-parens.ts index 71bfc4f10dc0..1232f336048d 100644 --- a/packages/eslint-plugin/src/rules/no-extra-parens.ts +++ b/packages/eslint-plugin/src/rules/no-extra-parens.ts @@ -79,7 +79,9 @@ export default util.createRule({ if ( node.arguments.length === 1 && node.typeParameters?.params.some( - param => param.type === AST_NODE_TYPES.TSImportType, + param => + param.type === AST_NODE_TYPES.TSImportType || + param.type === AST_NODE_TYPES.TSArrayType, ) ) { return rule({ 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 5a72b6015a21..058331be10a1 100644 --- a/packages/eslint-plugin/tests/rules/no-extra-parens.test.ts +++ b/packages/eslint-plugin/tests/rules/no-extra-parens.test.ts @@ -227,6 +227,17 @@ switch (foo) { case 1: case (<2>2): break; default: break; } }, ], }), + ...batchedSingleLineTests({ + code: ` +declare const f: (x: T) => any +f<(number | string)[]>(['a', 1]) + `, + parserOptions: { + ecmaFeatures: { + jsx: true, + }, + }, + }), ], invalid: [ diff --git a/packages/eslint-plugin/tests/rules/no-unused-vars/no-unused-vars.test.ts b/packages/eslint-plugin/tests/rules/no-unused-vars/no-unused-vars.test.ts index 5fac3eeed71a..715d2e94385b 100644 --- a/packages/eslint-plugin/tests/rules/no-unused-vars/no-unused-vars.test.ts +++ b/packages/eslint-plugin/tests/rules/no-unused-vars/no-unused-vars.test.ts @@ -1018,6 +1018,27 @@ export class TestClass { `, parserOptions: withMetaParserOptions, }, + // https://github.com/typescript-eslint/typescript-eslint/issues/5577 + ` +function foo() {} + +export class Foo { + constructor() { + foo(); + } +} + `, + ` +function foo() {} + +export class Foo { + static {} + + constructor() { + foo(); + } +} + `, ], invalid: [ diff --git a/packages/experimental-utils/CHANGELOG.md b/packages/experimental-utils/CHANGELOG.md index ce4cc9fd4e38..2ffc2a4e4d7d 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. +## [5.36.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.36.1...v5.36.2) (2022-09-05) + +**Note:** Version bump only for package @typescript-eslint/experimental-utils + + + + + ## [5.36.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.36.0...v5.36.1) (2022-08-30) **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 50c726c00736..8d8d8540e7f3 100644 --- a/packages/experimental-utils/package.json +++ b/packages/experimental-utils/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/experimental-utils", - "version": "5.36.1", + "version": "5.36.2", "description": "(Experimental) Utilities for working with TypeScript + ESLint together", "keywords": [ "eslint", @@ -38,7 +38,7 @@ "typecheck": "tsc -p tsconfig.json --noEmit" }, "dependencies": { - "@typescript-eslint/utils": "5.36.1" + "@typescript-eslint/utils": "5.36.2" }, "peerDependencies": { "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" diff --git a/packages/parser/CHANGELOG.md b/packages/parser/CHANGELOG.md index 231274f8ba4b..97daaa7dcfc8 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. +## [5.36.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.36.1...v5.36.2) (2022-09-05) + +**Note:** Version bump only for package @typescript-eslint/parser + + + + + ## [5.36.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.36.0...v5.36.1) (2022-08-30) **Note:** Version bump only for package @typescript-eslint/parser diff --git a/packages/parser/package.json b/packages/parser/package.json index 6ae5bf77e362..44992e92cb2f 100644 --- a/packages/parser/package.json +++ b/packages/parser/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/parser", - "version": "5.36.1", + "version": "5.36.2", "description": "An ESLint custom parser which leverages TypeScript ESTree", "main": "dist/index.js", "types": "dist/index.d.ts", @@ -45,9 +45,9 @@ "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" }, "dependencies": { - "@typescript-eslint/scope-manager": "5.36.1", - "@typescript-eslint/types": "5.36.1", - "@typescript-eslint/typescript-estree": "5.36.1", + "@typescript-eslint/scope-manager": "5.36.2", + "@typescript-eslint/types": "5.36.2", + "@typescript-eslint/typescript-estree": "5.36.2", "debug": "^4.3.4" }, "devDependencies": { diff --git a/packages/scope-manager/CHANGELOG.md b/packages/scope-manager/CHANGELOG.md index 1f298af0c37b..fe113e082dff 100644 --- a/packages/scope-manager/CHANGELOG.md +++ b/packages/scope-manager/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. +## [5.36.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.36.1...v5.36.2) (2022-09-05) + + +### Bug Fixes + +* **scope-manager:** correct handling for class static blocks ([#5580](https://github.com/typescript-eslint/typescript-eslint/issues/5580)) ([35bb8dd](https://github.com/typescript-eslint/typescript-eslint/commit/35bb8ddac1b46397f6447c1a6e1e4e1774dd7957)) + + + + + ## [5.36.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.36.0...v5.36.1) (2022-08-30) **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 7b372121ef5b..c77c31d43170 100644 --- a/packages/scope-manager/package.json +++ b/packages/scope-manager/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/scope-manager", - "version": "5.36.1", + "version": "5.36.2", "description": "TypeScript scope analyser for ESLint", "keywords": [ "eslint", @@ -38,12 +38,12 @@ "typecheck": "cd ../../ && nx typecheck @typescript-eslint/scope-manager" }, "dependencies": { - "@typescript-eslint/types": "5.36.1", - "@typescript-eslint/visitor-keys": "5.36.1" + "@typescript-eslint/types": "5.36.2", + "@typescript-eslint/visitor-keys": "5.36.2" }, "devDependencies": { "@types/glob": "*", - "@typescript-eslint/typescript-estree": "5.36.1", + "@typescript-eslint/typescript-estree": "5.36.2", "glob": "*", "jest-specific-snapshot": "*", "make-dir": "*", diff --git a/packages/scope-manager/src/referencer/ClassVisitor.ts b/packages/scope-manager/src/referencer/ClassVisitor.ts index 47e0bdef41cd..84c97fc445aa 100644 --- a/packages/scope-manager/src/referencer/ClassVisitor.ts +++ b/packages/scope-manager/src/referencer/ClassVisitor.ts @@ -322,10 +322,6 @@ class ClassVisitor extends Visitor { this.visitType(node); } - protected visitStaticBlock(node: TSESTree.StaticBlock): void { - this.#referencer.scopeManager.nestClassStaticBlockScope(node); - } - ///////////////////// // Visit selectors // ///////////////////// @@ -365,7 +361,11 @@ class ClassVisitor extends Visitor { } protected StaticBlock(node: TSESTree.StaticBlock): void { - this.visitStaticBlock(node); + this.#referencer.scopeManager.nestClassStaticBlockScope(node); + + node.body.forEach(b => this.visit(b)); + + this.#referencer.close(node); } } diff --git a/packages/scope-manager/tests/fixtures/class/declaration/static-external-ref.ts b/packages/scope-manager/tests/fixtures/class/declaration/static-external-ref.ts new file mode 100644 index 000000000000..d2237dc62b5b --- /dev/null +++ b/packages/scope-manager/tests/fixtures/class/declaration/static-external-ref.ts @@ -0,0 +1,7 @@ +function f() {} + +class A { + static { + f(); + } +} diff --git a/packages/scope-manager/tests/fixtures/class/declaration/static-external-ref.ts.shot b/packages/scope-manager/tests/fixtures/class/declaration/static-external-ref.ts.shot new file mode 100644 index 000000000000..0ef13dfe6d5a --- /dev/null +++ b/packages/scope-manager/tests/fixtures/class/declaration/static-external-ref.ts.shot @@ -0,0 +1,117 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`class declaration static-external-ref 1`] = ` +ScopeManager { + variables: Array [ + ImplicitGlobalConstTypeVariable, + Variable$2 { + defs: Array [ + FunctionNameDefinition$1 { + name: Identifier<"f">, + node: FunctionDeclaration$1, + }, + ], + name: "f", + references: Array [ + Reference$1 { + identifier: Identifier<"f">, + isRead: true, + isTypeReference: false, + isValueReference: true, + isWrite: false, + resolved: Variable$2, + }, + ], + isValueVariable: true, + isTypeVariable: false, + }, + Variable$3 { + defs: Array [], + name: "arguments", + references: Array [], + isValueVariable: true, + isTypeVariable: true, + }, + Variable$4 { + defs: Array [ + ClassNameDefinition$2 { + name: Identifier<"A">, + node: ClassDeclaration$2, + }, + ], + name: "A", + references: Array [], + isValueVariable: true, + isTypeVariable: true, + }, + Variable$5 { + defs: Array [ + ClassNameDefinition$3 { + name: Identifier<"A">, + node: ClassDeclaration$2, + }, + ], + name: "A", + references: Array [], + isValueVariable: true, + isTypeVariable: true, + }, + ], + scopes: Array [ + GlobalScope$1 { + block: Program$3, + isStrict: false, + references: Array [], + set: Map { + "const" => ImplicitGlobalConstTypeVariable, + "f" => Variable$2, + "A" => Variable$4, + }, + type: "global", + upper: null, + variables: Array [ + ImplicitGlobalConstTypeVariable, + Variable$2, + Variable$4, + ], + }, + FunctionScope$2 { + block: FunctionDeclaration$1, + isStrict: false, + references: Array [], + set: Map { + "arguments" => Variable$3, + }, + type: "function", + upper: GlobalScope$1, + variables: Array [ + Variable$3, + ], + }, + ClassScope$3 { + block: ClassDeclaration$2, + isStrict: true, + references: Array [], + set: Map { + "A" => Variable$5, + }, + type: "class", + upper: GlobalScope$1, + variables: Array [ + Variable$5, + ], + }, + ClassStaticBlockScope$4 { + block: StaticBlock$4, + isStrict: true, + references: Array [ + Reference$1, + ], + set: Map {}, + type: "class-static-block", + upper: ClassScope$3, + variables: Array [], + }, + ], +} +`; diff --git a/packages/scope-manager/tests/fixtures/class/declaration/static-with-constructor.ts b/packages/scope-manager/tests/fixtures/class/declaration/static-with-constructor.ts new file mode 100644 index 000000000000..ceb030c000c1 --- /dev/null +++ b/packages/scope-manager/tests/fixtures/class/declaration/static-with-constructor.ts @@ -0,0 +1,10 @@ +// https://github.com/typescript-eslint/typescript-eslint/issues/5577 +function f() {} + +class A { + static {} + + constructor() { + f(); + } +} diff --git a/packages/scope-manager/tests/fixtures/class/declaration/static-with-constructor.ts.shot b/packages/scope-manager/tests/fixtures/class/declaration/static-with-constructor.ts.shot new file mode 100644 index 000000000000..76d943c8df85 --- /dev/null +++ b/packages/scope-manager/tests/fixtures/class/declaration/static-with-constructor.ts.shot @@ -0,0 +1,137 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`class declaration static-with-constructor 1`] = ` +ScopeManager { + variables: Array [ + ImplicitGlobalConstTypeVariable, + Variable$2 { + defs: Array [ + FunctionNameDefinition$1 { + name: Identifier<"f">, + node: FunctionDeclaration$1, + }, + ], + name: "f", + references: Array [ + Reference$1 { + identifier: Identifier<"f">, + isRead: true, + isTypeReference: false, + isValueReference: true, + isWrite: false, + resolved: Variable$2, + }, + ], + isValueVariable: true, + isTypeVariable: false, + }, + Variable$3 { + defs: Array [], + name: "arguments", + references: Array [], + isValueVariable: true, + isTypeVariable: true, + }, + Variable$4 { + defs: Array [ + ClassNameDefinition$2 { + name: Identifier<"A">, + node: ClassDeclaration$2, + }, + ], + name: "A", + references: Array [], + isValueVariable: true, + isTypeVariable: true, + }, + Variable$5 { + defs: Array [ + ClassNameDefinition$3 { + name: Identifier<"A">, + node: ClassDeclaration$2, + }, + ], + name: "A", + references: Array [], + isValueVariable: true, + isTypeVariable: true, + }, + Variable$6 { + defs: Array [], + name: "arguments", + references: Array [], + isValueVariable: true, + isTypeVariable: true, + }, + ], + scopes: Array [ + GlobalScope$1 { + block: Program$3, + isStrict: false, + references: Array [], + set: Map { + "const" => ImplicitGlobalConstTypeVariable, + "f" => Variable$2, + "A" => Variable$4, + }, + type: "global", + upper: null, + variables: Array [ + ImplicitGlobalConstTypeVariable, + Variable$2, + Variable$4, + ], + }, + FunctionScope$2 { + block: FunctionDeclaration$1, + isStrict: false, + references: Array [], + set: Map { + "arguments" => Variable$3, + }, + type: "function", + upper: GlobalScope$1, + variables: Array [ + Variable$3, + ], + }, + ClassScope$3 { + block: ClassDeclaration$2, + isStrict: true, + references: Array [], + set: Map { + "A" => Variable$5, + }, + type: "class", + upper: GlobalScope$1, + variables: Array [ + Variable$5, + ], + }, + ClassStaticBlockScope$4 { + block: StaticBlock$4, + isStrict: true, + references: Array [], + set: Map {}, + type: "class-static-block", + upper: ClassScope$3, + variables: Array [], + }, + FunctionScope$5 { + block: FunctionExpression$5, + isStrict: true, + references: Array [ + Reference$1, + ], + set: Map { + "arguments" => Variable$6, + }, + type: "function", + upper: ClassScope$3, + variables: Array [ + Variable$6, + ], + }, + ], +} +`; diff --git a/packages/shared-fixtures/CHANGELOG.md b/packages/shared-fixtures/CHANGELOG.md index 44d71d639ef7..a9d688b023c3 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. +## [5.36.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.36.1...v5.36.2) (2022-09-05) + + +### Bug Fixes + +* **typescript-estree:** don't double add decorators to a parameter property's parameter ([#5582](https://github.com/typescript-eslint/typescript-eslint/issues/5582)) ([863694c](https://github.com/typescript-eslint/typescript-eslint/commit/863694cbc71b5158ca6a018de8707c9f9fbc22c3)) + + + + + ## [5.36.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.36.0...v5.36.1) (2022-08-30) **Note:** Version bump only for package @typescript-eslint/shared-fixtures diff --git a/packages/shared-fixtures/fixtures/typescript/decorators/class-decorators/class-parameter-property.src.ts b/packages/shared-fixtures/fixtures/typescript/decorators/class-decorators/class-parameter-property.src.ts new file mode 100644 index 000000000000..d8503e061cc1 --- /dev/null +++ b/packages/shared-fixtures/fixtures/typescript/decorators/class-decorators/class-parameter-property.src.ts @@ -0,0 +1,3 @@ +class A { + constructor(@d private x: number) {} +} diff --git a/packages/shared-fixtures/package.json b/packages/shared-fixtures/package.json index 8699c8b266ad..f8da2334fde0 100644 --- a/packages/shared-fixtures/package.json +++ b/packages/shared-fixtures/package.json @@ -1,5 +1,5 @@ { "name": "@typescript-eslint/shared-fixtures", - "version": "5.36.1", + "version": "5.36.2", "private": true } diff --git a/packages/type-utils/CHANGELOG.md b/packages/type-utils/CHANGELOG.md index 1f04d473a658..5155902ceef3 100644 --- a/packages/type-utils/CHANGELOG.md +++ b/packages/type-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. +## [5.36.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.36.1...v5.36.2) (2022-09-05) + +**Note:** Version bump only for package @typescript-eslint/type-utils + + + + + ## [5.36.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.36.0...v5.36.1) (2022-08-30) **Note:** Version bump only for package @typescript-eslint/type-utils diff --git a/packages/type-utils/package.json b/packages/type-utils/package.json index 384b5b913087..8fcf23de2fe2 100644 --- a/packages/type-utils/package.json +++ b/packages/type-utils/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/type-utils", - "version": "5.36.1", + "version": "5.36.2", "description": "Type utilities for working with TypeScript + ESLint together", "keywords": [ "eslint", @@ -39,13 +39,13 @@ "typecheck": "tsc -p tsconfig.json --noEmit" }, "dependencies": { - "@typescript-eslint/typescript-estree": "5.36.1", - "@typescript-eslint/utils": "5.36.1", + "@typescript-eslint/typescript-estree": "5.36.2", + "@typescript-eslint/utils": "5.36.2", "debug": "^4.3.4", "tsutils": "^3.21.0" }, "devDependencies": { - "@typescript-eslint/parser": "5.36.1", + "@typescript-eslint/parser": "5.36.2", "typescript": "*" }, "peerDependencies": { diff --git a/packages/types/CHANGELOG.md b/packages/types/CHANGELOG.md index d9f96139fdbd..ffcc8850a023 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. +## [5.36.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.36.1...v5.36.2) (2022-09-05) + +**Note:** Version bump only for package @typescript-eslint/types + + + + + ## [5.36.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.36.0...v5.36.1) (2022-08-30) **Note:** Version bump only for package @typescript-eslint/types diff --git a/packages/types/package.json b/packages/types/package.json index 5538bc4f29f9..4d38fddeaa56 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/types", - "version": "5.36.1", + "version": "5.36.2", "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 2c8a34298f51..243d67fb16b2 100644 --- a/packages/typescript-estree/CHANGELOG.md +++ b/packages/typescript-estree/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. +## [5.36.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.36.1...v5.36.2) (2022-09-05) + + +### Bug Fixes + +* **typescript-estree:** don't double add decorators to a parameter property's parameter ([#5582](https://github.com/typescript-eslint/typescript-eslint/issues/5582)) ([863694c](https://github.com/typescript-eslint/typescript-eslint/commit/863694cbc71b5158ca6a018de8707c9f9fbc22c3)) + + + + + ## [5.36.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.36.0...v5.36.1) (2022-08-30) diff --git a/packages/typescript-estree/package.json b/packages/typescript-estree/package.json index ddee1776ba15..764f01df1a3f 100644 --- a/packages/typescript-estree/package.json +++ b/packages/typescript-estree/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/typescript-estree", - "version": "5.36.1", + "version": "5.36.2", "description": "A parser that converts TypeScript source code into an ESTree compatible form", "main": "dist/index.js", "types": "dist/index.d.ts", @@ -42,8 +42,8 @@ "typecheck": "tsc -p tsconfig.json --noEmit" }, "dependencies": { - "@typescript-eslint/types": "5.36.1", - "@typescript-eslint/visitor-keys": "5.36.1", + "@typescript-eslint/types": "5.36.2", + "@typescript-eslint/visitor-keys": "5.36.2", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -59,7 +59,7 @@ "@types/is-glob": "*", "@types/semver": "*", "@types/tmp": "*", - "@typescript-eslint/shared-fixtures": "5.36.1", + "@typescript-eslint/shared-fixtures": "5.36.2", "glob": "*", "jest-specific-snapshot": "*", "make-dir": "*", diff --git a/packages/typescript-estree/src/convert.ts b/packages/typescript-estree/src/convert.ts index 6c1963c04562..3dace04e5407 100644 --- a/packages/typescript-estree/src/convert.ts +++ b/packages/typescript-estree/src/convert.ts @@ -1669,11 +1669,6 @@ export class Converter { parameter.optional = true; } - const decorators = getDecorators(node); - if (decorators) { - parameter.decorators = decorators.map(d => this.convertChild(d)); - } - const modifiers = getModifiers(node); if (modifiers) { return this.createNode(node, { 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 10c42e4dd022..6abab590b77c 100644 --- a/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts +++ b/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts @@ -444,6 +444,11 @@ tester.addFixturePatternConfig('typescript/decorators/class-decorators', { */ 'export-default-class-decorator', 'export-named-class-decorator', + /** + * babel sets the range of the export node to the start of the parameter + * TSESTree sets it to the start of the decorator + */ + 'class-parameter-property', ], }); tester.addFixturePatternConfig('typescript/decorators/method-decorators', { diff --git a/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.test.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.test.ts.snap index 5b2338cd4c36..204da250a869 100644 --- a/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.test.ts.snap +++ b/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.test.ts.snap @@ -2224,6 +2224,8 @@ exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" e exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/decorators/class-decorators/class-decorator-factory.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/decorators/class-decorators/class-parameter-property.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/decorators/class-decorators/export-default-class-decorator.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/decorators/class-decorators/export-named-class-decorator.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; diff --git a/packages/typescript-estree/tests/snapshots/typescript/decorators/class-decorators/class-parameter-property.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/decorators/class-decorators/class-parameter-property.src.ts.shot new file mode 100644 index 000000000000..81ff4dcfe3dc --- /dev/null +++ b/packages/typescript-estree/tests/snapshots/typescript/decorators/class-decorators/class-parameter-property.src.ts.shot @@ -0,0 +1,543 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`typescript decorators class-decorators class-parameter-property.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "name": "constructor", + "range": Array [ + 12, + 23, + ], + "type": "Identifier", + }, + "kind": "constructor", + "loc": Object { + "end": Object { + "column": 38, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "override": false, + "range": Array [ + 12, + 48, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 38, + "line": 2, + }, + "start": Object { + "column": 36, + "line": 2, + }, + }, + "range": Array [ + 46, + 48, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 38, + "line": 2, + }, + "start": Object { + "column": 13, + "line": 2, + }, + }, + "params": Array [ + Object { + "accessibility": "private", + "decorators": Array [ + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "name": "d", + "range": Array [ + 25, + 26, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 14, + "line": 2, + }, + }, + "range": Array [ + 24, + 26, + ], + "type": "Decorator", + }, + ], + "export": undefined, + "loc": Object { + "end": Object { + "column": 34, + "line": 2, + }, + "start": Object { + "column": 14, + "line": 2, + }, + }, + "override": undefined, + "parameter": Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 2, + }, + "start": Object { + "column": 25, + "line": 2, + }, + }, + "name": "x", + "range": Array [ + 35, + 44, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 2, + }, + "start": Object { + "column": 26, + "line": 2, + }, + }, + "range": Array [ + 36, + 44, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 2, + }, + "start": Object { + "column": 28, + "line": 2, + }, + }, + "range": Array [ + 38, + 44, + ], + "type": "TSNumberKeyword", + }, + }, + }, + "range": Array [ + 24, + 44, + ], + "readonly": undefined, + "static": undefined, + "type": "TSParameterProperty", + }, + ], + "range": Array [ + 23, + 48, + ], + "type": "FunctionExpression", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 50, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "A", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 50, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + ], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 51, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + "value": "A", + }, + 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": 13, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 12, + 23, + ], + "type": "Identifier", + "value": "constructor", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 13, + "line": 2, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 14, + "line": 2, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": "@", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Identifier", + "value": "d", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 2, + }, + "start": Object { + "column": 17, + "line": 2, + }, + }, + "range": Array [ + 27, + 34, + ], + "type": "Keyword", + "value": "private", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 2, + }, + "start": Object { + "column": 25, + "line": 2, + }, + }, + "range": Array [ + 35, + 36, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 2, + }, + "start": Object { + "column": 26, + "line": 2, + }, + }, + "range": Array [ + 36, + 37, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 2, + }, + "start": Object { + "column": 28, + "line": 2, + }, + }, + "range": Array [ + 38, + 44, + ], + "type": "Identifier", + "value": "number", + }, + Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 2, + }, + "start": Object { + "column": 34, + "line": 2, + }, + }, + "range": Array [ + 44, + 45, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 2, + }, + "start": Object { + "column": 36, + "line": 2, + }, + }, + "range": Array [ + 46, + 47, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 2, + }, + "start": Object { + "column": 37, + "line": 2, + }, + }, + "range": Array [ + 47, + 48, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 49, + 50, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; diff --git a/packages/utils/CHANGELOG.md b/packages/utils/CHANGELOG.md index 963443711787..f37405a8be0e 100644 --- a/packages/utils/CHANGELOG.md +++ b/packages/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. +## [5.36.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.36.1...v5.36.2) (2022-09-05) + +**Note:** Version bump only for package @typescript-eslint/utils + + + + + ## [5.36.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.36.0...v5.36.1) (2022-08-30) **Note:** Version bump only for package @typescript-eslint/utils diff --git a/packages/utils/package.json b/packages/utils/package.json index f7dd289ee858..edaca3a62e13 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/utils", - "version": "5.36.1", + "version": "5.36.2", "description": "Utilities for working with TypeScript + ESLint together", "keywords": [ "eslint", @@ -40,9 +40,9 @@ }, "dependencies": { "@types/json-schema": "^7.0.9", - "@typescript-eslint/scope-manager": "5.36.1", - "@typescript-eslint/types": "5.36.1", - "@typescript-eslint/typescript-estree": "5.36.1", + "@typescript-eslint/scope-manager": "5.36.2", + "@typescript-eslint/types": "5.36.2", + "@typescript-eslint/typescript-estree": "5.36.2", "eslint-scope": "^5.1.1", "eslint-utils": "^3.0.0" }, diff --git a/packages/visitor-keys/CHANGELOG.md b/packages/visitor-keys/CHANGELOG.md index b7a375c53dce..e413a4a3a729 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. +## [5.36.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.36.1...v5.36.2) (2022-09-05) + +**Note:** Version bump only for package @typescript-eslint/visitor-keys + + + + + ## [5.36.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.36.0...v5.36.1) (2022-08-30) **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 9398f20952de..24f05bfbad83 100644 --- a/packages/visitor-keys/package.json +++ b/packages/visitor-keys/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/visitor-keys", - "version": "5.36.1", + "version": "5.36.2", "description": "Visitor keys used to help traverse the TypeScript-ESTree AST", "keywords": [ "eslint", @@ -39,7 +39,7 @@ "typecheck": "tsc -p tsconfig.json --noEmit" }, "dependencies": { - "@typescript-eslint/types": "5.36.1", + "@typescript-eslint/types": "5.36.2", "eslint-visitor-keys": "^3.3.0" }, "devDependencies": { diff --git a/packages/website-eslint/CHANGELOG.md b/packages/website-eslint/CHANGELOG.md index 2fe831b40d8a..010e9e55f425 100644 --- a/packages/website-eslint/CHANGELOG.md +++ b/packages/website-eslint/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. +## [5.36.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.36.1...v5.36.2) (2022-09-05) + +**Note:** Version bump only for package @typescript-eslint/website-eslint + + + + + ## [5.36.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.36.0...v5.36.1) (2022-08-30) **Note:** Version bump only for package @typescript-eslint/website-eslint diff --git a/packages/website-eslint/package.json b/packages/website-eslint/package.json index a3b171559d9a..35180ac187ad 100644 --- a/packages/website-eslint/package.json +++ b/packages/website-eslint/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/website-eslint", - "version": "5.36.1", + "version": "5.36.2", "private": true, "description": "ESLint which works in browsers.", "engines": { @@ -16,19 +16,19 @@ "format": "prettier --write \"./**/*.{ts,mts,cts,tsx,js,mjs,cjs,jsx,json,md,css}\" --ignore-path ../../.prettierignore" }, "dependencies": { - "@typescript-eslint/types": "5.36.1", - "@typescript-eslint/utils": "5.36.1" + "@typescript-eslint/types": "5.36.2", + "@typescript-eslint/utils": "5.36.2" }, "devDependencies": { "@rollup/plugin-commonjs": "^22.0.0", "@rollup/plugin-json": "^4.1.0", "@rollup/plugin-node-resolve": "^13.3.0", "@rollup/pluginutils": "^4.2.1", - "@typescript-eslint/eslint-plugin": "5.36.1", - "@typescript-eslint/parser": "5.36.1", - "@typescript-eslint/scope-manager": "5.36.1", - "@typescript-eslint/typescript-estree": "5.36.1", - "@typescript-eslint/visitor-keys": "5.36.1", + "@typescript-eslint/eslint-plugin": "5.36.2", + "@typescript-eslint/parser": "5.36.2", + "@typescript-eslint/scope-manager": "5.36.2", + "@typescript-eslint/typescript-estree": "5.36.2", + "@typescript-eslint/visitor-keys": "5.36.2", "eslint": "*", "rollup": "^2.75.4", "rollup-plugin-terser": "^7.0.2", diff --git a/packages/website-eslint/rollup.config.js b/packages/website-eslint/rollup.config.js index 4175b1e754e7..bc9143b27dbe 100644 --- a/packages/website-eslint/rollup.config.js +++ b/packages/website-eslint/rollup.config.js @@ -36,6 +36,10 @@ module.exports = { /utils\/dist\/ts-eslint\/ESLint\.js/, // 'eslint/lib/shared/ajv.js', // 'eslint/lib/shared/runtime-info.js', + /ajv\/lib\/definition_schema\.js/, + /stream/, + /os/, + /fs/, ], target: './src/mock/empty.js', }, @@ -64,6 +68,14 @@ module.exports = { match: /semver$/u, target: './src/mock/semver.js', }, + { + match: /^globby$/u, + target: './src/mock/globby.js', + }, + { + match: /^is-glob$/u, + target: './src/mock/is-glob.js', + }, ], replace: [ { diff --git a/packages/website-eslint/src/mock/globby.js b/packages/website-eslint/src/mock/globby.js new file mode 100644 index 000000000000..80c2ae2d9e13 --- /dev/null +++ b/packages/website-eslint/src/mock/globby.js @@ -0,0 +1,4 @@ +export function sync() { + // the website config is static and doesn't use glob config + return []; +} diff --git a/packages/website-eslint/src/mock/is-glob.js b/packages/website-eslint/src/mock/is-glob.js new file mode 100644 index 000000000000..e35771f6460f --- /dev/null +++ b/packages/website-eslint/src/mock/is-glob.js @@ -0,0 +1,4 @@ +export default function isGlob() { + // the website config is static and doesn't use glob config + return false; +} diff --git a/packages/website-eslint/src/mock/semver.js b/packages/website-eslint/src/mock/semver.js index ba292927fe90..a7671aaaf066 100644 --- a/packages/website-eslint/src/mock/semver.js +++ b/packages/website-eslint/src/mock/semver.js @@ -1,4 +1,7 @@ import satisfies from 'semver/functions/satisfies'; import major from 'semver/functions/major'; +// just in case someone adds a import * as semver usage export { satisfies, major }; + +export default { satisfies, major }; diff --git a/packages/website/CHANGELOG.md b/packages/website/CHANGELOG.md index ecf574bd1167..f3076d260646 100644 --- a/packages/website/CHANGELOG.md +++ b/packages/website/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. +## [5.36.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.36.1...v5.36.2) (2022-09-05) + +**Note:** Version bump only for package website + + + + + ## [5.36.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.36.0...v5.36.1) (2022-08-30) **Note:** Version bump only for package website diff --git a/packages/website/data/sponsors.json b/packages/website/data/sponsors.json index e2b44dc38490..ce842b6231d7 100644 --- a/packages/website/data/sponsors.json +++ b/packages/website/data/sponsors.json @@ -12,7 +12,7 @@ "image": "https://images.opencollective.com/nx/0efbe42/logo.png", "name": "Nx (by Nrwl)", "tier": "sponsor", - "totalDonations": 475000, + "totalDonations": 500000, "website": "https://nx.dev" }, { @@ -20,7 +20,7 @@ "image": "https://images.opencollective.com/eslint/96b09dc/logo.png", "name": "ESLint", "tier": "sponsor", - "totalDonations": 170000, + "totalDonations": 185000, "website": "https://eslint.org/" }, { @@ -28,7 +28,7 @@ "image": "https://images.opencollective.com/airbnb/d327d66/logo.png", "name": "Airbnb", "tier": "sponsor", - "totalDonations": 125800, + "totalDonations": 130800, "website": "https://www.airbnb.com/" }, { @@ -44,9 +44,17 @@ "image": "https://images.opencollective.com/n8n/dca2f0c/logo.png", "name": "n8n.io - n8n GmbH", "tier": "sponsor", - "totalDonations": 100000, + "totalDonations": 105000, "website": "https://n8n.io" }, + { + "id": "GitBook", + "image": "https://images.opencollective.com/gitbook/d35a8e7/logo.png", + "name": "GitBook", + "tier": "supporter", + "totalDonations": 90000, + "website": "https://www.gitbook.com" + }, { "id": "EY Doberman", "image": "https://images.opencollective.com/ey-doberman/b269462/logo.png", @@ -55,20 +63,12 @@ "totalDonations": 80400, "website": "https://doberman.co" }, - { - "id": "GitBook", - "image": "https://images.opencollective.com/gitbook/d35a8e7/logo.png", - "name": "GitBook", - "tier": "supporter", - "totalDonations": 80000, - "website": "https://www.gitbook.com" - }, { "id": "Codecademy", "image": "https://images.opencollective.com/codecademy/d56a48d/logo.png", "name": "Codecademy", "tier": "supporter", - "totalDonations": 70000, + "totalDonations": 80000, "website": "https://codecademy.com" }, { @@ -104,21 +104,29 @@ "website": "https://www.monito.com" }, { - "id": "revo.js", - "image": "https://images.opencollective.com/revojsro/82623a7/logo.png", - "name": "revo.js", + "id": "Sourcegraph", + "image": "https://images.opencollective.com/sourcegraph/67e40ff/logo.png", + "name": "Sourcegraph", "tier": "contributor", - "totalDonations": 23000, - "website": "https://revojs.ro" + "totalDonations": 30000, + "website": "https://about.sourcegraph.com" }, { "id": "STORIS", "image": "https://images.opencollective.com/storis/dfb0e13/logo.png", "name": "STORIS", "tier": "contributor", - "totalDonations": 22500, + "totalDonations": 24000, "website": "https://www.storis.com/" }, + { + "id": "revo.js", + "image": "https://images.opencollective.com/revojsro/82623a7/logo.png", + "name": "revo.js", + "tier": "contributor", + "totalDonations": 23000, + "website": "https://revojs.ro" + }, { "id": "Ian MacLeod", "image": "https://images.opencollective.com/nevir/35c52ef/avatar.png", @@ -127,14 +135,6 @@ "totalDonations": 22000, "website": "https://twitter.com/nevir" }, - { - "id": "Sourcegraph", - "image": "https://images.opencollective.com/sourcegraph/67e40ff/logo.png", - "name": "Sourcegraph", - "tier": "contributor", - "totalDonations": 20000, - "website": "https://about.sourcegraph.com" - }, { "id": "Joe Alden", "image": "https://images.opencollective.com/joealden/44a6738/avatar.png", @@ -148,7 +148,7 @@ "image": "https://images.opencollective.com/blacksheepcode/976d69a/avatar.png", "name": "David Johnston", "tier": "contributor", - "totalDonations": 13500, + "totalDonations": 14000, "website": "https://blacksheepcode.com" }, { diff --git a/packages/website/docusaurusConfig.ts b/packages/website/docusaurusConfig.ts index 41c4336559af..9f111975a0e2 100644 --- a/packages/website/docusaurusConfig.ts +++ b/packages/website/docusaurusConfig.ts @@ -69,7 +69,7 @@ const themeConfig: ThemeCommonConfig & AlgoliaThemeConfig = { title: 'TypeScript ESLint', // hideOnScroll: true, logo: { - alt: 'TypeScript ESLint logo', + alt: '', height: '32px', src: 'img/logo.svg', width: '32px', diff --git a/packages/website/package.json b/packages/website/package.json index 7fba036c2da8..6458848f1dc5 100644 --- a/packages/website/package.json +++ b/packages/website/package.json @@ -1,6 +1,6 @@ { "name": "website", - "version": "5.36.1", + "version": "5.36.2", "private": true, "scripts": { "build": "docusaurus build", @@ -20,8 +20,8 @@ "@docusaurus/remark-plugin-npm2yarn": "~2.0.1", "@docusaurus/theme-common": "~2.0.1", "@mdx-js/react": "1.6.22", - "@typescript-eslint/parser": "5.36.1", - "@typescript-eslint/website-eslint": "5.36.1", + "@typescript-eslint/parser": "5.36.2", + "@typescript-eslint/website-eslint": "5.36.2", "clsx": "^1.1.1", "eslint": "*", "json-schema": "^0.4.0", @@ -41,7 +41,7 @@ "@types/react": "^18.0.9", "@types/react-helmet": "^6.1.5", "@types/react-router-dom": "^5.3.3", - "@typescript-eslint/eslint-plugin": "5.36.1", + "@typescript-eslint/eslint-plugin": "5.36.2", "copy-webpack-plugin": "^11.0.0", "cypress": "8.3.0", "cypress-axe": "^0.14.0",