From 2fba299250017ad6f2473650f9b22e6e1de320fb Mon Sep 17 00:00:00 2001 From: ota-meshi Date: Thu, 30 Mar 2023 15:21:04 +0900 Subject: [PATCH 1/3] Fix wrong scope reference type for ` + + diff --git a/typings/eslint-scope/index.d.ts b/typings/eslint-scope/index.d.ts index c3ae32b5..6d14afcf 100644 --- a/typings/eslint-scope/index.d.ts +++ b/typings/eslint-scope/index.d.ts @@ -75,8 +75,8 @@ export class Reference { public isWriteOnly(): boolean // For typescript-eslint - public isTypeReference: boolean - public isValueReference: boolean + public isTypeReference?: boolean + public isValueReference?: boolean } export declare const analyze: ( From a49e4fe8e2c8cc127ea6f9893985db256a683d3c Mon Sep 17 00:00:00 2001 From: ota-meshi Date: Thu, 30 Mar 2023 15:21:43 +0900 Subject: [PATCH 2/3] update --- .../consistent-type-imports/valid-type-import.vue | 1 - 1 file changed, 1 deletion(-) diff --git a/test/fixtures/integrations/script-setup-with-typescript-eslint/consistent-type-imports/valid-type-import.vue b/test/fixtures/integrations/script-setup-with-typescript-eslint/consistent-type-imports/valid-type-import.vue index 6b491065..c1c451fc 100644 --- a/test/fixtures/integrations/script-setup-with-typescript-eslint/consistent-type-imports/valid-type-import.vue +++ b/test/fixtures/integrations/script-setup-with-typescript-eslint/consistent-type-imports/valid-type-import.vue @@ -6,7 +6,6 @@ From 330675789bdaff1decad930ba01dd785f070360e Mon Sep 17 00:00:00 2001 From: ota-meshi Date: Thu, 30 Mar 2023 15:26:58 +0900 Subject: [PATCH 3/3] update --- .../parser-option-multiple-parsers-1/ast.json | 54 ++++++++- .../ast.json | 54 ++++++++- .../ast.json | 4 +- .../scope.json | 108 ++++++++++++++---- 4 files changed, 191 insertions(+), 29 deletions(-) diff --git a/test/fixtures/ast/parser-option-multiple-parsers-1/ast.json b/test/fixtures/ast/parser-option-multiple-parsers-1/ast.json index 97d900ed..e4419dca 100644 --- a/test/fixtures/ast/parser-option-multiple-parsers-1/ast.json +++ b/test/fixtures/ast/parser-option-multiple-parsers-1/ast.json @@ -656,7 +656,9 @@ } } }, - "mode": "r" + "mode": "r", + "isValueReference": true, + "isTypeReference": false }, { "id": { @@ -677,7 +679,55 @@ } } }, - "mode": "r" + "mode": "r", + "isValueReference": true, + "isTypeReference": false + }, + { + "id": { + "type": "Identifier", + "name": "b", + "range": [ + 17, + 18 + ], + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 7 + } + } + }, + "mode": "r", + "isValueReference": false, + "isTypeReference": true + }, + { + "id": { + "type": "Identifier", + "name": "c", + "range": [ + 19, + 20 + ], + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 9 + } + } + }, + "mode": "r", + "isValueReference": false, + "isTypeReference": true } ] }, diff --git a/test/fixtures/ast/parser-option-multiple-parsers-without-script/ast.json b/test/fixtures/ast/parser-option-multiple-parsers-without-script/ast.json index b7deda38..8ad44185 100644 --- a/test/fixtures/ast/parser-option-multiple-parsers-without-script/ast.json +++ b/test/fixtures/ast/parser-option-multiple-parsers-without-script/ast.json @@ -275,7 +275,9 @@ } } }, - "mode": "r" + "mode": "r", + "isValueReference": true, + "isTypeReference": false }, { "id": { @@ -296,7 +298,55 @@ } } }, - "mode": "r" + "mode": "r", + "isValueReference": true, + "isTypeReference": false + }, + { + "id": { + "type": "Identifier", + "name": "b", + "range": [ + 17, + 18 + ], + "loc": { + "start": { + "line": 2, + "column": 6 + }, + "end": { + "line": 2, + "column": 7 + } + } + }, + "mode": "r", + "isValueReference": false, + "isTypeReference": true + }, + { + "id": { + "type": "Identifier", + "name": "c", + "range": [ + 19, + 20 + ], + "loc": { + "start": { + "line": 2, + "column": 8 + }, + "end": { + "line": 2, + "column": 9 + } + } + }, + "mode": "r", + "isValueReference": false, + "isTypeReference": true } ] }, diff --git a/test/fixtures/ast/ts-script-setup-with-use-global-var/ast.json b/test/fixtures/ast/ts-script-setup-with-use-global-var/ast.json index b86e69af..6d83d037 100644 --- a/test/fixtures/ast/ts-script-setup-with-use-global-var/ast.json +++ b/test/fixtures/ast/ts-script-setup-with-use-global-var/ast.json @@ -357,7 +357,9 @@ } } }, - "mode": "r" + "mode": "r", + "isValueReference": true, + "isTypeReference": false } ] }, diff --git a/test/fixtures/ast/ts-script-setup-with-use-global-var/scope.json b/test/fixtures/ast/ts-script-setup-with-use-global-var/scope.json index 80bdb3dd..d82fa33c 100644 --- a/test/fixtures/ast/ts-script-setup-with-use-global-var/scope.json +++ b/test/fixtures/ast/ts-script-setup-with-use-global-var/scope.json @@ -1,6 +1,90 @@ { "type": "global", "variables": [ + { + "name": "ClassMemberDecoratorContext", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "DecoratorContext", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "ClassDecoratorContext", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "ClassMethodDecoratorContext", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "ClassGetterDecoratorContext", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "ClassSetterDecoratorContext", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "ClassAccessorDecoratorContext", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "ClassAccessorDecoratorTarget", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "ClassAccessorDecoratorResult", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "ClassFieldDecoratorContext", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "ClassDecorator", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "PropertyDecorator", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "MethodDecorator", + "identifiers": [], + "defs": [], + "references": [] + }, + { + "name": "ParameterDecorator", + "identifiers": [], + "defs": [], + "references": [] + }, { "name": "Symbol", "identifiers": [], @@ -301,30 +385,6 @@ "defs": [], "references": [] }, - { - "name": "ClassDecorator", - "identifiers": [], - "defs": [], - "references": [] - }, - { - "name": "PropertyDecorator", - "identifiers": [], - "defs": [], - "references": [] - }, - { - "name": "MethodDecorator", - "identifiers": [], - "defs": [], - "references": [] - }, - { - "name": "ParameterDecorator", - "identifiers": [], - "defs": [], - "references": [] - }, { "name": "PromiseConstructorLike", "identifiers": [],