From ffdfade106d602bcc12b074bdfa489e9f661491e Mon Sep 17 00:00:00 2001 From: Ethan Setnik Date: Tue, 1 Sep 2020 14:08:38 -0400 Subject: [PATCH 01/22] fix(eslint-plugin): handle missing message IDs in eslint v5/v6 (#2461) --- packages/eslint-plugin/src/rules/indent.ts | 5 ++++- packages/eslint-plugin/src/rules/init-declarations.ts | 7 ++++++- packages/eslint-plugin/src/rules/keyword-spacing.ts | 7 ++++++- .../eslint-plugin/src/rules/lines-between-class-members.ts | 5 ++++- packages/eslint-plugin/src/rules/no-invalid-this.ts | 4 +++- packages/eslint-plugin/src/rules/no-magic-numbers.ts | 5 ++++- packages/eslint-plugin/src/rules/no-unused-expressions.ts | 5 ++++- packages/eslint-plugin/src/rules/no-unused-vars.ts | 4 +++- packages/eslint-plugin/src/rules/no-useless-constructor.ts | 4 +++- packages/eslint-plugin/src/rules/quotes.ts | 4 +++- packages/eslint-plugin/src/rules/semi.ts | 5 ++++- 11 files changed, 44 insertions(+), 11 deletions(-) diff --git a/packages/eslint-plugin/src/rules/indent.ts b/packages/eslint-plugin/src/rules/indent.ts index 0a8d3196ab62..34ec40151798 100644 --- a/packages/eslint-plugin/src/rules/indent.ts +++ b/packages/eslint-plugin/src/rules/indent.ts @@ -97,7 +97,10 @@ export default util.createRule({ }, fixable: 'whitespace', schema: baseRule.meta.schema, - messages: baseRule.meta.messages, + messages: baseRule.meta.messages ?? { + wrongIndentation: + 'Expected indentation of {{expected}} but found {{actual}}.', + }, }, defaultOptions: [ // typescript docs and playground use 4 space indent diff --git a/packages/eslint-plugin/src/rules/init-declarations.ts b/packages/eslint-plugin/src/rules/init-declarations.ts index b4368527e0cd..5706006852b2 100644 --- a/packages/eslint-plugin/src/rules/init-declarations.ts +++ b/packages/eslint-plugin/src/rules/init-declarations.ts @@ -24,7 +24,12 @@ export default createRule({ extendsBaseRule: true, }, schema: baseRule.meta.schema, - messages: baseRule.meta.messages, + messages: baseRule.meta.messages ?? { + initialized: + "Variable '{{idName}}' should be initialized on declaration.", + notInitialized: + "Variable '{{idName}}' should not be initialized on declaration.", + }, }, defaultOptions: ['always'], create(context) { diff --git a/packages/eslint-plugin/src/rules/keyword-spacing.ts b/packages/eslint-plugin/src/rules/keyword-spacing.ts index 8c4ff1d38ff6..2265b2604436 100644 --- a/packages/eslint-plugin/src/rules/keyword-spacing.ts +++ b/packages/eslint-plugin/src/rules/keyword-spacing.ts @@ -17,7 +17,12 @@ export default util.createRule({ }, fixable: 'whitespace', schema: baseRule.meta.schema, - messages: baseRule.meta.messages, + messages: baseRule.meta.messages ?? { + expectedBefore: 'Expected space(s) before "{{value}}".', + expectedAfter: 'Expected space(s) after "{{value}}".', + unexpectedBefore: 'Unexpected space(s) before "{{value}}".', + unexpectedAfter: 'Unexpected space(s) after "{{value}}".', + }, }, defaultOptions: [{}], diff --git a/packages/eslint-plugin/src/rules/lines-between-class-members.ts b/packages/eslint-plugin/src/rules/lines-between-class-members.ts index 26b09d528f29..21c6b9ed5e51 100644 --- a/packages/eslint-plugin/src/rules/lines-between-class-members.ts +++ b/packages/eslint-plugin/src/rules/lines-between-class-members.ts @@ -32,7 +32,10 @@ export default util.createRule({ }, fixable: 'whitespace', schema, - messages: baseRule.meta.messages, + messages: baseRule.meta.messages ?? { + never: 'Unexpected blank line between class members.', + always: 'Expected blank line between class members.', + }, }, defaultOptions: [ 'always', diff --git a/packages/eslint-plugin/src/rules/no-invalid-this.ts b/packages/eslint-plugin/src/rules/no-invalid-this.ts index 186d33788469..8824978a3f37 100644 --- a/packages/eslint-plugin/src/rules/no-invalid-this.ts +++ b/packages/eslint-plugin/src/rules/no-invalid-this.ts @@ -23,7 +23,9 @@ export default createRule({ recommended: false, extendsBaseRule: true, }, - messages: baseRule.meta.messages, + messages: baseRule.meta.messages ?? { + unexpectedThis: "Unexpected 'this'.", + }, schema: baseRule.meta.schema, }, defaultOptions: [{ capIsConstructor: true }], diff --git a/packages/eslint-plugin/src/rules/no-magic-numbers.ts b/packages/eslint-plugin/src/rules/no-magic-numbers.ts index c285b0eb3024..0cb41337c1bb 100644 --- a/packages/eslint-plugin/src/rules/no-magic-numbers.ts +++ b/packages/eslint-plugin/src/rules/no-magic-numbers.ts @@ -40,7 +40,10 @@ export default util.createRule({ }, }, ], - messages: baseRule.meta.messages, + messages: baseRule.meta.messages ?? { + useConst: "Number constants declarations must use 'const'.", + noMagic: 'No magic number: {{raw}}.', + }, }, defaultOptions: [ { diff --git a/packages/eslint-plugin/src/rules/no-unused-expressions.ts b/packages/eslint-plugin/src/rules/no-unused-expressions.ts index bea697330063..8116cbf704e3 100644 --- a/packages/eslint-plugin/src/rules/no-unused-expressions.ts +++ b/packages/eslint-plugin/src/rules/no-unused-expressions.ts @@ -19,7 +19,10 @@ export default util.createRule({ extendsBaseRule: true, }, schema: baseRule.meta.schema, - messages: baseRule.meta.messages, + messages: baseRule.meta.messages ?? { + unusedExpression: + 'Expected an assignment or function call and instead saw an expression.', + }, }, defaultOptions: [ { diff --git a/packages/eslint-plugin/src/rules/no-unused-vars.ts b/packages/eslint-plugin/src/rules/no-unused-vars.ts index 85f806985794..973df534b0ed 100644 --- a/packages/eslint-plugin/src/rules/no-unused-vars.ts +++ b/packages/eslint-plugin/src/rules/no-unused-vars.ts @@ -21,7 +21,9 @@ export default util.createRule({ extendsBaseRule: true, }, schema: baseRule.meta.schema, - messages: baseRule.meta.messages, + messages: baseRule.meta.messages ?? { + unusedVar: "'{{varName}}' is {{action}} but never used{{additional}}.", + }, }, defaultOptions: [{}], create(context) { diff --git a/packages/eslint-plugin/src/rules/no-useless-constructor.ts b/packages/eslint-plugin/src/rules/no-useless-constructor.ts index 395ff28d45e1..2ad9c765c4e7 100644 --- a/packages/eslint-plugin/src/rules/no-useless-constructor.ts +++ b/packages/eslint-plugin/src/rules/no-useless-constructor.ts @@ -54,7 +54,9 @@ export default util.createRule({ extendsBaseRule: true, }, schema: baseRule.meta.schema, - messages: baseRule.meta.messages, + messages: baseRule.meta.messages ?? { + noUselessConstructor: 'Useless constructor.', + }, }, defaultOptions: [], create(context) { diff --git a/packages/eslint-plugin/src/rules/quotes.ts b/packages/eslint-plugin/src/rules/quotes.ts index 5d4d44028b14..3cbdbce3d875 100644 --- a/packages/eslint-plugin/src/rules/quotes.ts +++ b/packages/eslint-plugin/src/rules/quotes.ts @@ -20,7 +20,9 @@ export default util.createRule({ extendsBaseRule: true, }, fixable: 'code', - messages: baseRule.meta.messages, + messages: baseRule.meta.messages ?? { + wrongQuotes: 'Strings must use {{description}}.', + }, schema: baseRule.meta.schema, }, defaultOptions: [ diff --git a/packages/eslint-plugin/src/rules/semi.ts b/packages/eslint-plugin/src/rules/semi.ts index f35b93d98594..e73fd4b51dec 100644 --- a/packages/eslint-plugin/src/rules/semi.ts +++ b/packages/eslint-plugin/src/rules/semi.ts @@ -22,7 +22,10 @@ export default util.createRule({ }, fixable: 'code', schema: baseRule.meta.schema, - messages: baseRule.meta.messages, + messages: baseRule.meta.messages ?? { + missingSemi: 'Missing semicolon.', + extraSemi: 'Extra semicolon.', + }, }, defaultOptions: [ 'always', From bfe255fde0cb5fe5e32c02eb5ba35d27fb23d9ea Mon Sep 17 00:00:00 2001 From: Brad Zacher Date: Wed, 2 Sep 2020 10:14:40 -0700 Subject: [PATCH 02/22] feat(eslint-plugin): [no-shadow] add option `ignoreFunctionTypeParameterNameValueShadow` (#2470) --- package.json | 3 + .../eslint-plugin/docs/rules/no-shadow.md | 39 +++++- packages/eslint-plugin/src/rules/no-shadow.ts | 50 +++++-- .../tests/rules/no-shadow.test.ts | 122 +++++++++++++++++- 4 files changed, 197 insertions(+), 17 deletions(-) diff --git a/package.json b/package.json index 89e20c04d805..5d02e9b5e43b 100644 --- a/package.json +++ b/package.json @@ -57,6 +57,9 @@ "footer-max-length": [ 0 ], + "footer-max-line-length": [ + 0 + ], "header-max-length": [ 0 ] diff --git a/packages/eslint-plugin/docs/rules/no-shadow.md b/packages/eslint-plugin/docs/rules/no-shadow.md index d4b5294696aa..ed241b807882 100644 --- a/packages/eslint-plugin/docs/rules/no-shadow.md +++ b/packages/eslint-plugin/docs/rules/no-shadow.md @@ -23,17 +23,21 @@ This rule adds the following options: ```ts interface Options extends BaseNoShadowOptions { ignoreTypeValueShadow?: boolean; + ignoreFunctionTypeParameterNameValueShadow?: boolean; } const defaultOptions: Options = { ...baseNoShadowDefaultOptions, ignoreTypeValueShadow: true, + ignoreFunctionTypeParameterNameValueShadow: true, }; ``` ### `ignoreTypeValueShadow` -When set to `true`, the rule will ignore when you name a type and a variable with the same name. +When set to `true`, the rule will ignore the case when you name a type the same as a variable. + +TypeScript allows types and variables to shadow one-another. This is generally safe because you cannot use variables in type locations without a `typeof` operator, so there's little risk of confusion. Examples of **correct** code with `{ ignoreTypeValueShadow: true }`: @@ -47,4 +51,37 @@ interface Bar { const Bar = 'test'; ``` +### `ignoreFunctionTypeParameterNameValueShadow` + +When set to `true`, the rule will ignore the case when you name a function type argument the same as a variable. + +Each of a function type's arguments creates a value variable within the scope of the function type. This is done so that you can reference the type later using the `typeof` operator: + +```ts +type Func = (test: string) => typeof test; + +declare const fn: Func; +const result = fn('str'); // typeof result === string +``` + +This means that function type arguments shadow value variable names in parent scopes: + +```ts +let test = 1; +type TestType = typeof test; // === number +type Func = (test: string) => typeof test; // this "test" references the argument, not the variable + +declare const fn: Func; +const result = fn('str'); // typeof result === string +``` + +If you do not use the `typeof` operator in a function type return type position, you can safely turn this option on. + +Examples of **correct** code with `{ ignoreFunctionTypeParameterNameValueShadow: true }`: + +```ts +const test = 1; +type Func = (test: string) => typeof test; +``` + Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/master/docs/rules/no-shadow.md) diff --git a/packages/eslint-plugin/src/rules/no-shadow.ts b/packages/eslint-plugin/src/rules/no-shadow.ts index 9c77ca321fd6..05761572b216 100644 --- a/packages/eslint-plugin/src/rules/no-shadow.ts +++ b/packages/eslint-plugin/src/rules/no-shadow.ts @@ -12,6 +12,7 @@ type Options = [ builtinGlobals?: boolean; hoist?: 'all' | 'functions' | 'never'; ignoreTypeValueShadow?: boolean; + ignoreFunctionTypeParameterNameValueShadow?: boolean; }, ]; @@ -45,6 +46,9 @@ export default util.createRule({ ignoreTypeValueShadow: { type: 'boolean', }, + ignoreFunctionTypeParameterNameValueShadow: { + type: 'boolean', + }, }, additionalProperties: false, }, @@ -59,6 +63,7 @@ export default util.createRule({ builtinGlobals: false, hoist: 'functions', ignoreTypeValueShadow: true, + ignoreFunctionTypeParameterNameValueShadow: true, }, ], create(context, [options]) { @@ -77,15 +82,37 @@ export default util.createRule({ return false; } - if ( - !('isValueVariable' in shadowed) || - !('isValueVariable' in variable) - ) { - // one of them is an eslint global variable + if (!('isValueVariable' in variable)) { + // this shouldn't happen... + return false; + } + + const isShadowedValue = + 'isValueVariable' in shadowed ? shadowed.isValueVariable : true; + return variable.isValueVariable !== isShadowedValue; + } + + function isFunctionTypeParameterNameValueShadow( + variable: TSESLint.Scope.Variable, + shadowed: TSESLint.Scope.Variable, + ): boolean { + if (options.ignoreFunctionTypeParameterNameValueShadow !== true) { + return false; + } + + if (!('isValueVariable' in variable)) { + // this shouldn't happen... + return false; + } + + const isShadowedValue = + 'isValueVariable' in shadowed ? shadowed.isValueVariable : true; + if (!isShadowedValue) { return false; } - return variable.isValueVariable !== shadowed.isValueVariable; + const id = variable.identifiers[0]; + return util.isFunctionType(id.parent); } /** @@ -117,12 +144,12 @@ export default util.createRule({ } /** - * Checks if a variable of the class name in the class scope of ClassDeclaration. + * Checks if a variable of the class name in the class scope of TSEnumDeclaration. * - * ClassDeclaration creates two variables of its name into its outer scope and its class scope. + * TSEnumDeclaration creates two variables of its name into its outer scope and its class scope. * So we should ignore the variable in the class scope. * @param variable The variable to check. - * @returns Whether or not the variable of the class name in the class scope of ClassDeclaration. + * @returns Whether or not the variable of the class name in the class scope of TSEnumDeclaration. */ function isDuplicatedEnumNameVariable( variable: TSESLint.Scope.Variable, @@ -273,6 +300,11 @@ export default util.createRule({ continue; } + // ignore function type parameter name shadowing if configured + if (isFunctionTypeParameterNameValueShadow(variable, shadowed)) { + continue; + } + const isESLintGlobal = 'writeable' in shadowed; if ( (shadowed.identifiers.length > 0 || diff --git a/packages/eslint-plugin/tests/rules/no-shadow.test.ts b/packages/eslint-plugin/tests/rules/no-shadow.test.ts index 54f9851be842..bbaad211a25f 100644 --- a/packages/eslint-plugin/tests/rules/no-shadow.test.ts +++ b/packages/eslint-plugin/tests/rules/no-shadow.test.ts @@ -56,6 +56,58 @@ const x = 1; type x = string; } `, + { + code: ` +type Foo = 1; + `, + options: [{ ignoreTypeValueShadow: true }], + globals: { + Foo: 'writable', + }, + }, + { + code: ` +type Foo = 1; + `, + options: [ + { + ignoreTypeValueShadow: false, + builtinGlobals: false, + }, + ], + globals: { + Foo: 'writable', + }, + }, + // https://github.com/typescript-eslint/typescript-eslint/issues/2360 + ` +enum Direction { + left = 'left', + right = 'right', +} + `, + // https://github.com/typescript-eslint/typescript-eslint/issues/2447 + { + code: ` +const test = 1; +type Fn = (test: string) => typeof test; + `, + options: [{ ignoreFunctionTypeParameterNameValueShadow: true }], + }, + { + code: ` +type Fn = (Foo: string) => typeof Foo; + `, + options: [ + { + ignoreFunctionTypeParameterNameValueShadow: true, + builtinGlobals: false, + }, + ], + globals: { + Foo: 'writable', + }, + }, ], invalid: [ { @@ -109,6 +161,69 @@ const x = 1; }, ], }, + { + code: ` +type Foo = 1; + `, + options: [ + { + ignoreTypeValueShadow: false, + builtinGlobals: true, + }, + ], + globals: { + Foo: 'writable', + }, + errors: [ + { + messageId: 'noShadow', + data: { + name: 'Foo', + }, + line: 2, + }, + ], + }, + // https://github.com/typescript-eslint/typescript-eslint/issues/2447 + { + code: ` +const test = 1; +type Fn = (test: string) => typeof test; + `, + options: [{ ignoreFunctionTypeParameterNameValueShadow: false }], + errors: [ + { + messageId: 'noShadow', + data: { + name: 'test', + }, + line: 3, + }, + ], + }, + { + code: ` +type Fn = (Foo: string) => typeof Foo; + `, + options: [ + { + ignoreFunctionTypeParameterNameValueShadow: false, + builtinGlobals: true, + }, + ], + globals: { + Foo: 'writable', + }, + errors: [ + { + messageId: 'noShadow', + data: { + name: 'Foo', + }, + line: 2, + }, + ], + }, ], }); @@ -431,13 +546,6 @@ function foo(cb) { `, options: [{ allow: ['cb'] }], }, - // https://github.com/typescript-eslint/typescript-eslint/issues/2360 - ` -enum Direction { - left = 'left', - right = 'right', -} - `, ], invalid: [ { From 20a7dcc808a39cd447d6e52fc5a1e1373d7122e9 Mon Sep 17 00:00:00 2001 From: Gabriel Cangussu Date: Thu, 3 Sep 2020 03:22:09 -0300 Subject: [PATCH 03/22] fix(scope-manager): fallback to lib 'esnext' or 'es5' when ecma version is unsupported (#2474) --- packages/scope-manager/src/analyze.ts | 9 ++-- .../eslint-scope/map-ecma-version.test.ts | 45 +++++++++++++++++++ 2 files changed, 49 insertions(+), 5 deletions(-) create mode 100644 packages/scope-manager/tests/eslint-scope/map-ecma-version.test.ts diff --git a/packages/scope-manager/src/analyze.ts b/packages/scope-manager/src/analyze.ts index 2c7e39491769..ee3ac77de96a 100644 --- a/packages/scope-manager/src/analyze.ts +++ b/packages/scope-manager/src/analyze.ts @@ -2,6 +2,7 @@ import { TSESTree, EcmaVersion, Lib } from '@typescript-eslint/types'; import { visitorKeys } from '@typescript-eslint/visitor-keys'; import { Referencer, ReferencerOptions } from './referencer'; import { ScopeManager } from './ScopeManager'; +import { lib as TSLibraries } from './lib'; //////////////////////////////////////////////////// // MAKE SURE THIS IS KEPT IN SYNC WITH THE README // @@ -61,12 +62,10 @@ function mapEcmaVersion(version: EcmaVersion | undefined): Lib { return 'es5'; } - if (version > 2000) { - return `es${version}` as Lib; - } + const year = version > 2000 ? version : 2015 + (version - 6); + const lib = `es${year}`; - const year = 2015 + (version - 6); - return `es${year}` as Lib; + return lib in TSLibraries ? (lib as Lib) : year > 2020 ? 'esnext' : 'es5'; } /** diff --git a/packages/scope-manager/tests/eslint-scope/map-ecma-version.test.ts b/packages/scope-manager/tests/eslint-scope/map-ecma-version.test.ts new file mode 100644 index 000000000000..3a5957b7003a --- /dev/null +++ b/packages/scope-manager/tests/eslint-scope/map-ecma-version.test.ts @@ -0,0 +1,45 @@ +import { analyze } from '../../src/analyze'; +import { Referencer } from '../../src/referencer'; +import { TSESTree, EcmaVersion, Lib } from '@typescript-eslint/types'; + +jest.mock('../../src/referencer'); +jest.mock('../../src/ScopeManager'); + +describe('ecma version mapping', () => { + it("should map to 'esnext' when unsuported and new", () => { + expectMapping(2042, 'esnext'); + expectMapping(42, 'esnext'); + }); + + it("should map to 'es5' when unsuported and old", () => { + expectMapping(2002, 'es5'); + expectMapping(2, 'es5'); + }); + + it("should map to 'es{year}' when supported and >= 6", () => { + expectMapping(2015, 'es2015'); + expectMapping(6, 'es2015'); + expectMapping(2020, 'es2020'); + expectMapping(11, 'es2020'); + }); + + it("should map to 'es5' when 5 or 3", () => { + expectMapping(5, 'es5'); + expectMapping(3, 'es5'); + }); + + it("should map to 'es2018' when undefined", () => { + expectMapping(undefined, 'es2018'); + }); +}); + +const fakeNode = ({} as unknown) as TSESTree.Node; + +function expectMapping(ecmaVersion: number | undefined, lib: Lib): void { + (Referencer as jest.Mock).mockClear(); + analyze(fakeNode, { ecmaVersion: ecmaVersion as EcmaVersion }); + expect(Referencer).toHaveBeenCalledWith( + expect.objectContaining({ lib: [lib] }), + expect.any(Object), + ); +} From 6595cf1d458edd481507b40b78173eb49f5991b1 Mon Sep 17 00:00:00 2001 From: Brad Zacher Date: Fri, 4 Sep 2020 10:38:55 -0700 Subject: [PATCH 04/22] docs: reorder FAQ (#2485) --- docs/getting-started/linting/FAQ.md | 150 +++++++++++++++------------- 1 file changed, 78 insertions(+), 72 deletions(-) diff --git a/docs/getting-started/linting/FAQ.md b/docs/getting-started/linting/FAQ.md index c6509622e83c..71651b18319c 100644 --- a/docs/getting-started/linting/FAQ.md +++ b/docs/getting-started/linting/FAQ.md @@ -2,15 +2,15 @@ ## Table of Contents -- [My linting feels really slow](#my-linting-feels-really-slow) +- [I am using a rule from ESLint core, and it doesn't work correctly with TypeScript code](#i-am-using-a-rule-from-eslint-core-and-it-doesnt-work-correctly-with-typescript-code) - [I get errors telling me "The file must be included in at least one of the projects provided"](#i-get-errors-telling-me-the-file-must-be-included-in-at-least-one-of-the-projects-provided) - [I use a framework (like Vue) that requires custom file extensions, and I get errors like "You should add `parserOptions.extraFileExtensions` to your config"](#i-use-a-framework-like-vue-that-requires-custom-file-extensions-and-i-get-errors-like-you-should-add-parseroptionsextrafileextensions-to-your-config) -- [I am using a rule from ESLint core, and it doesn't work correctly with TypeScript code](#i-am-using-a-rule-from-eslint-core-and-it-doesnt-work-correctly-with-typescript-code) - [One of my lint rules isn't working correctly on a pure JavaScript file](#one-of-my-lint-rules-isnt-working-correctly-on-a-pure-javascript-file) - [TypeScript should be installed locally](#typescript-should-be-installed-locally) - [How can I ban ``?](#how-can-i-ban-specific-language-feature) - [Why don't I see TypeScript errors in my ESLint output?](#why-dont-i-see-typescript-errors-in-my-eslint-output) - [I get errors from the `no-undef` rule about global variables not being defined, even though there are no TypeScript errors](#i-get-errors-from-the-no-undef-rule-about-global-variables-not-being-defined-even-though-there-are-no-typescript-errors) +- [My linting feels really slow](#my-linting-feels-really-slow) --- @@ -18,55 +18,24 @@

-## My linting feels really slow - -As mentioned in the [type-aware linting doc](./TYPED_LINTING.md), if you're using type-aware linting, your lint times should be roughly the same as your build times. - -If you're experiencing times much slower than that, then there are a few common culprits. - -### Wide includes in your `tsconfig` - -When using type-aware linting, you provide us with one or more tsconfigs. We then will pre-parse all files so that full and complete type information is available. - -If you provide very wide globs in your `include` (like `**/*`), it can cause many more files than you expect to be included in this pre-parse. Additionally, if you provide no `include` in your tsconfig, then it is the same as providing the widest glob. - -Wide globs can cause TypeScript to parse things like build artifacts, which can heavily impact performance. Always ensure you provide globs targeted at the folders you are specifically wanting to lint. - -### `eslint-plugin-prettier` +## I am using a rule from ESLint core, and it doesn't work correctly with TypeScript code -This plugin surfaces prettier formatting problems at lint time, helping to ensure your code is always formatted. However this comes at a quite a large cost - in order to figure out if there is a difference, it has to do a prettier format on every file being linted. This means that each file will be parsed twice - once by ESLint, and once by Prettier. This can add up for large codebases. +This is a pretty common thing because TypeScript adds new features that ESLint doesn't know about. -Instead of using this plugin, we recommend using prettier's `--list-different` flag to detect if a file has not been correctly formatted. For example, our CI is setup to run the following command automatically, which blocks diffs that have not been formatted: +The first step is to [check our list of "extension" rules here](../../../packages/eslint-plugin/README.md#extension-rules). An extension rule is simply a rule which extends the base ESLint rules to support TypeScript syntax. If you find it in there, give it a go to see if it works for you. You can configure it by disabling the base rule, and turning on the extension rule. Here's an example with the `semi` rule: -```bash -$ yarn prettier --list-different \"./**/*.{ts,js,json,md}\" +```json +{ + "rules": { + "semi": "off", + "@typescript-eslint/semi": "error" + } +} ``` -### `eslint-plugin-import` - -This is another great plugin that we use ourselves in this project. However there are a few rules which can cause your lints to be really slow, because they cause the plugin to do its own parsing, and file tracking. This double parsing adds up for large codebases. - -There are many rules that do single file static analysis, but we provide the following recommendations. - -We recommend you do not use the following rules, as TypeScript provides the same checks as part of standard type checking: - -- `import/named` -- `import/namespace` -- `import/default` -- `import/no-named-as-default-member` - -The following rules do not have equivalent checks in TypeScript, so we recommend that you only run them at CI/push time, to lessen the local performance burden. - -- `import/no-named-as-default` -- `import/no-cycle` -- `import/no-unused-modules` -- `import/no-deprecated` - -### The `indent` / `@typescript-eslint/indent` rules +If you don't find an existing extension rule, or the extension rule doesn't work for your case, then you can go ahead and check our issues. [The contributing guide outlines the best way to raise an issue](../../../CONTRIBUTING.md#raising-issues). -This rule helps ensure your codebase follows a consistent indentation pattern. However this involves a _lot_ of computations across every single token in a file. Across a large codebase, these can add up, and severely impact performance. - -We recommend not using this rule, and instead using a tool like [`prettier`](https://www.npmjs.com/package/prettier) to enforce a standardized formatting. +We release a new version our tooling every week. **_Please_** ensure that you [check our the latest list of "extension" rules](../../../packages/eslint-plugin/README.md#extension-rules) **_before_** filing an issue.

@@ -118,33 +87,6 @@ You can use `parserOptions.extraFileExtensions` to specify an array of non-TypeS

-## I am using a rule from ESLint core, and it doesn't work correctly with TypeScript code - -This is a pretty common thing because TypeScript adds new features that ESLint doesn't know about. - -The first step is to [check our list of "extension" rules here](../../../packages/eslint-plugin/README.md#extension-rules). An extension rule is simply a rule which extends the base ESLint rules to support TypeScript syntax. If you find it in there, give it a go to see if it works for you. You can configure it by disabling the base rule, and turning on the extension rule. Here's an example with the `semi` rule: - -```json -{ - "rules": { - "semi": "off", - "@typescript-eslint/semi": "error" - } -} -``` - -If you don't find an existing extension rule, or the extension rule doesn't work for your case, then you can go ahead and check our issues. [The contributing guide outlines the best way to raise an issue](../../../CONTRIBUTING.md#raising-issues). - -
-
-
- ---- - -
-
-
- ## One of my lint rules isn't working correctly on a pure JavaScript file This is to be expected - ESLint rules do not check file extensions on purpose, as it causes issues in environments that use non-standard extensions (for example, a `.vue` and a `.md` file can both contain TypeScript code to be linted). @@ -245,3 +187,67 @@ Instead, our tooling exists to **_augment_** TypeScript's built in checks with l The `no-undef` lint rule does not use TypeScript to determine the global variables that exist - instead, it relies upon ESLint's configuration. You can [manually define the set of allowed `globals` in your ESLint config](https://eslint.org/docs/user-guide/configuring#specifying-globals), and/or you can use one of the [pre-defined environment (`env`) configurations](https://eslint.org/docs/user-guide/configuring#specifying-environments). + +
+
+
+ +--- + +
+
+
+ +## My linting feels really slow + +As mentioned in the [type-aware linting doc](./TYPED_LINTING.md), if you're using type-aware linting, your lint times should be roughly the same as your build times. + +If you're experiencing times much slower than that, then there are a few common culprits. + +### Wide includes in your `tsconfig` + +When using type-aware linting, you provide us with one or more tsconfigs. We then will pre-parse all files so that full and complete type information is available. + +If you provide very wide globs in your `include` (like `**/*`), it can cause many more files than you expect to be included in this pre-parse. Additionally, if you provide no `include` in your tsconfig, then it is the same as providing the widest glob. + +Wide globs can cause TypeScript to parse things like build artifacts, which can heavily impact performance. Always ensure you provide globs targeted at the folders you are specifically wanting to lint. + +### `eslint-plugin-prettier` + +This plugin surfaces prettier formatting problems at lint time, helping to ensure your code is always formatted. However this comes at a quite a large cost - in order to figure out if there is a difference, it has to do a prettier format on every file being linted. This means that each file will be parsed twice - once by ESLint, and once by Prettier. This can add up for large codebases. + +Instead of using this plugin, we recommend using prettier's `--list-different` flag to detect if a file has not been correctly formatted. For example, our CI is setup to run the following command automatically, which blocks diffs that have not been formatted: + +```bash +$ yarn prettier --list-different \"./**/*.{ts,js,json,md}\" +``` + +### `eslint-plugin-import` + +This is another great plugin that we use ourselves in this project. However there are a few rules which can cause your lints to be really slow, because they cause the plugin to do its own parsing, and file tracking. This double parsing adds up for large codebases. + +There are many rules that do single file static analysis, but we provide the following recommendations. + +We recommend you do not use the following rules, as TypeScript provides the same checks as part of standard type checking: + +- `import/named` +- `import/namespace` +- `import/default` +- `import/no-named-as-default-member` + +The following rules do not have equivalent checks in TypeScript, so we recommend that you only run them at CI/push time, to lessen the local performance burden. + +- `import/no-named-as-default` +- `import/no-cycle` +- `import/no-unused-modules` +- `import/no-deprecated` + +### The `indent` / `@typescript-eslint/indent` rules + +This rule helps ensure your codebase follows a consistent indentation pattern. However this involves a _lot_ of computations across every single token in a file. Across a large codebase, these can add up, and severely impact performance. + +We recommend not using this rule, and instead using a tool like [`prettier`](https://www.npmjs.com/package/prettier) to enforce a standardized formatting. + +
+
+
From cee9be708f1b19cefc4eea5af2a6a88eb4f9186b Mon Sep 17 00:00:00 2001 From: Brad Zacher Date: Fri, 4 Sep 2020 14:15:38 -0700 Subject: [PATCH 05/22] docs: add link to v4 release notes to the changelogs (#2487) Some users use CHANGELOG.md as the source of truth for releases and don't check the github releases page. We should probably delete these files and just have everything in the GH releases page. This adds a link to the v4 releases page and adds a disclaimer to the top of the file pointing at the releases page. --- CHANGELOG.md | 3 +++ package.json | 3 +++ packages/eslint-plugin-internal/CHANGELOG.md | 3 +++ packages/eslint-plugin-tslint/CHANGELOG.md | 4 ++++ packages/eslint-plugin/CHANGELOG.md | 3 +++ packages/experimental-utils/CHANGELOG.md | 3 +++ packages/parser/CHANGELOG.md | 3 +++ packages/scope-manager/CHANGELOG.md | 3 +++ packages/shared-fixtures/CHANGELOG.md | 4 ++++ packages/types/CHANGELOG.md | 3 +++ 10 files changed, 32 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7d25acfc31c6..fcc5ce4c7ec4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,8 @@ # Change Log All notable changes to this project will be documented in this file. +This file is just a history of the commits included in each release. +**For full release notes, please see [the github releases page](https://github.com/typescript-eslint/typescript-eslint/releases)** See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. ## [4.0.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.0.0...v4.0.1) (2020-08-31) @@ -16,6 +18,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline # [4.0.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.10.1...v4.0.0) (2020-08-31) +## [Please see the release notes for v4.0.0](https://github.com/typescript-eslint/typescript-eslint/releases/tag/v4.0.0) ### Bug Fixes diff --git a/package.json b/package.json index 5d02e9b5e43b..60668f219cf2 100644 --- a/package.json +++ b/package.json @@ -54,6 +54,9 @@ "body-max-length": [ 0 ], + "body-max-line-length": [ + 0 + ], "footer-max-length": [ 0 ], diff --git a/packages/eslint-plugin-internal/CHANGELOG.md b/packages/eslint-plugin-internal/CHANGELOG.md index b2660df9e2b9..8c528d2a56e8 100644 --- a/packages/eslint-plugin-internal/CHANGELOG.md +++ b/packages/eslint-plugin-internal/CHANGELOG.md @@ -1,6 +1,8 @@ # Change Log All notable changes to this project will be documented in this file. +This file is just a history of the commits included in each release. +**For full release notes, please see [the github releases page](https://github.com/typescript-eslint/typescript-eslint/releases)** See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. ## [4.0.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.0.0...v4.0.1) (2020-08-31) @@ -13,6 +15,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline # [4.0.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.10.1...v4.0.0) (2020-08-31) +## [Please see the release notes for v4.0.0](https://github.com/typescript-eslint/typescript-eslint/releases/tag/v4.0.0) ### Features diff --git a/packages/eslint-plugin-tslint/CHANGELOG.md b/packages/eslint-plugin-tslint/CHANGELOG.md index 2bd3091d24fd..b6bd6b6d1a4e 100644 --- a/packages/eslint-plugin-tslint/CHANGELOG.md +++ b/packages/eslint-plugin-tslint/CHANGELOG.md @@ -1,6 +1,8 @@ # Change Log All notable changes to this project will be documented in this file. +This file is just a history of the commits included in each release. +**For full release notes, please see [the github releases page](https://github.com/typescript-eslint/typescript-eslint/releases)** See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. ## [4.0.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.0.0...v4.0.1) (2020-08-31) @@ -13,6 +15,8 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline # [4.0.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.10.1...v4.0.0) (2020-08-31) +## [Please see the release notes for v4.0.0](https://github.com/typescript-eslint/typescript-eslint/releases/tag/v4.0.0) + **Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint diff --git a/packages/eslint-plugin/CHANGELOG.md b/packages/eslint-plugin/CHANGELOG.md index 97588ac1f54f..985da3c8304f 100644 --- a/packages/eslint-plugin/CHANGELOG.md +++ b/packages/eslint-plugin/CHANGELOG.md @@ -1,6 +1,8 @@ # Change Log All notable changes to this project will be documented in this file. +This file is just a history of the commits included in each release. +**For full release notes, please see [the github releases page](https://github.com/typescript-eslint/typescript-eslint/releases)** See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. ## [4.0.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.0.0...v4.0.1) (2020-08-31) @@ -16,6 +18,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline # [4.0.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.10.1...v4.0.0) (2020-08-31) +## [Please see the release notes for v4.0.0](https://github.com/typescript-eslint/typescript-eslint/releases/tag/v4.0.0) ### Bug Fixes diff --git a/packages/experimental-utils/CHANGELOG.md b/packages/experimental-utils/CHANGELOG.md index 6e03e9b2a4f5..27434ea7eb30 100644 --- a/packages/experimental-utils/CHANGELOG.md +++ b/packages/experimental-utils/CHANGELOG.md @@ -1,6 +1,8 @@ # Change Log All notable changes to this project will be documented in this file. +This file is just a history of the commits included in each release. +**For full release notes, please see [the github releases page](https://github.com/typescript-eslint/typescript-eslint/releases)** See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. ## [4.0.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.0.0...v4.0.1) (2020-08-31) @@ -13,6 +15,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline # [4.0.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.10.1...v4.0.0) (2020-08-31) +## [Please see the release notes for v4.0.0](https://github.com/typescript-eslint/typescript-eslint/releases/tag/v4.0.0) ### Features diff --git a/packages/parser/CHANGELOG.md b/packages/parser/CHANGELOG.md index e51e27adc38f..5ffef9538962 100644 --- a/packages/parser/CHANGELOG.md +++ b/packages/parser/CHANGELOG.md @@ -1,6 +1,8 @@ # Change Log All notable changes to this project will be documented in this file. +This file is just a history of the commits included in each release. +**For full release notes, please see [the github releases page](https://github.com/typescript-eslint/typescript-eslint/releases)** See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. ## [4.0.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.0.0...v4.0.1) (2020-08-31) @@ -13,6 +15,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline # [4.0.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.10.1...v4.0.0) (2020-08-31) +## [Please see the release notes for v4.0.0](https://github.com/typescript-eslint/typescript-eslint/releases/tag/v4.0.0) ### Features diff --git a/packages/scope-manager/CHANGELOG.md b/packages/scope-manager/CHANGELOG.md index c0a533210923..32214ad72f08 100644 --- a/packages/scope-manager/CHANGELOG.md +++ b/packages/scope-manager/CHANGELOG.md @@ -1,6 +1,8 @@ # Change Log All notable changes to this project will be documented in this file. +This file is just a history of the commits included in each release. +**For full release notes, please see [the github releases page](https://github.com/typescript-eslint/typescript-eslint/releases)** See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. ## [4.0.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.0.0...v4.0.1) (2020-08-31) @@ -13,6 +15,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline # [4.0.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.10.1...v4.0.0) (2020-08-31) +## [Please see the release notes for v4.0.0](https://github.com/typescript-eslint/typescript-eslint/releases/tag/v4.0.0) ### Bug Fixes diff --git a/packages/shared-fixtures/CHANGELOG.md b/packages/shared-fixtures/CHANGELOG.md index 0ece944f40d2..78d31dafa610 100644 --- a/packages/shared-fixtures/CHANGELOG.md +++ b/packages/shared-fixtures/CHANGELOG.md @@ -1,6 +1,8 @@ # Change Log All notable changes to this project will be documented in this file. +This file is just a history of the commits included in each release. +**For full release notes, please see [the github releases page](https://github.com/typescript-eslint/typescript-eslint/releases)** See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. ## [4.0.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.0.0...v4.0.1) (2020-08-31) @@ -13,6 +15,8 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline # [4.0.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.10.1...v4.0.0) (2020-08-31) +## [Please see the release notes for v4.0.0](https://github.com/typescript-eslint/typescript-eslint/releases/tag/v4.0.0) + **Note:** Version bump only for package @typescript-eslint/shared-fixtures diff --git a/packages/types/CHANGELOG.md b/packages/types/CHANGELOG.md index 3fac794a2f57..31cc40b144df 100644 --- a/packages/types/CHANGELOG.md +++ b/packages/types/CHANGELOG.md @@ -1,6 +1,8 @@ # Change Log All notable changes to this project will be documented in this file. +This file is just a history of the commits included in each release. +**For full release notes, please see [the github releases page](https://github.com/typescript-eslint/typescript-eslint/releases)** See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. ## [4.0.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.0.0...v4.0.1) (2020-08-31) @@ -13,6 +15,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline # [4.0.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.10.1...v4.0.0) (2020-08-31) +## [Please see the release notes for v4.0.0](https://github.com/typescript-eslint/typescript-eslint/releases/tag/v4.0.0) ### Bug Fixes From 36305df74b3c26b60364f7ec13390be492b4b2ec Mon Sep 17 00:00:00 2001 From: Brad Zacher Date: Sat, 5 Sep 2020 14:57:33 -0700 Subject: [PATCH 06/22] feat(eslint-plugin): add extension rule `no-loop-func` (#2490) --- packages/eslint-plugin/README.md | 61 +- .../eslint-plugin/docs/rules/no-loop-func.md | 22 + packages/eslint-plugin/src/configs/all.ts | 2 + packages/eslint-plugin/src/rules/index.ts | 18 +- .../eslint-plugin/src/rules/no-loop-func.ts | 220 ++++++ .../tests/rules/no-loop-func.test.ts | 738 ++++++++++++++++++ .../eslint-plugin/typings/eslint-rules.d.ts | 15 + 7 files changed, 1038 insertions(+), 38 deletions(-) create mode 100644 packages/eslint-plugin/docs/rules/no-loop-func.md create mode 100644 packages/eslint-plugin/src/rules/no-loop-func.ts create mode 100644 packages/eslint-plugin/tests/rules/no-loop-func.test.ts diff --git a/packages/eslint-plugin/README.md b/packages/eslint-plugin/README.md index fd77a7dcebab..63b5b6e7f321 100644 --- a/packages/eslint-plugin/README.md +++ b/packages/eslint-plugin/README.md @@ -185,36 +185,37 @@ In these cases, we create what we call an extension rule; a rule within our plug **Key**: :heavy_check_mark: = recommended, :wrench: = fixable, :thought_balloon: = requires type information -| Name | Description | :heavy_check_mark: | :wrench: | :thought_balloon: | -| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ------------------ | -------- | ----------------- | -| [`@typescript-eslint/brace-style`](./docs/rules/brace-style.md) | Enforce consistent brace style for blocks | | :wrench: | | -| [`@typescript-eslint/comma-spacing`](./docs/rules/comma-spacing.md) | Enforces consistent spacing before and after commas | | :wrench: | | -| [`@typescript-eslint/default-param-last`](./docs/rules/default-param-last.md) | Enforce default parameters to be last | | | | -| [`@typescript-eslint/dot-notation`](./docs/rules/dot-notation.md) | enforce dot notation whenever possible | | :wrench: | :thought_balloon: | -| [`@typescript-eslint/func-call-spacing`](./docs/rules/func-call-spacing.md) | Require or disallow spacing between function identifiers and their invocations | | :wrench: | | -| [`@typescript-eslint/indent`](./docs/rules/indent.md) | Enforce consistent indentation | | :wrench: | | -| [`@typescript-eslint/init-declarations`](./docs/rules/init-declarations.md) | require or disallow initialization in variable declarations | | | | -| [`@typescript-eslint/keyword-spacing`](./docs/rules/keyword-spacing.md) | Enforce consistent spacing before and after keywords | | :wrench: | | -| [`@typescript-eslint/lines-between-class-members`](./docs/rules/lines-between-class-members.md) | Require or disallow an empty line between class members | | :wrench: | | -| [`@typescript-eslint/no-array-constructor`](./docs/rules/no-array-constructor.md) | Disallow generic `Array` constructors | :heavy_check_mark: | :wrench: | | -| [`@typescript-eslint/no-dupe-class-members`](./docs/rules/no-dupe-class-members.md) | Disallow duplicate class members | | | | -| [`@typescript-eslint/no-empty-function`](./docs/rules/no-empty-function.md) | Disallow empty functions | :heavy_check_mark: | | | -| [`@typescript-eslint/no-extra-parens`](./docs/rules/no-extra-parens.md) | Disallow unnecessary parentheses | | :wrench: | | -| [`@typescript-eslint/no-extra-semi`](./docs/rules/no-extra-semi.md) | Disallow unnecessary semicolons | :heavy_check_mark: | :wrench: | | -| [`@typescript-eslint/no-invalid-this`](./docs/rules/no-invalid-this.md) | disallow `this` keywords outside of classes or class-like objects | | | | -| [`@typescript-eslint/no-loss-of-precision`](./docs/rules/no-loss-of-precision.md) | Disallow literal numbers that lose precision | | | | -| [`@typescript-eslint/no-magic-numbers`](./docs/rules/no-magic-numbers.md) | Disallow magic numbers | | | | -| [`@typescript-eslint/no-redeclare`](./docs/rules/no-redeclare.md) | Disallow variable redeclaration | | | | -| [`@typescript-eslint/no-shadow`](./docs/rules/no-shadow.md) | Disallow variable declarations from shadowing variables declared in the outer scope | | | | -| [`@typescript-eslint/no-unused-expressions`](./docs/rules/no-unused-expressions.md) | Disallow unused expressions | | | | -| [`@typescript-eslint/no-unused-vars`](./docs/rules/no-unused-vars.md) | Disallow unused variables | :heavy_check_mark: | | | -| [`@typescript-eslint/no-use-before-define`](./docs/rules/no-use-before-define.md) | Disallow the use of variables before they are defined | | | | -| [`@typescript-eslint/no-useless-constructor`](./docs/rules/no-useless-constructor.md) | Disallow unnecessary constructors | | | | -| [`@typescript-eslint/quotes`](./docs/rules/quotes.md) | Enforce the consistent use of either backticks, double, or single quotes | | :wrench: | | -| [`@typescript-eslint/require-await`](./docs/rules/require-await.md) | Disallow async functions which have no `await` expression | :heavy_check_mark: | | :thought_balloon: | -| [`@typescript-eslint/return-await`](./docs/rules/return-await.md) | Enforces consistent returning of awaited values | | :wrench: | :thought_balloon: | -| [`@typescript-eslint/semi`](./docs/rules/semi.md) | Require or disallow semicolons instead of ASI | | :wrench: | | -| [`@typescript-eslint/space-before-function-paren`](./docs/rules/space-before-function-paren.md) | Enforces consistent spacing before function parenthesis | | :wrench: | | +| Name | Description | :heavy_check_mark: | :wrench: | :thought_balloon: | +| ----------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------ | ------------------ | -------- | ----------------- | +| [`@typescript-eslint/brace-style`](./docs/rules/brace-style.md) | Enforce consistent brace style for blocks | | :wrench: | | +| [`@typescript-eslint/comma-spacing`](./docs/rules/comma-spacing.md) | Enforces consistent spacing before and after commas | | :wrench: | | +| [`@typescript-eslint/default-param-last`](./docs/rules/default-param-last.md) | Enforce default parameters to be last | | | | +| [`@typescript-eslint/dot-notation`](./docs/rules/dot-notation.md) | enforce dot notation whenever possible | | :wrench: | :thought_balloon: | +| [`@typescript-eslint/func-call-spacing`](./docs/rules/func-call-spacing.md) | Require or disallow spacing between function identifiers and their invocations | | :wrench: | | +| [`@typescript-eslint/indent`](./docs/rules/indent.md) | Enforce consistent indentation | | :wrench: | | +| [`@typescript-eslint/init-declarations`](./docs/rules/init-declarations.md) | require or disallow initialization in variable declarations | | | | +| [`@typescript-eslint/keyword-spacing`](./docs/rules/keyword-spacing.md) | Enforce consistent spacing before and after keywords | | :wrench: | | +| [`@typescript-eslint/lines-between-class-members`](./docs/rules/lines-between-class-members.md) | Require or disallow an empty line between class members | | :wrench: | | +| [`@typescript-eslint/no-array-constructor`](./docs/rules/no-array-constructor.md) | Disallow generic `Array` constructors | :heavy_check_mark: | :wrench: | | +| [`@typescript-eslint/no-dupe-class-members`](./docs/rules/no-dupe-class-members.md) | Disallow duplicate class members | | | | +| [`@typescript-eslint/no-empty-function`](./docs/rules/no-empty-function.md) | Disallow empty functions | :heavy_check_mark: | | | +| [`@typescript-eslint/no-extra-parens`](./docs/rules/no-extra-parens.md) | Disallow unnecessary parentheses | | :wrench: | | +| [`@typescript-eslint/no-extra-semi`](./docs/rules/no-extra-semi.md) | Disallow unnecessary semicolons | :heavy_check_mark: | :wrench: | | +| [`@typescript-eslint/no-invalid-this`](./docs/rules/no-invalid-this.md) | disallow `this` keywords outside of classes or class-like objects | | | | +| [`@typescript-eslint/no-loop-func`](./docs/rules/no-loop-func.md) | Disallow function declarations that contain unsafe references inside loop statements | | | | +| [`@typescript-eslint/no-loss-of-precision`](./docs/rules/no-loss-of-precision.md) | Disallow literal numbers that lose precision | | | | +| [`@typescript-eslint/no-magic-numbers`](./docs/rules/no-magic-numbers.md) | Disallow magic numbers | | | | +| [`@typescript-eslint/no-redeclare`](./docs/rules/no-redeclare.md) | Disallow variable redeclaration | | | | +| [`@typescript-eslint/no-shadow`](./docs/rules/no-shadow.md) | Disallow variable declarations from shadowing variables declared in the outer scope | | | | +| [`@typescript-eslint/no-unused-expressions`](./docs/rules/no-unused-expressions.md) | Disallow unused expressions | | | | +| [`@typescript-eslint/no-unused-vars`](./docs/rules/no-unused-vars.md) | Disallow unused variables | :heavy_check_mark: | | | +| [`@typescript-eslint/no-use-before-define`](./docs/rules/no-use-before-define.md) | Disallow the use of variables before they are defined | | | | +| [`@typescript-eslint/no-useless-constructor`](./docs/rules/no-useless-constructor.md) | Disallow unnecessary constructors | | | | +| [`@typescript-eslint/quotes`](./docs/rules/quotes.md) | Enforce the consistent use of either backticks, double, or single quotes | | :wrench: | | +| [`@typescript-eslint/require-await`](./docs/rules/require-await.md) | Disallow async functions which have no `await` expression | :heavy_check_mark: | | :thought_balloon: | +| [`@typescript-eslint/return-await`](./docs/rules/return-await.md) | Enforces consistent returning of awaited values | | :wrench: | :thought_balloon: | +| [`@typescript-eslint/semi`](./docs/rules/semi.md) | Require or disallow semicolons instead of ASI | | :wrench: | | +| [`@typescript-eslint/space-before-function-paren`](./docs/rules/space-before-function-paren.md) | Enforces consistent spacing before function parenthesis | | :wrench: | | diff --git a/packages/eslint-plugin/docs/rules/no-loop-func.md b/packages/eslint-plugin/docs/rules/no-loop-func.md new file mode 100644 index 000000000000..d48d38c20f6f --- /dev/null +++ b/packages/eslint-plugin/docs/rules/no-loop-func.md @@ -0,0 +1,22 @@ +# Disallow function declarations that contain unsafe references inside loop statements (`no-loop-func`) + +## Rule Details + +This rule extends the base [`eslint/no-loop-func`](https://eslint.org/docs/rules/no-loop-func) rule. +It adds support for TypeScript types. + +## How to use + +```cjson +{ + // note you must disable the base rule as it can report incorrect errors + "no-loop-func": "off", + "@typescript-eslint/no-loop-func": ["error"] +} +``` + +## Options + +See [`eslint/no-loop-func` options](https://eslint.org/docs/rules/no-loop-func#options). + +Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/master/docs/rules/no-loop-func.md) diff --git a/packages/eslint-plugin/src/configs/all.ts b/packages/eslint-plugin/src/configs/all.ts index c3edea830e83..7e457d7aa1f5 100644 --- a/packages/eslint-plugin/src/configs/all.ts +++ b/packages/eslint-plugin/src/configs/all.ts @@ -65,6 +65,8 @@ export = { 'no-invalid-this': 'off', '@typescript-eslint/no-invalid-this': 'error', '@typescript-eslint/no-invalid-void-type': 'error', + 'no-loop-func': 'off', + '@typescript-eslint/no-loop-func': 'error', 'no-loss-of-precision': 'off', '@typescript-eslint/no-loss-of-precision': 'error', 'no-magic-numbers': 'off', diff --git a/packages/eslint-plugin/src/rules/index.ts b/packages/eslint-plugin/src/rules/index.ts index f909be42d4e8..fa8dba93ed1d 100644 --- a/packages/eslint-plugin/src/rules/index.ts +++ b/packages/eslint-plugin/src/rules/index.ts @@ -45,6 +45,7 @@ import noInferrableTypes from './no-inferrable-types'; import noInvalidThis from './no-invalid-this'; import noInvalidVoidType from './no-invalid-void-type'; import noLossOfPrecision from './no-loss-of-precision'; +import noLoopFunc from './no-loop-func'; import noMagicNumbers from './no-magic-numbers'; import noMisusedNew from './no-misused-new'; import noMisusedPromises from './no-misused-promises'; @@ -114,7 +115,6 @@ export default { 'brace-style': braceStyle, 'class-literal-property-style': classLiteralPropertyStyle, 'comma-spacing': commaSpacing, - 'no-confusing-non-null-assertion': confusingNonNullAssertionLikeNotEqual, 'consistent-type-assertions': consistentTypeAssertions, 'consistent-type-definitions': consistentTypeDefinitions, 'consistent-type-imports': consistentTypeImports, @@ -124,31 +124,34 @@ export default { 'explicit-member-accessibility': explicitMemberAccessibility, 'explicit-module-boundary-types': explicitModuleBoundaryTypes, 'func-call-spacing': funcCallSpacing, - indent: indent, 'init-declarations': initDeclarations, 'keyword-spacing': keywordSpacing, + 'lines-between-class-members': linesBetweenClassMembers, 'member-delimiter-style': memberDelimiterStyle, 'member-ordering': memberOrdering, 'method-signature-style': methodSignatureStyle, 'naming-convention': namingConvention, 'no-array-constructor': noArrayConstructor, 'no-base-to-string': noBaseToString, + 'no-confusing-non-null-assertion': confusingNonNullAssertionLikeNotEqual, 'no-dupe-class-members': noDupeClassMembers, 'no-dynamic-delete': noDynamicDelete, 'no-empty-function': noEmptyFunction, 'no-empty-interface': noEmptyInterface, 'no-explicit-any': noExplicitAny, - 'no-implicit-any-catch': noImplicitAnyCatch, 'no-extra-non-null-assertion': noExtraNonNullAssertion, 'no-extra-parens': noExtraParens, 'no-extra-semi': noExtraSemi, 'no-extraneous-class': noExtraneousClass, 'no-floating-promises': noFloatingPromises, 'no-for-in-array': noForInArray, + 'no-implicit-any-catch': noImplicitAnyCatch, 'no-implied-eval': noImpliedEval, 'no-inferrable-types': noInferrableTypes, 'no-invalid-this': noInvalidThis, 'no-invalid-void-type': noInvalidVoidType, + 'no-loop-func': noLoopFunc, + 'no-loss-of-precision': noLossOfPrecision, 'no-magic-numbers': noMagicNumbers, 'no-misused-new': noMisusedNew, 'no-misused-promises': noMisusedPromises, @@ -193,21 +196,20 @@ export default { 'prefer-string-starts-ends-with': preferStringStartsEndsWith, 'prefer-ts-expect-error': preferTsExpectError, 'promise-function-async': promiseFunctionAsync, - quotes: quotes, 'require-array-sort-compare': requireArraySortCompare, 'require-await': requireAwait, 'restrict-plus-operands': restrictPlusOperands, 'restrict-template-expressions': restrictTemplateExpressions, 'return-await': returnAwait, - semi: semi, 'space-before-function-paren': spaceBeforeFunctionParen, 'strict-boolean-expressions': strictBooleanExpressions, 'switch-exhaustiveness-check': switchExhaustivenessCheck, 'triple-slash-reference': tripleSlashReference, 'type-annotation-spacing': typeAnnotationSpacing, - typedef: typedef, 'unbound-method': unboundMethod, 'unified-signatures': unifiedSignatures, - 'lines-between-class-members': linesBetweenClassMembers, - 'no-loss-of-precision': noLossOfPrecision, + indent: indent, + quotes: quotes, + semi: semi, + typedef: typedef, }; diff --git a/packages/eslint-plugin/src/rules/no-loop-func.ts b/packages/eslint-plugin/src/rules/no-loop-func.ts new file mode 100644 index 000000000000..44d0178e8670 --- /dev/null +++ b/packages/eslint-plugin/src/rules/no-loop-func.ts @@ -0,0 +1,220 @@ +import { + AST_NODE_TYPES, + TSESLint, + TSESTree, +} from '@typescript-eslint/experimental-utils'; +import baseRule from 'eslint/lib/rules/no-loop-func'; +import * as util from '../util'; + +type Options = util.InferOptionsTypeFromRule; +type MessageIds = util.InferMessageIdsTypeFromRule; + +export default util.createRule({ + name: 'no-loop-func', + meta: { + type: 'suggestion', + docs: { + description: + 'Disallow function declarations that contain unsafe references inside loop statements', + category: 'Best Practices', + recommended: false, + extendsBaseRule: true, + }, + schema: [], + messages: baseRule?.meta.messages ?? { + unsafeRefs: + 'Function declared in a loop contains unsafe references to variable(s) {{ varNames }}.', + }, + }, + defaultOptions: [], + create(context) { + /** + * Reports functions which match the following condition: + * - has a loop node in ancestors. + * - has any references which refers to an unsafe variable. + * + * @param node The AST node to check. + * @returns Whether or not the node is within a loop. + */ + function checkForLoops( + node: + | TSESTree.ArrowFunctionExpression + | TSESTree.FunctionExpression + | TSESTree.FunctionDeclaration, + ): void { + const loopNode = getContainingLoopNode(node); + + if (!loopNode) { + return; + } + + const references = context.getScope().through; + const unsafeRefs = references + .filter(r => !isSafe(loopNode, r)) + .map(r => r.identifier.name); + + if (unsafeRefs.length > 0) { + context.report({ + node, + messageId: 'unsafeRefs', + data: { varNames: `'${unsafeRefs.join("', '")}'` }, + }); + } + } + + return { + ArrowFunctionExpression: checkForLoops, + FunctionExpression: checkForLoops, + FunctionDeclaration: checkForLoops, + }; + }, +}); + +/** + * Gets the containing loop node of a specified node. + * + * We don't need to check nested functions, so this ignores those. + * `Scope.through` contains references of nested functions. + * + * @param node An AST node to get. + * @returns The containing loop node of the specified node, or `null`. + */ +function getContainingLoopNode(node: TSESTree.Node): TSESTree.Node | null { + for ( + let currentNode = node; + currentNode.parent; + currentNode = currentNode.parent + ) { + const parent = currentNode.parent; + + switch (parent.type) { + case AST_NODE_TYPES.WhileStatement: + case AST_NODE_TYPES.DoWhileStatement: + return parent; + + case AST_NODE_TYPES.ForStatement: + // `init` is outside of the loop. + if (parent.init !== currentNode) { + return parent; + } + break; + + case AST_NODE_TYPES.ForInStatement: + case AST_NODE_TYPES.ForOfStatement: + // `right` is outside of the loop. + if (parent.right !== currentNode) { + return parent; + } + break; + + case AST_NODE_TYPES.ArrowFunctionExpression: + case AST_NODE_TYPES.FunctionExpression: + case AST_NODE_TYPES.FunctionDeclaration: + // We don't need to check nested functions. + return null; + + default: + break; + } + } + + return null; +} + +/** + * Gets the containing loop node of a given node. + * If the loop was nested, this returns the most outer loop. + * @param node A node to get. This is a loop node. + * @param excludedNode A node that the result node should not include. + * @returns The most outer loop node. + */ +function getTopLoopNode( + node: TSESTree.Node, + excludedNode: TSESTree.Node | null | undefined, +): TSESTree.Node { + const border = excludedNode ? excludedNode.range[1] : 0; + let retv = node; + let containingLoopNode: TSESTree.Node | null = node; + + while (containingLoopNode && containingLoopNode.range[0] >= border) { + retv = containingLoopNode; + containingLoopNode = getContainingLoopNode(containingLoopNode); + } + + return retv; +} + +/** + * Checks whether a given reference which refers to an upper scope's variable is + * safe or not. + * @param loopNode A containing loop node. + * @param reference A reference to check. + * @returns `true` if the reference is safe or not. + */ +function isSafe( + loopNode: TSESTree.Node, + reference: TSESLint.Scope.Reference, +): boolean { + const variable = reference.resolved; + const definition = variable?.defs[0]; + const declaration = definition?.parent; + const kind = + declaration?.type === AST_NODE_TYPES.VariableDeclaration + ? declaration.kind + : ''; + + // type references are all safe + // this only really matters for global types that haven't been configured + if (reference.isTypeReference) { + return true; + } + + // Variables which are declared by `const` is safe. + if (kind === 'const') { + return true; + } + + /* + * Variables which are declared by `let` in the loop is safe. + * It's a different instance from the next loop step's. + */ + if ( + kind === 'let' && + declaration && + declaration.range[0] > loopNode.range[0] && + declaration.range[1] < loopNode.range[1] + ) { + return true; + } + + /* + * WriteReferences which exist after this border are unsafe because those + * can modify the variable. + */ + const border = getTopLoopNode(loopNode, kind === 'let' ? declaration : null) + .range[0]; + + /** + * Checks whether a given reference is safe or not. + * The reference is every reference of the upper scope's variable we are + * looking now. + * + * It's safe if the reference matches one of the following condition. + * - is readonly. + * - doesn't exist inside a local function and after the border. + * + * @param upperRef A reference to check. + * @returns `true` if the reference is safe. + */ + function isSafeReference(upperRef: TSESLint.Scope.Reference): boolean { + const id = upperRef.identifier; + + return ( + !upperRef.isWrite() || + (variable?.scope?.variableScope === upperRef.from.variableScope && + id.range[0] < border) + ); + } + + return variable?.references.every(isSafeReference) ?? false; +} diff --git a/packages/eslint-plugin/tests/rules/no-loop-func.test.ts b/packages/eslint-plugin/tests/rules/no-loop-func.test.ts new file mode 100644 index 000000000000..be22ae267c0f --- /dev/null +++ b/packages/eslint-plugin/tests/rules/no-loop-func.test.ts @@ -0,0 +1,738 @@ +import { AST_NODE_TYPES } from '@typescript-eslint/experimental-utils'; +import rule from '../../src/rules/no-loop-func'; +import { RuleTester } from '../RuleTester'; + +const ruleTester = new RuleTester({ + parser: '@typescript-eslint/parser', +}); + +ruleTester.run('no-loop-func', rule, { + valid: [ + ` +let someArray: MyType[] = []; +for (let i = 0; i < 10; i += 1) { + someArray = someArray.filter((item: MyType) => !!item); +} + `, + { + code: ` +let someArray: MyType[] = []; +for (let i = 0; i < 10; i += 1) { + someArray = someArray.filter((item: MyType) => !!item); +} + `, + globals: { + MyType: 'readonly', + }, + }, + { + code: ` +let someArray: MyType[] = []; +for (let i = 0; i < 10; i += 1) { + someArray = someArray.filter((item: MyType) => !!item); +} + `, + globals: { + MyType: 'writable', + }, + }, + ` +type MyType = 1; +let someArray: MyType[] = []; +for (let i = 0; i < 10; i += 1) { + someArray = someArray.filter((item: MyType) => !!item); +} + `, + ], + invalid: [], +}); + +// Forked from https://github.com/eslint/eslint/blob/bf2e367bf4f6fde9930af9de8b8d8bc3d8b5782f/tests/lib/rules/no-loop-func.js +ruleTester.run('no-loop-func ESLint tests', rule, { + valid: [ + "string = 'function a() {}';", + ` +for (var i = 0; i < l; i++) {} +var a = function () { + i; +}; + `, + ` +for ( + var i = 0, + a = function () { + i; + }; + i < l; + i++ +) {} + `, + ` +for (var x in xs.filter(function (x) { + return x != upper; +})) { +} + `, + { + code: ` +for (var x of xs.filter(function (x) { + return x != upper; +})) { +} + `, + parserOptions: { ecmaVersion: 6 }, + }, + + // no refers to variables that declared on upper scope. + ` +for (var i = 0; i < l; i++) { + (function () {}); +} + `, + ` +for (var i in {}) { + (function () {}); +} + `, + { + code: ` +for (var i of {}) { + (function () {}); +} + `, + parserOptions: { ecmaVersion: 6 }, + }, + + // functions which are using unmodified variables are OK. + { + code: ` +for (let i = 0; i < l; i++) { + (function () { + i; + }); +} + `, + parserOptions: { ecmaVersion: 6 }, + }, + { + code: ` +for (let i in {}) { + i = 7; + (function () { + i; + }); +} + `, + parserOptions: { ecmaVersion: 6 }, + }, + { + code: ` +for (const i of {}) { + (function () { + i; + }); +} + `, + parserOptions: { ecmaVersion: 6 }, + }, + { + code: ` +for (let i = 0; i < 10; ++i) { + for (let x in xs.filter(x => x != i)) { + } +} + `, + parserOptions: { ecmaVersion: 6 }, + }, + { + code: ` +let a = 0; +for (let i = 0; i < l; i++) { + (function () { + a; + }); +} + `, + parserOptions: { ecmaVersion: 6 }, + }, + { + code: ` +let a = 0; +for (let i in {}) { + (function () { + a; + }); +} + `, + parserOptions: { ecmaVersion: 6 }, + }, + { + code: ` +let a = 0; +for (let i of {}) { + (function () { + a; + }); +} + `, + parserOptions: { ecmaVersion: 6 }, + }, + { + code: ` +let a = 0; +for (let i = 0; i < l; i++) { + (function () { + (function () { + a; + }); + }); +} + `, + parserOptions: { ecmaVersion: 6 }, + }, + { + code: ` +let a = 0; +for (let i in {}) { + function foo() { + (function () { + a; + }); + } +} + `, + parserOptions: { ecmaVersion: 6 }, + }, + { + code: ` +let a = 0; +for (let i of {}) { + () => { + (function () { + a; + }); + }; +} + `, + parserOptions: { ecmaVersion: 6 }, + }, + { + code: ` +var a = 0; +for (let i = 0; i < l; i++) { + (function () { + a; + }); +} + `, + parserOptions: { ecmaVersion: 6 }, + }, + { + code: ` +var a = 0; +for (let i in {}) { + (function () { + a; + }); +} + `, + parserOptions: { ecmaVersion: 6 }, + }, + { + code: ` +var a = 0; +for (let i of {}) { + (function () { + a; + }); +} + `, + parserOptions: { ecmaVersion: 6 }, + }, + { + code: [ + 'let result = {};', + 'for (const score in scores) {', + ' const letters = scores[score];', + " letters.split('').forEach(letter => {", + ' result[letter] = score;', + ' });', + '}', + 'result.__default = 6;', + ].join('\n'), + parserOptions: { ecmaVersion: 6 }, + }, + { + code: ['while (true) {', ' (function() { a; });', '}', 'let a;'].join( + '\n', + ), + parserOptions: { ecmaVersion: 6 }, + }, + ], + invalid: [ + { + code: ` +for (var i = 0; i < l; i++) { + (function () { + i; + }); +} + `, + errors: [ + { + messageId: 'unsafeRefs', + data: { varNames: "'i'" }, + type: AST_NODE_TYPES.FunctionExpression, + }, + ], + }, + { + code: ` +for (var i = 0; i < l; i++) { + for (var j = 0; j < m; j++) { + (function () { + i + j; + }); + } +} + `, + errors: [ + { + messageId: 'unsafeRefs', + data: { varNames: "'i', 'j'" }, + type: AST_NODE_TYPES.FunctionExpression, + }, + ], + }, + { + code: ` +for (var i in {}) { + (function () { + i; + }); +} + `, + errors: [ + { + messageId: 'unsafeRefs', + data: { varNames: "'i'" }, + type: AST_NODE_TYPES.FunctionExpression, + }, + ], + }, + { + code: ` +for (var i of {}) { + (function () { + i; + }); +} + `, + parserOptions: { ecmaVersion: 6 }, + errors: [ + { + messageId: 'unsafeRefs', + data: { varNames: "'i'" }, + type: AST_NODE_TYPES.FunctionExpression, + }, + ], + }, + { + code: ` +for (var i = 0; i < l; i++) { + () => { + i; + }; +} + `, + parserOptions: { ecmaVersion: 6 }, + errors: [ + { + messageId: 'unsafeRefs', + data: { varNames: "'i'" }, + type: AST_NODE_TYPES.ArrowFunctionExpression, + }, + ], + }, + { + code: ` +for (var i = 0; i < l; i++) { + var a = function () { + i; + }; +} + `, + errors: [ + { + messageId: 'unsafeRefs', + data: { varNames: "'i'" }, + type: AST_NODE_TYPES.FunctionExpression, + }, + ], + }, + { + code: ` +for (var i = 0; i < l; i++) { + function a() { + i; + } + a(); +} + `, + errors: [ + { + messageId: 'unsafeRefs', + data: { varNames: "'i'" }, + type: AST_NODE_TYPES.FunctionDeclaration, + }, + ], + }, + { + code: ` +for ( + var i = 0; + (function () { + i; + })(), + i < l; + i++ +) {} + `, + errors: [ + { + messageId: 'unsafeRefs', + data: { varNames: "'i'" }, + type: AST_NODE_TYPES.FunctionExpression, + }, + ], + }, + { + code: ` +for ( + var i = 0; + i < l; + (function () { + i; + })(), + i++ +) {} + `, + errors: [ + { + messageId: 'unsafeRefs', + data: { varNames: "'i'" }, + type: AST_NODE_TYPES.FunctionExpression, + }, + ], + }, + { + code: ` +while (i) { + (function () { + i; + }); +} + `, + errors: [ + { + messageId: 'unsafeRefs', + data: { varNames: "'i'" }, + type: AST_NODE_TYPES.FunctionExpression, + }, + ], + }, + { + code: ` +do { + (function () { + i; + }); +} while (i); + `, + errors: [ + { + messageId: 'unsafeRefs', + data: { varNames: "'i'" }, + type: AST_NODE_TYPES.FunctionExpression, + }, + ], + }, + + // Warns functions which are using modified variables. + { + code: ` +let a; +for (let i = 0; i < l; i++) { + a = 1; + (function () { + a; + }); +} + `, + parserOptions: { ecmaVersion: 6 }, + errors: [ + { + messageId: 'unsafeRefs', + data: { varNames: "'a'" }, + type: AST_NODE_TYPES.FunctionExpression, + }, + ], + }, + { + code: ` +let a; +for (let i in {}) { + (function () { + a; + }); + a = 1; +} + `, + parserOptions: { ecmaVersion: 6 }, + errors: [ + { + messageId: 'unsafeRefs', + data: { varNames: "'a'" }, + type: AST_NODE_TYPES.FunctionExpression, + }, + ], + }, + { + code: ` +let a; +for (let i of {}) { + (function () { + a; + }); +} +a = 1; + `, + parserOptions: { ecmaVersion: 6 }, + errors: [ + { + messageId: 'unsafeRefs', + data: { varNames: "'a'" }, + type: AST_NODE_TYPES.FunctionExpression, + }, + ], + }, + { + code: ` +let a; +for (let i = 0; i < l; i++) { + (function () { + (function () { + a; + }); + }); + a = 1; +} + `, + parserOptions: { ecmaVersion: 6 }, + errors: [ + { + messageId: 'unsafeRefs', + data: { varNames: "'a'" }, + type: AST_NODE_TYPES.FunctionExpression, + }, + ], + }, + { + code: ` +let a; +for (let i in {}) { + a = 1; + function foo() { + (function () { + a; + }); + } +} + `, + parserOptions: { ecmaVersion: 6 }, + errors: [ + { + messageId: 'unsafeRefs', + data: { varNames: "'a'" }, + type: AST_NODE_TYPES.FunctionDeclaration, + }, + ], + }, + { + code: ` +let a; +for (let i of {}) { + () => { + (function () { + a; + }); + }; +} +a = 1; + `, + parserOptions: { ecmaVersion: 6 }, + errors: [ + { + messageId: 'unsafeRefs', + data: { varNames: "'a'" }, + type: AST_NODE_TYPES.ArrowFunctionExpression, + }, + ], + }, + { + code: ` +for (var i = 0; i < 10; ++i) { + for (let x in xs.filter(x => x != i)) { + } +} + `, + parserOptions: { ecmaVersion: 6 }, + errors: [ + { + messageId: 'unsafeRefs', + data: { varNames: "'i'" }, + type: AST_NODE_TYPES.ArrowFunctionExpression, + }, + ], + }, + { + code: ` +for (let x of xs) { + let a; + for (let y of ys) { + a = 1; + (function () { + a; + }); + } +} + `, + parserOptions: { ecmaVersion: 6 }, + errors: [ + { + messageId: 'unsafeRefs', + data: { varNames: "'a'" }, + type: AST_NODE_TYPES.FunctionExpression, + }, + ], + }, + { + code: ` +for (var x of xs) { + for (let y of ys) { + (function () { + x; + }); + } +} + `, + parserOptions: { ecmaVersion: 6 }, + errors: [ + { + messageId: 'unsafeRefs', + data: { varNames: "'x'" }, + type: AST_NODE_TYPES.FunctionExpression, + }, + ], + }, + { + code: ` +for (var x of xs) { + (function () { + x; + }); +} + `, + parserOptions: { ecmaVersion: 6 }, + errors: [ + { + messageId: 'unsafeRefs', + data: { varNames: "'x'" }, + type: AST_NODE_TYPES.FunctionExpression, + }, + ], + }, + { + code: ` +var a; +for (let x of xs) { + a = 1; + (function () { + a; + }); +} + `, + parserOptions: { ecmaVersion: 6 }, + errors: [ + { + messageId: 'unsafeRefs', + data: { varNames: "'a'" }, + type: AST_NODE_TYPES.FunctionExpression, + }, + ], + }, + { + code: ` +var a; +for (let x of xs) { + (function () { + a; + }); + a = 1; +} + `, + parserOptions: { ecmaVersion: 6 }, + errors: [ + { + messageId: 'unsafeRefs', + data: { varNames: "'a'" }, + type: AST_NODE_TYPES.FunctionExpression, + }, + ], + }, + { + code: ` +let a; +function foo() { + a = 10; +} +for (let x of xs) { + (function () { + a; + }); +} +foo(); + `, + parserOptions: { ecmaVersion: 6 }, + errors: [ + { + messageId: 'unsafeRefs', + data: { varNames: "'a'" }, + type: AST_NODE_TYPES.FunctionExpression, + }, + ], + }, + { + code: ` +let a; +function foo() { + a = 10; + for (let x of xs) { + (function () { + a; + }); + } +} +foo(); + `, + parserOptions: { ecmaVersion: 6 }, + errors: [ + { + messageId: 'unsafeRefs', + data: { varNames: "'a'" }, + type: AST_NODE_TYPES.FunctionExpression, + }, + ], + }, + ], +}); diff --git a/packages/eslint-plugin/typings/eslint-rules.d.ts b/packages/eslint-plugin/typings/eslint-rules.d.ts index fa9fc6170a6c..9117f06c6c1e 100644 --- a/packages/eslint-plugin/typings/eslint-rules.d.ts +++ b/packages/eslint-plugin/typings/eslint-rules.d.ts @@ -286,6 +286,21 @@ declare module 'eslint/lib/rules/no-implicit-globals' { export = rule; } +declare module 'eslint/lib/rules/no-loop-func' { + import { TSESLint, TSESTree } from '@typescript-eslint/experimental-utils'; + + const rule: TSESLint.RuleModule< + 'unsafeRefs', + [], + { + ArrowFunctionExpression(node: TSESTree.ArrowFunctionExpression): void; + FunctionExpression(node: TSESTree.FunctionExpression): void; + FunctionDeclaration(node: TSESTree.FunctionDeclaration): void; + } + >; + export = rule; +} + declare module 'eslint/lib/rules/no-magic-numbers' { import { TSESLint, TSESTree } from '@typescript-eslint/experimental-utils'; From 9d8b4c479c98623e4198aa07639321929a8a876f Mon Sep 17 00:00:00 2001 From: Brad Zacher Date: Sat, 5 Sep 2020 14:58:13 -0700 Subject: [PATCH 07/22] fix(scope-manager): support rest function type parameters (#2491) Fixes #2449 --- .../tests/rules/no-unused-vars.test.ts | 8 ++ .../src/referencer/TypeVisitor.ts | 12 ++- .../function/params/array-pattern.ts | 1 + .../function/params/array-pattern.ts.shot | 96 +++++++++++++++++++ .../function/params/object-pattern.ts | 1 + .../function/params/object-pattern.ts.shot | 96 +++++++++++++++++++ .../function/params/rest-element.ts | 1 + .../function/params/rest-element.ts.shot | 96 +++++++++++++++++++ 8 files changed, 310 insertions(+), 1 deletion(-) create mode 100644 packages/scope-manager/tests/fixtures/type-declaration/function/params/array-pattern.ts create mode 100644 packages/scope-manager/tests/fixtures/type-declaration/function/params/array-pattern.ts.shot create mode 100644 packages/scope-manager/tests/fixtures/type-declaration/function/params/object-pattern.ts create mode 100644 packages/scope-manager/tests/fixtures/type-declaration/function/params/object-pattern.ts.shot create mode 100644 packages/scope-manager/tests/fixtures/type-declaration/function/params/rest-element.ts create mode 100644 packages/scope-manager/tests/fixtures/type-declaration/function/params/rest-element.ts.shot diff --git a/packages/eslint-plugin/tests/rules/no-unused-vars.test.ts b/packages/eslint-plugin/tests/rules/no-unused-vars.test.ts index 323d85b94a65..5165ecda28ba 100644 --- a/packages/eslint-plugin/tests/rules/no-unused-vars.test.ts +++ b/packages/eslint-plugin/tests/rules/no-unused-vars.test.ts @@ -767,6 +767,14 @@ export abstract class Foo { protected abstract readonly type: FooType; } `, + // https://github.com/typescript-eslint/typescript-eslint/issues/2449 + ` +export type F = (...a: A) => unknown; + `, + ` +import { Foo } from './bar'; +export type F = (...a: Foo) => unknown; + `, ], invalid: [ diff --git a/packages/scope-manager/src/referencer/TypeVisitor.ts b/packages/scope-manager/src/referencer/TypeVisitor.ts index 49f0ac127430..a43d09486592 100644 --- a/packages/scope-manager/src/referencer/TypeVisitor.ts +++ b/packages/scope-manager/src/referencer/TypeVisitor.ts @@ -33,6 +33,7 @@ class TypeVisitor extends Visitor { this.visit(node.typeParameters); for (const param of node.params) { + let didVisitAnnotation = false; this.visitPattern(param, (pattern, info) => { // a parameter name creates a value type variable which can be referenced later via typeof arg this.#referencer @@ -41,8 +42,17 @@ class TypeVisitor extends Visitor { pattern, new ParameterDefinition(pattern, node, info.rest), ); - this.visit(pattern.typeAnnotation); + + if (pattern.typeAnnotation) { + this.visit(pattern.typeAnnotation); + didVisitAnnotation = true; + } }); + + // there are a few special cases where the type annotation is owned by the parameter, not the pattern + if (!didVisitAnnotation && 'typeAnnotation' in param) { + this.visit(param.typeAnnotation); + } } this.visit(node.returnType); diff --git a/packages/scope-manager/tests/fixtures/type-declaration/function/params/array-pattern.ts b/packages/scope-manager/tests/fixtures/type-declaration/function/params/array-pattern.ts new file mode 100644 index 000000000000..27da21ea7ad7 --- /dev/null +++ b/packages/scope-manager/tests/fixtures/type-declaration/function/params/array-pattern.ts @@ -0,0 +1 @@ +type Fn = ([a]: A) => unknown; diff --git a/packages/scope-manager/tests/fixtures/type-declaration/function/params/array-pattern.ts.shot b/packages/scope-manager/tests/fixtures/type-declaration/function/params/array-pattern.ts.shot new file mode 100644 index 000000000000..409f49b66b9d --- /dev/null +++ b/packages/scope-manager/tests/fixtures/type-declaration/function/params/array-pattern.ts.shot @@ -0,0 +1,96 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`type-declaration function params array-pattern 1`] = ` +ScopeManager { + variables: Array [ + Variable$1 { + defs: Array [ + TypeDefinition$1 { + name: Identifier<"Fn">, + node: TSTypeAliasDeclaration$1, + }, + ], + name: "Fn", + references: Array [], + isValueVariable: false, + isTypeVariable: true, + }, + Variable$2 { + defs: Array [ + TypeDefinition$2 { + name: Identifier<"A">, + node: TSTypeParameter$2, + }, + ], + name: "A", + references: Array [ + Reference$1 { + identifier: Identifier<"A">, + isRead: true, + isTypeReference: true, + isValueReference: false, + isWrite: false, + resolved: Variable$2, + }, + ], + isValueVariable: false, + isTypeVariable: true, + }, + Variable$3 { + defs: Array [ + ParameterDefinition$3 { + name: Identifier<"a">, + node: TSFunctionType$3, + }, + ], + name: "a", + references: Array [], + isValueVariable: true, + isTypeVariable: false, + }, + ], + scopes: Array [ + GlobalScope$1 { + block: Program$4, + isStrict: false, + references: Array [], + set: Map { + "Fn" => Variable$1, + }, + type: "global", + upper: null, + variables: Array [ + Variable$1, + ], + }, + TypeScope$2 { + block: TSTypeAliasDeclaration$1, + isStrict: true, + references: Array [], + set: Map { + "A" => Variable$2, + }, + type: "type", + upper: GlobalScope$1, + variables: Array [ + Variable$2, + ], + }, + FunctionTypeScope$3 { + block: TSFunctionType$3, + isStrict: true, + references: Array [ + Reference$1, + ], + set: Map { + "a" => Variable$3, + }, + type: "functionType", + upper: TypeScope$2, + variables: Array [ + Variable$3, + ], + }, + ], +} +`; diff --git a/packages/scope-manager/tests/fixtures/type-declaration/function/params/object-pattern.ts b/packages/scope-manager/tests/fixtures/type-declaration/function/params/object-pattern.ts new file mode 100644 index 000000000000..f262383a8d8a --- /dev/null +++ b/packages/scope-manager/tests/fixtures/type-declaration/function/params/object-pattern.ts @@ -0,0 +1 @@ +type Fn = ({ a }: A) => unknown; diff --git a/packages/scope-manager/tests/fixtures/type-declaration/function/params/object-pattern.ts.shot b/packages/scope-manager/tests/fixtures/type-declaration/function/params/object-pattern.ts.shot new file mode 100644 index 000000000000..44d53bab98e3 --- /dev/null +++ b/packages/scope-manager/tests/fixtures/type-declaration/function/params/object-pattern.ts.shot @@ -0,0 +1,96 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`type-declaration function params object-pattern 1`] = ` +ScopeManager { + variables: Array [ + Variable$1 { + defs: Array [ + TypeDefinition$1 { + name: Identifier<"Fn">, + node: TSTypeAliasDeclaration$1, + }, + ], + name: "Fn", + references: Array [], + isValueVariable: false, + isTypeVariable: true, + }, + Variable$2 { + defs: Array [ + TypeDefinition$2 { + name: Identifier<"A">, + node: TSTypeParameter$2, + }, + ], + name: "A", + references: Array [ + Reference$1 { + identifier: Identifier<"A">, + isRead: true, + isTypeReference: true, + isValueReference: false, + isWrite: false, + resolved: Variable$2, + }, + ], + isValueVariable: false, + isTypeVariable: true, + }, + Variable$3 { + defs: Array [ + ParameterDefinition$3 { + name: Identifier<"a">, + node: TSFunctionType$3, + }, + ], + name: "a", + references: Array [], + isValueVariable: true, + isTypeVariable: false, + }, + ], + scopes: Array [ + GlobalScope$1 { + block: Program$4, + isStrict: false, + references: Array [], + set: Map { + "Fn" => Variable$1, + }, + type: "global", + upper: null, + variables: Array [ + Variable$1, + ], + }, + TypeScope$2 { + block: TSTypeAliasDeclaration$1, + isStrict: true, + references: Array [], + set: Map { + "A" => Variable$2, + }, + type: "type", + upper: GlobalScope$1, + variables: Array [ + Variable$2, + ], + }, + FunctionTypeScope$3 { + block: TSFunctionType$3, + isStrict: true, + references: Array [ + Reference$1, + ], + set: Map { + "a" => Variable$3, + }, + type: "functionType", + upper: TypeScope$2, + variables: Array [ + Variable$3, + ], + }, + ], +} +`; diff --git a/packages/scope-manager/tests/fixtures/type-declaration/function/params/rest-element.ts b/packages/scope-manager/tests/fixtures/type-declaration/function/params/rest-element.ts new file mode 100644 index 000000000000..da11f73c40c0 --- /dev/null +++ b/packages/scope-manager/tests/fixtures/type-declaration/function/params/rest-element.ts @@ -0,0 +1 @@ +type Fn = (...a: A) => unknown; diff --git a/packages/scope-manager/tests/fixtures/type-declaration/function/params/rest-element.ts.shot b/packages/scope-manager/tests/fixtures/type-declaration/function/params/rest-element.ts.shot new file mode 100644 index 000000000000..6b69e7667d76 --- /dev/null +++ b/packages/scope-manager/tests/fixtures/type-declaration/function/params/rest-element.ts.shot @@ -0,0 +1,96 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`type-declaration function params rest-element 1`] = ` +ScopeManager { + variables: Array [ + Variable$1 { + defs: Array [ + TypeDefinition$1 { + name: Identifier<"Fn">, + node: TSTypeAliasDeclaration$1, + }, + ], + name: "Fn", + references: Array [], + isValueVariable: false, + isTypeVariable: true, + }, + Variable$2 { + defs: Array [ + TypeDefinition$2 { + name: Identifier<"A">, + node: TSTypeParameter$2, + }, + ], + name: "A", + references: Array [ + Reference$1 { + identifier: Identifier<"A">, + isRead: true, + isTypeReference: true, + isValueReference: false, + isWrite: false, + resolved: Variable$2, + }, + ], + isValueVariable: false, + isTypeVariable: true, + }, + Variable$3 { + defs: Array [ + ParameterDefinition$3 { + name: Identifier<"a">, + node: TSFunctionType$3, + }, + ], + name: "a", + references: Array [], + isValueVariable: true, + isTypeVariable: false, + }, + ], + scopes: Array [ + GlobalScope$1 { + block: Program$4, + isStrict: false, + references: Array [], + set: Map { + "Fn" => Variable$1, + }, + type: "global", + upper: null, + variables: Array [ + Variable$1, + ], + }, + TypeScope$2 { + block: TSTypeAliasDeclaration$1, + isStrict: true, + references: Array [], + set: Map { + "A" => Variable$2, + }, + type: "type", + upper: GlobalScope$1, + variables: Array [ + Variable$2, + ], + }, + FunctionTypeScope$3 { + block: TSFunctionType$3, + isStrict: true, + references: Array [ + Reference$1, + ], + set: Map { + "a" => Variable$3, + }, + type: "functionType", + upper: TypeScope$2, + variables: Array [ + Variable$3, + ], + }, + ], +} +`; From a2686c04293ab9070c1500a0dab7e205bd1fa9d2 Mon Sep 17 00:00:00 2001 From: Brad Zacher Date: Sat, 5 Sep 2020 15:30:55 -0700 Subject: [PATCH 08/22] fix(scope-manager): support tagged template string generic type parameters (#2492) --- .../tests/rules/no-unused-vars.test.ts | 8 + .../src/referencer/Referencer.ts | 8 + .../type-parameters/tagged-template.ts | 6 + .../type-parameters/tagged-template.ts.shot | 144 ++++++++++++++++++ 4 files changed, 166 insertions(+) create mode 100644 packages/scope-manager/tests/fixtures/type-declaration/type-parameters/tagged-template.ts create mode 100644 packages/scope-manager/tests/fixtures/type-declaration/type-parameters/tagged-template.ts.shot diff --git a/packages/eslint-plugin/tests/rules/no-unused-vars.test.ts b/packages/eslint-plugin/tests/rules/no-unused-vars.test.ts index 5165ecda28ba..aa795ed5d767 100644 --- a/packages/eslint-plugin/tests/rules/no-unused-vars.test.ts +++ b/packages/eslint-plugin/tests/rules/no-unused-vars.test.ts @@ -775,6 +775,14 @@ export type F = (...a: A) => unknown; import { Foo } from './bar'; export type F = (...a: Foo) => unknown; `, + // https://github.com/typescript-eslint/typescript-eslint/issues/2452 + ` +type StyledPaymentProps = { + isValid: boolean; +}; + +export const StyledPayment = styled.div\`\`; + `, ], invalid: [ diff --git a/packages/scope-manager/src/referencer/Referencer.ts b/packages/scope-manager/src/referencer/Referencer.ts index 1b71d7d0c50e..c0c49ef9728b 100644 --- a/packages/scope-manager/src/referencer/Referencer.ts +++ b/packages/scope-manager/src/referencer/Referencer.ts @@ -565,6 +565,14 @@ class Referencer extends Visitor { this.close(node); } + protected TaggedTemplateExpression( + node: TSESTree.TaggedTemplateExpression, + ): void { + this.visit(node.tag); + this.visit(node.quasi); + this.visitType(node.typeParameters); + } + protected TSAbstractClassProperty( node: TSESTree.TSAbstractClassProperty, ): void { diff --git a/packages/scope-manager/tests/fixtures/type-declaration/type-parameters/tagged-template.ts b/packages/scope-manager/tests/fixtures/type-declaration/type-parameters/tagged-template.ts new file mode 100644 index 000000000000..a3c92996728d --- /dev/null +++ b/packages/scope-manager/tests/fixtures/type-declaration/type-parameters/tagged-template.ts @@ -0,0 +1,6 @@ +type StyledPaymentProps = { + isValid: boolean; +}; +function div(arg: any): void {} + +const StyledPayment = div``; diff --git a/packages/scope-manager/tests/fixtures/type-declaration/type-parameters/tagged-template.ts.shot b/packages/scope-manager/tests/fixtures/type-declaration/type-parameters/tagged-template.ts.shot new file mode 100644 index 000000000000..20b355c1df3b --- /dev/null +++ b/packages/scope-manager/tests/fixtures/type-declaration/type-parameters/tagged-template.ts.shot @@ -0,0 +1,144 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`type-declaration type-parameters tagged-template 1`] = ` +ScopeManager { + variables: Array [ + Variable$1 { + defs: Array [ + TypeDefinition$1 { + name: Identifier<"StyledPaymentProps">, + node: TSTypeAliasDeclaration$1, + }, + ], + name: "StyledPaymentProps", + references: Array [ + Reference$3 { + identifier: Identifier<"StyledPaymentProps">, + isRead: true, + isTypeReference: true, + isValueReference: false, + isWrite: false, + resolved: Variable$1, + }, + ], + isValueVariable: false, + isTypeVariable: true, + }, + Variable$2 { + defs: Array [ + FunctionNameDefinition$2 { + name: Identifier<"div">, + node: FunctionDeclaration$2, + }, + ], + name: "div", + references: Array [ + Reference$2 { + identifier: Identifier<"div">, + 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 [ + ParameterDefinition$3 { + name: Identifier<"arg">, + node: FunctionDeclaration$2, + }, + ], + name: "arg", + references: Array [], + isValueVariable: true, + isTypeVariable: false, + }, + Variable$5 { + defs: Array [ + TypeDefinition$4 { + name: Identifier<"T">, + node: TSTypeParameter$3, + }, + ], + name: "T", + references: Array [], + isValueVariable: false, + isTypeVariable: true, + }, + Variable$6 { + defs: Array [ + VariableDefinition$5 { + name: Identifier<"StyledPayment">, + node: VariableDeclarator$4, + }, + ], + name: "StyledPayment", + references: Array [ + Reference$1 { + identifier: Identifier<"StyledPayment">, + init: true, + isRead: false, + isTypeReference: false, + isValueReference: true, + isWrite: true, + resolved: Variable$6, + writeExpr: TaggedTemplateExpression$5, + }, + ], + isValueVariable: true, + isTypeVariable: false, + }, + ], + scopes: Array [ + GlobalScope$1 { + block: Program$6, + isStrict: false, + references: Array [ + Reference$1, + Reference$2, + Reference$3, + ], + set: Map { + "StyledPaymentProps" => Variable$1, + "div" => Variable$2, + "StyledPayment" => Variable$6, + }, + type: "global", + upper: null, + variables: Array [ + Variable$1, + Variable$2, + Variable$6, + ], + }, + FunctionScope$2 { + block: FunctionDeclaration$2, + isStrict: false, + references: Array [], + set: Map { + "arguments" => Variable$3, + "arg" => Variable$4, + "T" => Variable$5, + }, + type: "function", + upper: GlobalScope$1, + variables: Array [ + Variable$3, + Variable$4, + Variable$5, + ], + }, + ], +} +`; From a40f54c39d59096a0d12a492807dcd52fbcdc384 Mon Sep 17 00:00:00 2001 From: Brad Zacher Date: Sat, 5 Sep 2020 15:52:18 -0700 Subject: [PATCH 09/22] fix(scope-manager): support type predicates (#2493) Fixes #2462 --- .../tests/eslint-rules/no-undef.test.ts | 29 ++++ .../src/referencer/TypeVisitor.ts | 7 + .../arrow/type-predicate-asserts1.ts | 1 + .../arrow/type-predicate-asserts1.ts.shot | 84 ++++++++++++ .../arrow/type-predicate-asserts2.ts | 2 + .../arrow/type-predicate-asserts2.ts.shot | 108 +++++++++++++++ .../functions/arrow/type-predicate1.ts | 3 + .../functions/arrow/type-predicate1.ts.shot | 93 +++++++++++++ .../functions/arrow/type-predicate2.ts | 4 + .../functions/arrow/type-predicate2.ts.shot | 117 ++++++++++++++++ .../type-predicate-asserts1.ts | 1 + .../type-predicate-asserts1.ts.shot | 80 +++++++++++ .../type-predicate-asserts2.ts | 2 + .../type-predicate-asserts2.ts.shot | 104 +++++++++++++++ .../function-declaration/type-predicate1.ts | 3 + .../type-predicate1.ts.shot | 89 +++++++++++++ .../function-declaration/type-predicate2.ts | 4 + .../type-predicate2.ts.shot | 113 ++++++++++++++++ .../type-predicate-asserts1.ts | 1 + .../type-predicate-asserts1.ts.shot | 93 +++++++++++++ .../type-predicate-asserts2.ts | 2 + .../type-predicate-asserts2.ts.shot | 117 ++++++++++++++++ .../function-expression/type-predicate1.ts | 3 + .../type-predicate1.ts.shot | 102 ++++++++++++++ .../function-expression/type-predicate2.ts | 4 + .../type-predicate2.ts.shot | 126 ++++++++++++++++++ 26 files changed, 1292 insertions(+) create mode 100644 packages/scope-manager/tests/fixtures/functions/arrow/type-predicate-asserts1.ts create mode 100644 packages/scope-manager/tests/fixtures/functions/arrow/type-predicate-asserts1.ts.shot create mode 100644 packages/scope-manager/tests/fixtures/functions/arrow/type-predicate-asserts2.ts create mode 100644 packages/scope-manager/tests/fixtures/functions/arrow/type-predicate-asserts2.ts.shot create mode 100644 packages/scope-manager/tests/fixtures/functions/arrow/type-predicate1.ts create mode 100644 packages/scope-manager/tests/fixtures/functions/arrow/type-predicate1.ts.shot create mode 100644 packages/scope-manager/tests/fixtures/functions/arrow/type-predicate2.ts create mode 100644 packages/scope-manager/tests/fixtures/functions/arrow/type-predicate2.ts.shot create mode 100644 packages/scope-manager/tests/fixtures/functions/function-declaration/type-predicate-asserts1.ts create mode 100644 packages/scope-manager/tests/fixtures/functions/function-declaration/type-predicate-asserts1.ts.shot create mode 100644 packages/scope-manager/tests/fixtures/functions/function-declaration/type-predicate-asserts2.ts create mode 100644 packages/scope-manager/tests/fixtures/functions/function-declaration/type-predicate-asserts2.ts.shot create mode 100644 packages/scope-manager/tests/fixtures/functions/function-declaration/type-predicate1.ts create mode 100644 packages/scope-manager/tests/fixtures/functions/function-declaration/type-predicate1.ts.shot create mode 100644 packages/scope-manager/tests/fixtures/functions/function-declaration/type-predicate2.ts create mode 100644 packages/scope-manager/tests/fixtures/functions/function-declaration/type-predicate2.ts.shot create mode 100644 packages/scope-manager/tests/fixtures/functions/function-expression/type-predicate-asserts1.ts create mode 100644 packages/scope-manager/tests/fixtures/functions/function-expression/type-predicate-asserts1.ts.shot create mode 100644 packages/scope-manager/tests/fixtures/functions/function-expression/type-predicate-asserts2.ts create mode 100644 packages/scope-manager/tests/fixtures/functions/function-expression/type-predicate-asserts2.ts.shot create mode 100644 packages/scope-manager/tests/fixtures/functions/function-expression/type-predicate1.ts create mode 100644 packages/scope-manager/tests/fixtures/functions/function-expression/type-predicate1.ts.shot create mode 100644 packages/scope-manager/tests/fixtures/functions/function-expression/type-predicate2.ts create mode 100644 packages/scope-manager/tests/fixtures/functions/function-expression/type-predicate2.ts.shot diff --git a/packages/eslint-plugin/tests/eslint-rules/no-undef.test.ts b/packages/eslint-plugin/tests/eslint-rules/no-undef.test.ts index fea74c8aae3e..c87e5b4433e2 100644 --- a/packages/eslint-plugin/tests/eslint-rules/no-undef.test.ts +++ b/packages/eslint-plugin/tests/eslint-rules/no-undef.test.ts @@ -111,6 +111,35 @@ function eachr(subject: Map): typeof subject; var a = { b: () => {} }; a?.b(); `, + // https://github.com/typescript-eslint/typescript-eslint/issues/2462 + ` +export default class Column { + isColumnString(column: unknown): column is string { + return typeof this.column === 'string'; + } +} + `, + ` +type T = string; +function predicate(arg: any): arg is T { + return typeof arg === 'string'; +} + `, + ` +function predicate(arg: any): asserts arg { + if (arg == null) { + throw 'oops'; + } +} + `, + ` +type T = string; +function predicate(arg: any): asserts arg is T { + if (typeof arg !== 'string') { + throw 'oops'; + } +} + `, ], invalid: [ { diff --git a/packages/scope-manager/src/referencer/TypeVisitor.ts b/packages/scope-manager/src/referencer/TypeVisitor.ts index a43d09486592..d921529ac82f 100644 --- a/packages/scope-manager/src/referencer/TypeVisitor.ts +++ b/packages/scope-manager/src/referencer/TypeVisitor.ts @@ -199,6 +199,13 @@ class TypeVisitor extends Visitor { this.visit(node.default); } + protected TSTypePredicate(node: TSESTree.TSTypePredicate): void { + if (node.parameterName.type !== AST_NODE_TYPES.TSThisType) { + this.#referencer.currentScope().referenceValue(node.parameterName); + } + this.visit(node.typeAnnotation); + } + // a type query `typeof foo` is a special case that references a _non-type_ variable, protected TSTypeQuery(node: TSESTree.TSTypeQuery): void { if (node.exprName.type === AST_NODE_TYPES.Identifier) { diff --git a/packages/scope-manager/tests/fixtures/functions/arrow/type-predicate-asserts1.ts b/packages/scope-manager/tests/fixtures/functions/arrow/type-predicate-asserts1.ts new file mode 100644 index 000000000000..3b0688ece76d --- /dev/null +++ b/packages/scope-manager/tests/fixtures/functions/arrow/type-predicate-asserts1.ts @@ -0,0 +1 @@ +const foo = (arg: any): asserts arg => {}; diff --git a/packages/scope-manager/tests/fixtures/functions/arrow/type-predicate-asserts1.ts.shot b/packages/scope-manager/tests/fixtures/functions/arrow/type-predicate-asserts1.ts.shot new file mode 100644 index 000000000000..0c9383d2c10b --- /dev/null +++ b/packages/scope-manager/tests/fixtures/functions/arrow/type-predicate-asserts1.ts.shot @@ -0,0 +1,84 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`functions arrow type-predicate-asserts1 1`] = ` +ScopeManager { + variables: Array [ + Variable$1 { + defs: Array [ + VariableDefinition$1 { + name: Identifier<"foo">, + node: VariableDeclarator$1, + }, + ], + name: "foo", + references: Array [ + Reference$1 { + identifier: Identifier<"foo">, + init: true, + isRead: false, + isTypeReference: false, + isValueReference: true, + isWrite: true, + resolved: Variable$1, + writeExpr: ArrowFunctionExpression$2, + }, + ], + isValueVariable: true, + isTypeVariable: false, + }, + Variable$2 { + defs: Array [ + ParameterDefinition$2 { + name: Identifier<"arg">, + node: ArrowFunctionExpression$2, + }, + ], + name: "arg", + references: Array [ + Reference$2 { + identifier: Identifier<"arg">, + isRead: true, + isTypeReference: false, + isValueReference: true, + isWrite: false, + resolved: Variable$2, + }, + ], + isValueVariable: true, + isTypeVariable: false, + }, + ], + scopes: Array [ + GlobalScope$1 { + block: Program$3, + isStrict: false, + references: Array [ + Reference$1, + ], + set: Map { + "foo" => Variable$1, + }, + type: "global", + upper: null, + variables: Array [ + Variable$1, + ], + }, + FunctionScope$2 { + block: ArrowFunctionExpression$2, + isStrict: false, + references: Array [ + Reference$2, + ], + set: Map { + "arg" => Variable$2, + }, + type: "function", + upper: GlobalScope$1, + variables: Array [ + Variable$2, + ], + }, + ], +} +`; diff --git a/packages/scope-manager/tests/fixtures/functions/arrow/type-predicate-asserts2.ts b/packages/scope-manager/tests/fixtures/functions/arrow/type-predicate-asserts2.ts new file mode 100644 index 000000000000..93d7055b7c4d --- /dev/null +++ b/packages/scope-manager/tests/fixtures/functions/arrow/type-predicate-asserts2.ts @@ -0,0 +1,2 @@ +type T = string; +const foo = (arg: any): asserts arg is T => {}; diff --git a/packages/scope-manager/tests/fixtures/functions/arrow/type-predicate-asserts2.ts.shot b/packages/scope-manager/tests/fixtures/functions/arrow/type-predicate-asserts2.ts.shot new file mode 100644 index 000000000000..6ef8fae784de --- /dev/null +++ b/packages/scope-manager/tests/fixtures/functions/arrow/type-predicate-asserts2.ts.shot @@ -0,0 +1,108 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`functions arrow type-predicate-asserts2 1`] = ` +ScopeManager { + variables: Array [ + Variable$1 { + defs: Array [ + TypeDefinition$1 { + name: Identifier<"T">, + node: TSTypeAliasDeclaration$1, + }, + ], + name: "T", + references: Array [ + Reference$3 { + identifier: Identifier<"T">, + isRead: true, + isTypeReference: true, + isValueReference: false, + isWrite: false, + resolved: Variable$1, + }, + ], + isValueVariable: false, + isTypeVariable: true, + }, + Variable$2 { + defs: Array [ + VariableDefinition$2 { + name: Identifier<"foo">, + node: VariableDeclarator$2, + }, + ], + name: "foo", + references: Array [ + Reference$1 { + identifier: Identifier<"foo">, + init: true, + isRead: false, + isTypeReference: false, + isValueReference: true, + isWrite: true, + resolved: Variable$2, + writeExpr: ArrowFunctionExpression$3, + }, + ], + isValueVariable: true, + isTypeVariable: false, + }, + Variable$3 { + defs: Array [ + ParameterDefinition$3 { + name: Identifier<"arg">, + node: ArrowFunctionExpression$3, + }, + ], + name: "arg", + references: Array [ + Reference$2 { + identifier: Identifier<"arg">, + isRead: true, + isTypeReference: false, + isValueReference: true, + isWrite: false, + resolved: Variable$3, + }, + ], + isValueVariable: true, + isTypeVariable: false, + }, + ], + scopes: Array [ + GlobalScope$1 { + block: Program$4, + isStrict: false, + references: Array [ + Reference$1, + ], + set: Map { + "T" => Variable$1, + "foo" => Variable$2, + }, + type: "global", + upper: null, + variables: Array [ + Variable$1, + Variable$2, + ], + }, + FunctionScope$2 { + block: ArrowFunctionExpression$3, + isStrict: false, + references: Array [ + Reference$2, + Reference$3, + ], + set: Map { + "arg" => Variable$3, + }, + type: "function", + upper: GlobalScope$1, + variables: Array [ + Variable$3, + ], + }, + ], +} +`; diff --git a/packages/scope-manager/tests/fixtures/functions/arrow/type-predicate1.ts b/packages/scope-manager/tests/fixtures/functions/arrow/type-predicate1.ts new file mode 100644 index 000000000000..61f672ab3db0 --- /dev/null +++ b/packages/scope-manager/tests/fixtures/functions/arrow/type-predicate1.ts @@ -0,0 +1,3 @@ +const foo = (arg: any): arg is string => { + return typeof arg === 'string'; +}; diff --git a/packages/scope-manager/tests/fixtures/functions/arrow/type-predicate1.ts.shot b/packages/scope-manager/tests/fixtures/functions/arrow/type-predicate1.ts.shot new file mode 100644 index 000000000000..88e387ae251f --- /dev/null +++ b/packages/scope-manager/tests/fixtures/functions/arrow/type-predicate1.ts.shot @@ -0,0 +1,93 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`functions arrow type-predicate1 1`] = ` +ScopeManager { + variables: Array [ + Variable$1 { + defs: Array [ + VariableDefinition$1 { + name: Identifier<"foo">, + node: VariableDeclarator$1, + }, + ], + name: "foo", + references: Array [ + Reference$1 { + identifier: Identifier<"foo">, + init: true, + isRead: false, + isTypeReference: false, + isValueReference: true, + isWrite: true, + resolved: Variable$1, + writeExpr: ArrowFunctionExpression$2, + }, + ], + isValueVariable: true, + isTypeVariable: false, + }, + Variable$2 { + defs: Array [ + ParameterDefinition$2 { + name: Identifier<"arg">, + node: ArrowFunctionExpression$2, + }, + ], + name: "arg", + references: Array [ + Reference$2 { + identifier: Identifier<"arg">, + isRead: true, + isTypeReference: false, + isValueReference: true, + isWrite: false, + resolved: Variable$2, + }, + Reference$3 { + identifier: Identifier<"arg">, + isRead: true, + isTypeReference: false, + isValueReference: true, + isWrite: false, + resolved: Variable$2, + }, + ], + isValueVariable: true, + isTypeVariable: false, + }, + ], + scopes: Array [ + GlobalScope$1 { + block: Program$3, + isStrict: false, + references: Array [ + Reference$1, + ], + set: Map { + "foo" => Variable$1, + }, + type: "global", + upper: null, + variables: Array [ + Variable$1, + ], + }, + FunctionScope$2 { + block: ArrowFunctionExpression$2, + isStrict: false, + references: Array [ + Reference$2, + Reference$3, + ], + set: Map { + "arg" => Variable$2, + }, + type: "function", + upper: GlobalScope$1, + variables: Array [ + Variable$2, + ], + }, + ], +} +`; diff --git a/packages/scope-manager/tests/fixtures/functions/arrow/type-predicate2.ts b/packages/scope-manager/tests/fixtures/functions/arrow/type-predicate2.ts new file mode 100644 index 000000000000..3a5c16435b0e --- /dev/null +++ b/packages/scope-manager/tests/fixtures/functions/arrow/type-predicate2.ts @@ -0,0 +1,4 @@ +type T = string; +const foo = (arg: any): arg is T => { + return typeof arg === 'string'; +}; diff --git a/packages/scope-manager/tests/fixtures/functions/arrow/type-predicate2.ts.shot b/packages/scope-manager/tests/fixtures/functions/arrow/type-predicate2.ts.shot new file mode 100644 index 000000000000..9795a6b29f78 --- /dev/null +++ b/packages/scope-manager/tests/fixtures/functions/arrow/type-predicate2.ts.shot @@ -0,0 +1,117 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`functions arrow type-predicate2 1`] = ` +ScopeManager { + variables: Array [ + Variable$1 { + defs: Array [ + TypeDefinition$1 { + name: Identifier<"T">, + node: TSTypeAliasDeclaration$1, + }, + ], + name: "T", + references: Array [ + Reference$3 { + identifier: Identifier<"T">, + isRead: true, + isTypeReference: true, + isValueReference: false, + isWrite: false, + resolved: Variable$1, + }, + ], + isValueVariable: false, + isTypeVariable: true, + }, + Variable$2 { + defs: Array [ + VariableDefinition$2 { + name: Identifier<"foo">, + node: VariableDeclarator$2, + }, + ], + name: "foo", + references: Array [ + Reference$1 { + identifier: Identifier<"foo">, + init: true, + isRead: false, + isTypeReference: false, + isValueReference: true, + isWrite: true, + resolved: Variable$2, + writeExpr: ArrowFunctionExpression$3, + }, + ], + isValueVariable: true, + isTypeVariable: false, + }, + Variable$3 { + defs: Array [ + ParameterDefinition$3 { + name: Identifier<"arg">, + node: ArrowFunctionExpression$3, + }, + ], + name: "arg", + references: Array [ + Reference$2 { + identifier: Identifier<"arg">, + isRead: true, + isTypeReference: false, + isValueReference: true, + isWrite: false, + resolved: Variable$3, + }, + Reference$4 { + identifier: Identifier<"arg">, + isRead: true, + isTypeReference: false, + isValueReference: true, + isWrite: false, + resolved: Variable$3, + }, + ], + isValueVariable: true, + isTypeVariable: false, + }, + ], + scopes: Array [ + GlobalScope$1 { + block: Program$4, + isStrict: false, + references: Array [ + Reference$1, + ], + set: Map { + "T" => Variable$1, + "foo" => Variable$2, + }, + type: "global", + upper: null, + variables: Array [ + Variable$1, + Variable$2, + ], + }, + FunctionScope$2 { + block: ArrowFunctionExpression$3, + isStrict: false, + references: Array [ + Reference$2, + Reference$3, + Reference$4, + ], + set: Map { + "arg" => Variable$3, + }, + type: "function", + upper: GlobalScope$1, + variables: Array [ + Variable$3, + ], + }, + ], +} +`; diff --git a/packages/scope-manager/tests/fixtures/functions/function-declaration/type-predicate-asserts1.ts b/packages/scope-manager/tests/fixtures/functions/function-declaration/type-predicate-asserts1.ts new file mode 100644 index 000000000000..f571c9fb2cbc --- /dev/null +++ b/packages/scope-manager/tests/fixtures/functions/function-declaration/type-predicate-asserts1.ts @@ -0,0 +1 @@ +function foo(arg: any): asserts arg {} diff --git a/packages/scope-manager/tests/fixtures/functions/function-declaration/type-predicate-asserts1.ts.shot b/packages/scope-manager/tests/fixtures/functions/function-declaration/type-predicate-asserts1.ts.shot new file mode 100644 index 000000000000..79f248a2044f --- /dev/null +++ b/packages/scope-manager/tests/fixtures/functions/function-declaration/type-predicate-asserts1.ts.shot @@ -0,0 +1,80 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`functions function-declaration type-predicate-asserts1 1`] = ` +ScopeManager { + variables: Array [ + Variable$1 { + defs: Array [ + FunctionNameDefinition$1 { + name: Identifier<"foo">, + node: FunctionDeclaration$1, + }, + ], + name: "foo", + references: Array [], + isValueVariable: true, + isTypeVariable: false, + }, + Variable$2 { + defs: Array [], + name: "arguments", + references: Array [], + isValueVariable: true, + isTypeVariable: true, + }, + Variable$3 { + defs: Array [ + ParameterDefinition$2 { + name: Identifier<"arg">, + node: FunctionDeclaration$1, + }, + ], + name: "arg", + references: Array [ + Reference$1 { + identifier: Identifier<"arg">, + isRead: true, + isTypeReference: false, + isValueReference: true, + isWrite: false, + resolved: Variable$3, + }, + ], + isValueVariable: true, + isTypeVariable: false, + }, + ], + scopes: Array [ + GlobalScope$1 { + block: Program$2, + isStrict: false, + references: Array [], + set: Map { + "foo" => Variable$1, + }, + type: "global", + upper: null, + variables: Array [ + Variable$1, + ], + }, + FunctionScope$2 { + block: FunctionDeclaration$1, + isStrict: false, + references: Array [ + Reference$1, + ], + set: Map { + "arguments" => Variable$2, + "arg" => Variable$3, + }, + type: "function", + upper: GlobalScope$1, + variables: Array [ + Variable$2, + Variable$3, + ], + }, + ], +} +`; diff --git a/packages/scope-manager/tests/fixtures/functions/function-declaration/type-predicate-asserts2.ts b/packages/scope-manager/tests/fixtures/functions/function-declaration/type-predicate-asserts2.ts new file mode 100644 index 000000000000..64c8afd613f2 --- /dev/null +++ b/packages/scope-manager/tests/fixtures/functions/function-declaration/type-predicate-asserts2.ts @@ -0,0 +1,2 @@ +type T = string; +function foo(arg: any): asserts arg is T {} diff --git a/packages/scope-manager/tests/fixtures/functions/function-declaration/type-predicate-asserts2.ts.shot b/packages/scope-manager/tests/fixtures/functions/function-declaration/type-predicate-asserts2.ts.shot new file mode 100644 index 000000000000..4df9c6d09eb6 --- /dev/null +++ b/packages/scope-manager/tests/fixtures/functions/function-declaration/type-predicate-asserts2.ts.shot @@ -0,0 +1,104 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`functions function-declaration type-predicate-asserts2 1`] = ` +ScopeManager { + variables: Array [ + Variable$1 { + defs: Array [ + TypeDefinition$1 { + name: Identifier<"T">, + node: TSTypeAliasDeclaration$1, + }, + ], + name: "T", + references: Array [ + Reference$2 { + identifier: Identifier<"T">, + isRead: true, + isTypeReference: true, + isValueReference: false, + isWrite: false, + resolved: Variable$1, + }, + ], + isValueVariable: false, + isTypeVariable: true, + }, + Variable$2 { + defs: Array [ + FunctionNameDefinition$2 { + name: Identifier<"foo">, + node: FunctionDeclaration$2, + }, + ], + name: "foo", + references: Array [], + isValueVariable: true, + isTypeVariable: false, + }, + Variable$3 { + defs: Array [], + name: "arguments", + references: Array [], + isValueVariable: true, + isTypeVariable: true, + }, + Variable$4 { + defs: Array [ + ParameterDefinition$3 { + name: Identifier<"arg">, + node: FunctionDeclaration$2, + }, + ], + name: "arg", + references: Array [ + Reference$1 { + identifier: Identifier<"arg">, + isRead: true, + isTypeReference: false, + isValueReference: true, + isWrite: false, + resolved: Variable$4, + }, + ], + isValueVariable: true, + isTypeVariable: false, + }, + ], + scopes: Array [ + GlobalScope$1 { + block: Program$3, + isStrict: false, + references: Array [], + set: Map { + "T" => Variable$1, + "foo" => Variable$2, + }, + type: "global", + upper: null, + variables: Array [ + Variable$1, + Variable$2, + ], + }, + FunctionScope$2 { + block: FunctionDeclaration$2, + isStrict: false, + references: Array [ + Reference$1, + Reference$2, + ], + set: Map { + "arguments" => Variable$3, + "arg" => Variable$4, + }, + type: "function", + upper: GlobalScope$1, + variables: Array [ + Variable$3, + Variable$4, + ], + }, + ], +} +`; diff --git a/packages/scope-manager/tests/fixtures/functions/function-declaration/type-predicate1.ts b/packages/scope-manager/tests/fixtures/functions/function-declaration/type-predicate1.ts new file mode 100644 index 000000000000..ed938ce7bfa9 --- /dev/null +++ b/packages/scope-manager/tests/fixtures/functions/function-declaration/type-predicate1.ts @@ -0,0 +1,3 @@ +function foo(arg: any): arg is string { + return typeof arg === 'string'; +} diff --git a/packages/scope-manager/tests/fixtures/functions/function-declaration/type-predicate1.ts.shot b/packages/scope-manager/tests/fixtures/functions/function-declaration/type-predicate1.ts.shot new file mode 100644 index 000000000000..315b74fe467b --- /dev/null +++ b/packages/scope-manager/tests/fixtures/functions/function-declaration/type-predicate1.ts.shot @@ -0,0 +1,89 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`functions function-declaration type-predicate1 1`] = ` +ScopeManager { + variables: Array [ + Variable$1 { + defs: Array [ + FunctionNameDefinition$1 { + name: Identifier<"foo">, + node: FunctionDeclaration$1, + }, + ], + name: "foo", + references: Array [], + isValueVariable: true, + isTypeVariable: false, + }, + Variable$2 { + defs: Array [], + name: "arguments", + references: Array [], + isValueVariable: true, + isTypeVariable: true, + }, + Variable$3 { + defs: Array [ + ParameterDefinition$2 { + name: Identifier<"arg">, + node: FunctionDeclaration$1, + }, + ], + name: "arg", + references: Array [ + Reference$1 { + identifier: Identifier<"arg">, + isRead: true, + isTypeReference: false, + isValueReference: true, + isWrite: false, + resolved: Variable$3, + }, + Reference$2 { + identifier: Identifier<"arg">, + isRead: true, + isTypeReference: false, + isValueReference: true, + isWrite: false, + resolved: Variable$3, + }, + ], + isValueVariable: true, + isTypeVariable: false, + }, + ], + scopes: Array [ + GlobalScope$1 { + block: Program$2, + isStrict: false, + references: Array [], + set: Map { + "foo" => Variable$1, + }, + type: "global", + upper: null, + variables: Array [ + Variable$1, + ], + }, + FunctionScope$2 { + block: FunctionDeclaration$1, + isStrict: false, + references: Array [ + Reference$1, + Reference$2, + ], + set: Map { + "arguments" => Variable$2, + "arg" => Variable$3, + }, + type: "function", + upper: GlobalScope$1, + variables: Array [ + Variable$2, + Variable$3, + ], + }, + ], +} +`; diff --git a/packages/scope-manager/tests/fixtures/functions/function-declaration/type-predicate2.ts b/packages/scope-manager/tests/fixtures/functions/function-declaration/type-predicate2.ts new file mode 100644 index 000000000000..ecf9003b234c --- /dev/null +++ b/packages/scope-manager/tests/fixtures/functions/function-declaration/type-predicate2.ts @@ -0,0 +1,4 @@ +type T = string; +function foo(arg: any): arg is T { + return typeof arg === 'string'; +} diff --git a/packages/scope-manager/tests/fixtures/functions/function-declaration/type-predicate2.ts.shot b/packages/scope-manager/tests/fixtures/functions/function-declaration/type-predicate2.ts.shot new file mode 100644 index 000000000000..95f298e5eeab --- /dev/null +++ b/packages/scope-manager/tests/fixtures/functions/function-declaration/type-predicate2.ts.shot @@ -0,0 +1,113 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`functions function-declaration type-predicate2 1`] = ` +ScopeManager { + variables: Array [ + Variable$1 { + defs: Array [ + TypeDefinition$1 { + name: Identifier<"T">, + node: TSTypeAliasDeclaration$1, + }, + ], + name: "T", + references: Array [ + Reference$2 { + identifier: Identifier<"T">, + isRead: true, + isTypeReference: true, + isValueReference: false, + isWrite: false, + resolved: Variable$1, + }, + ], + isValueVariable: false, + isTypeVariable: true, + }, + Variable$2 { + defs: Array [ + FunctionNameDefinition$2 { + name: Identifier<"foo">, + node: FunctionDeclaration$2, + }, + ], + name: "foo", + references: Array [], + isValueVariable: true, + isTypeVariable: false, + }, + Variable$3 { + defs: Array [], + name: "arguments", + references: Array [], + isValueVariable: true, + isTypeVariable: true, + }, + Variable$4 { + defs: Array [ + ParameterDefinition$3 { + name: Identifier<"arg">, + node: FunctionDeclaration$2, + }, + ], + name: "arg", + references: Array [ + Reference$1 { + identifier: Identifier<"arg">, + isRead: true, + isTypeReference: false, + isValueReference: true, + isWrite: false, + resolved: Variable$4, + }, + Reference$3 { + identifier: Identifier<"arg">, + isRead: true, + isTypeReference: false, + isValueReference: true, + isWrite: false, + resolved: Variable$4, + }, + ], + isValueVariable: true, + isTypeVariable: false, + }, + ], + scopes: Array [ + GlobalScope$1 { + block: Program$3, + isStrict: false, + references: Array [], + set: Map { + "T" => Variable$1, + "foo" => Variable$2, + }, + type: "global", + upper: null, + variables: Array [ + Variable$1, + Variable$2, + ], + }, + FunctionScope$2 { + block: FunctionDeclaration$2, + isStrict: false, + references: Array [ + Reference$1, + Reference$2, + Reference$3, + ], + set: Map { + "arguments" => Variable$3, + "arg" => Variable$4, + }, + type: "function", + upper: GlobalScope$1, + variables: Array [ + Variable$3, + Variable$4, + ], + }, + ], +} +`; diff --git a/packages/scope-manager/tests/fixtures/functions/function-expression/type-predicate-asserts1.ts b/packages/scope-manager/tests/fixtures/functions/function-expression/type-predicate-asserts1.ts new file mode 100644 index 000000000000..3bf323ef9e05 --- /dev/null +++ b/packages/scope-manager/tests/fixtures/functions/function-expression/type-predicate-asserts1.ts @@ -0,0 +1 @@ +const foo = function (arg: any): asserts arg {}; diff --git a/packages/scope-manager/tests/fixtures/functions/function-expression/type-predicate-asserts1.ts.shot b/packages/scope-manager/tests/fixtures/functions/function-expression/type-predicate-asserts1.ts.shot new file mode 100644 index 000000000000..53dbd1612eea --- /dev/null +++ b/packages/scope-manager/tests/fixtures/functions/function-expression/type-predicate-asserts1.ts.shot @@ -0,0 +1,93 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`functions function-expression type-predicate-asserts1 1`] = ` +ScopeManager { + variables: Array [ + Variable$1 { + defs: Array [ + VariableDefinition$1 { + name: Identifier<"foo">, + node: VariableDeclarator$1, + }, + ], + name: "foo", + references: Array [ + Reference$1 { + identifier: Identifier<"foo">, + init: true, + isRead: false, + isTypeReference: false, + isValueReference: true, + isWrite: true, + resolved: Variable$1, + writeExpr: FunctionExpression$2, + }, + ], + isValueVariable: true, + isTypeVariable: false, + }, + Variable$2 { + defs: Array [], + name: "arguments", + references: Array [], + isValueVariable: true, + isTypeVariable: true, + }, + Variable$3 { + defs: Array [ + ParameterDefinition$2 { + name: Identifier<"arg">, + node: FunctionExpression$2, + }, + ], + name: "arg", + references: Array [ + Reference$2 { + identifier: Identifier<"arg">, + isRead: true, + isTypeReference: false, + isValueReference: true, + isWrite: false, + resolved: Variable$3, + }, + ], + isValueVariable: true, + isTypeVariable: false, + }, + ], + scopes: Array [ + GlobalScope$1 { + block: Program$3, + isStrict: false, + references: Array [ + Reference$1, + ], + set: Map { + "foo" => Variable$1, + }, + type: "global", + upper: null, + variables: Array [ + Variable$1, + ], + }, + FunctionScope$2 { + block: FunctionExpression$2, + isStrict: false, + references: Array [ + Reference$2, + ], + set: Map { + "arguments" => Variable$2, + "arg" => Variable$3, + }, + type: "function", + upper: GlobalScope$1, + variables: Array [ + Variable$2, + Variable$3, + ], + }, + ], +} +`; diff --git a/packages/scope-manager/tests/fixtures/functions/function-expression/type-predicate-asserts2.ts b/packages/scope-manager/tests/fixtures/functions/function-expression/type-predicate-asserts2.ts new file mode 100644 index 000000000000..9e9be635d085 --- /dev/null +++ b/packages/scope-manager/tests/fixtures/functions/function-expression/type-predicate-asserts2.ts @@ -0,0 +1,2 @@ +type T = string; +const foo = function (arg: any): asserts arg is T {}; diff --git a/packages/scope-manager/tests/fixtures/functions/function-expression/type-predicate-asserts2.ts.shot b/packages/scope-manager/tests/fixtures/functions/function-expression/type-predicate-asserts2.ts.shot new file mode 100644 index 000000000000..12b912cf820c --- /dev/null +++ b/packages/scope-manager/tests/fixtures/functions/function-expression/type-predicate-asserts2.ts.shot @@ -0,0 +1,117 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`functions function-expression type-predicate-asserts2 1`] = ` +ScopeManager { + variables: Array [ + Variable$1 { + defs: Array [ + TypeDefinition$1 { + name: Identifier<"T">, + node: TSTypeAliasDeclaration$1, + }, + ], + name: "T", + references: Array [ + Reference$3 { + identifier: Identifier<"T">, + isRead: true, + isTypeReference: true, + isValueReference: false, + isWrite: false, + resolved: Variable$1, + }, + ], + isValueVariable: false, + isTypeVariable: true, + }, + Variable$2 { + defs: Array [ + VariableDefinition$2 { + name: Identifier<"foo">, + node: VariableDeclarator$2, + }, + ], + name: "foo", + references: Array [ + Reference$1 { + identifier: Identifier<"foo">, + init: true, + isRead: false, + isTypeReference: false, + isValueReference: true, + isWrite: true, + resolved: Variable$2, + writeExpr: FunctionExpression$3, + }, + ], + isValueVariable: true, + isTypeVariable: false, + }, + Variable$3 { + defs: Array [], + name: "arguments", + references: Array [], + isValueVariable: true, + isTypeVariable: true, + }, + Variable$4 { + defs: Array [ + ParameterDefinition$3 { + name: Identifier<"arg">, + node: FunctionExpression$3, + }, + ], + name: "arg", + references: Array [ + Reference$2 { + identifier: Identifier<"arg">, + isRead: true, + isTypeReference: false, + isValueReference: true, + isWrite: false, + resolved: Variable$4, + }, + ], + isValueVariable: true, + isTypeVariable: false, + }, + ], + scopes: Array [ + GlobalScope$1 { + block: Program$4, + isStrict: false, + references: Array [ + Reference$1, + ], + set: Map { + "T" => Variable$1, + "foo" => Variable$2, + }, + type: "global", + upper: null, + variables: Array [ + Variable$1, + Variable$2, + ], + }, + FunctionScope$2 { + block: FunctionExpression$3, + isStrict: false, + references: Array [ + Reference$2, + Reference$3, + ], + set: Map { + "arguments" => Variable$3, + "arg" => Variable$4, + }, + type: "function", + upper: GlobalScope$1, + variables: Array [ + Variable$3, + Variable$4, + ], + }, + ], +} +`; diff --git a/packages/scope-manager/tests/fixtures/functions/function-expression/type-predicate1.ts b/packages/scope-manager/tests/fixtures/functions/function-expression/type-predicate1.ts new file mode 100644 index 000000000000..a9a8b9257844 --- /dev/null +++ b/packages/scope-manager/tests/fixtures/functions/function-expression/type-predicate1.ts @@ -0,0 +1,3 @@ +const foo = function (arg: any): arg is string { + return typeof arg === 'string'; +}; diff --git a/packages/scope-manager/tests/fixtures/functions/function-expression/type-predicate1.ts.shot b/packages/scope-manager/tests/fixtures/functions/function-expression/type-predicate1.ts.shot new file mode 100644 index 000000000000..9aea3d721d81 --- /dev/null +++ b/packages/scope-manager/tests/fixtures/functions/function-expression/type-predicate1.ts.shot @@ -0,0 +1,102 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`functions function-expression type-predicate1 1`] = ` +ScopeManager { + variables: Array [ + Variable$1 { + defs: Array [ + VariableDefinition$1 { + name: Identifier<"foo">, + node: VariableDeclarator$1, + }, + ], + name: "foo", + references: Array [ + Reference$1 { + identifier: Identifier<"foo">, + init: true, + isRead: false, + isTypeReference: false, + isValueReference: true, + isWrite: true, + resolved: Variable$1, + writeExpr: FunctionExpression$2, + }, + ], + isValueVariable: true, + isTypeVariable: false, + }, + Variable$2 { + defs: Array [], + name: "arguments", + references: Array [], + isValueVariable: true, + isTypeVariable: true, + }, + Variable$3 { + defs: Array [ + ParameterDefinition$2 { + name: Identifier<"arg">, + node: FunctionExpression$2, + }, + ], + name: "arg", + references: Array [ + Reference$2 { + identifier: Identifier<"arg">, + isRead: true, + isTypeReference: false, + isValueReference: true, + isWrite: false, + resolved: Variable$3, + }, + Reference$3 { + identifier: Identifier<"arg">, + isRead: true, + isTypeReference: false, + isValueReference: true, + isWrite: false, + resolved: Variable$3, + }, + ], + isValueVariable: true, + isTypeVariable: false, + }, + ], + scopes: Array [ + GlobalScope$1 { + block: Program$3, + isStrict: false, + references: Array [ + Reference$1, + ], + set: Map { + "foo" => Variable$1, + }, + type: "global", + upper: null, + variables: Array [ + Variable$1, + ], + }, + FunctionScope$2 { + block: FunctionExpression$2, + isStrict: false, + references: Array [ + Reference$2, + Reference$3, + ], + set: Map { + "arguments" => Variable$2, + "arg" => Variable$3, + }, + type: "function", + upper: GlobalScope$1, + variables: Array [ + Variable$2, + Variable$3, + ], + }, + ], +} +`; diff --git a/packages/scope-manager/tests/fixtures/functions/function-expression/type-predicate2.ts b/packages/scope-manager/tests/fixtures/functions/function-expression/type-predicate2.ts new file mode 100644 index 000000000000..3e83e548b3b3 --- /dev/null +++ b/packages/scope-manager/tests/fixtures/functions/function-expression/type-predicate2.ts @@ -0,0 +1,4 @@ +type T = string; +const foo = function (arg: any): arg is T { + return typeof arg === 'string'; +}; diff --git a/packages/scope-manager/tests/fixtures/functions/function-expression/type-predicate2.ts.shot b/packages/scope-manager/tests/fixtures/functions/function-expression/type-predicate2.ts.shot new file mode 100644 index 000000000000..fc5dd9a6e0ef --- /dev/null +++ b/packages/scope-manager/tests/fixtures/functions/function-expression/type-predicate2.ts.shot @@ -0,0 +1,126 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`functions function-expression type-predicate2 1`] = ` +ScopeManager { + variables: Array [ + Variable$1 { + defs: Array [ + TypeDefinition$1 { + name: Identifier<"T">, + node: TSTypeAliasDeclaration$1, + }, + ], + name: "T", + references: Array [ + Reference$3 { + identifier: Identifier<"T">, + isRead: true, + isTypeReference: true, + isValueReference: false, + isWrite: false, + resolved: Variable$1, + }, + ], + isValueVariable: false, + isTypeVariable: true, + }, + Variable$2 { + defs: Array [ + VariableDefinition$2 { + name: Identifier<"foo">, + node: VariableDeclarator$2, + }, + ], + name: "foo", + references: Array [ + Reference$1 { + identifier: Identifier<"foo">, + init: true, + isRead: false, + isTypeReference: false, + isValueReference: true, + isWrite: true, + resolved: Variable$2, + writeExpr: FunctionExpression$3, + }, + ], + isValueVariable: true, + isTypeVariable: false, + }, + Variable$3 { + defs: Array [], + name: "arguments", + references: Array [], + isValueVariable: true, + isTypeVariable: true, + }, + Variable$4 { + defs: Array [ + ParameterDefinition$3 { + name: Identifier<"arg">, + node: FunctionExpression$3, + }, + ], + name: "arg", + references: Array [ + Reference$2 { + identifier: Identifier<"arg">, + isRead: true, + isTypeReference: false, + isValueReference: true, + isWrite: false, + resolved: Variable$4, + }, + Reference$4 { + identifier: Identifier<"arg">, + isRead: true, + isTypeReference: false, + isValueReference: true, + isWrite: false, + resolved: Variable$4, + }, + ], + isValueVariable: true, + isTypeVariable: false, + }, + ], + scopes: Array [ + GlobalScope$1 { + block: Program$4, + isStrict: false, + references: Array [ + Reference$1, + ], + set: Map { + "T" => Variable$1, + "foo" => Variable$2, + }, + type: "global", + upper: null, + variables: Array [ + Variable$1, + Variable$2, + ], + }, + FunctionScope$2 { + block: FunctionExpression$3, + isStrict: false, + references: Array [ + Reference$2, + Reference$3, + Reference$4, + ], + set: Map { + "arguments" => Variable$3, + "arg" => Variable$4, + }, + type: "function", + upper: GlobalScope$1, + variables: Array [ + Variable$3, + Variable$4, + ], + }, + ], +} +`; From 916e95a505689746dda38a67148c95cc7d207d9f Mon Sep 17 00:00:00 2001 From: Brad Zacher Date: Sat, 5 Sep 2020 17:23:18 -0700 Subject: [PATCH 10/22] fix(scope-manager): treat type imports as both values and types (#2494) Fixes #2453 --- .../tests/rules/no-unused-vars.test.ts | 5 ++ .../src/definition/ImportBindingDefinition.ts | 7 +- .../fixtures/import/type-default-value.ts | 5 ++ .../import/type-default-value.ts.shot | 69 +++++++++++++++++++ .../fixtures/import/type-default.ts.shot | 19 ++--- .../tests/fixtures/import/type-named-value.ts | 5 ++ .../fixtures/import/type-named-value.ts.shot | 69 +++++++++++++++++++ .../tests/fixtures/import/type-named.ts.shot | 19 ++--- .../tests/types/reference-type.test.ts | 13 ---- 9 files changed, 174 insertions(+), 37 deletions(-) create mode 100644 packages/scope-manager/tests/fixtures/import/type-default-value.ts create mode 100644 packages/scope-manager/tests/fixtures/import/type-default-value.ts.shot create mode 100644 packages/scope-manager/tests/fixtures/import/type-named-value.ts create mode 100644 packages/scope-manager/tests/fixtures/import/type-named-value.ts.shot diff --git a/packages/eslint-plugin/tests/rules/no-unused-vars.test.ts b/packages/eslint-plugin/tests/rules/no-unused-vars.test.ts index aa795ed5d767..af6ff089d4ba 100644 --- a/packages/eslint-plugin/tests/rules/no-unused-vars.test.ts +++ b/packages/eslint-plugin/tests/rules/no-unused-vars.test.ts @@ -783,6 +783,11 @@ type StyledPaymentProps = { export const StyledPayment = styled.div\`\`; `, + // https://github.com/typescript-eslint/typescript-eslint/issues/2453 + ` +import type { foo } from './a'; +export type Bar = typeof foo; + `, ], invalid: [ diff --git a/packages/scope-manager/src/definition/ImportBindingDefinition.ts b/packages/scope-manager/src/definition/ImportBindingDefinition.ts index e3e1d8401401..874edadf5e94 100644 --- a/packages/scope-manager/src/definition/ImportBindingDefinition.ts +++ b/packages/scope-manager/src/definition/ImportBindingDefinition.ts @@ -30,15 +30,10 @@ class ImportBindingDefinition extends DefinitionBase< decl: TSESTree.ImportDeclaration | TSESTree.TSImportEqualsDeclaration, ) { super(DefinitionType.ImportBinding, name, node, decl); - if ('importKind' in this.parent && this.parent.importKind === 'type') { - this.isVariableDefinition = false; - } else { - this.isVariableDefinition = true; - } } public readonly isTypeDefinition = true; - public readonly isVariableDefinition: boolean; + public readonly isVariableDefinition = true; } export { ImportBindingDefinition }; diff --git a/packages/scope-manager/tests/fixtures/import/type-default-value.ts b/packages/scope-manager/tests/fixtures/import/type-default-value.ts new file mode 100644 index 000000000000..0fcbdf3d72de --- /dev/null +++ b/packages/scope-manager/tests/fixtures/import/type-default-value.ts @@ -0,0 +1,5 @@ +//// @sourceType = module + +import type foo from 'foo'; + +type T = typeof foo; diff --git a/packages/scope-manager/tests/fixtures/import/type-default-value.ts.shot b/packages/scope-manager/tests/fixtures/import/type-default-value.ts.shot new file mode 100644 index 000000000000..d79d510a485d --- /dev/null +++ b/packages/scope-manager/tests/fixtures/import/type-default-value.ts.shot @@ -0,0 +1,69 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`import type-default-value 1`] = ` +ScopeManager { + variables: Array [ + Variable$1 { + defs: Array [ + ImportBindingDefinition$1 { + name: Identifier<"foo">, + node: ImportDefaultSpecifier$1, + }, + ], + name: "foo", + references: Array [ + Reference$1 { + identifier: Identifier<"foo">, + isRead: true, + isTypeReference: false, + isValueReference: true, + isWrite: false, + resolved: Variable$1, + }, + ], + isValueVariable: true, + isTypeVariable: true, + }, + Variable$2 { + defs: Array [ + TypeDefinition$2 { + name: Identifier<"T">, + node: TSTypeAliasDeclaration$2, + }, + ], + name: "T", + references: Array [], + isValueVariable: false, + isTypeVariable: true, + }, + ], + scopes: Array [ + GlobalScope$1 { + block: Program$3, + isStrict: false, + references: Array [], + set: Map {}, + type: "global", + upper: null, + variables: Array [], + }, + ModuleScope$2 { + block: Program$3, + isStrict: true, + references: Array [ + Reference$1, + ], + set: Map { + "foo" => Variable$1, + "T" => Variable$2, + }, + type: "module", + upper: GlobalScope$1, + variables: Array [ + Variable$1, + Variable$2, + ], + }, + ], +} +`; diff --git a/packages/scope-manager/tests/fixtures/import/type-default.ts.shot b/packages/scope-manager/tests/fixtures/import/type-default.ts.shot index 4f84aa209020..85b9df61e067 100644 --- a/packages/scope-manager/tests/fixtures/import/type-default.ts.shot +++ b/packages/scope-manager/tests/fixtures/import/type-default.ts.shot @@ -20,8 +20,16 @@ ScopeManager { isWrite: false, resolved: Variable$1, }, + Reference$3 { + identifier: Identifier<"T">, + isRead: true, + isTypeReference: false, + isValueReference: true, + isWrite: false, + resolved: Variable$1, + }, ], - isValueVariable: false, + isValueVariable: true, isTypeVariable: true, }, Variable$2 { @@ -76,14 +84,7 @@ ScopeManager { references: Array [ Reference$1, Reference$2, - Reference$3 { - identifier: Identifier<"T">, - isRead: true, - isTypeReference: false, - isValueReference: true, - isWrite: false, - resolved: null, - }, + Reference$3, ], set: Map { "T" => Variable$1, diff --git a/packages/scope-manager/tests/fixtures/import/type-named-value.ts b/packages/scope-manager/tests/fixtures/import/type-named-value.ts new file mode 100644 index 000000000000..112f86af9e6e --- /dev/null +++ b/packages/scope-manager/tests/fixtures/import/type-named-value.ts @@ -0,0 +1,5 @@ +//// @sourceType = module + +import type { foo } from 'foo'; + +type T = typeof foo; diff --git a/packages/scope-manager/tests/fixtures/import/type-named-value.ts.shot b/packages/scope-manager/tests/fixtures/import/type-named-value.ts.shot new file mode 100644 index 000000000000..36fa441cea15 --- /dev/null +++ b/packages/scope-manager/tests/fixtures/import/type-named-value.ts.shot @@ -0,0 +1,69 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`import type-named-value 1`] = ` +ScopeManager { + variables: Array [ + Variable$1 { + defs: Array [ + ImportBindingDefinition$1 { + name: Identifier<"foo">, + node: ImportSpecifier$1, + }, + ], + name: "foo", + references: Array [ + Reference$1 { + identifier: Identifier<"foo">, + isRead: true, + isTypeReference: false, + isValueReference: true, + isWrite: false, + resolved: Variable$1, + }, + ], + isValueVariable: true, + isTypeVariable: true, + }, + Variable$2 { + defs: Array [ + TypeDefinition$2 { + name: Identifier<"T">, + node: TSTypeAliasDeclaration$2, + }, + ], + name: "T", + references: Array [], + isValueVariable: false, + isTypeVariable: true, + }, + ], + scopes: Array [ + GlobalScope$1 { + block: Program$3, + isStrict: false, + references: Array [], + set: Map {}, + type: "global", + upper: null, + variables: Array [], + }, + ModuleScope$2 { + block: Program$3, + isStrict: true, + references: Array [ + Reference$1, + ], + set: Map { + "foo" => Variable$1, + "T" => Variable$2, + }, + type: "module", + upper: GlobalScope$1, + variables: Array [ + Variable$1, + Variable$2, + ], + }, + ], +} +`; diff --git a/packages/scope-manager/tests/fixtures/import/type-named.ts.shot b/packages/scope-manager/tests/fixtures/import/type-named.ts.shot index 359026e7d454..6e7a2481f795 100644 --- a/packages/scope-manager/tests/fixtures/import/type-named.ts.shot +++ b/packages/scope-manager/tests/fixtures/import/type-named.ts.shot @@ -20,8 +20,16 @@ ScopeManager { isWrite: false, resolved: Variable$1, }, + Reference$3 { + identifier: Identifier<"T">, + isRead: true, + isTypeReference: false, + isValueReference: true, + isWrite: false, + resolved: Variable$1, + }, ], - isValueVariable: false, + isValueVariable: true, isTypeVariable: true, }, Variable$2 { @@ -76,14 +84,7 @@ ScopeManager { references: Array [ Reference$1, Reference$2, - Reference$3 { - identifier: Identifier<"T">, - isRead: true, - isTypeReference: false, - isValueReference: true, - isWrite: false, - resolved: null, - }, + Reference$3, ], set: Map { "T" => Variable$1, diff --git a/packages/scope-manager/tests/types/reference-type.test.ts b/packages/scope-manager/tests/types/reference-type.test.ts index 585f29a15a53..2b4a305ff06d 100644 --- a/packages/scope-manager/tests/types/reference-type.test.ts +++ b/packages/scope-manager/tests/types/reference-type.test.ts @@ -180,17 +180,4 @@ describe('referencing a type - negative', () => { const variable = scopeManager.getDeclaredVariables(node)[0]; expect(variable.references).toHaveLength(0); }); - - it('does not record a reference when a type import is referenced from a value', () => { - const { ast, scopeManager } = parseAndAnalyze( - ` - import type { foo } from 'module'; - const test = foo; - `, - 'module', - ); - const node = getSpecificNode(ast, AST_NODE_TYPES.ImportSpecifier); - const variable = scopeManager.getDeclaredVariables(node)[0]; - expect(variable.references).toHaveLength(0); - }); }); From 4d3ce5f696985389bf53a31d62766041c703c70c Mon Sep 17 00:00:00 2001 From: Brad Zacher Date: Sat, 5 Sep 2020 17:46:11 -0700 Subject: [PATCH 11/22] fix(eslint-plugin): [no-unused-vars] properly handle ambient declaration exports (#2496) --- .cspell.json | 1 + .../eslint-plugin/src/rules/no-unused-vars.ts | 93 +++++++++++++++++-- .../tests/rules/no-unused-vars.test.ts | 35 +++---- 3 files changed, 103 insertions(+), 26 deletions(-) diff --git a/.cspell.json b/.cspell.json index 45e79f884857..cbd5138affa4 100644 --- a/.cspell.json +++ b/.cspell.json @@ -38,6 +38,7 @@ "words": [ "Airbnb", "Airbnb's", + "ambiently", "ASTs", "autofix", "autofixers", diff --git a/packages/eslint-plugin/src/rules/no-unused-vars.ts b/packages/eslint-plugin/src/rules/no-unused-vars.ts index 973df534b0ed..d3dc72049ce6 100644 --- a/packages/eslint-plugin/src/rules/no-unused-vars.ts +++ b/packages/eslint-plugin/src/rules/no-unused-vars.ts @@ -28,6 +28,7 @@ export default util.createRule({ defaultOptions: [{}], create(context) { const rules = baseRule.create(context); + const filename = context.getFilename(); /** * Gets a list of TS module definitions for a specified variable. @@ -207,19 +208,93 @@ export default util.createRule({ } }, - // TODO - this could probably be refined a bit - '*[declare=true] Identifier'(node: TSESTree.Identifier): void { - context.markVariableAsUsed(node.name); - const scope = context.getScope(); - const { variableScope } = scope; - if (variableScope !== scope) { - const superVar = variableScope.set.get(node.name); + // declaration file handling + [declarationSelector(AST_NODE_TYPES.Program, true)]( + node: DeclarationSelectorNode, + ): void { + if (!util.isDefinitionFile(filename)) { + return; + } + markDeclarationChildAsUsed(node); + }, + + // declared namespace handling + [declarationSelector( + 'TSModuleDeclaration[declare = true] > TSModuleBlock', + false, + )](node: DeclarationSelectorNode): void { + markDeclarationChildAsUsed(node); + }, + }; + + type DeclarationSelectorNode = + | TSESTree.TSInterfaceDeclaration + | TSESTree.TSTypeAliasDeclaration + | TSESTree.ClassDeclaration + | TSESTree.FunctionDeclaration + | TSESTree.TSDeclareFunction + | TSESTree.TSEnumDeclaration + | TSESTree.TSModuleDeclaration + | TSESTree.VariableDeclaration; + function declarationSelector( + parent: string, + childDeclare: boolean, + ): string { + return [ + // Types are ambiently exported + `${parent} > :matches(${[ + AST_NODE_TYPES.TSInterfaceDeclaration, + AST_NODE_TYPES.TSTypeAliasDeclaration, + ].join(', ')})`, + // Value things are ambiently exported if they are "declare"d + `${parent} > :matches(${[ + AST_NODE_TYPES.ClassDeclaration, + AST_NODE_TYPES.TSDeclareFunction, + AST_NODE_TYPES.TSEnumDeclaration, + AST_NODE_TYPES.TSModuleDeclaration, + AST_NODE_TYPES.VariableDeclaration, + ].join(', ')})${childDeclare ? '[declare=true]' : ''}`, + ].join(', '); + } + function markDeclarationChildAsUsed(node: DeclarationSelectorNode): void { + const identifiers: TSESTree.Identifier[] = []; + switch (node.type) { + case AST_NODE_TYPES.TSInterfaceDeclaration: + case AST_NODE_TYPES.TSTypeAliasDeclaration: + case AST_NODE_TYPES.ClassDeclaration: + case AST_NODE_TYPES.FunctionDeclaration: + case AST_NODE_TYPES.TSDeclareFunction: + case AST_NODE_TYPES.TSEnumDeclaration: + case AST_NODE_TYPES.TSModuleDeclaration: + if (node.id?.type === AST_NODE_TYPES.Identifier) { + identifiers.push(node.id); + } + break; + + case AST_NODE_TYPES.VariableDeclaration: + for (const declaration of node.declarations) { + visitPattern(declaration, pattern => { + identifiers.push(pattern); + }); + } + break; + } + + const scope = context.getScope(); + const { variableScope } = scope; + if (variableScope !== scope) { + for (const id of identifiers) { + const superVar = variableScope.set.get(id.name); if (superVar) { superVar.eslintUsed = true; } } - }, - }; + } else { + for (const id of identifiers) { + context.markVariableAsUsed(id.name); + } + } + } function visitPattern( node: TSESTree.Node, diff --git a/packages/eslint-plugin/tests/rules/no-unused-vars.test.ts b/packages/eslint-plugin/tests/rules/no-unused-vars.test.ts index af6ff089d4ba..5dd485d12e3b 100644 --- a/packages/eslint-plugin/tests/rules/no-unused-vars.test.ts +++ b/packages/eslint-plugin/tests/rules/no-unused-vars.test.ts @@ -550,20 +550,6 @@ declare namespace Foo { var baz: string; } console.log(Foo); - `, - // https://github.com/typescript-eslint/typescript-eslint/issues/61 - ` -declare var Foo: { - new (value?: any): Object; - foo(): string; -}; - `, - // https://github.com/typescript-eslint/typescript-eslint/issues/106 - ` -declare class Foo { - constructor(value?: any): Object; - foo(): string; -} `, ` import foo from 'foo'; @@ -631,9 +617,6 @@ export default class Foo { } `, ` -declare function foo(a: number): void; - `, - ` export function foo(): void; export function foo(): void; export function foo(): void {} @@ -788,6 +771,24 @@ export const StyledPayment = styled.div\`\`; import type { foo } from './a'; export type Bar = typeof foo; `, + // https://github.com/typescript-eslint/typescript-eslint/issues/2456 + { + code: ` +interface Foo {} +type Bar = {}; +declare class Clazz {} +declare function func(); +declare enum Enum {} +declare namespace Name {} +declare const v1 = 1; +declare var v2 = 1; +declare let v3 = 1; +declare const { v4 }; +declare const { v4: v5 }; +declare const [v6]; + `, + filename: 'foo.d.ts', + }, ], invalid: [ From 95f6bf4818cdec48a0583bf82f928c598af22736 Mon Sep 17 00:00:00 2001 From: Brad Zacher Date: Sat, 5 Sep 2020 18:21:28 -0700 Subject: [PATCH 12/22] fix(scope-manager): correctly handle inferred types in nested type scopes (#2497) --- .../tests/rules/no-unused-vars.test.ts | 14 ++ .../src/referencer/TypeVisitor.ts | 39 +++++ .../fixtures/type-declaration/conditional3.ts | 1 + .../type-declaration/conditional3.ts.shot | 131 +++++++++++++++ .../fixtures/type-declaration/conditional4.ts | 1 + .../type-declaration/conditional4.ts.shot | 106 ++++++++++++ .../fixtures/type-declaration/conditional5.ts | 3 + .../type-declaration/conditional5.ts.shot | 156 ++++++++++++++++++ 8 files changed, 451 insertions(+) create mode 100644 packages/scope-manager/tests/fixtures/type-declaration/conditional3.ts create mode 100644 packages/scope-manager/tests/fixtures/type-declaration/conditional3.ts.shot create mode 100644 packages/scope-manager/tests/fixtures/type-declaration/conditional4.ts create mode 100644 packages/scope-manager/tests/fixtures/type-declaration/conditional4.ts.shot create mode 100644 packages/scope-manager/tests/fixtures/type-declaration/conditional5.ts create mode 100644 packages/scope-manager/tests/fixtures/type-declaration/conditional5.ts.shot diff --git a/packages/eslint-plugin/tests/rules/no-unused-vars.test.ts b/packages/eslint-plugin/tests/rules/no-unused-vars.test.ts index 5dd485d12e3b..bac969579d9f 100644 --- a/packages/eslint-plugin/tests/rules/no-unused-vars.test.ts +++ b/packages/eslint-plugin/tests/rules/no-unused-vars.test.ts @@ -789,6 +789,20 @@ declare const [v6]; `, filename: 'foo.d.ts', }, + // https://github.com/typescript-eslint/typescript-eslint/issues/2459 + ` +export type Test = U extends (k: infer I) => void ? I : never; + `, + ` +export type Test = U extends { [k: string]: infer I } ? I : never; + `, + ` +export type Test = U extends (arg: { + [k: string]: (arg2: infer I) => void; +}) => void + ? I + : never; + `, ], invalid: [ diff --git a/packages/scope-manager/src/referencer/TypeVisitor.ts b/packages/scope-manager/src/referencer/TypeVisitor.ts index d921529ac82f..5e43f83bb326 100644 --- a/packages/scope-manager/src/referencer/TypeVisitor.ts +++ b/packages/scope-manager/src/referencer/TypeVisitor.ts @@ -2,6 +2,7 @@ import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/types'; import { Referencer } from './Referencer'; import { Visitor } from './Visitor'; import { ParameterDefinition, TypeDefinition } from '../definition'; +import { ScopeType } from '../scope'; class TypeVisitor extends Visitor { readonly #referencer: Referencer; @@ -121,6 +122,44 @@ class TypeVisitor extends Visitor { this.visit(node.typeAnnotation); } + protected TSInferType(node: TSESTree.TSInferType): void { + const typeParameter = node.typeParameter; + let scope = this.#referencer.currentScope(); + + /* + In cases where there is a sub-type scope created within a conditional type, then the generic should be defined in the + conditional type's scope, not the child type scope. + If we define it within the child type's scope then it won't be able to be referenced outside the child type + */ + if ( + scope.type === ScopeType.functionType || + scope.type === ScopeType.mappedType + ) { + // search up the scope tree to figure out if we're in a nested type scope + let currentScope = scope.upper; + while (currentScope) { + if ( + currentScope.type === ScopeType.functionType || + currentScope.type === ScopeType.mappedType + ) { + // ensure valid type parents only + currentScope = currentScope.upper; + continue; + } + if (currentScope.type === ScopeType.conditionalType) { + scope = currentScope; + break; + } + break; + } + } + + scope.defineIdentifier( + typeParameter.name, + new TypeDefinition(typeParameter.name, typeParameter), + ); + } + protected TSInterfaceDeclaration( node: TSESTree.TSInterfaceDeclaration, ): void { diff --git a/packages/scope-manager/tests/fixtures/type-declaration/conditional3.ts b/packages/scope-manager/tests/fixtures/type-declaration/conditional3.ts new file mode 100644 index 000000000000..a06e6959b436 --- /dev/null +++ b/packages/scope-manager/tests/fixtures/type-declaration/conditional3.ts @@ -0,0 +1 @@ +type Test = U extends (k: infer I) => void ? I : never; diff --git a/packages/scope-manager/tests/fixtures/type-declaration/conditional3.ts.shot b/packages/scope-manager/tests/fixtures/type-declaration/conditional3.ts.shot new file mode 100644 index 000000000000..12e493db4191 --- /dev/null +++ b/packages/scope-manager/tests/fixtures/type-declaration/conditional3.ts.shot @@ -0,0 +1,131 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`type-declaration conditional3 1`] = ` +ScopeManager { + variables: Array [ + Variable$1 { + defs: Array [ + TypeDefinition$1 { + name: Identifier<"Test">, + node: TSTypeAliasDeclaration$1, + }, + ], + name: "Test", + references: Array [], + isValueVariable: false, + isTypeVariable: true, + }, + Variable$2 { + defs: Array [ + TypeDefinition$2 { + name: Identifier<"U">, + node: TSTypeParameter$2, + }, + ], + name: "U", + references: Array [ + Reference$1 { + identifier: Identifier<"U">, + isRead: true, + isTypeReference: true, + isValueReference: false, + isWrite: false, + resolved: Variable$2, + }, + ], + isValueVariable: false, + isTypeVariable: true, + }, + Variable$3 { + defs: Array [ + ParameterDefinition$3 { + name: Identifier<"k">, + node: TSFunctionType$3, + }, + ], + name: "k", + references: Array [], + isValueVariable: true, + isTypeVariable: false, + }, + Variable$4 { + defs: Array [ + TypeDefinition$4 { + name: Identifier<"I">, + node: TSTypeParameter$4, + }, + ], + name: "I", + references: Array [ + Reference$2 { + identifier: Identifier<"I">, + isRead: true, + isTypeReference: true, + isValueReference: false, + isWrite: false, + resolved: Variable$4, + }, + ], + isValueVariable: false, + isTypeVariable: true, + }, + ], + scopes: Array [ + GlobalScope$1 { + block: Program$5, + isStrict: false, + references: Array [], + set: Map { + "Test" => Variable$1, + }, + type: "global", + upper: null, + variables: Array [ + Variable$1, + ], + }, + TypeScope$2 { + block: TSTypeAliasDeclaration$1, + isStrict: true, + references: Array [], + set: Map { + "U" => Variable$2, + }, + type: "type", + upper: GlobalScope$1, + variables: Array [ + Variable$2, + ], + }, + ConditionalTypeScope$3 { + block: TSConditionalType$6, + isStrict: true, + references: Array [ + Reference$1, + Reference$2, + ], + set: Map { + "I" => Variable$4, + }, + type: "conditionalType", + upper: TypeScope$2, + variables: Array [ + Variable$4, + ], + }, + FunctionTypeScope$4 { + block: TSFunctionType$3, + isStrict: true, + references: Array [], + set: Map { + "k" => Variable$3, + }, + type: "functionType", + upper: ConditionalTypeScope$3, + variables: Array [ + Variable$3, + ], + }, + ], +} +`; diff --git a/packages/scope-manager/tests/fixtures/type-declaration/conditional4.ts b/packages/scope-manager/tests/fixtures/type-declaration/conditional4.ts new file mode 100644 index 000000000000..01ca91d3215d --- /dev/null +++ b/packages/scope-manager/tests/fixtures/type-declaration/conditional4.ts @@ -0,0 +1 @@ +type Test = U extends { [k: string]: infer I } ? I : never; diff --git a/packages/scope-manager/tests/fixtures/type-declaration/conditional4.ts.shot b/packages/scope-manager/tests/fixtures/type-declaration/conditional4.ts.shot new file mode 100644 index 000000000000..13ba417eaf91 --- /dev/null +++ b/packages/scope-manager/tests/fixtures/type-declaration/conditional4.ts.shot @@ -0,0 +1,106 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`type-declaration conditional4 1`] = ` +ScopeManager { + variables: Array [ + Variable$1 { + defs: Array [ + TypeDefinition$1 { + name: Identifier<"Test">, + node: TSTypeAliasDeclaration$1, + }, + ], + name: "Test", + references: Array [], + isValueVariable: false, + isTypeVariable: true, + }, + Variable$2 { + defs: Array [ + TypeDefinition$2 { + name: Identifier<"U">, + node: TSTypeParameter$2, + }, + ], + name: "U", + references: Array [ + Reference$1 { + identifier: Identifier<"U">, + isRead: true, + isTypeReference: true, + isValueReference: false, + isWrite: false, + resolved: Variable$2, + }, + ], + isValueVariable: false, + isTypeVariable: true, + }, + Variable$3 { + defs: Array [ + TypeDefinition$3 { + name: Identifier<"I">, + node: TSTypeParameter$3, + }, + ], + name: "I", + references: Array [ + Reference$2 { + identifier: Identifier<"I">, + isRead: true, + isTypeReference: true, + isValueReference: false, + isWrite: false, + resolved: Variable$3, + }, + ], + isValueVariable: false, + isTypeVariable: true, + }, + ], + scopes: Array [ + GlobalScope$1 { + block: Program$4, + isStrict: false, + references: Array [], + set: Map { + "Test" => Variable$1, + }, + type: "global", + upper: null, + variables: Array [ + Variable$1, + ], + }, + TypeScope$2 { + block: TSTypeAliasDeclaration$1, + isStrict: true, + references: Array [], + set: Map { + "U" => Variable$2, + }, + type: "type", + upper: GlobalScope$1, + variables: Array [ + Variable$2, + ], + }, + ConditionalTypeScope$3 { + block: TSConditionalType$5, + isStrict: true, + references: Array [ + Reference$1, + Reference$2, + ], + set: Map { + "I" => Variable$3, + }, + type: "conditionalType", + upper: TypeScope$2, + variables: Array [ + Variable$3, + ], + }, + ], +} +`; diff --git a/packages/scope-manager/tests/fixtures/type-declaration/conditional5.ts b/packages/scope-manager/tests/fixtures/type-declaration/conditional5.ts new file mode 100644 index 000000000000..3d6a66f4d0f9 --- /dev/null +++ b/packages/scope-manager/tests/fixtures/type-declaration/conditional5.ts @@ -0,0 +1,3 @@ +type Test = U extends (arg: { [k: string]: (arg2: infer I) => void }) => void + ? I + : never; diff --git a/packages/scope-manager/tests/fixtures/type-declaration/conditional5.ts.shot b/packages/scope-manager/tests/fixtures/type-declaration/conditional5.ts.shot new file mode 100644 index 000000000000..1102d182209c --- /dev/null +++ b/packages/scope-manager/tests/fixtures/type-declaration/conditional5.ts.shot @@ -0,0 +1,156 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`type-declaration conditional5 1`] = ` +ScopeManager { + variables: Array [ + Variable$1 { + defs: Array [ + TypeDefinition$1 { + name: Identifier<"Test">, + node: TSTypeAliasDeclaration$1, + }, + ], + name: "Test", + references: Array [], + isValueVariable: false, + isTypeVariable: true, + }, + Variable$2 { + defs: Array [ + TypeDefinition$2 { + name: Identifier<"U">, + node: TSTypeParameter$2, + }, + ], + name: "U", + references: Array [ + Reference$1 { + identifier: Identifier<"U">, + isRead: true, + isTypeReference: true, + isValueReference: false, + isWrite: false, + resolved: Variable$2, + }, + ], + isValueVariable: false, + isTypeVariable: true, + }, + Variable$3 { + defs: Array [ + ParameterDefinition$3 { + name: Identifier<"arg">, + node: TSFunctionType$3, + }, + ], + name: "arg", + references: Array [], + isValueVariable: true, + isTypeVariable: false, + }, + Variable$4 { + defs: Array [ + ParameterDefinition$4 { + name: Identifier<"arg2">, + node: TSFunctionType$4, + }, + ], + name: "arg2", + references: Array [], + isValueVariable: true, + isTypeVariable: false, + }, + Variable$5 { + defs: Array [ + TypeDefinition$5 { + name: Identifier<"I">, + node: TSTypeParameter$5, + }, + ], + name: "I", + references: Array [ + Reference$2 { + identifier: Identifier<"I">, + isRead: true, + isTypeReference: true, + isValueReference: false, + isWrite: false, + resolved: Variable$5, + }, + ], + isValueVariable: false, + isTypeVariable: true, + }, + ], + scopes: Array [ + GlobalScope$1 { + block: Program$6, + isStrict: false, + references: Array [], + set: Map { + "Test" => Variable$1, + }, + type: "global", + upper: null, + variables: Array [ + Variable$1, + ], + }, + TypeScope$2 { + block: TSTypeAliasDeclaration$1, + isStrict: true, + references: Array [], + set: Map { + "U" => Variable$2, + }, + type: "type", + upper: GlobalScope$1, + variables: Array [ + Variable$2, + ], + }, + ConditionalTypeScope$3 { + block: TSConditionalType$7, + isStrict: true, + references: Array [ + Reference$1, + Reference$2, + ], + set: Map { + "I" => Variable$5, + }, + type: "conditionalType", + upper: TypeScope$2, + variables: Array [ + Variable$5, + ], + }, + FunctionTypeScope$4 { + block: TSFunctionType$3, + isStrict: true, + references: Array [], + set: Map { + "arg" => Variable$3, + }, + type: "functionType", + upper: ConditionalTypeScope$3, + variables: Array [ + Variable$3, + ], + }, + FunctionTypeScope$5 { + block: TSFunctionType$4, + isStrict: true, + references: Array [], + set: Map { + "arg2" => Variable$4, + }, + type: "functionType", + upper: FunctionTypeScope$4, + variables: Array [ + Variable$4, + ], + }, + ], +} +`; From f887ab51f58c1b3571f9a14832864bc0ca59623f Mon Sep 17 00:00:00 2001 From: Brad Zacher Date: Sat, 5 Sep 2020 20:20:48 -0700 Subject: [PATCH 13/22] feat(scope-manager): add support for JSX scope analysis (#2498) Fixes #2455 And part of #2477 JSX is a first-class citizen of TS, so we should really support it as well. I was going to just rely upon `eslint-plugin-react`'s patch lint rules (`react/jsx-uses-react` and `react/jsx-uses-vars`), but that leaves gaps in our tooling. For example #2455, `consistent-type-imports` makes assumptions and can create invalid fixes for react without this change. We could add options to that lint rule for the factory, but that is kind-of a sub-par experience and future rule authors will likely run into similar problems. - Adds full scope analysis support for JSX. - Adds two new `parserOption`: - `jsxPragma` - the name to use for constructing JSX elements. Defaults to `"React"`. Will be auto detected from the tsconfig. - `jsxFragmentName` - the name that unnamed JSX fragments use. Defaults to `null` (i.e. assumes `React.Fragment`). Will be auto detected from the tsconfig. --- .cspell.json | 2 + .../tests/eslint-rules/no-undef.test.ts | 161 ++++++++++++++++++ .../rules/consistent-type-imports.test.ts | 45 +++++ .../tests/rules/no-unused-vars.test.ts | 99 +++++++++++ packages/parser/README.md | 27 ++- packages/parser/src/parser.ts | 61 +++++-- packages/parser/tests/lib/parser.ts | 40 +++++ packages/scope-manager/README.md | 15 ++ packages/scope-manager/src/analyze.ts | 26 ++- .../scope-manager/src/referencer/Reference.ts | 4 +- .../src/referencer/Referencer.ts | 76 +++++++++ packages/scope-manager/src/scope/ScopeBase.ts | 2 +- packages/scope-manager/tests/fixtures.test.ts | 2 + .../tests/fixtures/jsx/attribute-spread.tsx | 3 + .../fixtures/jsx/attribute-spread.tsx.shot | 65 +++++++ .../tests/fixtures/jsx/attribute.tsx | 4 + .../tests/fixtures/jsx/attribute.tsx.shot | 91 ++++++++++ .../tests/fixtures/jsx/children.tsx | 3 + .../tests/fixtures/jsx/children.tsx.shot | 73 ++++++++ .../fixtures/jsx/component-namespaced.tsx | 6 + .../jsx/component-namespaced.tsx.shot | 103 +++++++++++ .../tests/fixtures/jsx/component.tsx | 3 + .../tests/fixtures/jsx/component.tsx.shot | 66 +++++++ .../jsx/factory/default-jsxFragmentName.tsx | 6 + .../factory/default-jsxFragmentName.tsx.shot | 69 ++++++++ .../factory/default-jsxPragma-fragment.tsx | 5 + .../default-jsxPragma-fragment.tsx.shot | 55 ++++++ .../jsx/factory/default-jsxPragma.tsx | 5 + .../jsx/factory/default-jsxPragma.tsx.shot | 63 +++++++ .../fixtures/jsx/factory/jsxFragmentName.tsx | 7 + .../jsx/factory/jsxFragmentName.tsx.shot | 79 +++++++++ .../jsx/factory/jsxPragma-jsxFragmentName.tsx | 8 + .../jsxPragma-jsxFragmentName.tsx.shot | 93 ++++++++++ .../tests/fixtures/jsx/factory/jsxPragma.tsx | 7 + .../fixtures/jsx/factory/jsxPragma.tsx.shot | 77 +++++++++ .../tests/fixtures/jsx/fragment-children.tsx | 3 + .../fixtures/jsx/fragment-children.tsx.shot | 57 +++++++ .../tests/fixtures/jsx/fragment.tsx | 1 + .../tests/fixtures/jsx/fragment.tsx.shot | 18 ++ .../tests/fixtures/jsx/generic-type-param.tsx | 3 + .../fixtures/jsx/generic-type-param.tsx.shot | 54 ++++++ .../scope-manager/tests/fixtures/jsx/text.tsx | 2 + .../tests/fixtures/jsx/text.tsx.shot | 48 ++++++ packages/types/src/parser-options.ts | 2 + 44 files changed, 1618 insertions(+), 21 deletions(-) create mode 100644 packages/scope-manager/tests/fixtures/jsx/attribute-spread.tsx create mode 100644 packages/scope-manager/tests/fixtures/jsx/attribute-spread.tsx.shot create mode 100644 packages/scope-manager/tests/fixtures/jsx/attribute.tsx create mode 100644 packages/scope-manager/tests/fixtures/jsx/attribute.tsx.shot create mode 100644 packages/scope-manager/tests/fixtures/jsx/children.tsx create mode 100644 packages/scope-manager/tests/fixtures/jsx/children.tsx.shot create mode 100644 packages/scope-manager/tests/fixtures/jsx/component-namespaced.tsx create mode 100644 packages/scope-manager/tests/fixtures/jsx/component-namespaced.tsx.shot create mode 100644 packages/scope-manager/tests/fixtures/jsx/component.tsx create mode 100644 packages/scope-manager/tests/fixtures/jsx/component.tsx.shot create mode 100644 packages/scope-manager/tests/fixtures/jsx/factory/default-jsxFragmentName.tsx create mode 100644 packages/scope-manager/tests/fixtures/jsx/factory/default-jsxFragmentName.tsx.shot create mode 100644 packages/scope-manager/tests/fixtures/jsx/factory/default-jsxPragma-fragment.tsx create mode 100644 packages/scope-manager/tests/fixtures/jsx/factory/default-jsxPragma-fragment.tsx.shot create mode 100644 packages/scope-manager/tests/fixtures/jsx/factory/default-jsxPragma.tsx create mode 100644 packages/scope-manager/tests/fixtures/jsx/factory/default-jsxPragma.tsx.shot create mode 100644 packages/scope-manager/tests/fixtures/jsx/factory/jsxFragmentName.tsx create mode 100644 packages/scope-manager/tests/fixtures/jsx/factory/jsxFragmentName.tsx.shot create mode 100644 packages/scope-manager/tests/fixtures/jsx/factory/jsxPragma-jsxFragmentName.tsx create mode 100644 packages/scope-manager/tests/fixtures/jsx/factory/jsxPragma-jsxFragmentName.tsx.shot create mode 100644 packages/scope-manager/tests/fixtures/jsx/factory/jsxPragma.tsx create mode 100644 packages/scope-manager/tests/fixtures/jsx/factory/jsxPragma.tsx.shot create mode 100644 packages/scope-manager/tests/fixtures/jsx/fragment-children.tsx create mode 100644 packages/scope-manager/tests/fixtures/jsx/fragment-children.tsx.shot create mode 100644 packages/scope-manager/tests/fixtures/jsx/fragment.tsx create mode 100644 packages/scope-manager/tests/fixtures/jsx/fragment.tsx.shot create mode 100644 packages/scope-manager/tests/fixtures/jsx/generic-type-param.tsx create mode 100644 packages/scope-manager/tests/fixtures/jsx/generic-type-param.tsx.shot create mode 100644 packages/scope-manager/tests/fixtures/jsx/text.tsx create mode 100644 packages/scope-manager/tests/fixtures/jsx/text.tsx.shot diff --git a/.cspell.json b/.cspell.json index cbd5138affa4..36beb3bb328e 100644 --- a/.cspell.json +++ b/.cspell.json @@ -75,6 +75,7 @@ "pluggable", "postprocess", "postprocessor", + "preact", "Premade", "prettier's", "recurse", @@ -88,6 +89,7 @@ "rulesets", "serializers", "superset", + "transpiling", "thenables", "transpiles", "tsconfigs", diff --git a/packages/eslint-plugin/tests/eslint-rules/no-undef.test.ts b/packages/eslint-plugin/tests/eslint-rules/no-undef.test.ts index c87e5b4433e2..7af6497c62a6 100644 --- a/packages/eslint-plugin/tests/eslint-rules/no-undef.test.ts +++ b/packages/eslint-plugin/tests/eslint-rules/no-undef.test.ts @@ -140,6 +140,65 @@ function predicate(arg: any): asserts arg is T { } } `, + { + code: ` +function Foo() {} +; + `, + parserOptions: { + ecmaFeatures: { + jsx: true, + }, + }, + }, + { + code: ` +type T = 1; +function Foo() {} + />; + `, + parserOptions: { + ecmaFeatures: { + jsx: true, + }, + }, + }, + { + code: ` +const x = 1; +function Foo() {} +; + `, + parserOptions: { + ecmaFeatures: { + jsx: true, + }, + }, + }, + { + code: ` +const x = {}; +function Foo() {} +; + `, + parserOptions: { + ecmaFeatures: { + jsx: true, + }, + }, + }, + { + code: ` +const x = {}; +function Foo() {} +{x}; + `, + parserOptions: { + ecmaFeatures: { + jsx: true, + }, + }, + }, ], invalid: [ { @@ -175,5 +234,107 @@ function predicate(arg: any): asserts arg is T { }, ], }, + { + code: ';', + parserOptions: { + ecmaFeatures: { + jsx: true, + }, + }, + errors: [ + { + messageId: 'undef', + data: { + name: 'Foo', + }, + line: 1, + column: 2, + }, + ], + }, + { + code: ` +function Foo() {} +; + `, + parserOptions: { + ecmaFeatures: { + jsx: true, + }, + }, + errors: [ + { + messageId: 'undef', + data: { + name: 'x', + }, + line: 3, + column: 12, + }, + ], + }, + { + code: ` +function Foo() {} +; + `, + parserOptions: { + ecmaFeatures: { + jsx: true, + }, + }, + errors: [ + { + messageId: 'undef', + data: { + name: 'x', + }, + line: 3, + column: 10, + }, + ], + }, + { + code: ` +function Foo() {} + />; + `, + parserOptions: { + ecmaFeatures: { + jsx: true, + }, + }, + errors: [ + { + messageId: 'undef', + data: { + name: 'T', + }, + line: 3, + column: 6, + }, + ], + }, + { + code: ` +function Foo() {} +{x}; + `, + parserOptions: { + ecmaFeatures: { + jsx: true, + }, + }, + errors: [ + { + messageId: 'undef', + data: { + name: 'x', + }, + line: 3, + column: 7, + }, + ], + }, ], }); diff --git a/packages/eslint-plugin/tests/rules/consistent-type-imports.test.ts b/packages/eslint-plugin/tests/rules/consistent-type-imports.test.ts index 13112793f625..88d6db374a04 100644 --- a/packages/eslint-plugin/tests/rules/consistent-type-imports.test.ts +++ b/packages/eslint-plugin/tests/rules/consistent-type-imports.test.ts @@ -180,6 +180,51 @@ ruleTester.run('consistent-type-imports', rule, { `, options: [{ prefer: 'no-type-imports' }], }, + // https://github.com/typescript-eslint/typescript-eslint/issues/2455 + { + code: ` + import React from 'react'; + + export const ComponentFoo: React.FC = () => { + return
Foo Foo
; + }; + `, + parserOptions: { + ecmaFeatures: { + jsx: true, + }, + }, + }, + { + code: ` + import { h } from 'some-other-jsx-lib'; + + export const ComponentFoo: h.FC = () => { + return
Foo Foo
; + }; + `, + parserOptions: { + ecmaFeatures: { + jsx: true, + }, + jsxPragma: 'h', + }, + }, + { + code: ` + import { Fragment } from 'react'; + + export const ComponentFoo: Fragment = () => { + return <>Foo Foo; + }; + `, + parserOptions: { + ecmaFeatures: { + jsx: true, + }, + jsxFragmentName: 'Fragment', + }, + }, ], invalid: [ { diff --git a/packages/eslint-plugin/tests/rules/no-unused-vars.test.ts b/packages/eslint-plugin/tests/rules/no-unused-vars.test.ts index bac969579d9f..837246f45835 100644 --- a/packages/eslint-plugin/tests/rules/no-unused-vars.test.ts +++ b/packages/eslint-plugin/tests/rules/no-unused-vars.test.ts @@ -803,6 +803,51 @@ export type Test = U extends (arg: { ? I : never; `, + // https://github.com/typescript-eslint/typescript-eslint/issues/2455 + { + code: ` + import React from 'react'; + + export const ComponentFoo: React.FC = () => { + return
Foo Foo
; + }; + `, + parserOptions: { + ecmaFeatures: { + jsx: true, + }, + }, + }, + { + code: ` + import { h } from 'some-other-jsx-lib'; + + export const ComponentFoo: h.FC = () => { + return
Foo Foo
; + }; + `, + parserOptions: { + ecmaFeatures: { + jsx: true, + }, + jsxPragma: 'h', + }, + }, + { + code: ` + import { Fragment } from 'react'; + + export const ComponentFoo: Fragment = () => { + return <>Foo Foo; + }; + `, + parserOptions: { + ecmaFeatures: { + jsx: true, + }, + jsxFragmentName: 'Fragment', + }, + }, ], invalid: [ @@ -1325,5 +1370,59 @@ type Foo = Array; }, ], }, + // https://github.com/typescript-eslint/typescript-eslint/issues/2455 + { + code: ` +import React from 'react'; +import { Fragment } from 'react'; + +export const ComponentFoo = () => { + return
Foo Foo
; +}; + `, + parserOptions: { + ecmaFeatures: { + jsx: true, + }, + }, + errors: [ + { + messageId: 'unusedVar', + line: 3, + data: { + varName: 'Fragment', + action: 'defined', + additional: '', + }, + }, + ], + }, + { + code: ` +import React from 'react'; +import { h } from 'some-other-jsx-lib'; + +export const ComponentFoo = () => { + return
Foo Foo
; +}; + `, + parserOptions: { + ecmaFeatures: { + jsx: true, + }, + jsxPragma: 'h', + }, + errors: [ + { + messageId: 'unusedVar', + line: 2, + data: { + varName: 'React', + action: 'defined', + additional: '', + }, + }, + ], + }, ], }); diff --git a/packages/parser/README.md b/packages/parser/README.md index 5a949425d9fb..f6417fd58896 100644 --- a/packages/parser/README.md +++ b/packages/parser/README.md @@ -54,6 +54,9 @@ interface ParserOptions { globalReturn?: boolean; }; ecmaVersion?: number; + + jsxPragma?: string; + jsxFragmentName?: string | null; lib?: string[]; project?: string | string[]; @@ -98,6 +101,27 @@ Accepts any valid ECMAScript version number: Specifies the version of ECMAScript syntax you want to use. This is used by the parser to determine how to perform scope analysis, and it affects the default +### `parserOptions.jsxPragma` + +Default `'React'` + +The identifier that's used for JSX Elements creation (after transpilation). +If you're using a library other than React (like `preact`), then you should change this value. + +This should not be a member expression - just the root identifier (i.e. use `"React"` instead of `"React.createElement"`). + +If you provide `parserOptions.project`, you do not need to set this, as it will automatically detected from the compiler. + +### `parserOptions.jsxFragmentName` + +Default `null` + +The identifier that's used for JSX fragment elements (after transpilation). +If `null`, assumes transpilation will always use a member of the configured `jsxPragma`. +This should not be a member expression - just the root identifier (i.e. use `"h"` instead of `"h.Fragment"`). + +If you provide `parserOptions.project`, you do not need to set this, as it will automatically detected from the compiler. + ### `parserOptions.lib` Default `['es2018']` @@ -105,7 +129,8 @@ Default `['es2018']` For valid options, see the [TypeScript compiler options](https://www.typescriptlang.org/tsconfig#lib). Specifies the TypeScript `lib`s that are available. This is used by the scope analyser to ensure there are global variables declared for the types exposed by TypeScript. -If you provide `parserOptions.project`, you do not need to set this, as it will automatically detected from the compiler + +If you provide `parserOptions.project`, you do not need to set this, as it will automatically detected from the compiler. ### `parserOptions.project` diff --git a/packages/parser/src/parser.ts b/packages/parser/src/parser.ts index 263779207c95..54dbd3997249 100644 --- a/packages/parser/src/parser.ts +++ b/packages/parser/src/parser.ts @@ -5,9 +5,13 @@ import { TSESTreeOptions, visitorKeys, } from '@typescript-eslint/typescript-estree'; -import { analyze, ScopeManager } from '@typescript-eslint/scope-manager'; +import { + analyze, + AnalyzeOptions, + ScopeManager, +} from '@typescript-eslint/scope-manager'; import debug from 'debug'; -import { ScriptTarget } from 'typescript'; +import { CompilerOptions, ScriptTarget } from 'typescript'; const log = debug('typescript-eslint:parser:parser'); @@ -33,8 +37,7 @@ function validateBoolean( } const LIB_FILENAME_REGEX = /lib\.(.+)\.d\.ts/; -function getLib(services: ParserServices): Lib[] { - const compilerOptions = services.program.getCompilerOptions(); +function getLib(compilerOptions: CompilerOptions): Lib[] { if (compilerOptions.lib) { return compilerOptions.lib .map(lib => { @@ -100,6 +103,14 @@ function parseForESLint( useJSXTextNode: validateBoolean(options.useJSXTextNode, true), jsx: validateBoolean(options.ecmaFeatures.jsx), }); + const analyzeOptions: AnalyzeOptions = { + ecmaVersion: options.ecmaVersion, + globalReturn: options.ecmaFeatures.globalReturn, + jsxPragma: options.jsxPragma, + jsxFragmentName: options.jsxFragmentName, + lib: options.lib, + sourceType: options.sourceType, + }; if (typeof options.filePath === 'string') { const tsx = options.filePath.endsWith('.tsx'); @@ -123,18 +134,40 @@ function parseForESLint( const { ast, services } = parseAndGenerateServices(code, parserOptions); ast.sourceType = options.sourceType; - // automatically apply the libs configured for the program - if (services.hasFullTypeInformation && options.lib == null) { - options.lib = getLib(services); - log('Resolved libs from program: %o', options.lib); + if (services.hasFullTypeInformation) { + // automatically apply the options configured for the program + const compilerOptions = services.program.getCompilerOptions(); + if (analyzeOptions.lib == null) { + analyzeOptions.lib = getLib(compilerOptions); + log('Resolved libs from program: %o', analyzeOptions.lib); + } + if (parserOptions.jsx === true) { + if ( + analyzeOptions.jsxPragma === undefined && + compilerOptions.jsxFactory != null + ) { + // in case the user has specified something like "preact.h" + const factory = compilerOptions.jsxFactory.split('.')[0].trim(); + analyzeOptions.jsxPragma = factory; + log('Resolved jsxPragma from program: %s', analyzeOptions.jsxPragma); + } + if ( + analyzeOptions.jsxFragmentName === undefined && + compilerOptions.jsxFragmentFactory != null + ) { + // in case the user has specified something like "preact.Fragment" + const fragFactory = compilerOptions.jsxFragmentFactory + .split('.')[0] + .trim(); + analyzeOptions.jsxFragmentName = fragFactory; + log( + 'Resolved jsxFragmentName from program: %s', + analyzeOptions.jsxFragmentName, + ); + } + } } - const analyzeOptions = { - ecmaVersion: options.ecmaVersion, - globalReturn: options.ecmaFeatures.globalReturn, - lib: options.lib, - sourceType: options.sourceType, - }; const scopeManager = analyze(ast, analyzeOptions); return { ast, services, scopeManager, visitorKeys }; diff --git a/packages/parser/tests/lib/parser.ts b/packages/parser/tests/lib/parser.ts index ba4a1663c8ea..41e22a911f9b 100644 --- a/packages/parser/tests/lib/parser.ts +++ b/packages/parser/tests/lib/parser.ts @@ -1,5 +1,6 @@ import { TSESLint } from '@typescript-eslint/experimental-utils'; import * as typescriptESTree from '@typescript-eslint/typescript-estree/dist/parser'; +import * as scopeManager from '@typescript-eslint/scope-manager/dist/analyze'; import { parse, parseForESLint } from '../../src/parser'; describe('parser', () => { @@ -70,4 +71,43 @@ describe('parser', () => { warnOnUnsupportedTypeScriptVersion: false, }); }); + + it('analyze() should be called with options', () => { + const code = 'const valid = true;'; + const spy = jest.spyOn(scopeManager, 'analyze'); + const config: TSESLint.ParserOptions = { + loc: false, + comment: false, + range: false, + tokens: false, + sourceType: 'module' as const, + ecmaVersion: 2018, + ecmaFeatures: { + globalReturn: false, + jsx: false, + }, + // scope-manager specific + lib: ['dom.iterable'], + jsxPragma: 'Foo', + jsxFragmentName: 'Bar', + // ts-estree specific + filePath: 'isolated-file.src.ts', + project: 'tsconfig.json', + useJSXTextNode: false, + errorOnUnknownASTType: false, + errorOnTypeScriptSyntacticAndSemanticIssues: false, + tsconfigRootDir: 'tests/fixtures/services', + extraFileExtensions: ['.foo'], + }; + parseForESLint(code, config); + expect(spy).toHaveBeenCalledTimes(1); + expect(spy).toHaveBeenLastCalledWith(expect.anything(), { + ecmaVersion: 2018, + globalReturn: false, + lib: ['dom.iterable'], + jsxPragma: 'Foo', + jsxFragmentName: 'Bar', + sourceType: 'module', + }); + }); }); diff --git a/packages/scope-manager/README.md b/packages/scope-manager/README.md index 6d389a32f319..24ccd839dff0 100644 --- a/packages/scope-manager/README.md +++ b/packages/scope-manager/README.md @@ -55,6 +55,21 @@ interface AnalyzeOptions { */ impliedStrict?: boolean; + /** + * The identifier that's used for JSX Element creation (after transpilation). + * This should not be a member expression - just the root identifier (i.e. use "React" instead of "React.createElement"). + * Defaults to `"React"`. + */ + jsxPragma?: string; + + /** + * The identifier that's used for JSX fragment elements (after transpilation). + * If `null`, assumes transpilation will always use a member on `jsxFactory` (i.e. React.Fragment). + * This should not be a member expression - just the root identifier (i.e. use "h" instead of "h.Fragment"). + * Defaults to `null`. + */ + jsxFragmentName?: string | null; + /** * The lib used by the project. * This automatically defines a type variable for any types provided by the configured TS libs. diff --git a/packages/scope-manager/src/analyze.ts b/packages/scope-manager/src/analyze.ts index ee3ac77de96a..9e734925da19 100644 --- a/packages/scope-manager/src/analyze.ts +++ b/packages/scope-manager/src/analyze.ts @@ -33,6 +33,21 @@ interface AnalyzeOptions { */ impliedStrict?: boolean; + /** + * The identifier that's used for JSX Element creation (after transpilation). + * This should not be a member expression - just the root identifier (i.e. use "React" instead of "React.createElement"). + * Defaults to `"React"`. + */ + jsxPragma?: string; + + /** + * The identifier that's used for JSX fragment elements (after transpilation). + * If `null`, assumes transpilation will always use a member on `jsxFactory` (i.e. React.Fragment). + * This should not be a member expression - just the root identifier (i.e. use "h" instead of "h.Fragment"). + * Defaults to `null`. + */ + jsxFragmentName?: string | null; + /** * The lib used by the project. * This automatically defines a type variable for any types provided by the configured TS libs. @@ -53,6 +68,8 @@ const DEFAULT_OPTIONS: Required = { ecmaVersion: 2018, globalReturn: false, impliedStrict: false, + jsxPragma: 'React', + jsxFragmentName: null, lib: ['es2018'], sourceType: 'script', }; @@ -78,13 +95,16 @@ function analyze( const ecmaVersion = providedOptions?.ecmaVersion ?? DEFAULT_OPTIONS.ecmaVersion; const options: Required = { + childVisitorKeys: + providedOptions?.childVisitorKeys ?? DEFAULT_OPTIONS.childVisitorKeys, + ecmaVersion, globalReturn: providedOptions?.globalReturn ?? DEFAULT_OPTIONS.globalReturn, impliedStrict: providedOptions?.impliedStrict ?? DEFAULT_OPTIONS.impliedStrict, + jsxPragma: providedOptions?.jsxPragma ?? DEFAULT_OPTIONS.jsxPragma, + jsxFragmentName: + providedOptions?.jsxFragmentName ?? DEFAULT_OPTIONS.jsxFragmentName, sourceType: providedOptions?.sourceType ?? DEFAULT_OPTIONS.sourceType, - ecmaVersion, - childVisitorKeys: - providedOptions?.childVisitorKeys ?? DEFAULT_OPTIONS.childVisitorKeys, lib: providedOptions?.lib ?? [mapEcmaVersion(ecmaVersion)], }; diff --git a/packages/scope-manager/src/referencer/Reference.ts b/packages/scope-manager/src/referencer/Reference.ts index 5786c5017300..9cf624f82a18 100644 --- a/packages/scope-manager/src/referencer/Reference.ts +++ b/packages/scope-manager/src/referencer/Reference.ts @@ -43,7 +43,7 @@ class Reference { * Identifier syntax node. * @public */ - public readonly identifier: TSESTree.Identifier; + public readonly identifier: TSESTree.Identifier | TSESTree.JSXIdentifier; /** * `true` if this writing reference is a variable initializer or a default value. * @public @@ -82,7 +82,7 @@ class Reference { } constructor( - identifier: TSESTree.Identifier, + identifier: TSESTree.Identifier | TSESTree.JSXIdentifier, scope: Scope, flag: ReferenceFlag, writeExpr?: TSESTree.Node | null, diff --git a/packages/scope-manager/src/referencer/Referencer.ts b/packages/scope-manager/src/referencer/Referencer.ts index c0c49ef9728b..bd88b6a59966 100644 --- a/packages/scope-manager/src/referencer/Referencer.ts +++ b/packages/scope-manager/src/referencer/Referencer.ts @@ -22,18 +22,26 @@ import { lib as TSLibraries } from '../lib'; import { Scope, GlobalScope } from '../scope'; interface ReferencerOptions extends VisitorOptions { + jsxPragma: string; + jsxFragmentName: string | null; lib: Lib[]; } // Referencing variables and creating bindings. class Referencer extends Visitor { #isInnerMethodDefinition: boolean; + #jsxPragma: string; + #jsxFragmentName: string | null; + #hasReferencedJsxFactory = false; + #hasReferencedJsxFragmentFactory = false; #lib: Lib[]; public readonly scopeManager: ScopeManager; constructor(options: ReferencerOptions, scopeManager: ScopeManager) { super(options); this.scopeManager = scopeManager; + this.#jsxPragma = options.jsxPragma; + this.#jsxFragmentName = options.jsxFragmentName; this.#lib = options.lib; this.#isInnerMethodDefinition = false; } @@ -99,6 +107,46 @@ class Referencer extends Visitor { } } + /** + * Searches for a variable named "name" in the upper scopes and adds a pseudo-reference from itself to itself + */ + private referenceInSomeUpperScope(name: string): boolean { + let scope = this.scopeManager.currentScope; + while (scope) { + const variable = scope.set.get(name); + if (!variable) { + scope = scope.upper; + continue; + } + + scope.referenceValue(variable.identifiers[0]); + return true; + } + + return false; + } + + private referenceJsxPragma(): void { + if (this.#hasReferencedJsxFactory) { + return; + } + this.#hasReferencedJsxFactory = this.referenceInSomeUpperScope( + this.#jsxPragma, + ); + } + + private referenceJsxFragment(): void { + if ( + this.#jsxFragmentName === null || + this.#hasReferencedJsxFragmentFactory + ) { + return; + } + this.#hasReferencedJsxFragmentFactory = this.referenceInSomeUpperScope( + this.#jsxFragmentName, + ); + } + /////////////////// // Visit helpers // /////////////////// @@ -498,6 +546,34 @@ class Referencer extends Visitor { ImportVisitor.visit(this, node); } + protected JSXAttribute(node: TSESTree.JSXAttribute): void { + this.visit(node.value); + } + + protected JSXFragment(node: TSESTree.JSXFragment): void { + this.referenceJsxPragma(); + this.referenceJsxFragment(); + this.visitChildren(node); + } + + protected JSXIdentifier(node: TSESTree.JSXIdentifier): void { + this.currentScope().referenceValue(node); + } + + protected JSXMemberExpression(node: TSESTree.JSXMemberExpression): void { + this.visit(node.object); + // we don't ever reference the property as it's always going to be a property on the thing + } + + protected JSXOpeningElement(node: TSESTree.JSXOpeningElement): void { + this.referenceJsxPragma(); + this.visit(node.name); + this.visitType(node.typeParameters); + for (const attr of node.attributes) { + this.visit(attr); + } + } + protected LabeledStatement(node: TSESTree.LabeledStatement): void { this.visit(node.body); } diff --git a/packages/scope-manager/src/scope/ScopeBase.ts b/packages/scope-manager/src/scope/ScopeBase.ts index cc38cdb3f97d..9b852dcff6ad 100644 --- a/packages/scope-manager/src/scope/ScopeBase.ts +++ b/packages/scope-manager/src/scope/ScopeBase.ts @@ -446,7 +446,7 @@ abstract class ScopeBase< } public referenceValue( - node: TSESTree.Identifier, + node: TSESTree.Identifier | TSESTree.JSXIdentifier, assign: ReferenceFlag = ReferenceFlag.Read, writeExpr?: TSESTree.Expression | null, maybeImplicitGlobal?: ReferenceImplicitGlobal | null, diff --git a/packages/scope-manager/tests/fixtures.test.ts b/packages/scope-manager/tests/fixtures.test.ts index 24bd0fd80f0b..08eea4f4995e 100644 --- a/packages/scope-manager/tests/fixtures.test.ts +++ b/packages/scope-manager/tests/fixtures.test.ts @@ -41,6 +41,8 @@ const ALLOWED_OPTIONS: Map = new Map< ['ecmaVersion', ['number']], ['globalReturn', ['boolean']], ['impliedStrict', ['boolean']], + ['jsxPragma', ['string']], + ['jsxFragmentName', ['string']], ['sourceType', ['string', new Set(['module', 'script'])]], ]); diff --git a/packages/scope-manager/tests/fixtures/jsx/attribute-spread.tsx b/packages/scope-manager/tests/fixtures/jsx/attribute-spread.tsx new file mode 100644 index 000000000000..b501cbc9b17f --- /dev/null +++ b/packages/scope-manager/tests/fixtures/jsx/attribute-spread.tsx @@ -0,0 +1,3 @@ +const x = {}; + +; diff --git a/packages/scope-manager/tests/fixtures/jsx/attribute-spread.tsx.shot b/packages/scope-manager/tests/fixtures/jsx/attribute-spread.tsx.shot new file mode 100644 index 000000000000..fd34f473d78d --- /dev/null +++ b/packages/scope-manager/tests/fixtures/jsx/attribute-spread.tsx.shot @@ -0,0 +1,65 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`jsx attribute-spread 1`] = ` +ScopeManager { + variables: Array [ + Variable$1 { + defs: Array [ + VariableDefinition$1 { + name: Identifier<"x">, + node: VariableDeclarator$1, + }, + ], + name: "x", + references: Array [ + Reference$1 { + identifier: Identifier<"x">, + init: true, + isRead: false, + isTypeReference: false, + isValueReference: true, + isWrite: true, + resolved: Variable$1, + writeExpr: ObjectExpression$2, + }, + Reference$3 { + identifier: Identifier<"x">, + isRead: true, + isTypeReference: false, + isValueReference: true, + isWrite: false, + resolved: Variable$1, + }, + ], + isValueVariable: true, + isTypeVariable: false, + }, + ], + scopes: Array [ + GlobalScope$1 { + block: Program$3, + isStrict: false, + references: Array [ + Reference$1, + Reference$2 { + identifier: JSXIdentifier$4, + isRead: true, + isTypeReference: false, + isValueReference: true, + isWrite: false, + resolved: null, + }, + Reference$3, + ], + set: Map { + "x" => Variable$1, + }, + type: "global", + upper: null, + variables: Array [ + Variable$1, + ], + }, + ], +} +`; diff --git a/packages/scope-manager/tests/fixtures/jsx/attribute.tsx b/packages/scope-manager/tests/fixtures/jsx/attribute.tsx new file mode 100644 index 000000000000..e915453933d4 --- /dev/null +++ b/packages/scope-manager/tests/fixtures/jsx/attribute.tsx @@ -0,0 +1,4 @@ +const x = 1; +const attr = 2; // should be unreferenced + +; diff --git a/packages/scope-manager/tests/fixtures/jsx/attribute.tsx.shot b/packages/scope-manager/tests/fixtures/jsx/attribute.tsx.shot new file mode 100644 index 000000000000..a87647863181 --- /dev/null +++ b/packages/scope-manager/tests/fixtures/jsx/attribute.tsx.shot @@ -0,0 +1,91 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`jsx attribute 1`] = ` +ScopeManager { + variables: Array [ + Variable$1 { + defs: Array [ + VariableDefinition$1 { + name: Identifier<"x">, + node: VariableDeclarator$1, + }, + ], + name: "x", + references: Array [ + Reference$1 { + identifier: Identifier<"x">, + init: true, + isRead: false, + isTypeReference: false, + isValueReference: true, + isWrite: true, + resolved: Variable$1, + writeExpr: Literal$2, + }, + Reference$4 { + identifier: Identifier<"x">, + isRead: true, + isTypeReference: false, + isValueReference: true, + isWrite: false, + resolved: Variable$1, + }, + ], + isValueVariable: true, + isTypeVariable: false, + }, + Variable$2 { + defs: Array [ + VariableDefinition$2 { + name: Identifier<"attr">, + node: VariableDeclarator$3, + }, + ], + name: "attr", + references: Array [ + Reference$2 { + identifier: Identifier<"attr">, + init: true, + isRead: false, + isTypeReference: false, + isValueReference: true, + isWrite: true, + resolved: Variable$2, + writeExpr: Literal$4, + }, + ], + isValueVariable: true, + isTypeVariable: false, + }, + ], + scopes: Array [ + GlobalScope$1 { + block: Program$5, + isStrict: false, + references: Array [ + Reference$1, + Reference$2, + Reference$3 { + identifier: JSXIdentifier$6, + isRead: true, + isTypeReference: false, + isValueReference: true, + isWrite: false, + resolved: null, + }, + Reference$4, + ], + set: Map { + "x" => Variable$1, + "attr" => Variable$2, + }, + type: "global", + upper: null, + variables: Array [ + Variable$1, + Variable$2, + ], + }, + ], +} +`; diff --git a/packages/scope-manager/tests/fixtures/jsx/children.tsx b/packages/scope-manager/tests/fixtures/jsx/children.tsx new file mode 100644 index 000000000000..eea4145f68d1 --- /dev/null +++ b/packages/scope-manager/tests/fixtures/jsx/children.tsx @@ -0,0 +1,3 @@ +const child = 1; + +{child}; diff --git a/packages/scope-manager/tests/fixtures/jsx/children.tsx.shot b/packages/scope-manager/tests/fixtures/jsx/children.tsx.shot new file mode 100644 index 000000000000..9fc1dfb49539 --- /dev/null +++ b/packages/scope-manager/tests/fixtures/jsx/children.tsx.shot @@ -0,0 +1,73 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`jsx children 1`] = ` +ScopeManager { + variables: Array [ + Variable$1 { + defs: Array [ + VariableDefinition$1 { + name: Identifier<"child">, + node: VariableDeclarator$1, + }, + ], + name: "child", + references: Array [ + Reference$1 { + identifier: Identifier<"child">, + init: true, + isRead: false, + isTypeReference: false, + isValueReference: true, + isWrite: true, + resolved: Variable$1, + writeExpr: Literal$2, + }, + Reference$3 { + identifier: Identifier<"child">, + isRead: true, + isTypeReference: false, + isValueReference: true, + isWrite: false, + resolved: Variable$1, + }, + ], + isValueVariable: true, + isTypeVariable: false, + }, + ], + scopes: Array [ + GlobalScope$1 { + block: Program$3, + isStrict: false, + references: Array [ + Reference$1, + Reference$2 { + identifier: JSXIdentifier$4, + isRead: true, + isTypeReference: false, + isValueReference: true, + isWrite: false, + resolved: null, + }, + Reference$3, + Reference$4 { + identifier: JSXIdentifier$5, + isRead: true, + isTypeReference: false, + isValueReference: true, + isWrite: false, + resolved: null, + }, + ], + set: Map { + "child" => Variable$1, + }, + type: "global", + upper: null, + variables: Array [ + Variable$1, + ], + }, + ], +} +`; diff --git a/packages/scope-manager/tests/fixtures/jsx/component-namespaced.tsx b/packages/scope-manager/tests/fixtures/jsx/component-namespaced.tsx new file mode 100644 index 000000000000..fa0a0f915212 --- /dev/null +++ b/packages/scope-manager/tests/fixtures/jsx/component-namespaced.tsx @@ -0,0 +1,6 @@ +const X = { + Foo() {}, +}; +const Foo = 1; // should be unreferenced + +; diff --git a/packages/scope-manager/tests/fixtures/jsx/component-namespaced.tsx.shot b/packages/scope-manager/tests/fixtures/jsx/component-namespaced.tsx.shot new file mode 100644 index 000000000000..c5bc7eb9d4e3 --- /dev/null +++ b/packages/scope-manager/tests/fixtures/jsx/component-namespaced.tsx.shot @@ -0,0 +1,103 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`jsx component-namespaced 1`] = ` +ScopeManager { + variables: Array [ + Variable$1 { + defs: Array [ + VariableDefinition$1 { + name: Identifier<"X">, + node: VariableDeclarator$1, + }, + ], + name: "X", + references: Array [ + Reference$1 { + identifier: Identifier<"X">, + init: true, + isRead: false, + isTypeReference: false, + isValueReference: true, + isWrite: true, + resolved: Variable$1, + writeExpr: ObjectExpression$2, + }, + Reference$3 { + identifier: JSXIdentifier$3, + isRead: true, + isTypeReference: false, + isValueReference: true, + isWrite: false, + resolved: Variable$1, + }, + ], + isValueVariable: true, + isTypeVariable: false, + }, + Variable$2 { + defs: Array [], + name: "arguments", + references: Array [], + isValueVariable: true, + isTypeVariable: true, + }, + Variable$3 { + defs: Array [ + VariableDefinition$2 { + name: Identifier<"Foo">, + node: VariableDeclarator$4, + }, + ], + name: "Foo", + references: Array [ + Reference$2 { + identifier: Identifier<"Foo">, + init: true, + isRead: false, + isTypeReference: false, + isValueReference: true, + isWrite: true, + resolved: Variable$3, + writeExpr: Literal$5, + }, + ], + isValueVariable: true, + isTypeVariable: false, + }, + ], + scopes: Array [ + GlobalScope$1 { + block: Program$6, + isStrict: false, + references: Array [ + Reference$1, + Reference$2, + Reference$3, + ], + set: Map { + "X" => Variable$1, + "Foo" => Variable$3, + }, + type: "global", + upper: null, + variables: Array [ + Variable$1, + Variable$3, + ], + }, + FunctionScope$2 { + block: FunctionExpression$7, + isStrict: false, + references: Array [], + set: Map { + "arguments" => Variable$2, + }, + type: "function", + upper: GlobalScope$1, + variables: Array [ + Variable$2, + ], + }, + ], +} +`; diff --git a/packages/scope-manager/tests/fixtures/jsx/component.tsx b/packages/scope-manager/tests/fixtures/jsx/component.tsx new file mode 100644 index 000000000000..20f898b540ca --- /dev/null +++ b/packages/scope-manager/tests/fixtures/jsx/component.tsx @@ -0,0 +1,3 @@ +function Foo() {} + +; diff --git a/packages/scope-manager/tests/fixtures/jsx/component.tsx.shot b/packages/scope-manager/tests/fixtures/jsx/component.tsx.shot new file mode 100644 index 000000000000..a37331e7f7e3 --- /dev/null +++ b/packages/scope-manager/tests/fixtures/jsx/component.tsx.shot @@ -0,0 +1,66 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`jsx component 1`] = ` +ScopeManager { + variables: Array [ + Variable$1 { + defs: Array [ + FunctionNameDefinition$1 { + name: Identifier<"Foo">, + node: FunctionDeclaration$1, + }, + ], + name: "Foo", + references: Array [ + Reference$1 { + identifier: JSXIdentifier$2, + isRead: true, + isTypeReference: false, + isValueReference: true, + isWrite: false, + resolved: Variable$1, + }, + ], + isValueVariable: true, + isTypeVariable: false, + }, + Variable$2 { + defs: Array [], + name: "arguments", + references: Array [], + isValueVariable: true, + isTypeVariable: true, + }, + ], + scopes: Array [ + GlobalScope$1 { + block: Program$3, + isStrict: false, + references: Array [ + Reference$1, + ], + set: Map { + "Foo" => Variable$1, + }, + type: "global", + upper: null, + variables: Array [ + Variable$1, + ], + }, + FunctionScope$2 { + block: FunctionDeclaration$1, + isStrict: false, + references: Array [], + set: Map { + "arguments" => Variable$2, + }, + type: "function", + upper: GlobalScope$1, + variables: Array [ + Variable$2, + ], + }, + ], +} +`; diff --git a/packages/scope-manager/tests/fixtures/jsx/factory/default-jsxFragmentName.tsx b/packages/scope-manager/tests/fixtures/jsx/factory/default-jsxFragmentName.tsx new file mode 100644 index 000000000000..de94f8168c85 --- /dev/null +++ b/packages/scope-manager/tests/fixtures/jsx/factory/default-jsxFragmentName.tsx @@ -0,0 +1,6 @@ +//// @sourceType = 'module' + +import React from 'react'; +import { Fragment } from 'react'; // should be unreferenced + +<>; diff --git a/packages/scope-manager/tests/fixtures/jsx/factory/default-jsxFragmentName.tsx.shot b/packages/scope-manager/tests/fixtures/jsx/factory/default-jsxFragmentName.tsx.shot new file mode 100644 index 000000000000..76e5b24ecc8d --- /dev/null +++ b/packages/scope-manager/tests/fixtures/jsx/factory/default-jsxFragmentName.tsx.shot @@ -0,0 +1,69 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`jsx factory default-jsxFragmentName 1`] = ` +ScopeManager { + variables: Array [ + Variable$1 { + defs: Array [ + ImportBindingDefinition$1 { + name: Identifier<"React">, + node: ImportDefaultSpecifier$1, + }, + ], + name: "React", + references: Array [ + Reference$1 { + identifier: Identifier<"React">, + isRead: true, + isTypeReference: false, + isValueReference: true, + isWrite: false, + resolved: Variable$1, + }, + ], + isValueVariable: true, + isTypeVariable: true, + }, + Variable$2 { + defs: Array [ + ImportBindingDefinition$2 { + name: Identifier<"Fragment">, + node: ImportSpecifier$2, + }, + ], + name: "Fragment", + references: Array [], + isValueVariable: true, + isTypeVariable: true, + }, + ], + scopes: Array [ + GlobalScope$1 { + block: Program$3, + isStrict: false, + references: Array [], + set: Map {}, + type: "global", + upper: null, + variables: Array [], + }, + ModuleScope$2 { + block: Program$3, + isStrict: true, + references: Array [ + Reference$1, + ], + set: Map { + "React" => Variable$1, + "Fragment" => Variable$2, + }, + type: "module", + upper: GlobalScope$1, + variables: Array [ + Variable$1, + Variable$2, + ], + }, + ], +} +`; diff --git a/packages/scope-manager/tests/fixtures/jsx/factory/default-jsxPragma-fragment.tsx b/packages/scope-manager/tests/fixtures/jsx/factory/default-jsxPragma-fragment.tsx new file mode 100644 index 000000000000..8fce679e7467 --- /dev/null +++ b/packages/scope-manager/tests/fixtures/jsx/factory/default-jsxPragma-fragment.tsx @@ -0,0 +1,5 @@ +//// @sourceType = 'module' + +import React from 'react'; + +<>; diff --git a/packages/scope-manager/tests/fixtures/jsx/factory/default-jsxPragma-fragment.tsx.shot b/packages/scope-manager/tests/fixtures/jsx/factory/default-jsxPragma-fragment.tsx.shot new file mode 100644 index 000000000000..4b7ea0925e15 --- /dev/null +++ b/packages/scope-manager/tests/fixtures/jsx/factory/default-jsxPragma-fragment.tsx.shot @@ -0,0 +1,55 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`jsx factory default-jsxPragma-fragment 1`] = ` +ScopeManager { + variables: Array [ + Variable$1 { + defs: Array [ + ImportBindingDefinition$1 { + name: Identifier<"React">, + node: ImportDefaultSpecifier$1, + }, + ], + name: "React", + references: Array [ + Reference$1 { + identifier: Identifier<"React">, + isRead: true, + isTypeReference: false, + isValueReference: true, + isWrite: false, + resolved: Variable$1, + }, + ], + isValueVariable: true, + isTypeVariable: true, + }, + ], + scopes: Array [ + GlobalScope$1 { + block: Program$2, + isStrict: false, + references: Array [], + set: Map {}, + type: "global", + upper: null, + variables: Array [], + }, + ModuleScope$2 { + block: Program$2, + isStrict: true, + references: Array [ + Reference$1, + ], + set: Map { + "React" => Variable$1, + }, + type: "module", + upper: GlobalScope$1, + variables: Array [ + Variable$1, + ], + }, + ], +} +`; diff --git a/packages/scope-manager/tests/fixtures/jsx/factory/default-jsxPragma.tsx b/packages/scope-manager/tests/fixtures/jsx/factory/default-jsxPragma.tsx new file mode 100644 index 000000000000..bf3f50888853 --- /dev/null +++ b/packages/scope-manager/tests/fixtures/jsx/factory/default-jsxPragma.tsx @@ -0,0 +1,5 @@ +//// @sourceType = 'module' + +import React from 'react'; + +; diff --git a/packages/scope-manager/tests/fixtures/jsx/factory/default-jsxPragma.tsx.shot b/packages/scope-manager/tests/fixtures/jsx/factory/default-jsxPragma.tsx.shot new file mode 100644 index 000000000000..4c7c51c772e8 --- /dev/null +++ b/packages/scope-manager/tests/fixtures/jsx/factory/default-jsxPragma.tsx.shot @@ -0,0 +1,63 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`jsx factory default-jsxPragma 1`] = ` +ScopeManager { + variables: Array [ + Variable$1 { + defs: Array [ + ImportBindingDefinition$1 { + name: Identifier<"React">, + node: ImportDefaultSpecifier$1, + }, + ], + name: "React", + references: Array [ + Reference$1 { + identifier: Identifier<"React">, + isRead: true, + isTypeReference: false, + isValueReference: true, + isWrite: false, + resolved: Variable$1, + }, + ], + isValueVariable: true, + isTypeVariable: true, + }, + ], + scopes: Array [ + GlobalScope$1 { + block: Program$2, + isStrict: false, + references: Array [], + set: Map {}, + type: "global", + upper: null, + variables: Array [], + }, + ModuleScope$2 { + block: Program$2, + isStrict: true, + references: Array [ + Reference$1, + Reference$2 { + identifier: JSXIdentifier$3, + isRead: true, + isTypeReference: false, + isValueReference: true, + isWrite: false, + resolved: null, + }, + ], + set: Map { + "React" => Variable$1, + }, + type: "module", + upper: GlobalScope$1, + variables: Array [ + Variable$1, + ], + }, + ], +} +`; diff --git a/packages/scope-manager/tests/fixtures/jsx/factory/jsxFragmentName.tsx b/packages/scope-manager/tests/fixtures/jsx/factory/jsxFragmentName.tsx new file mode 100644 index 000000000000..22df1a693d41 --- /dev/null +++ b/packages/scope-manager/tests/fixtures/jsx/factory/jsxFragmentName.tsx @@ -0,0 +1,7 @@ +//// @sourceType = 'module' +//// @jsxFragmentName = 'Fragment' + +import React from 'react'; // should be unreferenced +import { Fragment } from 'preact'; + +<>; diff --git a/packages/scope-manager/tests/fixtures/jsx/factory/jsxFragmentName.tsx.shot b/packages/scope-manager/tests/fixtures/jsx/factory/jsxFragmentName.tsx.shot new file mode 100644 index 000000000000..8392610d9a68 --- /dev/null +++ b/packages/scope-manager/tests/fixtures/jsx/factory/jsxFragmentName.tsx.shot @@ -0,0 +1,79 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`jsx factory jsxFragmentName 1`] = ` +ScopeManager { + variables: Array [ + Variable$1 { + defs: Array [ + ImportBindingDefinition$1 { + name: Identifier<"React">, + node: ImportDefaultSpecifier$1, + }, + ], + name: "React", + references: Array [ + Reference$1 { + identifier: Identifier<"React">, + isRead: true, + isTypeReference: false, + isValueReference: true, + isWrite: false, + resolved: Variable$1, + }, + ], + isValueVariable: true, + isTypeVariable: true, + }, + Variable$2 { + defs: Array [ + ImportBindingDefinition$2 { + name: Identifier<"Fragment">, + node: ImportSpecifier$2, + }, + ], + name: "Fragment", + references: Array [ + Reference$2 { + identifier: Identifier<"Fragment">, + isRead: true, + isTypeReference: false, + isValueReference: true, + isWrite: false, + resolved: Variable$2, + }, + ], + isValueVariable: true, + isTypeVariable: true, + }, + ], + scopes: Array [ + GlobalScope$1 { + block: Program$3, + isStrict: false, + references: Array [], + set: Map {}, + type: "global", + upper: null, + variables: Array [], + }, + ModuleScope$2 { + block: Program$3, + isStrict: true, + references: Array [ + Reference$1, + Reference$2, + ], + set: Map { + "React" => Variable$1, + "Fragment" => Variable$2, + }, + type: "module", + upper: GlobalScope$1, + variables: Array [ + Variable$1, + Variable$2, + ], + }, + ], +} +`; diff --git a/packages/scope-manager/tests/fixtures/jsx/factory/jsxPragma-jsxFragmentName.tsx b/packages/scope-manager/tests/fixtures/jsx/factory/jsxPragma-jsxFragmentName.tsx new file mode 100644 index 000000000000..e4bd844170bf --- /dev/null +++ b/packages/scope-manager/tests/fixtures/jsx/factory/jsxPragma-jsxFragmentName.tsx @@ -0,0 +1,8 @@ +//// @sourceType = 'module' +//// @jsxPragma = 'h' +//// @jsxFragmentName = 'Fragment' + +import React from 'react'; // should be unreferenced +import { h, Fragment } from 'preact'; + +<>; diff --git a/packages/scope-manager/tests/fixtures/jsx/factory/jsxPragma-jsxFragmentName.tsx.shot b/packages/scope-manager/tests/fixtures/jsx/factory/jsxPragma-jsxFragmentName.tsx.shot new file mode 100644 index 000000000000..5dc43c1d89f7 --- /dev/null +++ b/packages/scope-manager/tests/fixtures/jsx/factory/jsxPragma-jsxFragmentName.tsx.shot @@ -0,0 +1,93 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`jsx factory jsxPragma-jsxFragmentName 1`] = ` +ScopeManager { + variables: Array [ + Variable$1 { + defs: Array [ + ImportBindingDefinition$1 { + name: Identifier<"React">, + node: ImportDefaultSpecifier$1, + }, + ], + name: "React", + references: Array [], + isValueVariable: true, + isTypeVariable: true, + }, + Variable$2 { + defs: Array [ + ImportBindingDefinition$2 { + name: Identifier<"h">, + node: ImportSpecifier$2, + }, + ], + name: "h", + references: Array [ + Reference$1 { + identifier: Identifier<"h">, + isRead: true, + isTypeReference: false, + isValueReference: true, + isWrite: false, + resolved: Variable$2, + }, + ], + isValueVariable: true, + isTypeVariable: true, + }, + Variable$3 { + defs: Array [ + ImportBindingDefinition$3 { + name: Identifier<"Fragment">, + node: ImportSpecifier$3, + }, + ], + name: "Fragment", + references: Array [ + Reference$2 { + identifier: Identifier<"Fragment">, + isRead: true, + isTypeReference: false, + isValueReference: true, + isWrite: false, + resolved: Variable$3, + }, + ], + isValueVariable: true, + isTypeVariable: true, + }, + ], + scopes: Array [ + GlobalScope$1 { + block: Program$4, + isStrict: false, + references: Array [], + set: Map {}, + type: "global", + upper: null, + variables: Array [], + }, + ModuleScope$2 { + block: Program$4, + isStrict: true, + references: Array [ + Reference$1, + Reference$2, + ], + set: Map { + "React" => Variable$1, + "h" => Variable$2, + "Fragment" => Variable$3, + }, + type: "module", + upper: GlobalScope$1, + variables: Array [ + Variable$1, + Variable$2, + Variable$3, + ], + }, + ], +} +`; diff --git a/packages/scope-manager/tests/fixtures/jsx/factory/jsxPragma.tsx b/packages/scope-manager/tests/fixtures/jsx/factory/jsxPragma.tsx new file mode 100644 index 000000000000..61a64b504b97 --- /dev/null +++ b/packages/scope-manager/tests/fixtures/jsx/factory/jsxPragma.tsx @@ -0,0 +1,7 @@ +//// @sourceType = 'module' +//// @jsxPragma = 'h' + +import React from 'react'; // should be unreferenced +import { h } from 'preact'; + +; diff --git a/packages/scope-manager/tests/fixtures/jsx/factory/jsxPragma.tsx.shot b/packages/scope-manager/tests/fixtures/jsx/factory/jsxPragma.tsx.shot new file mode 100644 index 000000000000..1fb48ba9b059 --- /dev/null +++ b/packages/scope-manager/tests/fixtures/jsx/factory/jsxPragma.tsx.shot @@ -0,0 +1,77 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`jsx factory jsxPragma 1`] = ` +ScopeManager { + variables: Array [ + Variable$1 { + defs: Array [ + ImportBindingDefinition$1 { + name: Identifier<"React">, + node: ImportDefaultSpecifier$1, + }, + ], + name: "React", + references: Array [], + isValueVariable: true, + isTypeVariable: true, + }, + Variable$2 { + defs: Array [ + ImportBindingDefinition$2 { + name: Identifier<"h">, + node: ImportSpecifier$2, + }, + ], + name: "h", + references: Array [ + Reference$1 { + identifier: Identifier<"h">, + isRead: true, + isTypeReference: false, + isValueReference: true, + isWrite: false, + resolved: Variable$2, + }, + ], + isValueVariable: true, + isTypeVariable: true, + }, + ], + scopes: Array [ + GlobalScope$1 { + block: Program$3, + isStrict: false, + references: Array [], + set: Map {}, + type: "global", + upper: null, + variables: Array [], + }, + ModuleScope$2 { + block: Program$3, + isStrict: true, + references: Array [ + Reference$1, + Reference$2 { + identifier: JSXIdentifier$4, + isRead: true, + isTypeReference: false, + isValueReference: true, + isWrite: false, + resolved: null, + }, + ], + set: Map { + "React" => Variable$1, + "h" => Variable$2, + }, + type: "module", + upper: GlobalScope$1, + variables: Array [ + Variable$1, + Variable$2, + ], + }, + ], +} +`; diff --git a/packages/scope-manager/tests/fixtures/jsx/fragment-children.tsx b/packages/scope-manager/tests/fixtures/jsx/fragment-children.tsx new file mode 100644 index 000000000000..eb4c293d13bd --- /dev/null +++ b/packages/scope-manager/tests/fixtures/jsx/fragment-children.tsx @@ -0,0 +1,3 @@ +const child = 1; + +<>{child}; diff --git a/packages/scope-manager/tests/fixtures/jsx/fragment-children.tsx.shot b/packages/scope-manager/tests/fixtures/jsx/fragment-children.tsx.shot new file mode 100644 index 000000000000..ada53e07e796 --- /dev/null +++ b/packages/scope-manager/tests/fixtures/jsx/fragment-children.tsx.shot @@ -0,0 +1,57 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`jsx fragment-children 1`] = ` +ScopeManager { + variables: Array [ + Variable$1 { + defs: Array [ + VariableDefinition$1 { + name: Identifier<"child">, + node: VariableDeclarator$1, + }, + ], + name: "child", + references: Array [ + Reference$1 { + identifier: Identifier<"child">, + init: true, + isRead: false, + isTypeReference: false, + isValueReference: true, + isWrite: true, + resolved: Variable$1, + writeExpr: Literal$2, + }, + Reference$2 { + identifier: Identifier<"child">, + isRead: true, + isTypeReference: false, + isValueReference: true, + isWrite: false, + resolved: Variable$1, + }, + ], + isValueVariable: true, + isTypeVariable: false, + }, + ], + scopes: Array [ + GlobalScope$1 { + block: Program$3, + isStrict: false, + references: Array [ + Reference$1, + Reference$2, + ], + set: Map { + "child" => Variable$1, + }, + type: "global", + upper: null, + variables: Array [ + Variable$1, + ], + }, + ], +} +`; diff --git a/packages/scope-manager/tests/fixtures/jsx/fragment.tsx b/packages/scope-manager/tests/fixtures/jsx/fragment.tsx new file mode 100644 index 000000000000..ef5e491259c3 --- /dev/null +++ b/packages/scope-manager/tests/fixtures/jsx/fragment.tsx @@ -0,0 +1 @@ +<>; diff --git a/packages/scope-manager/tests/fixtures/jsx/fragment.tsx.shot b/packages/scope-manager/tests/fixtures/jsx/fragment.tsx.shot new file mode 100644 index 000000000000..7bf20feb1aad --- /dev/null +++ b/packages/scope-manager/tests/fixtures/jsx/fragment.tsx.shot @@ -0,0 +1,18 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`jsx fragment 1`] = ` +ScopeManager { + variables: Array [], + scopes: Array [ + GlobalScope$1 { + block: Program$1, + isStrict: false, + references: Array [], + set: Map {}, + type: "global", + upper: null, + variables: Array [], + }, + ], +} +`; diff --git a/packages/scope-manager/tests/fixtures/jsx/generic-type-param.tsx b/packages/scope-manager/tests/fixtures/jsx/generic-type-param.tsx new file mode 100644 index 000000000000..af9a714e5ac4 --- /dev/null +++ b/packages/scope-manager/tests/fixtures/jsx/generic-type-param.tsx @@ -0,0 +1,3 @@ +type T = 1; + + />; diff --git a/packages/scope-manager/tests/fixtures/jsx/generic-type-param.tsx.shot b/packages/scope-manager/tests/fixtures/jsx/generic-type-param.tsx.shot new file mode 100644 index 000000000000..1ea1b8dbca3a --- /dev/null +++ b/packages/scope-manager/tests/fixtures/jsx/generic-type-param.tsx.shot @@ -0,0 +1,54 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`jsx generic-type-param 1`] = ` +ScopeManager { + variables: Array [ + Variable$1 { + defs: Array [ + TypeDefinition$1 { + name: Identifier<"T">, + node: TSTypeAliasDeclaration$1, + }, + ], + name: "T", + references: Array [ + Reference$2 { + identifier: Identifier<"T">, + isRead: true, + isTypeReference: true, + isValueReference: false, + isWrite: false, + resolved: Variable$1, + }, + ], + isValueVariable: false, + isTypeVariable: true, + }, + ], + scopes: Array [ + GlobalScope$1 { + block: Program$2, + isStrict: false, + references: Array [ + Reference$1 { + identifier: JSXIdentifier$3, + isRead: true, + isTypeReference: false, + isValueReference: true, + isWrite: false, + resolved: null, + }, + Reference$2, + ], + set: Map { + "T" => Variable$1, + }, + type: "global", + upper: null, + variables: Array [ + Variable$1, + ], + }, + ], +} +`; diff --git a/packages/scope-manager/tests/fixtures/jsx/text.tsx b/packages/scope-manager/tests/fixtures/jsx/text.tsx new file mode 100644 index 000000000000..a5bb8d61130c --- /dev/null +++ b/packages/scope-manager/tests/fixtures/jsx/text.tsx @@ -0,0 +1,2 @@ +const Foo = 1; // should be unreferenced +<>Foo; diff --git a/packages/scope-manager/tests/fixtures/jsx/text.tsx.shot b/packages/scope-manager/tests/fixtures/jsx/text.tsx.shot new file mode 100644 index 000000000000..b901d67292f1 --- /dev/null +++ b/packages/scope-manager/tests/fixtures/jsx/text.tsx.shot @@ -0,0 +1,48 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`jsx text 1`] = ` +ScopeManager { + variables: Array [ + Variable$1 { + defs: Array [ + VariableDefinition$1 { + name: Identifier<"Foo">, + node: VariableDeclarator$1, + }, + ], + name: "Foo", + references: Array [ + Reference$1 { + identifier: Identifier<"Foo">, + init: true, + isRead: false, + isTypeReference: false, + isValueReference: true, + isWrite: true, + resolved: Variable$1, + writeExpr: Literal$2, + }, + ], + isValueVariable: true, + isTypeVariable: false, + }, + ], + scopes: Array [ + GlobalScope$1 { + block: Program$3, + isStrict: false, + references: Array [ + Reference$1, + ], + set: Map { + "Foo" => Variable$1, + }, + type: "global", + upper: null, + variables: Array [ + Variable$1, + ], + }, + ], +} +`; diff --git a/packages/types/src/parser-options.ts b/packages/types/src/parser-options.ts index c9623688e169..898f6583ef66 100644 --- a/packages/types/src/parser-options.ts +++ b/packages/types/src/parser-options.ts @@ -28,6 +28,8 @@ interface ParserOptions { ecmaVersion?: EcmaVersion; // scope-manager specific + jsxPragma?: string; + jsxFragmentName?: string | null; lib?: Lib[]; // typescript-estree specific From bb3e9d66e3821f37633d8c8077d807418c3f6f18 Mon Sep 17 00:00:00 2001 From: Brad Zacher Date: Sat, 5 Sep 2020 21:07:52 -0700 Subject: [PATCH 14/22] docs(eslint-plugin): [no-redeclare] clearly document type/variable redeclare case (#2500) Addresses #2477 --- packages/eslint-plugin/docs/rules/no-redeclare.md | 10 ++++++++++ .../tests/rules/no-redeclare.test.ts | 15 +++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/packages/eslint-plugin/docs/rules/no-redeclare.md b/packages/eslint-plugin/docs/rules/no-redeclare.md index a794250d6f12..d9e7042447d3 100644 --- a/packages/eslint-plugin/docs/rules/no-redeclare.md +++ b/packages/eslint-plugin/docs/rules/no-redeclare.md @@ -66,4 +66,14 @@ function Baz() {} namespace Baz {} ``` +**Note:** Even with this option set to true, this rule will report if you name a type and a variable the same name. **_This is intentional_**. +Declaring a variable and a type and a variable the same is usually an accident, and it can lead to hard-to-understand code. +If you have a rare case where you're intentionally naming a type the same name as a variable, use a disable comment. For example: + +```ts +type something = string; +// eslint-disable-next-line @typescript-eslint/no-redeclare -- intentionally naming the variable the same as the type +const something = 2; +``` + Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/master/docs/rules/no-redeclare.md) diff --git a/packages/eslint-plugin/tests/rules/no-redeclare.test.ts b/packages/eslint-plugin/tests/rules/no-redeclare.test.ts index 5a91d1c9822f..f227c5ac8919 100644 --- a/packages/eslint-plugin/tests/rules/no-redeclare.test.ts +++ b/packages/eslint-plugin/tests/rules/no-redeclare.test.ts @@ -627,5 +627,20 @@ namespace A {} }, ], }, + { + code: ` +type something = string; +const something = 2; + `, + errors: [ + { + messageId: 'redeclared', + data: { + id: 'something', + }, + line: 3, + }, + ], + }, ], }); From eb3f6e39391d62ac424baa305a15e61806b2fd65 Mon Sep 17 00:00:00 2001 From: Brad Zacher Date: Sat, 5 Sep 2020 21:50:13 -0700 Subject: [PATCH 15/22] fix(scope-manager): add `const` as a global type variable (#2499) --- .../tests/eslint-rules/no-undef.test.ts | 4 + .../scope-manager/src/lib/dom.iterable.ts | 52 - packages/scope-manager/src/lib/dom.ts | 1317 ----------------- .../src/lib/es2015.collection.ts | 10 - packages/scope-manager/src/lib/es2015.core.ts | 12 - .../scope-manager/src/lib/es2015.generator.ts | 3 - .../scope-manager/src/lib/es2015.iterable.ts | 43 - .../scope-manager/src/lib/es2015.promise.ts | 1 - .../scope-manager/src/lib/es2015.proxy.ts | 2 - .../scope-manager/src/lib/es2015.reflect.ts | 1 - .../scope-manager/src/lib/es2015.symbol.ts | 1 - .../src/lib/es2015.symbol.wellknown.ts | 32 - .../src/lib/es2016.array.include.ts | 11 - packages/scope-manager/src/lib/es2017.intl.ts | 1 - .../scope-manager/src/lib/es2017.object.ts | 1 - .../src/lib/es2017.sharedmemory.ts | 4 - .../scope-manager/src/lib/es2017.string.ts | 1 - .../src/lib/es2017.typedarrays.ts | 9 - .../src/lib/es2018.asyncgenerator.ts | 3 - .../src/lib/es2018.asynciterable.ts | 4 - packages/scope-manager/src/lib/es2018.intl.ts | 1 - .../scope-manager/src/lib/es2018.promise.ts | 1 - .../scope-manager/src/lib/es2018.regexp.ts | 3 - .../scope-manager/src/lib/es2019.array.ts | 3 - .../scope-manager/src/lib/es2019.object.ts | 1 - .../scope-manager/src/lib/es2019.string.ts | 1 - .../scope-manager/src/lib/es2019.symbol.ts | 1 - .../scope-manager/src/lib/es2020.bigint.ts | 9 - packages/scope-manager/src/lib/es2020.intl.ts | 1 - .../scope-manager/src/lib/es2020.promise.ts | 4 - .../scope-manager/src/lib/es2020.string.ts | 1 - .../src/lib/es2020.symbol.wellknown.ts | 2 - packages/scope-manager/src/lib/es5.ts | 96 -- .../scope-manager/src/lib/esnext.array.ts | 3 - .../src/lib/esnext.asynciterable.ts | 4 - .../scope-manager/src/lib/esnext.bigint.ts | 9 - packages/scope-manager/src/lib/esnext.intl.ts | 1 - .../scope-manager/src/lib/esnext.promise.ts | 3 - .../scope-manager/src/lib/esnext.string.ts | 1 - .../scope-manager/src/lib/esnext.symbol.ts | 1 - packages/scope-manager/src/lib/scripthost.ts | 13 - packages/scope-manager/src/lib/webworker.ts | 411 ----- .../src/referencer/Referencer.ts | 8 + .../tests/eslint-scope/arguments.test.ts | 11 +- .../tests/eslint-scope/catch-scope.test.ts | 20 +- .../es6-arrow-function-expression.test.ts | 42 +- .../eslint-scope/es6-block-scope.test.ts | 64 +- .../tests/eslint-scope/es6-catch.test.ts | 23 +- .../tests/eslint-scope/es6-class.test.ts | 58 +- .../es6-default-parameters.test.ts | 53 +- .../es6-destructuring-assignments.test.ts | 393 ++--- .../tests/eslint-scope/es6-export.test.ts | 73 +- .../tests/eslint-scope/es6-import.test.ts | 51 +- .../eslint-scope/es6-iteration-scope.test.ts | 118 +- .../tests/eslint-scope/es6-new-target.test.ts | 11 +- .../tests/eslint-scope/es6-object.test.ts | 15 +- .../tests/eslint-scope/es6-rest-args.test.ts | 19 +- .../tests/eslint-scope/es6-super.test.ts | 21 +- .../tests/eslint-scope/es6-switch.test.ts | 11 +- .../eslint-scope/es6-template-literal.test.ts | 19 +- .../function-expression-name.test.ts | 12 +- .../eslint-scope/global-increment.test.ts | 9 +- .../tests/eslint-scope/global-return.test.ts | 26 +- .../implicit-global-reference.test.ts | 34 +- .../tests/eslint-scope/label.test.ts | 22 +- .../tests/eslint-scope/references.test.ts | 103 +- .../tests/eslint-scope/typescript.test.ts | 11 +- .../tests/eslint-scope/with-scope.test.ts | 15 +- .../fixtures/block/inherited-scope.ts.shot | 13 +- .../tests/fixtures/block/scope.ts.shot | 25 +- .../call-expression/call-expression.ts.shot | 25 +- .../call-expression/type-parameters1.ts.shot | 11 +- .../call-expression/type-parameters2.ts.shot | 11 +- .../fixtures/catch/inherited-scope.ts.shot | 19 +- .../tests/fixtures/catch/scope.ts.shot | 33 +- .../declaration/abstract-property.ts.shot | 21 +- .../class/declaration/abstract.ts.shot | 29 +- .../class/declaration/computed-member.ts.shot | 37 +- .../class/declaration/extends-generic.ts.shot | 39 +- .../class/declaration/extends.ts.shot | 29 +- .../declaration/generic-ref-extends.ts.shot | 21 +- .../generic-ref-implements.ts.shot | 21 +- .../class/declaration/generic.ts.shot | 25 +- .../declaration/implements-generic.ts.shot | 35 +- .../class/declaration/implements.ts.shot | 21 +- .../fixtures/class/declaration/method.ts.shot | 67 +- .../fixtures/class/declaration/new.ts.shot | 17 +- .../declaration/parameter-properties.ts.shot | 77 +- .../properties-type-annotation.ts.shot | 21 +- .../class/declaration/properties.ts.shot | 23 +- .../class/declaration/type-reference.ts.shot | 37 +- .../class/expression/computed-member.ts.shot | 33 +- .../fixtures/class/expression/extends.ts.shot | 25 +- .../fixtures/class/expression/method.ts.shot | 63 +- .../fixtures/class/expression/new.ts.shot | 13 +- .../expression/parameter-properties.ts.shot | 73 +- .../class/expression/properties.ts.shot | 17 +- .../expression/self-reference-super.ts.shot | 19 +- .../fixtures/decorators/accessor.ts.shot | 43 +- .../decorators/class-property.ts.shot | 29 +- .../tests/fixtures/decorators/class.ts.shot | 29 +- .../tests/fixtures/decorators/method.ts.shot | 35 +- .../decorators/parameter-property.ts.shot | 47 +- .../fixtures/decorators/parameter.ts.shot | 53 +- .../destructuring/array-assignment.ts.shot | 25 +- .../fixtures/destructuring/array.ts.shot | 51 +- .../destructuring/object-assignment.ts.shot | 13 +- .../fixtures/destructuring/object.ts.shot | 47 +- .../tests/fixtures/export/all.ts.shot | 12 +- .../fixtures/export/default-type.ts.shot | 17 +- .../tests/fixtures/export/default1.ts.shot | 21 +- .../tests/fixtures/export/default2.ts.shot | 19 +- .../tests/fixtures/export/default3.ts.shot | 12 +- .../tests/fixtures/export/default4.ts.shot | 15 +- .../tests/fixtures/export/equals1.ts.shot | 19 +- .../tests/fixtures/export/equals2.ts.shot | 12 +- .../tests/fixtures/export/named-dual.ts.shot | 13 +- .../fixtures/export/named-source1.ts.shot | 12 +- .../fixtures/export/named-source2.ts.shot | 12 +- .../tests/fixtures/export/named-type1.ts.shot | 15 +- .../tests/fixtures/export/named1.ts.shot | 17 +- .../tests/fixtures/export/named2-type.ts.shot | 17 +- .../tests/fixtures/export/named2.ts.shot | 19 +- .../tests/fixtures/export/named3-type.ts.shot | 17 +- .../tests/fixtures/export/named3.ts.shot | 19 +- .../tests/fixtures/export/type.ts.shot | 19 +- .../readable-ref-body-shadow.ts.shot | 29 +- .../default-params/readable-ref-const.ts.shot | 27 +- .../default-params/readable-ref-let.ts.shot | 25 +- .../readable-ref-nested-body-shadow.ts.shot | 37 +- .../readable-ref-nested.ts.shot | 31 +- .../readable-ref-param-shadow.ts.shot | 29 +- .../readable-ref-partial.ts.shot | 25 +- .../arrow/default-params/writable-ref.ts.shot | 23 +- .../functions/arrow/inherited-scope.ts.shot | 13 +- .../fixtures/functions/arrow/no-body.ts.shot | 17 +- .../fixtures/functions/arrow/params.ts.shot | 61 +- .../fixtures/functions/arrow/scope.ts.shot | 35 +- .../type-parameters/body-reference.ts.shot | 23 +- .../type-parameters/param-reference.ts.shot | 23 +- .../return-value-reference.ts.shot | 19 +- .../type-param-reference.ts.shot | 23 +- .../type-parameter-declaration.ts.shot | 23 +- .../arrow/type-predicate-asserts1.ts.shot | 19 +- .../arrow/type-predicate-asserts2.ts.shot | 25 +- .../functions/arrow/type-predicate1.ts.shot | 21 +- .../functions/arrow/type-predicate2.ts.shot | 27 +- .../readable-ref-body-shadow.ts.shot | 31 +- .../default-params/readable-ref-const.ts.shot | 29 +- .../default-params/readable-ref-let.ts.shot | 27 +- .../readable-ref-nested-body-shadow.ts.shot | 39 +- .../readable-ref-nested.ts.shot | 33 +- .../readable-ref-param-shadow.ts.shot | 31 +- .../readable-ref-partial.ts.shot | 27 +- .../default-params/writable-ref.ts.shot | 25 +- .../inherited-scope.ts.shot | 23 +- .../name-shadowed-in-body.ts.shot | 31 +- .../function-declaration/overload.ts.shot | 39 +- .../function-declaration/params.ts.shot | 69 +- .../function-declaration/scope.ts.shot | 37 +- .../type-parameters/body-reference.ts.shot | 25 +- .../type-parameters/param-reference.ts.shot | 25 +- .../return-value-reference.ts.shot | 21 +- .../type-param-reference.ts.shot | 25 +- .../type-parameter-declaration.ts.shot | 25 +- .../type-predicate-asserts1.ts.shot | 21 +- .../type-predicate-asserts2.ts.shot | 27 +- .../type-predicate1.ts.shot | 23 +- .../type-predicate2.ts.shot | 29 +- .../function-expression/anonymous.ts.shot | 17 +- .../readable-ref-body-shadow.ts.shot | 33 +- .../default-params/readable-ref-const.ts.shot | 31 +- .../default-params/readable-ref-let.ts.shot | 29 +- .../readable-ref-nested-body-shadow.ts.shot | 41 +- .../readable-ref-nested.ts.shot | 35 +- .../readable-ref-param-shadow.ts.shot | 33 +- .../readable-ref-partial.ts.shot | 29 +- .../default-params/writable-ref.ts.shot | 27 +- .../inherited-scope.ts.shot | 25 +- .../function-expression/params.ts.shot | 71 +- .../function-expression/scope.ts.shot | 39 +- .../type-parameters/body-reference.ts.shot | 27 +- .../type-parameters/param-reference.ts.shot | 27 +- .../return-value-reference.ts.shot | 23 +- .../type-param-reference.ts.shot | 27 +- .../type-parameter-declaration.ts.shot | 27 +- .../type-predicate-asserts1.ts.shot | 23 +- .../type-predicate-asserts2.ts.shot | 29 +- .../type-predicate1.ts.shot | 25 +- .../type-predicate2.ts.shot | 31 +- .../global-resolution/module/class.ts.shot | 23 +- .../global-resolution/module/function.ts.shot | 23 +- .../module/variable-decl-const.ts.shot | 19 +- .../module/variable-decl-let.ts.shot | 19 +- .../module/variable-decl-var.ts.shot | 19 +- .../global-resolution/script/class.ts.shot | 17 +- .../global-resolution/script/function.ts.shot | 17 +- .../script/variable-decl-const.ts.shot | 13 +- .../script/variable-decl-let.ts.shot | 13 +- .../script/variable-decl-var.ts.shot | 9 +- .../tests/fixtures/implicit/implicit1.ts.shot | 11 +- .../tests/fixtures/import/default.ts.shot | 23 +- .../tests/fixtures/import/equals1.ts.shot | 17 +- .../tests/fixtures/import/equals2.ts.shot | 23 +- .../tests/fixtures/import/named-alias.ts.shot | 23 +- .../tests/fixtures/import/named.ts.shot | 23 +- .../tests/fixtures/import/namespace.ts.shot | 23 +- .../import/type-default-value.ts.shot | 21 +- .../fixtures/import/type-default.ts.shot | 29 +- .../fixtures/import/type-named-value.ts.shot | 21 +- .../tests/fixtures/import/type-named.ts.shot | 29 +- .../fixtures/jsx/attribute-spread.tsx.shot | 13 +- .../tests/fixtures/jsx/attribute.tsx.shot | 19 +- .../tests/fixtures/jsx/children.tsx.shot | 13 +- .../jsx/component-namespaced.tsx.shot | 27 +- .../tests/fixtures/jsx/component.tsx.shot | 17 +- .../factory/default-jsxFragmentName.tsx.shot | 21 +- .../default-jsxPragma-fragment.tsx.shot | 17 +- .../jsx/factory/default-jsxPragma.tsx.shot | 17 +- .../jsx/factory/jsxFragmentName.tsx.shot | 23 +- .../jsxPragma-jsxFragmentName.tsx.shot | 27 +- .../fixtures/jsx/factory/jsxPragma.tsx.shot | 21 +- .../fixtures/jsx/fragment-children.tsx.shot | 13 +- .../tests/fixtures/jsx/fragment.tsx.shot | 12 +- .../fixtures/jsx/generic-type-param.tsx.shot | 11 +- .../tests/fixtures/jsx/text.tsx.shot | 11 +- .../member-expression.ts.shot | 21 +- .../new-expression/new-expression.ts.shot | 27 +- .../new-expression/type-parameters1.ts.shot | 11 +- .../new-expression/type-parameters2.ts.shot | 11 +- .../fixtures/ts-enum/external-ref.ts.shot | 21 +- .../ts-enum/literal-member-ref.ts.shot | 25 +- .../fixtures/ts-enum/literal-member.ts.shot | 19 +- .../tests/fixtures/ts-enum/member-ref.ts.shot | 25 +- .../tests/fixtures/ts-enum/scope.ts.shot | 27 +- .../tests/fixtures/ts-enum/self-ref.ts.shot | 25 +- .../class-namespace.ts.shot | 33 +- .../function-namespace.ts.shot | 33 +- .../namespace-variable.ts.shot | 19 +- .../fixtures/ts-module/external-ref.ts.shot | 19 +- .../tests/fixtures/ts-module/import.ts.shot | 15 +- .../ts-module/name-shadowed-in-body.ts.shot | 27 +- .../fixtures/ts-module/namespace.ts.shot | 29 +- .../tests/fixtures/ts-module/scope.ts.shot | 25 +- .../tests/fixtures/ts-module/self-ref.ts.shot | 19 +- .../parameter-array-destructure.ts.shot | 25 +- .../type-annotation/parameter-default.ts.shot | 27 +- .../parameter-object-destructure.ts.shot | 25 +- .../type-annotation/parameter-rest.ts.shot | 25 +- .../type-annotation/parameter.ts.shot | 25 +- .../variable-array-destructure.ts.shot | 17 +- .../type-annotation/variable-const.ts.shot | 17 +- .../type-annotation/variable-let.ts.shot | 15 +- .../variable-object-destructure.ts.shot | 17 +- .../type-annotation/variable-var.ts.shot | 15 +- .../type-assertion/angle-bracket.ts.shot | 19 +- .../tests/fixtures/type-assertion/as.ts.shot | 19 +- .../type-declaration/conditional1.ts.shot | 31 +- .../type-declaration/conditional2.ts.shot | 23 +- .../type-declaration/conditional3.ts.shot | 31 +- .../type-declaration/conditional4.ts.shot | 25 +- .../type-declaration/conditional5.ts.shot | 37 +- .../type-declaration/dual-type-value.ts.shot | 25 +- .../function/constructor-generics1.ts.shot | 29 +- .../function/constructor-generics2.ts.shot | 27 +- .../function/constructor.ts.shot | 23 +- .../function/function-generics1.ts.shot | 29 +- .../function/function-generics2.ts.shot | 27 +- .../function/function1.ts.shot | 23 +- .../function/function2.ts.shot | 23 +- .../function/params/array-pattern.ts.shot | 23 +- .../function/params/object-pattern.ts.shot | 23 +- .../function/params/rest-element.ts.shot | 23 +- .../type-declaration/index-access1.ts.shot | 15 +- .../type-declaration/index-access2.ts.shot | 21 +- .../type-declaration/index-access3.ts.shot | 23 +- .../interface-heritage1.ts.shot | 15 +- .../interface-heritage2.ts.shot | 27 +- .../type-declaration/interface1.ts.shot | 9 +- .../type-declaration/interface2.ts.shot | 15 +- .../fixtures/type-declaration/mapped.ts.shot | 23 +- .../type-declaration/qualified-name.ts.shot | 15 +- .../signatures/call-generics.ts.shot | 27 +- .../type-declaration/signatures/call.ts.shot | 23 +- .../signatures/construct-generics.ts.shot | 27 +- .../signatures/construct.ts.shot | 23 +- .../signatures/index-sig.ts.shot | 15 +- .../signatures/method-computed-name.ts.shot | 31 +- .../signatures/method-computed-name2.ts.shot | 27 +- .../signatures/method-generics.ts.shot | 27 +- .../signatures/method.ts.shot | 23 +- .../signatures/property-computed-name.ts.shot | 23 +- .../property-computed-name2.ts.shot | 27 +- .../signatures/property.ts.shot | 15 +- .../tuple-labelled-rest.ts.shot | 15 +- .../type-declaration/tuple-labelled.ts.shot | 21 +- .../type-declaration/tuple-rest.ts.shot | 15 +- .../fixtures/type-declaration/tuple.ts.shot | 15 +- .../interface/body-reference.ts.shot | 17 +- .../interface/extends-reference.ts.shot | 31 +- .../interface/type-param-reference.ts.shot | 21 +- ...type-parameter-declaration-extends.ts.shot | 21 +- .../type-parameter-declaration.ts.shot | 21 +- .../type-parameters/tagged-template.ts.shot | 39 +- .../type-decl/body-reference.ts.shot | 17 +- .../type-decl/type-param-reference.ts.shot | 21 +- ...type-parameter-declaration-extends.ts.shot | 21 +- .../type-parameter-declaration.ts.shot | 21 +- .../type-declaration/type-query.ts.shot | 21 +- .../fixtures/type-declaration/type1.ts.shot | 9 +- .../fixtures/type-declaration/type2.ts.shot | 15 +- .../fixtures/type-declaration/type3.ts.shot | 15 +- packages/scope-manager/tests/lib.test.ts | 4 +- .../tests/types/variable-definition.test.ts | 10 +- packages/scope-manager/tests/util/index.ts | 1 + packages/scope-manager/tests/util/misc.ts | 7 + .../tests/util/serializers/Variable.ts | 12 +- .../tests/util/serializers/baseSerializer.ts | 4 + .../tests/util/serializers/index.ts | 1 + packages/scope-manager/tools/generate-lib.ts | 1 - 320 files changed, 4209 insertions(+), 5163 deletions(-) create mode 100644 packages/scope-manager/tests/util/misc.ts diff --git a/packages/eslint-plugin/tests/eslint-rules/no-undef.test.ts b/packages/eslint-plugin/tests/eslint-rules/no-undef.test.ts index 7af6497c62a6..7e1d179e4073 100644 --- a/packages/eslint-plugin/tests/eslint-rules/no-undef.test.ts +++ b/packages/eslint-plugin/tests/eslint-rules/no-undef.test.ts @@ -199,6 +199,10 @@ function Foo() {} }, }, }, + // https://github.com/typescript-eslint/typescript-eslint/issues/2477 + ` +const x = 1 as const; + `, ], invalid: [ { diff --git a/packages/scope-manager/src/lib/dom.iterable.ts b/packages/scope-manager/src/lib/dom.iterable.ts index d6970cee99ad..2893ddae28ad 100644 --- a/packages/scope-manager/src/lib/dom.iterable.ts +++ b/packages/scope-manager/src/lib/dom.iterable.ts @@ -10,363 +10,311 @@ export const dom_iterable = { isTypeVariable: true, isValueVariable: false, name: 'AudioParam', - writeable: false, }, AudioParamMap: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'AudioParamMap', - writeable: false, }, BaseAudioContext: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'BaseAudioContext', - writeable: false, }, CSSRuleList: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'CSSRuleList', - writeable: false, }, CSSStyleDeclaration: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'CSSStyleDeclaration', - writeable: false, }, Cache: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'Cache', - writeable: false, }, CanvasPathDrawingStyles: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'CanvasPathDrawingStyles', - writeable: false, }, ClientRectList: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ClientRectList', - writeable: false, }, DOMRectList: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'DOMRectList', - writeable: false, }, DOMStringList: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'DOMStringList', - writeable: false, }, DOMTokenList: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'DOMTokenList', - writeable: false, }, DataTransferItemList: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'DataTransferItemList', - writeable: false, }, FileList: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'FileList', - writeable: false, }, FormData: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'FormData', - writeable: false, }, HTMLAllCollection: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'HTMLAllCollection', - writeable: false, }, HTMLCollectionBase: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'HTMLCollectionBase', - writeable: false, }, HTMLCollectionOf: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'HTMLCollectionOf', - writeable: false, }, HTMLFormElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'HTMLFormElement', - writeable: false, }, HTMLSelectElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'HTMLSelectElement', - writeable: false, }, Headers: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'Headers', - writeable: false, }, IDBObjectStore: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'IDBObjectStore', - writeable: false, }, MediaKeyStatusMap: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'MediaKeyStatusMap', - writeable: false, }, MediaList: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'MediaList', - writeable: false, }, MimeTypeArray: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'MimeTypeArray', - writeable: false, }, NamedNodeMap: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'NamedNodeMap', - writeable: false, }, Navigator: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'Navigator', - writeable: false, }, NodeList: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'NodeList', - writeable: false, }, NodeListOf: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'NodeListOf', - writeable: false, }, Plugin: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'Plugin', - writeable: false, }, PluginArray: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'PluginArray', - writeable: false, }, RTCRtpTransceiver: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RTCRtpTransceiver', - writeable: false, }, RTCStatsReport: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RTCStatsReport', - writeable: false, }, SVGLengthList: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'SVGLengthList', - writeable: false, }, SVGNumberList: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'SVGNumberList', - writeable: false, }, SVGPointList: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'SVGPointList', - writeable: false, }, SVGStringList: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'SVGStringList', - writeable: false, }, SourceBufferList: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'SourceBufferList', - writeable: false, }, SpeechGrammarList: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'SpeechGrammarList', - writeable: false, }, SpeechRecognitionResult: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'SpeechRecognitionResult', - writeable: false, }, SpeechRecognitionResultList: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'SpeechRecognitionResultList', - writeable: false, }, StyleSheetList: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'StyleSheetList', - writeable: false, }, TextTrackCueList: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'TextTrackCueList', - writeable: false, }, TextTrackList: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'TextTrackList', - writeable: false, }, TouchList: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'TouchList', - writeable: false, }, URLSearchParams: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'URLSearchParams', - writeable: false, }, VRDisplay: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'VRDisplay', - writeable: false, }, WEBGL_draw_buffers: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'WEBGL_draw_buffers', - writeable: false, }, WebAuthentication: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'WebAuthentication', - writeable: false, }, WebGL2RenderingContextBase: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'WebGL2RenderingContextBase', - writeable: false, }, WebGL2RenderingContextOverloads: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'WebGL2RenderingContextOverloads', - writeable: false, }, WebGLRenderingContextBase: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'WebGLRenderingContextBase', - writeable: false, }, WebGLRenderingContextOverloads: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'WebGLRenderingContextOverloads', - writeable: false, }, } as Record; diff --git a/packages/scope-manager/src/lib/dom.ts b/packages/scope-manager/src/lib/dom.ts index 6bbfd4d13b39..8f578d13349c 100644 --- a/packages/scope-manager/src/lib/dom.ts +++ b/packages/scope-manager/src/lib/dom.ts @@ -10,9218 +10,7901 @@ export const dom = { isTypeVariable: true, isValueVariable: false, name: 'Account', - writeable: false, }, AddEventListenerOptions: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'AddEventListenerOptions', - writeable: false, }, AesCbcParams: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'AesCbcParams', - writeable: false, }, AesCtrParams: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'AesCtrParams', - writeable: false, }, AesDerivedKeyParams: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'AesDerivedKeyParams', - writeable: false, }, AesGcmParams: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'AesGcmParams', - writeable: false, }, AesKeyAlgorithm: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'AesKeyAlgorithm', - writeable: false, }, AesKeyGenParams: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'AesKeyGenParams', - writeable: false, }, Algorithm: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'Algorithm', - writeable: false, }, AnalyserOptions: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'AnalyserOptions', - writeable: false, }, AnimationEventInit: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'AnimationEventInit', - writeable: false, }, AnimationPlaybackEventInit: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'AnimationPlaybackEventInit', - writeable: false, }, AssertionOptions: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'AssertionOptions', - writeable: false, }, AssignedNodesOptions: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'AssignedNodesOptions', - writeable: false, }, AudioBufferOptions: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'AudioBufferOptions', - writeable: false, }, AudioBufferSourceOptions: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'AudioBufferSourceOptions', - writeable: false, }, AudioContextInfo: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'AudioContextInfo', - writeable: false, }, AudioContextOptions: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'AudioContextOptions', - writeable: false, }, AudioNodeOptions: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'AudioNodeOptions', - writeable: false, }, AudioParamDescriptor: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'AudioParamDescriptor', - writeable: false, }, AudioProcessingEventInit: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'AudioProcessingEventInit', - writeable: false, }, AudioTimestamp: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'AudioTimestamp', - writeable: false, }, AudioWorkletNodeOptions: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'AudioWorkletNodeOptions', - writeable: false, }, AuthenticationExtensionsClientInputs: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'AuthenticationExtensionsClientInputs', - writeable: false, }, AuthenticationExtensionsClientOutputs: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'AuthenticationExtensionsClientOutputs', - writeable: false, }, AuthenticatorSelectionCriteria: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'AuthenticatorSelectionCriteria', - writeable: false, }, BiquadFilterOptions: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'BiquadFilterOptions', - writeable: false, }, BlobPropertyBag: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'BlobPropertyBag', - writeable: false, }, ByteLengthChunk: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ByteLengthChunk', - writeable: false, }, CacheQueryOptions: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'CacheQueryOptions', - writeable: false, }, CanvasRenderingContext2DSettings: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'CanvasRenderingContext2DSettings', - writeable: false, }, ChannelMergerOptions: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ChannelMergerOptions', - writeable: false, }, ChannelSplitterOptions: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ChannelSplitterOptions', - writeable: false, }, ClientData: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ClientData', - writeable: false, }, ClientQueryOptions: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ClientQueryOptions', - writeable: false, }, ClipboardEventInit: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ClipboardEventInit', - writeable: false, }, CloseEventInit: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'CloseEventInit', - writeable: false, }, CompositionEventInit: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'CompositionEventInit', - writeable: false, }, ComputedEffectTiming: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ComputedEffectTiming', - writeable: false, }, ComputedKeyframe: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ComputedKeyframe', - writeable: false, }, ConfirmSiteSpecificExceptionsInformation: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ConfirmSiteSpecificExceptionsInformation', - writeable: false, }, ConstantSourceOptions: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ConstantSourceOptions', - writeable: false, }, ConstrainBooleanParameters: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ConstrainBooleanParameters', - writeable: false, }, ConstrainDOMStringParameters: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ConstrainDOMStringParameters', - writeable: false, }, ConstrainDoubleRange: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ConstrainDoubleRange', - writeable: false, }, ConstrainULongRange: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ConstrainULongRange', - writeable: false, }, ConstrainVideoFacingModeParameters: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ConstrainVideoFacingModeParameters', - writeable: false, }, ConvolverOptions: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ConvolverOptions', - writeable: false, }, CredentialCreationOptions: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'CredentialCreationOptions', - writeable: false, }, CredentialRequestOptions: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'CredentialRequestOptions', - writeable: false, }, CustomEventInit: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'CustomEventInit', - writeable: false, }, DOMMatrix2DInit: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'DOMMatrix2DInit', - writeable: false, }, DOMMatrixInit: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'DOMMatrixInit', - writeable: false, }, DOMPointInit: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'DOMPointInit', - writeable: false, }, DOMQuadInit: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'DOMQuadInit', - writeable: false, }, DOMRectInit: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'DOMRectInit', - writeable: false, }, DelayOptions: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'DelayOptions', - writeable: false, }, DeviceLightEventInit: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'DeviceLightEventInit', - writeable: false, }, DeviceMotionEventAccelerationInit: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'DeviceMotionEventAccelerationInit', - writeable: false, }, DeviceMotionEventInit: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'DeviceMotionEventInit', - writeable: false, }, DeviceMotionEventRotationRateInit: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'DeviceMotionEventRotationRateInit', - writeable: false, }, DeviceOrientationEventInit: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'DeviceOrientationEventInit', - writeable: false, }, DevicePermissionDescriptor: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'DevicePermissionDescriptor', - writeable: false, }, DocumentTimelineOptions: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'DocumentTimelineOptions', - writeable: false, }, DoubleRange: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'DoubleRange', - writeable: false, }, DragEventInit: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'DragEventInit', - writeable: false, }, DynamicsCompressorOptions: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'DynamicsCompressorOptions', - writeable: false, }, EcKeyAlgorithm: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'EcKeyAlgorithm', - writeable: false, }, EcKeyGenParams: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'EcKeyGenParams', - writeable: false, }, EcKeyImportParams: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'EcKeyImportParams', - writeable: false, }, EcdhKeyDeriveParams: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'EcdhKeyDeriveParams', - writeable: false, }, EcdsaParams: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'EcdsaParams', - writeable: false, }, EffectTiming: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'EffectTiming', - writeable: false, }, ElementCreationOptions: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ElementCreationOptions', - writeable: false, }, ElementDefinitionOptions: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ElementDefinitionOptions', - writeable: false, }, ErrorEventInit: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ErrorEventInit', - writeable: false, }, EventInit: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'EventInit', - writeable: false, }, EventListenerOptions: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'EventListenerOptions', - writeable: false, }, EventModifierInit: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'EventModifierInit', - writeable: false, }, EventSourceInit: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'EventSourceInit', - writeable: false, }, ExceptionInformation: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ExceptionInformation', - writeable: false, }, FilePropertyBag: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'FilePropertyBag', - writeable: false, }, FocusEventInit: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'FocusEventInit', - writeable: false, }, FocusNavigationEventInit: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'FocusNavigationEventInit', - writeable: false, }, FocusNavigationOrigin: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'FocusNavigationOrigin', - writeable: false, }, FocusOptions: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'FocusOptions', - writeable: false, }, FullscreenOptions: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'FullscreenOptions', - writeable: false, }, GainOptions: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'GainOptions', - writeable: false, }, GamepadEventInit: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'GamepadEventInit', - writeable: false, }, GetNotificationOptions: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'GetNotificationOptions', - writeable: false, }, GetRootNodeOptions: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'GetRootNodeOptions', - writeable: false, }, HashChangeEventInit: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'HashChangeEventInit', - writeable: false, }, HkdfParams: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'HkdfParams', - writeable: false, }, HmacImportParams: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'HmacImportParams', - writeable: false, }, HmacKeyAlgorithm: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'HmacKeyAlgorithm', - writeable: false, }, HmacKeyGenParams: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'HmacKeyGenParams', - writeable: false, }, IDBIndexParameters: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'IDBIndexParameters', - writeable: false, }, IDBObjectStoreParameters: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'IDBObjectStoreParameters', - writeable: false, }, IDBVersionChangeEventInit: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'IDBVersionChangeEventInit', - writeable: false, }, IIRFilterOptions: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'IIRFilterOptions', - writeable: false, }, ImageBitmapOptions: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ImageBitmapOptions', - writeable: false, }, ImageBitmapRenderingContextSettings: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ImageBitmapRenderingContextSettings', - writeable: false, }, ImageEncodeOptions: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ImageEncodeOptions', - writeable: false, }, InputEventInit: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'InputEventInit', - writeable: false, }, IntersectionObserverEntryInit: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'IntersectionObserverEntryInit', - writeable: false, }, IntersectionObserverInit: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'IntersectionObserverInit', - writeable: false, }, JsonWebKey: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'JsonWebKey', - writeable: false, }, KeyAlgorithm: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'KeyAlgorithm', - writeable: false, }, KeyboardEventInit: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'KeyboardEventInit', - writeable: false, }, Keyframe: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'Keyframe', - writeable: false, }, KeyframeAnimationOptions: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'KeyframeAnimationOptions', - writeable: false, }, KeyframeEffectOptions: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'KeyframeEffectOptions', - writeable: false, }, MediaElementAudioSourceOptions: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'MediaElementAudioSourceOptions', - writeable: false, }, MediaEncryptedEventInit: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'MediaEncryptedEventInit', - writeable: false, }, MediaKeyMessageEventInit: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'MediaKeyMessageEventInit', - writeable: false, }, MediaKeySystemConfiguration: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'MediaKeySystemConfiguration', - writeable: false, }, MediaKeySystemMediaCapability: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'MediaKeySystemMediaCapability', - writeable: false, }, MediaQueryListEventInit: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'MediaQueryListEventInit', - writeable: false, }, MediaStreamAudioSourceOptions: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'MediaStreamAudioSourceOptions', - writeable: false, }, MediaStreamConstraints: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'MediaStreamConstraints', - writeable: false, }, MediaStreamErrorEventInit: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'MediaStreamErrorEventInit', - writeable: false, }, MediaStreamEventInit: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'MediaStreamEventInit', - writeable: false, }, MediaStreamTrackAudioSourceOptions: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'MediaStreamTrackAudioSourceOptions', - writeable: false, }, MediaStreamTrackEventInit: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'MediaStreamTrackEventInit', - writeable: false, }, MediaTrackCapabilities: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'MediaTrackCapabilities', - writeable: false, }, MediaTrackConstraintSet: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'MediaTrackConstraintSet', - writeable: false, }, MediaTrackConstraints: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'MediaTrackConstraints', - writeable: false, }, MediaTrackSettings: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'MediaTrackSettings', - writeable: false, }, MediaTrackSupportedConstraints: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'MediaTrackSupportedConstraints', - writeable: false, }, MessageEventInit: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'MessageEventInit', - writeable: false, }, MidiPermissionDescriptor: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'MidiPermissionDescriptor', - writeable: false, }, MouseEventInit: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'MouseEventInit', - writeable: false, }, MultiCacheQueryOptions: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'MultiCacheQueryOptions', - writeable: false, }, MutationObserverInit: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'MutationObserverInit', - writeable: false, }, NavigationPreloadState: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'NavigationPreloadState', - writeable: false, }, NotificationAction: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'NotificationAction', - writeable: false, }, NotificationOptions: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'NotificationOptions', - writeable: false, }, OfflineAudioCompletionEventInit: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'OfflineAudioCompletionEventInit', - writeable: false, }, OfflineAudioContextOptions: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'OfflineAudioContextOptions', - writeable: false, }, OptionalEffectTiming: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'OptionalEffectTiming', - writeable: false, }, OscillatorOptions: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'OscillatorOptions', - writeable: false, }, PageTransitionEventInit: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'PageTransitionEventInit', - writeable: false, }, PannerOptions: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'PannerOptions', - writeable: false, }, PaymentCurrencyAmount: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'PaymentCurrencyAmount', - writeable: false, }, PaymentDetailsBase: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'PaymentDetailsBase', - writeable: false, }, PaymentDetailsInit: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'PaymentDetailsInit', - writeable: false, }, PaymentDetailsModifier: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'PaymentDetailsModifier', - writeable: false, }, PaymentDetailsUpdate: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'PaymentDetailsUpdate', - writeable: false, }, PaymentItem: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'PaymentItem', - writeable: false, }, PaymentMethodData: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'PaymentMethodData', - writeable: false, }, PaymentOptions: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'PaymentOptions', - writeable: false, }, PaymentRequestUpdateEventInit: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'PaymentRequestUpdateEventInit', - writeable: false, }, PaymentShippingOption: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'PaymentShippingOption', - writeable: false, }, Pbkdf2Params: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'Pbkdf2Params', - writeable: false, }, PerformanceObserverInit: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'PerformanceObserverInit', - writeable: false, }, PeriodicWaveConstraints: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'PeriodicWaveConstraints', - writeable: false, }, PeriodicWaveOptions: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'PeriodicWaveOptions', - writeable: false, }, PermissionDescriptor: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'PermissionDescriptor', - writeable: false, }, PipeOptions: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'PipeOptions', - writeable: false, }, PointerEventInit: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'PointerEventInit', - writeable: false, }, PopStateEventInit: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'PopStateEventInit', - writeable: false, }, PositionOptions: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'PositionOptions', - writeable: false, }, PostMessageOptions: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'PostMessageOptions', - writeable: false, }, ProgressEventInit: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ProgressEventInit', - writeable: false, }, PromiseRejectionEventInit: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'PromiseRejectionEventInit', - writeable: false, }, PropertyIndexedKeyframes: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'PropertyIndexedKeyframes', - writeable: false, }, PublicKeyCredentialCreationOptions: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'PublicKeyCredentialCreationOptions', - writeable: false, }, PublicKeyCredentialDescriptor: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'PublicKeyCredentialDescriptor', - writeable: false, }, PublicKeyCredentialEntity: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'PublicKeyCredentialEntity', - writeable: false, }, PublicKeyCredentialParameters: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'PublicKeyCredentialParameters', - writeable: false, }, PublicKeyCredentialRequestOptions: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'PublicKeyCredentialRequestOptions', - writeable: false, }, PublicKeyCredentialRpEntity: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'PublicKeyCredentialRpEntity', - writeable: false, }, PublicKeyCredentialUserEntity: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'PublicKeyCredentialUserEntity', - writeable: false, }, PushPermissionDescriptor: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'PushPermissionDescriptor', - writeable: false, }, PushSubscriptionJSON: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'PushSubscriptionJSON', - writeable: false, }, PushSubscriptionOptionsInit: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'PushSubscriptionOptionsInit', - writeable: false, }, QueuingStrategy: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'QueuingStrategy', - writeable: false, }, RTCAnswerOptions: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RTCAnswerOptions', - writeable: false, }, RTCCertificateExpiration: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RTCCertificateExpiration', - writeable: false, }, RTCConfiguration: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RTCConfiguration', - writeable: false, }, RTCDTMFToneChangeEventInit: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RTCDTMFToneChangeEventInit', - writeable: false, }, RTCDataChannelEventInit: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RTCDataChannelEventInit', - writeable: false, }, RTCDataChannelInit: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RTCDataChannelInit', - writeable: false, }, RTCDtlsFingerprint: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RTCDtlsFingerprint', - writeable: false, }, RTCDtlsParameters: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RTCDtlsParameters', - writeable: false, }, RTCErrorEventInit: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RTCErrorEventInit', - writeable: false, }, RTCErrorInit: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RTCErrorInit', - writeable: false, }, RTCIceCandidateAttributes: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RTCIceCandidateAttributes', - writeable: false, }, RTCIceCandidateComplete: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RTCIceCandidateComplete', - writeable: false, }, RTCIceCandidateDictionary: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RTCIceCandidateDictionary', - writeable: false, }, RTCIceCandidateInit: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RTCIceCandidateInit', - writeable: false, }, RTCIceCandidatePair: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RTCIceCandidatePair', - writeable: false, }, RTCIceCandidatePairStats: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RTCIceCandidatePairStats', - writeable: false, }, RTCIceGatherOptions: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RTCIceGatherOptions', - writeable: false, }, RTCIceParameters: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RTCIceParameters', - writeable: false, }, RTCIceServer: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RTCIceServer', - writeable: false, }, RTCIdentityProviderOptions: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RTCIdentityProviderOptions', - writeable: false, }, RTCInboundRTPStreamStats: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RTCInboundRTPStreamStats', - writeable: false, }, RTCMediaStreamTrackStats: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RTCMediaStreamTrackStats', - writeable: false, }, RTCOAuthCredential: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RTCOAuthCredential', - writeable: false, }, RTCOfferAnswerOptions: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RTCOfferAnswerOptions', - writeable: false, }, RTCOfferOptions: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RTCOfferOptions', - writeable: false, }, RTCOutboundRTPStreamStats: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RTCOutboundRTPStreamStats', - writeable: false, }, RTCPeerConnectionIceErrorEventInit: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RTCPeerConnectionIceErrorEventInit', - writeable: false, }, RTCPeerConnectionIceEventInit: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RTCPeerConnectionIceEventInit', - writeable: false, }, RTCRTPStreamStats: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RTCRTPStreamStats', - writeable: false, }, RTCRtcpFeedback: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RTCRtcpFeedback', - writeable: false, }, RTCRtcpParameters: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RTCRtcpParameters', - writeable: false, }, RTCRtpCapabilities: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RTCRtpCapabilities', - writeable: false, }, RTCRtpCodecCapability: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RTCRtpCodecCapability', - writeable: false, }, RTCRtpCodecParameters: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RTCRtpCodecParameters', - writeable: false, }, RTCRtpCodingParameters: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RTCRtpCodingParameters', - writeable: false, }, RTCRtpContributingSource: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RTCRtpContributingSource', - writeable: false, }, RTCRtpDecodingParameters: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RTCRtpDecodingParameters', - writeable: false, }, RTCRtpEncodingParameters: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RTCRtpEncodingParameters', - writeable: false, }, RTCRtpFecParameters: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RTCRtpFecParameters', - writeable: false, }, RTCRtpHeaderExtension: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RTCRtpHeaderExtension', - writeable: false, }, RTCRtpHeaderExtensionCapability: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RTCRtpHeaderExtensionCapability', - writeable: false, }, RTCRtpHeaderExtensionParameters: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RTCRtpHeaderExtensionParameters', - writeable: false, }, RTCRtpParameters: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RTCRtpParameters', - writeable: false, }, RTCRtpReceiveParameters: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RTCRtpReceiveParameters', - writeable: false, }, RTCRtpRtxParameters: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RTCRtpRtxParameters', - writeable: false, }, RTCRtpSendParameters: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RTCRtpSendParameters', - writeable: false, }, RTCRtpSynchronizationSource: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RTCRtpSynchronizationSource', - writeable: false, }, RTCRtpTransceiverInit: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RTCRtpTransceiverInit', - writeable: false, }, RTCRtpUnhandled: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RTCRtpUnhandled', - writeable: false, }, RTCSessionDescriptionInit: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RTCSessionDescriptionInit', - writeable: false, }, RTCSrtpKeyParam: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RTCSrtpKeyParam', - writeable: false, }, RTCSrtpSdesParameters: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RTCSrtpSdesParameters', - writeable: false, }, RTCSsrcRange: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RTCSsrcRange', - writeable: false, }, RTCStats: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RTCStats', - writeable: false, }, RTCStatsEventInit: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RTCStatsEventInit', - writeable: false, }, RTCStatsReport: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'RTCStatsReport', - writeable: false, }, RTCTrackEventInit: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RTCTrackEventInit', - writeable: false, }, RTCTransportStats: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RTCTransportStats', - writeable: false, }, ReadableStreamReadDoneResult: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ReadableStreamReadDoneResult', - writeable: false, }, ReadableStreamReadValueResult: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ReadableStreamReadValueResult', - writeable: false, }, RegistrationOptions: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RegistrationOptions', - writeable: false, }, RequestInit: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RequestInit', - writeable: false, }, ResponseInit: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ResponseInit', - writeable: false, }, RsaHashedImportParams: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RsaHashedImportParams', - writeable: false, }, RsaHashedKeyAlgorithm: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RsaHashedKeyAlgorithm', - writeable: false, }, RsaHashedKeyGenParams: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RsaHashedKeyGenParams', - writeable: false, }, RsaKeyAlgorithm: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RsaKeyAlgorithm', - writeable: false, }, RsaKeyGenParams: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RsaKeyGenParams', - writeable: false, }, RsaOaepParams: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RsaOaepParams', - writeable: false, }, RsaOtherPrimesInfo: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RsaOtherPrimesInfo', - writeable: false, }, RsaPssParams: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RsaPssParams', - writeable: false, }, SVGBoundingBoxOptions: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'SVGBoundingBoxOptions', - writeable: false, }, ScopedCredentialDescriptor: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ScopedCredentialDescriptor', - writeable: false, }, ScopedCredentialOptions: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ScopedCredentialOptions', - writeable: false, }, ScopedCredentialParameters: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ScopedCredentialParameters', - writeable: false, }, ScrollIntoViewOptions: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ScrollIntoViewOptions', - writeable: false, }, ScrollOptions: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ScrollOptions', - writeable: false, }, ScrollToOptions: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ScrollToOptions', - writeable: false, }, SecurityPolicyViolationEventInit: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'SecurityPolicyViolationEventInit', - writeable: false, }, ServiceWorkerMessageEventInit: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ServiceWorkerMessageEventInit', - writeable: false, }, ShadowRootInit: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ShadowRootInit', - writeable: false, }, ShareData: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ShareData', - writeable: false, }, SpeechSynthesisErrorEventInit: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'SpeechSynthesisErrorEventInit', - writeable: false, }, SpeechSynthesisEventInit: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'SpeechSynthesisEventInit', - writeable: false, }, StaticRangeInit: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'StaticRangeInit', - writeable: false, }, StereoPannerOptions: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'StereoPannerOptions', - writeable: false, }, StorageEstimate: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'StorageEstimate', - writeable: false, }, StorageEventInit: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'StorageEventInit', - writeable: false, }, StoreExceptionsInformation: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'StoreExceptionsInformation', - writeable: false, }, StoreSiteSpecificExceptionsInformation: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'StoreSiteSpecificExceptionsInformation', - writeable: false, }, TextDecodeOptions: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'TextDecodeOptions', - writeable: false, }, TextDecoderOptions: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'TextDecoderOptions', - writeable: false, }, TextEncoderEncodeIntoResult: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'TextEncoderEncodeIntoResult', - writeable: false, }, TouchEventInit: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'TouchEventInit', - writeable: false, }, TouchInit: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'TouchInit', - writeable: false, }, TrackEventInit: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'TrackEventInit', - writeable: false, }, Transformer: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'Transformer', - writeable: false, }, TransitionEventInit: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'TransitionEventInit', - writeable: false, }, UIEventInit: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'UIEventInit', - writeable: false, }, ULongRange: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ULongRange', - writeable: false, }, UnderlyingByteSource: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'UnderlyingByteSource', - writeable: false, }, UnderlyingSink: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'UnderlyingSink', - writeable: false, }, UnderlyingSource: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'UnderlyingSource', - writeable: false, }, VRDisplayEventInit: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'VRDisplayEventInit', - writeable: false, }, VRLayer: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'VRLayer', - writeable: false, }, VRStageParameters: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'VRStageParameters', - writeable: false, }, WaveShaperOptions: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'WaveShaperOptions', - writeable: false, }, WebAuthnExtensions: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'WebAuthnExtensions', - writeable: false, }, WebGLContextAttributes: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'WebGLContextAttributes', - writeable: false, }, WebGLContextEventInit: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'WebGLContextEventInit', - writeable: false, }, WheelEventInit: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'WheelEventInit', - writeable: false, }, WorkerOptions: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'WorkerOptions', - writeable: false, }, WorkletOptions: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'WorkletOptions', - writeable: false, }, txAuthGenericArg: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'txAuthGenericArg', - writeable: false, }, EventListener: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'EventListener', - writeable: false, }, XPathNSResolver: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'XPathNSResolver', - writeable: false, }, ANGLE_instanced_arrays: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ANGLE_instanced_arrays', - writeable: false, }, AbortController: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'AbortController', - writeable: false, }, AbortSignalEventMap: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'AbortSignalEventMap', - writeable: false, }, AbortSignal: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'AbortSignal', - writeable: false, }, AbstractRange: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'AbstractRange', - writeable: false, }, AbstractWorkerEventMap: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'AbstractWorkerEventMap', - writeable: false, }, AbstractWorker: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'AbstractWorker', - writeable: false, }, AesCfbParams: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'AesCfbParams', - writeable: false, }, AesCmacParams: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'AesCmacParams', - writeable: false, }, AnalyserNode: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'AnalyserNode', - writeable: false, }, Animatable: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'Animatable', - writeable: false, }, AnimationEventMap: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'AnimationEventMap', - writeable: false, }, Animation: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'Animation', - writeable: false, }, AnimationEffect: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'AnimationEffect', - writeable: false, }, AnimationEvent: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'AnimationEvent', - writeable: false, }, AnimationFrameProvider: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'AnimationFrameProvider', - writeable: false, }, AnimationPlaybackEvent: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'AnimationPlaybackEvent', - writeable: false, }, AnimationTimeline: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'AnimationTimeline', - writeable: false, }, ApplicationCacheEventMap: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ApplicationCacheEventMap', - writeable: false, }, ApplicationCache: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'ApplicationCache', - writeable: false, }, Attr: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'Attr', - writeable: false, }, AudioBuffer: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'AudioBuffer', - writeable: false, }, AudioBufferSourceNode: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'AudioBufferSourceNode', - writeable: false, }, AudioContext: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'AudioContext', - writeable: false, }, AudioDestinationNode: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'AudioDestinationNode', - writeable: false, }, AudioListener: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'AudioListener', - writeable: false, }, AudioNode: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'AudioNode', - writeable: false, }, AudioParam: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'AudioParam', - writeable: false, }, AudioParamMap: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'AudioParamMap', - writeable: false, }, AudioProcessingEvent: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'AudioProcessingEvent', - writeable: false, }, AudioScheduledSourceNodeEventMap: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'AudioScheduledSourceNodeEventMap', - writeable: false, }, AudioScheduledSourceNode: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'AudioScheduledSourceNode', - writeable: false, }, AudioWorklet: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'AudioWorklet', - writeable: false, }, AudioWorkletNodeEventMap: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'AudioWorkletNodeEventMap', - writeable: false, }, AudioWorkletNode: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'AudioWorkletNode', - writeable: false, }, AuthenticatorAssertionResponse: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'AuthenticatorAssertionResponse', - writeable: false, }, AuthenticatorAttestationResponse: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'AuthenticatorAttestationResponse', - writeable: false, }, AuthenticatorResponse: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'AuthenticatorResponse', - writeable: false, }, BarProp: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'BarProp', - writeable: false, }, BaseAudioContextEventMap: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'BaseAudioContextEventMap', - writeable: false, }, BaseAudioContext: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'BaseAudioContext', - writeable: false, }, BeforeUnloadEvent: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'BeforeUnloadEvent', - writeable: false, }, BhxBrowser: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'BhxBrowser', - writeable: false, }, BiquadFilterNode: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'BiquadFilterNode', - writeable: false, }, Blob: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'Blob', - writeable: false, }, Body: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'Body', - writeable: false, }, BroadcastChannelEventMap: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'BroadcastChannelEventMap', - writeable: false, }, BroadcastChannel: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'BroadcastChannel', - writeable: false, }, ByteLengthQueuingStrategy: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'ByteLengthQueuingStrategy', - writeable: false, }, CDATASection: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'CDATASection', - writeable: false, }, CSSConditionRule: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'CSSConditionRule', - writeable: false, }, CSSFontFaceRule: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'CSSFontFaceRule', - writeable: false, }, CSSGroupingRule: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'CSSGroupingRule', - writeable: false, }, CSSImportRule: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'CSSImportRule', - writeable: false, }, CSSKeyframeRule: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'CSSKeyframeRule', - writeable: false, }, CSSKeyframesRule: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'CSSKeyframesRule', - writeable: false, }, CSSMediaRule: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'CSSMediaRule', - writeable: false, }, CSSNamespaceRule: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'CSSNamespaceRule', - writeable: false, }, CSSPageRule: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'CSSPageRule', - writeable: false, }, CSSRule: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'CSSRule', - writeable: false, }, CSSRuleList: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'CSSRuleList', - writeable: false, }, CSSStyleDeclaration: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'CSSStyleDeclaration', - writeable: false, }, CSSStyleRule: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'CSSStyleRule', - writeable: false, }, CSSStyleSheet: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'CSSStyleSheet', - writeable: false, }, CSSSupportsRule: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'CSSSupportsRule', - writeable: false, }, Cache: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'Cache', - writeable: false, }, CacheStorage: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'CacheStorage', - writeable: false, }, CanvasCompositing: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'CanvasCompositing', - writeable: false, }, CanvasDrawImage: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'CanvasDrawImage', - writeable: false, }, CanvasDrawPath: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'CanvasDrawPath', - writeable: false, }, CanvasFillStrokeStyles: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'CanvasFillStrokeStyles', - writeable: false, }, CanvasFilters: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'CanvasFilters', - writeable: false, }, CanvasGradient: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'CanvasGradient', - writeable: false, }, CanvasImageData: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'CanvasImageData', - writeable: false, }, CanvasImageSmoothing: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'CanvasImageSmoothing', - writeable: false, }, CanvasPath: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'CanvasPath', - writeable: false, }, CanvasPathDrawingStyles: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'CanvasPathDrawingStyles', - writeable: false, }, CanvasPattern: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'CanvasPattern', - writeable: false, }, CanvasRect: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'CanvasRect', - writeable: false, }, CanvasRenderingContext2D: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'CanvasRenderingContext2D', - writeable: false, }, CanvasShadowStyles: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'CanvasShadowStyles', - writeable: false, }, CanvasState: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'CanvasState', - writeable: false, }, CanvasText: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'CanvasText', - writeable: false, }, CanvasTextDrawingStyles: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'CanvasTextDrawingStyles', - writeable: false, }, CanvasTransform: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'CanvasTransform', - writeable: false, }, CanvasUserInterface: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'CanvasUserInterface', - writeable: false, }, CaretPosition: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'CaretPosition', - writeable: false, }, ChannelMergerNode: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'ChannelMergerNode', - writeable: false, }, ChannelSplitterNode: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'ChannelSplitterNode', - writeable: false, }, CharacterData: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'CharacterData', - writeable: false, }, ChildNode: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ChildNode', - writeable: false, }, ClientRect: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'ClientRect', - writeable: false, }, ClientRectList: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'ClientRectList', - writeable: false, }, Clipboard: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'Clipboard', - writeable: false, }, ClipboardEvent: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'ClipboardEvent', - writeable: false, }, CloseEvent: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'CloseEvent', - writeable: false, }, Comment: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'Comment', - writeable: false, }, CompositionEvent: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'CompositionEvent', - writeable: false, }, ConcatParams: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ConcatParams', - writeable: false, }, ConstantSourceNode: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'ConstantSourceNode', - writeable: false, }, ConvolverNode: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'ConvolverNode', - writeable: false, }, Coordinates: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'Coordinates', - writeable: false, }, CountQueuingStrategy: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'CountQueuingStrategy', - writeable: false, }, Credential: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'Credential', - writeable: false, }, CredentialsContainer: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'CredentialsContainer', - writeable: false, }, Crypto: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'Crypto', - writeable: false, }, CryptoKey: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'CryptoKey', - writeable: false, }, CryptoKeyPair: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'CryptoKeyPair', - writeable: false, }, CustomElementRegistry: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'CustomElementRegistry', - writeable: false, }, CustomEvent: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'CustomEvent', - writeable: false, }, DOMError: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'DOMError', - writeable: false, }, DOMException: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'DOMException', - writeable: false, }, DOMImplementation: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'DOMImplementation', - writeable: false, }, DOML2DeprecatedColorProperty: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'DOML2DeprecatedColorProperty', - writeable: false, }, DOMMatrix: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'DOMMatrix', - writeable: false, }, SVGMatrix: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGMatrix', - writeable: false, }, WebKitCSSMatrix: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'WebKitCSSMatrix', - writeable: false, }, DOMMatrixReadOnly: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'DOMMatrixReadOnly', - writeable: false, }, DOMParser: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'DOMParser', - writeable: false, }, DOMPoint: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'DOMPoint', - writeable: false, }, SVGPoint: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGPoint', - writeable: false, }, DOMPointReadOnly: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'DOMPointReadOnly', - writeable: false, }, DOMQuad: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'DOMQuad', - writeable: false, }, DOMRect: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'DOMRect', - writeable: false, }, SVGRect: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGRect', - writeable: false, }, DOMRectList: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'DOMRectList', - writeable: false, }, DOMRectReadOnly: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'DOMRectReadOnly', - writeable: false, }, DOMSettableTokenList: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'DOMSettableTokenList', - writeable: false, }, DOMStringList: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'DOMStringList', - writeable: false, }, DOMStringMap: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'DOMStringMap', - writeable: false, }, DOMTokenList: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'DOMTokenList', - writeable: false, }, DataCue: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'DataCue', - writeable: false, }, DataTransfer: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'DataTransfer', - writeable: false, }, DataTransferItem: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'DataTransferItem', - writeable: false, }, DataTransferItemList: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'DataTransferItemList', - writeable: false, }, DeferredPermissionRequest: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'DeferredPermissionRequest', - writeable: false, }, DelayNode: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'DelayNode', - writeable: false, }, DeviceAcceleration: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'DeviceAcceleration', - writeable: false, }, DeviceLightEvent: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'DeviceLightEvent', - writeable: false, }, DeviceMotionEvent: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'DeviceMotionEvent', - writeable: false, }, DeviceMotionEventAcceleration: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'DeviceMotionEventAcceleration', - writeable: false, }, DeviceMotionEventRotationRate: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'DeviceMotionEventRotationRate', - writeable: false, }, DeviceOrientationEvent: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'DeviceOrientationEvent', - writeable: false, }, DeviceRotationRate: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'DeviceRotationRate', - writeable: false, }, DhImportKeyParams: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'DhImportKeyParams', - writeable: false, }, DhKeyAlgorithm: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'DhKeyAlgorithm', - writeable: false, }, DhKeyDeriveParams: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'DhKeyDeriveParams', - writeable: false, }, DhKeyGenParams: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'DhKeyGenParams', - writeable: false, }, DocumentEventMap: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'DocumentEventMap', - writeable: false, }, Document: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'Document', - writeable: false, }, DocumentAndElementEventHandlersEventMap: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'DocumentAndElementEventHandlersEventMap', - writeable: false, }, DocumentAndElementEventHandlers: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'DocumentAndElementEventHandlers', - writeable: false, }, DocumentEvent: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'DocumentEvent', - writeable: false, }, DocumentFragment: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'DocumentFragment', - writeable: false, }, DocumentOrShadowRoot: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'DocumentOrShadowRoot', - writeable: false, }, DocumentTimeline: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'DocumentTimeline', - writeable: false, }, DocumentType: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'DocumentType', - writeable: false, }, DragEvent: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'DragEvent', - writeable: false, }, DynamicsCompressorNode: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'DynamicsCompressorNode', - writeable: false, }, EXT_blend_minmax: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'EXT_blend_minmax', - writeable: false, }, EXT_frag_depth: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'EXT_frag_depth', - writeable: false, }, EXT_sRGB: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'EXT_sRGB', - writeable: false, }, EXT_shader_texture_lod: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'EXT_shader_texture_lod', - writeable: false, }, EXT_texture_filter_anisotropic: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'EXT_texture_filter_anisotropic', - writeable: false, }, ElementEventMap: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ElementEventMap', - writeable: false, }, Element: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'Element', - writeable: false, }, ElementCSSInlineStyle: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ElementCSSInlineStyle', - writeable: false, }, ElementContentEditable: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ElementContentEditable', - writeable: false, }, ErrorEvent: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'ErrorEvent', - writeable: false, }, Event: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'Event', - writeable: false, }, EventListenerObject: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'EventListenerObject', - writeable: false, }, EventSourceEventMap: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'EventSourceEventMap', - writeable: false, }, EventSource: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'EventSource', - writeable: false, }, EventTarget: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'EventTarget', - writeable: false, }, ExtensionScriptApis: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'ExtensionScriptApis', - writeable: false, }, External: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'External', - writeable: false, }, File: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'File', - writeable: false, }, FileList: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'FileList', - writeable: false, }, FileReaderEventMap: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'FileReaderEventMap', - writeable: false, }, FileReader: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'FileReader', - writeable: false, }, FocusEvent: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'FocusEvent', - writeable: false, }, FocusNavigationEvent: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'FocusNavigationEvent', - writeable: false, }, FormData: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'FormData', - writeable: false, }, GainNode: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'GainNode', - writeable: false, }, Gamepad: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'Gamepad', - writeable: false, }, GamepadButton: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'GamepadButton', - writeable: false, }, GamepadEvent: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'GamepadEvent', - writeable: false, }, GamepadHapticActuator: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'GamepadHapticActuator', - writeable: false, }, GamepadPose: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'GamepadPose', - writeable: false, }, GenericTransformStream: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'GenericTransformStream', - writeable: false, }, Geolocation: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'Geolocation', - writeable: false, }, GlobalEventHandlersEventMap: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'GlobalEventHandlersEventMap', - writeable: false, }, GlobalEventHandlers: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'GlobalEventHandlers', - writeable: false, }, HTMLAllCollection: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'HTMLAllCollection', - writeable: false, }, HTMLAnchorElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'HTMLAnchorElement', - writeable: false, }, HTMLAppletElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'HTMLAppletElement', - writeable: false, }, HTMLAreaElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'HTMLAreaElement', - writeable: false, }, HTMLAudioElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'HTMLAudioElement', - writeable: false, }, HTMLBRElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'HTMLBRElement', - writeable: false, }, HTMLBaseElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'HTMLBaseElement', - writeable: false, }, HTMLBaseFontElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'HTMLBaseFontElement', - writeable: false, }, HTMLBodyElementEventMap: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'HTMLBodyElementEventMap', - writeable: false, }, HTMLBodyElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'HTMLBodyElement', - writeable: false, }, HTMLButtonElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'HTMLButtonElement', - writeable: false, }, HTMLCanvasElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'HTMLCanvasElement', - writeable: false, }, HTMLCollectionBase: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'HTMLCollectionBase', - writeable: false, }, HTMLCollection: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'HTMLCollection', - writeable: false, }, HTMLCollectionOf: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'HTMLCollectionOf', - writeable: false, }, HTMLDListElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'HTMLDListElement', - writeable: false, }, HTMLDataElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'HTMLDataElement', - writeable: false, }, HTMLDataListElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'HTMLDataListElement', - writeable: false, }, HTMLDetailsElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'HTMLDetailsElement', - writeable: false, }, HTMLDialogElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'HTMLDialogElement', - writeable: false, }, HTMLDirectoryElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'HTMLDirectoryElement', - writeable: false, }, HTMLDivElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'HTMLDivElement', - writeable: false, }, HTMLDocument: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'HTMLDocument', - writeable: false, }, HTMLElementEventMap: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'HTMLElementEventMap', - writeable: false, }, HTMLElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'HTMLElement', - writeable: false, }, HTMLEmbedElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'HTMLEmbedElement', - writeable: false, }, HTMLFieldSetElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'HTMLFieldSetElement', - writeable: false, }, HTMLFontElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'HTMLFontElement', - writeable: false, }, HTMLFormControlsCollection: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'HTMLFormControlsCollection', - writeable: false, }, HTMLFormElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'HTMLFormElement', - writeable: false, }, HTMLFrameElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'HTMLFrameElement', - writeable: false, }, HTMLFrameSetElementEventMap: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'HTMLFrameSetElementEventMap', - writeable: false, }, HTMLFrameSetElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'HTMLFrameSetElement', - writeable: false, }, HTMLHRElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'HTMLHRElement', - writeable: false, }, HTMLHeadElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'HTMLHeadElement', - writeable: false, }, HTMLHeadingElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'HTMLHeadingElement', - writeable: false, }, HTMLHtmlElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'HTMLHtmlElement', - writeable: false, }, HTMLHyperlinkElementUtils: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'HTMLHyperlinkElementUtils', - writeable: false, }, HTMLIFrameElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'HTMLIFrameElement', - writeable: false, }, HTMLImageElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'HTMLImageElement', - writeable: false, }, HTMLInputElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'HTMLInputElement', - writeable: false, }, HTMLLIElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'HTMLLIElement', - writeable: false, }, HTMLLabelElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'HTMLLabelElement', - writeable: false, }, HTMLLegendElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'HTMLLegendElement', - writeable: false, }, HTMLLinkElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'HTMLLinkElement', - writeable: false, }, HTMLMapElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'HTMLMapElement', - writeable: false, }, HTMLMarqueeElementEventMap: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'HTMLMarqueeElementEventMap', - writeable: false, }, HTMLMarqueeElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'HTMLMarqueeElement', - writeable: false, }, HTMLMediaElementEventMap: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'HTMLMediaElementEventMap', - writeable: false, }, HTMLMediaElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'HTMLMediaElement', - writeable: false, }, HTMLMenuElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'HTMLMenuElement', - writeable: false, }, HTMLMetaElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'HTMLMetaElement', - writeable: false, }, HTMLMeterElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'HTMLMeterElement', - writeable: false, }, HTMLModElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'HTMLModElement', - writeable: false, }, HTMLOListElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'HTMLOListElement', - writeable: false, }, HTMLObjectElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'HTMLObjectElement', - writeable: false, }, HTMLOptGroupElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'HTMLOptGroupElement', - writeable: false, }, HTMLOptionElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'HTMLOptionElement', - writeable: false, }, HTMLOptionsCollection: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'HTMLOptionsCollection', - writeable: false, }, HTMLOrSVGElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'HTMLOrSVGElement', - writeable: false, }, HTMLOutputElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'HTMLOutputElement', - writeable: false, }, HTMLParagraphElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'HTMLParagraphElement', - writeable: false, }, HTMLParamElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'HTMLParamElement', - writeable: false, }, HTMLPictureElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'HTMLPictureElement', - writeable: false, }, HTMLPreElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'HTMLPreElement', - writeable: false, }, HTMLProgressElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'HTMLProgressElement', - writeable: false, }, HTMLQuoteElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'HTMLQuoteElement', - writeable: false, }, HTMLScriptElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'HTMLScriptElement', - writeable: false, }, HTMLSelectElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'HTMLSelectElement', - writeable: false, }, HTMLSlotElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'HTMLSlotElement', - writeable: false, }, HTMLSourceElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'HTMLSourceElement', - writeable: false, }, HTMLSpanElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'HTMLSpanElement', - writeable: false, }, HTMLStyleElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'HTMLStyleElement', - writeable: false, }, HTMLTableCaptionElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'HTMLTableCaptionElement', - writeable: false, }, HTMLTableCellElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'HTMLTableCellElement', - writeable: false, }, HTMLTableColElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'HTMLTableColElement', - writeable: false, }, HTMLTableDataCellElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'HTMLTableDataCellElement', - writeable: false, }, HTMLTableElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'HTMLTableElement', - writeable: false, }, HTMLTableHeaderCellElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'HTMLTableHeaderCellElement', - writeable: false, }, HTMLTableRowElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'HTMLTableRowElement', - writeable: false, }, HTMLTableSectionElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'HTMLTableSectionElement', - writeable: false, }, HTMLTemplateElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'HTMLTemplateElement', - writeable: false, }, HTMLTextAreaElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'HTMLTextAreaElement', - writeable: false, }, HTMLTimeElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'HTMLTimeElement', - writeable: false, }, HTMLTitleElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'HTMLTitleElement', - writeable: false, }, HTMLTrackElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'HTMLTrackElement', - writeable: false, }, HTMLUListElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'HTMLUListElement', - writeable: false, }, HTMLUnknownElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'HTMLUnknownElement', - writeable: false, }, HTMLVideoElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'HTMLVideoElement', - writeable: false, }, HashChangeEvent: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'HashChangeEvent', - writeable: false, }, Headers: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'Headers', - writeable: false, }, History: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'History', - writeable: false, }, HkdfCtrParams: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'HkdfCtrParams', - writeable: false, }, IDBArrayKey: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'IDBArrayKey', - writeable: false, }, IDBCursor: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'IDBCursor', - writeable: false, }, IDBCursorWithValue: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'IDBCursorWithValue', - writeable: false, }, IDBDatabaseEventMap: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'IDBDatabaseEventMap', - writeable: false, }, IDBDatabase: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'IDBDatabase', - writeable: false, }, IDBFactory: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'IDBFactory', - writeable: false, }, IDBIndex: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'IDBIndex', - writeable: false, }, IDBKeyRange: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'IDBKeyRange', - writeable: false, }, IDBObjectStore: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'IDBObjectStore', - writeable: false, }, IDBOpenDBRequestEventMap: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'IDBOpenDBRequestEventMap', - writeable: false, }, IDBOpenDBRequest: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'IDBOpenDBRequest', - writeable: false, }, IDBRequestEventMap: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'IDBRequestEventMap', - writeable: false, }, IDBRequest: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'IDBRequest', - writeable: false, }, IDBTransactionEventMap: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'IDBTransactionEventMap', - writeable: false, }, IDBTransaction: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'IDBTransaction', - writeable: false, }, IDBVersionChangeEvent: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'IDBVersionChangeEvent', - writeable: false, }, IIRFilterNode: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'IIRFilterNode', - writeable: false, }, ImageBitmap: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'ImageBitmap', - writeable: false, }, ImageBitmapRenderingContext: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'ImageBitmapRenderingContext', - writeable: false, }, ImageData: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'ImageData', - writeable: false, }, InnerHTML: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'InnerHTML', - writeable: false, }, InputDeviceInfo: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'InputDeviceInfo', - writeable: false, }, InputEvent: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'InputEvent', - writeable: false, }, IntersectionObserver: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'IntersectionObserver', - writeable: false, }, IntersectionObserverEntry: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'IntersectionObserverEntry', - writeable: false, }, KeyboardEvent: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'KeyboardEvent', - writeable: false, }, KeyframeEffect: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'KeyframeEffect', - writeable: false, }, LinkStyle: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'LinkStyle', - writeable: false, }, ListeningStateChangedEvent: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'ListeningStateChangedEvent', - writeable: false, }, Location: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'Location', - writeable: false, }, MSAssertion: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'MSAssertion', - writeable: false, }, MSBlobBuilder: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'MSBlobBuilder', - writeable: false, }, MSFIDOCredentialAssertion: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'MSFIDOCredentialAssertion', - writeable: false, }, MSFIDOSignature: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'MSFIDOSignature', - writeable: false, }, MSFIDOSignatureAssertion: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'MSFIDOSignatureAssertion', - writeable: false, }, MSFileSaver: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'MSFileSaver', - writeable: false, }, MSGesture: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'MSGesture', - writeable: false, }, MSGestureEvent: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'MSGestureEvent', - writeable: false, }, MSGraphicsTrust: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'MSGraphicsTrust', - writeable: false, }, MSInputMethodContextEventMap: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'MSInputMethodContextEventMap', - writeable: false, }, MSInputMethodContext: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'MSInputMethodContext', - writeable: false, }, MSMediaKeyError: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'MSMediaKeyError', - writeable: false, }, MSMediaKeyMessageEvent: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'MSMediaKeyMessageEvent', - writeable: false, }, MSMediaKeyNeededEvent: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'MSMediaKeyNeededEvent', - writeable: false, }, MSMediaKeySession: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'MSMediaKeySession', - writeable: false, }, MSMediaKeys: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'MSMediaKeys', - writeable: false, }, MSNavigatorDoNotTrack: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'MSNavigatorDoNotTrack', - writeable: false, }, MSPointerEvent: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'MSPointerEvent', - writeable: false, }, MSStream: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'MSStream', - writeable: false, }, MediaDeviceInfo: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'MediaDeviceInfo', - writeable: false, }, MediaDevicesEventMap: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'MediaDevicesEventMap', - writeable: false, }, MediaDevices: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'MediaDevices', - writeable: false, }, MediaElementAudioSourceNode: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'MediaElementAudioSourceNode', - writeable: false, }, MediaEncryptedEvent: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'MediaEncryptedEvent', - writeable: false, }, MediaError: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'MediaError', - writeable: false, }, MediaKeyMessageEvent: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'MediaKeyMessageEvent', - writeable: false, }, MediaKeySessionEventMap: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'MediaKeySessionEventMap', - writeable: false, }, MediaKeySession: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'MediaKeySession', - writeable: false, }, MediaKeyStatusMap: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'MediaKeyStatusMap', - writeable: false, }, MediaKeySystemAccess: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'MediaKeySystemAccess', - writeable: false, }, MediaKeys: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'MediaKeys', - writeable: false, }, MediaList: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'MediaList', - writeable: false, }, MediaQueryListEventMap: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'MediaQueryListEventMap', - writeable: false, }, MediaQueryList: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'MediaQueryList', - writeable: false, }, MediaQueryListEvent: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'MediaQueryListEvent', - writeable: false, }, MediaSourceEventMap: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'MediaSourceEventMap', - writeable: false, }, MediaSource: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'MediaSource', - writeable: false, }, MediaStreamEventMap: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'MediaStreamEventMap', - writeable: false, }, MediaStream: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'MediaStream', - writeable: false, }, MediaStreamAudioDestinationNode: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'MediaStreamAudioDestinationNode', - writeable: false, }, MediaStreamAudioSourceNode: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'MediaStreamAudioSourceNode', - writeable: false, }, MediaStreamError: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'MediaStreamError', - writeable: false, }, MediaStreamErrorEvent: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'MediaStreamErrorEvent', - writeable: false, }, MediaStreamEvent: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'MediaStreamEvent', - writeable: false, }, MediaStreamTrackEventMap: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'MediaStreamTrackEventMap', - writeable: false, }, MediaStreamTrack: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'MediaStreamTrack', - writeable: false, }, MediaStreamTrackAudioSourceNode: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'MediaStreamTrackAudioSourceNode', - writeable: false, }, MediaStreamTrackEvent: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'MediaStreamTrackEvent', - writeable: false, }, MessageChannel: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'MessageChannel', - writeable: false, }, MessageEvent: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'MessageEvent', - writeable: false, }, MessagePortEventMap: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'MessagePortEventMap', - writeable: false, }, MessagePort: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'MessagePort', - writeable: false, }, MimeType: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'MimeType', - writeable: false, }, MimeTypeArray: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'MimeTypeArray', - writeable: false, }, MouseEvent: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'MouseEvent', - writeable: false, }, MutationEvent: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'MutationEvent', - writeable: false, }, MutationObserver: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'MutationObserver', - writeable: false, }, MutationRecord: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'MutationRecord', - writeable: false, }, NamedNodeMap: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'NamedNodeMap', - writeable: false, }, NavigationPreloadManager: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'NavigationPreloadManager', - writeable: false, }, Navigator: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'Navigator', - writeable: false, }, NavigatorAutomationInformation: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'NavigatorAutomationInformation', - writeable: false, }, NavigatorBeacon: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'NavigatorBeacon', - writeable: false, }, NavigatorConcurrentHardware: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'NavigatorConcurrentHardware', - writeable: false, }, NavigatorContentUtils: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'NavigatorContentUtils', - writeable: false, }, NavigatorCookies: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'NavigatorCookies', - writeable: false, }, NavigatorID: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'NavigatorID', - writeable: false, }, NavigatorLanguage: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'NavigatorLanguage', - writeable: false, }, NavigatorOnLine: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'NavigatorOnLine', - writeable: false, }, NavigatorPlugins: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'NavigatorPlugins', - writeable: false, }, NavigatorStorage: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'NavigatorStorage', - writeable: false, }, Node: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'Node', - writeable: false, }, NodeFilter: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'NodeFilter', - writeable: false, }, NodeIterator: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'NodeIterator', - writeable: false, }, NodeList: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'NodeList', - writeable: false, }, NodeListOf: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'NodeListOf', - writeable: false, }, NonDocumentTypeChildNode: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'NonDocumentTypeChildNode', - writeable: false, }, NonElementParentNode: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'NonElementParentNode', - writeable: false, }, NotificationEventMap: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'NotificationEventMap', - writeable: false, }, Notification: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'Notification', - writeable: false, }, OES_element_index_uint: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'OES_element_index_uint', - writeable: false, }, OES_standard_derivatives: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'OES_standard_derivatives', - writeable: false, }, OES_texture_float: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'OES_texture_float', - writeable: false, }, OES_texture_float_linear: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'OES_texture_float_linear', - writeable: false, }, OES_texture_half_float: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'OES_texture_half_float', - writeable: false, }, OES_texture_half_float_linear: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'OES_texture_half_float_linear', - writeable: false, }, OES_vertex_array_object: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'OES_vertex_array_object', - writeable: false, }, OfflineAudioCompletionEvent: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'OfflineAudioCompletionEvent', - writeable: false, }, OfflineAudioContextEventMap: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'OfflineAudioContextEventMap', - writeable: false, }, OfflineAudioContext: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'OfflineAudioContext', - writeable: false, }, OffscreenCanvas: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'OffscreenCanvas', - writeable: false, }, OffscreenCanvasRenderingContext2D: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'OffscreenCanvasRenderingContext2D', - writeable: false, }, OscillatorNode: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'OscillatorNode', - writeable: false, }, OverconstrainedError: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'OverconstrainedError', - writeable: false, }, OverflowEvent: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'OverflowEvent', - writeable: false, }, PageTransitionEvent: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'PageTransitionEvent', - writeable: false, }, PannerNode: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'PannerNode', - writeable: false, }, ParentNode: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ParentNode', - writeable: false, }, Path2D: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'Path2D', - writeable: false, }, PaymentAddress: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'PaymentAddress', - writeable: false, }, PaymentRequestEventMap: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'PaymentRequestEventMap', - writeable: false, }, PaymentRequest: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'PaymentRequest', - writeable: false, }, PaymentRequestUpdateEvent: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'PaymentRequestUpdateEvent', - writeable: false, }, PaymentResponse: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'PaymentResponse', - writeable: false, }, PerfWidgetExternal: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'PerfWidgetExternal', - writeable: false, }, PerformanceEventMap: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'PerformanceEventMap', - writeable: false, }, Performance: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'Performance', - writeable: false, }, PerformanceEntry: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'PerformanceEntry', - writeable: false, }, PerformanceMark: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'PerformanceMark', - writeable: false, }, PerformanceMeasure: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'PerformanceMeasure', - writeable: false, }, PerformanceNavigation: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'PerformanceNavigation', - writeable: false, }, PerformanceNavigationTiming: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'PerformanceNavigationTiming', - writeable: false, }, PerformanceObserver: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'PerformanceObserver', - writeable: false, }, PerformanceObserverEntryList: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'PerformanceObserverEntryList', - writeable: false, }, PerformanceResourceTiming: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'PerformanceResourceTiming', - writeable: false, }, PerformanceTiming: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'PerformanceTiming', - writeable: false, }, PeriodicWave: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'PeriodicWave', - writeable: false, }, PermissionRequest: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'PermissionRequest', - writeable: false, }, PermissionRequestedEvent: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'PermissionRequestedEvent', - writeable: false, }, PermissionStatusEventMap: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'PermissionStatusEventMap', - writeable: false, }, PermissionStatus: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'PermissionStatus', - writeable: false, }, Permissions: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'Permissions', - writeable: false, }, Plugin: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'Plugin', - writeable: false, }, PluginArray: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'PluginArray', - writeable: false, }, PointerEvent: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'PointerEvent', - writeable: false, }, PopStateEvent: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'PopStateEvent', - writeable: false, }, Position: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'Position', - writeable: false, }, PositionError: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'PositionError', - writeable: false, }, ProcessingInstruction: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'ProcessingInstruction', - writeable: false, }, ProgressEvent: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'ProgressEvent', - writeable: false, }, PromiseRejectionEvent: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'PromiseRejectionEvent', - writeable: false, }, PublicKeyCredential: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'PublicKeyCredential', - writeable: false, }, PushManager: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'PushManager', - writeable: false, }, PushSubscription: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'PushSubscription', - writeable: false, }, PushSubscriptionOptions: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'PushSubscriptionOptions', - writeable: false, }, RTCCertificate: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'RTCCertificate', - writeable: false, }, RTCDTMFSenderEventMap: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RTCDTMFSenderEventMap', - writeable: false, }, RTCDTMFSender: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'RTCDTMFSender', - writeable: false, }, RTCDTMFToneChangeEvent: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'RTCDTMFToneChangeEvent', - writeable: false, }, RTCDataChannelEventMap: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RTCDataChannelEventMap', - writeable: false, }, RTCDataChannel: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'RTCDataChannel', - writeable: false, }, RTCDataChannelEvent: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'RTCDataChannelEvent', - writeable: false, }, RTCDtlsTransportEventMap: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RTCDtlsTransportEventMap', - writeable: false, }, RTCDtlsTransport: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'RTCDtlsTransport', - writeable: false, }, RTCDtlsTransportStateChangedEvent: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'RTCDtlsTransportStateChangedEvent', - writeable: false, }, RTCDtmfSenderEventMap: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RTCDtmfSenderEventMap', - writeable: false, }, RTCDtmfSender: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'RTCDtmfSender', - writeable: false, }, RTCError: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'RTCError', - writeable: false, }, RTCErrorEvent: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'RTCErrorEvent', - writeable: false, }, RTCIceCandidate: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'RTCIceCandidate', - writeable: false, }, RTCIceCandidatePairChangedEvent: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'RTCIceCandidatePairChangedEvent', - writeable: false, }, RTCIceGathererEventMap: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RTCIceGathererEventMap', - writeable: false, }, RTCIceGatherer: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'RTCIceGatherer', - writeable: false, }, RTCIceGathererEvent: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'RTCIceGathererEvent', - writeable: false, }, RTCIceTransportEventMap: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RTCIceTransportEventMap', - writeable: false, }, RTCIceTransport: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'RTCIceTransport', - writeable: false, }, RTCIceTransportStateChangedEvent: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'RTCIceTransportStateChangedEvent', - writeable: false, }, RTCIdentityAssertion: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'RTCIdentityAssertion', - writeable: false, }, RTCPeerConnectionEventMap: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RTCPeerConnectionEventMap', - writeable: false, }, RTCPeerConnection: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'RTCPeerConnection', - writeable: false, }, RTCPeerConnectionIceErrorEvent: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'RTCPeerConnectionIceErrorEvent', - writeable: false, }, RTCPeerConnectionIceEvent: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'RTCPeerConnectionIceEvent', - writeable: false, }, RTCRtpReceiver: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'RTCRtpReceiver', - writeable: false, }, RTCRtpSender: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'RTCRtpSender', - writeable: false, }, RTCRtpTransceiver: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'RTCRtpTransceiver', - writeable: false, }, RTCSctpTransportEventMap: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RTCSctpTransportEventMap', - writeable: false, }, RTCSctpTransport: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'RTCSctpTransport', - writeable: false, }, RTCSessionDescription: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'RTCSessionDescription', - writeable: false, }, RTCSrtpSdesTransportEventMap: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RTCSrtpSdesTransportEventMap', - writeable: false, }, RTCSrtpSdesTransport: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'RTCSrtpSdesTransport', - writeable: false, }, RTCSsrcConflictEvent: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'RTCSsrcConflictEvent', - writeable: false, }, RTCStatsEvent: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'RTCStatsEvent', - writeable: false, }, RTCStatsProvider: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'RTCStatsProvider', - writeable: false, }, RTCTrackEvent: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'RTCTrackEvent', - writeable: false, }, RadioNodeList: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'RadioNodeList', - writeable: false, }, RandomSource: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'RandomSource', - writeable: false, }, Range: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'Range', - writeable: false, }, ReadableByteStreamController: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ReadableByteStreamController', - writeable: false, }, ReadableStream: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'ReadableStream', - writeable: false, }, ReadableStreamBYOBReader: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ReadableStreamBYOBReader', - writeable: false, }, ReadableStreamBYOBRequest: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ReadableStreamBYOBRequest', - writeable: false, }, ReadableStreamDefaultController: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ReadableStreamDefaultController', - writeable: false, }, ReadableStreamDefaultReader: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ReadableStreamDefaultReader', - writeable: false, }, ReadableStreamReader: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'ReadableStreamReader', - writeable: false, }, Request: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'Request', - writeable: false, }, Response: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'Response', - writeable: false, }, SVGAElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGAElement', - writeable: false, }, SVGAngle: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGAngle', - writeable: false, }, SVGAnimateElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGAnimateElement', - writeable: false, }, SVGAnimateMotionElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGAnimateMotionElement', - writeable: false, }, SVGAnimateTransformElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGAnimateTransformElement', - writeable: false, }, SVGAnimatedAngle: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGAnimatedAngle', - writeable: false, }, SVGAnimatedBoolean: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGAnimatedBoolean', - writeable: false, }, SVGAnimatedEnumeration: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGAnimatedEnumeration', - writeable: false, }, SVGAnimatedInteger: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGAnimatedInteger', - writeable: false, }, SVGAnimatedLength: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGAnimatedLength', - writeable: false, }, SVGAnimatedLengthList: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGAnimatedLengthList', - writeable: false, }, SVGAnimatedNumber: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGAnimatedNumber', - writeable: false, }, SVGAnimatedNumberList: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGAnimatedNumberList', - writeable: false, }, SVGAnimatedPoints: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'SVGAnimatedPoints', - writeable: false, }, SVGAnimatedPreserveAspectRatio: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGAnimatedPreserveAspectRatio', - writeable: false, }, SVGAnimatedRect: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGAnimatedRect', - writeable: false, }, SVGAnimatedString: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGAnimatedString', - writeable: false, }, SVGAnimatedTransformList: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGAnimatedTransformList', - writeable: false, }, SVGAnimationElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGAnimationElement', - writeable: false, }, SVGCircleElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGCircleElement', - writeable: false, }, SVGClipPathElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGClipPathElement', - writeable: false, }, SVGComponentTransferFunctionElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGComponentTransferFunctionElement', - writeable: false, }, SVGCursorElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGCursorElement', - writeable: false, }, SVGDefsElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGDefsElement', - writeable: false, }, SVGDescElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGDescElement', - writeable: false, }, SVGElementEventMap: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'SVGElementEventMap', - writeable: false, }, SVGElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGElement', - writeable: false, }, SVGElementInstance: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGElementInstance', - writeable: false, }, SVGElementInstanceList: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGElementInstanceList', - writeable: false, }, SVGEllipseElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGEllipseElement', - writeable: false, }, SVGFEBlendElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGFEBlendElement', - writeable: false, }, SVGFEColorMatrixElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGFEColorMatrixElement', - writeable: false, }, SVGFEComponentTransferElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGFEComponentTransferElement', - writeable: false, }, SVGFECompositeElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGFECompositeElement', - writeable: false, }, SVGFEConvolveMatrixElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGFEConvolveMatrixElement', - writeable: false, }, SVGFEDiffuseLightingElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGFEDiffuseLightingElement', - writeable: false, }, SVGFEDisplacementMapElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGFEDisplacementMapElement', - writeable: false, }, SVGFEDistantLightElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGFEDistantLightElement', - writeable: false, }, SVGFEDropShadowElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGFEDropShadowElement', - writeable: false, }, SVGFEFloodElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGFEFloodElement', - writeable: false, }, SVGFEFuncAElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGFEFuncAElement', - writeable: false, }, SVGFEFuncBElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGFEFuncBElement', - writeable: false, }, SVGFEFuncGElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGFEFuncGElement', - writeable: false, }, SVGFEFuncRElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGFEFuncRElement', - writeable: false, }, SVGFEGaussianBlurElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGFEGaussianBlurElement', - writeable: false, }, SVGFEImageElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGFEImageElement', - writeable: false, }, SVGFEMergeElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGFEMergeElement', - writeable: false, }, SVGFEMergeNodeElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGFEMergeNodeElement', - writeable: false, }, SVGFEMorphologyElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGFEMorphologyElement', - writeable: false, }, SVGFEOffsetElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGFEOffsetElement', - writeable: false, }, SVGFEPointLightElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGFEPointLightElement', - writeable: false, }, SVGFESpecularLightingElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGFESpecularLightingElement', - writeable: false, }, SVGFESpotLightElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGFESpotLightElement', - writeable: false, }, SVGFETileElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGFETileElement', - writeable: false, }, SVGFETurbulenceElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGFETurbulenceElement', - writeable: false, }, SVGFilterElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGFilterElement', - writeable: false, }, SVGFilterPrimitiveStandardAttributes: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'SVGFilterPrimitiveStandardAttributes', - writeable: false, }, SVGFitToViewBox: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'SVGFitToViewBox', - writeable: false, }, SVGForeignObjectElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGForeignObjectElement', - writeable: false, }, SVGGElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGGElement', - writeable: false, }, SVGGeometryElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGGeometryElement', - writeable: false, }, SVGGradientElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGGradientElement', - writeable: false, }, SVGGraphicsElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGGraphicsElement', - writeable: false, }, SVGImageElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGImageElement', - writeable: false, }, SVGLength: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGLength', - writeable: false, }, SVGLengthList: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGLengthList', - writeable: false, }, SVGLineElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGLineElement', - writeable: false, }, SVGLinearGradientElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGLinearGradientElement', - writeable: false, }, SVGMarkerElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGMarkerElement', - writeable: false, }, SVGMaskElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGMaskElement', - writeable: false, }, SVGMetadataElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGMetadataElement', - writeable: false, }, SVGNumber: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGNumber', - writeable: false, }, SVGNumberList: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGNumberList', - writeable: false, }, SVGPathElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGPathElement', - writeable: false, }, SVGPathSeg: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGPathSeg', - writeable: false, }, SVGPathSegArcAbs: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGPathSegArcAbs', - writeable: false, }, SVGPathSegArcRel: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGPathSegArcRel', - writeable: false, }, SVGPathSegClosePath: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGPathSegClosePath', - writeable: false, }, SVGPathSegCurvetoCubicAbs: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGPathSegCurvetoCubicAbs', - writeable: false, }, SVGPathSegCurvetoCubicRel: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGPathSegCurvetoCubicRel', - writeable: false, }, SVGPathSegCurvetoCubicSmoothAbs: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGPathSegCurvetoCubicSmoothAbs', - writeable: false, }, SVGPathSegCurvetoCubicSmoothRel: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGPathSegCurvetoCubicSmoothRel', - writeable: false, }, SVGPathSegCurvetoQuadraticAbs: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGPathSegCurvetoQuadraticAbs', - writeable: false, }, SVGPathSegCurvetoQuadraticRel: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGPathSegCurvetoQuadraticRel', - writeable: false, }, SVGPathSegCurvetoQuadraticSmoothAbs: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGPathSegCurvetoQuadraticSmoothAbs', - writeable: false, }, SVGPathSegCurvetoQuadraticSmoothRel: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGPathSegCurvetoQuadraticSmoothRel', - writeable: false, }, SVGPathSegLinetoAbs: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGPathSegLinetoAbs', - writeable: false, }, SVGPathSegLinetoHorizontalAbs: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGPathSegLinetoHorizontalAbs', - writeable: false, }, SVGPathSegLinetoHorizontalRel: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGPathSegLinetoHorizontalRel', - writeable: false, }, SVGPathSegLinetoRel: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGPathSegLinetoRel', - writeable: false, }, SVGPathSegLinetoVerticalAbs: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGPathSegLinetoVerticalAbs', - writeable: false, }, SVGPathSegLinetoVerticalRel: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGPathSegLinetoVerticalRel', - writeable: false, }, SVGPathSegList: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGPathSegList', - writeable: false, }, SVGPathSegMovetoAbs: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGPathSegMovetoAbs', - writeable: false, }, SVGPathSegMovetoRel: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGPathSegMovetoRel', - writeable: false, }, SVGPatternElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGPatternElement', - writeable: false, }, SVGPointList: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGPointList', - writeable: false, }, SVGPolygonElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGPolygonElement', - writeable: false, }, SVGPolylineElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGPolylineElement', - writeable: false, }, SVGPreserveAspectRatio: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGPreserveAspectRatio', - writeable: false, }, SVGRadialGradientElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGRadialGradientElement', - writeable: false, }, SVGRectElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGRectElement', - writeable: false, }, SVGSVGElementEventMap: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'SVGSVGElementEventMap', - writeable: false, }, SVGSVGElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGSVGElement', - writeable: false, }, SVGScriptElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGScriptElement', - writeable: false, }, SVGStopElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGStopElement', - writeable: false, }, SVGStringList: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGStringList', - writeable: false, }, SVGStyleElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGStyleElement', - writeable: false, }, SVGSwitchElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGSwitchElement', - writeable: false, }, SVGSymbolElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGSymbolElement', - writeable: false, }, SVGTSpanElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGTSpanElement', - writeable: false, }, SVGTests: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'SVGTests', - writeable: false, }, SVGTextContentElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGTextContentElement', - writeable: false, }, SVGTextElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGTextElement', - writeable: false, }, SVGTextPathElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGTextPathElement', - writeable: false, }, SVGTextPositioningElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGTextPositioningElement', - writeable: false, }, SVGTitleElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGTitleElement', - writeable: false, }, SVGTransform: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGTransform', - writeable: false, }, SVGTransformList: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGTransformList', - writeable: false, }, SVGURIReference: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'SVGURIReference', - writeable: false, }, SVGUnitTypes: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGUnitTypes', - writeable: false, }, SVGUseElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGUseElement', - writeable: false, }, SVGViewElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGViewElement', - writeable: false, }, SVGZoomAndPan: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGZoomAndPan', - writeable: false, }, SVGZoomEvent: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SVGZoomEvent', - writeable: false, }, ScopedCredential: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'ScopedCredential', - writeable: false, }, ScopedCredentialInfo: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'ScopedCredentialInfo', - writeable: false, }, Screen: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'Screen', - writeable: false, }, ScreenOrientationEventMap: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ScreenOrientationEventMap', - writeable: false, }, ScreenOrientation: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'ScreenOrientation', - writeable: false, }, ScriptProcessorNodeEventMap: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ScriptProcessorNodeEventMap', - writeable: false, }, ScriptProcessorNode: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'ScriptProcessorNode', - writeable: false, }, SecurityPolicyViolationEvent: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SecurityPolicyViolationEvent', - writeable: false, }, Selection: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'Selection', - writeable: false, }, ServiceUIFrameContext: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'ServiceUIFrameContext', - writeable: false, }, ServiceWorkerEventMap: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ServiceWorkerEventMap', - writeable: false, }, ServiceWorker: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'ServiceWorker', - writeable: false, }, ServiceWorkerContainerEventMap: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ServiceWorkerContainerEventMap', - writeable: false, }, ServiceWorkerContainer: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'ServiceWorkerContainer', - writeable: false, }, ServiceWorkerMessageEvent: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'ServiceWorkerMessageEvent', - writeable: false, }, ServiceWorkerRegistrationEventMap: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ServiceWorkerRegistrationEventMap', - writeable: false, }, ServiceWorkerRegistration: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'ServiceWorkerRegistration', - writeable: false, }, ShadowRoot: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'ShadowRoot', - writeable: false, }, SharedWorker: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SharedWorker', - writeable: false, }, Slottable: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'Slottable', - writeable: false, }, SourceBufferEventMap: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'SourceBufferEventMap', - writeable: false, }, SourceBuffer: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SourceBuffer', - writeable: false, }, SourceBufferListEventMap: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'SourceBufferListEventMap', - writeable: false, }, SourceBufferList: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SourceBufferList', - writeable: false, }, SpeechGrammar: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SpeechGrammar', - writeable: false, }, SpeechGrammarList: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SpeechGrammarList', - writeable: false, }, SpeechRecognitionEventMap: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'SpeechRecognitionEventMap', - writeable: false, }, SpeechRecognition: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SpeechRecognition', - writeable: false, }, SpeechRecognitionAlternative: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SpeechRecognitionAlternative', - writeable: false, }, SpeechRecognitionEvent: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SpeechRecognitionEvent', - writeable: false, }, SpeechRecognitionResult: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SpeechRecognitionResult', - writeable: false, }, SpeechRecognitionResultList: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SpeechRecognitionResultList', - writeable: false, }, SpeechSynthesisEventMap: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'SpeechSynthesisEventMap', - writeable: false, }, SpeechSynthesis: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SpeechSynthesis', - writeable: false, }, SpeechSynthesisErrorEvent: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SpeechSynthesisErrorEvent', - writeable: false, }, SpeechSynthesisEvent: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SpeechSynthesisEvent', - writeable: false, }, SpeechSynthesisUtteranceEventMap: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'SpeechSynthesisUtteranceEventMap', - writeable: false, }, SpeechSynthesisUtterance: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SpeechSynthesisUtterance', - writeable: false, }, SpeechSynthesisVoice: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SpeechSynthesisVoice', - writeable: false, }, StaticRange: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'StaticRange', - writeable: false, }, StereoPannerNode: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'StereoPannerNode', - writeable: false, }, Storage: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'Storage', - writeable: false, }, StorageEvent: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'StorageEvent', - writeable: false, }, StorageManager: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'StorageManager', - writeable: false, }, StyleMedia: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'StyleMedia', - writeable: false, }, StyleSheet: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'StyleSheet', - writeable: false, }, StyleSheetList: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'StyleSheetList', - writeable: false, }, SubtleCrypto: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SubtleCrypto', - writeable: false, }, SyncManager: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SyncManager', - writeable: false, }, Text: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'Text', - writeable: false, }, TextDecoder: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'TextDecoder', - writeable: false, }, TextDecoderCommon: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'TextDecoderCommon', - writeable: false, }, TextDecoderStream: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'TextDecoderStream', - writeable: false, }, TextEncoder: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'TextEncoder', - writeable: false, }, TextEncoderCommon: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'TextEncoderCommon', - writeable: false, }, TextEncoderStream: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'TextEncoderStream', - writeable: false, }, TextEvent: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'TextEvent', - writeable: false, }, TextMetrics: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'TextMetrics', - writeable: false, }, TextTrackEventMap: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'TextTrackEventMap', - writeable: false, }, TextTrack: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'TextTrack', - writeable: false, }, TextTrackCueEventMap: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'TextTrackCueEventMap', - writeable: false, }, TextTrackCue: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'TextTrackCue', - writeable: false, }, TextTrackCueList: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'TextTrackCueList', - writeable: false, }, TextTrackListEventMap: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'TextTrackListEventMap', - writeable: false, }, TextTrackList: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'TextTrackList', - writeable: false, }, TimeRanges: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'TimeRanges', - writeable: false, }, Touch: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'Touch', - writeable: false, }, TouchEvent: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'TouchEvent', - writeable: false, }, TouchList: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'TouchList', - writeable: false, }, TrackEvent: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'TrackEvent', - writeable: false, }, TransformStream: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'TransformStream', - writeable: false, }, TransformStreamDefaultController: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'TransformStreamDefaultController', - writeable: false, }, TransitionEvent: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'TransitionEvent', - writeable: false, }, TreeWalker: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'TreeWalker', - writeable: false, }, UIEvent: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'UIEvent', - writeable: false, }, URL: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'URL', - writeable: false, }, webkitURL: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'webkitURL', - writeable: false, }, URLSearchParams: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'URLSearchParams', - writeable: false, }, VRDisplay: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'VRDisplay', - writeable: false, }, VRDisplayCapabilities: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'VRDisplayCapabilities', - writeable: false, }, VRDisplayEvent: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'VRDisplayEvent', - writeable: false, }, VREyeParameters: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'VREyeParameters', - writeable: false, }, VRFieldOfView: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'VRFieldOfView', - writeable: false, }, VRFrameData: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'VRFrameData', - writeable: false, }, VRPose: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'VRPose', - writeable: false, }, VTTCue: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'VTTCue', - writeable: false, }, VTTRegion: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'VTTRegion', - writeable: false, }, ValidityState: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'ValidityState', - writeable: false, }, VideoPlaybackQuality: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'VideoPlaybackQuality', - writeable: false, }, VisualViewportEventMap: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'VisualViewportEventMap', - writeable: false, }, VisualViewport: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'VisualViewport', - writeable: false, }, WEBGL_color_buffer_float: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'WEBGL_color_buffer_float', - writeable: false, }, WEBGL_compressed_texture_astc: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'WEBGL_compressed_texture_astc', - writeable: false, }, WEBGL_compressed_texture_s3tc: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'WEBGL_compressed_texture_s3tc', - writeable: false, }, WEBGL_compressed_texture_s3tc_srgb: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'WEBGL_compressed_texture_s3tc_srgb', - writeable: false, }, WEBGL_debug_renderer_info: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'WEBGL_debug_renderer_info', - writeable: false, }, WEBGL_debug_shaders: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'WEBGL_debug_shaders', - writeable: false, }, WEBGL_depth_texture: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'WEBGL_depth_texture', - writeable: false, }, WEBGL_draw_buffers: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'WEBGL_draw_buffers', - writeable: false, }, WEBGL_lose_context: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'WEBGL_lose_context', - writeable: false, }, WaveShaperNode: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'WaveShaperNode', - writeable: false, }, WebAuthentication: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'WebAuthentication', - writeable: false, }, WebAuthnAssertion: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'WebAuthnAssertion', - writeable: false, }, WebGL2RenderingContext: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'WebGL2RenderingContext', - writeable: false, }, WebGL2RenderingContextBase: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'WebGL2RenderingContextBase', - writeable: false, }, WebGL2RenderingContextOverloads: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'WebGL2RenderingContextOverloads', - writeable: false, }, WebGLActiveInfo: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'WebGLActiveInfo', - writeable: false, }, WebGLBuffer: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'WebGLBuffer', - writeable: false, }, WebGLContextEvent: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'WebGLContextEvent', - writeable: false, }, WebGLFramebuffer: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'WebGLFramebuffer', - writeable: false, }, WebGLObject: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'WebGLObject', - writeable: false, }, WebGLProgram: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'WebGLProgram', - writeable: false, }, WebGLQuery: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'WebGLQuery', - writeable: false, }, WebGLRenderbuffer: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'WebGLRenderbuffer', - writeable: false, }, WebGLRenderingContext: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'WebGLRenderingContext', - writeable: false, }, WebGLRenderingContextBase: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'WebGLRenderingContextBase', - writeable: false, }, WebGLRenderingContextOverloads: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'WebGLRenderingContextOverloads', - writeable: false, }, WebGLSampler: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'WebGLSampler', - writeable: false, }, WebGLShader: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'WebGLShader', - writeable: false, }, WebGLShaderPrecisionFormat: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'WebGLShaderPrecisionFormat', - writeable: false, }, WebGLSync: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'WebGLSync', - writeable: false, }, WebGLTexture: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'WebGLTexture', - writeable: false, }, WebGLTransformFeedback: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'WebGLTransformFeedback', - writeable: false, }, WebGLUniformLocation: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'WebGLUniformLocation', - writeable: false, }, WebGLVertexArrayObject: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'WebGLVertexArrayObject', - writeable: false, }, WebGLVertexArrayObjectOES: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'WebGLVertexArrayObjectOES', - writeable: false, }, WebKitPoint: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'WebKitPoint', - writeable: false, }, WebSocketEventMap: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'WebSocketEventMap', - writeable: false, }, WebSocket: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'WebSocket', - writeable: false, }, WheelEvent: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'WheelEvent', - writeable: false, }, WindowEventMap: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'WindowEventMap', - writeable: false, }, Window: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'Window', - writeable: false, }, WindowEventHandlersEventMap: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'WindowEventHandlersEventMap', - writeable: false, }, WindowEventHandlers: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'WindowEventHandlers', - writeable: false, }, WindowLocalStorage: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'WindowLocalStorage', - writeable: false, }, WindowOrWorkerGlobalScope: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'WindowOrWorkerGlobalScope', - writeable: false, }, WindowSessionStorage: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'WindowSessionStorage', - writeable: false, }, WorkerEventMap: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'WorkerEventMap', - writeable: false, }, Worker: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'Worker', - writeable: false, }, Worklet: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'Worklet', - writeable: false, }, WritableStream: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'WritableStream', - writeable: false, }, WritableStreamDefaultController: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'WritableStreamDefaultController', - writeable: false, }, WritableStreamDefaultWriter: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'WritableStreamDefaultWriter', - writeable: false, }, XMLDocument: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'XMLDocument', - writeable: false, }, XMLHttpRequestEventMap: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'XMLHttpRequestEventMap', - writeable: false, }, XMLHttpRequest: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'XMLHttpRequest', - writeable: false, }, XMLHttpRequestEventTargetEventMap: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'XMLHttpRequestEventTargetEventMap', - writeable: false, }, XMLHttpRequestEventTarget: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'XMLHttpRequestEventTarget', - writeable: false, }, XMLHttpRequestUpload: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'XMLHttpRequestUpload', - writeable: false, }, XMLSerializer: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'XMLSerializer', - writeable: false, }, XPathEvaluator: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'XPathEvaluator', - writeable: false, }, XPathEvaluatorBase: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'XPathEvaluatorBase', - writeable: false, }, XPathExpression: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'XPathExpression', - writeable: false, }, XPathResult: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'XPathResult', - writeable: false, }, XSLTProcessor: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'XSLTProcessor', - writeable: false, }, webkitRTCPeerConnection: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'webkitRTCPeerConnection', - writeable: false, }, EventListenerOrEventListenerObject: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'EventListenerOrEventListenerObject', - writeable: false, }, Console: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'Console', - writeable: false, }, CSS: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'CSS', - writeable: false, }, WebAssembly: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'WebAssembly', - writeable: false, }, BlobCallback: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'BlobCallback', - writeable: false, }, CustomElementConstructor: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'CustomElementConstructor', - writeable: false, }, DecodeErrorCallback: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'DecodeErrorCallback', - writeable: false, }, DecodeSuccessCallback: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'DecodeSuccessCallback', - writeable: false, }, EventHandlerNonNull: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'EventHandlerNonNull', - writeable: false, }, ForEachCallback: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ForEachCallback', - writeable: false, }, FrameRequestCallback: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'FrameRequestCallback', - writeable: false, }, FunctionStringCallback: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'FunctionStringCallback', - writeable: false, }, IntersectionObserverCallback: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'IntersectionObserverCallback', - writeable: false, }, MSLaunchUriCallback: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'MSLaunchUriCallback', - writeable: false, }, MutationCallback: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'MutationCallback', - writeable: false, }, NavigatorUserMediaErrorCallback: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'NavigatorUserMediaErrorCallback', - writeable: false, }, NavigatorUserMediaSuccessCallback: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'NavigatorUserMediaSuccessCallback', - writeable: false, }, NotificationPermissionCallback: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'NotificationPermissionCallback', - writeable: false, }, OnBeforeUnloadEventHandlerNonNull: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'OnBeforeUnloadEventHandlerNonNull', - writeable: false, }, OnErrorEventHandlerNonNull: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'OnErrorEventHandlerNonNull', - writeable: false, }, PerformanceObserverCallback: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'PerformanceObserverCallback', - writeable: false, }, PositionCallback: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'PositionCallback', - writeable: false, }, PositionErrorCallback: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'PositionErrorCallback', - writeable: false, }, QueuingStrategySizeCallback: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'QueuingStrategySizeCallback', - writeable: false, }, RTCPeerConnectionErrorCallback: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RTCPeerConnectionErrorCallback', - writeable: false, }, RTCSessionDescriptionCallback: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RTCSessionDescriptionCallback', - writeable: false, }, RTCStatsCallback: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RTCStatsCallback', - writeable: false, }, ReadableByteStreamControllerCallback: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ReadableByteStreamControllerCallback', - writeable: false, }, ReadableStreamDefaultControllerCallback: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ReadableStreamDefaultControllerCallback', - writeable: false, }, ReadableStreamErrorCallback: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ReadableStreamErrorCallback', - writeable: false, }, TransformStreamDefaultControllerCallback: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'TransformStreamDefaultControllerCallback', - writeable: false, }, TransformStreamDefaultControllerTransformCallback: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'TransformStreamDefaultControllerTransformCallback', - writeable: false, }, VoidFunction: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'VoidFunction', - writeable: false, }, WritableStreamDefaultControllerCloseCallback: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'WritableStreamDefaultControllerCloseCallback', - writeable: false, }, WritableStreamDefaultControllerStartCallback: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'WritableStreamDefaultControllerStartCallback', - writeable: false, }, WritableStreamDefaultControllerWriteCallback: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'WritableStreamDefaultControllerWriteCallback', - writeable: false, }, WritableStreamErrorCallback: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'WritableStreamErrorCallback', - writeable: false, }, HTMLElementTagNameMap: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'HTMLElementTagNameMap', - writeable: false, }, HTMLElementDeprecatedTagNameMap: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'HTMLElementDeprecatedTagNameMap', - writeable: false, }, SVGElementTagNameMap: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'SVGElementTagNameMap', - writeable: false, }, ElementTagNameMap: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ElementTagNameMap', - writeable: false, }, HeadersInit: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'HeadersInit', - writeable: false, }, BodyInit: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'BodyInit', - writeable: false, }, RequestInfo: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RequestInfo', - writeable: false, }, BlobPart: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'BlobPart', - writeable: false, }, DOMHighResTimeStamp: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'DOMHighResTimeStamp', - writeable: false, }, RenderingContext: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RenderingContext', - writeable: false, }, HTMLOrSVGImageElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'HTMLOrSVGImageElement', - writeable: false, }, CanvasImageSource: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'CanvasImageSource', - writeable: false, }, OffscreenRenderingContext: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'OffscreenRenderingContext', - writeable: false, }, MessageEventSource: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'MessageEventSource', - writeable: false, }, HTMLOrSVGScriptElement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'HTMLOrSVGScriptElement', - writeable: false, }, ImageBitmapSource: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ImageBitmapSource', - writeable: false, }, MediaProvider: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'MediaProvider', - writeable: false, }, OnErrorEventHandler: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'OnErrorEventHandler', - writeable: false, }, OnBeforeUnloadEventHandler: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'OnBeforeUnloadEventHandler', - writeable: false, }, TimerHandler: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'TimerHandler', - writeable: false, }, ConstrainULong: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ConstrainULong', - writeable: false, }, ConstrainDouble: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ConstrainDouble', - writeable: false, }, ConstrainBoolean: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ConstrainBoolean', - writeable: false, }, ConstrainDOMString: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ConstrainDOMString', - writeable: false, }, PerformanceEntryList: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'PerformanceEntryList', - writeable: false, }, ReadableStreamReadResult: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ReadableStreamReadResult', - writeable: false, }, VibratePattern: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'VibratePattern', - writeable: false, }, COSEAlgorithmIdentifier: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'COSEAlgorithmIdentifier', - writeable: false, }, AuthenticatorSelectionList: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'AuthenticatorSelectionList', - writeable: false, }, AAGUID: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'AAGUID', - writeable: false, }, AuthenticationExtensionsSupported: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'AuthenticationExtensionsSupported', - writeable: false, }, UvmEntry: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'UvmEntry', - writeable: false, }, UvmEntries: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'UvmEntries', - writeable: false, }, AlgorithmIdentifier: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'AlgorithmIdentifier', - writeable: false, }, HashAlgorithmIdentifier: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'HashAlgorithmIdentifier', - writeable: false, }, BigInteger: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'BigInteger', - writeable: false, }, NamedCurve: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'NamedCurve', - writeable: false, }, GLenum: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'GLenum', - writeable: false, }, GLboolean: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'GLboolean', - writeable: false, }, GLbitfield: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'GLbitfield', - writeable: false, }, GLint: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'GLint', - writeable: false, }, GLsizei: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'GLsizei', - writeable: false, }, GLintptr: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'GLintptr', - writeable: false, }, GLsizeiptr: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'GLsizeiptr', - writeable: false, }, GLuint: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'GLuint', - writeable: false, }, GLfloat: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'GLfloat', - writeable: false, }, GLclampf: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'GLclampf', - writeable: false, }, TexImageSource: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'TexImageSource', - writeable: false, }, Float32List: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'Float32List', - writeable: false, }, Int32List: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'Int32List', - writeable: false, }, GLint64: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'GLint64', - writeable: false, }, GLuint64: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'GLuint64', - writeable: false, }, Uint32List: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'Uint32List', - writeable: false, }, BufferSource: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'BufferSource', - writeable: false, }, DOMTimeStamp: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'DOMTimeStamp', - writeable: false, }, LineAndPositionSetting: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'LineAndPositionSetting', - writeable: false, }, FormDataEntryValue: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'FormDataEntryValue', - writeable: false, }, InsertPosition: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'InsertPosition', - writeable: false, }, IDBValidKey: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'IDBValidKey', - writeable: false, }, MutationRecordType: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'MutationRecordType', - writeable: false, }, IDBKeyPath: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'IDBKeyPath', - writeable: false, }, Transferable: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'Transferable', - writeable: false, }, RTCIceGatherCandidate: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RTCIceGatherCandidate', - writeable: false, }, RTCTransport: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RTCTransport', - writeable: false, }, MouseWheelEvent: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'MouseWheelEvent', - writeable: false, }, WindowProxy: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'WindowProxy', - writeable: false, }, AlignSetting: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'AlignSetting', - writeable: false, }, AnimationPlayState: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'AnimationPlayState', - writeable: false, }, AppendMode: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'AppendMode', - writeable: false, }, AttestationConveyancePreference: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'AttestationConveyancePreference', - writeable: false, }, AudioContextLatencyCategory: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'AudioContextLatencyCategory', - writeable: false, }, AudioContextState: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'AudioContextState', - writeable: false, }, AuthenticatorAttachment: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'AuthenticatorAttachment', - writeable: false, }, AuthenticatorTransport: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'AuthenticatorTransport', - writeable: false, }, AutoKeyword: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'AutoKeyword', - writeable: false, }, AutomationRate: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'AutomationRate', - writeable: false, }, BinaryType: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'BinaryType', - writeable: false, }, BiquadFilterType: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'BiquadFilterType', - writeable: false, }, CanPlayTypeResult: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'CanPlayTypeResult', - writeable: false, }, CanvasDirection: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'CanvasDirection', - writeable: false, }, CanvasFillRule: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'CanvasFillRule', - writeable: false, }, CanvasLineCap: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'CanvasLineCap', - writeable: false, }, CanvasLineJoin: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'CanvasLineJoin', - writeable: false, }, CanvasTextAlign: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'CanvasTextAlign', - writeable: false, }, CanvasTextBaseline: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'CanvasTextBaseline', - writeable: false, }, ChannelCountMode: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ChannelCountMode', - writeable: false, }, ChannelInterpretation: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ChannelInterpretation', - writeable: false, }, ClientTypes: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ClientTypes', - writeable: false, }, ColorSpaceConversion: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ColorSpaceConversion', - writeable: false, }, CompositeOperation: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'CompositeOperation', - writeable: false, }, CompositeOperationOrAuto: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'CompositeOperationOrAuto', - writeable: false, }, CredentialMediationRequirement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'CredentialMediationRequirement', - writeable: false, }, DOMParserSupportedType: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'DOMParserSupportedType', - writeable: false, }, DirectionSetting: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'DirectionSetting', - writeable: false, }, DisplayCaptureSurfaceType: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'DisplayCaptureSurfaceType', - writeable: false, }, DistanceModelType: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'DistanceModelType', - writeable: false, }, DocumentReadyState: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'DocumentReadyState', - writeable: false, }, EndOfStreamError: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'EndOfStreamError', - writeable: false, }, EndingType: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'EndingType', - writeable: false, }, FillMode: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'FillMode', - writeable: false, }, FullscreenNavigationUI: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'FullscreenNavigationUI', - writeable: false, }, GamepadHand: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'GamepadHand', - writeable: false, }, GamepadHapticActuatorType: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'GamepadHapticActuatorType', - writeable: false, }, GamepadMappingType: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'GamepadMappingType', - writeable: false, }, IDBCursorDirection: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'IDBCursorDirection', - writeable: false, }, IDBRequestReadyState: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'IDBRequestReadyState', - writeable: false, }, IDBTransactionMode: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'IDBTransactionMode', - writeable: false, }, ImageOrientation: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ImageOrientation', - writeable: false, }, ImageSmoothingQuality: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ImageSmoothingQuality', - writeable: false, }, IterationCompositeOperation: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'IterationCompositeOperation', - writeable: false, }, KeyFormat: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'KeyFormat', - writeable: false, }, KeyType: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'KeyType', - writeable: false, }, KeyUsage: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'KeyUsage', - writeable: false, }, LineAlignSetting: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'LineAlignSetting', - writeable: false, }, ListeningState: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ListeningState', - writeable: false, }, MSCredentialType: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'MSCredentialType', - writeable: false, }, MSTransportType: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'MSTransportType', - writeable: false, }, MSWebViewPermissionState: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'MSWebViewPermissionState', - writeable: false, }, MSWebViewPermissionType: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'MSWebViewPermissionType', - writeable: false, }, MediaDeviceKind: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'MediaDeviceKind', - writeable: false, }, MediaKeyMessageType: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'MediaKeyMessageType', - writeable: false, }, MediaKeySessionType: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'MediaKeySessionType', - writeable: false, }, MediaKeyStatus: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'MediaKeyStatus', - writeable: false, }, MediaKeysRequirement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'MediaKeysRequirement', - writeable: false, }, MediaStreamTrackState: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'MediaStreamTrackState', - writeable: false, }, NavigationReason: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'NavigationReason', - writeable: false, }, NavigationType: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'NavigationType', - writeable: false, }, NotificationDirection: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'NotificationDirection', - writeable: false, }, NotificationPermission: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'NotificationPermission', - writeable: false, }, OffscreenRenderingContextId: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'OffscreenRenderingContextId', - writeable: false, }, OrientationLockType: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'OrientationLockType', - writeable: false, }, OrientationType: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'OrientationType', - writeable: false, }, OscillatorType: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'OscillatorType', - writeable: false, }, OverSampleType: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'OverSampleType', - writeable: false, }, PanningModelType: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'PanningModelType', - writeable: false, }, PaymentComplete: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'PaymentComplete', - writeable: false, }, PaymentShippingType: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'PaymentShippingType', - writeable: false, }, PermissionName: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'PermissionName', - writeable: false, }, PermissionState: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'PermissionState', - writeable: false, }, PlaybackDirection: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'PlaybackDirection', - writeable: false, }, PositionAlignSetting: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'PositionAlignSetting', - writeable: false, }, PremultiplyAlpha: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'PremultiplyAlpha', - writeable: false, }, PublicKeyCredentialType: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'PublicKeyCredentialType', - writeable: false, }, PushEncryptionKeyName: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'PushEncryptionKeyName', - writeable: false, }, PushPermissionState: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'PushPermissionState', - writeable: false, }, RTCBundlePolicy: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RTCBundlePolicy', - writeable: false, }, RTCDataChannelState: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RTCDataChannelState', - writeable: false, }, RTCDegradationPreference: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RTCDegradationPreference', - writeable: false, }, RTCDtlsRole: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RTCDtlsRole', - writeable: false, }, RTCDtlsTransportState: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RTCDtlsTransportState', - writeable: false, }, RTCDtxStatus: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RTCDtxStatus', - writeable: false, }, RTCErrorDetailType: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RTCErrorDetailType', - writeable: false, }, RTCIceCandidateType: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RTCIceCandidateType', - writeable: false, }, RTCIceComponent: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RTCIceComponent', - writeable: false, }, RTCIceConnectionState: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RTCIceConnectionState', - writeable: false, }, RTCIceCredentialType: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RTCIceCredentialType', - writeable: false, }, RTCIceGatherPolicy: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RTCIceGatherPolicy', - writeable: false, }, RTCIceGathererState: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RTCIceGathererState', - writeable: false, }, RTCIceGatheringState: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RTCIceGatheringState', - writeable: false, }, RTCIceProtocol: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RTCIceProtocol', - writeable: false, }, RTCIceRole: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RTCIceRole', - writeable: false, }, RTCIceTcpCandidateType: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RTCIceTcpCandidateType', - writeable: false, }, RTCIceTransportPolicy: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RTCIceTransportPolicy', - writeable: false, }, RTCIceTransportState: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RTCIceTransportState', - writeable: false, }, RTCPeerConnectionState: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RTCPeerConnectionState', - writeable: false, }, RTCPriorityType: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RTCPriorityType', - writeable: false, }, RTCRtcpMuxPolicy: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RTCRtcpMuxPolicy', - writeable: false, }, RTCRtpTransceiverDirection: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RTCRtpTransceiverDirection', - writeable: false, }, RTCSctpTransportState: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RTCSctpTransportState', - writeable: false, }, RTCSdpType: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RTCSdpType', - writeable: false, }, RTCSignalingState: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RTCSignalingState', - writeable: false, }, RTCStatsIceCandidatePairState: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RTCStatsIceCandidatePairState', - writeable: false, }, RTCStatsIceCandidateType: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RTCStatsIceCandidateType', - writeable: false, }, RTCStatsType: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RTCStatsType', - writeable: false, }, ReadyState: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ReadyState', - writeable: false, }, ReferrerPolicy: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ReferrerPolicy', - writeable: false, }, RequestCache: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RequestCache', - writeable: false, }, RequestCredentials: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RequestCredentials', - writeable: false, }, RequestDestination: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RequestDestination', - writeable: false, }, RequestMode: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RequestMode', - writeable: false, }, RequestRedirect: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RequestRedirect', - writeable: false, }, ResizeQuality: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ResizeQuality', - writeable: false, }, ResponseType: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ResponseType', - writeable: false, }, ScopedCredentialType: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ScopedCredentialType', - writeable: false, }, ScrollBehavior: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ScrollBehavior', - writeable: false, }, ScrollLogicalPosition: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ScrollLogicalPosition', - writeable: false, }, ScrollRestoration: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ScrollRestoration', - writeable: false, }, ScrollSetting: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ScrollSetting', - writeable: false, }, SelectionMode: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'SelectionMode', - writeable: false, }, ServiceWorkerState: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ServiceWorkerState', - writeable: false, }, ServiceWorkerUpdateViaCache: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ServiceWorkerUpdateViaCache', - writeable: false, }, ShadowRootMode: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ShadowRootMode', - writeable: false, }, SpeechSynthesisErrorCode: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'SpeechSynthesisErrorCode', - writeable: false, }, TextTrackKind: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'TextTrackKind', - writeable: false, }, TextTrackMode: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'TextTrackMode', - writeable: false, }, TouchType: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'TouchType', - writeable: false, }, Transport: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'Transport', - writeable: false, }, UserVerificationRequirement: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'UserVerificationRequirement', - writeable: false, }, VRDisplayEventReason: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'VRDisplayEventReason', - writeable: false, }, VideoFacingModeEnum: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'VideoFacingModeEnum', - writeable: false, }, VisibilityState: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'VisibilityState', - writeable: false, }, WebGLPowerPreference: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'WebGLPowerPreference', - writeable: false, }, WorkerType: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'WorkerType', - writeable: false, }, XMLHttpRequestResponseType: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'XMLHttpRequestResponseType', - writeable: false, }, } as Record; diff --git a/packages/scope-manager/src/lib/es2015.collection.ts b/packages/scope-manager/src/lib/es2015.collection.ts index a5136e2a4481..bfe4b1671646 100644 --- a/packages/scope-manager/src/lib/es2015.collection.ts +++ b/packages/scope-manager/src/lib/es2015.collection.ts @@ -10,69 +10,59 @@ export const es2015_collection = { isTypeVariable: true, isValueVariable: true, name: 'Map', - writeable: false, }, MapConstructor: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'MapConstructor', - writeable: false, }, ReadonlyMap: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ReadonlyMap', - writeable: false, }, WeakMap: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'WeakMap', - writeable: false, }, WeakMapConstructor: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'WeakMapConstructor', - writeable: false, }, Set: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'Set', - writeable: false, }, SetConstructor: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'SetConstructor', - writeable: false, }, ReadonlySet: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ReadonlySet', - writeable: false, }, WeakSet: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'WeakSet', - writeable: false, }, WeakSetConstructor: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'WeakSetConstructor', - writeable: false, }, } as Record; diff --git a/packages/scope-manager/src/lib/es2015.core.ts b/packages/scope-manager/src/lib/es2015.core.ts index e3c3f694d437..1e55eac0ed10 100644 --- a/packages/scope-manager/src/lib/es2015.core.ts +++ b/packages/scope-manager/src/lib/es2015.core.ts @@ -10,83 +10,71 @@ export const es2015_core = { isTypeVariable: true, isValueVariable: false, name: 'Array', - writeable: false, }, ArrayConstructor: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ArrayConstructor', - writeable: false, }, DateConstructor: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'DateConstructor', - writeable: false, }, Function: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'Function', - writeable: false, }, Math: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'Math', - writeable: false, }, NumberConstructor: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'NumberConstructor', - writeable: false, }, ObjectConstructor: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ObjectConstructor', - writeable: false, }, ReadonlyArray: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ReadonlyArray', - writeable: false, }, RegExp: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RegExp', - writeable: false, }, RegExpConstructor: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RegExpConstructor', - writeable: false, }, String: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'String', - writeable: false, }, StringConstructor: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'StringConstructor', - writeable: false, }, } as Record; diff --git a/packages/scope-manager/src/lib/es2015.generator.ts b/packages/scope-manager/src/lib/es2015.generator.ts index acebae492b4c..20ba0c067b66 100644 --- a/packages/scope-manager/src/lib/es2015.generator.ts +++ b/packages/scope-manager/src/lib/es2015.generator.ts @@ -12,20 +12,17 @@ export const es2015_generator = { isTypeVariable: true, isValueVariable: false, name: 'Generator', - writeable: false, }, GeneratorFunction: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'GeneratorFunction', - writeable: false, }, GeneratorFunctionConstructor: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'GeneratorFunctionConstructor', - writeable: false, }, } as Record; diff --git a/packages/scope-manager/src/lib/es2015.iterable.ts b/packages/scope-manager/src/lib/es2015.iterable.ts index e618b7381397..6bfb232406aa 100644 --- a/packages/scope-manager/src/lib/es2015.iterable.ts +++ b/packages/scope-manager/src/lib/es2015.iterable.ts @@ -12,300 +12,257 @@ export const es2015_iterable = { isTypeVariable: true, isValueVariable: false, name: 'SymbolConstructor', - writeable: false, }, IteratorYieldResult: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'IteratorYieldResult', - writeable: false, }, IteratorReturnResult: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'IteratorReturnResult', - writeable: false, }, IteratorResult: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'IteratorResult', - writeable: false, }, Iterator: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'Iterator', - writeable: false, }, Iterable: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'Iterable', - writeable: false, }, IterableIterator: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'IterableIterator', - writeable: false, }, Array: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'Array', - writeable: false, }, ArrayConstructor: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ArrayConstructor', - writeable: false, }, ReadonlyArray: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ReadonlyArray', - writeable: false, }, IArguments: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'IArguments', - writeable: false, }, Map: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'Map', - writeable: false, }, ReadonlyMap: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ReadonlyMap', - writeable: false, }, MapConstructor: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'MapConstructor', - writeable: false, }, WeakMap: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'WeakMap', - writeable: false, }, WeakMapConstructor: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'WeakMapConstructor', - writeable: false, }, Set: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'Set', - writeable: false, }, ReadonlySet: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ReadonlySet', - writeable: false, }, SetConstructor: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'SetConstructor', - writeable: false, }, WeakSet: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'WeakSet', - writeable: false, }, WeakSetConstructor: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'WeakSetConstructor', - writeable: false, }, Promise: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'Promise', - writeable: false, }, PromiseConstructor: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'PromiseConstructor', - writeable: false, }, Reflect: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'Reflect', - writeable: false, }, String: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'String', - writeable: false, }, Int8Array: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'Int8Array', - writeable: false, }, Int8ArrayConstructor: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'Int8ArrayConstructor', - writeable: false, }, Uint8Array: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'Uint8Array', - writeable: false, }, Uint8ArrayConstructor: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'Uint8ArrayConstructor', - writeable: false, }, Uint8ClampedArray: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'Uint8ClampedArray', - writeable: false, }, Uint8ClampedArrayConstructor: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'Uint8ClampedArrayConstructor', - writeable: false, }, Int16Array: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'Int16Array', - writeable: false, }, Int16ArrayConstructor: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'Int16ArrayConstructor', - writeable: false, }, Uint16Array: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'Uint16Array', - writeable: false, }, Uint16ArrayConstructor: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'Uint16ArrayConstructor', - writeable: false, }, Int32Array: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'Int32Array', - writeable: false, }, Int32ArrayConstructor: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'Int32ArrayConstructor', - writeable: false, }, Uint32Array: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'Uint32Array', - writeable: false, }, Uint32ArrayConstructor: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'Uint32ArrayConstructor', - writeable: false, }, Float32Array: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'Float32Array', - writeable: false, }, Float32ArrayConstructor: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'Float32ArrayConstructor', - writeable: false, }, Float64Array: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'Float64Array', - writeable: false, }, Float64ArrayConstructor: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'Float64ArrayConstructor', - writeable: false, }, } as Record; diff --git a/packages/scope-manager/src/lib/es2015.promise.ts b/packages/scope-manager/src/lib/es2015.promise.ts index ab084a766dd3..79c90f23b77d 100644 --- a/packages/scope-manager/src/lib/es2015.promise.ts +++ b/packages/scope-manager/src/lib/es2015.promise.ts @@ -10,6 +10,5 @@ export const es2015_promise = { isTypeVariable: true, isValueVariable: false, name: 'PromiseConstructor', - writeable: false, }, } as Record; diff --git a/packages/scope-manager/src/lib/es2015.proxy.ts b/packages/scope-manager/src/lib/es2015.proxy.ts index 4ff461292dca..a57efe0b2b6a 100644 --- a/packages/scope-manager/src/lib/es2015.proxy.ts +++ b/packages/scope-manager/src/lib/es2015.proxy.ts @@ -10,13 +10,11 @@ export const es2015_proxy = { isTypeVariable: true, isValueVariable: false, name: 'ProxyHandler', - writeable: false, }, ProxyConstructor: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ProxyConstructor', - writeable: false, }, } as Record; diff --git a/packages/scope-manager/src/lib/es2015.reflect.ts b/packages/scope-manager/src/lib/es2015.reflect.ts index 8c7fca665136..796c3fb78973 100644 --- a/packages/scope-manager/src/lib/es2015.reflect.ts +++ b/packages/scope-manager/src/lib/es2015.reflect.ts @@ -10,6 +10,5 @@ export const es2015_reflect = { isTypeVariable: true, isValueVariable: true, name: 'Reflect', - writeable: false, }, } as Record; diff --git a/packages/scope-manager/src/lib/es2015.symbol.ts b/packages/scope-manager/src/lib/es2015.symbol.ts index c356e8e8276e..7f5a8acf7334 100644 --- a/packages/scope-manager/src/lib/es2015.symbol.ts +++ b/packages/scope-manager/src/lib/es2015.symbol.ts @@ -10,6 +10,5 @@ export const es2015_symbol = { isTypeVariable: true, isValueVariable: false, name: 'SymbolConstructor', - writeable: false, }, } as Record; diff --git a/packages/scope-manager/src/lib/es2015.symbol.wellknown.ts b/packages/scope-manager/src/lib/es2015.symbol.wellknown.ts index cc1f0f7d68f8..ba99a6855f80 100644 --- a/packages/scope-manager/src/lib/es2015.symbol.wellknown.ts +++ b/packages/scope-manager/src/lib/es2015.symbol.wellknown.ts @@ -12,223 +12,191 @@ export const es2015_symbol_wellknown = { isTypeVariable: true, isValueVariable: false, name: 'SymbolConstructor', - writeable: false, }, Symbol: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'Symbol', - writeable: false, }, Array: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'Array', - writeable: false, }, Date: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'Date', - writeable: false, }, Map: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'Map', - writeable: false, }, WeakMap: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'WeakMap', - writeable: false, }, Set: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'Set', - writeable: false, }, WeakSet: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'WeakSet', - writeable: false, }, JSON: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'JSON', - writeable: false, }, Function: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'Function', - writeable: false, }, GeneratorFunction: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'GeneratorFunction', - writeable: false, }, Math: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'Math', - writeable: false, }, Promise: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'Promise', - writeable: false, }, PromiseConstructor: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'PromiseConstructor', - writeable: false, }, RegExp: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RegExp', - writeable: false, }, RegExpConstructor: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RegExpConstructor', - writeable: false, }, String: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'String', - writeable: false, }, ArrayBuffer: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ArrayBuffer', - writeable: false, }, DataView: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'DataView', - writeable: false, }, Int8Array: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'Int8Array', - writeable: false, }, Uint8Array: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'Uint8Array', - writeable: false, }, Uint8ClampedArray: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'Uint8ClampedArray', - writeable: false, }, Int16Array: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'Int16Array', - writeable: false, }, Uint16Array: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'Uint16Array', - writeable: false, }, Int32Array: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'Int32Array', - writeable: false, }, Uint32Array: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'Uint32Array', - writeable: false, }, Float32Array: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'Float32Array', - writeable: false, }, Float64Array: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'Float64Array', - writeable: false, }, ArrayConstructor: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ArrayConstructor', - writeable: false, }, MapConstructor: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'MapConstructor', - writeable: false, }, SetConstructor: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'SetConstructor', - writeable: false, }, ArrayBufferConstructor: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ArrayBufferConstructor', - writeable: false, }, } as Record; diff --git a/packages/scope-manager/src/lib/es2016.array.include.ts b/packages/scope-manager/src/lib/es2016.array.include.ts index f105a21228aa..7a082df25f90 100644 --- a/packages/scope-manager/src/lib/es2016.array.include.ts +++ b/packages/scope-manager/src/lib/es2016.array.include.ts @@ -10,76 +10,65 @@ export const es2016_array_include = { isTypeVariable: true, isValueVariable: false, name: 'Array', - writeable: false, }, ReadonlyArray: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ReadonlyArray', - writeable: false, }, Int8Array: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'Int8Array', - writeable: false, }, Uint8Array: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'Uint8Array', - writeable: false, }, Uint8ClampedArray: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'Uint8ClampedArray', - writeable: false, }, Int16Array: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'Int16Array', - writeable: false, }, Uint16Array: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'Uint16Array', - writeable: false, }, Int32Array: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'Int32Array', - writeable: false, }, Uint32Array: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'Uint32Array', - writeable: false, }, Float32Array: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'Float32Array', - writeable: false, }, Float64Array: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'Float64Array', - writeable: false, }, } as Record; diff --git a/packages/scope-manager/src/lib/es2017.intl.ts b/packages/scope-manager/src/lib/es2017.intl.ts index 74e418667128..de836bee889e 100644 --- a/packages/scope-manager/src/lib/es2017.intl.ts +++ b/packages/scope-manager/src/lib/es2017.intl.ts @@ -10,6 +10,5 @@ export const es2017_intl = { isTypeVariable: true, isValueVariable: true, name: 'Intl', - writeable: false, }, } as Record; diff --git a/packages/scope-manager/src/lib/es2017.object.ts b/packages/scope-manager/src/lib/es2017.object.ts index ce8c26bad88d..cc6dadcb5c4b 100644 --- a/packages/scope-manager/src/lib/es2017.object.ts +++ b/packages/scope-manager/src/lib/es2017.object.ts @@ -10,6 +10,5 @@ export const es2017_object = { isTypeVariable: true, isValueVariable: false, name: 'ObjectConstructor', - writeable: false, }, } as Record; diff --git a/packages/scope-manager/src/lib/es2017.sharedmemory.ts b/packages/scope-manager/src/lib/es2017.sharedmemory.ts index b97e1ee8a87c..316d52424b99 100644 --- a/packages/scope-manager/src/lib/es2017.sharedmemory.ts +++ b/packages/scope-manager/src/lib/es2017.sharedmemory.ts @@ -14,27 +14,23 @@ export const es2017_sharedmemory = { isTypeVariable: true, isValueVariable: true, name: 'SharedArrayBuffer', - writeable: false, }, SharedArrayBufferConstructor: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'SharedArrayBufferConstructor', - writeable: false, }, ArrayBufferTypes: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ArrayBufferTypes', - writeable: false, }, Atomics: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'Atomics', - writeable: false, }, } as Record; diff --git a/packages/scope-manager/src/lib/es2017.string.ts b/packages/scope-manager/src/lib/es2017.string.ts index 6034f9f58bc1..5b3ef5e7e264 100644 --- a/packages/scope-manager/src/lib/es2017.string.ts +++ b/packages/scope-manager/src/lib/es2017.string.ts @@ -10,6 +10,5 @@ export const es2017_string = { isTypeVariable: true, isValueVariable: false, name: 'String', - writeable: false, }, } as Record; diff --git a/packages/scope-manager/src/lib/es2017.typedarrays.ts b/packages/scope-manager/src/lib/es2017.typedarrays.ts index 2cab03640916..dbe5dedfac36 100644 --- a/packages/scope-manager/src/lib/es2017.typedarrays.ts +++ b/packages/scope-manager/src/lib/es2017.typedarrays.ts @@ -10,62 +10,53 @@ export const es2017_typedarrays = { isTypeVariable: true, isValueVariable: false, name: 'Int8ArrayConstructor', - writeable: false, }, Uint8ArrayConstructor: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'Uint8ArrayConstructor', - writeable: false, }, Uint8ClampedArrayConstructor: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'Uint8ClampedArrayConstructor', - writeable: false, }, Int16ArrayConstructor: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'Int16ArrayConstructor', - writeable: false, }, Uint16ArrayConstructor: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'Uint16ArrayConstructor', - writeable: false, }, Int32ArrayConstructor: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'Int32ArrayConstructor', - writeable: false, }, Uint32ArrayConstructor: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'Uint32ArrayConstructor', - writeable: false, }, Float32ArrayConstructor: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'Float32ArrayConstructor', - writeable: false, }, Float64ArrayConstructor: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'Float64ArrayConstructor', - writeable: false, }, } as Record; diff --git a/packages/scope-manager/src/lib/es2018.asyncgenerator.ts b/packages/scope-manager/src/lib/es2018.asyncgenerator.ts index 302acfed1ccd..80752c2dca22 100644 --- a/packages/scope-manager/src/lib/es2018.asyncgenerator.ts +++ b/packages/scope-manager/src/lib/es2018.asyncgenerator.ts @@ -12,20 +12,17 @@ export const es2018_asyncgenerator = { isTypeVariable: true, isValueVariable: false, name: 'AsyncGenerator', - writeable: false, }, AsyncGeneratorFunction: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'AsyncGeneratorFunction', - writeable: false, }, AsyncGeneratorFunctionConstructor: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'AsyncGeneratorFunctionConstructor', - writeable: false, }, } as Record; diff --git a/packages/scope-manager/src/lib/es2018.asynciterable.ts b/packages/scope-manager/src/lib/es2018.asynciterable.ts index 2ba2fd26900c..fca209905022 100644 --- a/packages/scope-manager/src/lib/es2018.asynciterable.ts +++ b/packages/scope-manager/src/lib/es2018.asynciterable.ts @@ -14,27 +14,23 @@ export const es2018_asynciterable = { isTypeVariable: true, isValueVariable: false, name: 'SymbolConstructor', - writeable: false, }, AsyncIterator: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'AsyncIterator', - writeable: false, }, AsyncIterable: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'AsyncIterable', - writeable: false, }, AsyncIterableIterator: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'AsyncIterableIterator', - writeable: false, }, } as Record; diff --git a/packages/scope-manager/src/lib/es2018.intl.ts b/packages/scope-manager/src/lib/es2018.intl.ts index 159131a3ed31..7bc68a428ff9 100644 --- a/packages/scope-manager/src/lib/es2018.intl.ts +++ b/packages/scope-manager/src/lib/es2018.intl.ts @@ -10,6 +10,5 @@ export const es2018_intl = { isTypeVariable: true, isValueVariable: true, name: 'Intl', - writeable: false, }, } as Record; diff --git a/packages/scope-manager/src/lib/es2018.promise.ts b/packages/scope-manager/src/lib/es2018.promise.ts index 4aeb4f24c345..908e47e2f53e 100644 --- a/packages/scope-manager/src/lib/es2018.promise.ts +++ b/packages/scope-manager/src/lib/es2018.promise.ts @@ -10,6 +10,5 @@ export const es2018_promise = { isTypeVariable: true, isValueVariable: false, name: 'Promise', - writeable: false, }, } as Record; diff --git a/packages/scope-manager/src/lib/es2018.regexp.ts b/packages/scope-manager/src/lib/es2018.regexp.ts index 97d426c5e9f3..e59e4849f2b3 100644 --- a/packages/scope-manager/src/lib/es2018.regexp.ts +++ b/packages/scope-manager/src/lib/es2018.regexp.ts @@ -10,20 +10,17 @@ export const es2018_regexp = { isTypeVariable: true, isValueVariable: false, name: 'RegExpMatchArray', - writeable: false, }, RegExpExecArray: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RegExpExecArray', - writeable: false, }, RegExp: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RegExp', - writeable: false, }, } as Record; diff --git a/packages/scope-manager/src/lib/es2019.array.ts b/packages/scope-manager/src/lib/es2019.array.ts index 43cab778d0f9..e3fb2ff62beb 100644 --- a/packages/scope-manager/src/lib/es2019.array.ts +++ b/packages/scope-manager/src/lib/es2019.array.ts @@ -10,20 +10,17 @@ export const es2019_array = { isTypeVariable: true, isValueVariable: false, name: 'FlatArray', - writeable: false, }, ReadonlyArray: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ReadonlyArray', - writeable: false, }, Array: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'Array', - writeable: false, }, } as Record; diff --git a/packages/scope-manager/src/lib/es2019.object.ts b/packages/scope-manager/src/lib/es2019.object.ts index e1a2addeb370..3db91f3f1d6c 100644 --- a/packages/scope-manager/src/lib/es2019.object.ts +++ b/packages/scope-manager/src/lib/es2019.object.ts @@ -12,6 +12,5 @@ export const es2019_object = { isTypeVariable: true, isValueVariable: false, name: 'ObjectConstructor', - writeable: false, }, } as Record; diff --git a/packages/scope-manager/src/lib/es2019.string.ts b/packages/scope-manager/src/lib/es2019.string.ts index 519fc93c7a11..113a34775587 100644 --- a/packages/scope-manager/src/lib/es2019.string.ts +++ b/packages/scope-manager/src/lib/es2019.string.ts @@ -10,6 +10,5 @@ export const es2019_string = { isTypeVariable: true, isValueVariable: false, name: 'String', - writeable: false, }, } as Record; diff --git a/packages/scope-manager/src/lib/es2019.symbol.ts b/packages/scope-manager/src/lib/es2019.symbol.ts index 2024d1e3f7a9..36888f887cef 100644 --- a/packages/scope-manager/src/lib/es2019.symbol.ts +++ b/packages/scope-manager/src/lib/es2019.symbol.ts @@ -10,6 +10,5 @@ export const es2019_symbol = { isTypeVariable: true, isValueVariable: false, name: 'Symbol', - writeable: false, }, } as Record; diff --git a/packages/scope-manager/src/lib/es2020.bigint.ts b/packages/scope-manager/src/lib/es2020.bigint.ts index d37c17fcac43..b31042e8d3ae 100644 --- a/packages/scope-manager/src/lib/es2020.bigint.ts +++ b/packages/scope-manager/src/lib/es2020.bigint.ts @@ -10,62 +10,53 @@ export const es2020_bigint = { isTypeVariable: true, isValueVariable: false, name: 'BigIntToLocaleStringOptions', - writeable: false, }, BigInt: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'BigInt', - writeable: false, }, BigIntConstructor: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'BigIntConstructor', - writeable: false, }, BigInt64Array: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'BigInt64Array', - writeable: false, }, BigInt64ArrayConstructor: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'BigInt64ArrayConstructor', - writeable: false, }, BigUint64Array: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'BigUint64Array', - writeable: false, }, BigUint64ArrayConstructor: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'BigUint64ArrayConstructor', - writeable: false, }, DataView: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'DataView', - writeable: false, }, Intl: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'Intl', - writeable: false, }, } as Record; diff --git a/packages/scope-manager/src/lib/es2020.intl.ts b/packages/scope-manager/src/lib/es2020.intl.ts index f2efbf2eb231..d97db5a6aea2 100644 --- a/packages/scope-manager/src/lib/es2020.intl.ts +++ b/packages/scope-manager/src/lib/es2020.intl.ts @@ -10,6 +10,5 @@ export const es2020_intl = { isTypeVariable: true, isValueVariable: true, name: 'Intl', - writeable: false, }, } as Record; diff --git a/packages/scope-manager/src/lib/es2020.promise.ts b/packages/scope-manager/src/lib/es2020.promise.ts index fed66024f8b1..4a3743f0e7e1 100644 --- a/packages/scope-manager/src/lib/es2020.promise.ts +++ b/packages/scope-manager/src/lib/es2020.promise.ts @@ -10,27 +10,23 @@ export const es2020_promise = { isTypeVariable: true, isValueVariable: false, name: 'PromiseFulfilledResult', - writeable: false, }, PromiseRejectedResult: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'PromiseRejectedResult', - writeable: false, }, PromiseSettledResult: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'PromiseSettledResult', - writeable: false, }, PromiseConstructor: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'PromiseConstructor', - writeable: false, }, } as Record; diff --git a/packages/scope-manager/src/lib/es2020.string.ts b/packages/scope-manager/src/lib/es2020.string.ts index 2bfed8f2b62d..2f173d3fb5b8 100644 --- a/packages/scope-manager/src/lib/es2020.string.ts +++ b/packages/scope-manager/src/lib/es2020.string.ts @@ -12,6 +12,5 @@ export const es2020_string = { isTypeVariable: true, isValueVariable: false, name: 'String', - writeable: false, }, } as Record; diff --git a/packages/scope-manager/src/lib/es2020.symbol.wellknown.ts b/packages/scope-manager/src/lib/es2020.symbol.wellknown.ts index 1cc58e9ec4fa..9c452ca68979 100644 --- a/packages/scope-manager/src/lib/es2020.symbol.wellknown.ts +++ b/packages/scope-manager/src/lib/es2020.symbol.wellknown.ts @@ -14,13 +14,11 @@ export const es2020_symbol_wellknown = { isTypeVariable: true, isValueVariable: false, name: 'SymbolConstructor', - writeable: false, }, RegExp: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RegExp', - writeable: false, }, } as Record; diff --git a/packages/scope-manager/src/lib/es5.ts b/packages/scope-manager/src/lib/es5.ts index fb6cc4af4ed3..81a8af4b0674 100644 --- a/packages/scope-manager/src/lib/es5.ts +++ b/packages/scope-manager/src/lib/es5.ts @@ -10,671 +10,575 @@ export const es5 = { isTypeVariable: true, isValueVariable: false, name: 'Symbol', - writeable: false, }, PropertyKey: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'PropertyKey', - writeable: false, }, PropertyDescriptor: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'PropertyDescriptor', - writeable: false, }, PropertyDescriptorMap: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'PropertyDescriptorMap', - writeable: false, }, Object: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'Object', - writeable: false, }, ObjectConstructor: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ObjectConstructor', - writeable: false, }, Function: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'Function', - writeable: false, }, FunctionConstructor: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'FunctionConstructor', - writeable: false, }, ThisParameterType: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ThisParameterType', - writeable: false, }, OmitThisParameter: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'OmitThisParameter', - writeable: false, }, CallableFunction: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'CallableFunction', - writeable: false, }, NewableFunction: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'NewableFunction', - writeable: false, }, IArguments: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'IArguments', - writeable: false, }, String: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'String', - writeable: false, }, StringConstructor: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'StringConstructor', - writeable: false, }, Boolean: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'Boolean', - writeable: false, }, BooleanConstructor: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'BooleanConstructor', - writeable: false, }, Number: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'Number', - writeable: false, }, NumberConstructor: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'NumberConstructor', - writeable: false, }, TemplateStringsArray: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'TemplateStringsArray', - writeable: false, }, ImportMeta: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ImportMeta', - writeable: false, }, Math: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'Math', - writeable: false, }, Date: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'Date', - writeable: false, }, DateConstructor: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'DateConstructor', - writeable: false, }, RegExpMatchArray: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RegExpMatchArray', - writeable: false, }, RegExpExecArray: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RegExpExecArray', - writeable: false, }, RegExp: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'RegExp', - writeable: false, }, RegExpConstructor: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RegExpConstructor', - writeable: false, }, Error: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'Error', - writeable: false, }, ErrorConstructor: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ErrorConstructor', - writeable: false, }, EvalError: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'EvalError', - writeable: false, }, EvalErrorConstructor: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'EvalErrorConstructor', - writeable: false, }, RangeError: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'RangeError', - writeable: false, }, RangeErrorConstructor: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RangeErrorConstructor', - writeable: false, }, ReferenceError: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'ReferenceError', - writeable: false, }, ReferenceErrorConstructor: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ReferenceErrorConstructor', - writeable: false, }, SyntaxError: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SyntaxError', - writeable: false, }, SyntaxErrorConstructor: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'SyntaxErrorConstructor', - writeable: false, }, TypeError: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'TypeError', - writeable: false, }, TypeErrorConstructor: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'TypeErrorConstructor', - writeable: false, }, URIError: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'URIError', - writeable: false, }, URIErrorConstructor: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'URIErrorConstructor', - writeable: false, }, JSON: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'JSON', - writeable: false, }, ReadonlyArray: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ReadonlyArray', - writeable: false, }, ConcatArray: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ConcatArray', - writeable: false, }, Array: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'Array', - writeable: false, }, ArrayConstructor: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ArrayConstructor', - writeable: false, }, TypedPropertyDescriptor: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'TypedPropertyDescriptor', - writeable: false, }, ClassDecorator: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ClassDecorator', - writeable: false, }, PropertyDecorator: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'PropertyDecorator', - writeable: false, }, MethodDecorator: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'MethodDecorator', - writeable: false, }, ParameterDecorator: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ParameterDecorator', - writeable: false, }, PromiseConstructorLike: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'PromiseConstructorLike', - writeable: false, }, PromiseLike: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'PromiseLike', - writeable: false, }, Promise: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'Promise', - writeable: false, }, ArrayLike: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ArrayLike', - writeable: false, }, Partial: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'Partial', - writeable: false, }, Required: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'Required', - writeable: false, }, Readonly: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'Readonly', - writeable: false, }, Pick: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'Pick', - writeable: false, }, Record: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'Record', - writeable: false, }, Exclude: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'Exclude', - writeable: false, }, Extract: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'Extract', - writeable: false, }, Omit: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'Omit', - writeable: false, }, NonNullable: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'NonNullable', - writeable: false, }, Parameters: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'Parameters', - writeable: false, }, ConstructorParameters: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ConstructorParameters', - writeable: false, }, ReturnType: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ReturnType', - writeable: false, }, InstanceType: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'InstanceType', - writeable: false, }, ThisType: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ThisType', - writeable: false, }, ArrayBuffer: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'ArrayBuffer', - writeable: false, }, ArrayBufferTypes: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ArrayBufferTypes', - writeable: false, }, ArrayBufferLike: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ArrayBufferLike', - writeable: false, }, ArrayBufferConstructor: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ArrayBufferConstructor', - writeable: false, }, ArrayBufferView: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ArrayBufferView', - writeable: false, }, DataView: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'DataView', - writeable: false, }, DataViewConstructor: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'DataViewConstructor', - writeable: false, }, Int8Array: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'Int8Array', - writeable: false, }, Int8ArrayConstructor: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'Int8ArrayConstructor', - writeable: false, }, Uint8Array: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'Uint8Array', - writeable: false, }, Uint8ArrayConstructor: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'Uint8ArrayConstructor', - writeable: false, }, Uint8ClampedArray: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'Uint8ClampedArray', - writeable: false, }, Uint8ClampedArrayConstructor: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'Uint8ClampedArrayConstructor', - writeable: false, }, Int16Array: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'Int16Array', - writeable: false, }, Int16ArrayConstructor: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'Int16ArrayConstructor', - writeable: false, }, Uint16Array: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'Uint16Array', - writeable: false, }, Uint16ArrayConstructor: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'Uint16ArrayConstructor', - writeable: false, }, Int32Array: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'Int32Array', - writeable: false, }, Int32ArrayConstructor: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'Int32ArrayConstructor', - writeable: false, }, Uint32Array: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'Uint32Array', - writeable: false, }, Uint32ArrayConstructor: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'Uint32ArrayConstructor', - writeable: false, }, Float32Array: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'Float32Array', - writeable: false, }, Float32ArrayConstructor: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'Float32ArrayConstructor', - writeable: false, }, Float64Array: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'Float64Array', - writeable: false, }, Float64ArrayConstructor: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'Float64ArrayConstructor', - writeable: false, }, Intl: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'Intl', - writeable: false, }, } as Record; diff --git a/packages/scope-manager/src/lib/esnext.array.ts b/packages/scope-manager/src/lib/esnext.array.ts index b48090a0a60b..b349f206e184 100644 --- a/packages/scope-manager/src/lib/esnext.array.ts +++ b/packages/scope-manager/src/lib/esnext.array.ts @@ -10,20 +10,17 @@ export const esnext_array = { isTypeVariable: true, isValueVariable: false, name: 'FlatArray', - writeable: false, }, ReadonlyArray: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ReadonlyArray', - writeable: false, }, Array: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'Array', - writeable: false, }, } as Record; diff --git a/packages/scope-manager/src/lib/esnext.asynciterable.ts b/packages/scope-manager/src/lib/esnext.asynciterable.ts index c4d16fc52e4c..c78a7dc71fc4 100644 --- a/packages/scope-manager/src/lib/esnext.asynciterable.ts +++ b/packages/scope-manager/src/lib/esnext.asynciterable.ts @@ -14,27 +14,23 @@ export const esnext_asynciterable = { isTypeVariable: true, isValueVariable: false, name: 'SymbolConstructor', - writeable: false, }, AsyncIterator: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'AsyncIterator', - writeable: false, }, AsyncIterable: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'AsyncIterable', - writeable: false, }, AsyncIterableIterator: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'AsyncIterableIterator', - writeable: false, }, } as Record; diff --git a/packages/scope-manager/src/lib/esnext.bigint.ts b/packages/scope-manager/src/lib/esnext.bigint.ts index 07387b7c2466..18985a9df06c 100644 --- a/packages/scope-manager/src/lib/esnext.bigint.ts +++ b/packages/scope-manager/src/lib/esnext.bigint.ts @@ -10,62 +10,53 @@ export const esnext_bigint = { isTypeVariable: true, isValueVariable: false, name: 'BigIntToLocaleStringOptions', - writeable: false, }, BigInt: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'BigInt', - writeable: false, }, BigIntConstructor: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'BigIntConstructor', - writeable: false, }, BigInt64Array: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'BigInt64Array', - writeable: false, }, BigInt64ArrayConstructor: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'BigInt64ArrayConstructor', - writeable: false, }, BigUint64Array: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'BigUint64Array', - writeable: false, }, BigUint64ArrayConstructor: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'BigUint64ArrayConstructor', - writeable: false, }, DataView: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'DataView', - writeable: false, }, Intl: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'Intl', - writeable: false, }, } as Record; diff --git a/packages/scope-manager/src/lib/esnext.intl.ts b/packages/scope-manager/src/lib/esnext.intl.ts index bc5b26197244..e6a3fa9997ed 100644 --- a/packages/scope-manager/src/lib/esnext.intl.ts +++ b/packages/scope-manager/src/lib/esnext.intl.ts @@ -10,6 +10,5 @@ export const esnext_intl = { isTypeVariable: true, isValueVariable: true, name: 'Intl', - writeable: false, }, } as Record; diff --git a/packages/scope-manager/src/lib/esnext.promise.ts b/packages/scope-manager/src/lib/esnext.promise.ts index a5b1238df159..53240da659eb 100644 --- a/packages/scope-manager/src/lib/esnext.promise.ts +++ b/packages/scope-manager/src/lib/esnext.promise.ts @@ -10,20 +10,17 @@ export const esnext_promise = { isTypeVariable: true, isValueVariable: true, name: 'AggregateError', - writeable: false, }, AggregateErrorConstructor: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'AggregateErrorConstructor', - writeable: false, }, PromiseConstructor: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'PromiseConstructor', - writeable: false, }, } as Record; diff --git a/packages/scope-manager/src/lib/esnext.string.ts b/packages/scope-manager/src/lib/esnext.string.ts index 4a64eab69841..e1c3ab61f59a 100644 --- a/packages/scope-manager/src/lib/esnext.string.ts +++ b/packages/scope-manager/src/lib/esnext.string.ts @@ -10,6 +10,5 @@ export const esnext_string = { isTypeVariable: true, isValueVariable: false, name: 'String', - writeable: false, }, } as Record; diff --git a/packages/scope-manager/src/lib/esnext.symbol.ts b/packages/scope-manager/src/lib/esnext.symbol.ts index 8cdc142d4ed1..a7e3f7a15f21 100644 --- a/packages/scope-manager/src/lib/esnext.symbol.ts +++ b/packages/scope-manager/src/lib/esnext.symbol.ts @@ -10,6 +10,5 @@ export const esnext_symbol = { isTypeVariable: true, isValueVariable: false, name: 'Symbol', - writeable: false, }, } as Record; diff --git a/packages/scope-manager/src/lib/scripthost.ts b/packages/scope-manager/src/lib/scripthost.ts index a022d78e03ce..1ae99dcacac2 100644 --- a/packages/scope-manager/src/lib/scripthost.ts +++ b/packages/scope-manager/src/lib/scripthost.ts @@ -10,90 +10,77 @@ export const scripthost = { isTypeVariable: true, isValueVariable: true, name: 'ActiveXObject', - writeable: false, }, ITextWriter: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ITextWriter', - writeable: false, }, TextStreamBase: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'TextStreamBase', - writeable: false, }, TextStreamWriter: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'TextStreamWriter', - writeable: false, }, TextStreamReader: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'TextStreamReader', - writeable: false, }, SafeArray: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SafeArray', - writeable: false, }, Enumerator: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'Enumerator', - writeable: false, }, EnumeratorConstructor: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'EnumeratorConstructor', - writeable: false, }, VBArray: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'VBArray', - writeable: false, }, VBArrayConstructor: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'VBArrayConstructor', - writeable: false, }, VarDate: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'VarDate', - writeable: false, }, DateConstructor: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'DateConstructor', - writeable: false, }, Date: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'Date', - writeable: false, }, } as Record; diff --git a/packages/scope-manager/src/lib/webworker.ts b/packages/scope-manager/src/lib/webworker.ts index f60d467decdf..250c3db95007 100644 --- a/packages/scope-manager/src/lib/webworker.ts +++ b/packages/scope-manager/src/lib/webworker.ts @@ -10,2876 +10,2465 @@ export const webworker = { isTypeVariable: true, isValueVariable: false, name: 'AddEventListenerOptions', - writeable: false, }, AesCbcParams: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'AesCbcParams', - writeable: false, }, AesCtrParams: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'AesCtrParams', - writeable: false, }, AesDerivedKeyParams: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'AesDerivedKeyParams', - writeable: false, }, AesGcmParams: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'AesGcmParams', - writeable: false, }, AesKeyAlgorithm: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'AesKeyAlgorithm', - writeable: false, }, AesKeyGenParams: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'AesKeyGenParams', - writeable: false, }, Algorithm: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'Algorithm', - writeable: false, }, BlobPropertyBag: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'BlobPropertyBag', - writeable: false, }, CacheQueryOptions: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'CacheQueryOptions', - writeable: false, }, CanvasRenderingContext2DSettings: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'CanvasRenderingContext2DSettings', - writeable: false, }, ClientQueryOptions: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ClientQueryOptions', - writeable: false, }, CloseEventInit: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'CloseEventInit', - writeable: false, }, CryptoKeyPair: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'CryptoKeyPair', - writeable: false, }, CustomEventInit: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'CustomEventInit', - writeable: false, }, DOMMatrix2DInit: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'DOMMatrix2DInit', - writeable: false, }, DOMMatrixInit: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'DOMMatrixInit', - writeable: false, }, DOMPointInit: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'DOMPointInit', - writeable: false, }, DOMQuadInit: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'DOMQuadInit', - writeable: false, }, DOMRectInit: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'DOMRectInit', - writeable: false, }, DevicePermissionDescriptor: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'DevicePermissionDescriptor', - writeable: false, }, EcKeyGenParams: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'EcKeyGenParams', - writeable: false, }, EcKeyImportParams: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'EcKeyImportParams', - writeable: false, }, EcdhKeyDeriveParams: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'EcdhKeyDeriveParams', - writeable: false, }, EcdsaParams: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'EcdsaParams', - writeable: false, }, ErrorEventInit: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ErrorEventInit', - writeable: false, }, EventInit: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'EventInit', - writeable: false, }, EventListenerOptions: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'EventListenerOptions', - writeable: false, }, EventSourceInit: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'EventSourceInit', - writeable: false, }, ExtendableEventInit: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ExtendableEventInit', - writeable: false, }, ExtendableMessageEventInit: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ExtendableMessageEventInit', - writeable: false, }, FetchEventInit: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'FetchEventInit', - writeable: false, }, FilePropertyBag: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'FilePropertyBag', - writeable: false, }, GetNotificationOptions: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'GetNotificationOptions', - writeable: false, }, HmacImportParams: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'HmacImportParams', - writeable: false, }, HmacKeyGenParams: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'HmacKeyGenParams', - writeable: false, }, IDBIndexParameters: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'IDBIndexParameters', - writeable: false, }, IDBObjectStoreParameters: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'IDBObjectStoreParameters', - writeable: false, }, IDBVersionChangeEventInit: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'IDBVersionChangeEventInit', - writeable: false, }, ImageBitmapOptions: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ImageBitmapOptions', - writeable: false, }, ImageBitmapRenderingContextSettings: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ImageBitmapRenderingContextSettings', - writeable: false, }, ImageEncodeOptions: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ImageEncodeOptions', - writeable: false, }, JsonWebKey: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'JsonWebKey', - writeable: false, }, KeyAlgorithm: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'KeyAlgorithm', - writeable: false, }, MessageEventInit: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'MessageEventInit', - writeable: false, }, MidiPermissionDescriptor: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'MidiPermissionDescriptor', - writeable: false, }, MultiCacheQueryOptions: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'MultiCacheQueryOptions', - writeable: false, }, NavigationPreloadState: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'NavigationPreloadState', - writeable: false, }, NotificationAction: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'NotificationAction', - writeable: false, }, NotificationEventInit: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'NotificationEventInit', - writeable: false, }, NotificationOptions: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'NotificationOptions', - writeable: false, }, Pbkdf2Params: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'Pbkdf2Params', - writeable: false, }, PerformanceObserverInit: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'PerformanceObserverInit', - writeable: false, }, PermissionDescriptor: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'PermissionDescriptor', - writeable: false, }, PipeOptions: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'PipeOptions', - writeable: false, }, PostMessageOptions: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'PostMessageOptions', - writeable: false, }, ProgressEventInit: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ProgressEventInit', - writeable: false, }, PromiseRejectionEventInit: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'PromiseRejectionEventInit', - writeable: false, }, PushEventInit: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'PushEventInit', - writeable: false, }, PushPermissionDescriptor: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'PushPermissionDescriptor', - writeable: false, }, PushSubscriptionChangeEventInit: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'PushSubscriptionChangeEventInit', - writeable: false, }, PushSubscriptionJSON: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'PushSubscriptionJSON', - writeable: false, }, PushSubscriptionOptionsInit: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'PushSubscriptionOptionsInit', - writeable: false, }, QueuingStrategy: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'QueuingStrategy', - writeable: false, }, ReadableStreamReadDoneResult: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ReadableStreamReadDoneResult', - writeable: false, }, ReadableStreamReadValueResult: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ReadableStreamReadValueResult', - writeable: false, }, RegistrationOptions: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RegistrationOptions', - writeable: false, }, RequestInit: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RequestInit', - writeable: false, }, ResponseInit: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ResponseInit', - writeable: false, }, RsaHashedImportParams: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RsaHashedImportParams', - writeable: false, }, RsaHashedKeyGenParams: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RsaHashedKeyGenParams', - writeable: false, }, RsaKeyGenParams: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RsaKeyGenParams', - writeable: false, }, RsaOaepParams: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RsaOaepParams', - writeable: false, }, RsaOtherPrimesInfo: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RsaOtherPrimesInfo', - writeable: false, }, RsaPssParams: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RsaPssParams', - writeable: false, }, StorageEstimate: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'StorageEstimate', - writeable: false, }, SyncEventInit: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'SyncEventInit', - writeable: false, }, TextDecodeOptions: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'TextDecodeOptions', - writeable: false, }, TextDecoderOptions: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'TextDecoderOptions', - writeable: false, }, TextEncoderEncodeIntoResult: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'TextEncoderEncodeIntoResult', - writeable: false, }, Transformer: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'Transformer', - writeable: false, }, UnderlyingByteSource: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'UnderlyingByteSource', - writeable: false, }, UnderlyingSink: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'UnderlyingSink', - writeable: false, }, UnderlyingSource: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'UnderlyingSource', - writeable: false, }, WebGLContextAttributes: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'WebGLContextAttributes', - writeable: false, }, WebGLContextEventInit: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'WebGLContextEventInit', - writeable: false, }, WorkerOptions: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'WorkerOptions', - writeable: false, }, EventListener: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'EventListener', - writeable: false, }, ANGLE_instanced_arrays: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ANGLE_instanced_arrays', - writeable: false, }, AbortController: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'AbortController', - writeable: false, }, AbortSignalEventMap: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'AbortSignalEventMap', - writeable: false, }, AbortSignal: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'AbortSignal', - writeable: false, }, AbstractWorkerEventMap: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'AbstractWorkerEventMap', - writeable: false, }, AbstractWorker: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'AbstractWorker', - writeable: false, }, AesCfbParams: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'AesCfbParams', - writeable: false, }, AesCmacParams: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'AesCmacParams', - writeable: false, }, AnimationFrameProvider: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'AnimationFrameProvider', - writeable: false, }, Blob: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'Blob', - writeable: false, }, Body: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'Body', - writeable: false, }, BroadcastChannelEventMap: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'BroadcastChannelEventMap', - writeable: false, }, BroadcastChannel: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'BroadcastChannel', - writeable: false, }, ByteLengthQueuingStrategy: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'ByteLengthQueuingStrategy', - writeable: false, }, Cache: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'Cache', - writeable: false, }, CacheStorage: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'CacheStorage', - writeable: false, }, CanvasCompositing: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'CanvasCompositing', - writeable: false, }, CanvasDrawImage: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'CanvasDrawImage', - writeable: false, }, CanvasDrawPath: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'CanvasDrawPath', - writeable: false, }, CanvasFillStrokeStyles: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'CanvasFillStrokeStyles', - writeable: false, }, CanvasFilters: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'CanvasFilters', - writeable: false, }, CanvasGradient: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'CanvasGradient', - writeable: false, }, CanvasImageData: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'CanvasImageData', - writeable: false, }, CanvasImageSmoothing: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'CanvasImageSmoothing', - writeable: false, }, CanvasPath: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'CanvasPath', - writeable: false, }, CanvasPathDrawingStyles: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'CanvasPathDrawingStyles', - writeable: false, }, CanvasPattern: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'CanvasPattern', - writeable: false, }, CanvasRect: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'CanvasRect', - writeable: false, }, CanvasShadowStyles: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'CanvasShadowStyles', - writeable: false, }, CanvasState: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'CanvasState', - writeable: false, }, CanvasText: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'CanvasText', - writeable: false, }, CanvasTextDrawingStyles: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'CanvasTextDrawingStyles', - writeable: false, }, CanvasTransform: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'CanvasTransform', - writeable: false, }, Client: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'Client', - writeable: false, }, Clients: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'Clients', - writeable: false, }, CloseEvent: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'CloseEvent', - writeable: false, }, ConcatParams: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ConcatParams', - writeable: false, }, CountQueuingStrategy: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'CountQueuingStrategy', - writeable: false, }, Crypto: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'Crypto', - writeable: false, }, CryptoKey: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'CryptoKey', - writeable: false, }, CustomEvent: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'CustomEvent', - writeable: false, }, DOMException: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'DOMException', - writeable: false, }, DOMMatrix: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'DOMMatrix', - writeable: false, }, DOMMatrixReadOnly: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'DOMMatrixReadOnly', - writeable: false, }, DOMPoint: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'DOMPoint', - writeable: false, }, DOMPointReadOnly: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'DOMPointReadOnly', - writeable: false, }, DOMQuad: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'DOMQuad', - writeable: false, }, DOMRect: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'DOMRect', - writeable: false, }, DOMRectReadOnly: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'DOMRectReadOnly', - writeable: false, }, DOMStringList: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'DOMStringList', - writeable: false, }, DedicatedWorkerGlobalScopeEventMap: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'DedicatedWorkerGlobalScopeEventMap', - writeable: false, }, DedicatedWorkerGlobalScope: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'DedicatedWorkerGlobalScope', - writeable: false, }, DhImportKeyParams: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'DhImportKeyParams', - writeable: false, }, DhKeyAlgorithm: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'DhKeyAlgorithm', - writeable: false, }, DhKeyDeriveParams: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'DhKeyDeriveParams', - writeable: false, }, DhKeyGenParams: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'DhKeyGenParams', - writeable: false, }, EXT_blend_minmax: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'EXT_blend_minmax', - writeable: false, }, EXT_frag_depth: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'EXT_frag_depth', - writeable: false, }, EXT_sRGB: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'EXT_sRGB', - writeable: false, }, EXT_shader_texture_lod: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'EXT_shader_texture_lod', - writeable: false, }, EXT_texture_filter_anisotropic: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'EXT_texture_filter_anisotropic', - writeable: false, }, ErrorEvent: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'ErrorEvent', - writeable: false, }, Event: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'Event', - writeable: false, }, EventListenerObject: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'EventListenerObject', - writeable: false, }, EventSourceEventMap: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'EventSourceEventMap', - writeable: false, }, EventSource: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'EventSource', - writeable: false, }, EventTarget: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'EventTarget', - writeable: false, }, ExtendableEvent: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'ExtendableEvent', - writeable: false, }, ExtendableMessageEvent: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'ExtendableMessageEvent', - writeable: false, }, FetchEvent: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'FetchEvent', - writeable: false, }, File: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'File', - writeable: false, }, FileList: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'FileList', - writeable: false, }, FileReaderEventMap: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'FileReaderEventMap', - writeable: false, }, FileReader: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'FileReader', - writeable: false, }, FileReaderSync: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'FileReaderSync', - writeable: false, }, FormData: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'FormData', - writeable: false, }, GenericTransformStream: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'GenericTransformStream', - writeable: false, }, Headers: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'Headers', - writeable: false, }, HkdfCtrParams: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'HkdfCtrParams', - writeable: false, }, IDBArrayKey: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'IDBArrayKey', - writeable: false, }, IDBCursor: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'IDBCursor', - writeable: false, }, IDBCursorWithValue: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'IDBCursorWithValue', - writeable: false, }, IDBDatabaseEventMap: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'IDBDatabaseEventMap', - writeable: false, }, IDBDatabase: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'IDBDatabase', - writeable: false, }, IDBFactory: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'IDBFactory', - writeable: false, }, IDBIndex: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'IDBIndex', - writeable: false, }, IDBKeyRange: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'IDBKeyRange', - writeable: false, }, IDBObjectStore: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'IDBObjectStore', - writeable: false, }, IDBOpenDBRequestEventMap: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'IDBOpenDBRequestEventMap', - writeable: false, }, IDBOpenDBRequest: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'IDBOpenDBRequest', - writeable: false, }, IDBRequestEventMap: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'IDBRequestEventMap', - writeable: false, }, IDBRequest: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'IDBRequest', - writeable: false, }, IDBTransactionEventMap: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'IDBTransactionEventMap', - writeable: false, }, IDBTransaction: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'IDBTransaction', - writeable: false, }, IDBVersionChangeEvent: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'IDBVersionChangeEvent', - writeable: false, }, ImageBitmap: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'ImageBitmap', - writeable: false, }, ImageBitmapRenderingContext: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'ImageBitmapRenderingContext', - writeable: false, }, ImageData: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'ImageData', - writeable: false, }, MessageChannel: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'MessageChannel', - writeable: false, }, MessageEvent: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'MessageEvent', - writeable: false, }, MessagePortEventMap: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'MessagePortEventMap', - writeable: false, }, MessagePort: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'MessagePort', - writeable: false, }, NavigationPreloadManager: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'NavigationPreloadManager', - writeable: false, }, NavigatorConcurrentHardware: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'NavigatorConcurrentHardware', - writeable: false, }, NavigatorID: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'NavigatorID', - writeable: false, }, NavigatorLanguage: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'NavigatorLanguage', - writeable: false, }, NavigatorOnLine: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'NavigatorOnLine', - writeable: false, }, NavigatorStorage: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'NavigatorStorage', - writeable: false, }, NotificationEventMap: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'NotificationEventMap', - writeable: false, }, Notification: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'Notification', - writeable: false, }, NotificationEvent: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'NotificationEvent', - writeable: false, }, OES_element_index_uint: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'OES_element_index_uint', - writeable: false, }, OES_standard_derivatives: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'OES_standard_derivatives', - writeable: false, }, OES_texture_float: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'OES_texture_float', - writeable: false, }, OES_texture_float_linear: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'OES_texture_float_linear', - writeable: false, }, OES_texture_half_float: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'OES_texture_half_float', - writeable: false, }, OES_texture_half_float_linear: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'OES_texture_half_float_linear', - writeable: false, }, OES_vertex_array_object: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'OES_vertex_array_object', - writeable: false, }, OffscreenCanvas: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'OffscreenCanvas', - writeable: false, }, OffscreenCanvasRenderingContext2D: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'OffscreenCanvasRenderingContext2D', - writeable: false, }, Path2D: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'Path2D', - writeable: false, }, PerformanceEventMap: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'PerformanceEventMap', - writeable: false, }, Performance: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'Performance', - writeable: false, }, PerformanceEntry: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'PerformanceEntry', - writeable: false, }, PerformanceMark: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'PerformanceMark', - writeable: false, }, PerformanceMeasure: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'PerformanceMeasure', - writeable: false, }, PerformanceObserver: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'PerformanceObserver', - writeable: false, }, PerformanceObserverEntryList: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'PerformanceObserverEntryList', - writeable: false, }, PerformanceResourceTiming: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'PerformanceResourceTiming', - writeable: false, }, PermissionStatusEventMap: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'PermissionStatusEventMap', - writeable: false, }, PermissionStatus: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'PermissionStatus', - writeable: false, }, Permissions: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'Permissions', - writeable: false, }, ProgressEvent: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'ProgressEvent', - writeable: false, }, PromiseRejectionEvent: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'PromiseRejectionEvent', - writeable: false, }, PushEvent: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'PushEvent', - writeable: false, }, PushManager: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'PushManager', - writeable: false, }, PushMessageData: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'PushMessageData', - writeable: false, }, PushSubscription: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'PushSubscription', - writeable: false, }, PushSubscriptionChangeEvent: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'PushSubscriptionChangeEvent', - writeable: false, }, PushSubscriptionOptions: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'PushSubscriptionOptions', - writeable: false, }, ReadableByteStreamController: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ReadableByteStreamController', - writeable: false, }, ReadableStream: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'ReadableStream', - writeable: false, }, ReadableStreamBYOBReader: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ReadableStreamBYOBReader', - writeable: false, }, ReadableStreamBYOBRequest: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ReadableStreamBYOBRequest', - writeable: false, }, ReadableStreamDefaultController: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ReadableStreamDefaultController', - writeable: false, }, ReadableStreamDefaultReader: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ReadableStreamDefaultReader', - writeable: false, }, ReadableStreamReader: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'ReadableStreamReader', - writeable: false, }, Request: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'Request', - writeable: false, }, Response: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'Response', - writeable: false, }, ServiceWorkerEventMap: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ServiceWorkerEventMap', - writeable: false, }, ServiceWorker: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'ServiceWorker', - writeable: false, }, ServiceWorkerContainerEventMap: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ServiceWorkerContainerEventMap', - writeable: false, }, ServiceWorkerContainer: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'ServiceWorkerContainer', - writeable: false, }, ServiceWorkerGlobalScopeEventMap: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ServiceWorkerGlobalScopeEventMap', - writeable: false, }, ServiceWorkerGlobalScope: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'ServiceWorkerGlobalScope', - writeable: false, }, ServiceWorkerRegistrationEventMap: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ServiceWorkerRegistrationEventMap', - writeable: false, }, ServiceWorkerRegistration: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'ServiceWorkerRegistration', - writeable: false, }, SharedWorker: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SharedWorker', - writeable: false, }, SharedWorkerGlobalScopeEventMap: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'SharedWorkerGlobalScopeEventMap', - writeable: false, }, SharedWorkerGlobalScope: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SharedWorkerGlobalScope', - writeable: false, }, StorageManager: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'StorageManager', - writeable: false, }, SubtleCrypto: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SubtleCrypto', - writeable: false, }, SyncEvent: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SyncEvent', - writeable: false, }, SyncManager: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'SyncManager', - writeable: false, }, TextDecoder: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'TextDecoder', - writeable: false, }, TextDecoderCommon: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'TextDecoderCommon', - writeable: false, }, TextDecoderStream: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'TextDecoderStream', - writeable: false, }, TextEncoder: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'TextEncoder', - writeable: false, }, TextEncoderCommon: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'TextEncoderCommon', - writeable: false, }, TextEncoderStream: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'TextEncoderStream', - writeable: false, }, TextMetrics: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'TextMetrics', - writeable: false, }, TransformStream: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'TransformStream', - writeable: false, }, TransformStreamDefaultController: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'TransformStreamDefaultController', - writeable: false, }, URL: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'URL', - writeable: false, }, URLSearchParams: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'URLSearchParams', - writeable: false, }, WEBGL_color_buffer_float: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'WEBGL_color_buffer_float', - writeable: false, }, WEBGL_compressed_texture_astc: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'WEBGL_compressed_texture_astc', - writeable: false, }, WEBGL_compressed_texture_s3tc: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'WEBGL_compressed_texture_s3tc', - writeable: false, }, WEBGL_compressed_texture_s3tc_srgb: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'WEBGL_compressed_texture_s3tc_srgb', - writeable: false, }, WEBGL_debug_renderer_info: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'WEBGL_debug_renderer_info', - writeable: false, }, WEBGL_debug_shaders: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'WEBGL_debug_shaders', - writeable: false, }, WEBGL_depth_texture: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'WEBGL_depth_texture', - writeable: false, }, WEBGL_draw_buffers: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'WEBGL_draw_buffers', - writeable: false, }, WEBGL_lose_context: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'WEBGL_lose_context', - writeable: false, }, WebGL2RenderingContext: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'WebGL2RenderingContext', - writeable: false, }, WebGL2RenderingContextBase: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'WebGL2RenderingContextBase', - writeable: false, }, WebGL2RenderingContextOverloads: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'WebGL2RenderingContextOverloads', - writeable: false, }, WebGLActiveInfo: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'WebGLActiveInfo', - writeable: false, }, WebGLBuffer: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'WebGLBuffer', - writeable: false, }, WebGLContextEvent: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'WebGLContextEvent', - writeable: false, }, WebGLFramebuffer: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'WebGLFramebuffer', - writeable: false, }, WebGLObject: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'WebGLObject', - writeable: false, }, WebGLProgram: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'WebGLProgram', - writeable: false, }, WebGLQuery: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'WebGLQuery', - writeable: false, }, WebGLRenderbuffer: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'WebGLRenderbuffer', - writeable: false, }, WebGLRenderingContext: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'WebGLRenderingContext', - writeable: false, }, WebGLRenderingContextBase: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'WebGLRenderingContextBase', - writeable: false, }, WebGLRenderingContextOverloads: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'WebGLRenderingContextOverloads', - writeable: false, }, WebGLSampler: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'WebGLSampler', - writeable: false, }, WebGLShader: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'WebGLShader', - writeable: false, }, WebGLShaderPrecisionFormat: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'WebGLShaderPrecisionFormat', - writeable: false, }, WebGLSync: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'WebGLSync', - writeable: false, }, WebGLTexture: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'WebGLTexture', - writeable: false, }, WebGLTransformFeedback: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'WebGLTransformFeedback', - writeable: false, }, WebGLUniformLocation: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'WebGLUniformLocation', - writeable: false, }, WebGLVertexArrayObject: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'WebGLVertexArrayObject', - writeable: false, }, WebGLVertexArrayObjectOES: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'WebGLVertexArrayObjectOES', - writeable: false, }, WebSocketEventMap: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'WebSocketEventMap', - writeable: false, }, WebSocket: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'WebSocket', - writeable: false, }, WindowClient: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'WindowClient', - writeable: false, }, WindowOrWorkerGlobalScope: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'WindowOrWorkerGlobalScope', - writeable: false, }, WorkerEventMap: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'WorkerEventMap', - writeable: false, }, Worker: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'Worker', - writeable: false, }, WorkerGlobalScopeEventMap: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'WorkerGlobalScopeEventMap', - writeable: false, }, WorkerGlobalScope: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'WorkerGlobalScope', - writeable: false, }, WorkerLocation: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'WorkerLocation', - writeable: false, }, WorkerNavigator: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'WorkerNavigator', - writeable: false, }, WritableStream: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'WritableStream', - writeable: false, }, WritableStreamDefaultController: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'WritableStreamDefaultController', - writeable: false, }, WritableStreamDefaultWriter: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'WritableStreamDefaultWriter', - writeable: false, }, XMLHttpRequestEventMap: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'XMLHttpRequestEventMap', - writeable: false, }, XMLHttpRequest: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'XMLHttpRequest', - writeable: false, }, XMLHttpRequestEventTargetEventMap: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'XMLHttpRequestEventTargetEventMap', - writeable: false, }, XMLHttpRequestEventTarget: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'XMLHttpRequestEventTarget', - writeable: false, }, XMLHttpRequestUpload: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'XMLHttpRequestUpload', - writeable: false, }, EventListenerOrEventListenerObject: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'EventListenerOrEventListenerObject', - writeable: false, }, Console: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'Console', - writeable: false, }, WebAssembly: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: true, name: 'WebAssembly', - writeable: false, }, FrameRequestCallback: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'FrameRequestCallback', - writeable: false, }, OnErrorEventHandlerNonNull: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'OnErrorEventHandlerNonNull', - writeable: false, }, PerformanceObserverCallback: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'PerformanceObserverCallback', - writeable: false, }, QueuingStrategySizeCallback: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'QueuingStrategySizeCallback', - writeable: false, }, ReadableByteStreamControllerCallback: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ReadableByteStreamControllerCallback', - writeable: false, }, ReadableStreamDefaultControllerCallback: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ReadableStreamDefaultControllerCallback', - writeable: false, }, ReadableStreamErrorCallback: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ReadableStreamErrorCallback', - writeable: false, }, TransformStreamDefaultControllerCallback: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'TransformStreamDefaultControllerCallback', - writeable: false, }, TransformStreamDefaultControllerTransformCallback: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'TransformStreamDefaultControllerTransformCallback', - writeable: false, }, VoidFunction: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'VoidFunction', - writeable: false, }, WritableStreamDefaultControllerCloseCallback: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'WritableStreamDefaultControllerCloseCallback', - writeable: false, }, WritableStreamDefaultControllerStartCallback: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'WritableStreamDefaultControllerStartCallback', - writeable: false, }, WritableStreamDefaultControllerWriteCallback: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'WritableStreamDefaultControllerWriteCallback', - writeable: false, }, WritableStreamErrorCallback: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'WritableStreamErrorCallback', - writeable: false, }, HeadersInit: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'HeadersInit', - writeable: false, }, BodyInit: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'BodyInit', - writeable: false, }, RequestInfo: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RequestInfo', - writeable: false, }, BlobPart: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'BlobPart', - writeable: false, }, DOMHighResTimeStamp: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'DOMHighResTimeStamp', - writeable: false, }, CanvasImageSource: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'CanvasImageSource', - writeable: false, }, OffscreenRenderingContext: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'OffscreenRenderingContext', - writeable: false, }, MessageEventSource: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'MessageEventSource', - writeable: false, }, ImageBitmapSource: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ImageBitmapSource', - writeable: false, }, OnErrorEventHandler: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'OnErrorEventHandler', - writeable: false, }, TimerHandler: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'TimerHandler', - writeable: false, }, PerformanceEntryList: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'PerformanceEntryList', - writeable: false, }, PushMessageDataInit: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'PushMessageDataInit', - writeable: false, }, ReadableStreamReadResult: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ReadableStreamReadResult', - writeable: false, }, VibratePattern: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'VibratePattern', - writeable: false, }, AlgorithmIdentifier: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'AlgorithmIdentifier', - writeable: false, }, HashAlgorithmIdentifier: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'HashAlgorithmIdentifier', - writeable: false, }, BigInteger: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'BigInteger', - writeable: false, }, NamedCurve: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'NamedCurve', - writeable: false, }, GLenum: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'GLenum', - writeable: false, }, GLboolean: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'GLboolean', - writeable: false, }, GLbitfield: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'GLbitfield', - writeable: false, }, GLint: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'GLint', - writeable: false, }, GLsizei: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'GLsizei', - writeable: false, }, GLintptr: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'GLintptr', - writeable: false, }, GLsizeiptr: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'GLsizeiptr', - writeable: false, }, GLuint: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'GLuint', - writeable: false, }, GLfloat: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'GLfloat', - writeable: false, }, GLclampf: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'GLclampf', - writeable: false, }, TexImageSource: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'TexImageSource', - writeable: false, }, Float32List: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'Float32List', - writeable: false, }, Int32List: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'Int32List', - writeable: false, }, GLint64: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'GLint64', - writeable: false, }, GLuint64: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'GLuint64', - writeable: false, }, Uint32List: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'Uint32List', - writeable: false, }, BufferSource: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'BufferSource', - writeable: false, }, DOMTimeStamp: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'DOMTimeStamp', - writeable: false, }, FormDataEntryValue: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'FormDataEntryValue', - writeable: false, }, IDBValidKey: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'IDBValidKey', - writeable: false, }, Transferable: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'Transferable', - writeable: false, }, BinaryType: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'BinaryType', - writeable: false, }, CanvasDirection: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'CanvasDirection', - writeable: false, }, CanvasFillRule: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'CanvasFillRule', - writeable: false, }, CanvasLineCap: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'CanvasLineCap', - writeable: false, }, CanvasLineJoin: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'CanvasLineJoin', - writeable: false, }, CanvasTextAlign: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'CanvasTextAlign', - writeable: false, }, CanvasTextBaseline: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'CanvasTextBaseline', - writeable: false, }, ClientTypes: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ClientTypes', - writeable: false, }, ColorSpaceConversion: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ColorSpaceConversion', - writeable: false, }, EndingType: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'EndingType', - writeable: false, }, FrameType: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'FrameType', - writeable: false, }, IDBCursorDirection: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'IDBCursorDirection', - writeable: false, }, IDBRequestReadyState: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'IDBRequestReadyState', - writeable: false, }, IDBTransactionMode: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'IDBTransactionMode', - writeable: false, }, ImageOrientation: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ImageOrientation', - writeable: false, }, ImageSmoothingQuality: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ImageSmoothingQuality', - writeable: false, }, KeyFormat: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'KeyFormat', - writeable: false, }, KeyType: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'KeyType', - writeable: false, }, KeyUsage: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'KeyUsage', - writeable: false, }, NotificationDirection: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'NotificationDirection', - writeable: false, }, NotificationPermission: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'NotificationPermission', - writeable: false, }, OffscreenRenderingContextId: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'OffscreenRenderingContextId', - writeable: false, }, PermissionName: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'PermissionName', - writeable: false, }, PermissionState: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'PermissionState', - writeable: false, }, PremultiplyAlpha: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'PremultiplyAlpha', - writeable: false, }, PushEncryptionKeyName: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'PushEncryptionKeyName', - writeable: false, }, PushPermissionState: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'PushPermissionState', - writeable: false, }, ReferrerPolicy: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ReferrerPolicy', - writeable: false, }, RequestCache: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RequestCache', - writeable: false, }, RequestCredentials: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RequestCredentials', - writeable: false, }, RequestDestination: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RequestDestination', - writeable: false, }, RequestMode: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RequestMode', - writeable: false, }, RequestRedirect: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'RequestRedirect', - writeable: false, }, ResizeQuality: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ResizeQuality', - writeable: false, }, ResponseType: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ResponseType', - writeable: false, }, ServiceWorkerState: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ServiceWorkerState', - writeable: false, }, ServiceWorkerUpdateViaCache: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'ServiceWorkerUpdateViaCache', - writeable: false, }, VisibilityState: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'VisibilityState', - writeable: false, }, WebGLPowerPreference: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'WebGLPowerPreference', - writeable: false, }, WorkerType: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'WorkerType', - writeable: false, }, XMLHttpRequestResponseType: { eslintImplicitGlobalSetting: 'readonly', isTypeVariable: true, isValueVariable: false, name: 'XMLHttpRequestResponseType', - writeable: false, }, } as Record; diff --git a/packages/scope-manager/src/referencer/Referencer.ts b/packages/scope-manager/src/referencer/Referencer.ts index bd88b6a59966..d329eca2d173 100644 --- a/packages/scope-manager/src/referencer/Referencer.ts +++ b/packages/scope-manager/src/referencer/Referencer.ts @@ -105,6 +105,14 @@ class Referencer extends Visitor { globalScope.defineImplicitVariable(variable); } } + + // for const assertions (`{} as const` / `{}`) + globalScope.defineImplicitVariable({ + name: 'const', + eslintImplicitGlobalSetting: 'readonly', + isTypeVariable: true, + isValueVariable: false, + }); } /** diff --git a/packages/scope-manager/tests/eslint-scope/arguments.test.ts b/packages/scope-manager/tests/eslint-scope/arguments.test.ts index e3bbef8899f6..1fe69e2bdf03 100644 --- a/packages/scope-manager/tests/eslint-scope/arguments.test.ts +++ b/packages/scope-manager/tests/eslint-scope/arguments.test.ts @@ -1,6 +1,7 @@ import { expectToBeFunctionScope, expectToBeGlobalScope, + getRealVariables, parseAndAnalyze, } from '../util'; @@ -15,15 +16,17 @@ describe('arguments', () => { expect(scopeManager.scopes).toHaveLength(2); let scope = scopeManager.scopes[0]; + let variables = getRealVariables(scope.variables); expectToBeGlobalScope(scope); - expect(scope.variables).toHaveLength(0); + expect(variables).toHaveLength(0); expect(scope.references).toHaveLength(0); scope = scopeManager.scopes[1]; + variables = getRealVariables(scope.variables); expectToBeFunctionScope(scope); - expect(scope.variables).toHaveLength(1); - expect(scope.variables[0].name).toBe('arguments'); + expect(variables).toHaveLength(1); + expect(variables[0].name).toBe('arguments'); expect(scope.references).toHaveLength(1); - expect(scope.references[0].resolved).toBe(scope.variables[0]); + expect(scope.references[0].resolved).toBe(variables[0]); }); }); diff --git a/packages/scope-manager/tests/eslint-scope/catch-scope.test.ts b/packages/scope-manager/tests/eslint-scope/catch-scope.test.ts index bb3ad8f2b5f4..0a2a2b53412f 100644 --- a/packages/scope-manager/tests/eslint-scope/catch-scope.test.ts +++ b/packages/scope-manager/tests/eslint-scope/catch-scope.test.ts @@ -3,6 +3,7 @@ import { expectToBeCatchScope, expectToBeFunctionScope, expectToBeGlobalScope, + getRealVariables, parseAndAnalyze, } from '../util'; @@ -19,30 +20,35 @@ describe('catch', () => { expect(scopeManager.scopes).toHaveLength(5); let scope = scopeManager.scopes[0]; + let variables = getRealVariables(scope.variables); expectToBeGlobalScope(scope); - expect(scope.variables).toHaveLength(0); + expect(variables).toHaveLength(0); expect(scope.references).toHaveLength(0); scope = scopeManager.scopes[1]; + variables = getRealVariables(scope.variables); expectToBeFunctionScope(scope); - expect(scope.variables).toHaveLength(1); - expect(scope.variables[0].name).toBe('arguments'); + expect(variables).toHaveLength(1); + expect(variables[0].name).toBe('arguments'); expect(scope.references).toHaveLength(0); scope = scopeManager.scopes[2]; + variables = getRealVariables(scope.variables); expectToBeBlockScope(scope); - expect(scope.variables).toHaveLength(0); + expect(variables).toHaveLength(0); expect(scope.references).toHaveLength(0); scope = scopeManager.scopes[3]; + variables = getRealVariables(scope.variables); expectToBeCatchScope(scope); - expect(scope.variables).toHaveLength(1); - expect(scope.variables[0].name).toBe('e'); + expect(variables).toHaveLength(1); + expect(variables[0].name).toBe('e'); expect(scope.references).toHaveLength(0); scope = scopeManager.scopes[4]; + variables = getRealVariables(scope.variables); expectToBeBlockScope(scope); - expect(scope.variables).toHaveLength(0); + expect(variables).toHaveLength(0); expect(scope.references).toHaveLength(0); }); }); diff --git a/packages/scope-manager/tests/eslint-scope/es6-arrow-function-expression.test.ts b/packages/scope-manager/tests/eslint-scope/es6-arrow-function-expression.test.ts index 3032af6726db..a172d54423d5 100644 --- a/packages/scope-manager/tests/eslint-scope/es6-arrow-function-expression.test.ts +++ b/packages/scope-manager/tests/eslint-scope/es6-arrow-function-expression.test.ts @@ -2,6 +2,7 @@ import { AST_NODE_TYPES } from '@typescript-eslint/types'; import { expectToBeFunctionScope, expectToBeGlobalScope, + getRealVariables, parseAndAnalyze, } from '../util'; @@ -18,20 +19,22 @@ describe('ES6 arrow function expression', () => { expect(scopeManager.scopes).toHaveLength(2); let scope = scopeManager.scopes[0]; + let variables = getRealVariables(scope.variables); expectToBeGlobalScope(scope); expect(scope.block.type).toBe(AST_NODE_TYPES.Program); expect(scope.isStrict).toBeFalsy(); - expect(scope.variables).toHaveLength(1); + expect(variables).toHaveLength(1); scope = scopeManager.scopes[1]; + variables = getRealVariables(scope.variables); expectToBeFunctionScope(scope); expect(scope.block.type).toBe(AST_NODE_TYPES.ArrowFunctionExpression); expect(scope.isStrict).toBeFalsy(); - expect(scope.variables).toHaveLength(2); + expect(variables).toHaveLength(2); // There's no "arguments" - expect(scope.variables[0].name).toBe('i'); - expect(scope.variables[1].name).toBe('j'); + expect(variables[0].name).toBe('i'); + expect(variables[1].name).toBe('j'); }); it('generate bindings for parameters', () => { @@ -40,22 +43,24 @@ describe('ES6 arrow function expression', () => { expect(scopeManager.scopes).toHaveLength(2); let scope = scopeManager.scopes[0]; + let variables = getRealVariables(scope.variables); expectToBeGlobalScope(scope); expect(scope.block.type).toBe(AST_NODE_TYPES.Program); expect(scope.isStrict).toBeFalsy(); - expect(scope.variables).toHaveLength(1); + expect(variables).toHaveLength(1); scope = scopeManager.scopes[1]; + variables = getRealVariables(scope.variables); expectToBeFunctionScope(scope); expect(scope.block.type).toBe(AST_NODE_TYPES.ArrowFunctionExpression); expect(scope.isStrict).toBeFalsy(); - expect(scope.variables).toHaveLength(4); + expect(variables).toHaveLength(4); // There's no "arguments" - expect(scope.variables[0].name).toBe('a'); - expect(scope.variables[1].name).toBe('b'); - expect(scope.variables[2].name).toBe('c'); - expect(scope.variables[3].name).toBe('d'); + expect(variables[0].name).toBe('a'); + expect(variables[1].name).toBe('b'); + expect(variables[2].name).toBe('c'); + expect(variables[3].name).toBe('d'); }); it('inherits upper scope strictness', () => { @@ -67,17 +72,18 @@ describe('ES6 arrow function expression', () => { expect(scopeManager.scopes).toHaveLength(2); let scope = scopeManager.scopes[0]; + let variables = getRealVariables(scope.variables); expectToBeGlobalScope(scope); expect(scope.block.type).toBe(AST_NODE_TYPES.Program); expect(scope.isStrict).toBeTruthy(); - expect(scope.variables).toHaveLength(1); + expect(variables).toHaveLength(1); scope = scopeManager.scopes[1]; - + variables = getRealVariables(scope.variables); expectToBeFunctionScope(scope); expect(scope.block.type).toBe(AST_NODE_TYPES.ArrowFunctionExpression); expect(scope.isStrict).toBeTruthy(); - expect(scope.variables).toHaveLength(0); + expect(variables).toHaveLength(0); }); it('is strict when a strictness directive is used', () => { @@ -90,17 +96,18 @@ describe('ES6 arrow function expression', () => { expect(scopeManager.scopes).toHaveLength(2); let scope = scopeManager.scopes[0]; + let variables = getRealVariables(scope.variables); expectToBeGlobalScope(scope); expect(scope.block.type).toBe(AST_NODE_TYPES.Program); expect(scope.isStrict).toBeFalsy(); - expect(scope.variables).toHaveLength(1); + expect(variables).toHaveLength(1); scope = scopeManager.scopes[1]; - + variables = getRealVariables(scope.variables); expectToBeFunctionScope(scope); expect(scope.block.type).toBe(AST_NODE_TYPES.ArrowFunctionExpression); expect(scope.isStrict).toBeTruthy(); - expect(scope.variables).toHaveLength(0); + expect(variables).toHaveLength(0); }); it('works with no body', () => { @@ -109,10 +116,11 @@ describe('ES6 arrow function expression', () => { expect(scopeManager.scopes).toHaveLength(2); const scope = scopeManager.scopes[1]; + const variables = getRealVariables(scope.variables); expectToBeFunctionScope(scope); expect(scope.block.type).toBe(AST_NODE_TYPES.ArrowFunctionExpression); expect(scope.isStrict).toBeFalsy(); - expect(scope.variables).toHaveLength(1); + expect(variables).toHaveLength(1); }); }); diff --git a/packages/scope-manager/tests/eslint-scope/es6-block-scope.test.ts b/packages/scope-manager/tests/eslint-scope/es6-block-scope.test.ts index e2b51c0f9265..831d8954fc4b 100644 --- a/packages/scope-manager/tests/eslint-scope/es6-block-scope.test.ts +++ b/packages/scope-manager/tests/eslint-scope/es6-block-scope.test.ts @@ -2,6 +2,7 @@ import { expectToBeBlockScope, expectToBeFunctionScope, expectToBeGlobalScope, + getRealVariables, parseAndAnalyze, } from '../util'; @@ -17,13 +18,15 @@ describe('ES6 block scope', () => { expect(scopeManager.scopes).toHaveLength(2); // Program and BlockStatement scope. let scope = scopeManager.scopes[0]; + let variables = getRealVariables(scope.variables); expectToBeGlobalScope(scope); - expect(scope.variables).toHaveLength(0); // No variable in Program scope. + expect(variables).toHaveLength(0); // No variable in Program scope. scope = scopeManager.scopes[1]; + variables = getRealVariables(scope.variables); expectToBeBlockScope(scope); - expect(scope.variables).toHaveLength(1); // `i` in block scope. - expect(scope.variables[0].name).toBe('i'); + expect(variables).toHaveLength(1); // `i` in block scope. + expect(variables[0].name).toBe('i'); expect(scope.references).toHaveLength(2); expect(scope.references[0].identifier.name).toBe('i'); expect(scope.references[1].identifier.name).toBe('i'); @@ -41,20 +44,23 @@ describe('ES6 block scope', () => { expect(scopeManager.scopes).toHaveLength(3); let scope = scopeManager.scopes[0]; + let variables = getRealVariables(scope.variables); expectToBeGlobalScope(scope); - expect(scope.variables).toHaveLength(0); + expect(variables).toHaveLength(0); scope = scopeManager.scopes[1]; + variables = getRealVariables(scope.variables); expectToBeBlockScope(scope); - expect(scope.variables).toHaveLength(1); - expect(scope.variables[0].name).toBe('test'); + expect(variables).toHaveLength(1); + expect(variables[0].name).toBe('test'); expect(scope.references).toHaveLength(1); expect(scope.references[0].identifier.name).toBe('test'); scope = scopeManager.scopes[2]; + variables = getRealVariables(scope.variables); expectToBeFunctionScope(scope); - expect(scope.variables).toHaveLength(1); - expect(scope.variables[0].name).toBe('arguments'); + expect(variables).toHaveLength(1); + expect(variables[0].name).toBe('arguments'); expect(scope.references).toHaveLength(0); }); @@ -71,19 +77,21 @@ describe('ES6 block scope', () => { expect(scopeManager.scopes).toHaveLength(2); let scope = scopeManager.scopes[0]; + let variables = getRealVariables(scope.variables); expectToBeGlobalScope(scope); - expect(scope.variables).toHaveLength(1); - expect(scope.variables[0].name).toBe('i'); + expect(variables).toHaveLength(1); + expect(variables[0].name).toBe('i'); expect(scope.references).toHaveLength(1); scope = scopeManager.scopes[1]; + variables = getRealVariables(scope.variables); expectToBeBlockScope(scope); - expect(scope.variables).toHaveLength(1); - expect(scope.variables[0].name).toBe('i'); + expect(variables).toHaveLength(1); + expect(variables[0].name).toBe('i'); expect(scope.references).toHaveLength(3); - expect(scope.references[0].resolved).toBe(scope.variables[0]); - expect(scope.references[1].resolved).toBe(scope.variables[0]); - expect(scope.references[2].resolved).toBe(scope.variables[0]); + expect(scope.references[0].resolved).toBe(variables[0]); + expect(scope.references[1].resolved).toBe(variables[0]); + expect(scope.references[2].resolved).toBe(variables[0]); }); it('let is not hoistable#2', () => { @@ -108,16 +116,18 @@ describe('ES6 block scope', () => { expect(scopeManager.scopes).toHaveLength(4); let scope = scopeManager.scopes[0]; + let variables = getRealVariables(scope.variables); expectToBeGlobalScope(scope); - expect(scope.variables).toHaveLength(0); + expect(variables).toHaveLength(0); expect(scope.references).toHaveLength(0); scope = scopeManager.scopes[1]; + variables = getRealVariables(scope.variables); expectToBeFunctionScope(scope); - expect(scope.variables).toHaveLength(2); - expect(scope.variables[0].name).toBe('arguments'); - expect(scope.variables[1].name).toBe('i'); - const v1 = scope.variables[1]; + expect(variables).toHaveLength(2); + expect(variables[0].name).toBe('arguments'); + expect(variables[1].name).toBe('i'); + const v1 = variables[1]; expect(scope.references).toHaveLength(3); expect(scope.references[0].resolved).toBe(v1); @@ -125,10 +135,11 @@ describe('ES6 block scope', () => { expect(scope.references[2].resolved).toBe(v1); scope = scopeManager.scopes[2]; + variables = getRealVariables(scope.variables); expectToBeBlockScope(scope); - expect(scope.variables).toHaveLength(1); - expect(scope.variables[0].name).toBe('i'); - const v3 = scope.variables[0]; + expect(variables).toHaveLength(1); + expect(variables[0].name).toBe('i'); + const v3 = variables[0]; expect(scope.references).toHaveLength(3); expect(scope.references[0].resolved).toBe(v3); @@ -136,10 +147,11 @@ describe('ES6 block scope', () => { expect(scope.references[2].resolved).toBe(v3); scope = scopeManager.scopes[3]; + variables = getRealVariables(scope.variables); expectToBeBlockScope(scope); - expect(scope.variables).toHaveLength(1); - expect(scope.variables[0].name).toBe('i'); - const v2 = scope.variables[0]; + expect(variables).toHaveLength(1); + expect(variables[0].name).toBe('i'); + const v2 = variables[0]; expect(scope.references).toHaveLength(3); expect(scope.references[0].resolved).toBe(v2); diff --git a/packages/scope-manager/tests/eslint-scope/es6-catch.test.ts b/packages/scope-manager/tests/eslint-scope/es6-catch.test.ts index 906e8d8ba385..c82f3791833c 100644 --- a/packages/scope-manager/tests/eslint-scope/es6-catch.test.ts +++ b/packages/scope-manager/tests/eslint-scope/es6-catch.test.ts @@ -3,6 +3,7 @@ import { expectToBeBlockScope, expectToBeCatchScope, expectToBeGlobalScope, + getRealVariables, parseAndAnalyze, } from '../util'; @@ -22,37 +23,41 @@ describe('ES6 catch', () => { expect(scopeManager.scopes).toHaveLength(4); let scope = scopeManager.scopes[0]; + let variables = getRealVariables(scope.variables); expectToBeGlobalScope(scope); expect(scope.block.type).toBe(AST_NODE_TYPES.Program); expect(scope.isStrict).toBeFalsy(); - expect(scope.variables).toHaveLength(0); + expect(variables).toHaveLength(0); expect(scope.references).toHaveLength(0); scope = scopeManager.scopes[1]; + variables = getRealVariables(scope.variables); expectToBeBlockScope(scope); expect(scope.block.type).toBe(AST_NODE_TYPES.BlockStatement); expect(scope.isStrict).toBeFalsy(); - expect(scope.variables).toHaveLength(0); + expect(variables).toHaveLength(0); expect(scope.references).toHaveLength(0); scope = scopeManager.scopes[2]; + variables = getRealVariables(scope.variables); expectToBeCatchScope(scope); expect(scope.block.type).toBe(AST_NODE_TYPES.CatchClause); expect(scope.isStrict).toBeFalsy(); - expect(scope.variables).toHaveLength(4); - expect(scope.variables[0].name).toBe('a'); - expect(scope.variables[1].name).toBe('b'); - expect(scope.variables[2].name).toBe('c'); - expect(scope.variables[3].name).toBe('d'); + expect(variables).toHaveLength(4); + expect(variables[0].name).toBe('a'); + expect(variables[1].name).toBe('b'); + expect(variables[2].name).toBe('c'); + expect(variables[3].name).toBe('d'); expect(scope.references).toHaveLength(0); scope = scopeManager.scopes[3]; + variables = getRealVariables(scope.variables); expectToBeBlockScope(scope); expect(scope.block.type).toBe(AST_NODE_TYPES.BlockStatement); expect(scope.isStrict).toBeFalsy(); - expect(scope.variables).toHaveLength(1); - expect(scope.variables.map(variable => variable.name)).toEqual(['e']); + expect(variables).toHaveLength(1); + expect(variables.map(variable => variable.name)).toEqual(['e']); expect(scope.references.map(ref => ref.identifier.name)).toEqual([ 'e', 'a', diff --git a/packages/scope-manager/tests/eslint-scope/es6-class.test.ts b/packages/scope-manager/tests/eslint-scope/es6-class.test.ts index c0594ac7a2b1..a3c03b20518b 100644 --- a/packages/scope-manager/tests/eslint-scope/es6-class.test.ts +++ b/packages/scope-manager/tests/eslint-scope/es6-class.test.ts @@ -3,6 +3,7 @@ import { expectToBeClassScope, expectToBeFunctionScope, expectToBeGlobalScope, + getRealVariables, parseAndAnalyze, } from '../util'; @@ -19,29 +20,32 @@ describe('ES6 class', () => { expect(scopeManager.scopes).toHaveLength(3); let scope = scopeManager.scopes[0]; + let variables = getRealVariables(scope.variables); expectToBeGlobalScope(scope); expect(scope.block.type).toBe(AST_NODE_TYPES.Program); expect(scope.isStrict).toBeFalsy(); - expect(scope.variables).toHaveLength(1); - expect(scope.variables[0].name).toBe('Derived'); + expect(variables).toHaveLength(1); + expect(variables[0].name).toBe('Derived'); expect(scope.references).toHaveLength(1); expect(scope.references[0].identifier.name).toBe('Derived'); scope = scopeManager.scopes[1]; + variables = getRealVariables(scope.variables); expectToBeClassScope(scope); expect(scope.block.type).toBe(AST_NODE_TYPES.ClassDeclaration); expect(scope.isStrict).toBeTruthy(); - expect(scope.variables).toHaveLength(1); - expect(scope.variables[0].name).toBe('Derived'); + expect(variables).toHaveLength(1); + expect(variables[0].name).toBe('Derived'); expect(scope.references).toHaveLength(1); expect(scope.references[0].identifier.name).toBe('Base'); scope = scopeManager.scopes[2]; + variables = getRealVariables(scope.variables); expectToBeFunctionScope(scope); expect(scope.block.type).toBe(AST_NODE_TYPES.FunctionExpression); expect(scope.isStrict).toBeTruthy(); - expect(scope.variables).toHaveLength(1); - expect(scope.variables[0].name).toBe('arguments'); + expect(variables).toHaveLength(1); + expect(variables[0].name).toBe('arguments'); expect(scope.references).toHaveLength(0); }); @@ -56,27 +60,30 @@ describe('ES6 class', () => { expect(scopeManager.scopes).toHaveLength(3); let scope = scopeManager.scopes[0]; + let variables = getRealVariables(scope.variables); expectToBeGlobalScope(scope); expect(scope.block.type).toBe(AST_NODE_TYPES.Program); expect(scope.isStrict).toBeFalsy(); - expect(scope.variables).toHaveLength(0); + expect(variables).toHaveLength(0); expect(scope.references).toHaveLength(0); scope = scopeManager.scopes[1]; + variables = getRealVariables(scope.variables); expectToBeClassScope(scope); expect(scope.block.type).toBe(AST_NODE_TYPES.ClassExpression); expect(scope.isStrict).toBeTruthy(); - expect(scope.variables).toHaveLength(1); - expect(scope.variables[0].name).toBe('Derived'); + expect(variables).toHaveLength(1); + expect(variables[0].name).toBe('Derived'); expect(scope.references).toHaveLength(1); expect(scope.references[0].identifier.name).toBe('Base'); scope = scopeManager.scopes[2]; + variables = getRealVariables(scope.variables); expectToBeFunctionScope(scope); expect(scope.block.type).toBe(AST_NODE_TYPES.FunctionExpression); expect(scope.isStrict).toBeTruthy(); - expect(scope.variables).toHaveLength(1); - expect(scope.variables[0].name).toBe('arguments'); + expect(variables).toHaveLength(1); + expect(variables[0].name).toBe('arguments'); expect(scope.references).toHaveLength(0); }); @@ -91,25 +98,28 @@ describe('ES6 class', () => { expect(scopeManager.scopes).toHaveLength(3); let scope = scopeManager.scopes[0]; + let variables = getRealVariables(scope.variables); expectToBeGlobalScope(scope); expect(scope.block.type).toBe(AST_NODE_TYPES.Program); expect(scope.isStrict).toBeFalsy(); - expect(scope.variables).toHaveLength(0); + expect(variables).toHaveLength(0); expect(scope.references).toHaveLength(0); scope = scopeManager.scopes[1]; + variables = getRealVariables(scope.variables); expectToBeClassScope(scope); expect(scope.block.type).toBe(AST_NODE_TYPES.ClassExpression); - expect(scope.variables).toHaveLength(0); + expect(variables).toHaveLength(0); expect(scope.references).toHaveLength(1); expect(scope.references[0].identifier.name).toBe('Base'); scope = scopeManager.scopes[2]; + variables = getRealVariables(scope.variables); expectToBeFunctionScope(scope); expect(scope.block.type).toBe(AST_NODE_TYPES.FunctionExpression); expect(scope.isStrict).toBeTruthy(); - expect(scope.variables).toHaveLength(1); - expect(scope.variables[0].name).toBe('arguments'); + expect(variables).toHaveLength(1); + expect(variables[0].name).toBe('arguments'); expect(scope.references).toHaveLength(0); }); @@ -130,25 +140,28 @@ describe('ES6 class', () => { expect(scopeManager.scopes).toHaveLength(5); let scope = scopeManager.scopes[0]; + let variables = getRealVariables(scope.variables); expectToBeGlobalScope(scope); expect(scope.block.type).toBe(AST_NODE_TYPES.Program); expect(scope.isStrict).toBeFalsy(); scope = scopeManager.scopes[1]; + variables = getRealVariables(scope.variables); expectToBeFunctionScope(scope); expect(scope.block.type).toBe(AST_NODE_TYPES.FunctionExpression); expect(scope.isStrict).toBeFalsy(); - expect(scope.variables).toHaveLength(2); - expect(scope.variables[0].name).toBe('arguments'); - expect(scope.variables[1].name).toBe('yuyushiki'); + expect(variables).toHaveLength(2); + expect(variables[0].name).toBe('arguments'); + expect(variables[1].name).toBe('yuyushiki'); expect(scope.references).toHaveLength(1); expect(scope.references[0].identifier.name).toBe('yuyushiki'); scope = scopeManager.scopes[2]; + variables = getRealVariables(scope.variables); expectToBeClassScope(scope); expect(scope.block.type).toBe(AST_NODE_TYPES.ClassExpression); expect(scope.isStrict).toBeTruthy(); - expect(scope.variables).toHaveLength(0); + expect(variables).toHaveLength(0); expect(scope.references).toHaveLength(2); expect(scope.references[0].identifier.name).toBe('yuyushiki'); expect(scope.references[1].identifier.name).toBe('yuyushiki'); @@ -167,13 +180,14 @@ describe('ES6 class', () => { expect(scopeManager.scopes).toHaveLength(3); const scope = scopeManager.scopes[0]; + const variables = getRealVariables(scope.variables); expectToBeGlobalScope(scope); expect(scope.block.type).toBe(AST_NODE_TYPES.Program); expect(scope.isStrict).toBeFalsy(); - expect(scope.variables).toHaveLength(2); - expect(scope.variables[0].name).toBe('Shoe'); - expect(scope.variables[1].name).toBe('shoe'); + expect(variables).toHaveLength(2); + expect(variables[0].name).toBe('Shoe'); + expect(variables[1].name).toBe('shoe'); expect(scope.references).toHaveLength(2); expect(scope.references[0].identifier.name).toBe('shoe'); expect(scope.references[1].identifier.name).toBe('Shoe'); diff --git a/packages/scope-manager/tests/eslint-scope/es6-default-parameters.test.ts b/packages/scope-manager/tests/eslint-scope/es6-default-parameters.test.ts index f9868a575d69..3134930f5d19 100644 --- a/packages/scope-manager/tests/eslint-scope/es6-default-parameters.test.ts +++ b/packages/scope-manager/tests/eslint-scope/es6-default-parameters.test.ts @@ -1,4 +1,4 @@ -import { parseAndAnalyze } from '../util'; +import { getRealVariables, parseAndAnalyze } from '../util'; function forEach( obj: Record, @@ -27,15 +27,16 @@ describe('ES6 default parameters:', () => { expect(scopeManager.scopes).toHaveLength(2); // [global, foo] const scope = scopeManager.scopes[1]; + const variables = getRealVariables(scope.variables); - expect(scope.variables).toHaveLength(numVars); // [arguments?, a, b] + expect(variables).toHaveLength(numVars); // [arguments?, a, b] expect(scope.references).toHaveLength(1); const reference = scope.references[0]; expect(reference.from).toBe(scope); expect(reference.identifier.name).toBe('b'); - expect(reference.resolved).toBe(scope.variables[numVars - 1]); + expect(reference.resolved).toBe(variables[numVars - 1]); expect(reference.writeExpr).not.toBeUndefined(); expect(reference.isWrite()).toBeTruthy(); expect(reference.isRead()).toBeFalsy(); @@ -69,15 +70,18 @@ describe('ES6 default parameters:', () => { expect(scopeManager.scopes).toHaveLength(2); // [global, foo] const scope = scopeManager.scopes[1]; + const variables = getRealVariables(scope.variables); - expect(scope.variables).toHaveLength(numVars); // [arguments?, b] + expect(variables).toHaveLength(numVars); // [arguments?, b] expect(scope.references).toHaveLength(2); // [b, a] const reference = scope.references[1]; expect(reference.from).toBe(scope); expect(reference.identifier.name).toBe('a'); - expect(reference.resolved).toBe(scopeManager.scopes[0].variables[0]); + expect(reference.resolved).toBe( + getRealVariables(scopeManager.scopes[0].variables)[0], + ); expect(reference.writeExpr).toBeUndefined(); expect(reference.isWrite()).toBeFalsy(); expect(reference.isRead()).toBeTruthy(); @@ -111,15 +115,18 @@ describe('ES6 default parameters:', () => { expect(scopeManager.scopes).toHaveLength(2); // [global, foo] const scope = scopeManager.scopes[1]; + const variables = getRealVariables(scope.variables); - expect(scope.variables).toHaveLength(numVars); // [arguments?, b] + expect(variables).toHaveLength(numVars); // [arguments?, b] expect(scope.references).toHaveLength(2); // [b, a] const reference = scope.references[1]; expect(reference.from).toBe(scope); expect(reference.identifier.name).toBe('a'); - expect(reference.resolved).toBe(scopeManager.scopes[0].variables[0]); + expect(reference.resolved).toBe( + getRealVariables(scopeManager.scopes[0].variables)[0], + ); expect(reference.writeExpr).toBeUndefined(); expect(reference.isWrite()).toBeFalsy(); expect(reference.isRead()).toBeTruthy(); @@ -153,15 +160,18 @@ describe('ES6 default parameters:', () => { expect(scopeManager.scopes).toHaveLength(2); // [global, foo] const scope = scopeManager.scopes[1]; + const variables = getRealVariables(scope.variables); - expect(scope.variables).toHaveLength(numVars); // [arguments?, b] + expect(variables).toHaveLength(numVars); // [arguments?, b] expect(scope.references).toHaveLength(2); // [b, a] const reference = scope.references[1]; expect(reference.from).toBe(scope); expect(reference.identifier.name).toBe('a'); - expect(reference.resolved).toBe(scopeManager.scopes[0].variables[0]); + expect(reference.resolved).toBe( + getRealVariables(scopeManager.scopes[0].variables)[0], + ); expect(reference.writeExpr).toBeUndefined(); expect(reference.isWrite()).toBeFalsy(); expect(reference.isRead()).toBeTruthy(); @@ -194,15 +204,18 @@ describe('ES6 default parameters:', () => { expect(scopeManager.scopes).toHaveLength(3); // [global, foo, anonymous] const scope = scopeManager.scopes[2]; + const variables = getRealVariables(scope.variables); - expect(scope.variables).toHaveLength(1); // [arguments] + expect(variables).toHaveLength(1); // [arguments] expect(scope.references).toHaveLength(1); // [a] const reference = scope.references[0]; expect(reference.from).toBe(scope); expect(reference.identifier.name).toBe('a'); - expect(reference.resolved).toBe(scopeManager.scopes[0].variables[0]); + expect(reference.resolved).toBe( + getRealVariables(scopeManager.scopes[0].variables)[0], + ); expect(reference.writeExpr).toBeUndefined(); expect(reference.isWrite()).toBeFalsy(); expect(reference.isRead()).toBeTruthy(); @@ -236,15 +249,18 @@ describe('ES6 default parameters:', () => { expect(scopeManager.scopes).toHaveLength(2); // [global, foo] const scope = scopeManager.scopes[1]; + const variables = getRealVariables(scope.variables); - expect(scope.variables).toHaveLength(numVars); // [arguments?, b, a] + expect(variables).toHaveLength(numVars); // [arguments?, b, a] expect(scope.references).toHaveLength(2); // [b, a] const reference = scope.references[1]; expect(reference.from).toBe(scope); expect(reference.identifier.name).toBe('a'); - expect(reference.resolved).toBe(scopeManager.scopes[0].variables[0]); + expect(reference.resolved).toBe( + getRealVariables(scopeManager.scopes[0].variables)[0], + ); expect(reference.writeExpr).toBeUndefined(); expect(reference.isWrite()).toBeFalsy(); expect(reference.isRead()).toBeTruthy(); @@ -278,17 +294,16 @@ describe('ES6 default parameters:', () => { expect(scopeManager.scopes).toHaveLength(2); // [global, foo] const scope = scopeManager.scopes[1]; + const variables = getRealVariables(scope.variables); - expect(scope.variables).toHaveLength(numVars); // [arguments?, b, a] + expect(variables).toHaveLength(numVars); // [arguments?, b, a] expect(scope.references).toHaveLength(2); // [b, a] const reference = scope.references[1]; expect(reference.from).toBe(scope); expect(reference.identifier.name).toBe('a'); - expect(reference.resolved).toBe( - scope.variables[scope.variables.length - 1], - ); + expect(reference.resolved).toBe(variables[variables.length - 1]); expect(reference.writeExpr).toBeUndefined(); expect(reference.isWrite()).toBeFalsy(); expect(reference.isRead()).toBeTruthy(); @@ -328,7 +343,9 @@ describe('ES6 default parameters:', () => { expect(reference.from).toBe(scope); expect(reference.identifier.name).toBe('a'); - expect(reference.resolved).toBe(scopeManager.scopes[0].variables[0]); + expect(reference.resolved).toBe( + getRealVariables(scopeManager.scopes[0].variables)[0], + ); expect(reference.writeExpr).toBeUndefined(); expect(reference.isWrite()).toBeFalsy(); expect(reference.isRead()).toBeTruthy(); diff --git a/packages/scope-manager/tests/eslint-scope/es6-destructuring-assignments.test.ts b/packages/scope-manager/tests/eslint-scope/es6-destructuring-assignments.test.ts index 53837e27cd71..14cfeceb368d 100644 --- a/packages/scope-manager/tests/eslint-scope/es6-destructuring-assignments.test.ts +++ b/packages/scope-manager/tests/eslint-scope/es6-destructuring-assignments.test.ts @@ -4,6 +4,7 @@ import { expectToBeGlobalScope, expectToBeIdentifier, expectToBeParameterDefinition, + getRealVariables, parseAndAnalyze, } from '../util'; @@ -18,30 +19,32 @@ describe('ES6 destructuring assignments', () => { expect(scopeManager.scopes).toHaveLength(2); let scope = scopeManager.scopes[0]; + let variables = getRealVariables(scope.variables); expectToBeGlobalScope(scope); - expect(scope.variables).toHaveLength(0); + expect(variables).toHaveLength(0); expect(scope.references).toHaveLength(0); expect(scope['implicit'].leftToBeResolved).toHaveLength(1); expect(scope['implicit'].leftToBeResolved[0].identifier.name).toBe('array'); scope = scopeManager.scopes[1]; + variables = getRealVariables(scope.variables); expectToBeFunctionScope(scope); - expect(scope.variables).toHaveLength(4); - expect(scope.variables[0].name).toBe('arguments'); - expect(scope.variables[1].name).toBe('a'); - expect(scope.variables[2].name).toBe('b'); - expect(scope.variables[3].name).toBe('c'); + expect(variables).toHaveLength(4); + expect(variables[0].name).toBe('arguments'); + expect(variables[1].name).toBe('a'); + expect(variables[2].name).toBe('b'); + expect(variables[3].name).toBe('c'); expect(scope.references).toHaveLength(4); expect(scope.references[0].identifier.name).toBe('a'); expect(scope.references[0].isWrite()).toBeTruthy(); - expect(scope.references[0].resolved).toBe(scope.variables[1]); + expect(scope.references[0].resolved).toBe(variables[1]); expect(scope.references[1].identifier.name).toBe('b'); expect(scope.references[1].isWrite()).toBeTruthy(); - expect(scope.references[1].resolved).toBe(scope.variables[2]); + expect(scope.references[1].resolved).toBe(variables[2]); expect(scope.references[2].identifier.name).toBe('c'); expect(scope.references[2].isWrite()).toBeTruthy(); - expect(scope.references[2].resolved).toBe(scope.variables[3]); + expect(scope.references[2].resolved).toBe(variables[3]); expect(scope.references[3].identifier.name).toBe('array'); expect(scope.references[3].isWrite()).toBeFalsy(); }); @@ -56,29 +59,31 @@ describe('ES6 destructuring assignments', () => { expect(scopeManager.scopes).toHaveLength(3); // [global, function, for] let scope = scopeManager.scopes[0]; + let variables = getRealVariables(scope.variables); expectToBeGlobalScope(scope); - expect(scope.variables).toHaveLength(0); + expect(variables).toHaveLength(0); expect(scope.references).toHaveLength(0); expect(scope['implicit'].leftToBeResolved).toHaveLength(1); expect(scope['implicit'].leftToBeResolved[0].identifier.name).toBe('array'); scope = scopeManager.scopes[2]; + variables = getRealVariables(scope.variables); expectToBeForScope(scope); - expect(scope.variables).toHaveLength(3); - expect(scope.variables[0].name).toBe('a'); - expect(scope.variables[1].name).toBe('b'); - expect(scope.variables[2].name).toBe('c'); + expect(variables).toHaveLength(3); + expect(variables[0].name).toBe('a'); + expect(variables[1].name).toBe('b'); + expect(variables[2].name).toBe('c'); expect(scope.references).toHaveLength(4); expect(scope.references[0].identifier.name).toBe('a'); expect(scope.references[0].isWrite()).toBeTruthy(); - expect(scope.references[0].resolved).toBe(scope.variables[0]); + expect(scope.references[0].resolved).toBe(variables[0]); expect(scope.references[1].identifier.name).toBe('b'); expect(scope.references[1].isWrite()).toBeTruthy(); - expect(scope.references[1].resolved).toBe(scope.variables[1]); + expect(scope.references[1].resolved).toBe(variables[1]); expect(scope.references[2].identifier.name).toBe('c'); expect(scope.references[2].isWrite()).toBeTruthy(); - expect(scope.references[2].resolved).toBe(scope.variables[2]); + expect(scope.references[2].resolved).toBe(variables[2]); expect(scope.references[3].identifier.name).toBe('array'); expect(scope.references[3].isWrite()).toBeFalsy(); expect(scope.references[3].resolved).toBeNull(); @@ -94,40 +99,42 @@ describe('ES6 destructuring assignments', () => { expect(scopeManager.scopes).toHaveLength(2); let scope = scopeManager.scopes[0]; + let variables = getRealVariables(scope.variables); expectToBeGlobalScope(scope); - expect(scope.variables).toHaveLength(0); + expect(variables).toHaveLength(0); expect(scope.references).toHaveLength(0); expect(scope['implicit'].leftToBeResolved).toHaveLength(2); expect(scope['implicit'].leftToBeResolved[0].identifier.name).toBe('d'); expect(scope['implicit'].leftToBeResolved[1].identifier.name).toBe('array'); scope = scopeManager.scopes[1]; + variables = getRealVariables(scope.variables); expectToBeFunctionScope(scope); - expect(scope.variables).toHaveLength(4); - expect(scope.variables[0].name).toBe('arguments'); - expect(scope.variables[1].name).toBe('a'); - expect(scope.variables[2].name).toBe('b'); - expect(scope.variables[3].name).toBe('c'); + expect(variables).toHaveLength(4); + expect(variables[0].name).toBe('arguments'); + expect(variables[1].name).toBe('a'); + expect(variables[2].name).toBe('b'); + expect(variables[3].name).toBe('c'); expect(scope.references).toHaveLength(6); expect(scope.references[0].identifier.name).toBe('c'); expect(scope.references[0].isWrite()).toBeTruthy(); expectToBeIdentifier(scope.references[0].writeExpr); expect(scope.references[0].writeExpr.name).toBe('d'); - expect(scope.references[0].resolved).toBe(scope.variables[3]); + expect(scope.references[0].resolved).toBe(variables[3]); expect(scope.references[1].identifier.name).toBe('d'); expect(scope.references[1].isWrite()).toBeFalsy(); expect(scope.references[2].identifier.name).toBe('a'); expect(scope.references[2].isWrite()).toBeTruthy(); - expect(scope.references[2].resolved).toBe(scope.variables[1]); + expect(scope.references[2].resolved).toBe(variables[1]); expect(scope.references[3].identifier.name).toBe('b'); expect(scope.references[3].isWrite()).toBeTruthy(); - expect(scope.references[3].resolved).toBe(scope.variables[2]); + expect(scope.references[3].resolved).toBe(variables[2]); expect(scope.references[4].identifier.name).toBe('c'); expect(scope.references[4].isWrite()).toBeTruthy(); expectToBeIdentifier(scope.references[4].writeExpr); expect(scope.references[4].writeExpr.name).toBe('array'); - expect(scope.references[4].resolved).toBe(scope.variables[3]); + expect(scope.references[4].resolved).toBe(variables[3]); expect(scope.references[5].identifier.name).toBe('array'); expect(scope.references[5].isWrite()).toBeFalsy(); }); @@ -142,9 +149,10 @@ describe('ES6 destructuring assignments', () => { expect(scopeManager.scopes).toHaveLength(3); // [global, function, for] let scope = scopeManager.scopes[0]; + let variables = getRealVariables(scope.variables); expectToBeGlobalScope(scope); - expect(scope.variables).toHaveLength(0); + expect(variables).toHaveLength(0); expect(scope.references).toHaveLength(0); expect(scope['implicit'].leftToBeResolved).toHaveLength(2); expect(scope['implicit'].leftToBeResolved[0].identifier.name).toBe('d'); @@ -153,34 +161,35 @@ describe('ES6 destructuring assignments', () => { expectToBeForScope(scope['implicit'].leftToBeResolved[1].from); scope = scopeManager.scopes[2]; + variables = getRealVariables(scope.variables); expectToBeForScope(scope); - expect(scope.variables).toHaveLength(3); - expect(scope.variables[0].name).toBe('a'); - expect(scope.variables[1].name).toBe('b'); - expect(scope.variables[2].name).toBe('c'); + expect(variables).toHaveLength(3); + expect(variables[0].name).toBe('a'); + expect(variables[1].name).toBe('b'); + expect(variables[2].name).toBe('c'); expect(scope.references).toHaveLength(6); expect(scope.references[0].identifier.name).toBe('c'); expect(scope.references[0].isWrite()).toBeTruthy(); expectToBeIdentifier(scope.references[0].writeExpr); expect(scope.references[0].writeExpr.name).toBe('d'); - expect(scope.references[0].resolved).toBe(scope.variables[2]); + expect(scope.references[0].resolved).toBe(variables[2]); expect(scope.references[1].identifier.name).toBe('d'); expect(scope.references[1].isWrite()).toBeFalsy(); expect(scope.references[2].identifier.name).toBe('a'); expect(scope.references[2].isWrite()).toBeTruthy(); expectToBeIdentifier(scope.references[2].writeExpr); expect(scope.references[2].writeExpr.name).toBe('array'); - expect(scope.references[2].resolved).toBe(scope.variables[0]); + expect(scope.references[2].resolved).toBe(variables[0]); expect(scope.references[3].identifier.name).toBe('b'); expect(scope.references[3].isWrite()).toBeTruthy(); expectToBeIdentifier(scope.references[3].writeExpr); expect(scope.references[3].writeExpr.name).toBe('array'); - expect(scope.references[3].resolved).toBe(scope.variables[1]); + expect(scope.references[3].resolved).toBe(variables[1]); expect(scope.references[4].identifier.name).toBe('c'); expect(scope.references[4].isWrite()).toBeTruthy(); expectToBeIdentifier(scope.references[4].writeExpr); expect(scope.references[4].writeExpr.name).toBe('array'); - expect(scope.references[4].resolved).toBe(scope.variables[2]); + expect(scope.references[4].resolved).toBe(variables[2]); expect(scope.references[5].identifier.name).toBe('array'); expect(scope.references[5].isWrite()).toBeFalsy(); expect(scope.references[5].resolved).toBeNull(); @@ -196,9 +205,10 @@ describe('ES6 destructuring assignments', () => { expect(scopeManager.scopes).toHaveLength(2); let scope = scopeManager.scopes[0]; + let variables = getRealVariables(scope.variables); expectToBeGlobalScope(scope); - expect(scope.variables).toHaveLength(0); + expect(variables).toHaveLength(0); expect(scope.references).toHaveLength(0); expect(scope['implicit'].leftToBeResolved).toHaveLength(3); expect(scope['implicit'].leftToBeResolved[0].identifier.name).toBe('d'); @@ -206,28 +216,29 @@ describe('ES6 destructuring assignments', () => { expect(scope['implicit'].leftToBeResolved[2].identifier.name).toBe('array'); scope = scopeManager.scopes[1]; + variables = getRealVariables(scope.variables); expectToBeFunctionScope(scope); - expect(scope.variables).toHaveLength(4); - expect(scope.variables[0].name).toBe('arguments'); - expect(scope.variables[1].name).toBe('a'); - expect(scope.variables[2].name).toBe('b'); - expect(scope.variables[3].name).toBe('c'); + expect(variables).toHaveLength(4); + expect(variables[0].name).toBe('arguments'); + expect(variables[1].name).toBe('a'); + expect(variables[2].name).toBe('b'); + expect(variables[3].name).toBe('c'); expect(scope.references).toHaveLength(9); expect(scope.references[0].identifier.name).toBe('b'); expect(scope.references[0].isWrite()).toBeTruthy(); expectToBeIdentifier(scope.references[0].writeExpr); expect(scope.references[0].writeExpr.name).toBe('e'); - expect(scope.references[0].resolved).toBe(scope.variables[2]); + expect(scope.references[0].resolved).toBe(variables[2]); expect(scope.references[1].identifier.name).toBe('c'); expect(scope.references[1].isWrite()).toBeTruthy(); expectToBeIdentifier(scope.references[1].writeExpr); expect(scope.references[1].writeExpr.name).toBe('e'); - expect(scope.references[1].resolved).toBe(scope.variables[3]); + expect(scope.references[1].resolved).toBe(variables[3]); expect(scope.references[2].identifier.name).toBe('c'); expect(scope.references[2].isWrite()).toBeTruthy(); expectToBeIdentifier(scope.references[2].writeExpr); expect(scope.references[2].writeExpr.name).toBe('d'); - expect(scope.references[2].resolved).toBe(scope.variables[3]); + expect(scope.references[2].resolved).toBe(variables[3]); expect(scope.references[3].identifier.name).toBe('d'); expect(scope.references[3].isWrite()).toBeFalsy(); expect(scope.references[4].identifier.name).toBe('e'); @@ -236,17 +247,17 @@ describe('ES6 destructuring assignments', () => { expect(scope.references[5].isWrite()).toBeTruthy(); expectToBeIdentifier(scope.references[5].writeExpr); expect(scope.references[5].writeExpr.name).toBe('array'); - expect(scope.references[5].resolved).toBe(scope.variables[1]); + expect(scope.references[5].resolved).toBe(variables[1]); expect(scope.references[6].identifier.name).toBe('b'); expect(scope.references[6].isWrite()).toBeTruthy(); expectToBeIdentifier(scope.references[6].writeExpr); expect(scope.references[6].writeExpr.name).toBe('array'); - expect(scope.references[6].resolved).toBe(scope.variables[2]); + expect(scope.references[6].resolved).toBe(variables[2]); expect(scope.references[7].identifier.name).toBe('c'); expect(scope.references[7].isWrite()).toBeTruthy(); expectToBeIdentifier(scope.references[7].writeExpr); expect(scope.references[7].writeExpr.name).toBe('array'); - expect(scope.references[7].resolved).toBe(scope.variables[3]); + expect(scope.references[7].resolved).toBe(variables[3]); expect(scope.references[8].identifier.name).toBe('array'); expect(scope.references[8].isWrite()).toBeFalsy(); }); @@ -261,9 +272,10 @@ describe('ES6 destructuring assignments', () => { expect(scopeManager.scopes).toHaveLength(3); // [global, function, for] let scope = scopeManager.scopes[0]; + let variables = getRealVariables(scope.variables); expectToBeGlobalScope(scope); - expect(scope.variables).toHaveLength(0); + expect(variables).toHaveLength(0); expect(scope.references).toHaveLength(0); expect(scope['implicit'].leftToBeResolved).toHaveLength(3); expect(scope['implicit'].leftToBeResolved[0].identifier.name).toBe('d'); @@ -274,27 +286,28 @@ describe('ES6 destructuring assignments', () => { expectToBeForScope(scope['implicit'].leftToBeResolved[2].from); scope = scopeManager.scopes[2]; + variables = getRealVariables(scope.variables); expectToBeForScope(scope); - expect(scope.variables).toHaveLength(3); - expect(scope.variables[0].name).toBe('a'); - expect(scope.variables[1].name).toBe('b'); - expect(scope.variables[2].name).toBe('c'); + expect(variables).toHaveLength(3); + expect(variables[0].name).toBe('a'); + expect(variables[1].name).toBe('b'); + expect(variables[2].name).toBe('c'); expect(scope.references).toHaveLength(9); expect(scope.references[0].identifier.name).toBe('b'); expect(scope.references[0].isWrite()).toBeTruthy(); expectToBeIdentifier(scope.references[0].writeExpr); expect(scope.references[0].writeExpr.name).toBe('e'); - expect(scope.references[0].resolved).toBe(scope.variables[1]); + expect(scope.references[0].resolved).toBe(variables[1]); expect(scope.references[1].identifier.name).toBe('c'); expect(scope.references[1].isWrite()).toBeTruthy(); expectToBeIdentifier(scope.references[1].writeExpr); expect(scope.references[1].writeExpr.name).toBe('e'); - expect(scope.references[1].resolved).toBe(scope.variables[2]); + expect(scope.references[1].resolved).toBe(variables[2]); expect(scope.references[2].identifier.name).toBe('c'); expect(scope.references[2].isWrite()).toBeTruthy(); expectToBeIdentifier(scope.references[2].writeExpr); expect(scope.references[2].writeExpr.name).toBe('d'); - expect(scope.references[2].resolved).toBe(scope.variables[2]); + expect(scope.references[2].resolved).toBe(variables[2]); expect(scope.references[3].identifier.name).toBe('d'); expect(scope.references[3].isWrite()).toBeFalsy(); expect(scope.references[4].identifier.name).toBe('e'); @@ -303,17 +316,17 @@ describe('ES6 destructuring assignments', () => { expect(scope.references[5].isWrite()).toBeTruthy(); expectToBeIdentifier(scope.references[5].writeExpr); expect(scope.references[5].writeExpr.name).toBe('array'); - expect(scope.references[5].resolved).toBe(scope.variables[0]); + expect(scope.references[5].resolved).toBe(variables[0]); expect(scope.references[6].identifier.name).toBe('b'); expect(scope.references[6].isWrite()).toBeTruthy(); expectToBeIdentifier(scope.references[6].writeExpr); expect(scope.references[6].writeExpr.name).toBe('array'); - expect(scope.references[6].resolved).toBe(scope.variables[1]); + expect(scope.references[6].resolved).toBe(variables[1]); expect(scope.references[7].identifier.name).toBe('c'); expect(scope.references[7].isWrite()).toBeTruthy(); expectToBeIdentifier(scope.references[7].writeExpr); expect(scope.references[7].writeExpr.name).toBe('array'); - expect(scope.references[7].resolved).toBe(scope.variables[2]); + expect(scope.references[7].resolved).toBe(variables[2]); expect(scope.references[8].identifier.name).toBe('array'); expect(scope.references[8].isWrite()).toBeFalsy(); expect(scope.references[8].resolved).toBeNull(); @@ -330,38 +343,40 @@ describe('ES6 destructuring assignments', () => { expect(scopeManager.scopes).toHaveLength(2); let scope = scopeManager.scopes[0]; + let variables = getRealVariables(scope.variables); expectToBeGlobalScope(scope); - expect(scope.variables).toHaveLength(0); + expect(variables).toHaveLength(0); expect(scope.references).toHaveLength(0); expect(scope['implicit'].leftToBeResolved).toHaveLength(2); expect(scope['implicit'].leftToBeResolved[0].identifier.name).toBe('d'); expect(scope['implicit'].leftToBeResolved[1].identifier.name).toBe('array'); scope = scopeManager.scopes[1]; + variables = getRealVariables(scope.variables); expectToBeFunctionScope(scope); - expect(scope.variables).toHaveLength(4); - expect(scope.variables[0].name).toBe('arguments'); - expect(scope.variables[1].name).toBe('a'); - expect(scope.variables[2].name).toBe('b'); - expect(scope.variables[3].name).toBe('c'); + expect(variables).toHaveLength(4); + expect(variables[0].name).toBe('arguments'); + expect(variables[1].name).toBe('a'); + expect(variables[2].name).toBe('b'); + expect(variables[3].name).toBe('c'); expect(scope.references).toHaveLength(6); expect(scope.references[0].identifier.name).toBe('a'); expect(scope.references[0].isWrite()).toBeTruthy(); - expect(scope.references[0].resolved).toBe(scope.variables[1]); + expect(scope.references[0].resolved).toBe(variables[1]); expect(scope.references[1].identifier.name).toBe('b'); expect(scope.references[1].isWrite()).toBeTruthy(); - expect(scope.references[1].resolved).toBe(scope.variables[2]); + expect(scope.references[1].resolved).toBe(variables[2]); expect(scope.references[2].identifier.name).toBe('c'); expect(scope.references[2].isWrite()).toBeTruthy(); expectToBeIdentifier(scope.references[2].writeExpr); expect(scope.references[2].writeExpr.name).toBe('d'); - expect(scope.references[2].resolved).toBe(scope.variables[3]); + expect(scope.references[2].resolved).toBe(variables[3]); expect(scope.references[3].identifier.name).toBe('c'); expect(scope.references[3].isWrite()).toBeTruthy(); expectToBeIdentifier(scope.references[3].writeExpr); expect(scope.references[3].writeExpr.name).toBe('array'); - expect(scope.references[3].resolved).toBe(scope.variables[3]); + expect(scope.references[3].resolved).toBe(variables[3]); expect(scope.references[4].identifier.name).toBe('d'); expect(scope.references[4].isWrite()).toBeFalsy(); expect(scope.references[5].identifier.name).toBe('array'); @@ -379,32 +394,34 @@ describe('ES6 destructuring assignments', () => { expect(scopeManager.scopes).toHaveLength(2); let scope = scopeManager.scopes[0]; + let variables = getRealVariables(scope.variables); expectToBeGlobalScope(scope); - expect(scope.variables).toHaveLength(0); + expect(variables).toHaveLength(0); expect(scope.references).toHaveLength(0); expect(scope['implicit'].leftToBeResolved).toHaveLength(2); expect(scope['implicit'].leftToBeResolved[0].identifier.name).toBe('d'); expect(scope['implicit'].leftToBeResolved[1].identifier.name).toBe('array'); scope = scopeManager.scopes[1]; + variables = getRealVariables(scope.variables); expectToBeFunctionScope(scope); - expect(scope.variables).toHaveLength(2); - expect(scope.variables[0].name).toBe('arguments'); - expect(scope.variables[1].name).toBe('obj'); + expect(variables).toHaveLength(2); + expect(variables[0].name).toBe('arguments'); + expect(variables[1].name).toBe('obj'); expect(scope.references).toHaveLength(5); expect(scope.references[0].identifier.name).toBe('obj'); // obj.a expect(scope.references[0].isWrite()).toBeFalsy(); expect(scope.references[0].isRead()).toBeTruthy(); - expect(scope.references[0].resolved).toBe(scope.variables[1]); + expect(scope.references[0].resolved).toBe(variables[1]); expect(scope.references[1].identifier.name).toBe('obj'); // obj.b expect(scope.references[1].isWrite()).toBeFalsy(); expect(scope.references[1].isRead()).toBeTruthy(); - expect(scope.references[1].resolved).toBe(scope.variables[1]); + expect(scope.references[1].resolved).toBe(variables[1]); expect(scope.references[2].identifier.name).toBe('obj'); // obj.c expect(scope.references[2].isWrite()).toBeFalsy(); expect(scope.references[2].isRead()).toBeTruthy(); - expect(scope.references[2].resolved).toBe(scope.variables[1]); + expect(scope.references[2].resolved).toBe(variables[1]); expect(scope.references[3].identifier.name).toBe('d'); expect(scope.references[3].isWrite()).toBeFalsy(); expect(scope.references[3].isRead()).toBeTruthy(); @@ -423,30 +440,32 @@ describe('ES6 destructuring assignments', () => { expect(scopeManager.scopes).toHaveLength(2); let scope = scopeManager.scopes[0]; + let variables = getRealVariables(scope.variables); expectToBeGlobalScope(scope); - expect(scope.variables).toHaveLength(0); + expect(variables).toHaveLength(0); expect(scope.references).toHaveLength(0); expect(scope['implicit'].leftToBeResolved).toHaveLength(1); expect(scope['implicit'].leftToBeResolved[0].identifier.name).toBe('array'); scope = scopeManager.scopes[1]; + variables = getRealVariables(scope.variables); expectToBeFunctionScope(scope); - expect(scope.variables).toHaveLength(4); - expect(scope.variables[0].name).toBe('arguments'); - expect(scope.variables[1].name).toBe('a'); - expect(scope.variables[2].name).toBe('b'); - expect(scope.variables[3].name).toBe('c'); + expect(variables).toHaveLength(4); + expect(variables[0].name).toBe('arguments'); + expect(variables[1].name).toBe('a'); + expect(variables[2].name).toBe('b'); + expect(variables[3].name).toBe('c'); expect(scope.references).toHaveLength(4); expect(scope.references[0].identifier.name).toBe('a'); expect(scope.references[0].isWrite()).toBeTruthy(); - expect(scope.references[0].resolved).toBe(scope.variables[1]); + expect(scope.references[0].resolved).toBe(variables[1]); expect(scope.references[1].identifier.name).toBe('b'); expect(scope.references[1].isWrite()).toBeTruthy(); - expect(scope.references[1].resolved).toBe(scope.variables[2]); + expect(scope.references[1].resolved).toBe(variables[2]); expect(scope.references[2].identifier.name).toBe('c'); expect(scope.references[2].isWrite()).toBeTruthy(); - expect(scope.references[2].resolved).toBe(scope.variables[3]); + expect(scope.references[2].resolved).toBe(variables[3]); expect(scope.references[3].identifier.name).toBe('array'); expect(scope.references[3].isWrite()).toBeFalsy(); }); @@ -461,30 +480,32 @@ describe('ES6 destructuring assignments', () => { expect(scopeManager.scopes).toHaveLength(2); let scope = scopeManager.scopes[0]; + let variables = getRealVariables(scope.variables); expectToBeGlobalScope(scope); - expect(scope.variables).toHaveLength(0); + expect(variables).toHaveLength(0); expect(scope.references).toHaveLength(0); expect(scope['implicit'].leftToBeResolved).toHaveLength(1); expect(scope['implicit'].leftToBeResolved[0].identifier.name).toBe('array'); scope = scopeManager.scopes[1]; + variables = getRealVariables(scope.variables); expectToBeFunctionScope(scope); - expect(scope.variables).toHaveLength(4); - expect(scope.variables[0].name).toBe('arguments'); - expect(scope.variables[1].name).toBe('a'); - expect(scope.variables[2].name).toBe('b'); - expect(scope.variables[3].name).toBe('rest'); + expect(variables).toHaveLength(4); + expect(variables[0].name).toBe('arguments'); + expect(variables[1].name).toBe('a'); + expect(variables[2].name).toBe('b'); + expect(variables[3].name).toBe('rest'); expect(scope.references).toHaveLength(4); expect(scope.references[0].identifier.name).toBe('a'); expect(scope.references[0].isWrite()).toBeTruthy(); - expect(scope.references[0].resolved).toBe(scope.variables[1]); + expect(scope.references[0].resolved).toBe(variables[1]); expect(scope.references[1].identifier.name).toBe('b'); expect(scope.references[1].isWrite()).toBeTruthy(); - expect(scope.references[1].resolved).toBe(scope.variables[2]); + expect(scope.references[1].resolved).toBe(variables[2]); expect(scope.references[2].identifier.name).toBe('rest'); expect(scope.references[2].isWrite()).toBeTruthy(); - expect(scope.references[2].resolved).toBe(scope.variables[3]); + expect(scope.references[2].resolved).toBe(variables[3]); expect(scope.references[3].identifier.name).toBe('array'); expect(scope.references[3].isWrite()).toBeFalsy(); @@ -497,20 +518,22 @@ describe('ES6 destructuring assignments', () => { expect(scopeManager.scopes).toHaveLength(2); scope = scopeManager.scopes[0]; + variables = getRealVariables(scope.variables); expectToBeGlobalScope(scope); - expect(scope.variables).toHaveLength(0); + expect(variables).toHaveLength(0); expect(scope.references).toHaveLength(0); expect(scope['implicit'].leftToBeResolved).toHaveLength(1); expect(scope['implicit'].leftToBeResolved[0].identifier.name).toBe('array'); scope = scopeManager.scopes[1]; + variables = getRealVariables(scope.variables); expectToBeFunctionScope(scope); - expect(scope.variables).toHaveLength(6); + expect(variables).toHaveLength(6); const expectedVariableNames = ['arguments', 'a', 'b', 'c', 'd', 'rest']; for (let index = 0; index < expectedVariableNames.length; index++) { - expect(scope.variables[index].name).toBe(expectedVariableNames[index]); + expect(variables[index].name).toBe(expectedVariableNames[index]); } expect(scope.references).toHaveLength(6); @@ -542,9 +565,10 @@ describe('ES6 destructuring assignments', () => { expect(scopeManager.scopes).toHaveLength(2); let scope = scopeManager.scopes[0]; + let variables = getRealVariables(scope.variables); expectToBeGlobalScope(scope); - expect(scope.variables).toHaveLength(0); + expect(variables).toHaveLength(0); expect(scope.references).toHaveLength(0); expect(scope['implicit'].leftToBeResolved).toHaveLength(1); expect(scope['implicit'].leftToBeResolved[0].identifier.name).toBe( @@ -552,22 +576,23 @@ describe('ES6 destructuring assignments', () => { ); scope = scopeManager.scopes[1]; + variables = getRealVariables(scope.variables); expectToBeFunctionScope(scope); - expect(scope.variables).toHaveLength(4); - expect(scope.variables[0].name).toBe('arguments'); - expect(scope.variables[1].name).toBe('shorthand'); - expect(scope.variables[2].name).toBe('value'); - expect(scope.variables[3].name).toBe('world'); + expect(variables).toHaveLength(4); + expect(variables[0].name).toBe('arguments'); + expect(variables[1].name).toBe('shorthand'); + expect(variables[2].name).toBe('value'); + expect(variables[3].name).toBe('world'); expect(scope.references).toHaveLength(4); expect(scope.references[0].identifier.name).toBe('shorthand'); expect(scope.references[0].isWrite()).toBeTruthy(); - expect(scope.references[0].resolved).toBe(scope.variables[1]); + expect(scope.references[0].resolved).toBe(variables[1]); expect(scope.references[1].identifier.name).toBe('value'); expect(scope.references[1].isWrite()).toBeTruthy(); - expect(scope.references[1].resolved).toBe(scope.variables[2]); + expect(scope.references[1].resolved).toBe(variables[2]); expect(scope.references[2].identifier.name).toBe('world'); expect(scope.references[2].isWrite()).toBeTruthy(); - expect(scope.references[2].resolved).toBe(scope.variables[3]); + expect(scope.references[2].resolved).toBe(variables[3]); expect(scope.references[3].identifier.name).toBe('object'); expect(scope.references[3].isWrite()).toBeFalsy(); }); @@ -588,9 +613,10 @@ describe('ES6 destructuring assignments', () => { expect(scopeManager.scopes).toHaveLength(2); let scope = scopeManager.scopes[0]; + let variables = getRealVariables(scope.variables); expectToBeGlobalScope(scope); - expect(scope.variables).toHaveLength(0); + expect(variables).toHaveLength(0); expect(scope.references).toHaveLength(0); expect(scope['implicit'].leftToBeResolved).toHaveLength(1); expect(scope['implicit'].leftToBeResolved[0].identifier.name).toBe( @@ -598,8 +624,9 @@ describe('ES6 destructuring assignments', () => { ); scope = scopeManager.scopes[1]; + variables = getRealVariables(scope.variables); expectToBeFunctionScope(scope); - expect(scope.variables).toHaveLength(8); + expect(variables).toHaveLength(8); const expectedVariableNames = [ 'arguments', 'shorthand', @@ -612,7 +639,7 @@ describe('ES6 destructuring assignments', () => { ]; for (let index = 0; index < expectedVariableNames.length; index++) { - expect(scope.variables[index].name).toBe(expectedVariableNames[index]); + expect(variables[index].name).toBe(expectedVariableNames[index]); } expect(scope.references).toHaveLength(8); const expectedReferenceNames = [ @@ -645,9 +672,10 @@ describe('ES6 destructuring assignments', () => { expect(scopeManager.scopes).toHaveLength(2); let scope = scopeManager.scopes[0]; + let variables = getRealVariables(scope.variables); expectToBeGlobalScope(scope); - expect(scope.variables).toHaveLength(0); + expect(variables).toHaveLength(0); expect(scope.references).toHaveLength(0); expect(scope['implicit'].leftToBeResolved).toHaveLength(4); expect( @@ -655,9 +683,10 @@ describe('ES6 destructuring assignments', () => { ).toEqual(['a', 'b', 'c', 'array']); scope = scopeManager.scopes[1]; + variables = getRealVariables(scope.variables); expectToBeFunctionScope(scope); - expect(scope.variables).toHaveLength(1); - expect(scope.variables[0].name).toBe('arguments'); + expect(variables).toHaveLength(1); + expect(variables[0].name).toBe('arguments'); expect(scope.references).toHaveLength(4); expect(scope.references[0].identifier.name).toBe('a'); expect(scope.references[0].isWrite()).toBeTruthy(); @@ -683,31 +712,33 @@ describe('ES6 destructuring assignments', () => { expect(scopeManager.scopes).toHaveLength(2); let scope = scopeManager.scopes[0]; + let variables = getRealVariables(scope.variables); expectToBeGlobalScope(scope); - expect(scope.variables).toHaveLength(0); + expect(variables).toHaveLength(0); expect(scope.references).toHaveLength(0); expect(scope['implicit'].leftToBeResolved).toHaveLength(1); expect(scope['implicit'].leftToBeResolved[0].identifier.name).toBe('array'); scope = scopeManager.scopes[1]; + variables = getRealVariables(scope.variables); expectToBeFunctionScope(scope); - expect(scope.variables).toHaveLength(2); - expect(scope.variables[0].name).toBe('arguments'); - expect(scope.variables[1].name).toBe('obj'); + expect(variables).toHaveLength(2); + expect(variables[0].name).toBe('arguments'); + expect(variables[1].name).toBe('obj'); expect(scope.references).toHaveLength(4); expect(scope.references[0].identifier.name).toBe('obj'); expect(scope.references[0].isWrite()).toBeFalsy(); expect(scope.references[0].isRead()).toBeTruthy(); - expect(scope.references[0].resolved).toBe(scope.variables[1]); + expect(scope.references[0].resolved).toBe(variables[1]); expect(scope.references[1].identifier.name).toBe('obj'); expect(scope.references[1].isWrite()).toBeFalsy(); expect(scope.references[1].isRead()).toBeTruthy(); - expect(scope.references[1].resolved).toBe(scope.variables[1]); + expect(scope.references[1].resolved).toBe(variables[1]); expect(scope.references[2].identifier.name).toBe('obj'); expect(scope.references[2].isWrite()).toBeFalsy(); expect(scope.references[2].isRead()).toBeTruthy(); - expect(scope.references[2].resolved).toBe(scope.variables[1]); + expect(scope.references[2].resolved).toBe(variables[1]); expect(scope.references[3].identifier.name).toBe('array'); expect(scope.references[3].isWrite()).toBeFalsy(); expect(scope.references[3].isRead()).toBeTruthy(); @@ -723,9 +754,10 @@ describe('ES6 destructuring assignments', () => { expect(scopeManager.scopes).toHaveLength(2); let scope = scopeManager.scopes[0]; + let variables = getRealVariables(scope.variables); expectToBeGlobalScope(scope); - expect(scope.variables).toHaveLength(0); + expect(variables).toHaveLength(0); expect(scope.references).toHaveLength(0); expect(scope['implicit'].leftToBeResolved).toHaveLength(4); expect( @@ -733,9 +765,10 @@ describe('ES6 destructuring assignments', () => { ).toEqual(['a', 'b', 'rest', 'array']); scope = scopeManager.scopes[1]; + variables = getRealVariables(scope.variables); expectToBeFunctionScope(scope); - expect(scope.variables).toHaveLength(1); - expect(scope.variables[0].name).toBe('arguments'); + expect(variables).toHaveLength(1); + expect(variables[0].name).toBe('arguments'); expect(scope.references).toHaveLength(4); expect(scope.references[0].identifier.name).toBe('a'); expect(scope.references[0].isWrite()).toBeTruthy(); @@ -758,8 +791,9 @@ describe('ES6 destructuring assignments', () => { expect(scopeManager.scopes).toHaveLength(2); scope = scopeManager.scopes[0]; + variables = getRealVariables(scope.variables); expectToBeGlobalScope(scope); - expect(scope.variables).toHaveLength(0); + expect(variables).toHaveLength(0); expect(scope.references).toHaveLength(0); expect(scope['implicit'].leftToBeResolved).toHaveLength(6); expect( @@ -767,10 +801,11 @@ describe('ES6 destructuring assignments', () => { ).toEqual(['a', 'b', 'c', 'd', 'rest', 'array']); scope = scopeManager.scopes[1]; + variables = getRealVariables(scope.variables); expectToBeFunctionScope(scope); - expect(scope.variables).toHaveLength(1); - expect(scope.variables[0].name).toBe('arguments'); + expect(variables).toHaveLength(1); + expect(variables[0].name).toBe('arguments'); expect(scope.references).toHaveLength(6); const expectedReferenceNames = ['a', 'b', 'c', 'd', 'rest']; @@ -796,9 +831,10 @@ describe('ES6 destructuring assignments', () => { expect(scopeManager.scopes).toHaveLength(2); let scope = scopeManager.scopes[0]; + let variables = getRealVariables(scope.variables); expectToBeGlobalScope(scope); - expect(scope.variables).toHaveLength(0); + expect(variables).toHaveLength(0); expect(scope.references).toHaveLength(0); expect(scope['implicit'].leftToBeResolved).toHaveLength(4); expect( @@ -806,9 +842,10 @@ describe('ES6 destructuring assignments', () => { ).toEqual(['a', 'b', 'obj', 'array']); scope = scopeManager.scopes[1]; + variables = getRealVariables(scope.variables); expectToBeFunctionScope(scope); - expect(scope.variables).toHaveLength(1); - expect(scope.variables[0].name).toBe('arguments'); + expect(variables).toHaveLength(1); + expect(variables[0].name).toBe('arguments'); expect(scope.references).toHaveLength(4); expect(scope.references[0].identifier.name).toBe('a'); expect(scope.references[0].isWrite()).toBeTruthy(); @@ -838,9 +875,10 @@ describe('ES6 destructuring assignments', () => { expect(scopeManager.scopes).toHaveLength(2); let scope = scopeManager.scopes[0]; + let variables = getRealVariables(scope.variables); expectToBeGlobalScope(scope); - expect(scope.variables).toHaveLength(0); + expect(variables).toHaveLength(0); expect(scope.references).toHaveLength(0); expect(scope['implicit'].leftToBeResolved).toHaveLength(4); expect( @@ -848,9 +886,10 @@ describe('ES6 destructuring assignments', () => { ).toEqual(['shorthand', 'value', 'world', 'object']); scope = scopeManager.scopes[1]; + variables = getRealVariables(scope.variables); expectToBeFunctionScope(scope); - expect(scope.variables).toHaveLength(1); - expect(scope.variables[0].name).toBe('arguments'); + expect(variables).toHaveLength(1); + expect(variables[0].name).toBe('arguments'); expect(scope.references).toHaveLength(4); expect(scope.references[0].identifier.name).toBe('shorthand'); expect(scope.references[0].isWrite()).toBeTruthy(); @@ -881,9 +920,10 @@ describe('ES6 destructuring assignments', () => { expect(scopeManager.scopes).toHaveLength(2); let scope = scopeManager.scopes[0]; + let variables = getRealVariables(scope.variables); expectToBeGlobalScope(scope); - expect(scope.variables).toHaveLength(0); + expect(variables).toHaveLength(0); expect(scope.references).toHaveLength(0); expect(scope['implicit'].leftToBeResolved).toHaveLength(8); expect( @@ -891,9 +931,10 @@ describe('ES6 destructuring assignments', () => { ).toEqual(['shorthand', 'a', 'b', 'c', 'd', 'e', 'world', 'object']); scope = scopeManager.scopes[1]; + variables = getRealVariables(scope.variables); expectToBeFunctionScope(scope); - expect(scope.variables).toHaveLength(1); - expect(scope.variables[0].name).toBe('arguments'); + expect(variables).toHaveLength(1); + expect(variables[0].name).toBe('arguments'); expect(scope.references).toHaveLength(8); const expectedReferenceNames = [ 'shorthand', @@ -924,21 +965,23 @@ describe('ES6 destructuring assignments', () => { expect(scopeManager.scopes).toHaveLength(2); let scope = scopeManager.scopes[0]; + let variables = getRealVariables(scope.variables); expectToBeGlobalScope(scope); - expect(scope.variables).toHaveLength(0); + expect(variables).toHaveLength(0); expect(scope.references).toHaveLength(1); expect(scope.references[0].identifier.name).toBe('array'); expect(scope['implicit'].leftToBeResolved).toHaveLength(1); expect(scope['implicit'].leftToBeResolved[0].identifier.name).toBe('array'); scope = scopeManager.scopes[1]; + variables = getRealVariables(scope.variables); expectToBeFunctionScope(scope); - expect(scope.variables).toHaveLength(4); - expect(scope.variables[0].name).toBe('arguments'); - expect(scope.variables[1].name).toBe('a'); - expect(scope.variables[2].name).toBe('b'); - expect(scope.variables[3].name).toBe('c'); + expect(variables).toHaveLength(4); + expect(variables[0].name).toBe('arguments'); + expect(variables[1].name).toBe('a'); + expect(variables[2].name).toBe('b'); + expect(variables[3].name).toBe('c'); expect(scope.references).toHaveLength(0); }); @@ -951,26 +994,28 @@ describe('ES6 destructuring assignments', () => { expect(scopeManager.scopes).toHaveLength(2); let scope = scopeManager.scopes[0]; + let variables = getRealVariables(scope.variables); expectToBeGlobalScope(scope); - expect(scope.variables).toHaveLength(0); + expect(variables).toHaveLength(0); expect(scope.references).toHaveLength(1); expect(scope.references[0].identifier.name).toBe('array'); expect(scope['implicit'].leftToBeResolved).toHaveLength(1); expect(scope['implicit'].leftToBeResolved[0].identifier.name).toBe('array'); scope = scopeManager.scopes[1]; + variables = getRealVariables(scope.variables); expectToBeFunctionScope(scope); - expect(scope.variables).toHaveLength(5); - expect(scope.variables[0].name).toBe('arguments'); - expect(scope.variables[1].name).toBe('a'); - expect(scope.variables[2].name).toBe('b'); - expect(scope.variables[3].name).toBe('rest'); - expectToBeParameterDefinition(scope.variables[3].defs[0]); - expect(scope.variables[3].defs[0].rest).toBeTruthy(); - expect(scope.variables[4].name).toBe('rest2'); - expectToBeParameterDefinition(scope.variables[4].defs[0]); - expect(scope.variables[4].defs[0].rest).toBeTruthy(); + expect(variables).toHaveLength(5); + expect(variables[0].name).toBe('arguments'); + expect(variables[1].name).toBe('a'); + expect(variables[2].name).toBe('b'); + expect(variables[3].name).toBe('rest'); + expectToBeParameterDefinition(variables[3].defs[0]); + expect(variables[3].defs[0].rest).toBeTruthy(); + expect(variables[4].name).toBe('rest2'); + expectToBeParameterDefinition(variables[4].defs[0]); + expect(variables[4].defs[0].rest).toBeTruthy(); expect(scope.references).toHaveLength(0); }); @@ -988,9 +1033,10 @@ describe('ES6 destructuring assignments', () => { expect(scopeManager.scopes).toHaveLength(2); let scope = scopeManager.scopes[0]; + let variables = getRealVariables(scope.variables); expectToBeGlobalScope(scope); - expect(scope.variables).toHaveLength(0); + expect(variables).toHaveLength(0); expect(scope.references).toHaveLength(1); expect(scope.references[0].identifier.name).toBe('object'); expect(scope['implicit'].leftToBeResolved).toHaveLength(1); @@ -999,12 +1045,13 @@ describe('ES6 destructuring assignments', () => { ); scope = scopeManager.scopes[1]; + variables = getRealVariables(scope.variables); expectToBeFunctionScope(scope); - expect(scope.variables).toHaveLength(4); - expect(scope.variables[0].name).toBe('arguments'); - expect(scope.variables[1].name).toBe('shorthand'); - expect(scope.variables[2].name).toBe('value'); - expect(scope.variables[3].name).toBe('world'); + expect(variables).toHaveLength(4); + expect(variables[0].name).toBe('arguments'); + expect(variables[1].name).toBe('shorthand'); + expect(variables[2].name).toBe('value'); + expect(variables[3].name).toBe('world'); expect(scope.references).toHaveLength(0); }); @@ -1022,9 +1069,10 @@ describe('ES6 destructuring assignments', () => { expect(scopeManager.scopes).toHaveLength(2); let scope = scopeManager.scopes[0]; + let variables = getRealVariables(scope.variables); expectToBeGlobalScope(scope); - expect(scope.variables).toHaveLength(0); + expect(variables).toHaveLength(0); expect(scope.references).toHaveLength(1); expect(scope.references[0].identifier.name).toBe('object'); expect(scope['implicit'].leftToBeResolved).toHaveLength(1); @@ -1033,8 +1081,9 @@ describe('ES6 destructuring assignments', () => { ); scope = scopeManager.scopes[1]; + variables = getRealVariables(scope.variables); expectToBeFunctionScope(scope); - expect(scope.variables).toHaveLength(8); + expect(variables).toHaveLength(8); const expectedVariableNames = [ 'arguments', 'shorthand', @@ -1047,7 +1096,7 @@ describe('ES6 destructuring assignments', () => { ]; for (let index = 0; index < expectedVariableNames.length; index++) { - expect(scope.variables[index].name).toBe(expectedVariableNames[index]); + expect(variables[index].name).toBe(expectedVariableNames[index]); } expect(scope.references).toHaveLength(0); }); @@ -1062,18 +1111,20 @@ describe('ES6 destructuring assignments', () => { expect(scopeManager.scopes).toHaveLength(2); let scope = scopeManager.scopes[0]; + let variables = getRealVariables(scope.variables); expectToBeGlobalScope(scope); - expect(scope.variables).toHaveLength(0); + expect(variables).toHaveLength(0); expect(scope.references).toHaveLength(0); scope = scopeManager.scopes[1]; + variables = getRealVariables(scope.variables); expectToBeFunctionScope(scope); - expect(scope.variables).toHaveLength(5); + expect(variables).toHaveLength(5); const expectedVariableNames = ['arguments', 'a', 'b', 'c', 'd']; for (let index = 0; index < expectedVariableNames.length; index++) { - expect(scope.variables[index].name).toBe(expectedVariableNames[index]); + expect(variables[index].name).toBe(expectedVariableNames[index]); } expect(scope.references).toHaveLength(6); const expectedReferenceNames = [ @@ -1102,18 +1153,20 @@ describe('ES6 destructuring assignments', () => { expect(scopeManager.scopes).toHaveLength(2); let scope = scopeManager.scopes[0]; + let variables = getRealVariables(scope.variables); expectToBeGlobalScope(scope); - expect(scope.variables).toHaveLength(0); + expect(variables).toHaveLength(0); expect(scope.references).toHaveLength(0); scope = scopeManager.scopes[1]; + variables = getRealVariables(scope.variables); expectToBeFunctionScope(scope); - expect(scope.variables).toHaveLength(5); + expect(variables).toHaveLength(5); const expectedVariableNames = ['arguments', 'a', 'b', 'c', 'd']; for (let index = 0; index < expectedVariableNames.length; index++) { - expect(scope.variables[index].name).toBe(expectedVariableNames[index]); + expect(variables[index].name).toBe(expectedVariableNames[index]); } expect(scope.references).toHaveLength(7); const expectedReferenceNames = [ @@ -1143,18 +1196,20 @@ describe('ES6 destructuring assignments', () => { expect(scopeManager.scopes).toHaveLength(2); let scope = scopeManager.scopes[0]; + let variables = getRealVariables(scope.variables); expectToBeGlobalScope(scope); - expect(scope.variables).toHaveLength(0); + expect(variables).toHaveLength(0); expect(scope.references).toHaveLength(0); scope = scopeManager.scopes[1]; + variables = getRealVariables(scope.variables); expectToBeFunctionScope(scope); - expect(scope.variables).toHaveLength(5); + expect(variables).toHaveLength(5); const expectedVariableNames = ['arguments', 'a', 'b', 'c', 'd']; for (let index = 0; index < expectedVariableNames.length; index++) { - expect(scope.variables[index].name).toBe(expectedVariableNames[index]); + expect(variables[index].name).toBe(expectedVariableNames[index]); } expect(scope.references).toHaveLength(10); const expectedReferenceNames = [ diff --git a/packages/scope-manager/tests/eslint-scope/es6-export.test.ts b/packages/scope-manager/tests/eslint-scope/es6-export.test.ts index a172721a28f2..ecb6d261b54d 100644 --- a/packages/scope-manager/tests/eslint-scope/es6-export.test.ts +++ b/packages/scope-manager/tests/eslint-scope/es6-export.test.ts @@ -4,6 +4,7 @@ import { expectToBeGlobalScope, expectToBeModuleScope, expectToBeVariableDefinition, + getRealVariables, parseAndAnalyze, } from '../util'; @@ -15,15 +16,17 @@ describe('export declaration', () => { expect(scopeManager.scopes).toHaveLength(2); let scope = scopeManager.scopes[0]; + let variables = getRealVariables(scope.variables); expectToBeGlobalScope(scope); - expect(scope.variables).toHaveLength(0); + expect(variables).toHaveLength(0); expect(scope.references).toHaveLength(0); scope = scopeManager.scopes[1]; + variables = getRealVariables(scope.variables); expectToBeModuleScope(scope); - expect(scope.variables).toHaveLength(1); - expect(scope.variables[0].name).toBe('v'); - expectToBeVariableDefinition(scope.variables[0].defs[0]); + expect(variables).toHaveLength(1); + expect(variables[0].name).toBe('v'); + expectToBeVariableDefinition(variables[0].defs[0]); expect(scope.references).toHaveLength(0); }); @@ -36,21 +39,24 @@ describe('export declaration', () => { expect(scopeManager.scopes).toHaveLength(3); let scope = scopeManager.scopes[0]; + let variables = getRealVariables(scope.variables); expectToBeGlobalScope(scope); - expect(scope.variables).toHaveLength(0); + expect(variables).toHaveLength(0); expect(scope.references).toHaveLength(0); scope = scopeManager.scopes[1]; + variables = getRealVariables(scope.variables); expectToBeModuleScope(scope); - expect(scope.variables).toHaveLength(1); - expect(scope.variables[0].name).toBe('f'); - expectToBeFunctionNameDefinition(scope.variables[0].defs[0]); + expect(variables).toHaveLength(1); + expect(variables[0].name).toBe('f'); + expectToBeFunctionNameDefinition(variables[0].defs[0]); expect(scope.references).toHaveLength(0); scope = scopeManager.scopes[2]; + variables = getRealVariables(scope.variables); expectToBeFunctionScope(scope); - expect(scope.variables).toHaveLength(1); - expect(scope.variables[0].name).toBe('arguments'); + expect(variables).toHaveLength(1); + expect(variables[0].name).toBe('arguments'); expect(scope.references).toHaveLength(0); }); @@ -63,19 +69,22 @@ describe('export declaration', () => { expect(scopeManager.scopes).toHaveLength(3); let scope = scopeManager.scopes[0]; + let variables = getRealVariables(scope.variables); expectToBeGlobalScope(scope); - expect(scope.variables).toHaveLength(0); + expect(variables).toHaveLength(0); expect(scope.references).toHaveLength(0); scope = scopeManager.scopes[1]; + variables = getRealVariables(scope.variables); expectToBeModuleScope(scope); - expect(scope.variables).toHaveLength(0); + expect(variables).toHaveLength(0); expect(scope.references).toHaveLength(0); scope = scopeManager.scopes[2]; + variables = getRealVariables(scope.variables); expectToBeFunctionScope(scope); - expect(scope.variables).toHaveLength(1); - expect(scope.variables[0].name).toBe('arguments'); + expect(variables).toHaveLength(1); + expect(variables[0].name).toBe('arguments'); expect(scope.references).toHaveLength(0); }); @@ -85,13 +94,15 @@ describe('export declaration', () => { expect(scopeManager.scopes).toHaveLength(2); let scope = scopeManager.scopes[0]; + let variables = getRealVariables(scope.variables); expectToBeGlobalScope(scope); - expect(scope.variables).toHaveLength(0); + expect(variables).toHaveLength(0); expect(scope.references).toHaveLength(0); scope = scopeManager.scopes[1]; + variables = getRealVariables(scope.variables); expectToBeModuleScope(scope); - expect(scope.variables).toHaveLength(0); + expect(variables).toHaveLength(0); expect(scope.references).toHaveLength(0); }); @@ -104,13 +115,15 @@ describe('export declaration', () => { expect(scopeManager.scopes).toHaveLength(2); let scope = scopeManager.scopes[0]; + let variables = getRealVariables(scope.variables); expectToBeGlobalScope(scope); - expect(scope.variables).toHaveLength(0); + expect(variables).toHaveLength(0); expect(scope.references).toHaveLength(0); scope = scopeManager.scopes[1]; + variables = getRealVariables(scope.variables); expectToBeModuleScope(scope); - expect(scope.variables).toHaveLength(1); + expect(variables).toHaveLength(1); expect(scope.references).toHaveLength(2); expect(scope.references[0].identifier.name).toBe('x'); expect(scope.references[1].identifier.name).toBe('x'); @@ -125,13 +138,15 @@ describe('export declaration', () => { expect(scopeManager.scopes).toHaveLength(2); let scope = scopeManager.scopes[0]; + let variables = getRealVariables(scope.variables); expectToBeGlobalScope(scope); - expect(scope.variables).toHaveLength(0); + expect(variables).toHaveLength(0); expect(scope.references).toHaveLength(0); scope = scopeManager.scopes[1]; + variables = getRealVariables(scope.variables); expectToBeModuleScope(scope); - expect(scope.variables).toHaveLength(1); + expect(variables).toHaveLength(1); expect(scope.references).toHaveLength(2); expect(scope.references[0].identifier.name).toBe('v'); expect(scope.references[1].identifier.name).toBe('v'); @@ -146,13 +161,15 @@ describe('export declaration', () => { expect(scopeManager.scopes).toHaveLength(2); let scope = scopeManager.scopes[0]; + let variables = getRealVariables(scope.variables); expectToBeGlobalScope(scope); - expect(scope.variables).toHaveLength(0); + expect(variables).toHaveLength(0); expect(scope.references).toHaveLength(0); scope = scopeManager.scopes[1]; + variables = getRealVariables(scope.variables); expectToBeModuleScope(scope); - expect(scope.variables).toHaveLength(0); + expect(variables).toHaveLength(0); expect(scope.references).toHaveLength(0); }); @@ -165,13 +182,15 @@ describe('export declaration', () => { expect(scopeManager.scopes).toHaveLength(2); let scope = scopeManager.scopes[0]; + let variables = getRealVariables(scope.variables); expectToBeGlobalScope(scope); - expect(scope.variables).toHaveLength(0); + expect(variables).toHaveLength(0); expect(scope.references).toHaveLength(0); scope = scopeManager.scopes[1]; + variables = getRealVariables(scope.variables); expectToBeModuleScope(scope); - expect(scope.variables).toHaveLength(0); + expect(variables).toHaveLength(0); expect(scope.references).toHaveLength(0); }); @@ -181,13 +200,15 @@ describe('export declaration', () => { expect(scopeManager.scopes).toHaveLength(2); let scope = scopeManager.scopes[0]; + let variables = getRealVariables(scope.variables); expectToBeGlobalScope(scope); - expect(scope.variables).toHaveLength(0); + expect(variables).toHaveLength(0); expect(scope.references).toHaveLength(0); scope = scopeManager.scopes[1]; + variables = getRealVariables(scope.variables); expectToBeModuleScope(scope); - expect(scope.variables).toHaveLength(0); + expect(variables).toHaveLength(0); expect(scope.references).toHaveLength(0); }); }); diff --git a/packages/scope-manager/tests/eslint-scope/es6-import.test.ts b/packages/scope-manager/tests/eslint-scope/es6-import.test.ts index 7edd7fd638a7..835676292a2a 100644 --- a/packages/scope-manager/tests/eslint-scope/es6-import.test.ts +++ b/packages/scope-manager/tests/eslint-scope/es6-import.test.ts @@ -4,6 +4,7 @@ import { expectToBeImportBindingDefinition, expectToBeModuleScope, expectToBeVariableDefinition, + getRealVariables, } from '../util'; describe('import declaration', () => { @@ -14,16 +15,18 @@ describe('import declaration', () => { expect(scopeManager.scopes).toHaveLength(2); let scope = scopeManager.scopes[0]; + let variables = getRealVariables(scope.variables); expectToBeGlobalScope(scope); - expect(scope.variables).toHaveLength(0); + expect(variables).toHaveLength(0); expect(scope.references).toHaveLength(0); scope = scopeManager.scopes[1]; + variables = getRealVariables(scope.variables); expectToBeModuleScope(scope); expect(scope.isStrict).toBeTruthy(); - expect(scope.variables).toHaveLength(1); - expect(scope.variables[0].name).toBe('v'); - expectToBeImportBindingDefinition(scope.variables[0].defs[0]); + expect(variables).toHaveLength(1); + expect(variables[0].name).toBe('v'); + expectToBeImportBindingDefinition(variables[0].defs[0]); expect(scope.references).toHaveLength(0); }); @@ -36,16 +39,18 @@ describe('import declaration', () => { expect(scopeManager.scopes).toHaveLength(2); let scope = scopeManager.scopes[0]; + let variables = getRealVariables(scope.variables); expectToBeGlobalScope(scope); - expect(scope.variables).toHaveLength(0); + expect(variables).toHaveLength(0); expect(scope.references).toHaveLength(0); scope = scopeManager.scopes[1]; + variables = getRealVariables(scope.variables); expectToBeModuleScope(scope); expect(scope.isStrict).toBeTruthy(); - expect(scope.variables).toHaveLength(1); - expect(scope.variables[0].name).toBe('ns'); - expectToBeImportBindingDefinition(scope.variables[0].defs[0]); + expect(variables).toHaveLength(1); + expect(variables[0].name).toBe('ns'); + expectToBeImportBindingDefinition(variables[0].defs[0]); expect(scope.references).toHaveLength(0); }); @@ -58,16 +63,18 @@ describe('import declaration', () => { expect(scopeManager.scopes).toHaveLength(2); let scope = scopeManager.scopes[0]; + let variables = getRealVariables(scope.variables); expectToBeGlobalScope(scope); - expect(scope.variables).toHaveLength(0); + expect(variables).toHaveLength(0); expect(scope.references).toHaveLength(0); scope = scopeManager.scopes[1]; + variables = getRealVariables(scope.variables); expectToBeModuleScope(scope); expect(scope.isStrict).toBeTruthy(); - expect(scope.variables).toHaveLength(1); - expect(scope.variables[0].name).toBe('x'); - expectToBeImportBindingDefinition(scope.variables[0].defs[0]); + expect(variables).toHaveLength(1); + expect(variables[0].name).toBe('x'); + expectToBeImportBindingDefinition(variables[0].defs[0]); expect(scope.references).toHaveLength(0); }); @@ -80,16 +87,18 @@ describe('import declaration', () => { expect(scopeManager.scopes).toHaveLength(2); let scope = scopeManager.scopes[0]; + let variables = getRealVariables(scope.variables); expectToBeGlobalScope(scope); - expect(scope.variables).toHaveLength(0); + expect(variables).toHaveLength(0); expect(scope.references).toHaveLength(0); scope = scopeManager.scopes[1]; + variables = getRealVariables(scope.variables); expectToBeModuleScope(scope); expect(scope.isStrict).toBeTruthy(); - expect(scope.variables).toHaveLength(1); - expect(scope.variables[0].name).toBe('v'); - expectToBeImportBindingDefinition(scope.variables[0].defs[0]); + expect(variables).toHaveLength(1); + expect(variables[0].name).toBe('v'); + expectToBeImportBindingDefinition(variables[0].defs[0]); expect(scope.references).toHaveLength(0); }); @@ -111,18 +120,20 @@ describe('import declaration', () => { expect(scopeManager.scopes).toHaveLength(2); let scope = scopeManager.scopes[0]; + let variables = getRealVariables(scope.variables); expectToBeGlobalScope(scope); - expect(scope.variables).toHaveLength(0); + expect(variables).toHaveLength(0); expect(scope.references).toHaveLength(0); scope = scopeManager.scopes[1]; + variables = getRealVariables(scope.variables); expectToBeModuleScope(scope); expect(scope.isStrict).toBeTruthy(); - expect(scope.variables).toHaveLength(2); - const importV = scope.variables[0]; + expect(variables).toHaveLength(2); + const importV = variables[0]; expect(importV.name).toBe('v'); expectToBeImportBindingDefinition(importV.defs[0]); - const variableX = scope.variables[1]; + const variableX = variables[1]; expect(variableX.name).toBe('x'); expectToBeVariableDefinition(variableX.defs[0]); diff --git a/packages/scope-manager/tests/eslint-scope/es6-iteration-scope.test.ts b/packages/scope-manager/tests/eslint-scope/es6-iteration-scope.test.ts index 4bd4a6c91797..d2aea796163e 100644 --- a/packages/scope-manager/tests/eslint-scope/es6-iteration-scope.test.ts +++ b/packages/scope-manager/tests/eslint-scope/es6-iteration-scope.test.ts @@ -4,6 +4,7 @@ import { expectToBeFunctionScope, expectToBeGlobalScope, expectToBeVariableDefinition, + getRealVariables, parseAndAnalyze, } from '../util'; @@ -21,37 +22,41 @@ describe('ES6 iteration scope', () => { expect(scopeManager.scopes).toHaveLength(4); let scope = scopeManager.scopes[0]; + let variables = getRealVariables(scope.variables); expectToBeGlobalScope(scope); - expect(scope.variables).toHaveLength(0); + expect(variables).toHaveLength(0); scope = scopeManager.scopes[1]; + variables = getRealVariables(scope.variables); expectToBeFunctionScope(scope); - expect(scope.variables).toHaveLength(2); - expect(scope.variables[0].name).toBe('arguments'); - expect(scope.variables[1].name).toBe('i'); + expect(variables).toHaveLength(2); + expect(variables[0].name).toBe('arguments'); + expect(variables[1].name).toBe('i'); expect(scope.references).toHaveLength(1); expect(scope.references[0].identifier.name).toBe('i'); - expect(scope.references[0].resolved).toBe(scope.variables[1]); + expect(scope.references[0].resolved).toBe(variables[1]); const iterScope = (scope = scopeManager.scopes[2]); - + variables = getRealVariables(scope.variables); + const iterVariables = getRealVariables(iterScope.variables); expectToBeForScope(scope); - expect(scope.variables).toHaveLength(1); - expect(scope.variables[0].name).toBe('i'); + expect(variables).toHaveLength(1); + expect(variables[0].name).toBe('i'); expect(scope.references).toHaveLength(2); expect(scope.references[0].identifier.name).toBe('i'); - expect(scope.references[0].resolved).toBe(scope.variables[0]); + expect(scope.references[0].resolved).toBe(variables[0]); expect(scope.references[1].identifier.name).toBe('i'); - expect(scope.references[1].resolved).toBe(scope.variables[0]); + expect(scope.references[1].resolved).toBe(variables[0]); scope = scopeManager.scopes[3]; + variables = getRealVariables(scope.variables); expectToBeBlockScope(scope); - expect(scope.variables).toHaveLength(0); + expect(variables).toHaveLength(0); expect(scope.references).toHaveLength(2); expect(scope.references[0].identifier.name).toBe('console'); expect(scope.references[0].resolved).toBe(null); expect(scope.references[1].identifier.name).toBe('i'); - expect(scope.references[1].resolved).toBe(iterScope.variables[0]); + expect(scope.references[1].resolved).toBe(iterVariables[0]); }); it('let materialize iteration scope for ForInStatement#2', () => { @@ -67,44 +72,49 @@ describe('ES6 iteration scope', () => { expect(scopeManager.scopes).toHaveLength(4); let scope = scopeManager.scopes[0]; + let variables = getRealVariables(scope.variables); expectToBeGlobalScope(scope); - expect(scope.variables).toHaveLength(0); + expect(variables).toHaveLength(0); scope = scopeManager.scopes[1]; + variables = getRealVariables(scope.variables); expectToBeFunctionScope(scope); - expect(scope.variables).toHaveLength(2); - expect(scope.variables[0].name).toBe('arguments'); - expect(scope.variables[1].name).toBe('i'); + expect(variables).toHaveLength(2); + expect(variables[0].name).toBe('arguments'); + expect(variables[1].name).toBe('i'); expect(scope.references).toHaveLength(1); expect(scope.references[0].identifier.name).toBe('i'); - expect(scope.references[0].resolved).toBe(scope.variables[1]); + expect(scope.references[0].resolved).toBe(variables[1]); const iterScope = (scope = scopeManager.scopes[2]); + variables = getRealVariables(scope.variables); + const iterVariables = getRealVariables(iterScope.variables); expectToBeForScope(scope); - expect(scope.variables).toHaveLength(3); - expect(scope.variables[0].name).toBe('i'); - expect(scope.variables[1].name).toBe('j'); - expect(scope.variables[2].name).toBe('k'); + expect(variables).toHaveLength(3); + expect(variables[0].name).toBe('i'); + expect(variables[1].name).toBe('j'); + expect(variables[2].name).toBe('k'); expect(scope.references).toHaveLength(4); expect(scope.references[0].identifier.name).toBe('i'); - expect(scope.references[0].resolved).toBe(scope.variables[0]); + expect(scope.references[0].resolved).toBe(variables[0]); expect(scope.references[1].identifier.name).toBe('j'); - expect(scope.references[1].resolved).toBe(scope.variables[1]); + expect(scope.references[1].resolved).toBe(variables[1]); expect(scope.references[2].identifier.name).toBe('k'); - expect(scope.references[2].resolved).toBe(scope.variables[2]); + expect(scope.references[2].resolved).toBe(variables[2]); expect(scope.references[3].identifier.name).toBe('i'); - expect(scope.references[3].resolved).toBe(scope.variables[0]); + expect(scope.references[3].resolved).toBe(variables[0]); scope = scopeManager.scopes[3]; + variables = getRealVariables(scope.variables); expectToBeBlockScope(scope); - expect(scope.variables).toHaveLength(0); + expect(variables).toHaveLength(0); expect(scope.references).toHaveLength(2); expect(scope.references[0].identifier.name).toBe('console'); expect(scope.references[0].resolved).toBe(null); expect(scope.references[1].identifier.name).toBe('i'); - expect(scope.references[1].resolved).toBe(iterScope.variables[0]); + expect(scope.references[1].resolved).toBe(iterVariables[0]); }); it('let materialize iteration scope for ForStatement#2', () => { @@ -121,60 +131,66 @@ describe('ES6 iteration scope', () => { expect(scopeManager.scopes).toHaveLength(4); let scope = scopeManager.scopes[0]; + let variables = getRealVariables(scope.variables); expectToBeGlobalScope(scope); - expect(scope.variables).toHaveLength(0); + expect(variables).toHaveLength(0); const functionScope = (scope = scopeManager.scopes[1]); + variables = getRealVariables(scope.variables); + const functionVariables = getRealVariables(functionScope.variables); expectToBeFunctionScope(scope); - expect(scope.variables).toHaveLength(3); - expect(scope.variables[0].name).toBe('arguments'); - expect(scope.variables[1].name).toBe('i'); - expect(scope.variables[2].name).toBe('obj'); + expect(variables).toHaveLength(3); + expect(variables[0].name).toBe('arguments'); + expect(variables[1].name).toBe('i'); + expect(variables[2].name).toBe('obj'); expect(scope.references).toHaveLength(2); expect(scope.references[0].identifier.name).toBe('i'); - expect(scope.references[0].resolved).toBe(scope.variables[1]); + expect(scope.references[0].resolved).toBe(variables[1]); expect(scope.references[1].identifier.name).toBe('obj'); - expect(scope.references[1].resolved).toBe(scope.variables[2]); + expect(scope.references[1].resolved).toBe(variables[2]); const iterScope = (scope = scopeManager.scopes[2]); + variables = getRealVariables(scope.variables); + const iterVariables = getRealVariables(iterScope.variables); expectToBeForScope(scope); - expect(scope.variables).toHaveLength(3); - expect(scope.variables[0].name).toBe('i'); - expectToBeVariableDefinition(scope.variables[0].defs[0]); - expect(scope.variables[1].name).toBe('j'); - expectToBeVariableDefinition(scope.variables[1].defs[0]); - expect(scope.variables[2].name).toBe('k'); - expectToBeVariableDefinition(scope.variables[2].defs[0]); + expect(variables).toHaveLength(3); + expect(variables[0].name).toBe('i'); + expectToBeVariableDefinition(variables[0].defs[0]); + expect(variables[1].name).toBe('j'); + expectToBeVariableDefinition(variables[1].defs[0]); + expect(variables[2].name).toBe('k'); + expectToBeVariableDefinition(variables[2].defs[0]); expect(scope.references).toHaveLength(7); expect(scope.references[0].identifier.name).toBe('i'); - expect(scope.references[0].resolved).toBe(scope.variables[0]); + expect(scope.references[0].resolved).toBe(variables[0]); expect(scope.references[1].identifier.name).toBe('j'); - expect(scope.references[1].resolved).toBe(scope.variables[1]); + expect(scope.references[1].resolved).toBe(variables[1]); expect(scope.references[2].identifier.name).toBe('k'); - expect(scope.references[2].resolved).toBe(scope.variables[2]); + expect(scope.references[2].resolved).toBe(variables[2]); expect(scope.references[3].identifier.name).toBe('obj'); - expect(scope.references[3].resolved).toBe(functionScope.variables[2]); + expect(scope.references[3].resolved).toBe(functionVariables[2]); expect(scope.references[4].identifier.name).toBe('i'); - expect(scope.references[4].resolved).toBe(scope.variables[0]); + expect(scope.references[4].resolved).toBe(variables[0]); expect(scope.references[5].identifier.name).toBe('okok'); expect(scope.references[5].resolved).toBeNull(); expect(scope.references[6].identifier.name).toBe('i'); - expect(scope.references[6].resolved).toBe(scope.variables[0]); + expect(scope.references[6].resolved).toBe(variables[0]); scope = scopeManager.scopes[3]; + variables = getRealVariables(scope.variables); expectToBeBlockScope(scope); - expect(scope.variables).toHaveLength(0); + expect(variables).toHaveLength(0); expect(scope.references).toHaveLength(4); expect(scope.references[0].identifier.name).toBe('console'); expect(scope.references[0].resolved).toBeNull(); expect(scope.references[1].identifier.name).toBe('i'); - expect(scope.references[1].resolved).toBe(iterScope.variables[0]); + expect(scope.references[1].resolved).toBe(iterVariables[0]); expect(scope.references[2].identifier.name).toBe('j'); - expect(scope.references[2].resolved).toBe(iterScope.variables[1]); + expect(scope.references[2].resolved).toBe(iterVariables[1]); expect(scope.references[3].identifier.name).toBe('k'); - expect(scope.references[3].resolved).toBe(iterScope.variables[2]); + expect(scope.references[3].resolved).toBe(iterVariables[2]); }); }); diff --git a/packages/scope-manager/tests/eslint-scope/es6-new-target.test.ts b/packages/scope-manager/tests/eslint-scope/es6-new-target.test.ts index 097eee3d98e7..442f17a1212a 100644 --- a/packages/scope-manager/tests/eslint-scope/es6-new-target.test.ts +++ b/packages/scope-manager/tests/eslint-scope/es6-new-target.test.ts @@ -1,5 +1,9 @@ import { AST_NODE_TYPES } from '@typescript-eslint/types'; -import { expectToBeFunctionScope, parseAndAnalyze } from '../util'; +import { + expectToBeFunctionScope, + getRealVariables, + parseAndAnalyze, +} from '../util'; describe('ES6 new.target', () => { it('should not make references of new.target', () => { @@ -14,12 +18,13 @@ describe('ES6 new.target', () => { expect(scopeManager.scopes).toHaveLength(3); const scope = scopeManager.scopes[2]; + const variables = getRealVariables(scope.variables); expectToBeFunctionScope(scope); expect(scope.block.type).toBe(AST_NODE_TYPES.FunctionExpression); expect(scope.isStrict).toBeTruthy(); - expect(scope.variables).toHaveLength(1); - expect(scope.variables[0].name).toBe('arguments'); + expect(variables).toHaveLength(1); + expect(variables[0].name).toBe('arguments'); expect(scope.references).toHaveLength(0); }); }); diff --git a/packages/scope-manager/tests/eslint-scope/es6-object.test.ts b/packages/scope-manager/tests/eslint-scope/es6-object.test.ts index 77312f7a7ccd..5f69b51040db 100644 --- a/packages/scope-manager/tests/eslint-scope/es6-object.test.ts +++ b/packages/scope-manager/tests/eslint-scope/es6-object.test.ts @@ -2,6 +2,7 @@ import { AST_NODE_TYPES } from '@typescript-eslint/types'; import { expectToBeFunctionScope, expectToBeGlobalScope, + getRealVariables, parseAndAnalyze, } from '../util'; @@ -17,16 +18,18 @@ describe('ES6 object', () => { expect(scopeManager.scopes).toHaveLength(2); let scope = scopeManager.scopes[0]; + let variables = getRealVariables(scope.variables); expectToBeGlobalScope(scope); expect(scope.block.type).toBe(AST_NODE_TYPES.Program); expect(scope.isStrict).toBeFalsy(); scope = scopeManager.scopes[1]; + variables = getRealVariables(scope.variables); expectToBeFunctionScope(scope); expect(scope.block.type).toBe(AST_NODE_TYPES.FunctionExpression); expect(scope.isStrict).toBeFalsy(); - expect(scope.variables).toHaveLength(1); - expect(scope.variables[0].name).toBe('arguments'); + expect(variables).toHaveLength(1); + expect(variables[0].name).toBe('arguments'); expect(scope.references).toHaveLength(0); }); @@ -47,17 +50,19 @@ describe('ES6 object', () => { expect(scopeManager.scopes).toHaveLength(4); let scope = scopeManager.scopes[0]; + let variables = getRealVariables(scope.variables); expectToBeGlobalScope(scope); expect(scope.block.type).toBe(AST_NODE_TYPES.Program); expect(scope.isStrict).toBeFalsy(); scope = scopeManager.scopes[1]; + variables = getRealVariables(scope.variables); expectToBeFunctionScope(scope); expect(scope.block.type).toBe(AST_NODE_TYPES.FunctionExpression); expect(scope.isStrict).toBeFalsy(); - expect(scope.variables).toHaveLength(2); - expect(scope.variables[0].name).toBe('arguments'); - expect(scope.variables[1].name).toBe('yuyushiki'); + expect(variables).toHaveLength(2); + expect(variables[0].name).toBe('arguments'); + expect(variables[1].name).toBe('yuyushiki'); expect(scope.references).toHaveLength(3); expect(scope.references[0].identifier.name).toBe('yuyushiki'); expect(scope.references[1].identifier.name).toBe('yuyushiki'); diff --git a/packages/scope-manager/tests/eslint-scope/es6-rest-args.test.ts b/packages/scope-manager/tests/eslint-scope/es6-rest-args.test.ts index a96f740d4e86..6d0fc2d4c676 100644 --- a/packages/scope-manager/tests/eslint-scope/es6-rest-args.test.ts +++ b/packages/scope-manager/tests/eslint-scope/es6-rest-args.test.ts @@ -4,6 +4,7 @@ import { expectToBeGlobalScope, expectToBeIdentifier, expectToBeParameterDefinition, + getRealVariables, parseAndAnalyze, } from '../util'; @@ -18,19 +19,21 @@ describe('ES6 rest arguments', () => { expect(scopeManager.scopes).toHaveLength(2); let scope = scopeManager.scopes[0]; + let variables = getRealVariables(scope.variables); expectToBeGlobalScope(scope); expect(scope.block.type).toBe(AST_NODE_TYPES.Program); expect(scope.isStrict).toBeFalsy(); - expect(scope.variables).toHaveLength(1); + expect(variables).toHaveLength(1); scope = scopeManager.scopes[1]; + variables = getRealVariables(scope.variables); expectToBeFunctionScope(scope); - expect(scope.variables).toHaveLength(2); - expect(scope.variables[0].name).toBe('arguments'); - expect(scope.variables[1].name).toBe('bar'); - expectToBeIdentifier(scope.variables[1].defs[0].name); - expect(scope.variables[1].defs[0].name.name).toBe('bar'); - expectToBeParameterDefinition(scope.variables[1].defs[0]); - expect(scope.variables[1].defs[0].rest).toBeTruthy(); + expect(variables).toHaveLength(2); + expect(variables[0].name).toBe('arguments'); + expect(variables[1].name).toBe('bar'); + expectToBeIdentifier(variables[1].defs[0].name); + expect(variables[1].defs[0].name.name).toBe('bar'); + expectToBeParameterDefinition(variables[1].defs[0]); + expect(variables[1].defs[0].rest).toBeTruthy(); }); }); diff --git a/packages/scope-manager/tests/eslint-scope/es6-super.test.ts b/packages/scope-manager/tests/eslint-scope/es6-super.test.ts index 66930149b094..87d25ff7aaa4 100644 --- a/packages/scope-manager/tests/eslint-scope/es6-super.test.ts +++ b/packages/scope-manager/tests/eslint-scope/es6-super.test.ts @@ -2,6 +2,7 @@ import { expectToBeClassScope, expectToBeFunctionScope, expectToBeGlobalScope, + getRealVariables, parseAndAnalyze, } from '../util'; @@ -22,28 +23,32 @@ describe('ES6 super', () => { expect(scopeManager.scopes).toHaveLength(4); let scope = scopeManager.scopes[0]; + let variables = getRealVariables(scope.variables); expectToBeGlobalScope(scope); - expect(scope.variables).toHaveLength(1); - expect(scope.variables[0].name).toBe('Foo'); + expect(variables).toHaveLength(1); + expect(variables[0].name).toBe('Foo'); expect(scope.references).toHaveLength(0); scope = scopeManager.scopes[1]; + variables = getRealVariables(scope.variables); expectToBeClassScope(scope); - expect(scope.variables).toHaveLength(1); - expect(scope.variables[0].name).toBe('Foo'); + expect(variables).toHaveLength(1); + expect(variables[0].name).toBe('Foo'); expect(scope.references).toHaveLength(1); expect(scope.references[0].identifier.name).toBe('Bar'); scope = scopeManager.scopes[2]; + variables = getRealVariables(scope.variables); expectToBeFunctionScope(scope); - expect(scope.variables).toHaveLength(1); - expect(scope.variables[0].name).toBe('arguments'); + expect(variables).toHaveLength(1); + expect(variables[0].name).toBe('arguments'); expect(scope.references).toHaveLength(0); // super is specially handled like `this`. scope = scopeManager.scopes[3]; + variables = getRealVariables(scope.variables); expectToBeFunctionScope(scope); - expect(scope.variables).toHaveLength(1); - expect(scope.variables[0].name).toBe('arguments'); + expect(variables).toHaveLength(1); + expect(variables[0].name).toBe('arguments'); expect(scope.references).toHaveLength(0); // super is specially handled like `this`. }); }); diff --git a/packages/scope-manager/tests/eslint-scope/es6-switch.test.ts b/packages/scope-manager/tests/eslint-scope/es6-switch.test.ts index 430a17b8a790..f36731f43c95 100644 --- a/packages/scope-manager/tests/eslint-scope/es6-switch.test.ts +++ b/packages/scope-manager/tests/eslint-scope/es6-switch.test.ts @@ -2,6 +2,7 @@ import { AST_NODE_TYPES } from '@typescript-eslint/types'; import { expectToBeGlobalScope, expectToBeSwitchScope, + getRealVariables, parseAndAnalyze, } from '../util'; @@ -23,20 +24,22 @@ describe('ES6 switch', () => { expect(scopeManager.scopes).toHaveLength(2); let scope = scopeManager.scopes[0]; + let variables = getRealVariables(scope.variables); expectToBeGlobalScope(scope); expect(scope.block.type).toBe(AST_NODE_TYPES.Program); expect(scope.isStrict).toBeFalsy(); - expect(scope.variables).toHaveLength(0); + expect(variables).toHaveLength(0); expect(scope.references).toHaveLength(1); expect(scope.references[0].identifier.name).toBe('ok'); scope = scopeManager.scopes[1]; + variables = getRealVariables(scope.variables); expectToBeSwitchScope(scope); expect(scope.block.type).toBe(AST_NODE_TYPES.SwitchStatement); expect(scope.isStrict).toBeFalsy(); - expect(scope.variables).toHaveLength(2); - expect(scope.variables[0].name).toBe('i'); - expect(scope.variables[1].name).toBe('test'); + expect(variables).toHaveLength(2); + expect(variables[0].name).toBe('i'); + expect(variables[1].name).toBe('test'); expect(scope.references).toHaveLength(5); expect(scope.references[0].identifier.name).toBe('hello'); expect(scope.references[1].identifier.name).toBe('i'); diff --git a/packages/scope-manager/tests/eslint-scope/es6-template-literal.test.ts b/packages/scope-manager/tests/eslint-scope/es6-template-literal.test.ts index 91521c39b71a..0e019c68a995 100644 --- a/packages/scope-manager/tests/eslint-scope/es6-template-literal.test.ts +++ b/packages/scope-manager/tests/eslint-scope/es6-template-literal.test.ts @@ -2,6 +2,7 @@ import { AST_NODE_TYPES } from '@typescript-eslint/types'; import { expectToBeFunctionScope, expectToBeGlobalScope, + getRealVariables, parseAndAnalyze, } from '../util'; @@ -19,23 +20,25 @@ describe('ES6 template literal', () => { expect(scopeManager.scopes).toHaveLength(3); let scope = scopeManager.scopes[0]; + let variables = getRealVariables(scope.variables); expectToBeGlobalScope(scope); expect(scope.block.type).toBe(AST_NODE_TYPES.Program); expect(scope.isStrict).toBeFalsy(); - expect(scope.variables).toHaveLength(0); + expect(variables).toHaveLength(0); scope = scopeManager.scopes[1]; + variables = getRealVariables(scope.variables); expectToBeFunctionScope(scope); expect(scope.block.type).toBe(AST_NODE_TYPES.FunctionExpression); expect(scope.isStrict).toBeFalsy(); - expect(scope.variables).toHaveLength(6); - expect(scope.variables[0].name).toBe('arguments'); - expect(scope.variables[1].name).toBe('i'); - expect(scope.variables[2].name).toBe('j'); - expect(scope.variables[3].name).toBe('k'); - expect(scope.variables[4].name).toBe('testing'); - expect(scope.variables[5].name).toBe('template'); + expect(variables).toHaveLength(6); + expect(variables[0].name).toBe('arguments'); + expect(variables[1].name).toBe('i'); + expect(variables[2].name).toBe('j'); + expect(variables[3].name).toBe('k'); + expect(variables[4].name).toBe('testing'); + expect(variables[5].name).toBe('template'); expect(scope.references).toHaveLength(5); expect(scope.references[0].identifier.name).toBe('template'); expect(scope.references[1].identifier.name).toBe('testing'); diff --git a/packages/scope-manager/tests/eslint-scope/function-expression-name.test.ts b/packages/scope-manager/tests/eslint-scope/function-expression-name.test.ts index b0080860710b..18536ab7f002 100644 --- a/packages/scope-manager/tests/eslint-scope/function-expression-name.test.ts +++ b/packages/scope-manager/tests/eslint-scope/function-expression-name.test.ts @@ -2,6 +2,7 @@ import { expectToBeFunctionExpressionNameScope, expectToBeFunctionScope, expectToBeGlobalScope, + getRealVariables, parseAndAnalyze, } from '../util'; @@ -15,23 +16,26 @@ describe('function name', () => { expect(scopeManager.scopes).toHaveLength(3); let scope = scopeManager.scopes[0]; + let variables = getRealVariables(scope.variables); const globalScope = scope; expectToBeGlobalScope(scope); - expect(scope.variables).toHaveLength(0); + expect(variables).toHaveLength(0); expect(scope.references).toHaveLength(0); // Function expression name scope scope = scopeManager.scopes[1]; + variables = getRealVariables(scope.variables); expectToBeFunctionExpressionNameScope(scope); - expect(scope.variables).toHaveLength(1); - expect(scope.variables[0].name).toBe('name'); + expect(variables).toHaveLength(1); + expect(variables[0].name).toBe('name'); expect(scope.references).toHaveLength(0); expect(scope.upper === globalScope).toBeTruthy(); // Function scope scope = scopeManager.scopes[2]; + variables = getRealVariables(scope.variables); expectToBeFunctionScope(scope); - expect(scope.variables).toHaveLength(1); + expect(variables).toHaveLength(1); expect(scope.variables[0].name).toBe('arguments'); expect(scope.references).toHaveLength(0); expect(scope.upper === scopeManager.scopes[1]).toBeTruthy(); diff --git a/packages/scope-manager/tests/eslint-scope/global-increment.test.ts b/packages/scope-manager/tests/eslint-scope/global-increment.test.ts index 4f2fd68384a4..7cf86508d334 100644 --- a/packages/scope-manager/tests/eslint-scope/global-increment.test.ts +++ b/packages/scope-manager/tests/eslint-scope/global-increment.test.ts @@ -1,4 +1,8 @@ -import { expectToBeGlobalScope, parseAndAnalyze } from '../util'; +import { + expectToBeGlobalScope, + getRealVariables, + parseAndAnalyze, +} from '../util'; describe('global increment', () => { it('becomes read/write', () => { @@ -7,8 +11,9 @@ describe('global increment', () => { expect(scopeManager.scopes).toHaveLength(1); const scope = scopeManager.scopes[0]; + const variables = getRealVariables(scope.variables); expectToBeGlobalScope(scope); - expect(scope.variables).toHaveLength(0); + expect(variables).toHaveLength(0); expect(scope.references).toHaveLength(1); expect(scope.references[0].isReadWrite()).toBeTruthy(); }); diff --git a/packages/scope-manager/tests/eslint-scope/global-return.test.ts b/packages/scope-manager/tests/eslint-scope/global-return.test.ts index d5e2756ffc17..285f7d7c62eb 100644 --- a/packages/scope-manager/tests/eslint-scope/global-return.test.ts +++ b/packages/scope-manager/tests/eslint-scope/global-return.test.ts @@ -4,6 +4,7 @@ import { expectToBeFunctionScope, expectToBeModuleScope, expectToBeImportBindingDefinition, + getRealVariables, } from '../util'; import { parseAndAnalyze } from '../util/parse'; @@ -20,19 +21,21 @@ describe('gloablReturn option', () => { expect(scopeManager.scopes).toHaveLength(2); let scope = scopeManager.scopes[0]; + let variables = getRealVariables(scope.variables); expectToBeGlobalScope(scope); expect(scope.block.type).toBe(AST_NODE_TYPES.Program); expect(scope.isStrict).toBeFalsy(); - expect(scope.variables).toHaveLength(0); + expect(variables).toHaveLength(0); scope = scopeManager.scopes[1]; + variables = getRealVariables(scope.variables); expectToBeFunctionScope(scope); expect(scope.block.type).toBe(AST_NODE_TYPES.Program); expect(scope.isStrict).toBeTruthy(); - expect(scope.variables).toHaveLength(2); - expect(scope.variables[0].name).toBe('arguments'); - expect(scope.variables[1].name).toBe('hello'); + expect(variables).toHaveLength(2); + expect(variables[0].name).toBe('arguments'); + expect(variables[1].name).toBe('hello'); }); it('creates a function scope following the global scope immediately and creates module scope', () => { @@ -44,24 +47,27 @@ describe('gloablReturn option', () => { expect(scopeManager.scopes).toHaveLength(3); let scope = scopeManager.scopes[0]; + let variables = getRealVariables(scope.variables); expectToBeGlobalScope(scope); expect(scope.block.type).toBe(AST_NODE_TYPES.Program); expect(scope.isStrict).toBeFalsy(); - expect(scope.variables).toHaveLength(0); + expect(variables).toHaveLength(0); scope = scopeManager.scopes[1]; + variables = getRealVariables(scope.variables); expectToBeFunctionScope(scope); expect(scope.block.type).toBe(AST_NODE_TYPES.Program); expect(scope.isStrict).toBeFalsy(); - expect(scope.variables).toHaveLength(1); - expect(scope.variables[0].name).toBe('arguments'); + expect(variables).toHaveLength(1); + expect(variables[0].name).toBe('arguments'); scope = scopeManager.scopes[2]; + variables = getRealVariables(scope.variables); expectToBeModuleScope(scope); - expect(scope.variables).toHaveLength(1); - expect(scope.variables[0].name).toBe('v'); - expectToBeImportBindingDefinition(scope.variables[0].defs[0]); + expect(variables).toHaveLength(1); + expect(variables[0].name).toBe('v'); + expectToBeImportBindingDefinition(variables[0].defs[0]); expect(scope.references).toHaveLength(0); }); }); diff --git a/packages/scope-manager/tests/eslint-scope/implicit-global-reference.test.ts b/packages/scope-manager/tests/eslint-scope/implicit-global-reference.test.ts index e4a81e017bbd..bc2d589a9437 100644 --- a/packages/scope-manager/tests/eslint-scope/implicit-global-reference.test.ts +++ b/packages/scope-manager/tests/eslint-scope/implicit-global-reference.test.ts @@ -1,4 +1,8 @@ -import { expectToBeGlobalScope, parseAndAnalyze } from '../util'; +import { + expectToBeGlobalScope, + getRealVariables, + parseAndAnalyze, +} from '../util'; import { DefinitionType } from '../../src/definition'; describe('implicit global reference', () => { @@ -12,7 +16,9 @@ describe('implicit global reference', () => { expect( scopes.map(scope => - scope.variables.map(variable => variable.defs.map(def => def.type)), + getRealVariables(scope.variables).map(variable => + variable.defs.map(def => def.type), + ), ), ).toEqual([[[DefinitionType.Variable]]]); @@ -32,7 +38,9 @@ describe('implicit global reference', () => { expect( scopes.map(scope => - scope.variables.map(variable => variable.defs.map(def => def.type)), + getRealVariables(scope.variables).map(variable => + variable.defs.map(def => def.type), + ), ), ).toEqual([[]]); @@ -54,7 +62,9 @@ describe('implicit global reference', () => { expect( scopes.map(scope => - scope.variables.map(variable => variable.defs.map(def => def.type)), + getRealVariables(scope.variables).map(variable => + variable.defs.map(def => def.type), + ), ), ).toEqual([[[DefinitionType.FunctionName]], [[]]]); @@ -74,7 +84,9 @@ describe('implicit global reference', () => { const scopes = scopeManager.scopes; expect( - scopes.map(scope => scope.variables.map(variable => variable.name)), + scopes.map(scope => + getRealVariables(scope.variables).map(variable => variable.name), + ), ).toEqual([['outer'], ['arguments']]); expectToBeGlobalScope(scopes[0]); @@ -96,7 +108,9 @@ describe('implicit global reference', () => { const scopes = scopeManager.scopes; expect( - scopes.map(scope => scope.variables.map(variable => variable.name)), + scopes.map(scope => + getRealVariables(scope.variables).map(variable => variable.name), + ), ).toEqual([['outer'], ['arguments', 'inner', 'x'], ['arguments']]); expectToBeGlobalScope(scopes[0]); @@ -115,7 +129,9 @@ describe('implicit global reference', () => { const scopes = scopeManager.scopes; expect( - scopes.map(scope => scope.variables.map(variable => variable.name)), + scopes.map(scope => + getRealVariables(scope.variables).map(variable => variable.name), + ), ).toEqual([['outer'], ['arguments'], []]); expectToBeGlobalScope(scopes[0]); @@ -137,7 +153,9 @@ describe('implicit global reference', () => { const scopes = scopeManager.scopes; expect( - scopes.map(scope => scope.variables.map(variable => variable.name)), + scopes.map(scope => + getRealVariables(scope.variables).map(variable => variable.name), + ), ).toEqual([['outer'], ['arguments', 'inner', 'x'], ['arguments'], []]); expectToBeGlobalScope(scopes[0]); diff --git a/packages/scope-manager/tests/eslint-scope/label.test.ts b/packages/scope-manager/tests/eslint-scope/label.test.ts index b07acef1ad15..e68c841f2e97 100644 --- a/packages/scope-manager/tests/eslint-scope/label.test.ts +++ b/packages/scope-manager/tests/eslint-scope/label.test.ts @@ -2,6 +2,7 @@ import { expectToBeBlockScope, expectToBeFunctionScope, expectToBeGlobalScope, + getRealVariables, parseAndAnalyze, } from '../util'; @@ -14,20 +15,23 @@ describe('label', () => { expect(scopeManager.scopes).toHaveLength(3); let scope = scopeManager.scopes[0]; + let variables = getRealVariables(scope.variables); expectToBeGlobalScope(scope); - expect(scope.variables).toHaveLength(1); - expect(scope.variables[0].name).toBe('bar'); + expect(variables).toHaveLength(1); + expect(variables[0].name).toBe('bar'); expect(scope.references).toHaveLength(0); scope = scopeManager.scopes[1]; + variables = getRealVariables(scope.variables); expectToBeFunctionScope(scope); - expect(scope.variables).toHaveLength(1); - expect(scope.variables[0].name).toBe('arguments'); + expect(variables).toHaveLength(1); + expect(variables[0].name).toBe('arguments'); expect(scope.references).toHaveLength(0); scope = scopeManager.scopes[2]; + variables = getRealVariables(scope.variables); expectToBeBlockScope(scope); - expect(scope.variables).toHaveLength(0); + expect(variables).toHaveLength(0); expect(scope.references).toHaveLength(0); }); @@ -44,16 +48,18 @@ describe('label', () => { expect(scopeManager.scopes).toHaveLength(2); let scope = scopeManager.scopes[0]; + let variables = getRealVariables(scope.variables); expectToBeGlobalScope(scope); - expect(scope.variables).toHaveLength(1); - expect(scope.variables[0].name).toBe('foo'); + expect(variables).toHaveLength(1); + expect(variables[0].name).toBe('foo'); expect(scope.through).toHaveLength(3); expect(scope.through[2].identifier.name).toBe('foo'); expect(scope.through[2].isRead()).toBeTruthy(); scope = scopeManager.scopes[1]; + variables = getRealVariables(scope.variables); expectToBeBlockScope(scope); - expect(scope.variables).toHaveLength(0); + expect(variables).toHaveLength(0); expect(scope.references).toHaveLength(2); expect(scope.references[0].identifier.name).toBe('console'); expect(scope.references[1].identifier.name).toBe('foo'); diff --git a/packages/scope-manager/tests/eslint-scope/references.test.ts b/packages/scope-manager/tests/eslint-scope/references.test.ts index cc9a4d6e8736..573d0ce84b30 100644 --- a/packages/scope-manager/tests/eslint-scope/references.test.ts +++ b/packages/scope-manager/tests/eslint-scope/references.test.ts @@ -1,4 +1,4 @@ -import { parseAndAnalyze } from '../util'; +import { getRealVariables, parseAndAnalyze } from '../util'; describe('References:', () => { describe('When there is a `let` declaration on global,', () => { @@ -8,15 +8,16 @@ describe('References:', () => { expect(scopeManager.scopes).toHaveLength(1); const scope = scopeManager.scopes[0]; + const variables = getRealVariables(scope.variables); - expect(scope.variables).toHaveLength(1); + expect(variables).toHaveLength(1); expect(scope.references).toHaveLength(1); const reference = scope.references[0]; expect(reference.from).toBe(scope); expect(reference.identifier.name).toBe('a'); - expect(reference.resolved).toBe(scope.variables[0]); + expect(reference.resolved).toBe(variables[0]); expect(reference.writeExpr).not.toBeUndefined(); expect(reference.isWrite()).toBeTruthy(); expect(reference.isRead()).toBeFalsy(); @@ -33,15 +34,18 @@ describe('References:', () => { expect(scopeManager.scopes).toHaveLength(2); // [global, foo] const scope = scopeManager.scopes[1]; + const variables = getRealVariables(scope.variables); - expect(scope.variables).toHaveLength(2); // [arguments, b] + expect(variables).toHaveLength(2); // [arguments, b] expect(scope.references).toHaveLength(2); // [b, a] const reference = scope.references[1]; expect(reference.from).toBe(scope); expect(reference.identifier.name).toBe('a'); - expect(reference.resolved).toBe(scopeManager.scopes[0].variables[0]); + expect(reference.resolved).toBe( + getRealVariables(scopeManager.scopes[0].variables)[0], + ); expect(reference.writeExpr).toBeUndefined(); expect(reference.isWrite()).toBeFalsy(); expect(reference.isRead()).toBeTruthy(); @@ -57,15 +61,18 @@ describe('References:', () => { expect(scopeManager.scopes).toHaveLength(2); // [global, foo] const scope = scopeManager.scopes[1]; + const variables = getRealVariables(scope.variables); - expect(scope.variables).toHaveLength(2); // [arguments, b] + expect(variables).toHaveLength(2); // [arguments, b] expect(scope.references).toHaveLength(2); // [b, a] const reference = scope.references[1]; expect(reference.from).toBe(scope); expect(reference.identifier.name).toBe('a'); - expect(reference.resolved).toBe(scopeManager.scopes[0].variables[0]); + expect(reference.resolved).toBe( + getRealVariables(scopeManager.scopes[0].variables)[0], + ); expect(reference.writeExpr).toBeUndefined(); expect(reference.isWrite()).toBeFalsy(); expect(reference.isRead()).toBeTruthy(); @@ -79,15 +86,16 @@ describe('References:', () => { expect(scopeManager.scopes).toHaveLength(1); const scope = scopeManager.scopes[0]; + const variables = getRealVariables(scope.variables); - expect(scope.variables).toHaveLength(1); + expect(variables).toHaveLength(1); expect(scope.references).toHaveLength(1); const reference = scope.references[0]; expect(reference.from).toBe(scope); expect(reference.identifier.name).toBe('a'); - expect(reference.resolved).toBe(scope.variables[0]); + expect(reference.resolved).toBe(variables[0]); expect(reference.writeExpr).not.toBeUndefined(); expect(reference.isWrite()).toBeTruthy(); expect(reference.isRead()).toBeFalsy(); @@ -104,15 +112,18 @@ describe('References:', () => { expect(scopeManager.scopes).toHaveLength(2); // [global, foo] const scope = scopeManager.scopes[1]; + const variables = getRealVariables(scope.variables); - expect(scope.variables).toHaveLength(2); // [arguments, b] + expect(variables).toHaveLength(2); // [arguments, b] expect(scope.references).toHaveLength(2); // [b, a] const reference = scope.references[1]; expect(reference.from).toBe(scope); expect(reference.identifier.name).toBe('a'); - expect(reference.resolved).toBe(scopeManager.scopes[0].variables[0]); + expect(reference.resolved).toBe( + getRealVariables(scopeManager.scopes[0].variables)[0], + ); expect(reference.writeExpr).toBeUndefined(); expect(reference.isWrite()).toBeFalsy(); expect(reference.isRead()).toBeTruthy(); @@ -126,8 +137,9 @@ describe('References:', () => { expect(scopeManager.scopes).toHaveLength(1); const scope = scopeManager.scopes[0]; + const variables = getRealVariables(scope.variables); - expect(scope.variables).toHaveLength(1); + expect(variables).toHaveLength(1); expect(scope.references).toHaveLength(1); const reference = scope.references[0]; @@ -151,8 +163,9 @@ describe('References:', () => { expect(scopeManager.scopes).toHaveLength(2); // [global, foo] const scope = scopeManager.scopes[1]; + const variables = getRealVariables(scope.variables); - expect(scope.variables).toHaveLength(2); // [arguments, b] + expect(variables).toHaveLength(2); // [arguments, b] expect(scope.references).toHaveLength(2); // [b, a] const reference = scope.references[1]; @@ -176,15 +189,16 @@ describe('References:', () => { expect(scopeManager.scopes).toHaveLength(2); // [global, A] const scope = scopeManager.scopes[0]; + const variables = getRealVariables(scope.variables); - expect(scope.variables).toHaveLength(2); // [A, b] + expect(variables).toHaveLength(2); // [A, b] expect(scope.references).toHaveLength(2); // [b, A] const reference = scope.references[1]; expect(reference.from).toBe(scope); expect(reference.identifier.name).toBe('A'); - expect(reference.resolved).toBe(scope.variables[0]); + expect(reference.resolved).toBe(variables[0]); expect(reference.writeExpr).toBeUndefined(); expect(reference.isWrite()).toBeFalsy(); expect(reference.isRead()).toBeTruthy(); @@ -201,15 +215,18 @@ describe('References:', () => { expect(scopeManager.scopes).toHaveLength(3); // [global, A, foo] const scope = scopeManager.scopes[2]; + const variables = getRealVariables(scope.variables); - expect(scope.variables).toHaveLength(2); // [arguments, b] + expect(variables).toHaveLength(2); // [arguments, b] expect(scope.references).toHaveLength(2); // [b, A] const reference = scope.references[1]; expect(reference.from).toBe(scope); expect(reference.identifier.name).toBe('A'); - expect(reference.resolved).toBe(scopeManager.scopes[0].variables[0]); + expect(reference.resolved).toBe( + getRealVariables(scopeManager.scopes[0].variables)[0], + ); expect(reference.writeExpr).toBeUndefined(); expect(reference.isWrite()).toBeFalsy(); expect(reference.isRead()).toBeTruthy(); @@ -227,15 +244,16 @@ describe('References:', () => { expect(scopeManager.scopes).toHaveLength(2); // [global, foo] const scope = scopeManager.scopes[1]; + const variables = getRealVariables(scope.variables); - expect(scope.variables).toHaveLength(2); // [arguments, a] + expect(variables).toHaveLength(2); // [arguments, a] expect(scope.references).toHaveLength(1); const reference = scope.references[0]; expect(reference.from).toBe(scope); expect(reference.identifier.name).toBe('a'); - expect(reference.resolved).toBe(scope.variables[1]); + expect(reference.resolved).toBe(variables[1]); expect(reference.writeExpr).not.toBeUndefined(); expect(reference.isWrite()).toBeTruthy(); expect(reference.isRead()).toBeFalsy(); @@ -254,15 +272,18 @@ describe('References:', () => { expect(scopeManager.scopes).toHaveLength(3); // [global, foo, bar] const scope = scopeManager.scopes[2]; + const variables = getRealVariables(scope.variables); - expect(scope.variables).toHaveLength(2); // [arguments, b] + expect(variables).toHaveLength(2); // [arguments, b] expect(scope.references).toHaveLength(2); // [b, a] const reference = scope.references[1]; expect(reference.from).toBe(scope); expect(reference.identifier.name).toBe('a'); - expect(reference.resolved).toBe(scopeManager.scopes[1].variables[1]); + expect(reference.resolved).toBe( + getRealVariables(scopeManager.scopes[1].variables)[1], + ); expect(reference.writeExpr).toBeUndefined(); expect(reference.isWrite()).toBeFalsy(); expect(reference.isRead()).toBeTruthy(); @@ -280,15 +301,16 @@ describe('References:', () => { expect(scopeManager.scopes).toHaveLength(2); // [global, foo] const scope = scopeManager.scopes[1]; + const variables = getRealVariables(scope.variables); - expect(scope.variables).toHaveLength(2); // [arguments, a] + expect(variables).toHaveLength(2); // [arguments, a] expect(scope.references).toHaveLength(1); const reference = scope.references[0]; expect(reference.from).toBe(scope); expect(reference.identifier.name).toBe('a'); - expect(reference.resolved).toBe(scope.variables[1]); + expect(reference.resolved).toBe(variables[1]); expect(reference.writeExpr).not.toBeUndefined(); expect(reference.isWrite()).toBeTruthy(); expect(reference.isRead()).toBeFalsy(); @@ -307,15 +329,18 @@ describe('References:', () => { expect(scopeManager.scopes).toHaveLength(3); // [global, foo, bar] const scope = scopeManager.scopes[2]; + const variables = getRealVariables(scope.variables); - expect(scope.variables).toHaveLength(2); // [arguments, b] + expect(variables).toHaveLength(2); // [arguments, b] expect(scope.references).toHaveLength(2); // [b, a] const reference = scope.references[1]; expect(reference.from).toBe(scope); expect(reference.identifier.name).toBe('a'); - expect(reference.resolved).toBe(scopeManager.scopes[1].variables[1]); + expect(reference.resolved).toBe( + getRealVariables(scopeManager.scopes[1].variables)[1], + ); expect(reference.writeExpr).toBeUndefined(); expect(reference.isWrite()).toBeFalsy(); expect(reference.isRead()).toBeTruthy(); @@ -329,15 +354,16 @@ describe('References:', () => { expect(scopeManager.scopes).toHaveLength(1); const scope = scopeManager.scopes[0]; + const variables = getRealVariables(scope.variables); - expect(scope.variables).toHaveLength(1); + expect(variables).toHaveLength(1); expect(scope.references).toHaveLength(1); const reference = scope.references[0]; expect(reference.from).toBe(scope); expect(reference.identifier.name).toBe('a'); - expect(reference.resolved).toBe(scope.variables[0]); + expect(reference.resolved).toBe(variables[0]); expect(reference.writeExpr).not.toBeUndefined(); expect(reference.isWrite()).toBeTruthy(); expect(reference.isRead()).toBeFalsy(); @@ -349,15 +375,16 @@ describe('References:', () => { expect(scopeManager.scopes).toHaveLength(1); const scope = scopeManager.scopes[0]; + const variables = getRealVariables(scope.variables); - expect(scope.variables).toHaveLength(1); + expect(variables).toHaveLength(1); expect(scope.references).toHaveLength(1); const reference = scope.references[0]; expect(reference.from).toBe(scope); expect(reference.identifier.name).toBe('a'); - expect(reference.resolved).toBe(scope.variables[0]); + expect(reference.resolved).toBe(variables[0]); expect(reference.writeExpr).not.toBeUndefined(); expect(reference.isWrite()).toBeTruthy(); expect(reference.isRead()).toBeFalsy(); @@ -369,15 +396,16 @@ describe('References:', () => { expect(scopeManager.scopes).toHaveLength(1); const scope = scopeManager.scopes[0]; + const variables = getRealVariables(scope.variables); - expect(scope.variables).toHaveLength(1); + expect(variables).toHaveLength(1); expect(scope.references).toHaveLength(1); const reference = scope.references[0]; expect(reference.from).toBe(scope); expect(reference.identifier.name).toBe('a'); - expect(reference.resolved).toBe(scope.variables[0]); + expect(reference.resolved).toBe(variables[0]); expect(reference.writeExpr).not.toBeUndefined(); expect(reference.isWrite()).toBeTruthy(); expect(reference.isRead()).toBeFalsy(); @@ -426,8 +454,9 @@ describe('References:', () => { expect(scopeManager.scopes.length).toBeGreaterThanOrEqual(1); const scope = scopeManager.scopes[scopeManager.scopes.length - 1]; + const variables = getRealVariables(scope.variables); - expect(scope.variables.length).toBeGreaterThanOrEqual(1); + expect(variables.length).toBeGreaterThanOrEqual(1); expect(scope.references.length).toBeGreaterThanOrEqual(1); scope.references.forEach(reference => { @@ -459,8 +488,9 @@ describe('References:', () => { expect(scopeManager.scopes.length).toBeGreaterThanOrEqual(1); const scope = scopeManager.scopes[scopeManager.scopes.length - 1]; + const variables = getRealVariables(scope.variables); - expect(scope.variables).toHaveLength(1); + expect(variables).toHaveLength(1); expect(scope.references.length).toBeGreaterThanOrEqual(1); scope.references.forEach(reference => { @@ -494,11 +524,12 @@ describe('References:', () => { expect(scopeManager.scopes.length).toBeGreaterThanOrEqual(1); const scope = scopeManager.scopes[0]; + const variables = getRealVariables(scope.variables); - expect(scope.variables.length).toBeGreaterThanOrEqual(1); - expect(scope.variables[0].name).toBe('a'); + expect(variables.length).toBeGreaterThanOrEqual(1); + expect(variables[0].name).toBe('a'); - const references = scope.variables[0].references; + const references = variables[0].references; expect(references.length).toBeGreaterThanOrEqual(1); diff --git a/packages/scope-manager/tests/eslint-scope/typescript.test.ts b/packages/scope-manager/tests/eslint-scope/typescript.test.ts index c529ddce9624..03928e08e5ef 100644 --- a/packages/scope-manager/tests/eslint-scope/typescript.test.ts +++ b/packages/scope-manager/tests/eslint-scope/typescript.test.ts @@ -2,6 +2,7 @@ import { AST_NODE_TYPES } from '@typescript-eslint/types'; import { expectToBeFunctionScope, expectToBeGlobalScope, + getRealVariables, parseAndAnalyze, } from '../util'; @@ -22,16 +23,18 @@ describe('typescript', () => { expect(scopeManager.scopes).toHaveLength(4); let scope = scopeManager.scopes[0]; + let variables = getRealVariables(scope.variables); expectToBeGlobalScope(scope); expect(scope.references).toHaveLength(0); - expect(scope.variables).toHaveLength(1); - expect(scope.variables[0].defs).toHaveLength(3); + expect(variables).toHaveLength(1); + expect(variables[0].defs).toHaveLength(3); for (let i = 1; i < 4; i += 1) { scope = scopeManager.scopes[i]; + variables = getRealVariables(scope.variables); expectToBeFunctionScope(scope); - expect(scope.variables).toHaveLength(2); - expect(scope.variables[0].name).toBe('arguments'); + expect(variables).toHaveLength(2); + expect(variables[0].name).toBe('arguments'); if (scope.block.type === AST_NODE_TYPES.TSDeclareFunction) { expect(scope.references).toHaveLength(0); } else { diff --git a/packages/scope-manager/tests/eslint-scope/with-scope.test.ts b/packages/scope-manager/tests/eslint-scope/with-scope.test.ts index 7949d7734418..a2bfe13b07cc 100644 --- a/packages/scope-manager/tests/eslint-scope/with-scope.test.ts +++ b/packages/scope-manager/tests/eslint-scope/with-scope.test.ts @@ -3,6 +3,7 @@ import { expectToBeFunctionScope, expectToBeGlobalScope, expectToBeWithScope, + getRealVariables, parseAndAnalyze, } from '../util'; @@ -22,25 +23,29 @@ describe('with', () => { expect(scopeManager.scopes).toHaveLength(4); let scope = scopeManager.scopes[0]; + let variables = getRealVariables(scope.variables); expectToBeGlobalScope(scope); - expect(scope.variables).toHaveLength(0); + expect(variables).toHaveLength(0); expect(scope.references).toHaveLength(0); scope = scopeManager.scopes[1]; + variables = getRealVariables(scope.variables); expectToBeFunctionScope(scope); - expect(scope.variables).toHaveLength(1); - expect(scope.variables[0].name).toBe('arguments'); + expect(variables).toHaveLength(1); + expect(variables[0].name).toBe('arguments'); expect(scope.references).toHaveLength(1); expect(scope.references[0].resolved).toBeNull(); scope = scopeManager.scopes[2]; + variables = getRealVariables(scope.variables); expectToBeWithScope(scope); - expect(scope.variables).toHaveLength(0); + expect(variables).toHaveLength(0); expect(scope.references).toHaveLength(0); scope = scopeManager.scopes[3]; + variables = getRealVariables(scope.variables); expectToBeBlockScope(scope); - expect(scope.variables).toHaveLength(0); + expect(variables).toHaveLength(0); expect(scope.references).toHaveLength(1); expect(scope.references[0].identifier.name).toBe('testing'); expect(scope.references[0].resolved).toBeNull(); diff --git a/packages/scope-manager/tests/fixtures/block/inherited-scope.ts.shot b/packages/scope-manager/tests/fixtures/block/inherited-scope.ts.shot index bab8cfe2cc2b..3be6ff4b18d4 100644 --- a/packages/scope-manager/tests/fixtures/block/inherited-scope.ts.shot +++ b/packages/scope-manager/tests/fixtures/block/inherited-scope.ts.shot @@ -3,7 +3,8 @@ exports[`block inherited-scope 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ VariableDefinition$1 { name: Identifier<"a">, @@ -19,7 +20,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$1, + resolved: Variable$2, writeExpr: Literal$2, }, Reference$2 { @@ -28,7 +29,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: true, @@ -43,12 +44,14 @@ ScopeManager { Reference$1, ], set: Map { - "a" => Variable$1, + "const" => ImplicitGlobalConstTypeVariable, + "a" => Variable$2, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, + Variable$2, ], }, BlockScope$2 { diff --git a/packages/scope-manager/tests/fixtures/block/scope.ts.shot b/packages/scope-manager/tests/fixtures/block/scope.ts.shot index 86fee58272b2..69a26f99f017 100644 --- a/packages/scope-manager/tests/fixtures/block/scope.ts.shot +++ b/packages/scope-manager/tests/fixtures/block/scope.ts.shot @@ -3,7 +3,8 @@ exports[`block scope 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ VariableDefinition$1 { name: Identifier<"i">, @@ -19,7 +20,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$1, + resolved: Variable$2, writeExpr: Literal$2, }, Reference$3 { @@ -28,13 +29,13 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$2 { + Variable$3 { defs: Array [ VariableDefinition$2 { name: Identifier<"j">, @@ -50,7 +51,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$2, + resolved: Variable$3, writeExpr: Literal$4, }, ], @@ -72,10 +73,14 @@ ScopeManager { resolved: null, }, ], - set: Map {}, + set: Map { + "const" => ImplicitGlobalConstTypeVariable, + }, type: "global", upper: null, - variables: Array [], + variables: Array [ + ImplicitGlobalConstTypeVariable, + ], }, BlockScope$2 { block: BlockStatement$6, @@ -86,14 +91,14 @@ ScopeManager { Reference$3, ], set: Map { - "i" => Variable$1, - "j" => Variable$2, + "i" => Variable$2, + "j" => Variable$3, }, type: "block", upper: GlobalScope$1, variables: Array [ - Variable$1, Variable$2, + Variable$3, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/call-expression/call-expression.ts.shot b/packages/scope-manager/tests/fixtures/call-expression/call-expression.ts.shot index 9e80fe3da6e7..38488a3a6811 100644 --- a/packages/scope-manager/tests/fixtures/call-expression/call-expression.ts.shot +++ b/packages/scope-manager/tests/fixtures/call-expression/call-expression.ts.shot @@ -3,7 +3,8 @@ exports[`call-expression call-expression 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ VariableDefinition$1 { name: Identifier<"foo">, @@ -19,7 +20,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$1, + resolved: Variable$2, writeExpr: ArrowFunctionExpression$2, }, Reference$3 { @@ -28,7 +29,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, Reference$5 { identifier: Identifier<"foo">, @@ -36,13 +37,13 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$2 { + Variable$3 { defs: Array [ VariableDefinition$2 { name: Identifier<"a">, @@ -58,7 +59,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$2, + resolved: Variable$3, writeExpr: Literal$4, }, Reference$4 { @@ -67,7 +68,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$2, + resolved: Variable$3, }, Reference$6 { identifier: Identifier<"a">, @@ -75,7 +76,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$2, + resolved: Variable$3, }, ], isValueVariable: true, @@ -95,14 +96,16 @@ ScopeManager { Reference$6, ], set: Map { - "foo" => Variable$1, - "a" => Variable$2, + "const" => ImplicitGlobalConstTypeVariable, + "foo" => Variable$2, + "a" => Variable$3, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, Variable$2, + Variable$3, ], }, FunctionScope$2 { diff --git a/packages/scope-manager/tests/fixtures/call-expression/type-parameters1.ts.shot b/packages/scope-manager/tests/fixtures/call-expression/type-parameters1.ts.shot index 6a948b3b8822..983bda61d613 100644 --- a/packages/scope-manager/tests/fixtures/call-expression/type-parameters1.ts.shot +++ b/packages/scope-manager/tests/fixtures/call-expression/type-parameters1.ts.shot @@ -3,7 +3,8 @@ exports[`call-expression type-parameters1 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ TypeDefinition$1 { name: Identifier<"T">, @@ -18,7 +19,7 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: false, @@ -41,12 +42,14 @@ ScopeManager { Reference$2, ], set: Map { - "T" => Variable$1, + "const" => ImplicitGlobalConstTypeVariable, + "T" => Variable$2, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, + Variable$2, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/call-expression/type-parameters2.ts.shot b/packages/scope-manager/tests/fixtures/call-expression/type-parameters2.ts.shot index 46cdde48ac5c..6201d0d8f9f0 100644 --- a/packages/scope-manager/tests/fixtures/call-expression/type-parameters2.ts.shot +++ b/packages/scope-manager/tests/fixtures/call-expression/type-parameters2.ts.shot @@ -3,7 +3,8 @@ exports[`call-expression type-parameters2 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ VariableDefinition$1 { name: Identifier<"T">, @@ -19,7 +20,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$1, + resolved: Variable$2, writeExpr: Literal$2, }, ], @@ -51,12 +52,14 @@ ScopeManager { }, ], set: Map { - "T" => Variable$1, + "const" => ImplicitGlobalConstTypeVariable, + "T" => Variable$2, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, + Variable$2, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/catch/inherited-scope.ts.shot b/packages/scope-manager/tests/fixtures/catch/inherited-scope.ts.shot index 8e190b98a838..206d762ed0bd 100644 --- a/packages/scope-manager/tests/fixtures/catch/inherited-scope.ts.shot +++ b/packages/scope-manager/tests/fixtures/catch/inherited-scope.ts.shot @@ -3,7 +3,8 @@ exports[`catch inherited-scope 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ VariableDefinition$1 { name: Identifier<"a">, @@ -19,7 +20,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$1, + resolved: Variable$2, writeExpr: Literal$2, }, Reference$2 { @@ -28,13 +29,13 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$2 { + Variable$3 { defs: Array [ CatchClauseDefinition$2 { name: Identifier<"e">, @@ -55,12 +56,14 @@ ScopeManager { Reference$1, ], set: Map { - "a" => Variable$1, + "const" => ImplicitGlobalConstTypeVariable, + "a" => Variable$2, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, + Variable$2, ], }, BlockScope$2 { @@ -77,12 +80,12 @@ ScopeManager { isStrict: false, references: Array [], set: Map { - "e" => Variable$2, + "e" => Variable$3, }, type: "catch", upper: GlobalScope$1, variables: Array [ - Variable$2, + Variable$3, ], }, BlockScope$4 { diff --git a/packages/scope-manager/tests/fixtures/catch/scope.ts.shot b/packages/scope-manager/tests/fixtures/catch/scope.ts.shot index d534f396fee1..c042fe1b8d91 100644 --- a/packages/scope-manager/tests/fixtures/catch/scope.ts.shot +++ b/packages/scope-manager/tests/fixtures/catch/scope.ts.shot @@ -3,7 +3,8 @@ exports[`catch scope 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ CatchClauseDefinition$1 { name: Identifier<"e">, @@ -18,13 +19,13 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$2 { + Variable$3 { defs: Array [ VariableDefinition$2 { name: Identifier<"a">, @@ -40,14 +41,14 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$2, + resolved: Variable$3, writeExpr: Literal$3, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$3 { + Variable$4 { defs: Array [ VariableDefinition$3 { name: Identifier<"unresolved">, @@ -63,14 +64,14 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$3, + resolved: Variable$4, writeExpr: Identifier<"e">, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$4 { + Variable$5 { defs: Array [ VariableDefinition$4 { name: Identifier<"dontReference2">, @@ -86,7 +87,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$4, + resolved: Variable$5, writeExpr: Identifier<"a">, }, ], @@ -119,14 +120,16 @@ ScopeManager { }, ], set: Map { - "unresolved" => Variable$3, - "dontReference2" => Variable$4, + "const" => ImplicitGlobalConstTypeVariable, + "unresolved" => Variable$4, + "dontReference2" => Variable$5, }, type: "global", upper: null, variables: Array [ - Variable$3, + ImplicitGlobalConstTypeVariable, Variable$4, + Variable$5, ], }, BlockScope$2 { @@ -143,12 +146,12 @@ ScopeManager { isStrict: false, references: Array [], set: Map { - "e" => Variable$1, + "e" => Variable$2, }, type: "catch", upper: GlobalScope$1, variables: Array [ - Variable$1, + Variable$2, ], }, BlockScope$4 { @@ -159,12 +162,12 @@ ScopeManager { Reference$2, ], set: Map { - "a" => Variable$2, + "a" => Variable$3, }, type: "block", upper: CatchScope$3, variables: Array [ - Variable$2, + Variable$3, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/class/declaration/abstract-property.ts.shot b/packages/scope-manager/tests/fixtures/class/declaration/abstract-property.ts.shot index 75750d50fbd3..61adde1dd551 100644 --- a/packages/scope-manager/tests/fixtures/class/declaration/abstract-property.ts.shot +++ b/packages/scope-manager/tests/fixtures/class/declaration/abstract-property.ts.shot @@ -3,7 +3,8 @@ exports[`class declaration abstract-property 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ TypeDefinition$1 { name: Identifier<"T">, @@ -18,13 +19,13 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: false, isTypeVariable: true, }, - Variable$2 { + Variable$3 { defs: Array [ ClassNameDefinition$2 { name: Identifier<"Foo">, @@ -36,7 +37,7 @@ ScopeManager { isValueVariable: true, isTypeVariable: true, }, - Variable$3 { + Variable$4 { defs: Array [ ClassNameDefinition$3 { name: Identifier<"Foo">, @@ -55,14 +56,16 @@ ScopeManager { isStrict: false, references: Array [], set: Map { - "T" => Variable$1, - "Foo" => Variable$2, + "const" => ImplicitGlobalConstTypeVariable, + "T" => Variable$2, + "Foo" => Variable$3, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, Variable$2, + Variable$3, ], }, ClassScope$2 { @@ -72,12 +75,12 @@ ScopeManager { Reference$1, ], set: Map { - "Foo" => Variable$3, + "Foo" => Variable$4, }, type: "class", upper: GlobalScope$1, variables: Array [ - Variable$3, + Variable$4, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/class/declaration/abstract.ts.shot b/packages/scope-manager/tests/fixtures/class/declaration/abstract.ts.shot index c49da3541307..85db667ad33f 100644 --- a/packages/scope-manager/tests/fixtures/class/declaration/abstract.ts.shot +++ b/packages/scope-manager/tests/fixtures/class/declaration/abstract.ts.shot @@ -3,7 +3,8 @@ exports[`class declaration abstract 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ ClassNameDefinition$1 { name: Identifier<"A">, @@ -15,7 +16,7 @@ ScopeManager { isValueVariable: true, isTypeVariable: true, }, - Variable$2 { + Variable$3 { defs: Array [ ClassNameDefinition$2 { name: Identifier<"A">, @@ -27,14 +28,14 @@ ScopeManager { isValueVariable: true, isTypeVariable: true, }, - Variable$3 { + Variable$4 { defs: Array [], name: "arguments", references: Array [], isValueVariable: true, isTypeVariable: true, }, - Variable$4 { + Variable$5 { defs: Array [ ParameterDefinition$3 { name: Identifier<"a">, @@ -46,7 +47,7 @@ ScopeManager { isValueVariable: true, isTypeVariable: false, }, - Variable$5 { + Variable$6 { defs: Array [ ParameterDefinition$4 { name: Identifier<"b">, @@ -65,12 +66,14 @@ ScopeManager { isStrict: false, references: Array [], set: Map { - "A" => Variable$1, + "const" => ImplicitGlobalConstTypeVariable, + "A" => Variable$2, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, + Variable$2, ], }, ClassScope$2 { @@ -78,12 +81,12 @@ ScopeManager { isStrict: true, references: Array [], set: Map { - "A" => Variable$2, + "A" => Variable$3, }, type: "class", upper: GlobalScope$1, variables: Array [ - Variable$2, + Variable$3, ], }, FunctionScope$3 { @@ -91,16 +94,16 @@ ScopeManager { isStrict: true, references: Array [], set: Map { - "arguments" => Variable$3, - "a" => Variable$4, - "b" => Variable$5, + "arguments" => Variable$4, + "a" => Variable$5, + "b" => Variable$6, }, type: "function", upper: ClassScope$2, variables: Array [ - Variable$3, Variable$4, Variable$5, + Variable$6, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/class/declaration/computed-member.ts.shot b/packages/scope-manager/tests/fixtures/class/declaration/computed-member.ts.shot index 982cc54eef22..fa221e5e540d 100644 --- a/packages/scope-manager/tests/fixtures/class/declaration/computed-member.ts.shot +++ b/packages/scope-manager/tests/fixtures/class/declaration/computed-member.ts.shot @@ -3,7 +3,8 @@ exports[`class declaration computed-member 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ VariableDefinition$1 { name: Identifier<"outer1">, @@ -19,7 +20,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$1, + resolved: Variable$2, writeExpr: Literal$2, }, Reference$3 { @@ -28,13 +29,13 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$2 { + Variable$3 { defs: Array [ VariableDefinition$2 { name: Identifier<"outer2">, @@ -50,7 +51,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$2, + resolved: Variable$3, writeExpr: Literal$4, }, Reference$4 { @@ -59,13 +60,13 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$2, + resolved: Variable$3, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$3 { + Variable$4 { defs: Array [ ClassNameDefinition$3 { name: Identifier<"A">, @@ -77,7 +78,7 @@ ScopeManager { isValueVariable: true, isTypeVariable: true, }, - Variable$4 { + Variable$5 { defs: Array [ ClassNameDefinition$4 { name: Identifier<"A">, @@ -89,7 +90,7 @@ ScopeManager { isValueVariable: true, isTypeVariable: true, }, - Variable$5 { + Variable$6 { defs: Array [], name: "arguments", references: Array [], @@ -106,16 +107,18 @@ ScopeManager { Reference$2, ], set: Map { - "outer1" => Variable$1, - "outer2" => Variable$2, - "A" => Variable$3, + "const" => ImplicitGlobalConstTypeVariable, + "outer1" => Variable$2, + "outer2" => Variable$3, + "A" => Variable$4, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, Variable$2, Variable$3, + Variable$4, ], }, ClassScope$2 { @@ -126,12 +129,12 @@ ScopeManager { Reference$4, ], set: Map { - "A" => Variable$4, + "A" => Variable$5, }, type: "class", upper: GlobalScope$1, variables: Array [ - Variable$4, + Variable$5, ], }, FunctionScope$3 { @@ -139,12 +142,12 @@ ScopeManager { isStrict: true, references: Array [], set: Map { - "arguments" => Variable$5, + "arguments" => Variable$6, }, type: "function", upper: ClassScope$2, variables: Array [ - Variable$5, + Variable$6, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/class/declaration/extends-generic.ts.shot b/packages/scope-manager/tests/fixtures/class/declaration/extends-generic.ts.shot index b4196d062c74..4e52705d309c 100644 --- a/packages/scope-manager/tests/fixtures/class/declaration/extends-generic.ts.shot +++ b/packages/scope-manager/tests/fixtures/class/declaration/extends-generic.ts.shot @@ -3,7 +3,8 @@ exports[`class declaration extends-generic 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ ClassNameDefinition$1 { name: Identifier<"A">, @@ -18,13 +19,13 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: true, isTypeVariable: true, }, - Variable$2 { + Variable$3 { defs: Array [ ClassNameDefinition$2 { name: Identifier<"A">, @@ -36,7 +37,7 @@ ScopeManager { isValueVariable: true, isTypeVariable: true, }, - Variable$3 { + Variable$4 { defs: Array [ TypeDefinition$3 { name: Identifier<"U">, @@ -48,7 +49,7 @@ ScopeManager { isValueVariable: false, isTypeVariable: true, }, - Variable$4 { + Variable$5 { defs: Array [ TypeDefinition$4 { name: Identifier<"T">, @@ -63,13 +64,13 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$4, + resolved: Variable$5, }, ], isValueVariable: false, isTypeVariable: true, }, - Variable$5 { + Variable$6 { defs: Array [ ClassNameDefinition$5 { name: Identifier<"B">, @@ -81,7 +82,7 @@ ScopeManager { isValueVariable: true, isTypeVariable: true, }, - Variable$6 { + Variable$7 { defs: Array [ ClassNameDefinition$6 { name: Identifier<"B">, @@ -100,16 +101,18 @@ ScopeManager { isStrict: false, references: Array [], set: Map { - "A" => Variable$1, - "T" => Variable$4, - "B" => Variable$5, + "const" => ImplicitGlobalConstTypeVariable, + "A" => Variable$2, + "T" => Variable$5, + "B" => Variable$6, }, type: "global", upper: null, variables: Array [ - Variable$1, - Variable$4, + ImplicitGlobalConstTypeVariable, + Variable$2, Variable$5, + Variable$6, ], }, ClassScope$2 { @@ -117,14 +120,14 @@ ScopeManager { isStrict: true, references: Array [], set: Map { - "A" => Variable$2, - "U" => Variable$3, + "A" => Variable$3, + "U" => Variable$4, }, type: "class", upper: GlobalScope$1, variables: Array [ - Variable$2, Variable$3, + Variable$4, ], }, ClassScope$3 { @@ -135,12 +138,12 @@ ScopeManager { Reference$2, ], set: Map { - "B" => Variable$6, + "B" => Variable$7, }, type: "class", upper: GlobalScope$1, variables: Array [ - Variable$6, + Variable$7, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/class/declaration/extends.ts.shot b/packages/scope-manager/tests/fixtures/class/declaration/extends.ts.shot index 6639a05d87b7..00148ab72e56 100644 --- a/packages/scope-manager/tests/fixtures/class/declaration/extends.ts.shot +++ b/packages/scope-manager/tests/fixtures/class/declaration/extends.ts.shot @@ -3,7 +3,8 @@ exports[`class declaration extends 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ ClassNameDefinition$1 { name: Identifier<"A">, @@ -18,13 +19,13 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: true, isTypeVariable: true, }, - Variable$2 { + Variable$3 { defs: Array [ ClassNameDefinition$2 { name: Identifier<"A">, @@ -36,7 +37,7 @@ ScopeManager { isValueVariable: true, isTypeVariable: true, }, - Variable$3 { + Variable$4 { defs: Array [ ClassNameDefinition$3 { name: Identifier<"B">, @@ -48,7 +49,7 @@ ScopeManager { isValueVariable: true, isTypeVariable: true, }, - Variable$4 { + Variable$5 { defs: Array [ ClassNameDefinition$4 { name: Identifier<"B">, @@ -67,14 +68,16 @@ ScopeManager { isStrict: false, references: Array [], set: Map { - "A" => Variable$1, - "B" => Variable$3, + "const" => ImplicitGlobalConstTypeVariable, + "A" => Variable$2, + "B" => Variable$4, }, type: "global", upper: null, variables: Array [ - Variable$1, - Variable$3, + ImplicitGlobalConstTypeVariable, + Variable$2, + Variable$4, ], }, ClassScope$2 { @@ -82,12 +85,12 @@ ScopeManager { isStrict: true, references: Array [], set: Map { - "A" => Variable$2, + "A" => Variable$3, }, type: "class", upper: GlobalScope$1, variables: Array [ - Variable$2, + Variable$3, ], }, ClassScope$3 { @@ -97,12 +100,12 @@ ScopeManager { Reference$1, ], set: Map { - "B" => Variable$4, + "B" => Variable$5, }, type: "class", upper: GlobalScope$1, variables: Array [ - Variable$4, + Variable$5, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/class/declaration/generic-ref-extends.ts.shot b/packages/scope-manager/tests/fixtures/class/declaration/generic-ref-extends.ts.shot index 0740dc450713..307735e76f24 100644 --- a/packages/scope-manager/tests/fixtures/class/declaration/generic-ref-extends.ts.shot +++ b/packages/scope-manager/tests/fixtures/class/declaration/generic-ref-extends.ts.shot @@ -3,7 +3,8 @@ exports[`class declaration generic-ref-extends 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ ClassNameDefinition$1 { name: Identifier<"Foo">, @@ -15,7 +16,7 @@ ScopeManager { isValueVariable: true, isTypeVariable: true, }, - Variable$2 { + Variable$3 { defs: Array [ ClassNameDefinition$2 { name: Identifier<"Foo">, @@ -27,7 +28,7 @@ ScopeManager { isValueVariable: true, isTypeVariable: true, }, - Variable$3 { + Variable$4 { defs: Array [ TypeDefinition$3 { name: Identifier<"A">, @@ -42,7 +43,7 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$3, + resolved: Variable$4, }, ], isValueVariable: false, @@ -55,12 +56,14 @@ ScopeManager { isStrict: false, references: Array [], set: Map { - "Foo" => Variable$1, + "const" => ImplicitGlobalConstTypeVariable, + "Foo" => Variable$2, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, + Variable$2, ], }, ClassScope$2 { @@ -78,14 +81,14 @@ ScopeManager { Reference$2, ], set: Map { - "Foo" => Variable$2, - "A" => Variable$3, + "Foo" => Variable$3, + "A" => Variable$4, }, type: "class", upper: GlobalScope$1, variables: Array [ - Variable$2, Variable$3, + Variable$4, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/class/declaration/generic-ref-implements.ts.shot b/packages/scope-manager/tests/fixtures/class/declaration/generic-ref-implements.ts.shot index 73ae39a9e535..6198d70760ba 100644 --- a/packages/scope-manager/tests/fixtures/class/declaration/generic-ref-implements.ts.shot +++ b/packages/scope-manager/tests/fixtures/class/declaration/generic-ref-implements.ts.shot @@ -3,7 +3,8 @@ exports[`class declaration generic-ref-implements 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ ClassNameDefinition$1 { name: Identifier<"Foo">, @@ -15,7 +16,7 @@ ScopeManager { isValueVariable: true, isTypeVariable: true, }, - Variable$2 { + Variable$3 { defs: Array [ ClassNameDefinition$2 { name: Identifier<"Foo">, @@ -27,7 +28,7 @@ ScopeManager { isValueVariable: true, isTypeVariable: true, }, - Variable$3 { + Variable$4 { defs: Array [ TypeDefinition$3 { name: Identifier<"A">, @@ -42,7 +43,7 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$3, + resolved: Variable$4, }, ], isValueVariable: false, @@ -55,12 +56,14 @@ ScopeManager { isStrict: false, references: Array [], set: Map { - "Foo" => Variable$1, + "const" => ImplicitGlobalConstTypeVariable, + "Foo" => Variable$2, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, + Variable$2, ], }, ClassScope$2 { @@ -78,14 +81,14 @@ ScopeManager { Reference$2, ], set: Map { - "Foo" => Variable$2, - "A" => Variable$3, + "Foo" => Variable$3, + "A" => Variable$4, }, type: "class", upper: GlobalScope$1, variables: Array [ - Variable$2, Variable$3, + Variable$4, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/class/declaration/generic.ts.shot b/packages/scope-manager/tests/fixtures/class/declaration/generic.ts.shot index 58d28cfba676..649e88b395fb 100644 --- a/packages/scope-manager/tests/fixtures/class/declaration/generic.ts.shot +++ b/packages/scope-manager/tests/fixtures/class/declaration/generic.ts.shot @@ -3,7 +3,8 @@ exports[`class declaration generic 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ ClassNameDefinition$1 { name: Identifier<"Foo">, @@ -15,7 +16,7 @@ ScopeManager { isValueVariable: true, isTypeVariable: true, }, - Variable$2 { + Variable$3 { defs: Array [ ClassNameDefinition$2 { name: Identifier<"Foo">, @@ -27,7 +28,7 @@ ScopeManager { isValueVariable: true, isTypeVariable: true, }, - Variable$3 { + Variable$4 { defs: Array [ TypeDefinition$3 { name: Identifier<"A">, @@ -39,7 +40,7 @@ ScopeManager { isValueVariable: false, isTypeVariable: true, }, - Variable$4 { + Variable$5 { defs: Array [ TypeDefinition$4 { name: Identifier<"Unresolved">, @@ -67,14 +68,16 @@ ScopeManager { }, ], set: Map { - "Foo" => Variable$1, - "Unresolved" => Variable$4, + "const" => ImplicitGlobalConstTypeVariable, + "Foo" => Variable$2, + "Unresolved" => Variable$5, }, type: "global", upper: null, variables: Array [ - Variable$1, - Variable$4, + ImplicitGlobalConstTypeVariable, + Variable$2, + Variable$5, ], }, ClassScope$2 { @@ -82,14 +85,14 @@ ScopeManager { isStrict: true, references: Array [], set: Map { - "Foo" => Variable$2, - "A" => Variable$3, + "Foo" => Variable$3, + "A" => Variable$4, }, type: "class", upper: GlobalScope$1, variables: Array [ - Variable$2, Variable$3, + Variable$4, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/class/declaration/implements-generic.ts.shot b/packages/scope-manager/tests/fixtures/class/declaration/implements-generic.ts.shot index 23e6f8c249f6..9c4d0b28244c 100644 --- a/packages/scope-manager/tests/fixtures/class/declaration/implements-generic.ts.shot +++ b/packages/scope-manager/tests/fixtures/class/declaration/implements-generic.ts.shot @@ -3,7 +3,8 @@ exports[`class declaration implements-generic 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ TypeDefinition$1 { name: Identifier<"A">, @@ -18,13 +19,13 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: false, isTypeVariable: true, }, - Variable$2 { + Variable$3 { defs: Array [ TypeDefinition$2 { name: Identifier<"U">, @@ -36,7 +37,7 @@ ScopeManager { isValueVariable: false, isTypeVariable: true, }, - Variable$3 { + Variable$4 { defs: Array [ TypeDefinition$3 { name: Identifier<"T">, @@ -51,13 +52,13 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$3, + resolved: Variable$4, }, ], isValueVariable: false, isTypeVariable: true, }, - Variable$4 { + Variable$5 { defs: Array [ ClassNameDefinition$4 { name: Identifier<"B">, @@ -69,7 +70,7 @@ ScopeManager { isValueVariable: true, isTypeVariable: true, }, - Variable$5 { + Variable$6 { defs: Array [ ClassNameDefinition$5 { name: Identifier<"B">, @@ -88,16 +89,18 @@ ScopeManager { isStrict: false, references: Array [], set: Map { - "A" => Variable$1, - "T" => Variable$3, - "B" => Variable$4, + "const" => ImplicitGlobalConstTypeVariable, + "A" => Variable$2, + "T" => Variable$4, + "B" => Variable$5, }, type: "global", upper: null, variables: Array [ - Variable$1, - Variable$3, + ImplicitGlobalConstTypeVariable, + Variable$2, Variable$4, + Variable$5, ], }, TypeScope$2 { @@ -105,12 +108,12 @@ ScopeManager { isStrict: true, references: Array [], set: Map { - "U" => Variable$2, + "U" => Variable$3, }, type: "type", upper: GlobalScope$1, variables: Array [ - Variable$2, + Variable$3, ], }, ClassScope$3 { @@ -121,12 +124,12 @@ ScopeManager { Reference$2, ], set: Map { - "B" => Variable$5, + "B" => Variable$6, }, type: "class", upper: GlobalScope$1, variables: Array [ - Variable$5, + Variable$6, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/class/declaration/implements.ts.shot b/packages/scope-manager/tests/fixtures/class/declaration/implements.ts.shot index 00fb651c9bbe..368793c0259c 100644 --- a/packages/scope-manager/tests/fixtures/class/declaration/implements.ts.shot +++ b/packages/scope-manager/tests/fixtures/class/declaration/implements.ts.shot @@ -3,7 +3,8 @@ exports[`class declaration implements 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ TypeDefinition$1 { name: Identifier<"A">, @@ -18,13 +19,13 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: false, isTypeVariable: true, }, - Variable$2 { + Variable$3 { defs: Array [ ClassNameDefinition$2 { name: Identifier<"B">, @@ -36,7 +37,7 @@ ScopeManager { isValueVariable: true, isTypeVariable: true, }, - Variable$3 { + Variable$4 { defs: Array [ ClassNameDefinition$3 { name: Identifier<"B">, @@ -55,14 +56,16 @@ ScopeManager { isStrict: false, references: Array [], set: Map { - "A" => Variable$1, - "B" => Variable$2, + "const" => ImplicitGlobalConstTypeVariable, + "A" => Variable$2, + "B" => Variable$3, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, Variable$2, + Variable$3, ], }, ClassScope$2 { @@ -72,12 +75,12 @@ ScopeManager { Reference$1, ], set: Map { - "B" => Variable$3, + "B" => Variable$4, }, type: "class", upper: GlobalScope$1, variables: Array [ - Variable$3, + Variable$4, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/class/declaration/method.ts.shot b/packages/scope-manager/tests/fixtures/class/declaration/method.ts.shot index aa1ce22f1d7b..468589bfad8a 100644 --- a/packages/scope-manager/tests/fixtures/class/declaration/method.ts.shot +++ b/packages/scope-manager/tests/fixtures/class/declaration/method.ts.shot @@ -3,7 +3,8 @@ exports[`class declaration method 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ ClassNameDefinition$1 { name: Identifier<"A">, @@ -15,7 +16,7 @@ ScopeManager { isValueVariable: true, isTypeVariable: true, }, - Variable$2 { + Variable$3 { defs: Array [ ClassNameDefinition$2 { name: Identifier<"A">, @@ -27,14 +28,14 @@ ScopeManager { isValueVariable: true, isTypeVariable: true, }, - Variable$3 { + Variable$4 { defs: Array [], name: "arguments", references: Array [], isValueVariable: true, isTypeVariable: true, }, - Variable$4 { + Variable$5 { defs: Array [ ParameterDefinition$3 { name: Identifier<"a">, @@ -49,7 +50,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$4, + resolved: Variable$5, }, Reference$4 { identifier: Identifier<"a">, @@ -57,13 +58,13 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$4, + resolved: Variable$5, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$5 { + Variable$6 { defs: Array [ ParameterDefinition$4 { name: Identifier<"b">, @@ -75,7 +76,7 @@ ScopeManager { isValueVariable: true, isTypeVariable: false, }, - Variable$6 { + Variable$7 { defs: Array [ ParameterDefinition$5 { name: Identifier<"c">, @@ -87,7 +88,7 @@ ScopeManager { isValueVariable: true, isTypeVariable: false, }, - Variable$7 { + Variable$8 { defs: Array [ ParameterDefinition$6 { name: Identifier<"d">, @@ -103,14 +104,14 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$7, + resolved: Variable$8, writeExpr: Literal$3, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$8 { + Variable$9 { defs: Array [ ParameterDefinition$7 { name: Identifier<"e">, @@ -126,14 +127,14 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$8, + resolved: Variable$9, writeExpr: Identifier<"a">, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$9 { + Variable$10 { defs: Array [ ParameterDefinition$8 { name: Identifier<"f">, @@ -145,7 +146,7 @@ ScopeManager { isValueVariable: true, isTypeVariable: false, }, - Variable$10 { + Variable$11 { defs: Array [ VariableDefinition$9 { name: Identifier<"unresolved1">, @@ -161,14 +162,14 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$10, + resolved: Variable$11, writeExpr: Identifier<"f">, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$11 { + Variable$12 { defs: Array [ VariableDefinition$10 { name: Identifier<"unresolved2">, @@ -184,7 +185,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$11, + resolved: Variable$12, writeExpr: Identifier<"method">, }, ], @@ -217,16 +218,18 @@ ScopeManager { }, ], set: Map { - "A" => Variable$1, - "unresolved1" => Variable$10, - "unresolved2" => Variable$11, + "const" => ImplicitGlobalConstTypeVariable, + "A" => Variable$2, + "unresolved1" => Variable$11, + "unresolved2" => Variable$12, }, type: "global", upper: null, variables: Array [ - Variable$1, - Variable$10, + ImplicitGlobalConstTypeVariable, + Variable$2, Variable$11, + Variable$12, ], }, ClassScope$2 { @@ -234,12 +237,12 @@ ScopeManager { isStrict: true, references: Array [], set: Map { - "A" => Variable$2, + "A" => Variable$3, }, type: "class", upper: GlobalScope$1, variables: Array [ - Variable$2, + Variable$3, ], }, FunctionScope$3 { @@ -252,24 +255,24 @@ ScopeManager { Reference$4, ], set: Map { - "arguments" => Variable$3, - "a" => Variable$4, - "b" => Variable$5, - "c" => Variable$6, - "d" => Variable$7, - "e" => Variable$8, - "f" => Variable$9, + "arguments" => Variable$4, + "a" => Variable$5, + "b" => Variable$6, + "c" => Variable$7, + "d" => Variable$8, + "e" => Variable$9, + "f" => Variable$10, }, type: "function", upper: ClassScope$2, variables: Array [ - Variable$3, Variable$4, Variable$5, Variable$6, Variable$7, Variable$8, Variable$9, + Variable$10, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/class/declaration/new.ts.shot b/packages/scope-manager/tests/fixtures/class/declaration/new.ts.shot index 7e045001c1cc..0a411aba998e 100644 --- a/packages/scope-manager/tests/fixtures/class/declaration/new.ts.shot +++ b/packages/scope-manager/tests/fixtures/class/declaration/new.ts.shot @@ -3,7 +3,8 @@ exports[`class declaration new 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ ClassNameDefinition$1 { name: Identifier<"A">, @@ -18,13 +19,13 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: true, isTypeVariable: true, }, - Variable$2 { + Variable$3 { defs: Array [ ClassNameDefinition$2 { name: Identifier<"A">, @@ -45,12 +46,14 @@ ScopeManager { Reference$1, ], set: Map { - "A" => Variable$1, + "const" => ImplicitGlobalConstTypeVariable, + "A" => Variable$2, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, + Variable$2, ], }, ClassScope$2 { @@ -58,12 +61,12 @@ ScopeManager { isStrict: true, references: Array [], set: Map { - "A" => Variable$2, + "A" => Variable$3, }, type: "class", upper: GlobalScope$1, variables: Array [ - Variable$2, + Variable$3, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/class/declaration/parameter-properties.ts.shot b/packages/scope-manager/tests/fixtures/class/declaration/parameter-properties.ts.shot index 616d019bf5f7..ab92b6c3b117 100644 --- a/packages/scope-manager/tests/fixtures/class/declaration/parameter-properties.ts.shot +++ b/packages/scope-manager/tests/fixtures/class/declaration/parameter-properties.ts.shot @@ -3,7 +3,8 @@ exports[`class declaration parameter-properties 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ VariableDefinition$1 { name: Identifier<"outer">, @@ -19,7 +20,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$1, + resolved: Variable$2, writeExpr: Literal$2, }, Reference$6 { @@ -28,13 +29,13 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$2 { + Variable$3 { defs: Array [ TypeDefinition$2 { name: Identifier<"Outer">, @@ -49,13 +50,13 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$2, + resolved: Variable$3, }, ], isValueVariable: false, isTypeVariable: true, }, - Variable$3 { + Variable$4 { defs: Array [ ClassNameDefinition$3 { name: Identifier<"A">, @@ -67,7 +68,7 @@ ScopeManager { isValueVariable: true, isTypeVariable: true, }, - Variable$4 { + Variable$5 { defs: Array [ ClassNameDefinition$4 { name: Identifier<"A">, @@ -79,14 +80,14 @@ ScopeManager { isValueVariable: true, isTypeVariable: true, }, - Variable$5 { + Variable$6 { defs: Array [], name: "arguments", references: Array [], isValueVariable: true, isTypeVariable: true, }, - Variable$6 { + Variable$7 { defs: Array [ ParameterDefinition$5 { name: Identifier<"a">, @@ -101,7 +102,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$6, + resolved: Variable$7, }, Reference$8 { identifier: Identifier<"a">, @@ -109,13 +110,13 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$6, + resolved: Variable$7, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$7 { + Variable$8 { defs: Array [ ParameterDefinition$6 { name: Identifier<"b">, @@ -131,14 +132,14 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$7, + resolved: Variable$8, writeExpr: Literal$6, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$8 { + Variable$9 { defs: Array [ ParameterDefinition$7 { name: Identifier<"c">, @@ -154,14 +155,14 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$8, + resolved: Variable$9, writeExpr: Identifier<"a">, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$9 { + Variable$10 { defs: Array [ ParameterDefinition$8 { name: Identifier<"d">, @@ -177,14 +178,14 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$9, + resolved: Variable$10, writeExpr: Identifier<"outer">, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$10 { + Variable$11 { defs: Array [ ParameterDefinition$9 { name: Identifier<"e">, @@ -196,7 +197,7 @@ ScopeManager { isValueVariable: true, isTypeVariable: false, }, - Variable$11 { + Variable$12 { defs: Array [ ParameterDefinition$10 { name: Identifier<"f">, @@ -208,7 +209,7 @@ ScopeManager { isValueVariable: true, isTypeVariable: false, }, - Variable$12 { + Variable$13 { defs: Array [ VariableDefinition$11 { name: Identifier<"unresovled">, @@ -224,7 +225,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$12, + resolved: Variable$13, writeExpr: Identifier<"e">, }, ], @@ -249,18 +250,20 @@ ScopeManager { }, ], set: Map { - "outer" => Variable$1, - "Outer" => Variable$2, - "A" => Variable$3, - "unresovled" => Variable$12, + "const" => ImplicitGlobalConstTypeVariable, + "outer" => Variable$2, + "Outer" => Variable$3, + "A" => Variable$4, + "unresovled" => Variable$13, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, Variable$2, Variable$3, - Variable$12, + Variable$4, + Variable$13, ], }, ClassScope$2 { @@ -268,12 +271,12 @@ ScopeManager { isStrict: true, references: Array [], set: Map { - "A" => Variable$4, + "A" => Variable$5, }, type: "class", upper: GlobalScope$1, variables: Array [ - Variable$4, + Variable$5, ], }, FunctionScope$3 { @@ -289,24 +292,24 @@ ScopeManager { Reference$8, ], set: Map { - "arguments" => Variable$5, - "a" => Variable$6, - "b" => Variable$7, - "c" => Variable$8, - "d" => Variable$9, - "e" => Variable$10, - "f" => Variable$11, + "arguments" => Variable$6, + "a" => Variable$7, + "b" => Variable$8, + "c" => Variable$9, + "d" => Variable$10, + "e" => Variable$11, + "f" => Variable$12, }, type: "function", upper: ClassScope$2, variables: Array [ - Variable$5, Variable$6, Variable$7, Variable$8, Variable$9, Variable$10, Variable$11, + Variable$12, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/class/declaration/properties-type-annotation.ts.shot b/packages/scope-manager/tests/fixtures/class/declaration/properties-type-annotation.ts.shot index 06632409575f..429118937915 100644 --- a/packages/scope-manager/tests/fixtures/class/declaration/properties-type-annotation.ts.shot +++ b/packages/scope-manager/tests/fixtures/class/declaration/properties-type-annotation.ts.shot @@ -3,7 +3,8 @@ exports[`class declaration properties-type-annotation 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ TypeDefinition$1 { name: Identifier<"T">, @@ -18,13 +19,13 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: false, isTypeVariable: true, }, - Variable$2 { + Variable$3 { defs: Array [ ClassNameDefinition$2 { name: Identifier<"A">, @@ -36,7 +37,7 @@ ScopeManager { isValueVariable: true, isTypeVariable: true, }, - Variable$3 { + Variable$4 { defs: Array [ ClassNameDefinition$3 { name: Identifier<"A">, @@ -55,14 +56,16 @@ ScopeManager { isStrict: false, references: Array [], set: Map { - "T" => Variable$1, - "A" => Variable$2, + "const" => ImplicitGlobalConstTypeVariable, + "T" => Variable$2, + "A" => Variable$3, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, Variable$2, + Variable$3, ], }, ClassScope$2 { @@ -72,12 +75,12 @@ ScopeManager { Reference$1, ], set: Map { - "A" => Variable$3, + "A" => Variable$4, }, type: "class", upper: GlobalScope$1, variables: Array [ - Variable$3, + Variable$4, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/class/declaration/properties.ts.shot b/packages/scope-manager/tests/fixtures/class/declaration/properties.ts.shot index 5fee4e911bda..3592b97d80a5 100644 --- a/packages/scope-manager/tests/fixtures/class/declaration/properties.ts.shot +++ b/packages/scope-manager/tests/fixtures/class/declaration/properties.ts.shot @@ -3,7 +3,8 @@ exports[`class declaration properties 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ ClassNameDefinition$1 { name: Identifier<"A">, @@ -15,7 +16,7 @@ ScopeManager { isValueVariable: true, isTypeVariable: true, }, - Variable$2 { + Variable$3 { defs: Array [ ClassNameDefinition$2 { name: Identifier<"A">, @@ -27,7 +28,7 @@ ScopeManager { isValueVariable: true, isTypeVariable: true, }, - Variable$3 { + Variable$4 { defs: Array [ VariableDefinition$3 { name: Identifier<"unresolved">, @@ -43,7 +44,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$3, + resolved: Variable$4, writeExpr: Identifier<"prop">, }, ], @@ -67,14 +68,16 @@ ScopeManager { }, ], set: Map { - "A" => Variable$1, - "unresolved" => Variable$3, + "const" => ImplicitGlobalConstTypeVariable, + "A" => Variable$2, + "unresolved" => Variable$4, }, type: "global", upper: null, variables: Array [ - Variable$1, - Variable$3, + ImplicitGlobalConstTypeVariable, + Variable$2, + Variable$4, ], }, ClassScope$2 { @@ -82,12 +85,12 @@ ScopeManager { isStrict: true, references: Array [], set: Map { - "A" => Variable$2, + "A" => Variable$3, }, type: "class", upper: GlobalScope$1, variables: Array [ - Variable$2, + Variable$3, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/class/declaration/type-reference.ts.shot b/packages/scope-manager/tests/fixtures/class/declaration/type-reference.ts.shot index b8c31865d10f..78b65954b2e6 100644 --- a/packages/scope-manager/tests/fixtures/class/declaration/type-reference.ts.shot +++ b/packages/scope-manager/tests/fixtures/class/declaration/type-reference.ts.shot @@ -3,7 +3,8 @@ exports[`class declaration type-reference 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ ClassNameDefinition$1 { name: Identifier<"A">, @@ -18,7 +19,7 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, Reference$2 { identifier: Identifier<"A">, @@ -26,7 +27,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, Reference$4 { identifier: Identifier<"A">, @@ -34,13 +35,13 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: true, isTypeVariable: true, }, - Variable$2 { + Variable$3 { defs: Array [ ClassNameDefinition$2 { name: Identifier<"A">, @@ -52,7 +53,7 @@ ScopeManager { isValueVariable: true, isTypeVariable: true, }, - Variable$3 { + Variable$4 { defs: Array [ TypeDefinition$3 { name: Identifier<"T1">, @@ -64,7 +65,7 @@ ScopeManager { isValueVariable: false, isTypeVariable: true, }, - Variable$4 { + Variable$5 { defs: Array [ TypeDefinition$4 { name: Identifier<"T2">, @@ -76,7 +77,7 @@ ScopeManager { isValueVariable: false, isTypeVariable: true, }, - Variable$5 { + Variable$6 { defs: Array [ VariableDefinition$5 { name: Identifier<"v">, @@ -92,7 +93,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$5, + resolved: Variable$6, writeExpr: Identifier<"A">, }, ], @@ -111,18 +112,20 @@ ScopeManager { Reference$4, ], set: Map { - "A" => Variable$1, - "T1" => Variable$3, - "T2" => Variable$4, - "v" => Variable$5, + "const" => ImplicitGlobalConstTypeVariable, + "A" => Variable$2, + "T1" => Variable$4, + "T2" => Variable$5, + "v" => Variable$6, }, type: "global", upper: null, variables: Array [ - Variable$1, - Variable$3, + ImplicitGlobalConstTypeVariable, + Variable$2, Variable$4, Variable$5, + Variable$6, ], }, ClassScope$2 { @@ -130,12 +133,12 @@ ScopeManager { isStrict: true, references: Array [], set: Map { - "A" => Variable$2, + "A" => Variable$3, }, type: "class", upper: GlobalScope$1, variables: Array [ - Variable$2, + Variable$3, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/class/expression/computed-member.ts.shot b/packages/scope-manager/tests/fixtures/class/expression/computed-member.ts.shot index 8062c2119420..25e96169fc75 100644 --- a/packages/scope-manager/tests/fixtures/class/expression/computed-member.ts.shot +++ b/packages/scope-manager/tests/fixtures/class/expression/computed-member.ts.shot @@ -3,7 +3,8 @@ exports[`class expression computed-member 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ VariableDefinition$1 { name: Identifier<"outer1">, @@ -19,7 +20,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$1, + resolved: Variable$2, writeExpr: Literal$2, }, Reference$4 { @@ -28,13 +29,13 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$2 { + Variable$3 { defs: Array [ VariableDefinition$2 { name: Identifier<"outer2">, @@ -50,7 +51,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$2, + resolved: Variable$3, writeExpr: Literal$4, }, Reference$5 { @@ -59,13 +60,13 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$2, + resolved: Variable$3, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$3 { + Variable$4 { defs: Array [ VariableDefinition$3 { name: Identifier<"A">, @@ -81,14 +82,14 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$3, + resolved: Variable$4, writeExpr: ClassExpression$6, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$4 { + Variable$5 { defs: Array [], name: "arguments", references: Array [], @@ -106,16 +107,18 @@ ScopeManager { Reference$3, ], set: Map { - "outer1" => Variable$1, - "outer2" => Variable$2, - "A" => Variable$3, + "const" => ImplicitGlobalConstTypeVariable, + "outer1" => Variable$2, + "outer2" => Variable$3, + "A" => Variable$4, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, Variable$2, Variable$3, + Variable$4, ], }, ClassScope$2 { @@ -135,12 +138,12 @@ ScopeManager { isStrict: true, references: Array [], set: Map { - "arguments" => Variable$4, + "arguments" => Variable$5, }, type: "function", upper: ClassScope$2, variables: Array [ - Variable$4, + Variable$5, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/class/expression/extends.ts.shot b/packages/scope-manager/tests/fixtures/class/expression/extends.ts.shot index cd6c299ba5f0..cd4f6d36a491 100644 --- a/packages/scope-manager/tests/fixtures/class/expression/extends.ts.shot +++ b/packages/scope-manager/tests/fixtures/class/expression/extends.ts.shot @@ -3,7 +3,8 @@ exports[`class expression extends 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ ClassNameDefinition$1 { name: Identifier<"A">, @@ -18,13 +19,13 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: true, isTypeVariable: true, }, - Variable$2 { + Variable$3 { defs: Array [ ClassNameDefinition$2 { name: Identifier<"A">, @@ -36,7 +37,7 @@ ScopeManager { isValueVariable: true, isTypeVariable: true, }, - Variable$3 { + Variable$4 { defs: Array [ VariableDefinition$3 { name: Identifier<"B">, @@ -52,7 +53,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$3, + resolved: Variable$4, writeExpr: ClassExpression$3, }, ], @@ -68,14 +69,16 @@ ScopeManager { Reference$1, ], set: Map { - "A" => Variable$1, - "B" => Variable$3, + "const" => ImplicitGlobalConstTypeVariable, + "A" => Variable$2, + "B" => Variable$4, }, type: "global", upper: null, variables: Array [ - Variable$1, - Variable$3, + ImplicitGlobalConstTypeVariable, + Variable$2, + Variable$4, ], }, ClassScope$2 { @@ -83,12 +86,12 @@ ScopeManager { isStrict: true, references: Array [], set: Map { - "A" => Variable$2, + "A" => Variable$3, }, type: "class", upper: GlobalScope$1, variables: Array [ - Variable$2, + Variable$3, ], }, ClassScope$3 { diff --git a/packages/scope-manager/tests/fixtures/class/expression/method.ts.shot b/packages/scope-manager/tests/fixtures/class/expression/method.ts.shot index 5f69df591e1a..e384c15dc7d6 100644 --- a/packages/scope-manager/tests/fixtures/class/expression/method.ts.shot +++ b/packages/scope-manager/tests/fixtures/class/expression/method.ts.shot @@ -3,7 +3,8 @@ exports[`class expression method 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ VariableDefinition$1 { name: Identifier<"A">, @@ -19,21 +20,21 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$1, + resolved: Variable$2, writeExpr: ClassExpression$2, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$2 { + Variable$3 { defs: Array [], name: "arguments", references: Array [], isValueVariable: true, isTypeVariable: true, }, - Variable$3 { + Variable$4 { defs: Array [ ParameterDefinition$2 { name: Identifier<"a">, @@ -48,7 +49,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$3, + resolved: Variable$4, }, Reference$5 { identifier: Identifier<"a">, @@ -56,13 +57,13 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$3, + resolved: Variable$4, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$4 { + Variable$5 { defs: Array [ ParameterDefinition$3 { name: Identifier<"b">, @@ -74,7 +75,7 @@ ScopeManager { isValueVariable: true, isTypeVariable: false, }, - Variable$5 { + Variable$6 { defs: Array [ ParameterDefinition$4 { name: Identifier<"c">, @@ -86,7 +87,7 @@ ScopeManager { isValueVariable: true, isTypeVariable: false, }, - Variable$6 { + Variable$7 { defs: Array [ ParameterDefinition$5 { name: Identifier<"d">, @@ -102,14 +103,14 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$6, + resolved: Variable$7, writeExpr: Literal$4, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$7 { + Variable$8 { defs: Array [ ParameterDefinition$6 { name: Identifier<"e">, @@ -125,14 +126,14 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$7, + resolved: Variable$8, writeExpr: Identifier<"a">, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$8 { + Variable$9 { defs: Array [ ParameterDefinition$7 { name: Identifier<"f">, @@ -144,7 +145,7 @@ ScopeManager { isValueVariable: true, isTypeVariable: false, }, - Variable$9 { + Variable$10 { defs: Array [ VariableDefinition$8 { name: Identifier<"unresolved1">, @@ -160,14 +161,14 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$9, + resolved: Variable$10, writeExpr: Identifier<"f">, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$10 { + Variable$11 { defs: Array [ VariableDefinition$9 { name: Identifier<"unresolved2">, @@ -183,7 +184,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$10, + resolved: Variable$11, writeExpr: Identifier<"method">, }, ], @@ -217,16 +218,18 @@ ScopeManager { }, ], set: Map { - "A" => Variable$1, - "unresolved1" => Variable$9, - "unresolved2" => Variable$10, + "const" => ImplicitGlobalConstTypeVariable, + "A" => Variable$2, + "unresolved1" => Variable$10, + "unresolved2" => Variable$11, }, type: "global", upper: null, variables: Array [ - Variable$1, - Variable$9, + ImplicitGlobalConstTypeVariable, + Variable$2, Variable$10, + Variable$11, ], }, ClassScope$2 { @@ -248,24 +251,24 @@ ScopeManager { Reference$5, ], set: Map { - "arguments" => Variable$2, - "a" => Variable$3, - "b" => Variable$4, - "c" => Variable$5, - "d" => Variable$6, - "e" => Variable$7, - "f" => Variable$8, + "arguments" => Variable$3, + "a" => Variable$4, + "b" => Variable$5, + "c" => Variable$6, + "d" => Variable$7, + "e" => Variable$8, + "f" => Variable$9, }, type: "function", upper: ClassScope$2, variables: Array [ - Variable$2, Variable$3, Variable$4, Variable$5, Variable$6, Variable$7, Variable$8, + Variable$9, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/class/expression/new.ts.shot b/packages/scope-manager/tests/fixtures/class/expression/new.ts.shot index 01a68595251b..6fdc35d5fcb2 100644 --- a/packages/scope-manager/tests/fixtures/class/expression/new.ts.shot +++ b/packages/scope-manager/tests/fixtures/class/expression/new.ts.shot @@ -3,7 +3,8 @@ exports[`class expression new 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ VariableDefinition$1 { name: Identifier<"A">, @@ -19,7 +20,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$1, + resolved: Variable$2, writeExpr: ClassExpression$2, }, Reference$2 { @@ -28,7 +29,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: true, @@ -44,12 +45,14 @@ ScopeManager { Reference$2, ], set: Map { - "A" => Variable$1, + "const" => ImplicitGlobalConstTypeVariable, + "A" => Variable$2, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, + Variable$2, ], }, ClassScope$2 { diff --git a/packages/scope-manager/tests/fixtures/class/expression/parameter-properties.ts.shot b/packages/scope-manager/tests/fixtures/class/expression/parameter-properties.ts.shot index 8534d2360fa0..66dbb6d1a6a5 100644 --- a/packages/scope-manager/tests/fixtures/class/expression/parameter-properties.ts.shot +++ b/packages/scope-manager/tests/fixtures/class/expression/parameter-properties.ts.shot @@ -3,7 +3,8 @@ exports[`class expression parameter-properties 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ VariableDefinition$1 { name: Identifier<"outer">, @@ -19,7 +20,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$1, + resolved: Variable$2, writeExpr: Literal$2, }, Reference$7 { @@ -28,13 +29,13 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$2 { + Variable$3 { defs: Array [ TypeDefinition$2 { name: Identifier<"Outer">, @@ -49,13 +50,13 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$2, + resolved: Variable$3, }, ], isValueVariable: false, isTypeVariable: true, }, - Variable$3 { + Variable$4 { defs: Array [ VariableDefinition$3 { name: Identifier<"A">, @@ -71,21 +72,21 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$3, + resolved: Variable$4, writeExpr: ClassExpression$5, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$4 { + Variable$5 { defs: Array [], name: "arguments", references: Array [], isValueVariable: true, isTypeVariable: true, }, - Variable$5 { + Variable$6 { defs: Array [ ParameterDefinition$4 { name: Identifier<"a">, @@ -100,7 +101,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$5, + resolved: Variable$6, }, Reference$9 { identifier: Identifier<"a">, @@ -108,13 +109,13 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$5, + resolved: Variable$6, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$6 { + Variable$7 { defs: Array [ ParameterDefinition$5 { name: Identifier<"b">, @@ -130,14 +131,14 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$6, + resolved: Variable$7, writeExpr: Literal$7, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$7 { + Variable$8 { defs: Array [ ParameterDefinition$6 { name: Identifier<"c">, @@ -153,14 +154,14 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$7, + resolved: Variable$8, writeExpr: Identifier<"a">, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$8 { + Variable$9 { defs: Array [ ParameterDefinition$7 { name: Identifier<"d">, @@ -176,14 +177,14 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$8, + resolved: Variable$9, writeExpr: Identifier<"outer">, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$9 { + Variable$10 { defs: Array [ ParameterDefinition$8 { name: Identifier<"e">, @@ -195,7 +196,7 @@ ScopeManager { isValueVariable: true, isTypeVariable: false, }, - Variable$10 { + Variable$11 { defs: Array [ ParameterDefinition$9 { name: Identifier<"f">, @@ -207,7 +208,7 @@ ScopeManager { isValueVariable: true, isTypeVariable: false, }, - Variable$11 { + Variable$12 { defs: Array [ VariableDefinition$10 { name: Identifier<"unresovled">, @@ -223,7 +224,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$11, + resolved: Variable$12, writeExpr: Identifier<"e">, }, ], @@ -249,18 +250,20 @@ ScopeManager { }, ], set: Map { - "outer" => Variable$1, - "Outer" => Variable$2, - "A" => Variable$3, - "unresovled" => Variable$11, + "const" => ImplicitGlobalConstTypeVariable, + "outer" => Variable$2, + "Outer" => Variable$3, + "A" => Variable$4, + "unresovled" => Variable$12, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, Variable$2, Variable$3, - Variable$11, + Variable$4, + Variable$12, ], }, ClassScope$2 { @@ -285,24 +288,24 @@ ScopeManager { Reference$9, ], set: Map { - "arguments" => Variable$4, - "a" => Variable$5, - "b" => Variable$6, - "c" => Variable$7, - "d" => Variable$8, - "e" => Variable$9, - "f" => Variable$10, + "arguments" => Variable$5, + "a" => Variable$6, + "b" => Variable$7, + "c" => Variable$8, + "d" => Variable$9, + "e" => Variable$10, + "f" => Variable$11, }, type: "function", upper: ClassScope$2, variables: Array [ - Variable$4, Variable$5, Variable$6, Variable$7, Variable$8, Variable$9, Variable$10, + Variable$11, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/class/expression/properties.ts.shot b/packages/scope-manager/tests/fixtures/class/expression/properties.ts.shot index 892ed9942867..261a24a50ecc 100644 --- a/packages/scope-manager/tests/fixtures/class/expression/properties.ts.shot +++ b/packages/scope-manager/tests/fixtures/class/expression/properties.ts.shot @@ -3,7 +3,8 @@ exports[`class expression properties 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ VariableDefinition$1 { name: Identifier<"A">, @@ -19,14 +20,14 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$1, + resolved: Variable$2, writeExpr: ClassExpression$2, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$2 { + Variable$3 { defs: Array [ VariableDefinition$2 { name: Identifier<"unresolved">, @@ -42,7 +43,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$2, + resolved: Variable$3, writeExpr: Identifier<"prop">, }, ], @@ -67,14 +68,16 @@ ScopeManager { }, ], set: Map { - "A" => Variable$1, - "unresolved" => Variable$2, + "const" => ImplicitGlobalConstTypeVariable, + "A" => Variable$2, + "unresolved" => Variable$3, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, Variable$2, + Variable$3, ], }, ClassScope$2 { diff --git a/packages/scope-manager/tests/fixtures/class/expression/self-reference-super.ts.shot b/packages/scope-manager/tests/fixtures/class/expression/self-reference-super.ts.shot index 4d15bde3af93..9c6b38b8fea2 100644 --- a/packages/scope-manager/tests/fixtures/class/expression/self-reference-super.ts.shot +++ b/packages/scope-manager/tests/fixtures/class/expression/self-reference-super.ts.shot @@ -3,7 +3,8 @@ exports[`class expression self-reference-super 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ VariableDefinition$1 { name: Identifier<"A">, @@ -19,14 +20,14 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$1, + resolved: Variable$2, writeExpr: ClassExpression$2, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$2 { + Variable$3 { defs: Array [ ClassNameDefinition$2 { name: Identifier<"A">, @@ -41,7 +42,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$2, + resolved: Variable$3, }, ], isValueVariable: true, @@ -56,12 +57,14 @@ ScopeManager { Reference$1, ], set: Map { - "A" => Variable$1, + "const" => ImplicitGlobalConstTypeVariable, + "A" => Variable$2, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, + Variable$2, ], }, ClassScope$2 { @@ -71,12 +74,12 @@ ScopeManager { Reference$2, ], set: Map { - "A" => Variable$2, + "A" => Variable$3, }, type: "class", upper: GlobalScope$1, variables: Array [ - Variable$2, + Variable$3, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/decorators/accessor.ts.shot b/packages/scope-manager/tests/fixtures/decorators/accessor.ts.shot index 88b6e1b44900..0b471462d3a7 100644 --- a/packages/scope-manager/tests/fixtures/decorators/accessor.ts.shot +++ b/packages/scope-manager/tests/fixtures/decorators/accessor.ts.shot @@ -3,7 +3,8 @@ exports[`decorators accessor 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ FunctionNameDefinition$1 { name: Identifier<"decorator">, @@ -18,7 +19,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, Reference$2 { identifier: Identifier<"decorator">, @@ -26,20 +27,20 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$2 { + Variable$3 { defs: Array [], name: "arguments", references: Array [], isValueVariable: true, isTypeVariable: true, }, - Variable$3 { + Variable$4 { defs: Array [ ClassNameDefinition$2 { name: Identifier<"Foo">, @@ -51,7 +52,7 @@ ScopeManager { isValueVariable: true, isTypeVariable: true, }, - Variable$4 { + Variable$5 { defs: Array [ ClassNameDefinition$3 { name: Identifier<"Foo">, @@ -63,14 +64,14 @@ ScopeManager { isValueVariable: true, isTypeVariable: true, }, - Variable$5 { + Variable$6 { defs: Array [], name: "arguments", references: Array [], isValueVariable: true, isTypeVariable: true, }, - Variable$6 { + Variable$7 { defs: Array [], name: "arguments", references: Array [], @@ -84,14 +85,16 @@ ScopeManager { isStrict: false, references: Array [], set: Map { - "decorator" => Variable$1, - "Foo" => Variable$3, + "const" => ImplicitGlobalConstTypeVariable, + "decorator" => Variable$2, + "Foo" => Variable$4, }, type: "global", upper: null, variables: Array [ - Variable$1, - Variable$3, + ImplicitGlobalConstTypeVariable, + Variable$2, + Variable$4, ], }, FunctionScope$2 { @@ -99,12 +102,12 @@ ScopeManager { isStrict: false, references: Array [], set: Map { - "arguments" => Variable$2, + "arguments" => Variable$3, }, type: "function", upper: GlobalScope$1, variables: Array [ - Variable$2, + Variable$3, ], }, ClassScope$3 { @@ -115,12 +118,12 @@ ScopeManager { Reference$2, ], set: Map { - "Foo" => Variable$4, + "Foo" => Variable$5, }, type: "class", upper: GlobalScope$1, variables: Array [ - Variable$4, + Variable$5, ], }, FunctionScope$4 { @@ -128,12 +131,12 @@ ScopeManager { isStrict: true, references: Array [], set: Map { - "arguments" => Variable$5, + "arguments" => Variable$6, }, type: "function", upper: ClassScope$3, variables: Array [ - Variable$5, + Variable$6, ], }, FunctionScope$5 { @@ -141,12 +144,12 @@ ScopeManager { isStrict: true, references: Array [], set: Map { - "arguments" => Variable$6, + "arguments" => Variable$7, }, type: "function", upper: ClassScope$3, variables: Array [ - Variable$6, + Variable$7, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/decorators/class-property.ts.shot b/packages/scope-manager/tests/fixtures/decorators/class-property.ts.shot index 82c6f614a131..dca6fe84e64b 100644 --- a/packages/scope-manager/tests/fixtures/decorators/class-property.ts.shot +++ b/packages/scope-manager/tests/fixtures/decorators/class-property.ts.shot @@ -3,7 +3,8 @@ exports[`decorators class-property 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ FunctionNameDefinition$1 { name: Identifier<"decorator">, @@ -18,20 +19,20 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$2 { + Variable$3 { defs: Array [], name: "arguments", references: Array [], isValueVariable: true, isTypeVariable: true, }, - Variable$3 { + Variable$4 { defs: Array [ ClassNameDefinition$2 { name: Identifier<"Foo">, @@ -43,7 +44,7 @@ ScopeManager { isValueVariable: true, isTypeVariable: true, }, - Variable$4 { + Variable$5 { defs: Array [ ClassNameDefinition$3 { name: Identifier<"Foo">, @@ -62,14 +63,16 @@ ScopeManager { isStrict: false, references: Array [], set: Map { - "decorator" => Variable$1, - "Foo" => Variable$3, + "const" => ImplicitGlobalConstTypeVariable, + "decorator" => Variable$2, + "Foo" => Variable$4, }, type: "global", upper: null, variables: Array [ - Variable$1, - Variable$3, + ImplicitGlobalConstTypeVariable, + Variable$2, + Variable$4, ], }, FunctionScope$2 { @@ -77,12 +80,12 @@ ScopeManager { isStrict: false, references: Array [], set: Map { - "arguments" => Variable$2, + "arguments" => Variable$3, }, type: "function", upper: GlobalScope$1, variables: Array [ - Variable$2, + Variable$3, ], }, ClassScope$3 { @@ -92,12 +95,12 @@ ScopeManager { Reference$1, ], set: Map { - "Foo" => Variable$4, + "Foo" => Variable$5, }, type: "class", upper: GlobalScope$1, variables: Array [ - Variable$4, + Variable$5, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/decorators/class.ts.shot b/packages/scope-manager/tests/fixtures/decorators/class.ts.shot index 08b604838153..d4c6514a0db1 100644 --- a/packages/scope-manager/tests/fixtures/decorators/class.ts.shot +++ b/packages/scope-manager/tests/fixtures/decorators/class.ts.shot @@ -3,7 +3,8 @@ exports[`decorators class 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ FunctionNameDefinition$1 { name: Identifier<"decorator">, @@ -18,20 +19,20 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$2 { + Variable$3 { defs: Array [], name: "arguments", references: Array [], isValueVariable: true, isTypeVariable: true, }, - Variable$3 { + Variable$4 { defs: Array [ ClassNameDefinition$2 { name: Identifier<"Foo">, @@ -43,7 +44,7 @@ ScopeManager { isValueVariable: true, isTypeVariable: true, }, - Variable$4 { + Variable$5 { defs: Array [ ClassNameDefinition$3 { name: Identifier<"Foo">, @@ -64,14 +65,16 @@ ScopeManager { Reference$1, ], set: Map { - "decorator" => Variable$1, - "Foo" => Variable$3, + "const" => ImplicitGlobalConstTypeVariable, + "decorator" => Variable$2, + "Foo" => Variable$4, }, type: "global", upper: null, variables: Array [ - Variable$1, - Variable$3, + ImplicitGlobalConstTypeVariable, + Variable$2, + Variable$4, ], }, FunctionScope$2 { @@ -79,12 +82,12 @@ ScopeManager { isStrict: false, references: Array [], set: Map { - "arguments" => Variable$2, + "arguments" => Variable$3, }, type: "function", upper: GlobalScope$1, variables: Array [ - Variable$2, + Variable$3, ], }, ClassScope$3 { @@ -92,12 +95,12 @@ ScopeManager { isStrict: true, references: Array [], set: Map { - "Foo" => Variable$4, + "Foo" => Variable$5, }, type: "class", upper: GlobalScope$1, variables: Array [ - Variable$4, + Variable$5, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/decorators/method.ts.shot b/packages/scope-manager/tests/fixtures/decorators/method.ts.shot index 7e2c65a324b4..8cd6d4718cac 100644 --- a/packages/scope-manager/tests/fixtures/decorators/method.ts.shot +++ b/packages/scope-manager/tests/fixtures/decorators/method.ts.shot @@ -3,7 +3,8 @@ exports[`decorators method 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ FunctionNameDefinition$1 { name: Identifier<"decorator">, @@ -18,20 +19,20 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$2 { + Variable$3 { defs: Array [], name: "arguments", references: Array [], isValueVariable: true, isTypeVariable: true, }, - Variable$3 { + Variable$4 { defs: Array [ ClassNameDefinition$2 { name: Identifier<"Foo">, @@ -43,7 +44,7 @@ ScopeManager { isValueVariable: true, isTypeVariable: true, }, - Variable$4 { + Variable$5 { defs: Array [ ClassNameDefinition$3 { name: Identifier<"Foo">, @@ -55,7 +56,7 @@ ScopeManager { isValueVariable: true, isTypeVariable: true, }, - Variable$5 { + Variable$6 { defs: Array [], name: "arguments", references: Array [], @@ -69,14 +70,16 @@ ScopeManager { isStrict: false, references: Array [], set: Map { - "decorator" => Variable$1, - "Foo" => Variable$3, + "const" => ImplicitGlobalConstTypeVariable, + "decorator" => Variable$2, + "Foo" => Variable$4, }, type: "global", upper: null, variables: Array [ - Variable$1, - Variable$3, + ImplicitGlobalConstTypeVariable, + Variable$2, + Variable$4, ], }, FunctionScope$2 { @@ -84,12 +87,12 @@ ScopeManager { isStrict: false, references: Array [], set: Map { - "arguments" => Variable$2, + "arguments" => Variable$3, }, type: "function", upper: GlobalScope$1, variables: Array [ - Variable$2, + Variable$3, ], }, ClassScope$3 { @@ -99,12 +102,12 @@ ScopeManager { Reference$1, ], set: Map { - "Foo" => Variable$4, + "Foo" => Variable$5, }, type: "class", upper: GlobalScope$1, variables: Array [ - Variable$4, + Variable$5, ], }, FunctionScope$4 { @@ -112,12 +115,12 @@ ScopeManager { isStrict: true, references: Array [], set: Map { - "arguments" => Variable$5, + "arguments" => Variable$6, }, type: "function", upper: ClassScope$3, variables: Array [ - Variable$5, + Variable$6, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/decorators/parameter-property.ts.shot b/packages/scope-manager/tests/fixtures/decorators/parameter-property.ts.shot index e61b4a9aaac8..5e349bb45225 100644 --- a/packages/scope-manager/tests/fixtures/decorators/parameter-property.ts.shot +++ b/packages/scope-manager/tests/fixtures/decorators/parameter-property.ts.shot @@ -3,7 +3,8 @@ exports[`decorators parameter-property 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ FunctionNameDefinition$1 { name: Identifier<"decorator">, @@ -18,7 +19,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, Reference$3 { identifier: Identifier<"decorator">, @@ -26,20 +27,20 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$2 { + Variable$3 { defs: Array [], name: "arguments", references: Array [], isValueVariable: true, isTypeVariable: true, }, - Variable$3 { + Variable$4 { defs: Array [ ClassNameDefinition$2 { name: Identifier<"Foo">, @@ -51,7 +52,7 @@ ScopeManager { isValueVariable: true, isTypeVariable: true, }, - Variable$4 { + Variable$5 { defs: Array [ ClassNameDefinition$3 { name: Identifier<"Foo">, @@ -63,14 +64,14 @@ ScopeManager { isValueVariable: true, isTypeVariable: true, }, - Variable$5 { + Variable$6 { defs: Array [], name: "arguments", references: Array [], isValueVariable: true, isTypeVariable: true, }, - Variable$6 { + Variable$7 { defs: Array [ ParameterDefinition$4 { name: Identifier<"a">, @@ -82,7 +83,7 @@ ScopeManager { isValueVariable: true, isTypeVariable: false, }, - Variable$7 { + Variable$8 { defs: Array [ ParameterDefinition$5 { name: Identifier<"b">, @@ -98,7 +99,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$7, + resolved: Variable$8, writeExpr: Literal$4, }, ], @@ -112,14 +113,16 @@ ScopeManager { isStrict: false, references: Array [], set: Map { - "decorator" => Variable$1, - "Foo" => Variable$3, + "const" => ImplicitGlobalConstTypeVariable, + "decorator" => Variable$2, + "Foo" => Variable$4, }, type: "global", upper: null, variables: Array [ - Variable$1, - Variable$3, + ImplicitGlobalConstTypeVariable, + Variable$2, + Variable$4, ], }, FunctionScope$2 { @@ -127,12 +130,12 @@ ScopeManager { isStrict: false, references: Array [], set: Map { - "arguments" => Variable$2, + "arguments" => Variable$3, }, type: "function", upper: GlobalScope$1, variables: Array [ - Variable$2, + Variable$3, ], }, ClassScope$3 { @@ -140,12 +143,12 @@ ScopeManager { isStrict: true, references: Array [], set: Map { - "Foo" => Variable$4, + "Foo" => Variable$5, }, type: "class", upper: GlobalScope$1, variables: Array [ - Variable$4, + Variable$5, ], }, FunctionScope$4 { @@ -157,16 +160,16 @@ ScopeManager { Reference$3, ], set: Map { - "arguments" => Variable$5, - "a" => Variable$6, - "b" => Variable$7, + "arguments" => Variable$6, + "a" => Variable$7, + "b" => Variable$8, }, type: "function", upper: ClassScope$3, variables: Array [ - Variable$5, Variable$6, Variable$7, + Variable$8, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/decorators/parameter.ts.shot b/packages/scope-manager/tests/fixtures/decorators/parameter.ts.shot index 2aa453c4cb99..9fd72e7d7042 100644 --- a/packages/scope-manager/tests/fixtures/decorators/parameter.ts.shot +++ b/packages/scope-manager/tests/fixtures/decorators/parameter.ts.shot @@ -3,7 +3,8 @@ exports[`decorators parameter 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ FunctionNameDefinition$1 { name: Identifier<"decorator">, @@ -18,7 +19,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, Reference$2 { identifier: Identifier<"decorator">, @@ -26,7 +27,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, Reference$3 { identifier: Identifier<"decorator">, @@ -34,7 +35,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, Reference$5 { identifier: Identifier<"decorator">, @@ -42,20 +43,20 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$2 { + Variable$3 { defs: Array [], name: "arguments", references: Array [], isValueVariable: true, isTypeVariable: true, }, - Variable$3 { + Variable$4 { defs: Array [ FunctionNameDefinition$2 { name: Identifier<"foo">, @@ -67,14 +68,14 @@ ScopeManager { isValueVariable: true, isTypeVariable: false, }, - Variable$4 { + Variable$5 { defs: Array [], name: "arguments", references: Array [], isValueVariable: true, isTypeVariable: true, }, - Variable$5 { + Variable$6 { defs: Array [ ParameterDefinition$3 { name: Identifier<"a">, @@ -86,7 +87,7 @@ ScopeManager { isValueVariable: true, isTypeVariable: false, }, - Variable$6 { + Variable$7 { defs: Array [ ParameterDefinition$4 { name: Identifier<"b">, @@ -98,7 +99,7 @@ ScopeManager { isValueVariable: true, isTypeVariable: false, }, - Variable$7 { + Variable$8 { defs: Array [ ParameterDefinition$5 { name: Identifier<"c">, @@ -110,7 +111,7 @@ ScopeManager { isValueVariable: true, isTypeVariable: false, }, - Variable$8 { + Variable$9 { defs: Array [ ParameterDefinition$6 { name: Identifier<"d">, @@ -126,7 +127,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$8, + resolved: Variable$9, writeExpr: Literal$3, }, ], @@ -140,14 +141,16 @@ ScopeManager { isStrict: false, references: Array [], set: Map { - "decorator" => Variable$1, - "foo" => Variable$3, + "const" => ImplicitGlobalConstTypeVariable, + "decorator" => Variable$2, + "foo" => Variable$4, }, type: "global", upper: null, variables: Array [ - Variable$1, - Variable$3, + ImplicitGlobalConstTypeVariable, + Variable$2, + Variable$4, ], }, FunctionScope$2 { @@ -155,12 +158,12 @@ ScopeManager { isStrict: false, references: Array [], set: Map { - "arguments" => Variable$2, + "arguments" => Variable$3, }, type: "function", upper: GlobalScope$1, variables: Array [ - Variable$2, + Variable$3, ], }, FunctionScope$3 { @@ -174,20 +177,20 @@ ScopeManager { Reference$5, ], set: Map { - "arguments" => Variable$4, - "a" => Variable$5, - "b" => Variable$6, - "c" => Variable$7, - "d" => Variable$8, + "arguments" => Variable$5, + "a" => Variable$6, + "b" => Variable$7, + "c" => Variable$8, + "d" => Variable$9, }, type: "function", upper: GlobalScope$1, variables: Array [ - Variable$4, Variable$5, Variable$6, Variable$7, Variable$8, + Variable$9, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/destructuring/array-assignment.ts.shot b/packages/scope-manager/tests/fixtures/destructuring/array-assignment.ts.shot index f4967e623b75..cff8c3d21798 100644 --- a/packages/scope-manager/tests/fixtures/destructuring/array-assignment.ts.shot +++ b/packages/scope-manager/tests/fixtures/destructuring/array-assignment.ts.shot @@ -3,7 +3,8 @@ exports[`destructuring array-assignment 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ VariableDefinition$1 { name: Identifier<"obj">, @@ -19,7 +20,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$1, + resolved: Variable$2, writeExpr: ObjectExpression$2, }, Reference$4 { @@ -28,13 +29,13 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$2 { + Variable$3 { defs: Array [ VariableDefinition$2 { name: Identifier<"b">, @@ -50,14 +51,14 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$2, + resolved: Variable$3, writeExpr: ArrayExpression$4, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$3 { + Variable$4 { defs: Array [ VariableDefinition$3 { name: Identifier<"c">, @@ -73,7 +74,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$3, + resolved: Variable$4, writeExpr: ArrayExpression$4, }, ], @@ -92,16 +93,18 @@ ScopeManager { Reference$4, ], set: Map { - "obj" => Variable$1, - "b" => Variable$2, - "c" => Variable$3, + "const" => ImplicitGlobalConstTypeVariable, + "obj" => Variable$2, + "b" => Variable$3, + "c" => Variable$4, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, Variable$2, Variable$3, + Variable$4, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/destructuring/array.ts.shot b/packages/scope-manager/tests/fixtures/destructuring/array.ts.shot index 713eb9ed9d9c..cccf164ebe48 100644 --- a/packages/scope-manager/tests/fixtures/destructuring/array.ts.shot +++ b/packages/scope-manager/tests/fixtures/destructuring/array.ts.shot @@ -3,7 +3,8 @@ exports[`destructuring array 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ VariableDefinition$1 { name: Identifier<"a">, @@ -19,14 +20,14 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$1, + resolved: Variable$2, writeExpr: ArrayExpression$2, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$2 { + Variable$3 { defs: Array [ VariableDefinition$2 { name: Identifier<"b">, @@ -42,14 +43,14 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$2, + resolved: Variable$3, writeExpr: ArrayExpression$2, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$3 { + Variable$4 { defs: Array [ VariableDefinition$3 { name: Identifier<"c">, @@ -65,14 +66,14 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$3, + resolved: Variable$4, writeExpr: ArrayExpression$2, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$4 { + Variable$5 { defs: Array [ VariableDefinition$4 { name: Identifier<"d">, @@ -88,7 +89,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$4, + resolved: Variable$5, writeExpr: Literal$3, }, Reference$5 { @@ -98,14 +99,14 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$4, + resolved: Variable$5, writeExpr: ArrayExpression$2, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$5 { + Variable$6 { defs: Array [ VariableDefinition$5 { name: Identifier<"e">, @@ -121,14 +122,14 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$5, + resolved: Variable$6, writeExpr: ArrayExpression$2, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$6 { + Variable$7 { defs: Array [ VariableDefinition$6 { name: Identifier<"f">, @@ -144,7 +145,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$6, + resolved: Variable$7, writeExpr: Identifier<"g">, }, Reference$8 { @@ -154,14 +155,14 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$6, + resolved: Variable$7, writeExpr: ArrayExpression$2, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$7 { + Variable$8 { defs: Array [ VariableDefinition$7 { name: Identifier<"rest">, @@ -177,7 +178,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$7, + resolved: Variable$8, writeExpr: ArrayExpression$2, }, ], @@ -209,24 +210,26 @@ ScopeManager { }, ], set: Map { - "a" => Variable$1, - "b" => Variable$2, - "c" => Variable$3, - "d" => Variable$4, - "e" => Variable$5, - "f" => Variable$6, - "rest" => Variable$7, + "const" => ImplicitGlobalConstTypeVariable, + "a" => Variable$2, + "b" => Variable$3, + "c" => Variable$4, + "d" => Variable$5, + "e" => Variable$6, + "f" => Variable$7, + "rest" => Variable$8, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, Variable$2, Variable$3, Variable$4, Variable$5, Variable$6, Variable$7, + Variable$8, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/destructuring/object-assignment.ts.shot b/packages/scope-manager/tests/fixtures/destructuring/object-assignment.ts.shot index a1aec3c47b91..7652978efd21 100644 --- a/packages/scope-manager/tests/fixtures/destructuring/object-assignment.ts.shot +++ b/packages/scope-manager/tests/fixtures/destructuring/object-assignment.ts.shot @@ -3,7 +3,8 @@ exports[`destructuring object-assignment 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ VariableDefinition$1 { name: Identifier<"obj">, @@ -19,7 +20,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$1, + resolved: Variable$2, writeExpr: ObjectExpression$2, }, Reference$4 { @@ -28,7 +29,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: true, @@ -72,12 +73,14 @@ ScopeManager { }, ], set: Map { - "obj" => Variable$1, + "const" => ImplicitGlobalConstTypeVariable, + "obj" => Variable$2, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, + Variable$2, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/destructuring/object.ts.shot b/packages/scope-manager/tests/fixtures/destructuring/object.ts.shot index cd501444cc5a..c23beb599210 100644 --- a/packages/scope-manager/tests/fixtures/destructuring/object.ts.shot +++ b/packages/scope-manager/tests/fixtures/destructuring/object.ts.shot @@ -3,7 +3,8 @@ exports[`destructuring object 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ VariableDefinition$1 { name: Identifier<"shorthand">, @@ -19,14 +20,14 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$1, + resolved: Variable$2, writeExpr: Identifier<"object">, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$2 { + Variable$3 { defs: Array [ VariableDefinition$2 { name: Identifier<"value">, @@ -42,14 +43,14 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$2, + resolved: Variable$3, writeExpr: Identifier<"object">, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$3 { + Variable$4 { defs: Array [ VariableDefinition$3 { name: Identifier<"world">, @@ -65,14 +66,14 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$3, + resolved: Variable$4, writeExpr: Identifier<"object">, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$4 { + Variable$5 { defs: Array [ VariableDefinition$4 { name: Identifier<"a">, @@ -88,14 +89,14 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$4, + resolved: Variable$5, writeExpr: Identifier<"object">, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$5 { + Variable$6 { defs: Array [ VariableDefinition$5 { name: Identifier<"b">, @@ -111,14 +112,14 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$5, + resolved: Variable$6, writeExpr: Identifier<"object">, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$6 { + Variable$7 { defs: Array [ VariableDefinition$6 { name: Identifier<"c">, @@ -134,14 +135,14 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$6, + resolved: Variable$7, writeExpr: Identifier<"object">, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$7 { + Variable$8 { defs: Array [ VariableDefinition$7 { name: Identifier<"d">, @@ -157,7 +158,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$7, + resolved: Variable$8, writeExpr: Identifier<"object">, }, ], @@ -187,24 +188,26 @@ ScopeManager { }, ], set: Map { - "shorthand" => Variable$1, - "value" => Variable$2, - "world" => Variable$3, - "a" => Variable$4, - "b" => Variable$5, - "c" => Variable$6, - "d" => Variable$7, + "const" => ImplicitGlobalConstTypeVariable, + "shorthand" => Variable$2, + "value" => Variable$3, + "world" => Variable$4, + "a" => Variable$5, + "b" => Variable$6, + "c" => Variable$7, + "d" => Variable$8, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, Variable$2, Variable$3, Variable$4, Variable$5, Variable$6, Variable$7, + Variable$8, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/export/all.ts.shot b/packages/scope-manager/tests/fixtures/export/all.ts.shot index a420ebe9cc08..207e8fc5cf30 100644 --- a/packages/scope-manager/tests/fixtures/export/all.ts.shot +++ b/packages/scope-manager/tests/fixtures/export/all.ts.shot @@ -2,16 +2,22 @@ exports[`export all 1`] = ` ScopeManager { - variables: Array [], + variables: Array [ + ImplicitGlobalConstTypeVariable, + ], scopes: Array [ GlobalScope$1 { block: Program$1, isStrict: false, references: Array [], - set: Map {}, + set: Map { + "const" => ImplicitGlobalConstTypeVariable, + }, type: "global", upper: null, - variables: Array [], + variables: Array [ + ImplicitGlobalConstTypeVariable, + ], }, ModuleScope$2 { block: Program$1, diff --git a/packages/scope-manager/tests/fixtures/export/default-type.ts.shot b/packages/scope-manager/tests/fixtures/export/default-type.ts.shot index 491f770171c3..cd8ffb388738 100644 --- a/packages/scope-manager/tests/fixtures/export/default-type.ts.shot +++ b/packages/scope-manager/tests/fixtures/export/default-type.ts.shot @@ -3,7 +3,8 @@ exports[`export default-type 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ TypeDefinition$1 { name: Identifier<"T">, @@ -18,7 +19,7 @@ ScopeManager { isTypeReference: true, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: false, @@ -30,10 +31,14 @@ ScopeManager { block: Program$2, isStrict: false, references: Array [], - set: Map {}, + set: Map { + "const" => ImplicitGlobalConstTypeVariable, + }, type: "global", upper: null, - variables: Array [], + variables: Array [ + ImplicitGlobalConstTypeVariable, + ], }, ModuleScope$2 { block: Program$2, @@ -42,12 +47,12 @@ ScopeManager { Reference$1, ], set: Map { - "T" => Variable$1, + "T" => Variable$2, }, type: "module", upper: GlobalScope$1, variables: Array [ - Variable$1, + Variable$2, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/export/default1.ts.shot b/packages/scope-manager/tests/fixtures/export/default1.ts.shot index 7e8fe1b48b81..28eba0906342 100644 --- a/packages/scope-manager/tests/fixtures/export/default1.ts.shot +++ b/packages/scope-manager/tests/fixtures/export/default1.ts.shot @@ -3,7 +3,8 @@ exports[`export default1 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ FunctionNameDefinition$1 { name: Identifier<"f">, @@ -15,7 +16,7 @@ ScopeManager { isValueVariable: true, isTypeVariable: false, }, - Variable$2 { + Variable$3 { defs: Array [], name: "arguments", references: Array [], @@ -28,22 +29,26 @@ ScopeManager { block: Program$2, isStrict: false, references: Array [], - set: Map {}, + set: Map { + "const" => ImplicitGlobalConstTypeVariable, + }, type: "global", upper: null, - variables: Array [], + variables: Array [ + ImplicitGlobalConstTypeVariable, + ], }, ModuleScope$2 { block: Program$2, isStrict: true, references: Array [], set: Map { - "f" => Variable$1, + "f" => Variable$2, }, type: "module", upper: GlobalScope$1, variables: Array [ - Variable$1, + Variable$2, ], }, FunctionScope$3 { @@ -51,12 +56,12 @@ ScopeManager { isStrict: true, references: Array [], set: Map { - "arguments" => Variable$2, + "arguments" => Variable$3, }, type: "function", upper: ModuleScope$2, variables: Array [ - Variable$2, + Variable$3, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/export/default2.ts.shot b/packages/scope-manager/tests/fixtures/export/default2.ts.shot index 4dda1f3f5681..af1ce16878c7 100644 --- a/packages/scope-manager/tests/fixtures/export/default2.ts.shot +++ b/packages/scope-manager/tests/fixtures/export/default2.ts.shot @@ -3,7 +3,8 @@ exports[`export default2 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ VariableDefinition$1 { name: Identifier<"a">, @@ -19,7 +20,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$1, + resolved: Variable$2, writeExpr: Literal$2, }, Reference$2 { @@ -28,7 +29,7 @@ ScopeManager { isTypeReference: true, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: true, @@ -40,10 +41,14 @@ ScopeManager { block: Program$3, isStrict: false, references: Array [], - set: Map {}, + set: Map { + "const" => ImplicitGlobalConstTypeVariable, + }, type: "global", upper: null, - variables: Array [], + variables: Array [ + ImplicitGlobalConstTypeVariable, + ], }, ModuleScope$2 { block: Program$3, @@ -53,12 +58,12 @@ ScopeManager { Reference$2, ], set: Map { - "a" => Variable$1, + "a" => Variable$2, }, type: "module", upper: GlobalScope$1, variables: Array [ - Variable$1, + Variable$2, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/export/default3.ts.shot b/packages/scope-manager/tests/fixtures/export/default3.ts.shot index 620d33c95346..de0b2e6a2809 100644 --- a/packages/scope-manager/tests/fixtures/export/default3.ts.shot +++ b/packages/scope-manager/tests/fixtures/export/default3.ts.shot @@ -2,16 +2,22 @@ exports[`export default3 1`] = ` ScopeManager { - variables: Array [], + variables: Array [ + ImplicitGlobalConstTypeVariable, + ], scopes: Array [ GlobalScope$1 { block: Program$1, isStrict: false, references: Array [], - set: Map {}, + set: Map { + "const" => ImplicitGlobalConstTypeVariable, + }, type: "global", upper: null, - variables: Array [], + variables: Array [ + ImplicitGlobalConstTypeVariable, + ], }, ModuleScope$2 { block: Program$1, diff --git a/packages/scope-manager/tests/fixtures/export/default4.ts.shot b/packages/scope-manager/tests/fixtures/export/default4.ts.shot index c02248243ecd..1544042a6e86 100644 --- a/packages/scope-manager/tests/fixtures/export/default4.ts.shot +++ b/packages/scope-manager/tests/fixtures/export/default4.ts.shot @@ -3,7 +3,8 @@ exports[`export default4 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [], name: "arguments", references: Array [], @@ -16,10 +17,14 @@ ScopeManager { block: Program$1, isStrict: false, references: Array [], - set: Map {}, + set: Map { + "const" => ImplicitGlobalConstTypeVariable, + }, type: "global", upper: null, - variables: Array [], + variables: Array [ + ImplicitGlobalConstTypeVariable, + ], }, ModuleScope$2 { block: Program$1, @@ -35,12 +40,12 @@ ScopeManager { isStrict: true, references: Array [], set: Map { - "arguments" => Variable$1, + "arguments" => Variable$2, }, type: "function", upper: ModuleScope$2, variables: Array [ - Variable$1, + Variable$2, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/export/equals1.ts.shot b/packages/scope-manager/tests/fixtures/export/equals1.ts.shot index b689422a830f..5185581a0d27 100644 --- a/packages/scope-manager/tests/fixtures/export/equals1.ts.shot +++ b/packages/scope-manager/tests/fixtures/export/equals1.ts.shot @@ -3,7 +3,8 @@ exports[`export equals1 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ VariableDefinition$1 { name: Identifier<"x">, @@ -19,7 +20,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$1, + resolved: Variable$2, writeExpr: Literal$2, }, Reference$2 { @@ -28,7 +29,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: true, @@ -40,10 +41,14 @@ ScopeManager { block: Program$3, isStrict: false, references: Array [], - set: Map {}, + set: Map { + "const" => ImplicitGlobalConstTypeVariable, + }, type: "global", upper: null, - variables: Array [], + variables: Array [ + ImplicitGlobalConstTypeVariable, + ], }, ModuleScope$2 { block: Program$3, @@ -53,12 +58,12 @@ ScopeManager { Reference$2, ], set: Map { - "x" => Variable$1, + "x" => Variable$2, }, type: "module", upper: GlobalScope$1, variables: Array [ - Variable$1, + Variable$2, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/export/equals2.ts.shot b/packages/scope-manager/tests/fixtures/export/equals2.ts.shot index 3b83940b97eb..c12dced3391f 100644 --- a/packages/scope-manager/tests/fixtures/export/equals2.ts.shot +++ b/packages/scope-manager/tests/fixtures/export/equals2.ts.shot @@ -2,16 +2,22 @@ exports[`export equals2 1`] = ` ScopeManager { - variables: Array [], + variables: Array [ + ImplicitGlobalConstTypeVariable, + ], scopes: Array [ GlobalScope$1 { block: Program$1, isStrict: false, references: Array [], - set: Map {}, + set: Map { + "const" => ImplicitGlobalConstTypeVariable, + }, type: "global", upper: null, - variables: Array [], + variables: Array [ + ImplicitGlobalConstTypeVariable, + ], }, ModuleScope$2 { block: Program$1, diff --git a/packages/scope-manager/tests/fixtures/export/named-dual.ts.shot b/packages/scope-manager/tests/fixtures/export/named-dual.ts.shot index dd8bc58834dc..dcc2b576ab1b 100644 --- a/packages/scope-manager/tests/fixtures/export/named-dual.ts.shot +++ b/packages/scope-manager/tests/fixtures/export/named-dual.ts.shot @@ -3,7 +3,8 @@ exports[`export named-dual 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ VariableDefinition$1 { name: Identifier<"T">, @@ -23,7 +24,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$1, + resolved: Variable$2, writeExpr: Literal$3, }, Reference$2 { @@ -32,7 +33,7 @@ ScopeManager { isTypeReference: true, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: true, @@ -48,12 +49,14 @@ ScopeManager { Reference$2, ], set: Map { - "T" => Variable$1, + "const" => ImplicitGlobalConstTypeVariable, + "T" => Variable$2, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, + Variable$2, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/export/named-source1.ts.shot b/packages/scope-manager/tests/fixtures/export/named-source1.ts.shot index 7598572fc78e..b0c72051de2b 100644 --- a/packages/scope-manager/tests/fixtures/export/named-source1.ts.shot +++ b/packages/scope-manager/tests/fixtures/export/named-source1.ts.shot @@ -2,16 +2,22 @@ exports[`export named-source1 1`] = ` ScopeManager { - variables: Array [], + variables: Array [ + ImplicitGlobalConstTypeVariable, + ], scopes: Array [ GlobalScope$1 { block: Program$1, isStrict: false, references: Array [], - set: Map {}, + set: Map { + "const" => ImplicitGlobalConstTypeVariable, + }, type: "global", upper: null, - variables: Array [], + variables: Array [ + ImplicitGlobalConstTypeVariable, + ], }, ModuleScope$2 { block: Program$1, diff --git a/packages/scope-manager/tests/fixtures/export/named-source2.ts.shot b/packages/scope-manager/tests/fixtures/export/named-source2.ts.shot index e56a8288c32a..11873326c52b 100644 --- a/packages/scope-manager/tests/fixtures/export/named-source2.ts.shot +++ b/packages/scope-manager/tests/fixtures/export/named-source2.ts.shot @@ -2,16 +2,22 @@ exports[`export named-source2 1`] = ` ScopeManager { - variables: Array [], + variables: Array [ + ImplicitGlobalConstTypeVariable, + ], scopes: Array [ GlobalScope$1 { block: Program$1, isStrict: false, references: Array [], - set: Map {}, + set: Map { + "const" => ImplicitGlobalConstTypeVariable, + }, type: "global", upper: null, - variables: Array [], + variables: Array [ + ImplicitGlobalConstTypeVariable, + ], }, ModuleScope$2 { block: Program$1, diff --git a/packages/scope-manager/tests/fixtures/export/named-type1.ts.shot b/packages/scope-manager/tests/fixtures/export/named-type1.ts.shot index f9b193e83db1..c999b4dfa3eb 100644 --- a/packages/scope-manager/tests/fixtures/export/named-type1.ts.shot +++ b/packages/scope-manager/tests/fixtures/export/named-type1.ts.shot @@ -3,7 +3,8 @@ exports[`export named-type1 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ TypeDefinition$1 { name: Identifier<"X">, @@ -21,22 +22,26 @@ ScopeManager { block: Program$2, isStrict: false, references: Array [], - set: Map {}, + set: Map { + "const" => ImplicitGlobalConstTypeVariable, + }, type: "global", upper: null, - variables: Array [], + variables: Array [ + ImplicitGlobalConstTypeVariable, + ], }, ModuleScope$2 { block: Program$2, isStrict: true, references: Array [], set: Map { - "X" => Variable$1, + "X" => Variable$2, }, type: "module", upper: GlobalScope$1, variables: Array [ - Variable$1, + Variable$2, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/export/named1.ts.shot b/packages/scope-manager/tests/fixtures/export/named1.ts.shot index 346f856c6d2b..148561757f0c 100644 --- a/packages/scope-manager/tests/fixtures/export/named1.ts.shot +++ b/packages/scope-manager/tests/fixtures/export/named1.ts.shot @@ -3,7 +3,8 @@ exports[`export named1 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ VariableDefinition$1 { name: Identifier<"x">, @@ -19,7 +20,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$1, + resolved: Variable$2, writeExpr: Literal$2, }, ], @@ -32,10 +33,14 @@ ScopeManager { block: Program$3, isStrict: false, references: Array [], - set: Map {}, + set: Map { + "const" => ImplicitGlobalConstTypeVariable, + }, type: "global", upper: null, - variables: Array [], + variables: Array [ + ImplicitGlobalConstTypeVariable, + ], }, ModuleScope$2 { block: Program$3, @@ -44,12 +49,12 @@ ScopeManager { Reference$1, ], set: Map { - "x" => Variable$1, + "x" => Variable$2, }, type: "module", upper: GlobalScope$1, variables: Array [ - Variable$1, + Variable$2, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/export/named2-type.ts.shot b/packages/scope-manager/tests/fixtures/export/named2-type.ts.shot index 6ce886e949cf..d14df664ec59 100644 --- a/packages/scope-manager/tests/fixtures/export/named2-type.ts.shot +++ b/packages/scope-manager/tests/fixtures/export/named2-type.ts.shot @@ -3,7 +3,8 @@ exports[`export named2-type 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ TypeDefinition$1 { name: Identifier<"A">, @@ -18,7 +19,7 @@ ScopeManager { isTypeReference: true, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: false, @@ -30,10 +31,14 @@ ScopeManager { block: Program$2, isStrict: false, references: Array [], - set: Map {}, + set: Map { + "const" => ImplicitGlobalConstTypeVariable, + }, type: "global", upper: null, - variables: Array [], + variables: Array [ + ImplicitGlobalConstTypeVariable, + ], }, ModuleScope$2 { block: Program$2, @@ -42,12 +47,12 @@ ScopeManager { Reference$1, ], set: Map { - "A" => Variable$1, + "A" => Variable$2, }, type: "module", upper: GlobalScope$1, variables: Array [ - Variable$1, + Variable$2, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/export/named2.ts.shot b/packages/scope-manager/tests/fixtures/export/named2.ts.shot index 47039df33c8c..979be9bd9628 100644 --- a/packages/scope-manager/tests/fixtures/export/named2.ts.shot +++ b/packages/scope-manager/tests/fixtures/export/named2.ts.shot @@ -3,7 +3,8 @@ exports[`export named2 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ VariableDefinition$1 { name: Identifier<"a">, @@ -19,7 +20,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$1, + resolved: Variable$2, writeExpr: Literal$2, }, Reference$2 { @@ -28,7 +29,7 @@ ScopeManager { isTypeReference: true, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: true, @@ -40,10 +41,14 @@ ScopeManager { block: Program$3, isStrict: false, references: Array [], - set: Map {}, + set: Map { + "const" => ImplicitGlobalConstTypeVariable, + }, type: "global", upper: null, - variables: Array [], + variables: Array [ + ImplicitGlobalConstTypeVariable, + ], }, ModuleScope$2 { block: Program$3, @@ -53,12 +58,12 @@ ScopeManager { Reference$2, ], set: Map { - "a" => Variable$1, + "a" => Variable$2, }, type: "module", upper: GlobalScope$1, variables: Array [ - Variable$1, + Variable$2, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/export/named3-type.ts.shot b/packages/scope-manager/tests/fixtures/export/named3-type.ts.shot index 857355afdef7..1f2cdf0f0ce1 100644 --- a/packages/scope-manager/tests/fixtures/export/named3-type.ts.shot +++ b/packages/scope-manager/tests/fixtures/export/named3-type.ts.shot @@ -3,7 +3,8 @@ exports[`export named3-type 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ TypeDefinition$1 { name: Identifier<"V">, @@ -18,7 +19,7 @@ ScopeManager { isTypeReference: true, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: false, @@ -30,10 +31,14 @@ ScopeManager { block: Program$2, isStrict: false, references: Array [], - set: Map {}, + set: Map { + "const" => ImplicitGlobalConstTypeVariable, + }, type: "global", upper: null, - variables: Array [], + variables: Array [ + ImplicitGlobalConstTypeVariable, + ], }, ModuleScope$2 { block: Program$2, @@ -42,12 +47,12 @@ ScopeManager { Reference$1, ], set: Map { - "V" => Variable$1, + "V" => Variable$2, }, type: "module", upper: GlobalScope$1, variables: Array [ - Variable$1, + Variable$2, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/export/named3.ts.shot b/packages/scope-manager/tests/fixtures/export/named3.ts.shot index df3271e94335..2ef856086ea2 100644 --- a/packages/scope-manager/tests/fixtures/export/named3.ts.shot +++ b/packages/scope-manager/tests/fixtures/export/named3.ts.shot @@ -3,7 +3,8 @@ exports[`export named3 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ VariableDefinition$1 { name: Identifier<"v">, @@ -19,7 +20,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$1, + resolved: Variable$2, writeExpr: Literal$2, }, Reference$2 { @@ -28,7 +29,7 @@ ScopeManager { isTypeReference: true, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: true, @@ -40,10 +41,14 @@ ScopeManager { block: Program$3, isStrict: false, references: Array [], - set: Map {}, + set: Map { + "const" => ImplicitGlobalConstTypeVariable, + }, type: "global", upper: null, - variables: Array [], + variables: Array [ + ImplicitGlobalConstTypeVariable, + ], }, ModuleScope$2 { block: Program$3, @@ -53,12 +58,12 @@ ScopeManager { Reference$2, ], set: Map { - "v" => Variable$1, + "v" => Variable$2, }, type: "module", upper: GlobalScope$1, variables: Array [ - Variable$1, + Variable$2, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/export/type.ts.shot b/packages/scope-manager/tests/fixtures/export/type.ts.shot index 1bc0de38c41d..c95efa551ab2 100644 --- a/packages/scope-manager/tests/fixtures/export/type.ts.shot +++ b/packages/scope-manager/tests/fixtures/export/type.ts.shot @@ -3,7 +3,8 @@ exports[`export type 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ VariableDefinition$1 { name: Identifier<"T">, @@ -23,7 +24,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$1, + resolved: Variable$2, writeExpr: Literal$3, }, Reference$2 { @@ -32,7 +33,7 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: true, @@ -44,10 +45,14 @@ ScopeManager { block: Program$4, isStrict: false, references: Array [], - set: Map {}, + set: Map { + "const" => ImplicitGlobalConstTypeVariable, + }, type: "global", upper: null, - variables: Array [], + variables: Array [ + ImplicitGlobalConstTypeVariable, + ], }, ModuleScope$2 { block: Program$4, @@ -57,12 +62,12 @@ ScopeManager { Reference$2, ], set: Map { - "T" => Variable$1, + "T" => Variable$2, }, type: "module", upper: GlobalScope$1, variables: Array [ - Variable$1, + Variable$2, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/functions/arrow/default-params/readable-ref-body-shadow.ts.shot b/packages/scope-manager/tests/fixtures/functions/arrow/default-params/readable-ref-body-shadow.ts.shot index 830cbb524f36..3f56afcb1645 100644 --- a/packages/scope-manager/tests/fixtures/functions/arrow/default-params/readable-ref-body-shadow.ts.shot +++ b/packages/scope-manager/tests/fixtures/functions/arrow/default-params/readable-ref-body-shadow.ts.shot @@ -3,7 +3,8 @@ exports[`functions arrow default-params readable-ref-body-shadow 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ VariableDefinition$1 { name: Identifier<"a">, @@ -18,13 +19,13 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$2 { + Variable$3 { defs: Array [ VariableDefinition$2 { name: Identifier<"foo">, @@ -40,14 +41,14 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$2, + resolved: Variable$3, writeExpr: ArrowFunctionExpression$3, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$3 { + Variable$4 { defs: Array [ ParameterDefinition$3 { name: Identifier<"b">, @@ -63,14 +64,14 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$3, + resolved: Variable$4, writeExpr: Identifier<"a">, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$4 { + Variable$5 { defs: Array [ VariableDefinition$4 { name: Identifier<"a">, @@ -91,14 +92,16 @@ ScopeManager { Reference$1, ], set: Map { - "a" => Variable$1, - "foo" => Variable$2, + "const" => ImplicitGlobalConstTypeVariable, + "a" => Variable$2, + "foo" => Variable$3, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, Variable$2, + Variable$3, ], }, FunctionScope$2 { @@ -109,14 +112,14 @@ ScopeManager { Reference$3, ], set: Map { - "b" => Variable$3, - "a" => Variable$4, + "b" => Variable$4, + "a" => Variable$5, }, type: "function", upper: GlobalScope$1, variables: Array [ - Variable$3, Variable$4, + Variable$5, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/functions/arrow/default-params/readable-ref-const.ts.shot b/packages/scope-manager/tests/fixtures/functions/arrow/default-params/readable-ref-const.ts.shot index 8f46b5b608dd..ef1e32d36e21 100644 --- a/packages/scope-manager/tests/fixtures/functions/arrow/default-params/readable-ref-const.ts.shot +++ b/packages/scope-manager/tests/fixtures/functions/arrow/default-params/readable-ref-const.ts.shot @@ -3,7 +3,8 @@ exports[`functions arrow default-params readable-ref-const 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ VariableDefinition$1 { name: Identifier<"a">, @@ -19,7 +20,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$1, + resolved: Variable$2, writeExpr: Literal$2, }, Reference$4 { @@ -28,13 +29,13 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$2 { + Variable$3 { defs: Array [ VariableDefinition$2 { name: Identifier<"foo">, @@ -50,14 +51,14 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$2, + resolved: Variable$3, writeExpr: ArrowFunctionExpression$4, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$3 { + Variable$4 { defs: Array [ ParameterDefinition$3 { name: Identifier<"b">, @@ -73,7 +74,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$3, + resolved: Variable$4, writeExpr: Identifier<"a">, }, ], @@ -90,14 +91,16 @@ ScopeManager { Reference$2, ], set: Map { - "a" => Variable$1, - "foo" => Variable$2, + "const" => ImplicitGlobalConstTypeVariable, + "a" => Variable$2, + "foo" => Variable$3, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, Variable$2, + Variable$3, ], }, FunctionScope$2 { @@ -108,12 +111,12 @@ ScopeManager { Reference$4, ], set: Map { - "b" => Variable$3, + "b" => Variable$4, }, type: "function", upper: GlobalScope$1, variables: Array [ - Variable$3, + Variable$4, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/functions/arrow/default-params/readable-ref-let.ts.shot b/packages/scope-manager/tests/fixtures/functions/arrow/default-params/readable-ref-let.ts.shot index 6f12d56d5784..8e9eea5929e6 100644 --- a/packages/scope-manager/tests/fixtures/functions/arrow/default-params/readable-ref-let.ts.shot +++ b/packages/scope-manager/tests/fixtures/functions/arrow/default-params/readable-ref-let.ts.shot @@ -3,7 +3,8 @@ exports[`functions arrow default-params readable-ref-let 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ VariableDefinition$1 { name: Identifier<"a">, @@ -18,13 +19,13 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$2 { + Variable$3 { defs: Array [ VariableDefinition$2 { name: Identifier<"foo">, @@ -40,14 +41,14 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$2, + resolved: Variable$3, writeExpr: ArrowFunctionExpression$3, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$3 { + Variable$4 { defs: Array [ ParameterDefinition$3 { name: Identifier<"b">, @@ -63,7 +64,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$3, + resolved: Variable$4, writeExpr: Identifier<"a">, }, ], @@ -79,14 +80,16 @@ ScopeManager { Reference$1, ], set: Map { - "a" => Variable$1, - "foo" => Variable$2, + "const" => ImplicitGlobalConstTypeVariable, + "a" => Variable$2, + "foo" => Variable$3, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, Variable$2, + Variable$3, ], }, FunctionScope$2 { @@ -97,12 +100,12 @@ ScopeManager { Reference$3, ], set: Map { - "b" => Variable$3, + "b" => Variable$4, }, type: "function", upper: GlobalScope$1, variables: Array [ - Variable$3, + Variable$4, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/functions/arrow/default-params/readable-ref-nested-body-shadow.ts.shot b/packages/scope-manager/tests/fixtures/functions/arrow/default-params/readable-ref-nested-body-shadow.ts.shot index 5d2b2a357938..10e7d131caa4 100644 --- a/packages/scope-manager/tests/fixtures/functions/arrow/default-params/readable-ref-nested-body-shadow.ts.shot +++ b/packages/scope-manager/tests/fixtures/functions/arrow/default-params/readable-ref-nested-body-shadow.ts.shot @@ -3,7 +3,8 @@ exports[`functions arrow default-params readable-ref-nested-body-shadow 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ VariableDefinition$1 { name: Identifier<"a">, @@ -18,13 +19,13 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$2 { + Variable$3 { defs: Array [ VariableDefinition$2 { name: Identifier<"foo">, @@ -40,14 +41,14 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$2, + resolved: Variable$3, writeExpr: ArrowFunctionExpression$3, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$3 { + Variable$4 { defs: Array [ ParameterDefinition$3 { name: Identifier<"b">, @@ -63,21 +64,21 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$3, + resolved: Variable$4, writeExpr: FunctionExpression$4, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$4 { + Variable$5 { defs: Array [], name: "arguments", references: Array [], isValueVariable: true, isTypeVariable: true, }, - Variable$5 { + Variable$6 { defs: Array [ VariableDefinition$4 { name: Identifier<"a">, @@ -98,14 +99,16 @@ ScopeManager { Reference$1, ], set: Map { - "a" => Variable$1, - "foo" => Variable$2, + "const" => ImplicitGlobalConstTypeVariable, + "a" => Variable$2, + "foo" => Variable$3, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, Variable$2, + Variable$3, ], }, FunctionScope$2 { @@ -115,14 +118,14 @@ ScopeManager { Reference$2, ], set: Map { - "b" => Variable$3, - "a" => Variable$5, + "b" => Variable$4, + "a" => Variable$6, }, type: "function", upper: GlobalScope$1, variables: Array [ - Variable$3, - Variable$5, + Variable$4, + Variable$6, ], }, FunctionScope$3 { @@ -132,12 +135,12 @@ ScopeManager { Reference$3, ], set: Map { - "arguments" => Variable$4, + "arguments" => Variable$5, }, type: "function", upper: FunctionScope$2, variables: Array [ - Variable$4, + Variable$5, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/functions/arrow/default-params/readable-ref-nested.ts.shot b/packages/scope-manager/tests/fixtures/functions/arrow/default-params/readable-ref-nested.ts.shot index 28aaf547357f..88bb598d6305 100644 --- a/packages/scope-manager/tests/fixtures/functions/arrow/default-params/readable-ref-nested.ts.shot +++ b/packages/scope-manager/tests/fixtures/functions/arrow/default-params/readable-ref-nested.ts.shot @@ -3,7 +3,8 @@ exports[`functions arrow default-params readable-ref-nested 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ VariableDefinition$1 { name: Identifier<"a">, @@ -18,13 +19,13 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$2 { + Variable$3 { defs: Array [ VariableDefinition$2 { name: Identifier<"foo">, @@ -40,14 +41,14 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$2, + resolved: Variable$3, writeExpr: ArrowFunctionExpression$3, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$3 { + Variable$4 { defs: Array [ ParameterDefinition$3 { name: Identifier<"b">, @@ -63,14 +64,14 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$3, + resolved: Variable$4, writeExpr: FunctionExpression$4, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$4 { + Variable$5 { defs: Array [], name: "arguments", references: Array [], @@ -86,14 +87,16 @@ ScopeManager { Reference$1, ], set: Map { - "a" => Variable$1, - "foo" => Variable$2, + "const" => ImplicitGlobalConstTypeVariable, + "a" => Variable$2, + "foo" => Variable$3, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, Variable$2, + Variable$3, ], }, FunctionScope$2 { @@ -103,12 +106,12 @@ ScopeManager { Reference$2, ], set: Map { - "b" => Variable$3, + "b" => Variable$4, }, type: "function", upper: GlobalScope$1, variables: Array [ - Variable$3, + Variable$4, ], }, FunctionScope$3 { @@ -118,12 +121,12 @@ ScopeManager { Reference$3, ], set: Map { - "arguments" => Variable$4, + "arguments" => Variable$5, }, type: "function", upper: FunctionScope$2, variables: Array [ - Variable$4, + Variable$5, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/functions/arrow/default-params/readable-ref-param-shadow.ts.shot b/packages/scope-manager/tests/fixtures/functions/arrow/default-params/readable-ref-param-shadow.ts.shot index 4190abf70755..b6de5d4fa74b 100644 --- a/packages/scope-manager/tests/fixtures/functions/arrow/default-params/readable-ref-param-shadow.ts.shot +++ b/packages/scope-manager/tests/fixtures/functions/arrow/default-params/readable-ref-param-shadow.ts.shot @@ -3,7 +3,8 @@ exports[`functions arrow default-params readable-ref-param-shadow 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ VariableDefinition$1 { name: Identifier<"a">, @@ -15,7 +16,7 @@ ScopeManager { isValueVariable: true, isTypeVariable: false, }, - Variable$2 { + Variable$3 { defs: Array [ VariableDefinition$2 { name: Identifier<"foo">, @@ -31,14 +32,14 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$2, + resolved: Variable$3, writeExpr: ArrowFunctionExpression$3, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$3 { + Variable$4 { defs: Array [ ParameterDefinition$3 { name: Identifier<"b">, @@ -54,14 +55,14 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$3, + resolved: Variable$4, writeExpr: Identifier<"a">, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$4 { + Variable$5 { defs: Array [ ParameterDefinition$4 { name: Identifier<"a">, @@ -76,7 +77,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$4, + resolved: Variable$5, }, ], isValueVariable: true, @@ -91,14 +92,16 @@ ScopeManager { Reference$1, ], set: Map { - "a" => Variable$1, - "foo" => Variable$2, + "const" => ImplicitGlobalConstTypeVariable, + "a" => Variable$2, + "foo" => Variable$3, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, Variable$2, + Variable$3, ], }, FunctionScope$2 { @@ -109,14 +112,14 @@ ScopeManager { Reference$3, ], set: Map { - "b" => Variable$3, - "a" => Variable$4, + "b" => Variable$4, + "a" => Variable$5, }, type: "function", upper: GlobalScope$1, variables: Array [ - Variable$3, Variable$4, + Variable$5, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/functions/arrow/default-params/readable-ref-partial.ts.shot b/packages/scope-manager/tests/fixtures/functions/arrow/default-params/readable-ref-partial.ts.shot index 2ce3315ae1fe..229916ae650f 100644 --- a/packages/scope-manager/tests/fixtures/functions/arrow/default-params/readable-ref-partial.ts.shot +++ b/packages/scope-manager/tests/fixtures/functions/arrow/default-params/readable-ref-partial.ts.shot @@ -3,7 +3,8 @@ exports[`functions arrow default-params readable-ref-partial 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ VariableDefinition$1 { name: Identifier<"a">, @@ -18,13 +19,13 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$2 { + Variable$3 { defs: Array [ VariableDefinition$2 { name: Identifier<"foo">, @@ -40,14 +41,14 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$2, + resolved: Variable$3, writeExpr: ArrowFunctionExpression$3, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$3 { + Variable$4 { defs: Array [ ParameterDefinition$3 { name: Identifier<"b">, @@ -63,7 +64,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$3, + resolved: Variable$4, writeExpr: MemberExpression$4, }, ], @@ -79,14 +80,16 @@ ScopeManager { Reference$1, ], set: Map { - "a" => Variable$1, - "foo" => Variable$2, + "const" => ImplicitGlobalConstTypeVariable, + "a" => Variable$2, + "foo" => Variable$3, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, Variable$2, + Variable$3, ], }, FunctionScope$2 { @@ -97,12 +100,12 @@ ScopeManager { Reference$3, ], set: Map { - "b" => Variable$3, + "b" => Variable$4, }, type: "function", upper: GlobalScope$1, variables: Array [ - Variable$3, + Variable$4, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/functions/arrow/default-params/writable-ref.ts.shot b/packages/scope-manager/tests/fixtures/functions/arrow/default-params/writable-ref.ts.shot index 11c64c55c310..46bae0801a77 100644 --- a/packages/scope-manager/tests/fixtures/functions/arrow/default-params/writable-ref.ts.shot +++ b/packages/scope-manager/tests/fixtures/functions/arrow/default-params/writable-ref.ts.shot @@ -3,7 +3,8 @@ exports[`functions arrow default-params writable-ref 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ VariableDefinition$1 { name: Identifier<"foo">, @@ -19,14 +20,14 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$1, + resolved: Variable$2, writeExpr: ArrowFunctionExpression$2, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$2 { + Variable$3 { defs: Array [ ParameterDefinition$2 { name: Identifier<"a">, @@ -38,7 +39,7 @@ ScopeManager { isValueVariable: true, isTypeVariable: false, }, - Variable$3 { + Variable$4 { defs: Array [ ParameterDefinition$3 { name: Identifier<"b">, @@ -54,7 +55,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$3, + resolved: Variable$4, writeExpr: Literal$3, }, ], @@ -70,12 +71,14 @@ ScopeManager { Reference$1, ], set: Map { - "foo" => Variable$1, + "const" => ImplicitGlobalConstTypeVariable, + "foo" => Variable$2, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, + Variable$2, ], }, FunctionScope$2 { @@ -85,14 +88,14 @@ ScopeManager { Reference$2, ], set: Map { - "a" => Variable$2, - "b" => Variable$3, + "a" => Variable$3, + "b" => Variable$4, }, type: "function", upper: GlobalScope$1, variables: Array [ - Variable$2, Variable$3, + Variable$4, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/functions/arrow/inherited-scope.ts.shot b/packages/scope-manager/tests/fixtures/functions/arrow/inherited-scope.ts.shot index 86bda3b91647..e0317bc5fccb 100644 --- a/packages/scope-manager/tests/fixtures/functions/arrow/inherited-scope.ts.shot +++ b/packages/scope-manager/tests/fixtures/functions/arrow/inherited-scope.ts.shot @@ -3,7 +3,8 @@ exports[`functions arrow inherited-scope 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ VariableDefinition$1 { name: Identifier<"parentScoped">, @@ -19,7 +20,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$1, + resolved: Variable$2, writeExpr: Literal$2, }, Reference$2 { @@ -28,7 +29,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: true, @@ -43,12 +44,14 @@ ScopeManager { Reference$1, ], set: Map { - "parentScoped" => Variable$1, + "const" => ImplicitGlobalConstTypeVariable, + "parentScoped" => Variable$2, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, + Variable$2, ], }, FunctionScope$2 { diff --git a/packages/scope-manager/tests/fixtures/functions/arrow/no-body.ts.shot b/packages/scope-manager/tests/fixtures/functions/arrow/no-body.ts.shot index 599cdb6b3ac2..edc43182dacf 100644 --- a/packages/scope-manager/tests/fixtures/functions/arrow/no-body.ts.shot +++ b/packages/scope-manager/tests/fixtures/functions/arrow/no-body.ts.shot @@ -3,7 +3,8 @@ exports[`functions arrow no-body 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ ParameterDefinition$1 { name: Identifier<"a">, @@ -18,7 +19,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: true, @@ -30,10 +31,14 @@ ScopeManager { block: Program$2, isStrict: false, references: Array [], - set: Map {}, + set: Map { + "const" => ImplicitGlobalConstTypeVariable, + }, type: "global", upper: null, - variables: Array [], + variables: Array [ + ImplicitGlobalConstTypeVariable, + ], }, FunctionScope$2 { block: ArrowFunctionExpression$1, @@ -42,12 +47,12 @@ ScopeManager { Reference$1, ], set: Map { - "a" => Variable$1, + "a" => Variable$2, }, type: "function", upper: GlobalScope$1, variables: Array [ - Variable$1, + Variable$2, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/functions/arrow/params.ts.shot b/packages/scope-manager/tests/fixtures/functions/arrow/params.ts.shot index e9f4ac6eaa0b..7198aa95bdec 100644 --- a/packages/scope-manager/tests/fixtures/functions/arrow/params.ts.shot +++ b/packages/scope-manager/tests/fixtures/functions/arrow/params.ts.shot @@ -3,7 +3,8 @@ exports[`functions arrow params 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ VariableDefinition$1 { name: Identifier<"outer">, @@ -19,7 +20,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$1, + resolved: Variable$2, writeExpr: Literal$2, }, Reference$6 { @@ -28,13 +29,13 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$2 { + Variable$3 { defs: Array [ ParameterDefinition$2 { name: Identifier<"a">, @@ -49,7 +50,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$2, + resolved: Variable$3, }, Reference$7 { identifier: Identifier<"a">, @@ -57,13 +58,13 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$2, + resolved: Variable$3, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$3 { + Variable$4 { defs: Array [ ParameterDefinition$3 { name: Identifier<"b">, @@ -75,7 +76,7 @@ ScopeManager { isValueVariable: true, isTypeVariable: false, }, - Variable$4 { + Variable$5 { defs: Array [ ParameterDefinition$4 { name: Identifier<"c">, @@ -87,7 +88,7 @@ ScopeManager { isValueVariable: true, isTypeVariable: false, }, - Variable$5 { + Variable$6 { defs: Array [ ParameterDefinition$5 { name: Identifier<"d">, @@ -103,14 +104,14 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$5, + resolved: Variable$6, writeExpr: Literal$4, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$6 { + Variable$7 { defs: Array [ ParameterDefinition$6 { name: Identifier<"e">, @@ -126,14 +127,14 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$6, + resolved: Variable$7, writeExpr: Identifier<"a">, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$7 { + Variable$8 { defs: Array [ ParameterDefinition$7 { name: Identifier<"f">, @@ -149,14 +150,14 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$7, + resolved: Variable$8, writeExpr: Identifier<"outer">, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$8 { + Variable$9 { defs: Array [ ParameterDefinition$8 { name: Identifier<"g">, @@ -168,7 +169,7 @@ ScopeManager { isValueVariable: true, isTypeVariable: false, }, - Variable$9 { + Variable$10 { defs: Array [ VariableDefinition$9 { name: Identifier<"unresolved">, @@ -184,7 +185,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$9, + resolved: Variable$10, writeExpr: Identifier<"g">, }, ], @@ -209,14 +210,16 @@ ScopeManager { }, ], set: Map { - "outer" => Variable$1, - "unresolved" => Variable$9, + "const" => ImplicitGlobalConstTypeVariable, + "outer" => Variable$2, + "unresolved" => Variable$10, }, type: "global", upper: null, variables: Array [ - Variable$1, - Variable$9, + ImplicitGlobalConstTypeVariable, + Variable$2, + Variable$10, ], }, FunctionScope$2 { @@ -231,24 +234,24 @@ ScopeManager { Reference$7, ], set: Map { - "a" => Variable$2, - "b" => Variable$3, - "c" => Variable$4, - "d" => Variable$5, - "e" => Variable$6, - "f" => Variable$7, - "g" => Variable$8, + "a" => Variable$3, + "b" => Variable$4, + "c" => Variable$5, + "d" => Variable$6, + "e" => Variable$7, + "f" => Variable$8, + "g" => Variable$9, }, type: "function", upper: GlobalScope$1, variables: Array [ - Variable$2, Variable$3, Variable$4, Variable$5, Variable$6, Variable$7, Variable$8, + Variable$9, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/functions/arrow/scope.ts.shot b/packages/scope-manager/tests/fixtures/functions/arrow/scope.ts.shot index fc6680e7e33e..e86dcb34208f 100644 --- a/packages/scope-manager/tests/fixtures/functions/arrow/scope.ts.shot +++ b/packages/scope-manager/tests/fixtures/functions/arrow/scope.ts.shot @@ -3,7 +3,8 @@ exports[`functions arrow scope 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ VariableDefinition$1 { name: Identifier<"arrow">, @@ -19,14 +20,14 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$1, + resolved: Variable$2, writeExpr: ArrowFunctionExpression$2, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$2 { + Variable$3 { defs: Array [ VariableDefinition$2 { name: Identifier<"i">, @@ -42,7 +43,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$2, + resolved: Variable$3, writeExpr: Literal$4, }, Reference$4 { @@ -51,13 +52,13 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$2, + resolved: Variable$3, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$3 { + Variable$4 { defs: Array [ VariableDefinition$3 { name: Identifier<"j">, @@ -73,14 +74,14 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$3, + resolved: Variable$4, writeExpr: Literal$6, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$4 { + Variable$5 { defs: Array [ VariableDefinition$4 { name: Identifier<"unresolved">, @@ -96,7 +97,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$4, + resolved: Variable$5, writeExpr: Identifier<"j">, }, ], @@ -121,14 +122,16 @@ ScopeManager { }, ], set: Map { - "arrow" => Variable$1, - "unresolved" => Variable$4, + "const" => ImplicitGlobalConstTypeVariable, + "arrow" => Variable$2, + "unresolved" => Variable$5, }, type: "global", upper: null, variables: Array [ - Variable$1, - Variable$4, + ImplicitGlobalConstTypeVariable, + Variable$2, + Variable$5, ], }, FunctionScope$2 { @@ -140,14 +143,14 @@ ScopeManager { Reference$4, ], set: Map { - "i" => Variable$2, - "j" => Variable$3, + "i" => Variable$3, + "j" => Variable$4, }, type: "function", upper: GlobalScope$1, variables: Array [ - Variable$2, Variable$3, + Variable$4, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/functions/arrow/type-parameters/body-reference.ts.shot b/packages/scope-manager/tests/fixtures/functions/arrow/type-parameters/body-reference.ts.shot index b6e7a4b937af..c9f3b62f1fd7 100644 --- a/packages/scope-manager/tests/fixtures/functions/arrow/type-parameters/body-reference.ts.shot +++ b/packages/scope-manager/tests/fixtures/functions/arrow/type-parameters/body-reference.ts.shot @@ -3,7 +3,8 @@ exports[`functions arrow type-parameters body-reference 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ VariableDefinition$1 { name: Identifier<"foo">, @@ -19,14 +20,14 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$1, + resolved: Variable$2, writeExpr: ArrowFunctionExpression$2, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$2 { + Variable$3 { defs: Array [ TypeDefinition$2 { name: Identifier<"T">, @@ -41,13 +42,13 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$2, + resolved: Variable$3, }, ], isValueVariable: false, isTypeVariable: true, }, - Variable$3 { + Variable$4 { defs: Array [ VariableDefinition$3 { name: Identifier<"x">, @@ -68,12 +69,14 @@ ScopeManager { Reference$1, ], set: Map { - "foo" => Variable$1, + "const" => ImplicitGlobalConstTypeVariable, + "foo" => Variable$2, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, + Variable$2, ], }, FunctionScope$2 { @@ -83,14 +86,14 @@ ScopeManager { Reference$2, ], set: Map { - "T" => Variable$2, - "x" => Variable$3, + "T" => Variable$3, + "x" => Variable$4, }, type: "function", upper: GlobalScope$1, variables: Array [ - Variable$2, Variable$3, + Variable$4, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/functions/arrow/type-parameters/param-reference.ts.shot b/packages/scope-manager/tests/fixtures/functions/arrow/type-parameters/param-reference.ts.shot index 77f0e1947b61..387cfcf9b5a4 100644 --- a/packages/scope-manager/tests/fixtures/functions/arrow/type-parameters/param-reference.ts.shot +++ b/packages/scope-manager/tests/fixtures/functions/arrow/type-parameters/param-reference.ts.shot @@ -3,7 +3,8 @@ exports[`functions arrow type-parameters param-reference 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ VariableDefinition$1 { name: Identifier<"foo">, @@ -19,14 +20,14 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$1, + resolved: Variable$2, writeExpr: ArrowFunctionExpression$2, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$2 { + Variable$3 { defs: Array [ ParameterDefinition$2 { name: Identifier<"a">, @@ -38,7 +39,7 @@ ScopeManager { isValueVariable: true, isTypeVariable: false, }, - Variable$3 { + Variable$4 { defs: Array [ TypeDefinition$3 { name: Identifier<"T">, @@ -53,7 +54,7 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$3, + resolved: Variable$4, }, ], isValueVariable: false, @@ -68,12 +69,14 @@ ScopeManager { Reference$1, ], set: Map { - "foo" => Variable$1, + "const" => ImplicitGlobalConstTypeVariable, + "foo" => Variable$2, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, + Variable$2, ], }, FunctionScope$2 { @@ -83,14 +86,14 @@ ScopeManager { Reference$2, ], set: Map { - "a" => Variable$2, - "T" => Variable$3, + "a" => Variable$3, + "T" => Variable$4, }, type: "function", upper: GlobalScope$1, variables: Array [ - Variable$2, Variable$3, + Variable$4, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/functions/arrow/type-parameters/return-value-reference.ts.shot b/packages/scope-manager/tests/fixtures/functions/arrow/type-parameters/return-value-reference.ts.shot index 7c7cd07b0d03..cc45823e15e2 100644 --- a/packages/scope-manager/tests/fixtures/functions/arrow/type-parameters/return-value-reference.ts.shot +++ b/packages/scope-manager/tests/fixtures/functions/arrow/type-parameters/return-value-reference.ts.shot @@ -3,7 +3,8 @@ exports[`functions arrow type-parameters return-value-reference 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ VariableDefinition$1 { name: Identifier<"foo">, @@ -19,14 +20,14 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$1, + resolved: Variable$2, writeExpr: ArrowFunctionExpression$2, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$2 { + Variable$3 { defs: Array [ TypeDefinition$2 { name: Identifier<"T">, @@ -41,7 +42,7 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$2, + resolved: Variable$3, }, ], isValueVariable: false, @@ -56,12 +57,14 @@ ScopeManager { Reference$1, ], set: Map { - "foo" => Variable$1, + "const" => ImplicitGlobalConstTypeVariable, + "foo" => Variable$2, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, + Variable$2, ], }, FunctionScope$2 { @@ -71,12 +74,12 @@ ScopeManager { Reference$2, ], set: Map { - "T" => Variable$2, + "T" => Variable$3, }, type: "function", upper: GlobalScope$1, variables: Array [ - Variable$2, + Variable$3, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/functions/arrow/type-parameters/type-param-reference.ts.shot b/packages/scope-manager/tests/fixtures/functions/arrow/type-parameters/type-param-reference.ts.shot index 4d8ee0d16dbf..c35121db6ab5 100644 --- a/packages/scope-manager/tests/fixtures/functions/arrow/type-parameters/type-param-reference.ts.shot +++ b/packages/scope-manager/tests/fixtures/functions/arrow/type-parameters/type-param-reference.ts.shot @@ -3,7 +3,8 @@ exports[`functions arrow type-parameters type-param-reference 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ VariableDefinition$1 { name: Identifier<"foo">, @@ -19,14 +20,14 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$1, + resolved: Variable$2, writeExpr: ArrowFunctionExpression$2, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$2 { + Variable$3 { defs: Array [ TypeDefinition$2 { name: Identifier<"T">, @@ -41,13 +42,13 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$2, + resolved: Variable$3, }, ], isValueVariable: false, isTypeVariable: true, }, - Variable$3 { + Variable$4 { defs: Array [ TypeDefinition$3 { name: Identifier<"U">, @@ -68,12 +69,14 @@ ScopeManager { Reference$1, ], set: Map { - "foo" => Variable$1, + "const" => ImplicitGlobalConstTypeVariable, + "foo" => Variable$2, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, + Variable$2, ], }, FunctionScope$2 { @@ -83,14 +86,14 @@ ScopeManager { Reference$2, ], set: Map { - "T" => Variable$2, - "U" => Variable$3, + "T" => Variable$3, + "U" => Variable$4, }, type: "function", upper: GlobalScope$1, variables: Array [ - Variable$2, Variable$3, + Variable$4, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/functions/arrow/type-parameters/type-parameter-declaration.ts.shot b/packages/scope-manager/tests/fixtures/functions/arrow/type-parameters/type-parameter-declaration.ts.shot index cda3324b346b..f2dcb15ca7a6 100644 --- a/packages/scope-manager/tests/fixtures/functions/arrow/type-parameters/type-parameter-declaration.ts.shot +++ b/packages/scope-manager/tests/fixtures/functions/arrow/type-parameters/type-parameter-declaration.ts.shot @@ -3,7 +3,8 @@ exports[`functions arrow type-parameters type-parameter-declaration 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ VariableDefinition$1 { name: Identifier<"foo">, @@ -19,14 +20,14 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$1, + resolved: Variable$2, writeExpr: ArrowFunctionExpression$2, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$2 { + Variable$3 { defs: Array [ TypeDefinition$2 { name: Identifier<"T">, @@ -38,7 +39,7 @@ ScopeManager { isValueVariable: false, isTypeVariable: true, }, - Variable$3 { + Variable$4 { defs: Array [ TypeDefinition$3 { name: Identifier<"Unresolved">, @@ -67,14 +68,16 @@ ScopeManager { }, ], set: Map { - "foo" => Variable$1, - "Unresolved" => Variable$3, + "const" => ImplicitGlobalConstTypeVariable, + "foo" => Variable$2, + "Unresolved" => Variable$4, }, type: "global", upper: null, variables: Array [ - Variable$1, - Variable$3, + ImplicitGlobalConstTypeVariable, + Variable$2, + Variable$4, ], }, FunctionScope$2 { @@ -82,12 +85,12 @@ ScopeManager { isStrict: false, references: Array [], set: Map { - "T" => Variable$2, + "T" => Variable$3, }, type: "function", upper: GlobalScope$1, variables: Array [ - Variable$2, + Variable$3, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/functions/arrow/type-predicate-asserts1.ts.shot b/packages/scope-manager/tests/fixtures/functions/arrow/type-predicate-asserts1.ts.shot index 0c9383d2c10b..106976682c74 100644 --- a/packages/scope-manager/tests/fixtures/functions/arrow/type-predicate-asserts1.ts.shot +++ b/packages/scope-manager/tests/fixtures/functions/arrow/type-predicate-asserts1.ts.shot @@ -3,7 +3,8 @@ exports[`functions arrow type-predicate-asserts1 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ VariableDefinition$1 { name: Identifier<"foo">, @@ -19,14 +20,14 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$1, + resolved: Variable$2, writeExpr: ArrowFunctionExpression$2, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$2 { + Variable$3 { defs: Array [ ParameterDefinition$2 { name: Identifier<"arg">, @@ -41,7 +42,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$2, + resolved: Variable$3, }, ], isValueVariable: true, @@ -56,12 +57,14 @@ ScopeManager { Reference$1, ], set: Map { - "foo" => Variable$1, + "const" => ImplicitGlobalConstTypeVariable, + "foo" => Variable$2, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, + Variable$2, ], }, FunctionScope$2 { @@ -71,12 +74,12 @@ ScopeManager { Reference$2, ], set: Map { - "arg" => Variable$2, + "arg" => Variable$3, }, type: "function", upper: GlobalScope$1, variables: Array [ - Variable$2, + Variable$3, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/functions/arrow/type-predicate-asserts2.ts.shot b/packages/scope-manager/tests/fixtures/functions/arrow/type-predicate-asserts2.ts.shot index 6ef8fae784de..695374e49152 100644 --- a/packages/scope-manager/tests/fixtures/functions/arrow/type-predicate-asserts2.ts.shot +++ b/packages/scope-manager/tests/fixtures/functions/arrow/type-predicate-asserts2.ts.shot @@ -3,7 +3,8 @@ exports[`functions arrow type-predicate-asserts2 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ TypeDefinition$1 { name: Identifier<"T">, @@ -18,13 +19,13 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: false, isTypeVariable: true, }, - Variable$2 { + Variable$3 { defs: Array [ VariableDefinition$2 { name: Identifier<"foo">, @@ -40,14 +41,14 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$2, + resolved: Variable$3, writeExpr: ArrowFunctionExpression$3, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$3 { + Variable$4 { defs: Array [ ParameterDefinition$3 { name: Identifier<"arg">, @@ -62,7 +63,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$3, + resolved: Variable$4, }, ], isValueVariable: true, @@ -77,14 +78,16 @@ ScopeManager { Reference$1, ], set: Map { - "T" => Variable$1, - "foo" => Variable$2, + "const" => ImplicitGlobalConstTypeVariable, + "T" => Variable$2, + "foo" => Variable$3, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, Variable$2, + Variable$3, ], }, FunctionScope$2 { @@ -95,12 +98,12 @@ ScopeManager { Reference$3, ], set: Map { - "arg" => Variable$3, + "arg" => Variable$4, }, type: "function", upper: GlobalScope$1, variables: Array [ - Variable$3, + Variable$4, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/functions/arrow/type-predicate1.ts.shot b/packages/scope-manager/tests/fixtures/functions/arrow/type-predicate1.ts.shot index 88e387ae251f..27909f8a757b 100644 --- a/packages/scope-manager/tests/fixtures/functions/arrow/type-predicate1.ts.shot +++ b/packages/scope-manager/tests/fixtures/functions/arrow/type-predicate1.ts.shot @@ -3,7 +3,8 @@ exports[`functions arrow type-predicate1 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ VariableDefinition$1 { name: Identifier<"foo">, @@ -19,14 +20,14 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$1, + resolved: Variable$2, writeExpr: ArrowFunctionExpression$2, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$2 { + Variable$3 { defs: Array [ ParameterDefinition$2 { name: Identifier<"arg">, @@ -41,7 +42,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$2, + resolved: Variable$3, }, Reference$3 { identifier: Identifier<"arg">, @@ -49,7 +50,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$2, + resolved: Variable$3, }, ], isValueVariable: true, @@ -64,12 +65,14 @@ ScopeManager { Reference$1, ], set: Map { - "foo" => Variable$1, + "const" => ImplicitGlobalConstTypeVariable, + "foo" => Variable$2, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, + Variable$2, ], }, FunctionScope$2 { @@ -80,12 +83,12 @@ ScopeManager { Reference$3, ], set: Map { - "arg" => Variable$2, + "arg" => Variable$3, }, type: "function", upper: GlobalScope$1, variables: Array [ - Variable$2, + Variable$3, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/functions/arrow/type-predicate2.ts.shot b/packages/scope-manager/tests/fixtures/functions/arrow/type-predicate2.ts.shot index 9795a6b29f78..f061a729a3f4 100644 --- a/packages/scope-manager/tests/fixtures/functions/arrow/type-predicate2.ts.shot +++ b/packages/scope-manager/tests/fixtures/functions/arrow/type-predicate2.ts.shot @@ -3,7 +3,8 @@ exports[`functions arrow type-predicate2 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ TypeDefinition$1 { name: Identifier<"T">, @@ -18,13 +19,13 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: false, isTypeVariable: true, }, - Variable$2 { + Variable$3 { defs: Array [ VariableDefinition$2 { name: Identifier<"foo">, @@ -40,14 +41,14 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$2, + resolved: Variable$3, writeExpr: ArrowFunctionExpression$3, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$3 { + Variable$4 { defs: Array [ ParameterDefinition$3 { name: Identifier<"arg">, @@ -62,7 +63,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$3, + resolved: Variable$4, }, Reference$4 { identifier: Identifier<"arg">, @@ -70,7 +71,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$3, + resolved: Variable$4, }, ], isValueVariable: true, @@ -85,14 +86,16 @@ ScopeManager { Reference$1, ], set: Map { - "T" => Variable$1, - "foo" => Variable$2, + "const" => ImplicitGlobalConstTypeVariable, + "T" => Variable$2, + "foo" => Variable$3, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, Variable$2, + Variable$3, ], }, FunctionScope$2 { @@ -104,12 +107,12 @@ ScopeManager { Reference$4, ], set: Map { - "arg" => Variable$3, + "arg" => Variable$4, }, type: "function", upper: GlobalScope$1, variables: Array [ - Variable$3, + Variable$4, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/functions/function-declaration/default-params/readable-ref-body-shadow.ts.shot b/packages/scope-manager/tests/fixtures/functions/function-declaration/default-params/readable-ref-body-shadow.ts.shot index 936280a27dde..2d9702db068a 100644 --- a/packages/scope-manager/tests/fixtures/functions/function-declaration/default-params/readable-ref-body-shadow.ts.shot +++ b/packages/scope-manager/tests/fixtures/functions/function-declaration/default-params/readable-ref-body-shadow.ts.shot @@ -3,7 +3,8 @@ exports[`functions function-declaration default-params readable-ref-body-shadow 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ VariableDefinition$1 { name: Identifier<"a">, @@ -18,13 +19,13 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$2 { + Variable$3 { defs: Array [ FunctionNameDefinition$2 { name: Identifier<"foo">, @@ -36,14 +37,14 @@ ScopeManager { isValueVariable: true, isTypeVariable: false, }, - Variable$3 { + Variable$4 { defs: Array [], name: "arguments", references: Array [], isValueVariable: true, isTypeVariable: true, }, - Variable$4 { + Variable$5 { defs: Array [ ParameterDefinition$3 { name: Identifier<"b">, @@ -59,14 +60,14 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$4, + resolved: Variable$5, writeExpr: Identifier<"a">, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$5 { + Variable$6 { defs: Array [ VariableDefinition$4 { name: Identifier<"a">, @@ -85,14 +86,16 @@ ScopeManager { isStrict: false, references: Array [], set: Map { - "a" => Variable$1, - "foo" => Variable$2, + "const" => ImplicitGlobalConstTypeVariable, + "a" => Variable$2, + "foo" => Variable$3, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, Variable$2, + Variable$3, ], }, FunctionScope$2 { @@ -103,16 +106,16 @@ ScopeManager { Reference$2, ], set: Map { - "arguments" => Variable$3, - "b" => Variable$4, - "a" => Variable$5, + "arguments" => Variable$4, + "b" => Variable$5, + "a" => Variable$6, }, type: "function", upper: GlobalScope$1, variables: Array [ - Variable$3, Variable$4, Variable$5, + Variable$6, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/functions/function-declaration/default-params/readable-ref-const.ts.shot b/packages/scope-manager/tests/fixtures/functions/function-declaration/default-params/readable-ref-const.ts.shot index fad4fee89d52..6e37efafb7f7 100644 --- a/packages/scope-manager/tests/fixtures/functions/function-declaration/default-params/readable-ref-const.ts.shot +++ b/packages/scope-manager/tests/fixtures/functions/function-declaration/default-params/readable-ref-const.ts.shot @@ -3,7 +3,8 @@ exports[`functions function-declaration default-params readable-ref-const 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ VariableDefinition$1 { name: Identifier<"a">, @@ -19,7 +20,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$1, + resolved: Variable$2, writeExpr: Literal$2, }, Reference$3 { @@ -28,13 +29,13 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$2 { + Variable$3 { defs: Array [ FunctionNameDefinition$2 { name: Identifier<"foo">, @@ -46,14 +47,14 @@ ScopeManager { isValueVariable: true, isTypeVariable: false, }, - Variable$3 { + Variable$4 { defs: Array [], name: "arguments", references: Array [], isValueVariable: true, isTypeVariable: true, }, - Variable$4 { + Variable$5 { defs: Array [ ParameterDefinition$3 { name: Identifier<"b">, @@ -69,7 +70,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$4, + resolved: Variable$5, writeExpr: Identifier<"a">, }, ], @@ -85,14 +86,16 @@ ScopeManager { Reference$1, ], set: Map { - "a" => Variable$1, - "foo" => Variable$2, + "const" => ImplicitGlobalConstTypeVariable, + "a" => Variable$2, + "foo" => Variable$3, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, Variable$2, + Variable$3, ], }, FunctionScope$2 { @@ -103,14 +106,14 @@ ScopeManager { Reference$3, ], set: Map { - "arguments" => Variable$3, - "b" => Variable$4, + "arguments" => Variable$4, + "b" => Variable$5, }, type: "function", upper: GlobalScope$1, variables: Array [ - Variable$3, Variable$4, + Variable$5, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/functions/function-declaration/default-params/readable-ref-let.ts.shot b/packages/scope-manager/tests/fixtures/functions/function-declaration/default-params/readable-ref-let.ts.shot index ae53f562eba1..8bb27c9898f5 100644 --- a/packages/scope-manager/tests/fixtures/functions/function-declaration/default-params/readable-ref-let.ts.shot +++ b/packages/scope-manager/tests/fixtures/functions/function-declaration/default-params/readable-ref-let.ts.shot @@ -3,7 +3,8 @@ exports[`functions function-declaration default-params readable-ref-let 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ VariableDefinition$1 { name: Identifier<"a">, @@ -18,13 +19,13 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$2 { + Variable$3 { defs: Array [ FunctionNameDefinition$2 { name: Identifier<"foo">, @@ -36,14 +37,14 @@ ScopeManager { isValueVariable: true, isTypeVariable: false, }, - Variable$3 { + Variable$4 { defs: Array [], name: "arguments", references: Array [], isValueVariable: true, isTypeVariable: true, }, - Variable$4 { + Variable$5 { defs: Array [ ParameterDefinition$3 { name: Identifier<"b">, @@ -59,7 +60,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$4, + resolved: Variable$5, writeExpr: Identifier<"a">, }, ], @@ -73,14 +74,16 @@ ScopeManager { isStrict: false, references: Array [], set: Map { - "a" => Variable$1, - "foo" => Variable$2, + "const" => ImplicitGlobalConstTypeVariable, + "a" => Variable$2, + "foo" => Variable$3, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, Variable$2, + Variable$3, ], }, FunctionScope$2 { @@ -91,14 +94,14 @@ ScopeManager { Reference$2, ], set: Map { - "arguments" => Variable$3, - "b" => Variable$4, + "arguments" => Variable$4, + "b" => Variable$5, }, type: "function", upper: GlobalScope$1, variables: Array [ - Variable$3, Variable$4, + Variable$5, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/functions/function-declaration/default-params/readable-ref-nested-body-shadow.ts.shot b/packages/scope-manager/tests/fixtures/functions/function-declaration/default-params/readable-ref-nested-body-shadow.ts.shot index b313f3aeff62..265974f967f0 100644 --- a/packages/scope-manager/tests/fixtures/functions/function-declaration/default-params/readable-ref-nested-body-shadow.ts.shot +++ b/packages/scope-manager/tests/fixtures/functions/function-declaration/default-params/readable-ref-nested-body-shadow.ts.shot @@ -3,7 +3,8 @@ exports[`functions function-declaration default-params readable-ref-nested-body-shadow 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ VariableDefinition$1 { name: Identifier<"a">, @@ -18,13 +19,13 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$2 { + Variable$3 { defs: Array [ FunctionNameDefinition$2 { name: Identifier<"foo">, @@ -36,14 +37,14 @@ ScopeManager { isValueVariable: true, isTypeVariable: false, }, - Variable$3 { + Variable$4 { defs: Array [], name: "arguments", references: Array [], isValueVariable: true, isTypeVariable: true, }, - Variable$4 { + Variable$5 { defs: Array [ ParameterDefinition$3 { name: Identifier<"b">, @@ -59,21 +60,21 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$4, + resolved: Variable$5, writeExpr: FunctionExpression$3, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$5 { + Variable$6 { defs: Array [], name: "arguments", references: Array [], isValueVariable: true, isTypeVariable: true, }, - Variable$6 { + Variable$7 { defs: Array [ VariableDefinition$4 { name: Identifier<"a">, @@ -92,14 +93,16 @@ ScopeManager { isStrict: false, references: Array [], set: Map { - "a" => Variable$1, - "foo" => Variable$2, + "const" => ImplicitGlobalConstTypeVariable, + "a" => Variable$2, + "foo" => Variable$3, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, Variable$2, + Variable$3, ], }, FunctionScope$2 { @@ -109,16 +112,16 @@ ScopeManager { Reference$1, ], set: Map { - "arguments" => Variable$3, - "b" => Variable$4, - "a" => Variable$6, + "arguments" => Variable$4, + "b" => Variable$5, + "a" => Variable$7, }, type: "function", upper: GlobalScope$1, variables: Array [ - Variable$3, Variable$4, - Variable$6, + Variable$5, + Variable$7, ], }, FunctionScope$3 { @@ -128,12 +131,12 @@ ScopeManager { Reference$2, ], set: Map { - "arguments" => Variable$5, + "arguments" => Variable$6, }, type: "function", upper: FunctionScope$2, variables: Array [ - Variable$5, + Variable$6, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/functions/function-declaration/default-params/readable-ref-nested.ts.shot b/packages/scope-manager/tests/fixtures/functions/function-declaration/default-params/readable-ref-nested.ts.shot index 3c17f693b8eb..f3ad55a5841e 100644 --- a/packages/scope-manager/tests/fixtures/functions/function-declaration/default-params/readable-ref-nested.ts.shot +++ b/packages/scope-manager/tests/fixtures/functions/function-declaration/default-params/readable-ref-nested.ts.shot @@ -3,7 +3,8 @@ exports[`functions function-declaration default-params readable-ref-nested 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ VariableDefinition$1 { name: Identifier<"a">, @@ -18,13 +19,13 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$2 { + Variable$3 { defs: Array [ FunctionNameDefinition$2 { name: Identifier<"foo">, @@ -36,14 +37,14 @@ ScopeManager { isValueVariable: true, isTypeVariable: false, }, - Variable$3 { + Variable$4 { defs: Array [], name: "arguments", references: Array [], isValueVariable: true, isTypeVariable: true, }, - Variable$4 { + Variable$5 { defs: Array [ ParameterDefinition$3 { name: Identifier<"b">, @@ -59,14 +60,14 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$4, + resolved: Variable$5, writeExpr: FunctionExpression$3, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$5 { + Variable$6 { defs: Array [], name: "arguments", references: Array [], @@ -80,14 +81,16 @@ ScopeManager { isStrict: false, references: Array [], set: Map { - "a" => Variable$1, - "foo" => Variable$2, + "const" => ImplicitGlobalConstTypeVariable, + "a" => Variable$2, + "foo" => Variable$3, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, Variable$2, + Variable$3, ], }, FunctionScope$2 { @@ -97,14 +100,14 @@ ScopeManager { Reference$1, ], set: Map { - "arguments" => Variable$3, - "b" => Variable$4, + "arguments" => Variable$4, + "b" => Variable$5, }, type: "function", upper: GlobalScope$1, variables: Array [ - Variable$3, Variable$4, + Variable$5, ], }, FunctionScope$3 { @@ -114,12 +117,12 @@ ScopeManager { Reference$2, ], set: Map { - "arguments" => Variable$5, + "arguments" => Variable$6, }, type: "function", upper: FunctionScope$2, variables: Array [ - Variable$5, + Variable$6, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/functions/function-declaration/default-params/readable-ref-param-shadow.ts.shot b/packages/scope-manager/tests/fixtures/functions/function-declaration/default-params/readable-ref-param-shadow.ts.shot index 95e143a4f35b..f6e1776dd1ca 100644 --- a/packages/scope-manager/tests/fixtures/functions/function-declaration/default-params/readable-ref-param-shadow.ts.shot +++ b/packages/scope-manager/tests/fixtures/functions/function-declaration/default-params/readable-ref-param-shadow.ts.shot @@ -3,7 +3,8 @@ exports[`functions function-declaration default-params readable-ref-param-shadow 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ VariableDefinition$1 { name: Identifier<"a">, @@ -15,7 +16,7 @@ ScopeManager { isValueVariable: true, isTypeVariable: false, }, - Variable$2 { + Variable$3 { defs: Array [ FunctionNameDefinition$2 { name: Identifier<"foo">, @@ -27,14 +28,14 @@ ScopeManager { isValueVariable: true, isTypeVariable: false, }, - Variable$3 { + Variable$4 { defs: Array [], name: "arguments", references: Array [], isValueVariable: true, isTypeVariable: true, }, - Variable$4 { + Variable$5 { defs: Array [ ParameterDefinition$3 { name: Identifier<"b">, @@ -50,14 +51,14 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$4, + resolved: Variable$5, writeExpr: Identifier<"a">, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$5 { + Variable$6 { defs: Array [ ParameterDefinition$4 { name: Identifier<"a">, @@ -72,7 +73,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$5, + resolved: Variable$6, }, ], isValueVariable: true, @@ -85,14 +86,16 @@ ScopeManager { isStrict: false, references: Array [], set: Map { - "a" => Variable$1, - "foo" => Variable$2, + "const" => ImplicitGlobalConstTypeVariable, + "a" => Variable$2, + "foo" => Variable$3, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, Variable$2, + Variable$3, ], }, FunctionScope$2 { @@ -103,16 +106,16 @@ ScopeManager { Reference$2, ], set: Map { - "arguments" => Variable$3, - "b" => Variable$4, - "a" => Variable$5, + "arguments" => Variable$4, + "b" => Variable$5, + "a" => Variable$6, }, type: "function", upper: GlobalScope$1, variables: Array [ - Variable$3, Variable$4, Variable$5, + Variable$6, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/functions/function-declaration/default-params/readable-ref-partial.ts.shot b/packages/scope-manager/tests/fixtures/functions/function-declaration/default-params/readable-ref-partial.ts.shot index 04ad2e0e8720..b55432219962 100644 --- a/packages/scope-manager/tests/fixtures/functions/function-declaration/default-params/readable-ref-partial.ts.shot +++ b/packages/scope-manager/tests/fixtures/functions/function-declaration/default-params/readable-ref-partial.ts.shot @@ -3,7 +3,8 @@ exports[`functions function-declaration default-params readable-ref-partial 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ VariableDefinition$1 { name: Identifier<"a">, @@ -18,13 +19,13 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$2 { + Variable$3 { defs: Array [ FunctionNameDefinition$2 { name: Identifier<"foo">, @@ -36,14 +37,14 @@ ScopeManager { isValueVariable: true, isTypeVariable: false, }, - Variable$3 { + Variable$4 { defs: Array [], name: "arguments", references: Array [], isValueVariable: true, isTypeVariable: true, }, - Variable$4 { + Variable$5 { defs: Array [ ParameterDefinition$3 { name: Identifier<"b">, @@ -59,7 +60,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$4, + resolved: Variable$5, writeExpr: MemberExpression$3, }, ], @@ -73,14 +74,16 @@ ScopeManager { isStrict: false, references: Array [], set: Map { - "a" => Variable$1, - "foo" => Variable$2, + "const" => ImplicitGlobalConstTypeVariable, + "a" => Variable$2, + "foo" => Variable$3, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, Variable$2, + Variable$3, ], }, FunctionScope$2 { @@ -91,14 +94,14 @@ ScopeManager { Reference$2, ], set: Map { - "arguments" => Variable$3, - "b" => Variable$4, + "arguments" => Variable$4, + "b" => Variable$5, }, type: "function", upper: GlobalScope$1, variables: Array [ - Variable$3, Variable$4, + Variable$5, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/functions/function-declaration/default-params/writable-ref.ts.shot b/packages/scope-manager/tests/fixtures/functions/function-declaration/default-params/writable-ref.ts.shot index c0af2b3c8c34..c44dbf8facc2 100644 --- a/packages/scope-manager/tests/fixtures/functions/function-declaration/default-params/writable-ref.ts.shot +++ b/packages/scope-manager/tests/fixtures/functions/function-declaration/default-params/writable-ref.ts.shot @@ -3,7 +3,8 @@ exports[`functions function-declaration default-params writable-ref 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ FunctionNameDefinition$1 { name: Identifier<"foo">, @@ -15,14 +16,14 @@ ScopeManager { isValueVariable: true, isTypeVariable: false, }, - Variable$2 { + Variable$3 { defs: Array [], name: "arguments", references: Array [], isValueVariable: true, isTypeVariable: true, }, - Variable$3 { + Variable$4 { defs: Array [ ParameterDefinition$2 { name: Identifier<"a">, @@ -34,7 +35,7 @@ ScopeManager { isValueVariable: true, isTypeVariable: false, }, - Variable$4 { + Variable$5 { defs: Array [ ParameterDefinition$3 { name: Identifier<"b">, @@ -50,7 +51,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$4, + resolved: Variable$5, writeExpr: Literal$2, }, ], @@ -64,12 +65,14 @@ ScopeManager { isStrict: false, references: Array [], set: Map { - "foo" => Variable$1, + "const" => ImplicitGlobalConstTypeVariable, + "foo" => Variable$2, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, + Variable$2, ], }, FunctionScope$2 { @@ -79,16 +82,16 @@ ScopeManager { Reference$1, ], set: Map { - "arguments" => Variable$2, - "a" => Variable$3, - "b" => Variable$4, + "arguments" => Variable$3, + "a" => Variable$4, + "b" => Variable$5, }, type: "function", upper: GlobalScope$1, variables: Array [ - Variable$2, Variable$3, Variable$4, + Variable$5, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/functions/function-declaration/inherited-scope.ts.shot b/packages/scope-manager/tests/fixtures/functions/function-declaration/inherited-scope.ts.shot index e4cd0cfe5326..62a87751b28d 100644 --- a/packages/scope-manager/tests/fixtures/functions/function-declaration/inherited-scope.ts.shot +++ b/packages/scope-manager/tests/fixtures/functions/function-declaration/inherited-scope.ts.shot @@ -3,7 +3,8 @@ exports[`functions function-declaration inherited-scope 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ VariableDefinition$1 { name: Identifier<"parentScoped">, @@ -19,7 +20,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$1, + resolved: Variable$2, writeExpr: Literal$2, }, Reference$2 { @@ -28,13 +29,13 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$2 { + Variable$3 { defs: Array [ FunctionNameDefinition$2 { name: Identifier<"foo">, @@ -46,7 +47,7 @@ ScopeManager { isValueVariable: true, isTypeVariable: false, }, - Variable$3 { + Variable$4 { defs: Array [], name: "arguments", references: Array [], @@ -62,14 +63,16 @@ ScopeManager { Reference$1, ], set: Map { - "parentScoped" => Variable$1, - "foo" => Variable$2, + "const" => ImplicitGlobalConstTypeVariable, + "parentScoped" => Variable$2, + "foo" => Variable$3, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, Variable$2, + Variable$3, ], }, FunctionScope$2 { @@ -79,12 +82,12 @@ ScopeManager { Reference$2, ], set: Map { - "arguments" => Variable$3, + "arguments" => Variable$4, }, type: "function", upper: GlobalScope$1, variables: Array [ - Variable$3, + Variable$4, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/functions/function-declaration/name-shadowed-in-body.ts.shot b/packages/scope-manager/tests/fixtures/functions/function-declaration/name-shadowed-in-body.ts.shot index 37e19bf7466e..38cc2459ba44 100644 --- a/packages/scope-manager/tests/fixtures/functions/function-declaration/name-shadowed-in-body.ts.shot +++ b/packages/scope-manager/tests/fixtures/functions/function-declaration/name-shadowed-in-body.ts.shot @@ -3,7 +3,8 @@ exports[`functions function-declaration name-shadowed-in-body 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ FunctionNameDefinition$1 { name: Identifier<"Foo">, @@ -18,20 +19,20 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$2 { + Variable$3 { defs: Array [], name: "arguments", references: Array [], isValueVariable: true, isTypeVariable: true, }, - Variable$3 { + Variable$4 { defs: Array [ VariableDefinition$2 { name: Identifier<"Foo">, @@ -47,14 +48,14 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$3, + resolved: Variable$4, writeExpr: Literal$3, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$4 { + Variable$5 { defs: Array [ VariableDefinition$3 { name: Identifier<"usage">, @@ -70,7 +71,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$4, + resolved: Variable$5, writeExpr: Identifier<"Foo">, }, ], @@ -87,14 +88,16 @@ ScopeManager { Reference$3, ], set: Map { - "Foo" => Variable$1, - "usage" => Variable$4, + "const" => ImplicitGlobalConstTypeVariable, + "Foo" => Variable$2, + "usage" => Variable$5, }, type: "global", upper: null, variables: Array [ - Variable$1, - Variable$4, + ImplicitGlobalConstTypeVariable, + Variable$2, + Variable$5, ], }, FunctionScope$2 { @@ -104,14 +107,14 @@ ScopeManager { Reference$1, ], set: Map { - "arguments" => Variable$2, - "Foo" => Variable$3, + "arguments" => Variable$3, + "Foo" => Variable$4, }, type: "function", upper: GlobalScope$1, variables: Array [ - Variable$2, Variable$3, + Variable$4, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/functions/function-declaration/overload.ts.shot b/packages/scope-manager/tests/fixtures/functions/function-declaration/overload.ts.shot index e26a1823bf24..7ef3e182e2bf 100644 --- a/packages/scope-manager/tests/fixtures/functions/function-declaration/overload.ts.shot +++ b/packages/scope-manager/tests/fixtures/functions/function-declaration/overload.ts.shot @@ -3,7 +3,8 @@ exports[`functions function-declaration overload 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ FunctionNameDefinition$1 { name: Identifier<"foo">, @@ -19,14 +20,14 @@ ScopeManager { isValueVariable: true, isTypeVariable: false, }, - Variable$2 { + Variable$3 { defs: Array [], name: "arguments", references: Array [], isValueVariable: true, isTypeVariable: true, }, - Variable$3 { + Variable$4 { defs: Array [ ParameterDefinition$2 { name: Identifier<"a">, @@ -38,7 +39,7 @@ ScopeManager { isValueVariable: true, isTypeVariable: false, }, - Variable$4 { + Variable$5 { defs: Array [ ParameterDefinition$3 { name: Identifier<"b">, @@ -50,14 +51,14 @@ ScopeManager { isValueVariable: true, isTypeVariable: false, }, - Variable$5 { + Variable$6 { defs: Array [], name: "arguments", references: Array [], isValueVariable: true, isTypeVariable: true, }, - Variable$6 { + Variable$7 { defs: Array [ ParameterDefinition$5 { name: Identifier<"a">, @@ -72,13 +73,13 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$6, + resolved: Variable$7, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$7 { + Variable$8 { defs: Array [ ParameterDefinition$6 { name: Identifier<"b">, @@ -97,12 +98,14 @@ ScopeManager { isStrict: false, references: Array [], set: Map { - "foo" => Variable$1, + "const" => ImplicitGlobalConstTypeVariable, + "foo" => Variable$2, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, + Variable$2, ], }, FunctionScope$2 { @@ -110,16 +113,16 @@ ScopeManager { isStrict: false, references: Array [], set: Map { - "arguments" => Variable$2, - "a" => Variable$3, - "b" => Variable$4, + "arguments" => Variable$3, + "a" => Variable$4, + "b" => Variable$5, }, type: "function", upper: GlobalScope$1, variables: Array [ - Variable$2, Variable$3, Variable$4, + Variable$5, ], }, FunctionScope$3 { @@ -129,16 +132,16 @@ ScopeManager { Reference$1, ], set: Map { - "arguments" => Variable$5, - "a" => Variable$6, - "b" => Variable$7, + "arguments" => Variable$6, + "a" => Variable$7, + "b" => Variable$8, }, type: "function", upper: GlobalScope$1, variables: Array [ - Variable$5, Variable$6, Variable$7, + Variable$8, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/functions/function-declaration/params.ts.shot b/packages/scope-manager/tests/fixtures/functions/function-declaration/params.ts.shot index a9e3295b3824..74412933dbe9 100644 --- a/packages/scope-manager/tests/fixtures/functions/function-declaration/params.ts.shot +++ b/packages/scope-manager/tests/fixtures/functions/function-declaration/params.ts.shot @@ -3,7 +3,8 @@ exports[`functions function-declaration params 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ VariableDefinition$1 { name: Identifier<"outer">, @@ -19,7 +20,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$1, + resolved: Variable$2, writeExpr: Literal$2, }, Reference$6 { @@ -28,13 +29,13 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$2 { + Variable$3 { defs: Array [ FunctionNameDefinition$2 { name: Identifier<"foo">, @@ -46,14 +47,14 @@ ScopeManager { isValueVariable: true, isTypeVariable: false, }, - Variable$3 { + Variable$4 { defs: Array [], name: "arguments", references: Array [], isValueVariable: true, isTypeVariable: true, }, - Variable$4 { + Variable$5 { defs: Array [ ParameterDefinition$3 { name: Identifier<"a">, @@ -68,7 +69,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$4, + resolved: Variable$5, }, Reference$7 { identifier: Identifier<"a">, @@ -76,13 +77,13 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$4, + resolved: Variable$5, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$5 { + Variable$6 { defs: Array [ ParameterDefinition$4 { name: Identifier<"b">, @@ -94,7 +95,7 @@ ScopeManager { isValueVariable: true, isTypeVariable: false, }, - Variable$6 { + Variable$7 { defs: Array [ ParameterDefinition$5 { name: Identifier<"c">, @@ -106,7 +107,7 @@ ScopeManager { isValueVariable: true, isTypeVariable: false, }, - Variable$7 { + Variable$8 { defs: Array [ ParameterDefinition$6 { name: Identifier<"d">, @@ -122,14 +123,14 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$7, + resolved: Variable$8, writeExpr: Literal$4, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$8 { + Variable$9 { defs: Array [ ParameterDefinition$7 { name: Identifier<"e">, @@ -145,14 +146,14 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$8, + resolved: Variable$9, writeExpr: Identifier<"a">, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$9 { + Variable$10 { defs: Array [ ParameterDefinition$8 { name: Identifier<"f">, @@ -168,14 +169,14 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$9, + resolved: Variable$10, writeExpr: Identifier<"outer">, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$10 { + Variable$11 { defs: Array [ ParameterDefinition$9 { name: Identifier<"g">, @@ -187,7 +188,7 @@ ScopeManager { isValueVariable: true, isTypeVariable: false, }, - Variable$11 { + Variable$12 { defs: Array [ VariableDefinition$10 { name: Identifier<"unresolved">, @@ -203,7 +204,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$11, + resolved: Variable$12, writeExpr: Identifier<"g">, }, ], @@ -228,16 +229,18 @@ ScopeManager { }, ], set: Map { - "outer" => Variable$1, - "foo" => Variable$2, - "unresolved" => Variable$11, + "const" => ImplicitGlobalConstTypeVariable, + "outer" => Variable$2, + "foo" => Variable$3, + "unresolved" => Variable$12, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, Variable$2, - Variable$11, + Variable$3, + Variable$12, ], }, FunctionScope$2 { @@ -252,19 +255,18 @@ ScopeManager { Reference$7, ], set: Map { - "arguments" => Variable$3, - "a" => Variable$4, - "b" => Variable$5, - "c" => Variable$6, - "d" => Variable$7, - "e" => Variable$8, - "f" => Variable$9, - "g" => Variable$10, + "arguments" => Variable$4, + "a" => Variable$5, + "b" => Variable$6, + "c" => Variable$7, + "d" => Variable$8, + "e" => Variable$9, + "f" => Variable$10, + "g" => Variable$11, }, type: "function", upper: GlobalScope$1, variables: Array [ - Variable$3, Variable$4, Variable$5, Variable$6, @@ -272,6 +274,7 @@ ScopeManager { Variable$8, Variable$9, Variable$10, + Variable$11, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/functions/function-declaration/scope.ts.shot b/packages/scope-manager/tests/fixtures/functions/function-declaration/scope.ts.shot index fd83889154c8..ee093eceedcd 100644 --- a/packages/scope-manager/tests/fixtures/functions/function-declaration/scope.ts.shot +++ b/packages/scope-manager/tests/fixtures/functions/function-declaration/scope.ts.shot @@ -3,7 +3,8 @@ exports[`functions function-declaration scope 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ FunctionNameDefinition$1 { name: Identifier<"foo">, @@ -15,14 +16,14 @@ ScopeManager { isValueVariable: true, isTypeVariable: false, }, - Variable$2 { + Variable$3 { defs: Array [], name: "arguments", references: Array [], isValueVariable: true, isTypeVariable: true, }, - Variable$3 { + Variable$4 { defs: Array [ VariableDefinition$2 { name: Identifier<"i">, @@ -38,7 +39,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$3, + resolved: Variable$4, writeExpr: Literal$3, }, Reference$3 { @@ -47,13 +48,13 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$3, + resolved: Variable$4, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$4 { + Variable$5 { defs: Array [ VariableDefinition$3 { name: Identifier<"j">, @@ -69,14 +70,14 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$4, + resolved: Variable$5, writeExpr: Literal$5, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$5 { + Variable$6 { defs: Array [ VariableDefinition$4 { name: Identifier<"unresolved">, @@ -92,7 +93,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$5, + resolved: Variable$6, writeExpr: Identifier<"j">, }, ], @@ -116,14 +117,16 @@ ScopeManager { }, ], set: Map { - "foo" => Variable$1, - "unresolved" => Variable$5, + "const" => ImplicitGlobalConstTypeVariable, + "foo" => Variable$2, + "unresolved" => Variable$6, }, type: "global", upper: null, variables: Array [ - Variable$1, - Variable$5, + ImplicitGlobalConstTypeVariable, + Variable$2, + Variable$6, ], }, FunctionScope$2 { @@ -135,16 +138,16 @@ ScopeManager { Reference$3, ], set: Map { - "arguments" => Variable$2, - "i" => Variable$3, - "j" => Variable$4, + "arguments" => Variable$3, + "i" => Variable$4, + "j" => Variable$5, }, type: "function", upper: GlobalScope$1, variables: Array [ - Variable$2, Variable$3, Variable$4, + Variable$5, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/functions/function-declaration/type-parameters/body-reference.ts.shot b/packages/scope-manager/tests/fixtures/functions/function-declaration/type-parameters/body-reference.ts.shot index 42fbf6e6ea52..509b76e73867 100644 --- a/packages/scope-manager/tests/fixtures/functions/function-declaration/type-parameters/body-reference.ts.shot +++ b/packages/scope-manager/tests/fixtures/functions/function-declaration/type-parameters/body-reference.ts.shot @@ -3,7 +3,8 @@ exports[`functions function-declaration type-parameters body-reference 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ FunctionNameDefinition$1 { name: Identifier<"foo">, @@ -15,14 +16,14 @@ ScopeManager { isValueVariable: true, isTypeVariable: false, }, - Variable$2 { + Variable$3 { defs: Array [], name: "arguments", references: Array [], isValueVariable: true, isTypeVariable: true, }, - Variable$3 { + Variable$4 { defs: Array [ TypeDefinition$2 { name: Identifier<"T">, @@ -37,13 +38,13 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$3, + resolved: Variable$4, }, ], isValueVariable: false, isTypeVariable: true, }, - Variable$4 { + Variable$5 { defs: Array [ VariableDefinition$3 { name: Identifier<"x">, @@ -62,12 +63,14 @@ ScopeManager { isStrict: false, references: Array [], set: Map { - "foo" => Variable$1, + "const" => ImplicitGlobalConstTypeVariable, + "foo" => Variable$2, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, + Variable$2, ], }, FunctionScope$2 { @@ -77,16 +80,16 @@ ScopeManager { Reference$1, ], set: Map { - "arguments" => Variable$2, - "T" => Variable$3, - "x" => Variable$4, + "arguments" => Variable$3, + "T" => Variable$4, + "x" => Variable$5, }, type: "function", upper: GlobalScope$1, variables: Array [ - Variable$2, Variable$3, Variable$4, + Variable$5, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/functions/function-declaration/type-parameters/param-reference.ts.shot b/packages/scope-manager/tests/fixtures/functions/function-declaration/type-parameters/param-reference.ts.shot index 103e44e01496..450bbbf8fe94 100644 --- a/packages/scope-manager/tests/fixtures/functions/function-declaration/type-parameters/param-reference.ts.shot +++ b/packages/scope-manager/tests/fixtures/functions/function-declaration/type-parameters/param-reference.ts.shot @@ -3,7 +3,8 @@ exports[`functions function-declaration type-parameters param-reference 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ FunctionNameDefinition$1 { name: Identifier<"foo">, @@ -15,14 +16,14 @@ ScopeManager { isValueVariable: true, isTypeVariable: false, }, - Variable$2 { + Variable$3 { defs: Array [], name: "arguments", references: Array [], isValueVariable: true, isTypeVariable: true, }, - Variable$3 { + Variable$4 { defs: Array [ ParameterDefinition$2 { name: Identifier<"a">, @@ -34,7 +35,7 @@ ScopeManager { isValueVariable: true, isTypeVariable: false, }, - Variable$4 { + Variable$5 { defs: Array [ TypeDefinition$3 { name: Identifier<"T">, @@ -49,7 +50,7 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$4, + resolved: Variable$5, }, ], isValueVariable: false, @@ -62,12 +63,14 @@ ScopeManager { isStrict: false, references: Array [], set: Map { - "foo" => Variable$1, + "const" => ImplicitGlobalConstTypeVariable, + "foo" => Variable$2, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, + Variable$2, ], }, FunctionScope$2 { @@ -77,16 +80,16 @@ ScopeManager { Reference$1, ], set: Map { - "arguments" => Variable$2, - "a" => Variable$3, - "T" => Variable$4, + "arguments" => Variable$3, + "a" => Variable$4, + "T" => Variable$5, }, type: "function", upper: GlobalScope$1, variables: Array [ - Variable$2, Variable$3, Variable$4, + Variable$5, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/functions/function-declaration/type-parameters/return-value-reference.ts.shot b/packages/scope-manager/tests/fixtures/functions/function-declaration/type-parameters/return-value-reference.ts.shot index fac40af43978..7a82a1954c90 100644 --- a/packages/scope-manager/tests/fixtures/functions/function-declaration/type-parameters/return-value-reference.ts.shot +++ b/packages/scope-manager/tests/fixtures/functions/function-declaration/type-parameters/return-value-reference.ts.shot @@ -3,7 +3,8 @@ exports[`functions function-declaration type-parameters return-value-reference 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ FunctionNameDefinition$1 { name: Identifier<"foo">, @@ -15,14 +16,14 @@ ScopeManager { isValueVariable: true, isTypeVariable: false, }, - Variable$2 { + Variable$3 { defs: Array [], name: "arguments", references: Array [], isValueVariable: true, isTypeVariable: true, }, - Variable$3 { + Variable$4 { defs: Array [ TypeDefinition$2 { name: Identifier<"T">, @@ -37,7 +38,7 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$3, + resolved: Variable$4, }, ], isValueVariable: false, @@ -50,12 +51,14 @@ ScopeManager { isStrict: false, references: Array [], set: Map { - "foo" => Variable$1, + "const" => ImplicitGlobalConstTypeVariable, + "foo" => Variable$2, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, + Variable$2, ], }, FunctionScope$2 { @@ -65,14 +68,14 @@ ScopeManager { Reference$1, ], set: Map { - "arguments" => Variable$2, - "T" => Variable$3, + "arguments" => Variable$3, + "T" => Variable$4, }, type: "function", upper: GlobalScope$1, variables: Array [ - Variable$2, Variable$3, + Variable$4, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/functions/function-declaration/type-parameters/type-param-reference.ts.shot b/packages/scope-manager/tests/fixtures/functions/function-declaration/type-parameters/type-param-reference.ts.shot index be1193462100..2a794bb37d5e 100644 --- a/packages/scope-manager/tests/fixtures/functions/function-declaration/type-parameters/type-param-reference.ts.shot +++ b/packages/scope-manager/tests/fixtures/functions/function-declaration/type-parameters/type-param-reference.ts.shot @@ -3,7 +3,8 @@ exports[`functions function-declaration type-parameters type-param-reference 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ FunctionNameDefinition$1 { name: Identifier<"foo">, @@ -15,14 +16,14 @@ ScopeManager { isValueVariable: true, isTypeVariable: false, }, - Variable$2 { + Variable$3 { defs: Array [], name: "arguments", references: Array [], isValueVariable: true, isTypeVariable: true, }, - Variable$3 { + Variable$4 { defs: Array [ TypeDefinition$2 { name: Identifier<"T">, @@ -37,13 +38,13 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$3, + resolved: Variable$4, }, ], isValueVariable: false, isTypeVariable: true, }, - Variable$4 { + Variable$5 { defs: Array [ TypeDefinition$3 { name: Identifier<"U">, @@ -62,12 +63,14 @@ ScopeManager { isStrict: false, references: Array [], set: Map { - "foo" => Variable$1, + "const" => ImplicitGlobalConstTypeVariable, + "foo" => Variable$2, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, + Variable$2, ], }, FunctionScope$2 { @@ -77,16 +80,16 @@ ScopeManager { Reference$1, ], set: Map { - "arguments" => Variable$2, - "T" => Variable$3, - "U" => Variable$4, + "arguments" => Variable$3, + "T" => Variable$4, + "U" => Variable$5, }, type: "function", upper: GlobalScope$1, variables: Array [ - Variable$2, Variable$3, Variable$4, + Variable$5, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/functions/function-declaration/type-parameters/type-parameter-declaration.ts.shot b/packages/scope-manager/tests/fixtures/functions/function-declaration/type-parameters/type-parameter-declaration.ts.shot index 33e489b57d14..95d3379de930 100644 --- a/packages/scope-manager/tests/fixtures/functions/function-declaration/type-parameters/type-parameter-declaration.ts.shot +++ b/packages/scope-manager/tests/fixtures/functions/function-declaration/type-parameters/type-parameter-declaration.ts.shot @@ -3,7 +3,8 @@ exports[`functions function-declaration type-parameters type-parameter-declaration 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ FunctionNameDefinition$1 { name: Identifier<"foo">, @@ -15,14 +16,14 @@ ScopeManager { isValueVariable: true, isTypeVariable: false, }, - Variable$2 { + Variable$3 { defs: Array [], name: "arguments", references: Array [], isValueVariable: true, isTypeVariable: true, }, - Variable$3 { + Variable$4 { defs: Array [ TypeDefinition$2 { name: Identifier<"T">, @@ -34,7 +35,7 @@ ScopeManager { isValueVariable: false, isTypeVariable: true, }, - Variable$4 { + Variable$5 { defs: Array [ TypeDefinition$3 { name: Identifier<"Unresolved">, @@ -62,14 +63,16 @@ ScopeManager { }, ], set: Map { - "foo" => Variable$1, - "Unresolved" => Variable$4, + "const" => ImplicitGlobalConstTypeVariable, + "foo" => Variable$2, + "Unresolved" => Variable$5, }, type: "global", upper: null, variables: Array [ - Variable$1, - Variable$4, + ImplicitGlobalConstTypeVariable, + Variable$2, + Variable$5, ], }, FunctionScope$2 { @@ -77,14 +80,14 @@ ScopeManager { isStrict: false, references: Array [], set: Map { - "arguments" => Variable$2, - "T" => Variable$3, + "arguments" => Variable$3, + "T" => Variable$4, }, type: "function", upper: GlobalScope$1, variables: Array [ - Variable$2, Variable$3, + Variable$4, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/functions/function-declaration/type-predicate-asserts1.ts.shot b/packages/scope-manager/tests/fixtures/functions/function-declaration/type-predicate-asserts1.ts.shot index 79f248a2044f..74cbb2a55338 100644 --- a/packages/scope-manager/tests/fixtures/functions/function-declaration/type-predicate-asserts1.ts.shot +++ b/packages/scope-manager/tests/fixtures/functions/function-declaration/type-predicate-asserts1.ts.shot @@ -3,7 +3,8 @@ exports[`functions function-declaration type-predicate-asserts1 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ FunctionNameDefinition$1 { name: Identifier<"foo">, @@ -15,14 +16,14 @@ ScopeManager { isValueVariable: true, isTypeVariable: false, }, - Variable$2 { + Variable$3 { defs: Array [], name: "arguments", references: Array [], isValueVariable: true, isTypeVariable: true, }, - Variable$3 { + Variable$4 { defs: Array [ ParameterDefinition$2 { name: Identifier<"arg">, @@ -37,7 +38,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$3, + resolved: Variable$4, }, ], isValueVariable: true, @@ -50,12 +51,14 @@ ScopeManager { isStrict: false, references: Array [], set: Map { - "foo" => Variable$1, + "const" => ImplicitGlobalConstTypeVariable, + "foo" => Variable$2, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, + Variable$2, ], }, FunctionScope$2 { @@ -65,14 +68,14 @@ ScopeManager { Reference$1, ], set: Map { - "arguments" => Variable$2, - "arg" => Variable$3, + "arguments" => Variable$3, + "arg" => Variable$4, }, type: "function", upper: GlobalScope$1, variables: Array [ - Variable$2, Variable$3, + Variable$4, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/functions/function-declaration/type-predicate-asserts2.ts.shot b/packages/scope-manager/tests/fixtures/functions/function-declaration/type-predicate-asserts2.ts.shot index 4df9c6d09eb6..912ac72e0e1b 100644 --- a/packages/scope-manager/tests/fixtures/functions/function-declaration/type-predicate-asserts2.ts.shot +++ b/packages/scope-manager/tests/fixtures/functions/function-declaration/type-predicate-asserts2.ts.shot @@ -3,7 +3,8 @@ exports[`functions function-declaration type-predicate-asserts2 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ TypeDefinition$1 { name: Identifier<"T">, @@ -18,13 +19,13 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: false, isTypeVariable: true, }, - Variable$2 { + Variable$3 { defs: Array [ FunctionNameDefinition$2 { name: Identifier<"foo">, @@ -36,14 +37,14 @@ ScopeManager { isValueVariable: true, isTypeVariable: false, }, - Variable$3 { + Variable$4 { defs: Array [], name: "arguments", references: Array [], isValueVariable: true, isTypeVariable: true, }, - Variable$4 { + Variable$5 { defs: Array [ ParameterDefinition$3 { name: Identifier<"arg">, @@ -58,7 +59,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$4, + resolved: Variable$5, }, ], isValueVariable: true, @@ -71,14 +72,16 @@ ScopeManager { isStrict: false, references: Array [], set: Map { - "T" => Variable$1, - "foo" => Variable$2, + "const" => ImplicitGlobalConstTypeVariable, + "T" => Variable$2, + "foo" => Variable$3, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, Variable$2, + Variable$3, ], }, FunctionScope$2 { @@ -89,14 +92,14 @@ ScopeManager { Reference$2, ], set: Map { - "arguments" => Variable$3, - "arg" => Variable$4, + "arguments" => Variable$4, + "arg" => Variable$5, }, type: "function", upper: GlobalScope$1, variables: Array [ - Variable$3, Variable$4, + Variable$5, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/functions/function-declaration/type-predicate1.ts.shot b/packages/scope-manager/tests/fixtures/functions/function-declaration/type-predicate1.ts.shot index 315b74fe467b..1982885870d5 100644 --- a/packages/scope-manager/tests/fixtures/functions/function-declaration/type-predicate1.ts.shot +++ b/packages/scope-manager/tests/fixtures/functions/function-declaration/type-predicate1.ts.shot @@ -3,7 +3,8 @@ exports[`functions function-declaration type-predicate1 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ FunctionNameDefinition$1 { name: Identifier<"foo">, @@ -15,14 +16,14 @@ ScopeManager { isValueVariable: true, isTypeVariable: false, }, - Variable$2 { + Variable$3 { defs: Array [], name: "arguments", references: Array [], isValueVariable: true, isTypeVariable: true, }, - Variable$3 { + Variable$4 { defs: Array [ ParameterDefinition$2 { name: Identifier<"arg">, @@ -37,7 +38,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$3, + resolved: Variable$4, }, Reference$2 { identifier: Identifier<"arg">, @@ -45,7 +46,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$3, + resolved: Variable$4, }, ], isValueVariable: true, @@ -58,12 +59,14 @@ ScopeManager { isStrict: false, references: Array [], set: Map { - "foo" => Variable$1, + "const" => ImplicitGlobalConstTypeVariable, + "foo" => Variable$2, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, + Variable$2, ], }, FunctionScope$2 { @@ -74,14 +77,14 @@ ScopeManager { Reference$2, ], set: Map { - "arguments" => Variable$2, - "arg" => Variable$3, + "arguments" => Variable$3, + "arg" => Variable$4, }, type: "function", upper: GlobalScope$1, variables: Array [ - Variable$2, Variable$3, + Variable$4, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/functions/function-declaration/type-predicate2.ts.shot b/packages/scope-manager/tests/fixtures/functions/function-declaration/type-predicate2.ts.shot index 95f298e5eeab..878adc032255 100644 --- a/packages/scope-manager/tests/fixtures/functions/function-declaration/type-predicate2.ts.shot +++ b/packages/scope-manager/tests/fixtures/functions/function-declaration/type-predicate2.ts.shot @@ -3,7 +3,8 @@ exports[`functions function-declaration type-predicate2 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ TypeDefinition$1 { name: Identifier<"T">, @@ -18,13 +19,13 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: false, isTypeVariable: true, }, - Variable$2 { + Variable$3 { defs: Array [ FunctionNameDefinition$2 { name: Identifier<"foo">, @@ -36,14 +37,14 @@ ScopeManager { isValueVariable: true, isTypeVariable: false, }, - Variable$3 { + Variable$4 { defs: Array [], name: "arguments", references: Array [], isValueVariable: true, isTypeVariable: true, }, - Variable$4 { + Variable$5 { defs: Array [ ParameterDefinition$3 { name: Identifier<"arg">, @@ -58,7 +59,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$4, + resolved: Variable$5, }, Reference$3 { identifier: Identifier<"arg">, @@ -66,7 +67,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$4, + resolved: Variable$5, }, ], isValueVariable: true, @@ -79,14 +80,16 @@ ScopeManager { isStrict: false, references: Array [], set: Map { - "T" => Variable$1, - "foo" => Variable$2, + "const" => ImplicitGlobalConstTypeVariable, + "T" => Variable$2, + "foo" => Variable$3, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, Variable$2, + Variable$3, ], }, FunctionScope$2 { @@ -98,14 +101,14 @@ ScopeManager { Reference$3, ], set: Map { - "arguments" => Variable$3, - "arg" => Variable$4, + "arguments" => Variable$4, + "arg" => Variable$5, }, type: "function", upper: GlobalScope$1, variables: Array [ - Variable$3, Variable$4, + Variable$5, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/functions/function-expression/anonymous.ts.shot b/packages/scope-manager/tests/fixtures/functions/function-expression/anonymous.ts.shot index 3c21bb8c0c56..d3350c6e2398 100644 --- a/packages/scope-manager/tests/fixtures/functions/function-expression/anonymous.ts.shot +++ b/packages/scope-manager/tests/fixtures/functions/function-expression/anonymous.ts.shot @@ -3,7 +3,8 @@ exports[`functions function-expression anonymous 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ VariableDefinition$1 { name: Identifier<"foo">, @@ -19,14 +20,14 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$1, + resolved: Variable$2, writeExpr: FunctionExpression$2, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$2 { + Variable$3 { defs: Array [], name: "arguments", references: Array [], @@ -42,12 +43,14 @@ ScopeManager { Reference$1, ], set: Map { - "foo" => Variable$1, + "const" => ImplicitGlobalConstTypeVariable, + "foo" => Variable$2, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, + Variable$2, ], }, FunctionScope$2 { @@ -55,12 +58,12 @@ ScopeManager { isStrict: false, references: Array [], set: Map { - "arguments" => Variable$2, + "arguments" => Variable$3, }, type: "function", upper: GlobalScope$1, variables: Array [ - Variable$2, + Variable$3, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/functions/function-expression/default-params/readable-ref-body-shadow.ts.shot b/packages/scope-manager/tests/fixtures/functions/function-expression/default-params/readable-ref-body-shadow.ts.shot index 02cca0dae95f..1a9a514ee5cd 100644 --- a/packages/scope-manager/tests/fixtures/functions/function-expression/default-params/readable-ref-body-shadow.ts.shot +++ b/packages/scope-manager/tests/fixtures/functions/function-expression/default-params/readable-ref-body-shadow.ts.shot @@ -3,7 +3,8 @@ exports[`functions function-expression default-params readable-ref-body-shadow 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ VariableDefinition$1 { name: Identifier<"a">, @@ -18,13 +19,13 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$2 { + Variable$3 { defs: Array [ VariableDefinition$2 { name: Identifier<"foo">, @@ -40,21 +41,21 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$2, + resolved: Variable$3, writeExpr: FunctionExpression$3, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$3 { + Variable$4 { defs: Array [], name: "arguments", references: Array [], isValueVariable: true, isTypeVariable: true, }, - Variable$4 { + Variable$5 { defs: Array [ ParameterDefinition$3 { name: Identifier<"b">, @@ -70,14 +71,14 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$4, + resolved: Variable$5, writeExpr: Identifier<"a">, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$5 { + Variable$6 { defs: Array [ VariableDefinition$4 { name: Identifier<"a">, @@ -98,14 +99,16 @@ ScopeManager { Reference$1, ], set: Map { - "a" => Variable$1, - "foo" => Variable$2, + "const" => ImplicitGlobalConstTypeVariable, + "a" => Variable$2, + "foo" => Variable$3, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, Variable$2, + Variable$3, ], }, FunctionScope$2 { @@ -116,16 +119,16 @@ ScopeManager { Reference$3, ], set: Map { - "arguments" => Variable$3, - "b" => Variable$4, - "a" => Variable$5, + "arguments" => Variable$4, + "b" => Variable$5, + "a" => Variable$6, }, type: "function", upper: GlobalScope$1, variables: Array [ - Variable$3, Variable$4, Variable$5, + Variable$6, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/functions/function-expression/default-params/readable-ref-const.ts.shot b/packages/scope-manager/tests/fixtures/functions/function-expression/default-params/readable-ref-const.ts.shot index 02669e40c25a..29ea4b888828 100644 --- a/packages/scope-manager/tests/fixtures/functions/function-expression/default-params/readable-ref-const.ts.shot +++ b/packages/scope-manager/tests/fixtures/functions/function-expression/default-params/readable-ref-const.ts.shot @@ -3,7 +3,8 @@ exports[`functions function-expression default-params readable-ref-const 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ VariableDefinition$1 { name: Identifier<"a">, @@ -19,7 +20,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$1, + resolved: Variable$2, writeExpr: Literal$2, }, Reference$4 { @@ -28,13 +29,13 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$2 { + Variable$3 { defs: Array [ VariableDefinition$2 { name: Identifier<"foo">, @@ -50,21 +51,21 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$2, + resolved: Variable$3, writeExpr: FunctionExpression$4, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$3 { + Variable$4 { defs: Array [], name: "arguments", references: Array [], isValueVariable: true, isTypeVariable: true, }, - Variable$4 { + Variable$5 { defs: Array [ ParameterDefinition$3 { name: Identifier<"b">, @@ -80,7 +81,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$4, + resolved: Variable$5, writeExpr: Identifier<"a">, }, ], @@ -97,14 +98,16 @@ ScopeManager { Reference$2, ], set: Map { - "a" => Variable$1, - "foo" => Variable$2, + "const" => ImplicitGlobalConstTypeVariable, + "a" => Variable$2, + "foo" => Variable$3, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, Variable$2, + Variable$3, ], }, FunctionScope$2 { @@ -115,14 +118,14 @@ ScopeManager { Reference$4, ], set: Map { - "arguments" => Variable$3, - "b" => Variable$4, + "arguments" => Variable$4, + "b" => Variable$5, }, type: "function", upper: GlobalScope$1, variables: Array [ - Variable$3, Variable$4, + Variable$5, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/functions/function-expression/default-params/readable-ref-let.ts.shot b/packages/scope-manager/tests/fixtures/functions/function-expression/default-params/readable-ref-let.ts.shot index 28fe2f3e33f0..218a3a8d91ae 100644 --- a/packages/scope-manager/tests/fixtures/functions/function-expression/default-params/readable-ref-let.ts.shot +++ b/packages/scope-manager/tests/fixtures/functions/function-expression/default-params/readable-ref-let.ts.shot @@ -3,7 +3,8 @@ exports[`functions function-expression default-params readable-ref-let 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ VariableDefinition$1 { name: Identifier<"a">, @@ -18,13 +19,13 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$2 { + Variable$3 { defs: Array [ VariableDefinition$2 { name: Identifier<"foo">, @@ -40,21 +41,21 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$2, + resolved: Variable$3, writeExpr: FunctionExpression$3, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$3 { + Variable$4 { defs: Array [], name: "arguments", references: Array [], isValueVariable: true, isTypeVariable: true, }, - Variable$4 { + Variable$5 { defs: Array [ ParameterDefinition$3 { name: Identifier<"b">, @@ -70,7 +71,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$4, + resolved: Variable$5, writeExpr: Identifier<"a">, }, ], @@ -86,14 +87,16 @@ ScopeManager { Reference$1, ], set: Map { - "a" => Variable$1, - "foo" => Variable$2, + "const" => ImplicitGlobalConstTypeVariable, + "a" => Variable$2, + "foo" => Variable$3, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, Variable$2, + Variable$3, ], }, FunctionScope$2 { @@ -104,14 +107,14 @@ ScopeManager { Reference$3, ], set: Map { - "arguments" => Variable$3, - "b" => Variable$4, + "arguments" => Variable$4, + "b" => Variable$5, }, type: "function", upper: GlobalScope$1, variables: Array [ - Variable$3, Variable$4, + Variable$5, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/functions/function-expression/default-params/readable-ref-nested-body-shadow.ts.shot b/packages/scope-manager/tests/fixtures/functions/function-expression/default-params/readable-ref-nested-body-shadow.ts.shot index 391c7d154632..ed80aaccc6c2 100644 --- a/packages/scope-manager/tests/fixtures/functions/function-expression/default-params/readable-ref-nested-body-shadow.ts.shot +++ b/packages/scope-manager/tests/fixtures/functions/function-expression/default-params/readable-ref-nested-body-shadow.ts.shot @@ -3,7 +3,8 @@ exports[`functions function-expression default-params readable-ref-nested-body-shadow 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ VariableDefinition$1 { name: Identifier<"a">, @@ -18,13 +19,13 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$2 { + Variable$3 { defs: Array [ VariableDefinition$2 { name: Identifier<"foo">, @@ -40,21 +41,21 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$2, + resolved: Variable$3, writeExpr: FunctionExpression$3, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$3 { + Variable$4 { defs: Array [], name: "arguments", references: Array [], isValueVariable: true, isTypeVariable: true, }, - Variable$4 { + Variable$5 { defs: Array [ ParameterDefinition$3 { name: Identifier<"b">, @@ -70,21 +71,21 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$4, + resolved: Variable$5, writeExpr: FunctionExpression$4, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$5 { + Variable$6 { defs: Array [], name: "arguments", references: Array [], isValueVariable: true, isTypeVariable: true, }, - Variable$6 { + Variable$7 { defs: Array [ VariableDefinition$4 { name: Identifier<"a">, @@ -105,14 +106,16 @@ ScopeManager { Reference$1, ], set: Map { - "a" => Variable$1, - "foo" => Variable$2, + "const" => ImplicitGlobalConstTypeVariable, + "a" => Variable$2, + "foo" => Variable$3, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, Variable$2, + Variable$3, ], }, FunctionScope$2 { @@ -122,16 +125,16 @@ ScopeManager { Reference$2, ], set: Map { - "arguments" => Variable$3, - "b" => Variable$4, - "a" => Variable$6, + "arguments" => Variable$4, + "b" => Variable$5, + "a" => Variable$7, }, type: "function", upper: GlobalScope$1, variables: Array [ - Variable$3, Variable$4, - Variable$6, + Variable$5, + Variable$7, ], }, FunctionScope$3 { @@ -141,12 +144,12 @@ ScopeManager { Reference$3, ], set: Map { - "arguments" => Variable$5, + "arguments" => Variable$6, }, type: "function", upper: FunctionScope$2, variables: Array [ - Variable$5, + Variable$6, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/functions/function-expression/default-params/readable-ref-nested.ts.shot b/packages/scope-manager/tests/fixtures/functions/function-expression/default-params/readable-ref-nested.ts.shot index 3201428b1a56..f0b5dd9ea539 100644 --- a/packages/scope-manager/tests/fixtures/functions/function-expression/default-params/readable-ref-nested.ts.shot +++ b/packages/scope-manager/tests/fixtures/functions/function-expression/default-params/readable-ref-nested.ts.shot @@ -3,7 +3,8 @@ exports[`functions function-expression default-params readable-ref-nested 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ VariableDefinition$1 { name: Identifier<"a">, @@ -18,13 +19,13 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$2 { + Variable$3 { defs: Array [ VariableDefinition$2 { name: Identifier<"foo">, @@ -40,21 +41,21 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$2, + resolved: Variable$3, writeExpr: FunctionExpression$3, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$3 { + Variable$4 { defs: Array [], name: "arguments", references: Array [], isValueVariable: true, isTypeVariable: true, }, - Variable$4 { + Variable$5 { defs: Array [ ParameterDefinition$3 { name: Identifier<"b">, @@ -70,14 +71,14 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$4, + resolved: Variable$5, writeExpr: FunctionExpression$4, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$5 { + Variable$6 { defs: Array [], name: "arguments", references: Array [], @@ -93,14 +94,16 @@ ScopeManager { Reference$1, ], set: Map { - "a" => Variable$1, - "foo" => Variable$2, + "const" => ImplicitGlobalConstTypeVariable, + "a" => Variable$2, + "foo" => Variable$3, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, Variable$2, + Variable$3, ], }, FunctionScope$2 { @@ -110,14 +113,14 @@ ScopeManager { Reference$2, ], set: Map { - "arguments" => Variable$3, - "b" => Variable$4, + "arguments" => Variable$4, + "b" => Variable$5, }, type: "function", upper: GlobalScope$1, variables: Array [ - Variable$3, Variable$4, + Variable$5, ], }, FunctionScope$3 { @@ -127,12 +130,12 @@ ScopeManager { Reference$3, ], set: Map { - "arguments" => Variable$5, + "arguments" => Variable$6, }, type: "function", upper: FunctionScope$2, variables: Array [ - Variable$5, + Variable$6, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/functions/function-expression/default-params/readable-ref-param-shadow.ts.shot b/packages/scope-manager/tests/fixtures/functions/function-expression/default-params/readable-ref-param-shadow.ts.shot index b47e3f9e2905..414983469280 100644 --- a/packages/scope-manager/tests/fixtures/functions/function-expression/default-params/readable-ref-param-shadow.ts.shot +++ b/packages/scope-manager/tests/fixtures/functions/function-expression/default-params/readable-ref-param-shadow.ts.shot @@ -3,7 +3,8 @@ exports[`functions function-expression default-params readable-ref-param-shadow 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ VariableDefinition$1 { name: Identifier<"a">, @@ -15,7 +16,7 @@ ScopeManager { isValueVariable: true, isTypeVariable: false, }, - Variable$2 { + Variable$3 { defs: Array [ VariableDefinition$2 { name: Identifier<"foo">, @@ -31,21 +32,21 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$2, + resolved: Variable$3, writeExpr: FunctionExpression$3, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$3 { + Variable$4 { defs: Array [], name: "arguments", references: Array [], isValueVariable: true, isTypeVariable: true, }, - Variable$4 { + Variable$5 { defs: Array [ ParameterDefinition$3 { name: Identifier<"b">, @@ -61,14 +62,14 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$4, + resolved: Variable$5, writeExpr: Identifier<"a">, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$5 { + Variable$6 { defs: Array [ ParameterDefinition$4 { name: Identifier<"a">, @@ -83,7 +84,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$5, + resolved: Variable$6, }, ], isValueVariable: true, @@ -98,14 +99,16 @@ ScopeManager { Reference$1, ], set: Map { - "a" => Variable$1, - "foo" => Variable$2, + "const" => ImplicitGlobalConstTypeVariable, + "a" => Variable$2, + "foo" => Variable$3, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, Variable$2, + Variable$3, ], }, FunctionScope$2 { @@ -116,16 +119,16 @@ ScopeManager { Reference$3, ], set: Map { - "arguments" => Variable$3, - "b" => Variable$4, - "a" => Variable$5, + "arguments" => Variable$4, + "b" => Variable$5, + "a" => Variable$6, }, type: "function", upper: GlobalScope$1, variables: Array [ - Variable$3, Variable$4, Variable$5, + Variable$6, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/functions/function-expression/default-params/readable-ref-partial.ts.shot b/packages/scope-manager/tests/fixtures/functions/function-expression/default-params/readable-ref-partial.ts.shot index 3cd961f4f199..097daa97b6fa 100644 --- a/packages/scope-manager/tests/fixtures/functions/function-expression/default-params/readable-ref-partial.ts.shot +++ b/packages/scope-manager/tests/fixtures/functions/function-expression/default-params/readable-ref-partial.ts.shot @@ -3,7 +3,8 @@ exports[`functions function-expression default-params readable-ref-partial 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ VariableDefinition$1 { name: Identifier<"a">, @@ -18,13 +19,13 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$2 { + Variable$3 { defs: Array [ VariableDefinition$2 { name: Identifier<"foo">, @@ -40,21 +41,21 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$2, + resolved: Variable$3, writeExpr: FunctionExpression$3, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$3 { + Variable$4 { defs: Array [], name: "arguments", references: Array [], isValueVariable: true, isTypeVariable: true, }, - Variable$4 { + Variable$5 { defs: Array [ ParameterDefinition$3 { name: Identifier<"b">, @@ -70,7 +71,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$4, + resolved: Variable$5, writeExpr: MemberExpression$4, }, ], @@ -86,14 +87,16 @@ ScopeManager { Reference$1, ], set: Map { - "a" => Variable$1, - "foo" => Variable$2, + "const" => ImplicitGlobalConstTypeVariable, + "a" => Variable$2, + "foo" => Variable$3, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, Variable$2, + Variable$3, ], }, FunctionScope$2 { @@ -104,14 +107,14 @@ ScopeManager { Reference$3, ], set: Map { - "arguments" => Variable$3, - "b" => Variable$4, + "arguments" => Variable$4, + "b" => Variable$5, }, type: "function", upper: GlobalScope$1, variables: Array [ - Variable$3, Variable$4, + Variable$5, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/functions/function-expression/default-params/writable-ref.ts.shot b/packages/scope-manager/tests/fixtures/functions/function-expression/default-params/writable-ref.ts.shot index 0af28fa79fc2..077c35f147d3 100644 --- a/packages/scope-manager/tests/fixtures/functions/function-expression/default-params/writable-ref.ts.shot +++ b/packages/scope-manager/tests/fixtures/functions/function-expression/default-params/writable-ref.ts.shot @@ -3,7 +3,8 @@ exports[`functions function-expression default-params writable-ref 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ VariableDefinition$1 { name: Identifier<"foo">, @@ -19,21 +20,21 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$1, + resolved: Variable$2, writeExpr: FunctionExpression$2, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$2 { + Variable$3 { defs: Array [], name: "arguments", references: Array [], isValueVariable: true, isTypeVariable: true, }, - Variable$3 { + Variable$4 { defs: Array [ ParameterDefinition$2 { name: Identifier<"a">, @@ -45,7 +46,7 @@ ScopeManager { isValueVariable: true, isTypeVariable: false, }, - Variable$4 { + Variable$5 { defs: Array [ ParameterDefinition$3 { name: Identifier<"b">, @@ -61,7 +62,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$4, + resolved: Variable$5, writeExpr: Literal$3, }, ], @@ -77,12 +78,14 @@ ScopeManager { Reference$1, ], set: Map { - "foo" => Variable$1, + "const" => ImplicitGlobalConstTypeVariable, + "foo" => Variable$2, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, + Variable$2, ], }, FunctionScope$2 { @@ -92,16 +95,16 @@ ScopeManager { Reference$2, ], set: Map { - "arguments" => Variable$2, - "a" => Variable$3, - "b" => Variable$4, + "arguments" => Variable$3, + "a" => Variable$4, + "b" => Variable$5, }, type: "function", upper: GlobalScope$1, variables: Array [ - Variable$2, Variable$3, Variable$4, + Variable$5, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/functions/function-expression/inherited-scope.ts.shot b/packages/scope-manager/tests/fixtures/functions/function-expression/inherited-scope.ts.shot index a929486045e1..4510909af711 100644 --- a/packages/scope-manager/tests/fixtures/functions/function-expression/inherited-scope.ts.shot +++ b/packages/scope-manager/tests/fixtures/functions/function-expression/inherited-scope.ts.shot @@ -3,7 +3,8 @@ exports[`functions function-expression inherited-scope 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ VariableDefinition$1 { name: Identifier<"parentScoped">, @@ -19,7 +20,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$1, + resolved: Variable$2, writeExpr: Literal$2, }, Reference$3 { @@ -28,13 +29,13 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$2 { + Variable$3 { defs: Array [ VariableDefinition$2 { name: Identifier<"foo">, @@ -50,14 +51,14 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$2, + resolved: Variable$3, writeExpr: FunctionExpression$4, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$3 { + Variable$4 { defs: Array [], name: "arguments", references: Array [], @@ -74,14 +75,16 @@ ScopeManager { Reference$2, ], set: Map { - "parentScoped" => Variable$1, - "foo" => Variable$2, + "const" => ImplicitGlobalConstTypeVariable, + "parentScoped" => Variable$2, + "foo" => Variable$3, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, Variable$2, + Variable$3, ], }, FunctionScope$2 { @@ -91,12 +94,12 @@ ScopeManager { Reference$3, ], set: Map { - "arguments" => Variable$3, + "arguments" => Variable$4, }, type: "function", upper: GlobalScope$1, variables: Array [ - Variable$3, + Variable$4, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/functions/function-expression/params.ts.shot b/packages/scope-manager/tests/fixtures/functions/function-expression/params.ts.shot index 98f6c79d8ea0..425932dc3d91 100644 --- a/packages/scope-manager/tests/fixtures/functions/function-expression/params.ts.shot +++ b/packages/scope-manager/tests/fixtures/functions/function-expression/params.ts.shot @@ -3,7 +3,8 @@ exports[`functions function-expression params 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ VariableDefinition$1 { name: Identifier<"outer">, @@ -19,7 +20,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$1, + resolved: Variable$2, writeExpr: Literal$2, }, Reference$7 { @@ -28,13 +29,13 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$2 { + Variable$3 { defs: Array [ VariableDefinition$2 { name: Identifier<"foo">, @@ -50,21 +51,21 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$2, + resolved: Variable$3, writeExpr: FunctionExpression$4, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$3 { + Variable$4 { defs: Array [], name: "arguments", references: Array [], isValueVariable: true, isTypeVariable: true, }, - Variable$4 { + Variable$5 { defs: Array [ ParameterDefinition$3 { name: Identifier<"a">, @@ -79,7 +80,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$4, + resolved: Variable$5, }, Reference$8 { identifier: Identifier<"a">, @@ -87,13 +88,13 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$4, + resolved: Variable$5, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$5 { + Variable$6 { defs: Array [ ParameterDefinition$4 { name: Identifier<"b">, @@ -105,7 +106,7 @@ ScopeManager { isValueVariable: true, isTypeVariable: false, }, - Variable$6 { + Variable$7 { defs: Array [ ParameterDefinition$5 { name: Identifier<"c">, @@ -117,7 +118,7 @@ ScopeManager { isValueVariable: true, isTypeVariable: false, }, - Variable$7 { + Variable$8 { defs: Array [ ParameterDefinition$6 { name: Identifier<"d">, @@ -133,14 +134,14 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$7, + resolved: Variable$8, writeExpr: Literal$5, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$8 { + Variable$9 { defs: Array [ ParameterDefinition$7 { name: Identifier<"e">, @@ -156,14 +157,14 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$8, + resolved: Variable$9, writeExpr: Identifier<"a">, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$9 { + Variable$10 { defs: Array [ ParameterDefinition$8 { name: Identifier<"f">, @@ -179,14 +180,14 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$9, + resolved: Variable$10, writeExpr: Identifier<"outer">, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$10 { + Variable$11 { defs: Array [ ParameterDefinition$9 { name: Identifier<"g">, @@ -198,7 +199,7 @@ ScopeManager { isValueVariable: true, isTypeVariable: false, }, - Variable$11 { + Variable$12 { defs: Array [ VariableDefinition$10 { name: Identifier<"unresolved">, @@ -214,7 +215,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$11, + resolved: Variable$12, writeExpr: Identifier<"g">, }, ], @@ -240,16 +241,18 @@ ScopeManager { }, ], set: Map { - "outer" => Variable$1, - "foo" => Variable$2, - "unresolved" => Variable$11, + "const" => ImplicitGlobalConstTypeVariable, + "outer" => Variable$2, + "foo" => Variable$3, + "unresolved" => Variable$12, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, Variable$2, - Variable$11, + Variable$3, + Variable$12, ], }, FunctionScope$2 { @@ -264,19 +267,18 @@ ScopeManager { Reference$8, ], set: Map { - "arguments" => Variable$3, - "a" => Variable$4, - "b" => Variable$5, - "c" => Variable$6, - "d" => Variable$7, - "e" => Variable$8, - "f" => Variable$9, - "g" => Variable$10, + "arguments" => Variable$4, + "a" => Variable$5, + "b" => Variable$6, + "c" => Variable$7, + "d" => Variable$8, + "e" => Variable$9, + "f" => Variable$10, + "g" => Variable$11, }, type: "function", upper: GlobalScope$1, variables: Array [ - Variable$3, Variable$4, Variable$5, Variable$6, @@ -284,6 +286,7 @@ ScopeManager { Variable$8, Variable$9, Variable$10, + Variable$11, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/functions/function-expression/scope.ts.shot b/packages/scope-manager/tests/fixtures/functions/function-expression/scope.ts.shot index 22b38184310a..d0c93a9a0dbf 100644 --- a/packages/scope-manager/tests/fixtures/functions/function-expression/scope.ts.shot +++ b/packages/scope-manager/tests/fixtures/functions/function-expression/scope.ts.shot @@ -3,7 +3,8 @@ exports[`functions function-expression scope 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ VariableDefinition$1 { name: Identifier<"foo">, @@ -19,21 +20,21 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$1, + resolved: Variable$2, writeExpr: FunctionExpression$2, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$2 { + Variable$3 { defs: Array [], name: "arguments", references: Array [], isValueVariable: true, isTypeVariable: true, }, - Variable$3 { + Variable$4 { defs: Array [ VariableDefinition$2 { name: Identifier<"i">, @@ -49,7 +50,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$3, + resolved: Variable$4, writeExpr: Literal$4, }, Reference$4 { @@ -58,13 +59,13 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$3, + resolved: Variable$4, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$4 { + Variable$5 { defs: Array [ VariableDefinition$3 { name: Identifier<"j">, @@ -80,14 +81,14 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$4, + resolved: Variable$5, writeExpr: Literal$6, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$5 { + Variable$6 { defs: Array [ VariableDefinition$4 { name: Identifier<"unresolved">, @@ -103,7 +104,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$5, + resolved: Variable$6, writeExpr: Identifier<"j">, }, ], @@ -128,14 +129,16 @@ ScopeManager { }, ], set: Map { - "foo" => Variable$1, - "unresolved" => Variable$5, + "const" => ImplicitGlobalConstTypeVariable, + "foo" => Variable$2, + "unresolved" => Variable$6, }, type: "global", upper: null, variables: Array [ - Variable$1, - Variable$5, + ImplicitGlobalConstTypeVariable, + Variable$2, + Variable$6, ], }, FunctionScope$2 { @@ -147,16 +150,16 @@ ScopeManager { Reference$4, ], set: Map { - "arguments" => Variable$2, - "i" => Variable$3, - "j" => Variable$4, + "arguments" => Variable$3, + "i" => Variable$4, + "j" => Variable$5, }, type: "function", upper: GlobalScope$1, variables: Array [ - Variable$2, Variable$3, Variable$4, + Variable$5, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/functions/function-expression/type-parameters/body-reference.ts.shot b/packages/scope-manager/tests/fixtures/functions/function-expression/type-parameters/body-reference.ts.shot index 821d3efae057..febc3e09efa1 100644 --- a/packages/scope-manager/tests/fixtures/functions/function-expression/type-parameters/body-reference.ts.shot +++ b/packages/scope-manager/tests/fixtures/functions/function-expression/type-parameters/body-reference.ts.shot @@ -3,7 +3,8 @@ exports[`functions function-expression type-parameters body-reference 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ VariableDefinition$1 { name: Identifier<"foo">, @@ -19,21 +20,21 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$1, + resolved: Variable$2, writeExpr: FunctionExpression$2, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$2 { + Variable$3 { defs: Array [], name: "arguments", references: Array [], isValueVariable: true, isTypeVariable: true, }, - Variable$3 { + Variable$4 { defs: Array [ TypeDefinition$2 { name: Identifier<"T">, @@ -48,13 +49,13 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$3, + resolved: Variable$4, }, ], isValueVariable: false, isTypeVariable: true, }, - Variable$4 { + Variable$5 { defs: Array [ VariableDefinition$3 { name: Identifier<"x">, @@ -75,12 +76,14 @@ ScopeManager { Reference$1, ], set: Map { - "foo" => Variable$1, + "const" => ImplicitGlobalConstTypeVariable, + "foo" => Variable$2, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, + Variable$2, ], }, FunctionScope$2 { @@ -90,16 +93,16 @@ ScopeManager { Reference$2, ], set: Map { - "arguments" => Variable$2, - "T" => Variable$3, - "x" => Variable$4, + "arguments" => Variable$3, + "T" => Variable$4, + "x" => Variable$5, }, type: "function", upper: GlobalScope$1, variables: Array [ - Variable$2, Variable$3, Variable$4, + Variable$5, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/functions/function-expression/type-parameters/param-reference.ts.shot b/packages/scope-manager/tests/fixtures/functions/function-expression/type-parameters/param-reference.ts.shot index cece156d09ad..96a2ea373410 100644 --- a/packages/scope-manager/tests/fixtures/functions/function-expression/type-parameters/param-reference.ts.shot +++ b/packages/scope-manager/tests/fixtures/functions/function-expression/type-parameters/param-reference.ts.shot @@ -3,7 +3,8 @@ exports[`functions function-expression type-parameters param-reference 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ VariableDefinition$1 { name: Identifier<"foo">, @@ -19,21 +20,21 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$1, + resolved: Variable$2, writeExpr: FunctionExpression$2, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$2 { + Variable$3 { defs: Array [], name: "arguments", references: Array [], isValueVariable: true, isTypeVariable: true, }, - Variable$3 { + Variable$4 { defs: Array [ ParameterDefinition$2 { name: Identifier<"a">, @@ -45,7 +46,7 @@ ScopeManager { isValueVariable: true, isTypeVariable: false, }, - Variable$4 { + Variable$5 { defs: Array [ TypeDefinition$3 { name: Identifier<"T">, @@ -60,7 +61,7 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$4, + resolved: Variable$5, }, ], isValueVariable: false, @@ -75,12 +76,14 @@ ScopeManager { Reference$1, ], set: Map { - "foo" => Variable$1, + "const" => ImplicitGlobalConstTypeVariable, + "foo" => Variable$2, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, + Variable$2, ], }, FunctionScope$2 { @@ -90,16 +93,16 @@ ScopeManager { Reference$2, ], set: Map { - "arguments" => Variable$2, - "a" => Variable$3, - "T" => Variable$4, + "arguments" => Variable$3, + "a" => Variable$4, + "T" => Variable$5, }, type: "function", upper: GlobalScope$1, variables: Array [ - Variable$2, Variable$3, Variable$4, + Variable$5, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/functions/function-expression/type-parameters/return-value-reference.ts.shot b/packages/scope-manager/tests/fixtures/functions/function-expression/type-parameters/return-value-reference.ts.shot index 126726d73ffe..f198fc3efe1b 100644 --- a/packages/scope-manager/tests/fixtures/functions/function-expression/type-parameters/return-value-reference.ts.shot +++ b/packages/scope-manager/tests/fixtures/functions/function-expression/type-parameters/return-value-reference.ts.shot @@ -3,7 +3,8 @@ exports[`functions function-expression type-parameters return-value-reference 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ VariableDefinition$1 { name: Identifier<"foo">, @@ -19,21 +20,21 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$1, + resolved: Variable$2, writeExpr: FunctionExpression$2, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$2 { + Variable$3 { defs: Array [], name: "arguments", references: Array [], isValueVariable: true, isTypeVariable: true, }, - Variable$3 { + Variable$4 { defs: Array [ TypeDefinition$2 { name: Identifier<"T">, @@ -48,7 +49,7 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$3, + resolved: Variable$4, }, ], isValueVariable: false, @@ -63,12 +64,14 @@ ScopeManager { Reference$1, ], set: Map { - "foo" => Variable$1, + "const" => ImplicitGlobalConstTypeVariable, + "foo" => Variable$2, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, + Variable$2, ], }, FunctionScope$2 { @@ -78,14 +81,14 @@ ScopeManager { Reference$2, ], set: Map { - "arguments" => Variable$2, - "T" => Variable$3, + "arguments" => Variable$3, + "T" => Variable$4, }, type: "function", upper: GlobalScope$1, variables: Array [ - Variable$2, Variable$3, + Variable$4, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/functions/function-expression/type-parameters/type-param-reference.ts.shot b/packages/scope-manager/tests/fixtures/functions/function-expression/type-parameters/type-param-reference.ts.shot index 3395da085eca..d1c45c8b840b 100644 --- a/packages/scope-manager/tests/fixtures/functions/function-expression/type-parameters/type-param-reference.ts.shot +++ b/packages/scope-manager/tests/fixtures/functions/function-expression/type-parameters/type-param-reference.ts.shot @@ -3,7 +3,8 @@ exports[`functions function-expression type-parameters type-param-reference 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ VariableDefinition$1 { name: Identifier<"foo">, @@ -19,21 +20,21 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$1, + resolved: Variable$2, writeExpr: FunctionExpression$2, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$2 { + Variable$3 { defs: Array [], name: "arguments", references: Array [], isValueVariable: true, isTypeVariable: true, }, - Variable$3 { + Variable$4 { defs: Array [ TypeDefinition$2 { name: Identifier<"T">, @@ -48,13 +49,13 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$3, + resolved: Variable$4, }, ], isValueVariable: false, isTypeVariable: true, }, - Variable$4 { + Variable$5 { defs: Array [ TypeDefinition$3 { name: Identifier<"U">, @@ -75,12 +76,14 @@ ScopeManager { Reference$1, ], set: Map { - "foo" => Variable$1, + "const" => ImplicitGlobalConstTypeVariable, + "foo" => Variable$2, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, + Variable$2, ], }, FunctionScope$2 { @@ -90,16 +93,16 @@ ScopeManager { Reference$2, ], set: Map { - "arguments" => Variable$2, - "T" => Variable$3, - "U" => Variable$4, + "arguments" => Variable$3, + "T" => Variable$4, + "U" => Variable$5, }, type: "function", upper: GlobalScope$1, variables: Array [ - Variable$2, Variable$3, Variable$4, + Variable$5, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/functions/function-expression/type-parameters/type-parameter-declaration.ts.shot b/packages/scope-manager/tests/fixtures/functions/function-expression/type-parameters/type-parameter-declaration.ts.shot index f1b4024651b5..f090f4c7abe8 100644 --- a/packages/scope-manager/tests/fixtures/functions/function-expression/type-parameters/type-parameter-declaration.ts.shot +++ b/packages/scope-manager/tests/fixtures/functions/function-expression/type-parameters/type-parameter-declaration.ts.shot @@ -3,7 +3,8 @@ exports[`functions function-expression type-parameters type-parameter-declaration 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ VariableDefinition$1 { name: Identifier<"foo">, @@ -19,21 +20,21 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$1, + resolved: Variable$2, writeExpr: FunctionExpression$2, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$2 { + Variable$3 { defs: Array [], name: "arguments", references: Array [], isValueVariable: true, isTypeVariable: true, }, - Variable$3 { + Variable$4 { defs: Array [ TypeDefinition$2 { name: Identifier<"T">, @@ -45,7 +46,7 @@ ScopeManager { isValueVariable: false, isTypeVariable: true, }, - Variable$4 { + Variable$5 { defs: Array [ TypeDefinition$3 { name: Identifier<"Unresolved">, @@ -74,14 +75,16 @@ ScopeManager { }, ], set: Map { - "foo" => Variable$1, - "Unresolved" => Variable$4, + "const" => ImplicitGlobalConstTypeVariable, + "foo" => Variable$2, + "Unresolved" => Variable$5, }, type: "global", upper: null, variables: Array [ - Variable$1, - Variable$4, + ImplicitGlobalConstTypeVariable, + Variable$2, + Variable$5, ], }, FunctionScope$2 { @@ -89,14 +92,14 @@ ScopeManager { isStrict: false, references: Array [], set: Map { - "arguments" => Variable$2, - "T" => Variable$3, + "arguments" => Variable$3, + "T" => Variable$4, }, type: "function", upper: GlobalScope$1, variables: Array [ - Variable$2, Variable$3, + Variable$4, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/functions/function-expression/type-predicate-asserts1.ts.shot b/packages/scope-manager/tests/fixtures/functions/function-expression/type-predicate-asserts1.ts.shot index 53dbd1612eea..4193011b8dba 100644 --- a/packages/scope-manager/tests/fixtures/functions/function-expression/type-predicate-asserts1.ts.shot +++ b/packages/scope-manager/tests/fixtures/functions/function-expression/type-predicate-asserts1.ts.shot @@ -3,7 +3,8 @@ exports[`functions function-expression type-predicate-asserts1 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ VariableDefinition$1 { name: Identifier<"foo">, @@ -19,21 +20,21 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$1, + resolved: Variable$2, writeExpr: FunctionExpression$2, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$2 { + Variable$3 { defs: Array [], name: "arguments", references: Array [], isValueVariable: true, isTypeVariable: true, }, - Variable$3 { + Variable$4 { defs: Array [ ParameterDefinition$2 { name: Identifier<"arg">, @@ -48,7 +49,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$3, + resolved: Variable$4, }, ], isValueVariable: true, @@ -63,12 +64,14 @@ ScopeManager { Reference$1, ], set: Map { - "foo" => Variable$1, + "const" => ImplicitGlobalConstTypeVariable, + "foo" => Variable$2, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, + Variable$2, ], }, FunctionScope$2 { @@ -78,14 +81,14 @@ ScopeManager { Reference$2, ], set: Map { - "arguments" => Variable$2, - "arg" => Variable$3, + "arguments" => Variable$3, + "arg" => Variable$4, }, type: "function", upper: GlobalScope$1, variables: Array [ - Variable$2, Variable$3, + Variable$4, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/functions/function-expression/type-predicate-asserts2.ts.shot b/packages/scope-manager/tests/fixtures/functions/function-expression/type-predicate-asserts2.ts.shot index 12b912cf820c..5fa2038599f0 100644 --- a/packages/scope-manager/tests/fixtures/functions/function-expression/type-predicate-asserts2.ts.shot +++ b/packages/scope-manager/tests/fixtures/functions/function-expression/type-predicate-asserts2.ts.shot @@ -3,7 +3,8 @@ exports[`functions function-expression type-predicate-asserts2 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ TypeDefinition$1 { name: Identifier<"T">, @@ -18,13 +19,13 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: false, isTypeVariable: true, }, - Variable$2 { + Variable$3 { defs: Array [ VariableDefinition$2 { name: Identifier<"foo">, @@ -40,21 +41,21 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$2, + resolved: Variable$3, writeExpr: FunctionExpression$3, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$3 { + Variable$4 { defs: Array [], name: "arguments", references: Array [], isValueVariable: true, isTypeVariable: true, }, - Variable$4 { + Variable$5 { defs: Array [ ParameterDefinition$3 { name: Identifier<"arg">, @@ -69,7 +70,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$4, + resolved: Variable$5, }, ], isValueVariable: true, @@ -84,14 +85,16 @@ ScopeManager { Reference$1, ], set: Map { - "T" => Variable$1, - "foo" => Variable$2, + "const" => ImplicitGlobalConstTypeVariable, + "T" => Variable$2, + "foo" => Variable$3, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, Variable$2, + Variable$3, ], }, FunctionScope$2 { @@ -102,14 +105,14 @@ ScopeManager { Reference$3, ], set: Map { - "arguments" => Variable$3, - "arg" => Variable$4, + "arguments" => Variable$4, + "arg" => Variable$5, }, type: "function", upper: GlobalScope$1, variables: Array [ - Variable$3, Variable$4, + Variable$5, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/functions/function-expression/type-predicate1.ts.shot b/packages/scope-manager/tests/fixtures/functions/function-expression/type-predicate1.ts.shot index 9aea3d721d81..154f475a4f2d 100644 --- a/packages/scope-manager/tests/fixtures/functions/function-expression/type-predicate1.ts.shot +++ b/packages/scope-manager/tests/fixtures/functions/function-expression/type-predicate1.ts.shot @@ -3,7 +3,8 @@ exports[`functions function-expression type-predicate1 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ VariableDefinition$1 { name: Identifier<"foo">, @@ -19,21 +20,21 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$1, + resolved: Variable$2, writeExpr: FunctionExpression$2, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$2 { + Variable$3 { defs: Array [], name: "arguments", references: Array [], isValueVariable: true, isTypeVariable: true, }, - Variable$3 { + Variable$4 { defs: Array [ ParameterDefinition$2 { name: Identifier<"arg">, @@ -48,7 +49,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$3, + resolved: Variable$4, }, Reference$3 { identifier: Identifier<"arg">, @@ -56,7 +57,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$3, + resolved: Variable$4, }, ], isValueVariable: true, @@ -71,12 +72,14 @@ ScopeManager { Reference$1, ], set: Map { - "foo" => Variable$1, + "const" => ImplicitGlobalConstTypeVariable, + "foo" => Variable$2, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, + Variable$2, ], }, FunctionScope$2 { @@ -87,14 +90,14 @@ ScopeManager { Reference$3, ], set: Map { - "arguments" => Variable$2, - "arg" => Variable$3, + "arguments" => Variable$3, + "arg" => Variable$4, }, type: "function", upper: GlobalScope$1, variables: Array [ - Variable$2, Variable$3, + Variable$4, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/functions/function-expression/type-predicate2.ts.shot b/packages/scope-manager/tests/fixtures/functions/function-expression/type-predicate2.ts.shot index fc5dd9a6e0ef..f9a88efb941b 100644 --- a/packages/scope-manager/tests/fixtures/functions/function-expression/type-predicate2.ts.shot +++ b/packages/scope-manager/tests/fixtures/functions/function-expression/type-predicate2.ts.shot @@ -3,7 +3,8 @@ exports[`functions function-expression type-predicate2 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ TypeDefinition$1 { name: Identifier<"T">, @@ -18,13 +19,13 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: false, isTypeVariable: true, }, - Variable$2 { + Variable$3 { defs: Array [ VariableDefinition$2 { name: Identifier<"foo">, @@ -40,21 +41,21 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$2, + resolved: Variable$3, writeExpr: FunctionExpression$3, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$3 { + Variable$4 { defs: Array [], name: "arguments", references: Array [], isValueVariable: true, isTypeVariable: true, }, - Variable$4 { + Variable$5 { defs: Array [ ParameterDefinition$3 { name: Identifier<"arg">, @@ -69,7 +70,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$4, + resolved: Variable$5, }, Reference$4 { identifier: Identifier<"arg">, @@ -77,7 +78,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$4, + resolved: Variable$5, }, ], isValueVariable: true, @@ -92,14 +93,16 @@ ScopeManager { Reference$1, ], set: Map { - "T" => Variable$1, - "foo" => Variable$2, + "const" => ImplicitGlobalConstTypeVariable, + "T" => Variable$2, + "foo" => Variable$3, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, Variable$2, + Variable$3, ], }, FunctionScope$2 { @@ -111,14 +114,14 @@ ScopeManager { Reference$4, ], set: Map { - "arguments" => Variable$3, - "arg" => Variable$4, + "arguments" => Variable$4, + "arg" => Variable$5, }, type: "function", upper: GlobalScope$1, variables: Array [ - Variable$3, Variable$4, + Variable$5, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/global-resolution/module/class.ts.shot b/packages/scope-manager/tests/fixtures/global-resolution/module/class.ts.shot index 14a6536cfbbc..75e28e474cb7 100644 --- a/packages/scope-manager/tests/fixtures/global-resolution/module/class.ts.shot +++ b/packages/scope-manager/tests/fixtures/global-resolution/module/class.ts.shot @@ -3,7 +3,8 @@ exports[`global-resolution module class 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ ClassNameDefinition$1 { name: Identifier<"Foo">, @@ -18,13 +19,13 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: true, isTypeVariable: true, }, - Variable$2 { + Variable$3 { defs: Array [ ClassNameDefinition$2 { name: Identifier<"Foo">, @@ -42,10 +43,14 @@ ScopeManager { block: Program$2, isStrict: false, references: Array [], - set: Map {}, + set: Map { + "const" => ImplicitGlobalConstTypeVariable, + }, type: "global", upper: null, - variables: Array [], + variables: Array [ + ImplicitGlobalConstTypeVariable, + ], }, ModuleScope$2 { block: Program$2, @@ -54,12 +59,12 @@ ScopeManager { Reference$1, ], set: Map { - "Foo" => Variable$1, + "Foo" => Variable$2, }, type: "module", upper: GlobalScope$1, variables: Array [ - Variable$1, + Variable$2, ], }, ClassScope$3 { @@ -67,12 +72,12 @@ ScopeManager { isStrict: true, references: Array [], set: Map { - "Foo" => Variable$2, + "Foo" => Variable$3, }, type: "class", upper: ModuleScope$2, variables: Array [ - Variable$2, + Variable$3, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/global-resolution/module/function.ts.shot b/packages/scope-manager/tests/fixtures/global-resolution/module/function.ts.shot index feb3416de130..d3f74d777036 100644 --- a/packages/scope-manager/tests/fixtures/global-resolution/module/function.ts.shot +++ b/packages/scope-manager/tests/fixtures/global-resolution/module/function.ts.shot @@ -3,7 +3,8 @@ exports[`global-resolution module function 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ FunctionNameDefinition$1 { name: Identifier<"top">, @@ -18,13 +19,13 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$2 { + Variable$3 { defs: Array [], name: "arguments", references: Array [], @@ -37,10 +38,14 @@ ScopeManager { block: Program$2, isStrict: false, references: Array [], - set: Map {}, + set: Map { + "const" => ImplicitGlobalConstTypeVariable, + }, type: "global", upper: null, - variables: Array [], + variables: Array [ + ImplicitGlobalConstTypeVariable, + ], }, ModuleScope$2 { block: Program$2, @@ -49,12 +54,12 @@ ScopeManager { Reference$1, ], set: Map { - "top" => Variable$1, + "top" => Variable$2, }, type: "module", upper: GlobalScope$1, variables: Array [ - Variable$1, + Variable$2, ], }, FunctionScope$3 { @@ -62,12 +67,12 @@ ScopeManager { isStrict: true, references: Array [], set: Map { - "arguments" => Variable$2, + "arguments" => Variable$3, }, type: "function", upper: ModuleScope$2, variables: Array [ - Variable$2, + Variable$3, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/global-resolution/module/variable-decl-const.ts.shot b/packages/scope-manager/tests/fixtures/global-resolution/module/variable-decl-const.ts.shot index cc641be85c40..f75dfd16e0c7 100644 --- a/packages/scope-manager/tests/fixtures/global-resolution/module/variable-decl-const.ts.shot +++ b/packages/scope-manager/tests/fixtures/global-resolution/module/variable-decl-const.ts.shot @@ -3,7 +3,8 @@ exports[`global-resolution module variable-decl-const 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ VariableDefinition$1 { name: Identifier<"top">, @@ -19,7 +20,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$1, + resolved: Variable$2, writeExpr: ArrowFunctionExpression$2, }, Reference$2 { @@ -28,7 +29,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: true, @@ -40,10 +41,14 @@ ScopeManager { block: Program$3, isStrict: false, references: Array [], - set: Map {}, + set: Map { + "const" => ImplicitGlobalConstTypeVariable, + }, type: "global", upper: null, - variables: Array [], + variables: Array [ + ImplicitGlobalConstTypeVariable, + ], }, ModuleScope$2 { block: Program$3, @@ -53,12 +58,12 @@ ScopeManager { Reference$2, ], set: Map { - "top" => Variable$1, + "top" => Variable$2, }, type: "module", upper: GlobalScope$1, variables: Array [ - Variable$1, + Variable$2, ], }, FunctionScope$3 { diff --git a/packages/scope-manager/tests/fixtures/global-resolution/module/variable-decl-let.ts.shot b/packages/scope-manager/tests/fixtures/global-resolution/module/variable-decl-let.ts.shot index f23c94acf49a..7147cf4277d3 100644 --- a/packages/scope-manager/tests/fixtures/global-resolution/module/variable-decl-let.ts.shot +++ b/packages/scope-manager/tests/fixtures/global-resolution/module/variable-decl-let.ts.shot @@ -3,7 +3,8 @@ exports[`global-resolution module variable-decl-let 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ VariableDefinition$1 { name: Identifier<"top">, @@ -19,7 +20,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$1, + resolved: Variable$2, writeExpr: ArrowFunctionExpression$2, }, Reference$2 { @@ -28,7 +29,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: true, @@ -40,10 +41,14 @@ ScopeManager { block: Program$3, isStrict: false, references: Array [], - set: Map {}, + set: Map { + "const" => ImplicitGlobalConstTypeVariable, + }, type: "global", upper: null, - variables: Array [], + variables: Array [ + ImplicitGlobalConstTypeVariable, + ], }, ModuleScope$2 { block: Program$3, @@ -53,12 +58,12 @@ ScopeManager { Reference$2, ], set: Map { - "top" => Variable$1, + "top" => Variable$2, }, type: "module", upper: GlobalScope$1, variables: Array [ - Variable$1, + Variable$2, ], }, FunctionScope$3 { diff --git a/packages/scope-manager/tests/fixtures/global-resolution/module/variable-decl-var.ts.shot b/packages/scope-manager/tests/fixtures/global-resolution/module/variable-decl-var.ts.shot index d7aa486e441e..d272adf20c8c 100644 --- a/packages/scope-manager/tests/fixtures/global-resolution/module/variable-decl-var.ts.shot +++ b/packages/scope-manager/tests/fixtures/global-resolution/module/variable-decl-var.ts.shot @@ -3,7 +3,8 @@ exports[`global-resolution module variable-decl-var 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ VariableDefinition$1 { name: Identifier<"top">, @@ -19,7 +20,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$1, + resolved: Variable$2, writeExpr: ArrowFunctionExpression$2, }, Reference$2 { @@ -28,7 +29,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: true, @@ -40,10 +41,14 @@ ScopeManager { block: Program$3, isStrict: false, references: Array [], - set: Map {}, + set: Map { + "const" => ImplicitGlobalConstTypeVariable, + }, type: "global", upper: null, - variables: Array [], + variables: Array [ + ImplicitGlobalConstTypeVariable, + ], }, ModuleScope$2 { block: Program$3, @@ -53,12 +58,12 @@ ScopeManager { Reference$2, ], set: Map { - "top" => Variable$1, + "top" => Variable$2, }, type: "module", upper: GlobalScope$1, variables: Array [ - Variable$1, + Variable$2, ], }, FunctionScope$3 { diff --git a/packages/scope-manager/tests/fixtures/global-resolution/script/class.ts.shot b/packages/scope-manager/tests/fixtures/global-resolution/script/class.ts.shot index aecade279a6a..984646c4c21a 100644 --- a/packages/scope-manager/tests/fixtures/global-resolution/script/class.ts.shot +++ b/packages/scope-manager/tests/fixtures/global-resolution/script/class.ts.shot @@ -3,7 +3,8 @@ exports[`global-resolution script class 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ ClassNameDefinition$1 { name: Identifier<"Foo">, @@ -18,13 +19,13 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: true, isTypeVariable: true, }, - Variable$2 { + Variable$3 { defs: Array [ ClassNameDefinition$2 { name: Identifier<"Foo">, @@ -45,12 +46,14 @@ ScopeManager { Reference$1, ], set: Map { - "Foo" => Variable$1, + "const" => ImplicitGlobalConstTypeVariable, + "Foo" => Variable$2, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, + Variable$2, ], }, ClassScope$2 { @@ -58,12 +61,12 @@ ScopeManager { isStrict: true, references: Array [], set: Map { - "Foo" => Variable$2, + "Foo" => Variable$3, }, type: "class", upper: GlobalScope$1, variables: Array [ - Variable$2, + Variable$3, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/global-resolution/script/function.ts.shot b/packages/scope-manager/tests/fixtures/global-resolution/script/function.ts.shot index 8f2e117f82e0..c237ae2953a3 100644 --- a/packages/scope-manager/tests/fixtures/global-resolution/script/function.ts.shot +++ b/packages/scope-manager/tests/fixtures/global-resolution/script/function.ts.shot @@ -3,7 +3,8 @@ exports[`global-resolution script function 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ FunctionNameDefinition$1 { name: Identifier<"top">, @@ -18,13 +19,13 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$2 { + Variable$3 { defs: Array [], name: "arguments", references: Array [], @@ -40,12 +41,14 @@ ScopeManager { Reference$1, ], set: Map { - "top" => Variable$1, + "const" => ImplicitGlobalConstTypeVariable, + "top" => Variable$2, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, + Variable$2, ], }, FunctionScope$2 { @@ -53,12 +56,12 @@ ScopeManager { isStrict: false, references: Array [], set: Map { - "arguments" => Variable$2, + "arguments" => Variable$3, }, type: "function", upper: GlobalScope$1, variables: Array [ - Variable$2, + Variable$3, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/global-resolution/script/variable-decl-const.ts.shot b/packages/scope-manager/tests/fixtures/global-resolution/script/variable-decl-const.ts.shot index 432d5f444093..f83cbfcdaec1 100644 --- a/packages/scope-manager/tests/fixtures/global-resolution/script/variable-decl-const.ts.shot +++ b/packages/scope-manager/tests/fixtures/global-resolution/script/variable-decl-const.ts.shot @@ -3,7 +3,8 @@ exports[`global-resolution script variable-decl-const 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ VariableDefinition$1 { name: Identifier<"top">, @@ -19,7 +20,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$1, + resolved: Variable$2, writeExpr: ArrowFunctionExpression$2, }, Reference$2 { @@ -28,7 +29,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: true, @@ -44,12 +45,14 @@ ScopeManager { Reference$2, ], set: Map { - "top" => Variable$1, + "const" => ImplicitGlobalConstTypeVariable, + "top" => Variable$2, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, + Variable$2, ], }, FunctionScope$2 { diff --git a/packages/scope-manager/tests/fixtures/global-resolution/script/variable-decl-let.ts.shot b/packages/scope-manager/tests/fixtures/global-resolution/script/variable-decl-let.ts.shot index e2c70907766b..516c63a9191f 100644 --- a/packages/scope-manager/tests/fixtures/global-resolution/script/variable-decl-let.ts.shot +++ b/packages/scope-manager/tests/fixtures/global-resolution/script/variable-decl-let.ts.shot @@ -3,7 +3,8 @@ exports[`global-resolution script variable-decl-let 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ VariableDefinition$1 { name: Identifier<"top">, @@ -19,7 +20,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$1, + resolved: Variable$2, writeExpr: ArrowFunctionExpression$2, }, Reference$2 { @@ -28,7 +29,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: true, @@ -44,12 +45,14 @@ ScopeManager { Reference$2, ], set: Map { - "top" => Variable$1, + "const" => ImplicitGlobalConstTypeVariable, + "top" => Variable$2, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, + Variable$2, ], }, FunctionScope$2 { diff --git a/packages/scope-manager/tests/fixtures/global-resolution/script/variable-decl-var.ts.shot b/packages/scope-manager/tests/fixtures/global-resolution/script/variable-decl-var.ts.shot index ef93f81f44e7..f7efeaa669b4 100644 --- a/packages/scope-manager/tests/fixtures/global-resolution/script/variable-decl-var.ts.shot +++ b/packages/scope-manager/tests/fixtures/global-resolution/script/variable-decl-var.ts.shot @@ -3,7 +3,8 @@ exports[`global-resolution script variable-decl-var 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ VariableDefinition$1 { name: Identifier<"top">, @@ -41,12 +42,14 @@ ScopeManager { }, ], set: Map { - "top" => Variable$1, + "const" => ImplicitGlobalConstTypeVariable, + "top" => Variable$2, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, + Variable$2, ], }, FunctionScope$2 { diff --git a/packages/scope-manager/tests/fixtures/implicit/implicit1.ts.shot b/packages/scope-manager/tests/fixtures/implicit/implicit1.ts.shot index bc46d312af9d..0fa96bf3beee 100644 --- a/packages/scope-manager/tests/fixtures/implicit/implicit1.ts.shot +++ b/packages/scope-manager/tests/fixtures/implicit/implicit1.ts.shot @@ -3,7 +3,8 @@ exports[`implicit implicit1 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ VariableDefinition$1 { name: Identifier<"x">, @@ -19,7 +20,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$1, + resolved: Variable$2, writeExpr: Identifier<"y">, }, ], @@ -43,12 +44,14 @@ ScopeManager { }, ], set: Map { - "x" => Variable$1, + "const" => ImplicitGlobalConstTypeVariable, + "x" => Variable$2, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, + Variable$2, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/import/default.ts.shot b/packages/scope-manager/tests/fixtures/import/default.ts.shot index 3caff8338621..427e6cb7ee4b 100644 --- a/packages/scope-manager/tests/fixtures/import/default.ts.shot +++ b/packages/scope-manager/tests/fixtures/import/default.ts.shot @@ -3,7 +3,8 @@ exports[`import default 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ ImportBindingDefinition$1 { name: Identifier<"v">, @@ -18,7 +19,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, Reference$2 { identifier: Identifier<"v">, @@ -26,13 +27,13 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: true, isTypeVariable: true, }, - Variable$2 { + Variable$3 { defs: Array [ TypeDefinition$2 { name: Identifier<"T">, @@ -50,10 +51,14 @@ ScopeManager { block: Program$3, isStrict: false, references: Array [], - set: Map {}, + set: Map { + "const" => ImplicitGlobalConstTypeVariable, + }, type: "global", upper: null, - variables: Array [], + variables: Array [ + ImplicitGlobalConstTypeVariable, + ], }, ModuleScope$2 { block: Program$3, @@ -63,14 +68,14 @@ ScopeManager { Reference$2, ], set: Map { - "v" => Variable$1, - "T" => Variable$2, + "v" => Variable$2, + "T" => Variable$3, }, type: "module", upper: GlobalScope$1, variables: Array [ - Variable$1, Variable$2, + Variable$3, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/import/equals1.ts.shot b/packages/scope-manager/tests/fixtures/import/equals1.ts.shot index c8b28f770787..e20ab068f8c0 100644 --- a/packages/scope-manager/tests/fixtures/import/equals1.ts.shot +++ b/packages/scope-manager/tests/fixtures/import/equals1.ts.shot @@ -3,7 +3,8 @@ exports[`import equals1 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ ImportBindingDefinition$1 { name: Identifier<"foo">, @@ -18,7 +19,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: true, @@ -30,10 +31,14 @@ ScopeManager { block: Program$2, isStrict: false, references: Array [], - set: Map {}, + set: Map { + "const" => ImplicitGlobalConstTypeVariable, + }, type: "global", upper: null, - variables: Array [], + variables: Array [ + ImplicitGlobalConstTypeVariable, + ], }, ModuleScope$2 { block: Program$2, @@ -42,12 +47,12 @@ ScopeManager { Reference$1, ], set: Map { - "foo" => Variable$1, + "foo" => Variable$2, }, type: "module", upper: GlobalScope$1, variables: Array [ - Variable$1, + Variable$2, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/import/equals2.ts.shot b/packages/scope-manager/tests/fixtures/import/equals2.ts.shot index d616a90df6d3..e69befe705b7 100644 --- a/packages/scope-manager/tests/fixtures/import/equals2.ts.shot +++ b/packages/scope-manager/tests/fixtures/import/equals2.ts.shot @@ -3,7 +3,8 @@ exports[`import equals2 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ VariableDefinition$1 { name: Identifier<"x">, @@ -19,7 +20,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$1, + resolved: Variable$2, writeExpr: Literal$2, }, Reference$2 { @@ -28,13 +29,13 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$2 { + Variable$3 { defs: Array [ ImportBindingDefinition$2 { name: Identifier<"foo">, @@ -52,10 +53,14 @@ ScopeManager { block: Program$4, isStrict: false, references: Array [], - set: Map {}, + set: Map { + "const" => ImplicitGlobalConstTypeVariable, + }, type: "global", upper: null, - variables: Array [], + variables: Array [ + ImplicitGlobalConstTypeVariable, + ], }, ModuleScope$2 { block: Program$4, @@ -65,14 +70,14 @@ ScopeManager { Reference$2, ], set: Map { - "x" => Variable$1, - "foo" => Variable$2, + "x" => Variable$2, + "foo" => Variable$3, }, type: "module", upper: GlobalScope$1, variables: Array [ - Variable$1, Variable$2, + Variable$3, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/import/named-alias.ts.shot b/packages/scope-manager/tests/fixtures/import/named-alias.ts.shot index 8031e0490cca..bc093fec64a9 100644 --- a/packages/scope-manager/tests/fixtures/import/named-alias.ts.shot +++ b/packages/scope-manager/tests/fixtures/import/named-alias.ts.shot @@ -3,7 +3,8 @@ exports[`import named-alias 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ ImportBindingDefinition$1 { name: Identifier<"t">, @@ -18,7 +19,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, Reference$2 { identifier: Identifier<"t">, @@ -26,13 +27,13 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: true, isTypeVariable: true, }, - Variable$2 { + Variable$3 { defs: Array [ TypeDefinition$2 { name: Identifier<"T">, @@ -50,10 +51,14 @@ ScopeManager { block: Program$3, isStrict: false, references: Array [], - set: Map {}, + set: Map { + "const" => ImplicitGlobalConstTypeVariable, + }, type: "global", upper: null, - variables: Array [], + variables: Array [ + ImplicitGlobalConstTypeVariable, + ], }, ModuleScope$2 { block: Program$3, @@ -63,14 +68,14 @@ ScopeManager { Reference$2, ], set: Map { - "t" => Variable$1, - "T" => Variable$2, + "t" => Variable$2, + "T" => Variable$3, }, type: "module", upper: GlobalScope$1, variables: Array [ - Variable$1, Variable$2, + Variable$3, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/import/named.ts.shot b/packages/scope-manager/tests/fixtures/import/named.ts.shot index ea011a52606f..f983ab379359 100644 --- a/packages/scope-manager/tests/fixtures/import/named.ts.shot +++ b/packages/scope-manager/tests/fixtures/import/named.ts.shot @@ -3,7 +3,8 @@ exports[`import named 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ ImportBindingDefinition$1 { name: Identifier<"v">, @@ -18,7 +19,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, Reference$2 { identifier: Identifier<"v">, @@ -26,13 +27,13 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: true, isTypeVariable: true, }, - Variable$2 { + Variable$3 { defs: Array [ TypeDefinition$2 { name: Identifier<"T">, @@ -50,10 +51,14 @@ ScopeManager { block: Program$3, isStrict: false, references: Array [], - set: Map {}, + set: Map { + "const" => ImplicitGlobalConstTypeVariable, + }, type: "global", upper: null, - variables: Array [], + variables: Array [ + ImplicitGlobalConstTypeVariable, + ], }, ModuleScope$2 { block: Program$3, @@ -63,14 +68,14 @@ ScopeManager { Reference$2, ], set: Map { - "v" => Variable$1, - "T" => Variable$2, + "v" => Variable$2, + "T" => Variable$3, }, type: "module", upper: GlobalScope$1, variables: Array [ - Variable$1, Variable$2, + Variable$3, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/import/namespace.ts.shot b/packages/scope-manager/tests/fixtures/import/namespace.ts.shot index d1fa4be65617..0431b9a0580c 100644 --- a/packages/scope-manager/tests/fixtures/import/namespace.ts.shot +++ b/packages/scope-manager/tests/fixtures/import/namespace.ts.shot @@ -3,7 +3,8 @@ exports[`import namespace 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ ImportBindingDefinition$1 { name: Identifier<"v">, @@ -18,7 +19,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, Reference$2 { identifier: Identifier<"v">, @@ -26,13 +27,13 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: true, isTypeVariable: true, }, - Variable$2 { + Variable$3 { defs: Array [ TypeDefinition$2 { name: Identifier<"T">, @@ -50,10 +51,14 @@ ScopeManager { block: Program$3, isStrict: false, references: Array [], - set: Map {}, + set: Map { + "const" => ImplicitGlobalConstTypeVariable, + }, type: "global", upper: null, - variables: Array [], + variables: Array [ + ImplicitGlobalConstTypeVariable, + ], }, ModuleScope$2 { block: Program$3, @@ -63,14 +68,14 @@ ScopeManager { Reference$2, ], set: Map { - "v" => Variable$1, - "T" => Variable$2, + "v" => Variable$2, + "T" => Variable$3, }, type: "module", upper: GlobalScope$1, variables: Array [ - Variable$1, Variable$2, + Variable$3, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/import/type-default-value.ts.shot b/packages/scope-manager/tests/fixtures/import/type-default-value.ts.shot index d79d510a485d..c269d5be2a05 100644 --- a/packages/scope-manager/tests/fixtures/import/type-default-value.ts.shot +++ b/packages/scope-manager/tests/fixtures/import/type-default-value.ts.shot @@ -3,7 +3,8 @@ exports[`import type-default-value 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ ImportBindingDefinition$1 { name: Identifier<"foo">, @@ -18,13 +19,13 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: true, isTypeVariable: true, }, - Variable$2 { + Variable$3 { defs: Array [ TypeDefinition$2 { name: Identifier<"T">, @@ -42,10 +43,14 @@ ScopeManager { block: Program$3, isStrict: false, references: Array [], - set: Map {}, + set: Map { + "const" => ImplicitGlobalConstTypeVariable, + }, type: "global", upper: null, - variables: Array [], + variables: Array [ + ImplicitGlobalConstTypeVariable, + ], }, ModuleScope$2 { block: Program$3, @@ -54,14 +59,14 @@ ScopeManager { Reference$1, ], set: Map { - "foo" => Variable$1, - "T" => Variable$2, + "foo" => Variable$2, + "T" => Variable$3, }, type: "module", upper: GlobalScope$1, variables: Array [ - Variable$1, Variable$2, + Variable$3, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/import/type-default.ts.shot b/packages/scope-manager/tests/fixtures/import/type-default.ts.shot index 85b9df61e067..11a150a59a39 100644 --- a/packages/scope-manager/tests/fixtures/import/type-default.ts.shot +++ b/packages/scope-manager/tests/fixtures/import/type-default.ts.shot @@ -3,7 +3,8 @@ exports[`import type-default 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ ImportBindingDefinition$1 { name: Identifier<"T">, @@ -18,7 +19,7 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, Reference$3 { identifier: Identifier<"T">, @@ -26,13 +27,13 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: true, isTypeVariable: true, }, - Variable$2 { + Variable$3 { defs: Array [ TypeDefinition$2 { name: Identifier<"Ref">, @@ -44,7 +45,7 @@ ScopeManager { isValueVariable: false, isTypeVariable: true, }, - Variable$3 { + Variable$4 { defs: Array [ VariableDefinition$3 { name: Identifier<"unresolved">, @@ -60,7 +61,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$3, + resolved: Variable$4, writeExpr: Identifier<"T">, }, ], @@ -73,10 +74,14 @@ ScopeManager { block: Program$4, isStrict: false, references: Array [], - set: Map {}, + set: Map { + "const" => ImplicitGlobalConstTypeVariable, + }, type: "global", upper: null, - variables: Array [], + variables: Array [ + ImplicitGlobalConstTypeVariable, + ], }, ModuleScope$2 { block: Program$4, @@ -87,16 +92,16 @@ ScopeManager { Reference$3, ], set: Map { - "T" => Variable$1, - "Ref" => Variable$2, - "unresolved" => Variable$3, + "T" => Variable$2, + "Ref" => Variable$3, + "unresolved" => Variable$4, }, type: "module", upper: GlobalScope$1, variables: Array [ - Variable$1, Variable$2, Variable$3, + Variable$4, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/import/type-named-value.ts.shot b/packages/scope-manager/tests/fixtures/import/type-named-value.ts.shot index 36fa441cea15..dfaf7fa31ad0 100644 --- a/packages/scope-manager/tests/fixtures/import/type-named-value.ts.shot +++ b/packages/scope-manager/tests/fixtures/import/type-named-value.ts.shot @@ -3,7 +3,8 @@ exports[`import type-named-value 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ ImportBindingDefinition$1 { name: Identifier<"foo">, @@ -18,13 +19,13 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: true, isTypeVariable: true, }, - Variable$2 { + Variable$3 { defs: Array [ TypeDefinition$2 { name: Identifier<"T">, @@ -42,10 +43,14 @@ ScopeManager { block: Program$3, isStrict: false, references: Array [], - set: Map {}, + set: Map { + "const" => ImplicitGlobalConstTypeVariable, + }, type: "global", upper: null, - variables: Array [], + variables: Array [ + ImplicitGlobalConstTypeVariable, + ], }, ModuleScope$2 { block: Program$3, @@ -54,14 +59,14 @@ ScopeManager { Reference$1, ], set: Map { - "foo" => Variable$1, - "T" => Variable$2, + "foo" => Variable$2, + "T" => Variable$3, }, type: "module", upper: GlobalScope$1, variables: Array [ - Variable$1, Variable$2, + Variable$3, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/import/type-named.ts.shot b/packages/scope-manager/tests/fixtures/import/type-named.ts.shot index 6e7a2481f795..ddf3bf95f63a 100644 --- a/packages/scope-manager/tests/fixtures/import/type-named.ts.shot +++ b/packages/scope-manager/tests/fixtures/import/type-named.ts.shot @@ -3,7 +3,8 @@ exports[`import type-named 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ ImportBindingDefinition$1 { name: Identifier<"T">, @@ -18,7 +19,7 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, Reference$3 { identifier: Identifier<"T">, @@ -26,13 +27,13 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: true, isTypeVariable: true, }, - Variable$2 { + Variable$3 { defs: Array [ TypeDefinition$2 { name: Identifier<"Ref">, @@ -44,7 +45,7 @@ ScopeManager { isValueVariable: false, isTypeVariable: true, }, - Variable$3 { + Variable$4 { defs: Array [ VariableDefinition$3 { name: Identifier<"unresovled">, @@ -60,7 +61,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$3, + resolved: Variable$4, writeExpr: Identifier<"T">, }, ], @@ -73,10 +74,14 @@ ScopeManager { block: Program$4, isStrict: false, references: Array [], - set: Map {}, + set: Map { + "const" => ImplicitGlobalConstTypeVariable, + }, type: "global", upper: null, - variables: Array [], + variables: Array [ + ImplicitGlobalConstTypeVariable, + ], }, ModuleScope$2 { block: Program$4, @@ -87,16 +92,16 @@ ScopeManager { Reference$3, ], set: Map { - "T" => Variable$1, - "Ref" => Variable$2, - "unresovled" => Variable$3, + "T" => Variable$2, + "Ref" => Variable$3, + "unresovled" => Variable$4, }, type: "module", upper: GlobalScope$1, variables: Array [ - Variable$1, Variable$2, Variable$3, + Variable$4, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/jsx/attribute-spread.tsx.shot b/packages/scope-manager/tests/fixtures/jsx/attribute-spread.tsx.shot index fd34f473d78d..df4f72b6ffe8 100644 --- a/packages/scope-manager/tests/fixtures/jsx/attribute-spread.tsx.shot +++ b/packages/scope-manager/tests/fixtures/jsx/attribute-spread.tsx.shot @@ -3,7 +3,8 @@ exports[`jsx attribute-spread 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ VariableDefinition$1 { name: Identifier<"x">, @@ -19,7 +20,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$1, + resolved: Variable$2, writeExpr: ObjectExpression$2, }, Reference$3 { @@ -28,7 +29,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: true, @@ -52,12 +53,14 @@ ScopeManager { Reference$3, ], set: Map { - "x" => Variable$1, + "const" => ImplicitGlobalConstTypeVariable, + "x" => Variable$2, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, + Variable$2, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/jsx/attribute.tsx.shot b/packages/scope-manager/tests/fixtures/jsx/attribute.tsx.shot index a87647863181..c9a7d3e1ea79 100644 --- a/packages/scope-manager/tests/fixtures/jsx/attribute.tsx.shot +++ b/packages/scope-manager/tests/fixtures/jsx/attribute.tsx.shot @@ -3,7 +3,8 @@ exports[`jsx attribute 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ VariableDefinition$1 { name: Identifier<"x">, @@ -19,7 +20,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$1, + resolved: Variable$2, writeExpr: Literal$2, }, Reference$4 { @@ -28,13 +29,13 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$2 { + Variable$3 { defs: Array [ VariableDefinition$2 { name: Identifier<"attr">, @@ -50,7 +51,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$2, + resolved: Variable$3, writeExpr: Literal$4, }, ], @@ -76,14 +77,16 @@ ScopeManager { Reference$4, ], set: Map { - "x" => Variable$1, - "attr" => Variable$2, + "const" => ImplicitGlobalConstTypeVariable, + "x" => Variable$2, + "attr" => Variable$3, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, Variable$2, + Variable$3, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/jsx/children.tsx.shot b/packages/scope-manager/tests/fixtures/jsx/children.tsx.shot index 9fc1dfb49539..65e4f3202314 100644 --- a/packages/scope-manager/tests/fixtures/jsx/children.tsx.shot +++ b/packages/scope-manager/tests/fixtures/jsx/children.tsx.shot @@ -3,7 +3,8 @@ exports[`jsx children 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ VariableDefinition$1 { name: Identifier<"child">, @@ -19,7 +20,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$1, + resolved: Variable$2, writeExpr: Literal$2, }, Reference$3 { @@ -28,7 +29,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: true, @@ -60,12 +61,14 @@ ScopeManager { }, ], set: Map { - "child" => Variable$1, + "const" => ImplicitGlobalConstTypeVariable, + "child" => Variable$2, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, + Variable$2, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/jsx/component-namespaced.tsx.shot b/packages/scope-manager/tests/fixtures/jsx/component-namespaced.tsx.shot index c5bc7eb9d4e3..5a3d3327032a 100644 --- a/packages/scope-manager/tests/fixtures/jsx/component-namespaced.tsx.shot +++ b/packages/scope-manager/tests/fixtures/jsx/component-namespaced.tsx.shot @@ -3,7 +3,8 @@ exports[`jsx component-namespaced 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ VariableDefinition$1 { name: Identifier<"X">, @@ -19,7 +20,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$1, + resolved: Variable$2, writeExpr: ObjectExpression$2, }, Reference$3 { @@ -28,20 +29,20 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$2 { + Variable$3 { defs: Array [], name: "arguments", references: Array [], isValueVariable: true, isTypeVariable: true, }, - Variable$3 { + Variable$4 { defs: Array [ VariableDefinition$2 { name: Identifier<"Foo">, @@ -57,7 +58,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$3, + resolved: Variable$4, writeExpr: Literal$5, }, ], @@ -75,14 +76,16 @@ ScopeManager { Reference$3, ], set: Map { - "X" => Variable$1, - "Foo" => Variable$3, + "const" => ImplicitGlobalConstTypeVariable, + "X" => Variable$2, + "Foo" => Variable$4, }, type: "global", upper: null, variables: Array [ - Variable$1, - Variable$3, + ImplicitGlobalConstTypeVariable, + Variable$2, + Variable$4, ], }, FunctionScope$2 { @@ -90,12 +93,12 @@ ScopeManager { isStrict: false, references: Array [], set: Map { - "arguments" => Variable$2, + "arguments" => Variable$3, }, type: "function", upper: GlobalScope$1, variables: Array [ - Variable$2, + Variable$3, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/jsx/component.tsx.shot b/packages/scope-manager/tests/fixtures/jsx/component.tsx.shot index a37331e7f7e3..90dfd10b7ec2 100644 --- a/packages/scope-manager/tests/fixtures/jsx/component.tsx.shot +++ b/packages/scope-manager/tests/fixtures/jsx/component.tsx.shot @@ -3,7 +3,8 @@ exports[`jsx component 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ FunctionNameDefinition$1 { name: Identifier<"Foo">, @@ -18,13 +19,13 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$2 { + Variable$3 { defs: Array [], name: "arguments", references: Array [], @@ -40,12 +41,14 @@ ScopeManager { Reference$1, ], set: Map { - "Foo" => Variable$1, + "const" => ImplicitGlobalConstTypeVariable, + "Foo" => Variable$2, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, + Variable$2, ], }, FunctionScope$2 { @@ -53,12 +56,12 @@ ScopeManager { isStrict: false, references: Array [], set: Map { - "arguments" => Variable$2, + "arguments" => Variable$3, }, type: "function", upper: GlobalScope$1, variables: Array [ - Variable$2, + Variable$3, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/jsx/factory/default-jsxFragmentName.tsx.shot b/packages/scope-manager/tests/fixtures/jsx/factory/default-jsxFragmentName.tsx.shot index 76e5b24ecc8d..182c52b0606a 100644 --- a/packages/scope-manager/tests/fixtures/jsx/factory/default-jsxFragmentName.tsx.shot +++ b/packages/scope-manager/tests/fixtures/jsx/factory/default-jsxFragmentName.tsx.shot @@ -3,7 +3,8 @@ exports[`jsx factory default-jsxFragmentName 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ ImportBindingDefinition$1 { name: Identifier<"React">, @@ -18,13 +19,13 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: true, isTypeVariable: true, }, - Variable$2 { + Variable$3 { defs: Array [ ImportBindingDefinition$2 { name: Identifier<"Fragment">, @@ -42,10 +43,14 @@ ScopeManager { block: Program$3, isStrict: false, references: Array [], - set: Map {}, + set: Map { + "const" => ImplicitGlobalConstTypeVariable, + }, type: "global", upper: null, - variables: Array [], + variables: Array [ + ImplicitGlobalConstTypeVariable, + ], }, ModuleScope$2 { block: Program$3, @@ -54,14 +59,14 @@ ScopeManager { Reference$1, ], set: Map { - "React" => Variable$1, - "Fragment" => Variable$2, + "React" => Variable$2, + "Fragment" => Variable$3, }, type: "module", upper: GlobalScope$1, variables: Array [ - Variable$1, Variable$2, + Variable$3, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/jsx/factory/default-jsxPragma-fragment.tsx.shot b/packages/scope-manager/tests/fixtures/jsx/factory/default-jsxPragma-fragment.tsx.shot index 4b7ea0925e15..cdae17be19f9 100644 --- a/packages/scope-manager/tests/fixtures/jsx/factory/default-jsxPragma-fragment.tsx.shot +++ b/packages/scope-manager/tests/fixtures/jsx/factory/default-jsxPragma-fragment.tsx.shot @@ -3,7 +3,8 @@ exports[`jsx factory default-jsxPragma-fragment 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ ImportBindingDefinition$1 { name: Identifier<"React">, @@ -18,7 +19,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: true, @@ -30,10 +31,14 @@ ScopeManager { block: Program$2, isStrict: false, references: Array [], - set: Map {}, + set: Map { + "const" => ImplicitGlobalConstTypeVariable, + }, type: "global", upper: null, - variables: Array [], + variables: Array [ + ImplicitGlobalConstTypeVariable, + ], }, ModuleScope$2 { block: Program$2, @@ -42,12 +47,12 @@ ScopeManager { Reference$1, ], set: Map { - "React" => Variable$1, + "React" => Variable$2, }, type: "module", upper: GlobalScope$1, variables: Array [ - Variable$1, + Variable$2, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/jsx/factory/default-jsxPragma.tsx.shot b/packages/scope-manager/tests/fixtures/jsx/factory/default-jsxPragma.tsx.shot index 4c7c51c772e8..48c3476764e9 100644 --- a/packages/scope-manager/tests/fixtures/jsx/factory/default-jsxPragma.tsx.shot +++ b/packages/scope-manager/tests/fixtures/jsx/factory/default-jsxPragma.tsx.shot @@ -3,7 +3,8 @@ exports[`jsx factory default-jsxPragma 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ ImportBindingDefinition$1 { name: Identifier<"React">, @@ -18,7 +19,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: true, @@ -30,10 +31,14 @@ ScopeManager { block: Program$2, isStrict: false, references: Array [], - set: Map {}, + set: Map { + "const" => ImplicitGlobalConstTypeVariable, + }, type: "global", upper: null, - variables: Array [], + variables: Array [ + ImplicitGlobalConstTypeVariable, + ], }, ModuleScope$2 { block: Program$2, @@ -50,12 +55,12 @@ ScopeManager { }, ], set: Map { - "React" => Variable$1, + "React" => Variable$2, }, type: "module", upper: GlobalScope$1, variables: Array [ - Variable$1, + Variable$2, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/jsx/factory/jsxFragmentName.tsx.shot b/packages/scope-manager/tests/fixtures/jsx/factory/jsxFragmentName.tsx.shot index 8392610d9a68..80777e67185c 100644 --- a/packages/scope-manager/tests/fixtures/jsx/factory/jsxFragmentName.tsx.shot +++ b/packages/scope-manager/tests/fixtures/jsx/factory/jsxFragmentName.tsx.shot @@ -3,7 +3,8 @@ exports[`jsx factory jsxFragmentName 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ ImportBindingDefinition$1 { name: Identifier<"React">, @@ -18,13 +19,13 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: true, isTypeVariable: true, }, - Variable$2 { + Variable$3 { defs: Array [ ImportBindingDefinition$2 { name: Identifier<"Fragment">, @@ -39,7 +40,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$2, + resolved: Variable$3, }, ], isValueVariable: true, @@ -51,10 +52,14 @@ ScopeManager { block: Program$3, isStrict: false, references: Array [], - set: Map {}, + set: Map { + "const" => ImplicitGlobalConstTypeVariable, + }, type: "global", upper: null, - variables: Array [], + variables: Array [ + ImplicitGlobalConstTypeVariable, + ], }, ModuleScope$2 { block: Program$3, @@ -64,14 +69,14 @@ ScopeManager { Reference$2, ], set: Map { - "React" => Variable$1, - "Fragment" => Variable$2, + "React" => Variable$2, + "Fragment" => Variable$3, }, type: "module", upper: GlobalScope$1, variables: Array [ - Variable$1, Variable$2, + Variable$3, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/jsx/factory/jsxPragma-jsxFragmentName.tsx.shot b/packages/scope-manager/tests/fixtures/jsx/factory/jsxPragma-jsxFragmentName.tsx.shot index 5dc43c1d89f7..d59f6526fc5f 100644 --- a/packages/scope-manager/tests/fixtures/jsx/factory/jsxPragma-jsxFragmentName.tsx.shot +++ b/packages/scope-manager/tests/fixtures/jsx/factory/jsxPragma-jsxFragmentName.tsx.shot @@ -3,7 +3,8 @@ exports[`jsx factory jsxPragma-jsxFragmentName 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ ImportBindingDefinition$1 { name: Identifier<"React">, @@ -15,7 +16,7 @@ ScopeManager { isValueVariable: true, isTypeVariable: true, }, - Variable$2 { + Variable$3 { defs: Array [ ImportBindingDefinition$2 { name: Identifier<"h">, @@ -30,13 +31,13 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$2, + resolved: Variable$3, }, ], isValueVariable: true, isTypeVariable: true, }, - Variable$3 { + Variable$4 { defs: Array [ ImportBindingDefinition$3 { name: Identifier<"Fragment">, @@ -51,7 +52,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$3, + resolved: Variable$4, }, ], isValueVariable: true, @@ -63,10 +64,14 @@ ScopeManager { block: Program$4, isStrict: false, references: Array [], - set: Map {}, + set: Map { + "const" => ImplicitGlobalConstTypeVariable, + }, type: "global", upper: null, - variables: Array [], + variables: Array [ + ImplicitGlobalConstTypeVariable, + ], }, ModuleScope$2 { block: Program$4, @@ -76,16 +81,16 @@ ScopeManager { Reference$2, ], set: Map { - "React" => Variable$1, - "h" => Variable$2, - "Fragment" => Variable$3, + "React" => Variable$2, + "h" => Variable$3, + "Fragment" => Variable$4, }, type: "module", upper: GlobalScope$1, variables: Array [ - Variable$1, Variable$2, Variable$3, + Variable$4, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/jsx/factory/jsxPragma.tsx.shot b/packages/scope-manager/tests/fixtures/jsx/factory/jsxPragma.tsx.shot index 1fb48ba9b059..6f2580a0950a 100644 --- a/packages/scope-manager/tests/fixtures/jsx/factory/jsxPragma.tsx.shot +++ b/packages/scope-manager/tests/fixtures/jsx/factory/jsxPragma.tsx.shot @@ -3,7 +3,8 @@ exports[`jsx factory jsxPragma 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ ImportBindingDefinition$1 { name: Identifier<"React">, @@ -15,7 +16,7 @@ ScopeManager { isValueVariable: true, isTypeVariable: true, }, - Variable$2 { + Variable$3 { defs: Array [ ImportBindingDefinition$2 { name: Identifier<"h">, @@ -30,7 +31,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$2, + resolved: Variable$3, }, ], isValueVariable: true, @@ -42,10 +43,14 @@ ScopeManager { block: Program$3, isStrict: false, references: Array [], - set: Map {}, + set: Map { + "const" => ImplicitGlobalConstTypeVariable, + }, type: "global", upper: null, - variables: Array [], + variables: Array [ + ImplicitGlobalConstTypeVariable, + ], }, ModuleScope$2 { block: Program$3, @@ -62,14 +67,14 @@ ScopeManager { }, ], set: Map { - "React" => Variable$1, - "h" => Variable$2, + "React" => Variable$2, + "h" => Variable$3, }, type: "module", upper: GlobalScope$1, variables: Array [ - Variable$1, Variable$2, + Variable$3, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/jsx/fragment-children.tsx.shot b/packages/scope-manager/tests/fixtures/jsx/fragment-children.tsx.shot index ada53e07e796..69a035379a99 100644 --- a/packages/scope-manager/tests/fixtures/jsx/fragment-children.tsx.shot +++ b/packages/scope-manager/tests/fixtures/jsx/fragment-children.tsx.shot @@ -3,7 +3,8 @@ exports[`jsx fragment-children 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ VariableDefinition$1 { name: Identifier<"child">, @@ -19,7 +20,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$1, + resolved: Variable$2, writeExpr: Literal$2, }, Reference$2 { @@ -28,7 +29,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: true, @@ -44,12 +45,14 @@ ScopeManager { Reference$2, ], set: Map { - "child" => Variable$1, + "const" => ImplicitGlobalConstTypeVariable, + "child" => Variable$2, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, + Variable$2, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/jsx/fragment.tsx.shot b/packages/scope-manager/tests/fixtures/jsx/fragment.tsx.shot index 7bf20feb1aad..77342297d2c9 100644 --- a/packages/scope-manager/tests/fixtures/jsx/fragment.tsx.shot +++ b/packages/scope-manager/tests/fixtures/jsx/fragment.tsx.shot @@ -2,16 +2,22 @@ exports[`jsx fragment 1`] = ` ScopeManager { - variables: Array [], + variables: Array [ + ImplicitGlobalConstTypeVariable, + ], scopes: Array [ GlobalScope$1 { block: Program$1, isStrict: false, references: Array [], - set: Map {}, + set: Map { + "const" => ImplicitGlobalConstTypeVariable, + }, type: "global", upper: null, - variables: Array [], + variables: Array [ + ImplicitGlobalConstTypeVariable, + ], }, ], } diff --git a/packages/scope-manager/tests/fixtures/jsx/generic-type-param.tsx.shot b/packages/scope-manager/tests/fixtures/jsx/generic-type-param.tsx.shot index 1ea1b8dbca3a..a7b995fd461e 100644 --- a/packages/scope-manager/tests/fixtures/jsx/generic-type-param.tsx.shot +++ b/packages/scope-manager/tests/fixtures/jsx/generic-type-param.tsx.shot @@ -3,7 +3,8 @@ exports[`jsx generic-type-param 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ TypeDefinition$1 { name: Identifier<"T">, @@ -18,7 +19,7 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: false, @@ -41,12 +42,14 @@ ScopeManager { Reference$2, ], set: Map { - "T" => Variable$1, + "const" => ImplicitGlobalConstTypeVariable, + "T" => Variable$2, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, + Variable$2, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/jsx/text.tsx.shot b/packages/scope-manager/tests/fixtures/jsx/text.tsx.shot index b901d67292f1..6d52dea69199 100644 --- a/packages/scope-manager/tests/fixtures/jsx/text.tsx.shot +++ b/packages/scope-manager/tests/fixtures/jsx/text.tsx.shot @@ -3,7 +3,8 @@ exports[`jsx text 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ VariableDefinition$1 { name: Identifier<"Foo">, @@ -19,7 +20,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$1, + resolved: Variable$2, writeExpr: Literal$2, }, ], @@ -35,12 +36,14 @@ ScopeManager { Reference$1, ], set: Map { - "Foo" => Variable$1, + "const" => ImplicitGlobalConstTypeVariable, + "Foo" => Variable$2, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, + Variable$2, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/member-expression/member-expression.ts.shot b/packages/scope-manager/tests/fixtures/member-expression/member-expression.ts.shot index 76781a28ff28..3608c5d5d2b2 100644 --- a/packages/scope-manager/tests/fixtures/member-expression/member-expression.ts.shot +++ b/packages/scope-manager/tests/fixtures/member-expression/member-expression.ts.shot @@ -3,7 +3,8 @@ exports[`member-expression member-expression 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ VariableDefinition$1 { name: Identifier<"x">, @@ -19,7 +20,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$1, + resolved: Variable$2, writeExpr: ObjectExpression$2, }, Reference$2 { @@ -28,7 +29,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, Reference$3 { identifier: Identifier<"x">, @@ -36,7 +37,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, Reference$4 { identifier: Identifier<"x">, @@ -44,7 +45,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, Reference$5 { identifier: Identifier<"x">, @@ -52,7 +53,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, Reference$6 { identifier: Identifier<"x">, @@ -60,7 +61,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: true, @@ -80,12 +81,14 @@ ScopeManager { Reference$6, ], set: Map { - "x" => Variable$1, + "const" => ImplicitGlobalConstTypeVariable, + "x" => Variable$2, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, + Variable$2, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/new-expression/new-expression.ts.shot b/packages/scope-manager/tests/fixtures/new-expression/new-expression.ts.shot index 8a5ce2b6dbbd..36106a8eeba5 100644 --- a/packages/scope-manager/tests/fixtures/new-expression/new-expression.ts.shot +++ b/packages/scope-manager/tests/fixtures/new-expression/new-expression.ts.shot @@ -3,7 +3,8 @@ exports[`new-expression new-expression 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ ClassNameDefinition$1 { name: Identifier<"Foo">, @@ -18,13 +19,13 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: true, isTypeVariable: true, }, - Variable$2 { + Variable$3 { defs: Array [ ClassNameDefinition$2 { name: Identifier<"Foo">, @@ -36,7 +37,7 @@ ScopeManager { isValueVariable: true, isTypeVariable: true, }, - Variable$3 { + Variable$4 { defs: Array [ VariableDefinition$3 { name: Identifier<"a">, @@ -52,7 +53,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$3, + resolved: Variable$4, writeExpr: Literal$3, }, Reference$3 { @@ -61,7 +62,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$3, + resolved: Variable$4, }, ], isValueVariable: true, @@ -78,14 +79,16 @@ ScopeManager { Reference$3, ], set: Map { - "Foo" => Variable$1, - "a" => Variable$3, + "const" => ImplicitGlobalConstTypeVariable, + "Foo" => Variable$2, + "a" => Variable$4, }, type: "global", upper: null, variables: Array [ - Variable$1, - Variable$3, + ImplicitGlobalConstTypeVariable, + Variable$2, + Variable$4, ], }, ClassScope$2 { @@ -93,12 +96,12 @@ ScopeManager { isStrict: true, references: Array [], set: Map { - "Foo" => Variable$2, + "Foo" => Variable$3, }, type: "class", upper: GlobalScope$1, variables: Array [ - Variable$2, + Variable$3, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/new-expression/type-parameters1.ts.shot b/packages/scope-manager/tests/fixtures/new-expression/type-parameters1.ts.shot index e3cbeb7690c8..cc469c9d4c6a 100644 --- a/packages/scope-manager/tests/fixtures/new-expression/type-parameters1.ts.shot +++ b/packages/scope-manager/tests/fixtures/new-expression/type-parameters1.ts.shot @@ -3,7 +3,8 @@ exports[`new-expression type-parameters1 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ TypeDefinition$1 { name: Identifier<"T">, @@ -18,7 +19,7 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: false, @@ -41,12 +42,14 @@ ScopeManager { Reference$2, ], set: Map { - "T" => Variable$1, + "const" => ImplicitGlobalConstTypeVariable, + "T" => Variable$2, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, + Variable$2, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/new-expression/type-parameters2.ts.shot b/packages/scope-manager/tests/fixtures/new-expression/type-parameters2.ts.shot index 60018fe8023b..ac28701d4f45 100644 --- a/packages/scope-manager/tests/fixtures/new-expression/type-parameters2.ts.shot +++ b/packages/scope-manager/tests/fixtures/new-expression/type-parameters2.ts.shot @@ -3,7 +3,8 @@ exports[`new-expression type-parameters2 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ VariableDefinition$1 { name: Identifier<"T">, @@ -19,7 +20,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$1, + resolved: Variable$2, writeExpr: Literal$2, }, ], @@ -51,12 +52,14 @@ ScopeManager { }, ], set: Map { - "T" => Variable$1, + "const" => ImplicitGlobalConstTypeVariable, + "T" => Variable$2, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, + Variable$2, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/ts-enum/external-ref.ts.shot b/packages/scope-manager/tests/fixtures/ts-enum/external-ref.ts.shot index e07b4f0b7d42..5a4aec35a3ab 100644 --- a/packages/scope-manager/tests/fixtures/ts-enum/external-ref.ts.shot +++ b/packages/scope-manager/tests/fixtures/ts-enum/external-ref.ts.shot @@ -3,7 +3,8 @@ exports[`ts-enum external-ref 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ TSEnumNameDefinition$1 { name: Identifier<"Foo">, @@ -18,13 +19,13 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: true, isTypeVariable: true, }, - Variable$2 { + Variable$3 { defs: Array [ TSEnumNameDefinition$2 { name: Identifier<"Foo">, @@ -36,7 +37,7 @@ ScopeManager { isValueVariable: true, isTypeVariable: true, }, - Variable$3 { + Variable$4 { defs: Array [ TSEnumMemberDefinition$3 { name: Identifier<"a">, @@ -57,12 +58,14 @@ ScopeManager { Reference$1, ], set: Map { - "Foo" => Variable$1, + "const" => ImplicitGlobalConstTypeVariable, + "Foo" => Variable$2, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, + Variable$2, ], }, TSEnumScope$2 { @@ -70,14 +73,14 @@ ScopeManager { isStrict: true, references: Array [], set: Map { - "Foo" => Variable$2, - "a" => Variable$3, + "Foo" => Variable$3, + "a" => Variable$4, }, type: "tsEnum", upper: GlobalScope$1, variables: Array [ - Variable$2, Variable$3, + Variable$4, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/ts-enum/literal-member-ref.ts.shot b/packages/scope-manager/tests/fixtures/ts-enum/literal-member-ref.ts.shot index 060d79c5969a..32f15eba2e5d 100644 --- a/packages/scope-manager/tests/fixtures/ts-enum/literal-member-ref.ts.shot +++ b/packages/scope-manager/tests/fixtures/ts-enum/literal-member-ref.ts.shot @@ -3,7 +3,8 @@ exports[`ts-enum literal-member-ref 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ TSEnumNameDefinition$1 { name: Identifier<"Foo">, @@ -15,7 +16,7 @@ ScopeManager { isValueVariable: true, isTypeVariable: true, }, - Variable$2 { + Variable$3 { defs: Array [ TSEnumNameDefinition$2 { name: Identifier<"Foo">, @@ -27,7 +28,7 @@ ScopeManager { isValueVariable: true, isTypeVariable: true, }, - Variable$3 { + Variable$4 { defs: Array [ TSEnumMemberDefinition$3 { name: Literal$2, @@ -42,13 +43,13 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$3, + resolved: Variable$4, }, ], isValueVariable: true, isTypeVariable: true, }, - Variable$4 { + Variable$5 { defs: Array [ TSEnumMemberDefinition$4 { name: Identifier<"b">, @@ -67,12 +68,14 @@ ScopeManager { isStrict: false, references: Array [], set: Map { - "Foo" => Variable$1, + "const" => ImplicitGlobalConstTypeVariable, + "Foo" => Variable$2, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, + Variable$2, ], }, TSEnumScope$2 { @@ -82,16 +85,16 @@ ScopeManager { Reference$1, ], set: Map { - "Foo" => Variable$2, - "a" => Variable$3, - "b" => Variable$4, + "Foo" => Variable$3, + "a" => Variable$4, + "b" => Variable$5, }, type: "tsEnum", upper: GlobalScope$1, variables: Array [ - Variable$2, Variable$3, Variable$4, + Variable$5, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/ts-enum/literal-member.ts.shot b/packages/scope-manager/tests/fixtures/ts-enum/literal-member.ts.shot index 3f4f338384ba..3ed420ea4b77 100644 --- a/packages/scope-manager/tests/fixtures/ts-enum/literal-member.ts.shot +++ b/packages/scope-manager/tests/fixtures/ts-enum/literal-member.ts.shot @@ -3,7 +3,8 @@ exports[`ts-enum literal-member 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ TSEnumNameDefinition$1 { name: Identifier<"Foo">, @@ -15,7 +16,7 @@ ScopeManager { isValueVariable: true, isTypeVariable: true, }, - Variable$2 { + Variable$3 { defs: Array [ TSEnumNameDefinition$2 { name: Identifier<"Foo">, @@ -27,7 +28,7 @@ ScopeManager { isValueVariable: true, isTypeVariable: true, }, - Variable$3 { + Variable$4 { defs: Array [ TSEnumMemberDefinition$3 { name: Literal$2, @@ -46,12 +47,14 @@ ScopeManager { isStrict: false, references: Array [], set: Map { - "Foo" => Variable$1, + "const" => ImplicitGlobalConstTypeVariable, + "Foo" => Variable$2, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, + Variable$2, ], }, TSEnumScope$2 { @@ -59,14 +62,14 @@ ScopeManager { isStrict: true, references: Array [], set: Map { - "Foo" => Variable$2, - "a" => Variable$3, + "Foo" => Variable$3, + "a" => Variable$4, }, type: "tsEnum", upper: GlobalScope$1, variables: Array [ - Variable$2, Variable$3, + Variable$4, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/ts-enum/member-ref.ts.shot b/packages/scope-manager/tests/fixtures/ts-enum/member-ref.ts.shot index d69e03593055..65057dbd1030 100644 --- a/packages/scope-manager/tests/fixtures/ts-enum/member-ref.ts.shot +++ b/packages/scope-manager/tests/fixtures/ts-enum/member-ref.ts.shot @@ -3,7 +3,8 @@ exports[`ts-enum member-ref 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ TSEnumNameDefinition$1 { name: Identifier<"Foo">, @@ -15,7 +16,7 @@ ScopeManager { isValueVariable: true, isTypeVariable: true, }, - Variable$2 { + Variable$3 { defs: Array [ TSEnumNameDefinition$2 { name: Identifier<"Foo">, @@ -27,7 +28,7 @@ ScopeManager { isValueVariable: true, isTypeVariable: true, }, - Variable$3 { + Variable$4 { defs: Array [ TSEnumMemberDefinition$3 { name: Identifier<"a">, @@ -42,13 +43,13 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$3, + resolved: Variable$4, }, ], isValueVariable: true, isTypeVariable: true, }, - Variable$4 { + Variable$5 { defs: Array [ TSEnumMemberDefinition$4 { name: Identifier<"b">, @@ -67,12 +68,14 @@ ScopeManager { isStrict: false, references: Array [], set: Map { - "Foo" => Variable$1, + "const" => ImplicitGlobalConstTypeVariable, + "Foo" => Variable$2, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, + Variable$2, ], }, TSEnumScope$2 { @@ -82,16 +85,16 @@ ScopeManager { Reference$1, ], set: Map { - "Foo" => Variable$2, - "a" => Variable$3, - "b" => Variable$4, + "Foo" => Variable$3, + "a" => Variable$4, + "b" => Variable$5, }, type: "tsEnum", upper: GlobalScope$1, variables: Array [ - Variable$2, Variable$3, Variable$4, + Variable$5, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/ts-enum/scope.ts.shot b/packages/scope-manager/tests/fixtures/ts-enum/scope.ts.shot index f4dca3fd04c9..d355ac577515 100644 --- a/packages/scope-manager/tests/fixtures/ts-enum/scope.ts.shot +++ b/packages/scope-manager/tests/fixtures/ts-enum/scope.ts.shot @@ -3,7 +3,8 @@ exports[`ts-enum scope 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ TSEnumNameDefinition$1 { name: Identifier<"Foo">, @@ -15,7 +16,7 @@ ScopeManager { isValueVariable: true, isTypeVariable: true, }, - Variable$2 { + Variable$3 { defs: Array [ TSEnumNameDefinition$2 { name: Identifier<"Foo">, @@ -27,7 +28,7 @@ ScopeManager { isValueVariable: true, isTypeVariable: true, }, - Variable$3 { + Variable$4 { defs: Array [ TSEnumMemberDefinition$3 { name: Identifier<"a">, @@ -39,7 +40,7 @@ ScopeManager { isValueVariable: true, isTypeVariable: true, }, - Variable$4 { + Variable$5 { defs: Array [ VariableDefinition$4 { name: Identifier<"unresolved">, @@ -55,7 +56,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$4, + resolved: Variable$5, writeExpr: Identifier<"a">, }, ], @@ -79,14 +80,16 @@ ScopeManager { }, ], set: Map { - "Foo" => Variable$1, - "unresolved" => Variable$4, + "const" => ImplicitGlobalConstTypeVariable, + "Foo" => Variable$2, + "unresolved" => Variable$5, }, type: "global", upper: null, variables: Array [ - Variable$1, - Variable$4, + ImplicitGlobalConstTypeVariable, + Variable$2, + Variable$5, ], }, TSEnumScope$2 { @@ -94,14 +97,14 @@ ScopeManager { isStrict: true, references: Array [], set: Map { - "Foo" => Variable$2, - "a" => Variable$3, + "Foo" => Variable$3, + "a" => Variable$4, }, type: "tsEnum", upper: GlobalScope$1, variables: Array [ - Variable$2, Variable$3, + Variable$4, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/ts-enum/self-ref.ts.shot b/packages/scope-manager/tests/fixtures/ts-enum/self-ref.ts.shot index d34fa02081b3..3222c89d467c 100644 --- a/packages/scope-manager/tests/fixtures/ts-enum/self-ref.ts.shot +++ b/packages/scope-manager/tests/fixtures/ts-enum/self-ref.ts.shot @@ -3,7 +3,8 @@ exports[`ts-enum self-ref 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ TSEnumNameDefinition$1 { name: Identifier<"Foo">, @@ -15,7 +16,7 @@ ScopeManager { isValueVariable: true, isTypeVariable: true, }, - Variable$2 { + Variable$3 { defs: Array [ TSEnumNameDefinition$2 { name: Identifier<"Foo">, @@ -30,13 +31,13 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$2, + resolved: Variable$3, }, ], isValueVariable: true, isTypeVariable: true, }, - Variable$3 { + Variable$4 { defs: Array [ TSEnumMemberDefinition$3 { name: Identifier<"a">, @@ -48,7 +49,7 @@ ScopeManager { isValueVariable: true, isTypeVariable: true, }, - Variable$4 { + Variable$5 { defs: Array [ TSEnumMemberDefinition$4 { name: Identifier<"b">, @@ -67,12 +68,14 @@ ScopeManager { isStrict: false, references: Array [], set: Map { - "Foo" => Variable$1, + "const" => ImplicitGlobalConstTypeVariable, + "Foo" => Variable$2, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, + Variable$2, ], }, TSEnumScope$2 { @@ -82,16 +85,16 @@ ScopeManager { Reference$1, ], set: Map { - "Foo" => Variable$2, - "a" => Variable$3, - "b" => Variable$4, + "Foo" => Variable$3, + "a" => Variable$4, + "b" => Variable$5, }, type: "tsEnum", upper: GlobalScope$1, variables: Array [ - Variable$2, Variable$3, Variable$4, + Variable$5, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/ts-module/declaration-merging/class-namespace.ts.shot b/packages/scope-manager/tests/fixtures/ts-module/declaration-merging/class-namespace.ts.shot index b59249012f99..d99112e93f93 100644 --- a/packages/scope-manager/tests/fixtures/ts-module/declaration-merging/class-namespace.ts.shot +++ b/packages/scope-manager/tests/fixtures/ts-module/declaration-merging/class-namespace.ts.shot @@ -3,7 +3,8 @@ exports[`ts-module declaration-merging class-namespace 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ ClassNameDefinition$1 { name: Identifier<"Foo">, @@ -22,13 +23,13 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: true, isTypeVariable: true, }, - Variable$2 { + Variable$3 { defs: Array [ ClassNameDefinition$2 { name: Identifier<"Foo">, @@ -40,7 +41,7 @@ ScopeManager { isValueVariable: true, isTypeVariable: true, }, - Variable$3 { + Variable$4 { defs: Array [ VariableDefinition$4 { name: Identifier<"x">, @@ -56,14 +57,14 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$3, + resolved: Variable$4, writeExpr: Literal$4, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$4 { + Variable$5 { defs: Array [ VariableDefinition$5 { name: Identifier<"usage">, @@ -79,7 +80,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$4, + resolved: Variable$5, writeExpr: Identifier<"Foo">, }, ], @@ -96,14 +97,16 @@ ScopeManager { Reference$3, ], set: Map { - "Foo" => Variable$1, - "usage" => Variable$4, + "const" => ImplicitGlobalConstTypeVariable, + "Foo" => Variable$2, + "usage" => Variable$5, }, type: "global", upper: null, variables: Array [ - Variable$1, - Variable$4, + ImplicitGlobalConstTypeVariable, + Variable$2, + Variable$5, ], }, ClassScope$2 { @@ -111,12 +114,12 @@ ScopeManager { isStrict: true, references: Array [], set: Map { - "Foo" => Variable$2, + "Foo" => Variable$3, }, type: "class", upper: GlobalScope$1, variables: Array [ - Variable$2, + Variable$3, ], }, TSModuleScope$3 { @@ -126,12 +129,12 @@ ScopeManager { Reference$1, ], set: Map { - "x" => Variable$3, + "x" => Variable$4, }, type: "tsModule", upper: GlobalScope$1, variables: Array [ - Variable$3, + Variable$4, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/ts-module/declaration-merging/function-namespace.ts.shot b/packages/scope-manager/tests/fixtures/ts-module/declaration-merging/function-namespace.ts.shot index 69c4d2644aab..67258fa0278e 100644 --- a/packages/scope-manager/tests/fixtures/ts-module/declaration-merging/function-namespace.ts.shot +++ b/packages/scope-manager/tests/fixtures/ts-module/declaration-merging/function-namespace.ts.shot @@ -3,7 +3,8 @@ exports[`ts-module declaration-merging function-namespace 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ FunctionNameDefinition$1 { name: Identifier<"Foo">, @@ -22,20 +23,20 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: true, isTypeVariable: true, }, - Variable$2 { + Variable$3 { defs: Array [], name: "arguments", references: Array [], isValueVariable: true, isTypeVariable: true, }, - Variable$3 { + Variable$4 { defs: Array [ VariableDefinition$3 { name: Identifier<"x">, @@ -51,14 +52,14 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$3, + resolved: Variable$4, writeExpr: Literal$4, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$4 { + Variable$5 { defs: Array [ VariableDefinition$4 { name: Identifier<"usage">, @@ -74,7 +75,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$4, + resolved: Variable$5, writeExpr: Identifier<"Foo">, }, ], @@ -91,14 +92,16 @@ ScopeManager { Reference$3, ], set: Map { - "Foo" => Variable$1, - "usage" => Variable$4, + "const" => ImplicitGlobalConstTypeVariable, + "Foo" => Variable$2, + "usage" => Variable$5, }, type: "global", upper: null, variables: Array [ - Variable$1, - Variable$4, + ImplicitGlobalConstTypeVariable, + Variable$2, + Variable$5, ], }, FunctionScope$2 { @@ -106,12 +109,12 @@ ScopeManager { isStrict: false, references: Array [], set: Map { - "arguments" => Variable$2, + "arguments" => Variable$3, }, type: "function", upper: GlobalScope$1, variables: Array [ - Variable$2, + Variable$3, ], }, TSModuleScope$3 { @@ -121,12 +124,12 @@ ScopeManager { Reference$1, ], set: Map { - "x" => Variable$3, + "x" => Variable$4, }, type: "tsModule", upper: GlobalScope$1, variables: Array [ - Variable$3, + Variable$4, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/ts-module/declaration-merging/namespace-variable.ts.shot b/packages/scope-manager/tests/fixtures/ts-module/declaration-merging/namespace-variable.ts.shot index 165232729909..b01a1ed686a3 100644 --- a/packages/scope-manager/tests/fixtures/ts-module/declaration-merging/namespace-variable.ts.shot +++ b/packages/scope-manager/tests/fixtures/ts-module/declaration-merging/namespace-variable.ts.shot @@ -3,7 +3,8 @@ exports[`ts-module declaration-merging namespace-variable 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ TSModuleNameDefinition$1 { name: Identifier<"Foo">, @@ -23,7 +24,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$1, + resolved: Variable$2, writeExpr: Literal$3, }, Reference$3 { @@ -32,13 +33,13 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: true, isTypeVariable: true, }, - Variable$2 { + Variable$3 { defs: Array [ VariableDefinition$3 { name: Identifier<"usage">, @@ -54,7 +55,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$2, + resolved: Variable$3, writeExpr: Identifier<"Foo">, }, ], @@ -72,14 +73,16 @@ ScopeManager { Reference$3, ], set: Map { - "Foo" => Variable$1, - "usage" => Variable$2, + "const" => ImplicitGlobalConstTypeVariable, + "Foo" => Variable$2, + "usage" => Variable$3, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, Variable$2, + Variable$3, ], }, TSModuleScope$2 { diff --git a/packages/scope-manager/tests/fixtures/ts-module/external-ref.ts.shot b/packages/scope-manager/tests/fixtures/ts-module/external-ref.ts.shot index 397067a1a747..717be21b8e62 100644 --- a/packages/scope-manager/tests/fixtures/ts-module/external-ref.ts.shot +++ b/packages/scope-manager/tests/fixtures/ts-module/external-ref.ts.shot @@ -3,7 +3,8 @@ exports[`ts-module external-ref 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ TSModuleNameDefinition$1 { name: Identifier<"Foo">, @@ -18,13 +19,13 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: true, isTypeVariable: true, }, - Variable$2 { + Variable$3 { defs: Array [ VariableDefinition$2 { name: Identifier<"x">, @@ -40,7 +41,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$2, + resolved: Variable$3, writeExpr: Literal$3, }, ], @@ -56,12 +57,14 @@ ScopeManager { Reference$2, ], set: Map { - "Foo" => Variable$1, + "const" => ImplicitGlobalConstTypeVariable, + "Foo" => Variable$2, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, + Variable$2, ], }, TSModuleScope$2 { @@ -71,12 +74,12 @@ ScopeManager { Reference$1, ], set: Map { - "x" => Variable$2, + "x" => Variable$3, }, type: "tsModule", upper: GlobalScope$1, variables: Array [ - Variable$2, + Variable$3, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/ts-module/import.ts.shot b/packages/scope-manager/tests/fixtures/ts-module/import.ts.shot index 7ab8ac5e37a6..f28381e40230 100644 --- a/packages/scope-manager/tests/fixtures/ts-module/import.ts.shot +++ b/packages/scope-manager/tests/fixtures/ts-module/import.ts.shot @@ -3,7 +3,8 @@ exports[`ts-module import 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ ImportBindingDefinition$1 { name: Identifier<"bar">, @@ -21,10 +22,14 @@ ScopeManager { block: Program$2, isStrict: false, references: Array [], - set: Map {}, + set: Map { + "const" => ImplicitGlobalConstTypeVariable, + }, type: "global", upper: null, - variables: Array [], + variables: Array [ + ImplicitGlobalConstTypeVariable, + ], }, ModuleScope$2 { block: Program$2, @@ -40,12 +45,12 @@ ScopeManager { isStrict: true, references: Array [], set: Map { - "bar" => Variable$1, + "bar" => Variable$2, }, type: "tsModule", upper: ModuleScope$2, variables: Array [ - Variable$1, + Variable$2, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/ts-module/name-shadowed-in-body.ts.shot b/packages/scope-manager/tests/fixtures/ts-module/name-shadowed-in-body.ts.shot index 8acc3e619692..c26f00fc21b4 100644 --- a/packages/scope-manager/tests/fixtures/ts-module/name-shadowed-in-body.ts.shot +++ b/packages/scope-manager/tests/fixtures/ts-module/name-shadowed-in-body.ts.shot @@ -3,7 +3,8 @@ exports[`ts-module name-shadowed-in-body 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ TSModuleNameDefinition$1 { name: Identifier<"Foo">, @@ -18,13 +19,13 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: true, isTypeVariable: true, }, - Variable$2 { + Variable$3 { defs: Array [ VariableDefinition$2 { name: Identifier<"Foo">, @@ -40,14 +41,14 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$2, + resolved: Variable$3, writeExpr: Literal$3, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$3 { + Variable$4 { defs: Array [ VariableDefinition$3 { name: Identifier<"usage">, @@ -63,7 +64,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$3, + resolved: Variable$4, writeExpr: Identifier<"Foo">, }, ], @@ -80,14 +81,16 @@ ScopeManager { Reference$3, ], set: Map { - "Foo" => Variable$1, - "usage" => Variable$3, + "const" => ImplicitGlobalConstTypeVariable, + "Foo" => Variable$2, + "usage" => Variable$4, }, type: "global", upper: null, variables: Array [ - Variable$1, - Variable$3, + ImplicitGlobalConstTypeVariable, + Variable$2, + Variable$4, ], }, TSModuleScope$2 { @@ -97,12 +100,12 @@ ScopeManager { Reference$1, ], set: Map { - "Foo" => Variable$2, + "Foo" => Variable$3, }, type: "tsModule", upper: GlobalScope$1, variables: Array [ - Variable$2, + Variable$3, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/ts-module/namespace.ts.shot b/packages/scope-manager/tests/fixtures/ts-module/namespace.ts.shot index 6dcf29fa675b..c35b4130baca 100644 --- a/packages/scope-manager/tests/fixtures/ts-module/namespace.ts.shot +++ b/packages/scope-manager/tests/fixtures/ts-module/namespace.ts.shot @@ -3,7 +3,8 @@ exports[`ts-module namespace 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ TSModuleNameDefinition$1 { name: Identifier<"Foo">, @@ -18,7 +19,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, Reference$5 { identifier: Identifier<"Foo">, @@ -26,13 +27,13 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: true, isTypeVariable: true, }, - Variable$2 { + Variable$3 { defs: Array [ VariableDefinition$2 { name: Identifier<"x">, @@ -48,14 +49,14 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$2, + resolved: Variable$3, writeExpr: Literal$3, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$3 { + Variable$4 { defs: Array [ VariableDefinition$3 { name: Identifier<"unresolved">, @@ -71,7 +72,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$3, + resolved: Variable$4, writeExpr: Identifier<"x">, }, ], @@ -96,14 +97,16 @@ ScopeManager { Reference$5, ], set: Map { - "Foo" => Variable$1, - "unresolved" => Variable$3, + "const" => ImplicitGlobalConstTypeVariable, + "Foo" => Variable$2, + "unresolved" => Variable$4, }, type: "global", upper: null, variables: Array [ - Variable$1, - Variable$3, + ImplicitGlobalConstTypeVariable, + Variable$2, + Variable$4, ], }, TSModuleScope$2 { @@ -114,12 +117,12 @@ ScopeManager { Reference$2, ], set: Map { - "x" => Variable$2, + "x" => Variable$3, }, type: "tsModule", upper: GlobalScope$1, variables: Array [ - Variable$2, + Variable$3, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/ts-module/scope.ts.shot b/packages/scope-manager/tests/fixtures/ts-module/scope.ts.shot index b228d0ff06be..087824c121e0 100644 --- a/packages/scope-manager/tests/fixtures/ts-module/scope.ts.shot +++ b/packages/scope-manager/tests/fixtures/ts-module/scope.ts.shot @@ -3,7 +3,8 @@ exports[`ts-module scope 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ TSModuleNameDefinition$1 { name: Identifier<"Foo">, @@ -15,7 +16,7 @@ ScopeManager { isValueVariable: true, isTypeVariable: true, }, - Variable$2 { + Variable$3 { defs: Array [ VariableDefinition$2 { name: Identifier<"x">, @@ -31,14 +32,14 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$2, + resolved: Variable$3, writeExpr: Literal$3, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$3 { + Variable$4 { defs: Array [ VariableDefinition$3 { name: Identifier<"unresolved">, @@ -54,7 +55,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$3, + resolved: Variable$4, writeExpr: Identifier<"x">, }, ], @@ -78,14 +79,16 @@ ScopeManager { }, ], set: Map { - "Foo" => Variable$1, - "unresolved" => Variable$3, + "const" => ImplicitGlobalConstTypeVariable, + "Foo" => Variable$2, + "unresolved" => Variable$4, }, type: "global", upper: null, variables: Array [ - Variable$1, - Variable$3, + ImplicitGlobalConstTypeVariable, + Variable$2, + Variable$4, ], }, TSModuleScope$2 { @@ -95,12 +98,12 @@ ScopeManager { Reference$1, ], set: Map { - "x" => Variable$2, + "x" => Variable$3, }, type: "tsModule", upper: GlobalScope$1, variables: Array [ - Variable$2, + Variable$3, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/ts-module/self-ref.ts.shot b/packages/scope-manager/tests/fixtures/ts-module/self-ref.ts.shot index c95936af46cf..a86baa108867 100644 --- a/packages/scope-manager/tests/fixtures/ts-module/self-ref.ts.shot +++ b/packages/scope-manager/tests/fixtures/ts-module/self-ref.ts.shot @@ -3,7 +3,8 @@ exports[`ts-module self-ref 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ TSModuleNameDefinition$1 { name: Identifier<"Foo">, @@ -18,13 +19,13 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: true, isTypeVariable: true, }, - Variable$2 { + Variable$3 { defs: Array [ VariableDefinition$2 { name: Identifier<"x">, @@ -40,7 +41,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$2, + resolved: Variable$3, writeExpr: Literal$3, }, ], @@ -54,12 +55,14 @@ ScopeManager { isStrict: false, references: Array [], set: Map { - "Foo" => Variable$1, + "const" => ImplicitGlobalConstTypeVariable, + "Foo" => Variable$2, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, + Variable$2, ], }, TSModuleScope$2 { @@ -70,12 +73,12 @@ ScopeManager { Reference$2, ], set: Map { - "x" => Variable$2, + "x" => Variable$3, }, type: "tsModule", upper: GlobalScope$1, variables: Array [ - Variable$2, + Variable$3, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/type-annotation/parameter-array-destructure.ts.shot b/packages/scope-manager/tests/fixtures/type-annotation/parameter-array-destructure.ts.shot index fb8e65e0af4c..8d08f8a7b502 100644 --- a/packages/scope-manager/tests/fixtures/type-annotation/parameter-array-destructure.ts.shot +++ b/packages/scope-manager/tests/fixtures/type-annotation/parameter-array-destructure.ts.shot @@ -3,7 +3,8 @@ exports[`type-annotation parameter-array-destructure 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ TypeDefinition$1 { name: Identifier<"T">, @@ -18,13 +19,13 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: false, isTypeVariable: true, }, - Variable$2 { + Variable$3 { defs: Array [ FunctionNameDefinition$2 { name: Identifier<"foo">, @@ -36,14 +37,14 @@ ScopeManager { isValueVariable: true, isTypeVariable: false, }, - Variable$3 { + Variable$4 { defs: Array [], name: "arguments", references: Array [], isValueVariable: true, isTypeVariable: true, }, - Variable$4 { + Variable$5 { defs: Array [ ParameterDefinition$3 { name: Identifier<"a">, @@ -62,14 +63,16 @@ ScopeManager { isStrict: false, references: Array [], set: Map { - "T" => Variable$1, - "foo" => Variable$2, + "const" => ImplicitGlobalConstTypeVariable, + "T" => Variable$2, + "foo" => Variable$3, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, Variable$2, + Variable$3, ], }, FunctionScope$2 { @@ -79,14 +82,14 @@ ScopeManager { Reference$1, ], set: Map { - "arguments" => Variable$3, - "a" => Variable$4, + "arguments" => Variable$4, + "a" => Variable$5, }, type: "function", upper: GlobalScope$1, variables: Array [ - Variable$3, Variable$4, + Variable$5, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/type-annotation/parameter-default.ts.shot b/packages/scope-manager/tests/fixtures/type-annotation/parameter-default.ts.shot index bccc7601df52..fde1483a8736 100644 --- a/packages/scope-manager/tests/fixtures/type-annotation/parameter-default.ts.shot +++ b/packages/scope-manager/tests/fixtures/type-annotation/parameter-default.ts.shot @@ -3,7 +3,8 @@ exports[`type-annotation parameter-default 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ TypeDefinition$1 { name: Identifier<"T">, @@ -18,13 +19,13 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: false, isTypeVariable: true, }, - Variable$2 { + Variable$3 { defs: Array [ FunctionNameDefinition$2 { name: Identifier<"foo">, @@ -36,14 +37,14 @@ ScopeManager { isValueVariable: true, isTypeVariable: false, }, - Variable$3 { + Variable$4 { defs: Array [], name: "arguments", references: Array [], isValueVariable: true, isTypeVariable: true, }, - Variable$4 { + Variable$5 { defs: Array [ ParameterDefinition$3 { name: Identifier<"a">, @@ -59,7 +60,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$4, + resolved: Variable$5, writeExpr: Literal$3, }, ], @@ -73,14 +74,16 @@ ScopeManager { isStrict: false, references: Array [], set: Map { - "T" => Variable$1, - "foo" => Variable$2, + "const" => ImplicitGlobalConstTypeVariable, + "T" => Variable$2, + "foo" => Variable$3, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, Variable$2, + Variable$3, ], }, FunctionScope$2 { @@ -91,14 +94,14 @@ ScopeManager { Reference$2, ], set: Map { - "arguments" => Variable$3, - "a" => Variable$4, + "arguments" => Variable$4, + "a" => Variable$5, }, type: "function", upper: GlobalScope$1, variables: Array [ - Variable$3, Variable$4, + Variable$5, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/type-annotation/parameter-object-destructure.ts.shot b/packages/scope-manager/tests/fixtures/type-annotation/parameter-object-destructure.ts.shot index e0dba0f71d95..284dbb744757 100644 --- a/packages/scope-manager/tests/fixtures/type-annotation/parameter-object-destructure.ts.shot +++ b/packages/scope-manager/tests/fixtures/type-annotation/parameter-object-destructure.ts.shot @@ -3,7 +3,8 @@ exports[`type-annotation parameter-object-destructure 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ TypeDefinition$1 { name: Identifier<"T">, @@ -18,13 +19,13 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: false, isTypeVariable: true, }, - Variable$2 { + Variable$3 { defs: Array [ FunctionNameDefinition$2 { name: Identifier<"foo">, @@ -36,14 +37,14 @@ ScopeManager { isValueVariable: true, isTypeVariable: false, }, - Variable$3 { + Variable$4 { defs: Array [], name: "arguments", references: Array [], isValueVariable: true, isTypeVariable: true, }, - Variable$4 { + Variable$5 { defs: Array [ ParameterDefinition$3 { name: Identifier<"a">, @@ -62,14 +63,16 @@ ScopeManager { isStrict: false, references: Array [], set: Map { - "T" => Variable$1, - "foo" => Variable$2, + "const" => ImplicitGlobalConstTypeVariable, + "T" => Variable$2, + "foo" => Variable$3, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, Variable$2, + Variable$3, ], }, FunctionScope$2 { @@ -79,14 +82,14 @@ ScopeManager { Reference$1, ], set: Map { - "arguments" => Variable$3, - "a" => Variable$4, + "arguments" => Variable$4, + "a" => Variable$5, }, type: "function", upper: GlobalScope$1, variables: Array [ - Variable$3, Variable$4, + Variable$5, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/type-annotation/parameter-rest.ts.shot b/packages/scope-manager/tests/fixtures/type-annotation/parameter-rest.ts.shot index cc121b8fbacc..6dd0e5c52777 100644 --- a/packages/scope-manager/tests/fixtures/type-annotation/parameter-rest.ts.shot +++ b/packages/scope-manager/tests/fixtures/type-annotation/parameter-rest.ts.shot @@ -3,7 +3,8 @@ exports[`type-annotation parameter-rest 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ TypeDefinition$1 { name: Identifier<"T">, @@ -18,13 +19,13 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: false, isTypeVariable: true, }, - Variable$2 { + Variable$3 { defs: Array [ FunctionNameDefinition$2 { name: Identifier<"foo">, @@ -36,14 +37,14 @@ ScopeManager { isValueVariable: true, isTypeVariable: false, }, - Variable$3 { + Variable$4 { defs: Array [], name: "arguments", references: Array [], isValueVariable: true, isTypeVariable: true, }, - Variable$4 { + Variable$5 { defs: Array [ ParameterDefinition$3 { name: Identifier<"a">, @@ -62,14 +63,16 @@ ScopeManager { isStrict: false, references: Array [], set: Map { - "T" => Variable$1, - "foo" => Variable$2, + "const" => ImplicitGlobalConstTypeVariable, + "T" => Variable$2, + "foo" => Variable$3, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, Variable$2, + Variable$3, ], }, FunctionScope$2 { @@ -79,14 +82,14 @@ ScopeManager { Reference$1, ], set: Map { - "arguments" => Variable$3, - "a" => Variable$4, + "arguments" => Variable$4, + "a" => Variable$5, }, type: "function", upper: GlobalScope$1, variables: Array [ - Variable$3, Variable$4, + Variable$5, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/type-annotation/parameter.ts.shot b/packages/scope-manager/tests/fixtures/type-annotation/parameter.ts.shot index 098c35bc4ea8..251e0607bf3b 100644 --- a/packages/scope-manager/tests/fixtures/type-annotation/parameter.ts.shot +++ b/packages/scope-manager/tests/fixtures/type-annotation/parameter.ts.shot @@ -3,7 +3,8 @@ exports[`type-annotation parameter 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ TypeDefinition$1 { name: Identifier<"T">, @@ -18,13 +19,13 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: false, isTypeVariable: true, }, - Variable$2 { + Variable$3 { defs: Array [ FunctionNameDefinition$2 { name: Identifier<"foo">, @@ -36,14 +37,14 @@ ScopeManager { isValueVariable: true, isTypeVariable: false, }, - Variable$3 { + Variable$4 { defs: Array [], name: "arguments", references: Array [], isValueVariable: true, isTypeVariable: true, }, - Variable$4 { + Variable$5 { defs: Array [ ParameterDefinition$3 { name: Identifier<"a">, @@ -62,14 +63,16 @@ ScopeManager { isStrict: false, references: Array [], set: Map { - "T" => Variable$1, - "foo" => Variable$2, + "const" => ImplicitGlobalConstTypeVariable, + "T" => Variable$2, + "foo" => Variable$3, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, Variable$2, + Variable$3, ], }, FunctionScope$2 { @@ -79,14 +82,14 @@ ScopeManager { Reference$1, ], set: Map { - "arguments" => Variable$3, - "a" => Variable$4, + "arguments" => Variable$4, + "a" => Variable$5, }, type: "function", upper: GlobalScope$1, variables: Array [ - Variable$3, Variable$4, + Variable$5, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/type-annotation/variable-array-destructure.ts.shot b/packages/scope-manager/tests/fixtures/type-annotation/variable-array-destructure.ts.shot index 047b34760494..15eddcbd4966 100644 --- a/packages/scope-manager/tests/fixtures/type-annotation/variable-array-destructure.ts.shot +++ b/packages/scope-manager/tests/fixtures/type-annotation/variable-array-destructure.ts.shot @@ -3,7 +3,8 @@ exports[`type-annotation variable-array-destructure 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ TypeDefinition$1 { name: Identifier<"T">, @@ -18,13 +19,13 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: false, isTypeVariable: true, }, - Variable$2 { + Variable$3 { defs: Array [ VariableDefinition$2 { name: Identifier<"x">, @@ -40,7 +41,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$2, + resolved: Variable$3, writeExpr: ArrayExpression$3, }, ], @@ -57,14 +58,16 @@ ScopeManager { Reference$2, ], set: Map { - "T" => Variable$1, - "x" => Variable$2, + "const" => ImplicitGlobalConstTypeVariable, + "T" => Variable$2, + "x" => Variable$3, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, Variable$2, + Variable$3, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/type-annotation/variable-const.ts.shot b/packages/scope-manager/tests/fixtures/type-annotation/variable-const.ts.shot index ea1d13408b7d..81e215fc0dda 100644 --- a/packages/scope-manager/tests/fixtures/type-annotation/variable-const.ts.shot +++ b/packages/scope-manager/tests/fixtures/type-annotation/variable-const.ts.shot @@ -3,7 +3,8 @@ exports[`type-annotation variable-const 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ TypeDefinition$1 { name: Identifier<"T">, @@ -18,13 +19,13 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: false, isTypeVariable: true, }, - Variable$2 { + Variable$3 { defs: Array [ VariableDefinition$2 { name: Identifier<"x">, @@ -40,7 +41,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$2, + resolved: Variable$3, writeExpr: Literal$3, }, ], @@ -57,14 +58,16 @@ ScopeManager { Reference$2, ], set: Map { - "T" => Variable$1, - "x" => Variable$2, + "const" => ImplicitGlobalConstTypeVariable, + "T" => Variable$2, + "x" => Variable$3, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, Variable$2, + Variable$3, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/type-annotation/variable-let.ts.shot b/packages/scope-manager/tests/fixtures/type-annotation/variable-let.ts.shot index 7dc21978020b..b6e96944d623 100644 --- a/packages/scope-manager/tests/fixtures/type-annotation/variable-let.ts.shot +++ b/packages/scope-manager/tests/fixtures/type-annotation/variable-let.ts.shot @@ -3,7 +3,8 @@ exports[`type-annotation variable-let 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ TypeDefinition$1 { name: Identifier<"T">, @@ -18,13 +19,13 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: false, isTypeVariable: true, }, - Variable$2 { + Variable$3 { defs: Array [ VariableDefinition$2 { name: Identifier<"x">, @@ -45,14 +46,16 @@ ScopeManager { Reference$1, ], set: Map { - "T" => Variable$1, - "x" => Variable$2, + "const" => ImplicitGlobalConstTypeVariable, + "T" => Variable$2, + "x" => Variable$3, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, Variable$2, + Variable$3, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/type-annotation/variable-object-destructure.ts.shot b/packages/scope-manager/tests/fixtures/type-annotation/variable-object-destructure.ts.shot index 3257f250b7c5..2b9c3e2da32d 100644 --- a/packages/scope-manager/tests/fixtures/type-annotation/variable-object-destructure.ts.shot +++ b/packages/scope-manager/tests/fixtures/type-annotation/variable-object-destructure.ts.shot @@ -3,7 +3,8 @@ exports[`type-annotation variable-object-destructure 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ TypeDefinition$1 { name: Identifier<"T">, @@ -18,13 +19,13 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: false, isTypeVariable: true, }, - Variable$2 { + Variable$3 { defs: Array [ VariableDefinition$2 { name: Identifier<"x">, @@ -40,7 +41,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$2, + resolved: Variable$3, writeExpr: ObjectExpression$3, }, ], @@ -57,14 +58,16 @@ ScopeManager { Reference$2, ], set: Map { - "T" => Variable$1, - "x" => Variable$2, + "const" => ImplicitGlobalConstTypeVariable, + "T" => Variable$2, + "x" => Variable$3, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, Variable$2, + Variable$3, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/type-annotation/variable-var.ts.shot b/packages/scope-manager/tests/fixtures/type-annotation/variable-var.ts.shot index 0f2f8d6934a5..cf0d553ea76d 100644 --- a/packages/scope-manager/tests/fixtures/type-annotation/variable-var.ts.shot +++ b/packages/scope-manager/tests/fixtures/type-annotation/variable-var.ts.shot @@ -3,7 +3,8 @@ exports[`type-annotation variable-var 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ TypeDefinition$1 { name: Identifier<"T">, @@ -18,13 +19,13 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: false, isTypeVariable: true, }, - Variable$2 { + Variable$3 { defs: Array [ VariableDefinition$2 { name: Identifier<"x">, @@ -45,14 +46,16 @@ ScopeManager { Reference$1, ], set: Map { - "T" => Variable$1, - "x" => Variable$2, + "const" => ImplicitGlobalConstTypeVariable, + "T" => Variable$2, + "x" => Variable$3, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, Variable$2, + Variable$3, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/type-assertion/angle-bracket.ts.shot b/packages/scope-manager/tests/fixtures/type-assertion/angle-bracket.ts.shot index 9c2347eaacea..351a44ff3d8c 100644 --- a/packages/scope-manager/tests/fixtures/type-assertion/angle-bracket.ts.shot +++ b/packages/scope-manager/tests/fixtures/type-assertion/angle-bracket.ts.shot @@ -3,7 +3,8 @@ exports[`type-assertion angle-bracket 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ VariableDefinition$1 { name: Identifier<"x">, @@ -19,7 +20,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$1, + resolved: Variable$2, writeExpr: Literal$2, }, Reference$2 { @@ -28,13 +29,13 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$2 { + Variable$3 { defs: Array [ TypeDefinition$2 { name: Identifier<"T">, @@ -49,7 +50,7 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$2, + resolved: Variable$3, }, ], isValueVariable: false, @@ -66,14 +67,16 @@ ScopeManager { Reference$3, ], set: Map { - "x" => Variable$1, - "T" => Variable$2, + "const" => ImplicitGlobalConstTypeVariable, + "x" => Variable$2, + "T" => Variable$3, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, Variable$2, + Variable$3, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/type-assertion/as.ts.shot b/packages/scope-manager/tests/fixtures/type-assertion/as.ts.shot index b26ce09247a3..f5ba1eeff1a1 100644 --- a/packages/scope-manager/tests/fixtures/type-assertion/as.ts.shot +++ b/packages/scope-manager/tests/fixtures/type-assertion/as.ts.shot @@ -3,7 +3,8 @@ exports[`type-assertion as 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ VariableDefinition$1 { name: Identifier<"x">, @@ -19,7 +20,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$1, + resolved: Variable$2, writeExpr: Literal$2, }, Reference$2 { @@ -28,13 +29,13 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$2 { + Variable$3 { defs: Array [ TypeDefinition$2 { name: Identifier<"T">, @@ -49,7 +50,7 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$2, + resolved: Variable$3, }, ], isValueVariable: false, @@ -66,14 +67,16 @@ ScopeManager { Reference$3, ], set: Map { - "x" => Variable$1, - "T" => Variable$2, + "const" => ImplicitGlobalConstTypeVariable, + "x" => Variable$2, + "T" => Variable$3, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, Variable$2, + Variable$3, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/type-declaration/conditional1.ts.shot b/packages/scope-manager/tests/fixtures/type-declaration/conditional1.ts.shot index 6a825f301fe6..4fb0e402b4b3 100644 --- a/packages/scope-manager/tests/fixtures/type-declaration/conditional1.ts.shot +++ b/packages/scope-manager/tests/fixtures/type-declaration/conditional1.ts.shot @@ -3,7 +3,8 @@ exports[`type-declaration conditional1 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ TypeDefinition$1 { name: Identifier<"T">, @@ -15,7 +16,7 @@ ScopeManager { isValueVariable: false, isTypeVariable: true, }, - Variable$2 { + Variable$3 { defs: Array [ TypeDefinition$2 { name: Identifier<"U">, @@ -30,13 +31,13 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$2, + resolved: Variable$3, }, ], isValueVariable: false, isTypeVariable: true, }, - Variable$3 { + Variable$4 { defs: Array [ TypeDefinition$3 { name: Identifier<"V">, @@ -51,13 +52,13 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$3, + resolved: Variable$4, }, ], isValueVariable: false, isTypeVariable: true, }, - Variable$4 { + Variable$5 { defs: Array [ TypeDefinition$4 { name: Identifier<"Unresolved">, @@ -85,14 +86,16 @@ ScopeManager { }, ], set: Map { - "T" => Variable$1, - "Unresolved" => Variable$4, + "const" => ImplicitGlobalConstTypeVariable, + "T" => Variable$2, + "Unresolved" => Variable$5, }, type: "global", upper: null, variables: Array [ - Variable$1, - Variable$4, + ImplicitGlobalConstTypeVariable, + Variable$2, + Variable$5, ], }, TypeScope$2 { @@ -100,12 +103,12 @@ ScopeManager { isStrict: true, references: Array [], set: Map { - "U" => Variable$2, + "U" => Variable$3, }, type: "type", upper: GlobalScope$1, variables: Array [ - Variable$2, + Variable$3, ], }, ConditionalTypeScope$3 { @@ -116,12 +119,12 @@ ScopeManager { Reference$2, ], set: Map { - "V" => Variable$3, + "V" => Variable$4, }, type: "conditionalType", upper: TypeScope$2, variables: Array [ - Variable$3, + Variable$4, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/type-declaration/conditional2.ts.shot b/packages/scope-manager/tests/fixtures/type-declaration/conditional2.ts.shot index de6b30f3ba2e..f3ef0767e262 100644 --- a/packages/scope-manager/tests/fixtures/type-declaration/conditional2.ts.shot +++ b/packages/scope-manager/tests/fixtures/type-declaration/conditional2.ts.shot @@ -3,7 +3,8 @@ exports[`type-declaration conditional2 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ TypeDefinition$1 { name: Identifier<"T">, @@ -15,7 +16,7 @@ ScopeManager { isValueVariable: false, isTypeVariable: true, }, - Variable$2 { + Variable$3 { defs: Array [ TypeDefinition$2 { name: Identifier<"U">, @@ -30,13 +31,13 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$2, + resolved: Variable$3, }, ], isValueVariable: false, isTypeVariable: true, }, - Variable$3 { + Variable$4 { defs: Array [ TypeDefinition$3 { name: Identifier<"Unresolved">, @@ -64,14 +65,16 @@ ScopeManager { }, ], set: Map { - "T" => Variable$1, - "Unresolved" => Variable$3, + "const" => ImplicitGlobalConstTypeVariable, + "T" => Variable$2, + "Unresolved" => Variable$4, }, type: "global", upper: null, variables: Array [ - Variable$1, - Variable$3, + ImplicitGlobalConstTypeVariable, + Variable$2, + Variable$4, ], }, ConditionalTypeScope$2 { @@ -81,12 +84,12 @@ ScopeManager { Reference$1, ], set: Map { - "U" => Variable$2, + "U" => Variable$3, }, type: "conditionalType", upper: GlobalScope$1, variables: Array [ - Variable$2, + Variable$3, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/type-declaration/conditional3.ts.shot b/packages/scope-manager/tests/fixtures/type-declaration/conditional3.ts.shot index 12e493db4191..7271162cbacf 100644 --- a/packages/scope-manager/tests/fixtures/type-declaration/conditional3.ts.shot +++ b/packages/scope-manager/tests/fixtures/type-declaration/conditional3.ts.shot @@ -3,7 +3,8 @@ exports[`type-declaration conditional3 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ TypeDefinition$1 { name: Identifier<"Test">, @@ -15,7 +16,7 @@ ScopeManager { isValueVariable: false, isTypeVariable: true, }, - Variable$2 { + Variable$3 { defs: Array [ TypeDefinition$2 { name: Identifier<"U">, @@ -30,13 +31,13 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$2, + resolved: Variable$3, }, ], isValueVariable: false, isTypeVariable: true, }, - Variable$3 { + Variable$4 { defs: Array [ ParameterDefinition$3 { name: Identifier<"k">, @@ -48,7 +49,7 @@ ScopeManager { isValueVariable: true, isTypeVariable: false, }, - Variable$4 { + Variable$5 { defs: Array [ TypeDefinition$4 { name: Identifier<"I">, @@ -63,7 +64,7 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$4, + resolved: Variable$5, }, ], isValueVariable: false, @@ -76,12 +77,14 @@ ScopeManager { isStrict: false, references: Array [], set: Map { - "Test" => Variable$1, + "const" => ImplicitGlobalConstTypeVariable, + "Test" => Variable$2, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, + Variable$2, ], }, TypeScope$2 { @@ -89,12 +92,12 @@ ScopeManager { isStrict: true, references: Array [], set: Map { - "U" => Variable$2, + "U" => Variable$3, }, type: "type", upper: GlobalScope$1, variables: Array [ - Variable$2, + Variable$3, ], }, ConditionalTypeScope$3 { @@ -105,12 +108,12 @@ ScopeManager { Reference$2, ], set: Map { - "I" => Variable$4, + "I" => Variable$5, }, type: "conditionalType", upper: TypeScope$2, variables: Array [ - Variable$4, + Variable$5, ], }, FunctionTypeScope$4 { @@ -118,12 +121,12 @@ ScopeManager { isStrict: true, references: Array [], set: Map { - "k" => Variable$3, + "k" => Variable$4, }, type: "functionType", upper: ConditionalTypeScope$3, variables: Array [ - Variable$3, + Variable$4, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/type-declaration/conditional4.ts.shot b/packages/scope-manager/tests/fixtures/type-declaration/conditional4.ts.shot index 13ba417eaf91..2fe48b779984 100644 --- a/packages/scope-manager/tests/fixtures/type-declaration/conditional4.ts.shot +++ b/packages/scope-manager/tests/fixtures/type-declaration/conditional4.ts.shot @@ -3,7 +3,8 @@ exports[`type-declaration conditional4 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ TypeDefinition$1 { name: Identifier<"Test">, @@ -15,7 +16,7 @@ ScopeManager { isValueVariable: false, isTypeVariable: true, }, - Variable$2 { + Variable$3 { defs: Array [ TypeDefinition$2 { name: Identifier<"U">, @@ -30,13 +31,13 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$2, + resolved: Variable$3, }, ], isValueVariable: false, isTypeVariable: true, }, - Variable$3 { + Variable$4 { defs: Array [ TypeDefinition$3 { name: Identifier<"I">, @@ -51,7 +52,7 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$3, + resolved: Variable$4, }, ], isValueVariable: false, @@ -64,12 +65,14 @@ ScopeManager { isStrict: false, references: Array [], set: Map { - "Test" => Variable$1, + "const" => ImplicitGlobalConstTypeVariable, + "Test" => Variable$2, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, + Variable$2, ], }, TypeScope$2 { @@ -77,12 +80,12 @@ ScopeManager { isStrict: true, references: Array [], set: Map { - "U" => Variable$2, + "U" => Variable$3, }, type: "type", upper: GlobalScope$1, variables: Array [ - Variable$2, + Variable$3, ], }, ConditionalTypeScope$3 { @@ -93,12 +96,12 @@ ScopeManager { Reference$2, ], set: Map { - "I" => Variable$3, + "I" => Variable$4, }, type: "conditionalType", upper: TypeScope$2, variables: Array [ - Variable$3, + Variable$4, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/type-declaration/conditional5.ts.shot b/packages/scope-manager/tests/fixtures/type-declaration/conditional5.ts.shot index 1102d182209c..92fada83fdf4 100644 --- a/packages/scope-manager/tests/fixtures/type-declaration/conditional5.ts.shot +++ b/packages/scope-manager/tests/fixtures/type-declaration/conditional5.ts.shot @@ -3,7 +3,8 @@ exports[`type-declaration conditional5 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ TypeDefinition$1 { name: Identifier<"Test">, @@ -15,7 +16,7 @@ ScopeManager { isValueVariable: false, isTypeVariable: true, }, - Variable$2 { + Variable$3 { defs: Array [ TypeDefinition$2 { name: Identifier<"U">, @@ -30,13 +31,13 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$2, + resolved: Variable$3, }, ], isValueVariable: false, isTypeVariable: true, }, - Variable$3 { + Variable$4 { defs: Array [ ParameterDefinition$3 { name: Identifier<"arg">, @@ -48,7 +49,7 @@ ScopeManager { isValueVariable: true, isTypeVariable: false, }, - Variable$4 { + Variable$5 { defs: Array [ ParameterDefinition$4 { name: Identifier<"arg2">, @@ -60,7 +61,7 @@ ScopeManager { isValueVariable: true, isTypeVariable: false, }, - Variable$5 { + Variable$6 { defs: Array [ TypeDefinition$5 { name: Identifier<"I">, @@ -75,7 +76,7 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$5, + resolved: Variable$6, }, ], isValueVariable: false, @@ -88,12 +89,14 @@ ScopeManager { isStrict: false, references: Array [], set: Map { - "Test" => Variable$1, + "const" => ImplicitGlobalConstTypeVariable, + "Test" => Variable$2, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, + Variable$2, ], }, TypeScope$2 { @@ -101,12 +104,12 @@ ScopeManager { isStrict: true, references: Array [], set: Map { - "U" => Variable$2, + "U" => Variable$3, }, type: "type", upper: GlobalScope$1, variables: Array [ - Variable$2, + Variable$3, ], }, ConditionalTypeScope$3 { @@ -117,12 +120,12 @@ ScopeManager { Reference$2, ], set: Map { - "I" => Variable$5, + "I" => Variable$6, }, type: "conditionalType", upper: TypeScope$2, variables: Array [ - Variable$5, + Variable$6, ], }, FunctionTypeScope$4 { @@ -130,12 +133,12 @@ ScopeManager { isStrict: true, references: Array [], set: Map { - "arg" => Variable$3, + "arg" => Variable$4, }, type: "functionType", upper: ConditionalTypeScope$3, variables: Array [ - Variable$3, + Variable$4, ], }, FunctionTypeScope$5 { @@ -143,12 +146,12 @@ ScopeManager { isStrict: true, references: Array [], set: Map { - "arg2" => Variable$4, + "arg2" => Variable$5, }, type: "functionType", upper: FunctionTypeScope$4, variables: Array [ - Variable$4, + Variable$5, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/type-declaration/dual-type-value.ts.shot b/packages/scope-manager/tests/fixtures/type-declaration/dual-type-value.ts.shot index 35a2fbb68a28..678e04514581 100644 --- a/packages/scope-manager/tests/fixtures/type-declaration/dual-type-value.ts.shot +++ b/packages/scope-manager/tests/fixtures/type-declaration/dual-type-value.ts.shot @@ -3,7 +3,8 @@ exports[`type-declaration dual-type-value 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ VariableDefinition$1 { name: Identifier<"dual">, @@ -23,7 +24,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$1, + resolved: Variable$2, writeExpr: Literal$3, }, Reference$2 { @@ -32,7 +33,7 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, Reference$4 { identifier: Identifier<"dual">, @@ -40,13 +41,13 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: true, isTypeVariable: true, }, - Variable$2 { + Variable$3 { defs: Array [ TypeDefinition$3 { name: Identifier<"reference1">, @@ -58,7 +59,7 @@ ScopeManager { isValueVariable: false, isTypeVariable: true, }, - Variable$3 { + Variable$4 { defs: Array [ VariableDefinition$4 { name: Identifier<"reference2">, @@ -74,7 +75,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$3, + resolved: Variable$4, writeExpr: Identifier<"dual">, }, ], @@ -93,16 +94,18 @@ ScopeManager { Reference$4, ], set: Map { - "dual" => Variable$1, - "reference1" => Variable$2, - "reference2" => Variable$3, + "const" => ImplicitGlobalConstTypeVariable, + "dual" => Variable$2, + "reference1" => Variable$3, + "reference2" => Variable$4, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, Variable$2, Variable$3, + Variable$4, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/type-declaration/function/constructor-generics1.ts.shot b/packages/scope-manager/tests/fixtures/type-declaration/function/constructor-generics1.ts.shot index a78bbd8addfd..03d2a8bfc335 100644 --- a/packages/scope-manager/tests/fixtures/type-declaration/function/constructor-generics1.ts.shot +++ b/packages/scope-manager/tests/fixtures/type-declaration/function/constructor-generics1.ts.shot @@ -3,7 +3,8 @@ exports[`type-declaration function constructor-generics1 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ TypeDefinition$1 { name: Identifier<"T">, @@ -18,13 +19,13 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: false, isTypeVariable: true, }, - Variable$2 { + Variable$3 { defs: Array [ TypeDefinition$2 { name: Identifier<"A">, @@ -36,7 +37,7 @@ ScopeManager { isValueVariable: false, isTypeVariable: true, }, - Variable$3 { + Variable$4 { defs: Array [ TypeDefinition$3 { name: Identifier<"U">, @@ -51,13 +52,13 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$3, + resolved: Variable$4, }, ], isValueVariable: false, isTypeVariable: true, }, - Variable$4 { + Variable$5 { defs: Array [ ParameterDefinition$4 { name: Identifier<"arg">, @@ -76,14 +77,16 @@ ScopeManager { isStrict: false, references: Array [], set: Map { - "T" => Variable$1, - "A" => Variable$2, + "const" => ImplicitGlobalConstTypeVariable, + "T" => Variable$2, + "A" => Variable$3, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, Variable$2, + Variable$3, ], }, TypeScope$2 { @@ -91,12 +94,12 @@ ScopeManager { isStrict: true, references: Array [], set: Map { - "U" => Variable$3, + "U" => Variable$4, }, type: "type", upper: GlobalScope$1, variables: Array [ - Variable$3, + Variable$4, ], }, FunctionTypeScope$3 { @@ -107,12 +110,12 @@ ScopeManager { Reference$2, ], set: Map { - "arg" => Variable$4, + "arg" => Variable$5, }, type: "functionType", upper: TypeScope$2, variables: Array [ - Variable$4, + Variable$5, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/type-declaration/function/constructor-generics2.ts.shot b/packages/scope-manager/tests/fixtures/type-declaration/function/constructor-generics2.ts.shot index 38669365e510..5eb9b9e80ebf 100644 --- a/packages/scope-manager/tests/fixtures/type-declaration/function/constructor-generics2.ts.shot +++ b/packages/scope-manager/tests/fixtures/type-declaration/function/constructor-generics2.ts.shot @@ -3,7 +3,8 @@ exports[`type-declaration function constructor-generics2 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ TypeDefinition$1 { name: Identifier<"T">, @@ -18,13 +19,13 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: false, isTypeVariable: true, }, - Variable$2 { + Variable$3 { defs: Array [ TypeDefinition$2 { name: Identifier<"A">, @@ -36,7 +37,7 @@ ScopeManager { isValueVariable: false, isTypeVariable: true, }, - Variable$3 { + Variable$4 { defs: Array [ TypeDefinition$3 { name: Identifier<"U">, @@ -51,13 +52,13 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$3, + resolved: Variable$4, }, ], isValueVariable: false, isTypeVariable: true, }, - Variable$4 { + Variable$5 { defs: Array [ ParameterDefinition$4 { name: Identifier<"arg">, @@ -76,14 +77,16 @@ ScopeManager { isStrict: false, references: Array [], set: Map { - "T" => Variable$1, - "A" => Variable$2, + "const" => ImplicitGlobalConstTypeVariable, + "T" => Variable$2, + "A" => Variable$3, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, Variable$2, + Variable$3, ], }, FunctionTypeScope$2 { @@ -94,14 +97,14 @@ ScopeManager { Reference$2, ], set: Map { - "U" => Variable$3, - "arg" => Variable$4, + "U" => Variable$4, + "arg" => Variable$5, }, type: "functionType", upper: GlobalScope$1, variables: Array [ - Variable$3, Variable$4, + Variable$5, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/type-declaration/function/constructor.ts.shot b/packages/scope-manager/tests/fixtures/type-declaration/function/constructor.ts.shot index 157c68e38682..8fc5107456b4 100644 --- a/packages/scope-manager/tests/fixtures/type-declaration/function/constructor.ts.shot +++ b/packages/scope-manager/tests/fixtures/type-declaration/function/constructor.ts.shot @@ -3,7 +3,8 @@ exports[`type-declaration function constructor 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ TypeDefinition$1 { name: Identifier<"T">, @@ -18,7 +19,7 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, Reference$2 { identifier: Identifier<"T">, @@ -26,13 +27,13 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: false, isTypeVariable: true, }, - Variable$2 { + Variable$3 { defs: Array [ TypeDefinition$2 { name: Identifier<"A">, @@ -44,7 +45,7 @@ ScopeManager { isValueVariable: false, isTypeVariable: true, }, - Variable$3 { + Variable$4 { defs: Array [ ParameterDefinition$3 { name: Identifier<"arg">, @@ -63,14 +64,16 @@ ScopeManager { isStrict: false, references: Array [], set: Map { - "T" => Variable$1, - "A" => Variable$2, + "const" => ImplicitGlobalConstTypeVariable, + "T" => Variable$2, + "A" => Variable$3, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, Variable$2, + Variable$3, ], }, FunctionTypeScope$2 { @@ -81,12 +84,12 @@ ScopeManager { Reference$2, ], set: Map { - "arg" => Variable$3, + "arg" => Variable$4, }, type: "functionType", upper: GlobalScope$1, variables: Array [ - Variable$3, + Variable$4, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/type-declaration/function/function-generics1.ts.shot b/packages/scope-manager/tests/fixtures/type-declaration/function/function-generics1.ts.shot index 362c88d6cb0d..8a066428ca52 100644 --- a/packages/scope-manager/tests/fixtures/type-declaration/function/function-generics1.ts.shot +++ b/packages/scope-manager/tests/fixtures/type-declaration/function/function-generics1.ts.shot @@ -3,7 +3,8 @@ exports[`type-declaration function function-generics1 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ TypeDefinition$1 { name: Identifier<"T">, @@ -18,13 +19,13 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: false, isTypeVariable: true, }, - Variable$2 { + Variable$3 { defs: Array [ TypeDefinition$2 { name: Identifier<"A">, @@ -36,7 +37,7 @@ ScopeManager { isValueVariable: false, isTypeVariable: true, }, - Variable$3 { + Variable$4 { defs: Array [ TypeDefinition$3 { name: Identifier<"U">, @@ -51,13 +52,13 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$3, + resolved: Variable$4, }, ], isValueVariable: false, isTypeVariable: true, }, - Variable$4 { + Variable$5 { defs: Array [ ParameterDefinition$4 { name: Identifier<"arg">, @@ -76,14 +77,16 @@ ScopeManager { isStrict: false, references: Array [], set: Map { - "T" => Variable$1, - "A" => Variable$2, + "const" => ImplicitGlobalConstTypeVariable, + "T" => Variable$2, + "A" => Variable$3, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, Variable$2, + Variable$3, ], }, TypeScope$2 { @@ -91,12 +94,12 @@ ScopeManager { isStrict: true, references: Array [], set: Map { - "U" => Variable$3, + "U" => Variable$4, }, type: "type", upper: GlobalScope$1, variables: Array [ - Variable$3, + Variable$4, ], }, FunctionTypeScope$3 { @@ -107,12 +110,12 @@ ScopeManager { Reference$2, ], set: Map { - "arg" => Variable$4, + "arg" => Variable$5, }, type: "functionType", upper: TypeScope$2, variables: Array [ - Variable$4, + Variable$5, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/type-declaration/function/function-generics2.ts.shot b/packages/scope-manager/tests/fixtures/type-declaration/function/function-generics2.ts.shot index 4b9a53eab97b..ebd6d82910d9 100644 --- a/packages/scope-manager/tests/fixtures/type-declaration/function/function-generics2.ts.shot +++ b/packages/scope-manager/tests/fixtures/type-declaration/function/function-generics2.ts.shot @@ -3,7 +3,8 @@ exports[`type-declaration function function-generics2 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ TypeDefinition$1 { name: Identifier<"T">, @@ -18,13 +19,13 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: false, isTypeVariable: true, }, - Variable$2 { + Variable$3 { defs: Array [ TypeDefinition$2 { name: Identifier<"A">, @@ -36,7 +37,7 @@ ScopeManager { isValueVariable: false, isTypeVariable: true, }, - Variable$3 { + Variable$4 { defs: Array [ TypeDefinition$3 { name: Identifier<"U">, @@ -51,13 +52,13 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$3, + resolved: Variable$4, }, ], isValueVariable: false, isTypeVariable: true, }, - Variable$4 { + Variable$5 { defs: Array [ ParameterDefinition$4 { name: Identifier<"arg">, @@ -76,14 +77,16 @@ ScopeManager { isStrict: false, references: Array [], set: Map { - "T" => Variable$1, - "A" => Variable$2, + "const" => ImplicitGlobalConstTypeVariable, + "T" => Variable$2, + "A" => Variable$3, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, Variable$2, + Variable$3, ], }, FunctionTypeScope$2 { @@ -94,14 +97,14 @@ ScopeManager { Reference$2, ], set: Map { - "U" => Variable$3, - "arg" => Variable$4, + "U" => Variable$4, + "arg" => Variable$5, }, type: "functionType", upper: GlobalScope$1, variables: Array [ - Variable$3, Variable$4, + Variable$5, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/type-declaration/function/function1.ts.shot b/packages/scope-manager/tests/fixtures/type-declaration/function/function1.ts.shot index b2d5d969b77c..f9041adfda6f 100644 --- a/packages/scope-manager/tests/fixtures/type-declaration/function/function1.ts.shot +++ b/packages/scope-manager/tests/fixtures/type-declaration/function/function1.ts.shot @@ -3,7 +3,8 @@ exports[`type-declaration function function1 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ TypeDefinition$1 { name: Identifier<"T">, @@ -18,7 +19,7 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, Reference$2 { identifier: Identifier<"T">, @@ -26,13 +27,13 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: false, isTypeVariable: true, }, - Variable$2 { + Variable$3 { defs: Array [ TypeDefinition$2 { name: Identifier<"A">, @@ -44,7 +45,7 @@ ScopeManager { isValueVariable: false, isTypeVariable: true, }, - Variable$3 { + Variable$4 { defs: Array [ ParameterDefinition$3 { name: Identifier<"arg">, @@ -63,14 +64,16 @@ ScopeManager { isStrict: false, references: Array [], set: Map { - "T" => Variable$1, - "A" => Variable$2, + "const" => ImplicitGlobalConstTypeVariable, + "T" => Variable$2, + "A" => Variable$3, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, Variable$2, + Variable$3, ], }, FunctionTypeScope$2 { @@ -81,12 +84,12 @@ ScopeManager { Reference$2, ], set: Map { - "arg" => Variable$3, + "arg" => Variable$4, }, type: "functionType", upper: GlobalScope$1, variables: Array [ - Variable$3, + Variable$4, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/type-declaration/function/function2.ts.shot b/packages/scope-manager/tests/fixtures/type-declaration/function/function2.ts.shot index d741cd3f77dc..1ce6aabe88f0 100644 --- a/packages/scope-manager/tests/fixtures/type-declaration/function/function2.ts.shot +++ b/packages/scope-manager/tests/fixtures/type-declaration/function/function2.ts.shot @@ -3,7 +3,8 @@ exports[`type-declaration function function2 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ VariableDefinition$1 { name: Identifier<"arg">, @@ -19,14 +20,14 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$1, + resolved: Variable$2, writeExpr: Literal$2, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$2 { + Variable$3 { defs: Array [ TypeDefinition$2 { name: Identifier<"A">, @@ -38,7 +39,7 @@ ScopeManager { isValueVariable: false, isTypeVariable: true, }, - Variable$3 { + Variable$4 { defs: Array [ ParameterDefinition$3 { name: Identifier<"arg">, @@ -53,7 +54,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$3, + resolved: Variable$4, }, ], isValueVariable: true, @@ -68,14 +69,16 @@ ScopeManager { Reference$1, ], set: Map { - "arg" => Variable$1, - "A" => Variable$2, + "const" => ImplicitGlobalConstTypeVariable, + "arg" => Variable$2, + "A" => Variable$3, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, Variable$2, + Variable$3, ], }, FunctionTypeScope$2 { @@ -85,12 +88,12 @@ ScopeManager { Reference$2, ], set: Map { - "arg" => Variable$3, + "arg" => Variable$4, }, type: "functionType", upper: GlobalScope$1, variables: Array [ - Variable$3, + Variable$4, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/type-declaration/function/params/array-pattern.ts.shot b/packages/scope-manager/tests/fixtures/type-declaration/function/params/array-pattern.ts.shot index 409f49b66b9d..d1e79e45137a 100644 --- a/packages/scope-manager/tests/fixtures/type-declaration/function/params/array-pattern.ts.shot +++ b/packages/scope-manager/tests/fixtures/type-declaration/function/params/array-pattern.ts.shot @@ -3,7 +3,8 @@ exports[`type-declaration function params array-pattern 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ TypeDefinition$1 { name: Identifier<"Fn">, @@ -15,7 +16,7 @@ ScopeManager { isValueVariable: false, isTypeVariable: true, }, - Variable$2 { + Variable$3 { defs: Array [ TypeDefinition$2 { name: Identifier<"A">, @@ -30,13 +31,13 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$2, + resolved: Variable$3, }, ], isValueVariable: false, isTypeVariable: true, }, - Variable$3 { + Variable$4 { defs: Array [ ParameterDefinition$3 { name: Identifier<"a">, @@ -55,12 +56,14 @@ ScopeManager { isStrict: false, references: Array [], set: Map { - "Fn" => Variable$1, + "const" => ImplicitGlobalConstTypeVariable, + "Fn" => Variable$2, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, + Variable$2, ], }, TypeScope$2 { @@ -68,12 +71,12 @@ ScopeManager { isStrict: true, references: Array [], set: Map { - "A" => Variable$2, + "A" => Variable$3, }, type: "type", upper: GlobalScope$1, variables: Array [ - Variable$2, + Variable$3, ], }, FunctionTypeScope$3 { @@ -83,12 +86,12 @@ ScopeManager { Reference$1, ], set: Map { - "a" => Variable$3, + "a" => Variable$4, }, type: "functionType", upper: TypeScope$2, variables: Array [ - Variable$3, + Variable$4, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/type-declaration/function/params/object-pattern.ts.shot b/packages/scope-manager/tests/fixtures/type-declaration/function/params/object-pattern.ts.shot index 44d53bab98e3..c8a1c9dcd722 100644 --- a/packages/scope-manager/tests/fixtures/type-declaration/function/params/object-pattern.ts.shot +++ b/packages/scope-manager/tests/fixtures/type-declaration/function/params/object-pattern.ts.shot @@ -3,7 +3,8 @@ exports[`type-declaration function params object-pattern 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ TypeDefinition$1 { name: Identifier<"Fn">, @@ -15,7 +16,7 @@ ScopeManager { isValueVariable: false, isTypeVariable: true, }, - Variable$2 { + Variable$3 { defs: Array [ TypeDefinition$2 { name: Identifier<"A">, @@ -30,13 +31,13 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$2, + resolved: Variable$3, }, ], isValueVariable: false, isTypeVariable: true, }, - Variable$3 { + Variable$4 { defs: Array [ ParameterDefinition$3 { name: Identifier<"a">, @@ -55,12 +56,14 @@ ScopeManager { isStrict: false, references: Array [], set: Map { - "Fn" => Variable$1, + "const" => ImplicitGlobalConstTypeVariable, + "Fn" => Variable$2, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, + Variable$2, ], }, TypeScope$2 { @@ -68,12 +71,12 @@ ScopeManager { isStrict: true, references: Array [], set: Map { - "A" => Variable$2, + "A" => Variable$3, }, type: "type", upper: GlobalScope$1, variables: Array [ - Variable$2, + Variable$3, ], }, FunctionTypeScope$3 { @@ -83,12 +86,12 @@ ScopeManager { Reference$1, ], set: Map { - "a" => Variable$3, + "a" => Variable$4, }, type: "functionType", upper: TypeScope$2, variables: Array [ - Variable$3, + Variable$4, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/type-declaration/function/params/rest-element.ts.shot b/packages/scope-manager/tests/fixtures/type-declaration/function/params/rest-element.ts.shot index 6b69e7667d76..9ed0d680f25f 100644 --- a/packages/scope-manager/tests/fixtures/type-declaration/function/params/rest-element.ts.shot +++ b/packages/scope-manager/tests/fixtures/type-declaration/function/params/rest-element.ts.shot @@ -3,7 +3,8 @@ exports[`type-declaration function params rest-element 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ TypeDefinition$1 { name: Identifier<"Fn">, @@ -15,7 +16,7 @@ ScopeManager { isValueVariable: false, isTypeVariable: true, }, - Variable$2 { + Variable$3 { defs: Array [ TypeDefinition$2 { name: Identifier<"A">, @@ -30,13 +31,13 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$2, + resolved: Variable$3, }, ], isValueVariable: false, isTypeVariable: true, }, - Variable$3 { + Variable$4 { defs: Array [ ParameterDefinition$3 { name: Identifier<"a">, @@ -55,12 +56,14 @@ ScopeManager { isStrict: false, references: Array [], set: Map { - "Fn" => Variable$1, + "const" => ImplicitGlobalConstTypeVariable, + "Fn" => Variable$2, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, + Variable$2, ], }, TypeScope$2 { @@ -68,12 +71,12 @@ ScopeManager { isStrict: true, references: Array [], set: Map { - "A" => Variable$2, + "A" => Variable$3, }, type: "type", upper: GlobalScope$1, variables: Array [ - Variable$2, + Variable$3, ], }, FunctionTypeScope$3 { @@ -83,12 +86,12 @@ ScopeManager { Reference$1, ], set: Map { - "a" => Variable$3, + "a" => Variable$4, }, type: "functionType", upper: TypeScope$2, variables: Array [ - Variable$3, + Variable$4, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/type-declaration/index-access1.ts.shot b/packages/scope-manager/tests/fixtures/type-declaration/index-access1.ts.shot index 7178ba8d43f0..96ab00dc7734 100644 --- a/packages/scope-manager/tests/fixtures/type-declaration/index-access1.ts.shot +++ b/packages/scope-manager/tests/fixtures/type-declaration/index-access1.ts.shot @@ -3,7 +3,8 @@ exports[`type-declaration index-access1 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ TypeDefinition$1 { name: Identifier<"T">, @@ -18,13 +19,13 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: false, isTypeVariable: true, }, - Variable$2 { + Variable$3 { defs: Array [ TypeDefinition$2 { name: Identifier<"A">, @@ -45,14 +46,16 @@ ScopeManager { Reference$1, ], set: Map { - "T" => Variable$1, - "A" => Variable$2, + "const" => ImplicitGlobalConstTypeVariable, + "T" => Variable$2, + "A" => Variable$3, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, Variable$2, + Variable$3, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/type-declaration/index-access2.ts.shot b/packages/scope-manager/tests/fixtures/type-declaration/index-access2.ts.shot index dc14f5e73f66..a36547fde3fe 100644 --- a/packages/scope-manager/tests/fixtures/type-declaration/index-access2.ts.shot +++ b/packages/scope-manager/tests/fixtures/type-declaration/index-access2.ts.shot @@ -3,7 +3,8 @@ exports[`type-declaration index-access2 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ TypeDefinition$1 { name: Identifier<"T">, @@ -18,13 +19,13 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: false, isTypeVariable: true, }, - Variable$2 { + Variable$3 { defs: Array [ TypeDefinition$2 { name: Identifier<"K">, @@ -39,13 +40,13 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$2, + resolved: Variable$3, }, ], isValueVariable: false, isTypeVariable: true, }, - Variable$3 { + Variable$4 { defs: Array [ TypeDefinition$3 { name: Identifier<"A">, @@ -67,16 +68,18 @@ ScopeManager { Reference$2, ], set: Map { - "T" => Variable$1, - "K" => Variable$2, - "A" => Variable$3, + "const" => ImplicitGlobalConstTypeVariable, + "T" => Variable$2, + "K" => Variable$3, + "A" => Variable$4, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, Variable$2, Variable$3, + Variable$4, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/type-declaration/index-access3.ts.shot b/packages/scope-manager/tests/fixtures/type-declaration/index-access3.ts.shot index f4df3d244368..244ccb849244 100644 --- a/packages/scope-manager/tests/fixtures/type-declaration/index-access3.ts.shot +++ b/packages/scope-manager/tests/fixtures/type-declaration/index-access3.ts.shot @@ -3,7 +3,8 @@ exports[`type-declaration index-access3 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ TypeDefinition$1 { name: Identifier<"T">, @@ -18,13 +19,13 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: false, isTypeVariable: true, }, - Variable$2 { + Variable$3 { defs: Array [ VariableDefinition$2 { name: Identifier<"k">, @@ -40,7 +41,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$2, + resolved: Variable$3, writeExpr: Literal$3, }, Reference$2 { @@ -49,13 +50,13 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$2, + resolved: Variable$3, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$3 { + Variable$4 { defs: Array [ TypeDefinition$3 { name: Identifier<"A">, @@ -78,16 +79,18 @@ ScopeManager { Reference$3, ], set: Map { - "T" => Variable$1, - "k" => Variable$2, - "A" => Variable$3, + "const" => ImplicitGlobalConstTypeVariable, + "T" => Variable$2, + "k" => Variable$3, + "A" => Variable$4, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, Variable$2, Variable$3, + Variable$4, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/type-declaration/interface-heritage1.ts.shot b/packages/scope-manager/tests/fixtures/type-declaration/interface-heritage1.ts.shot index 0e1efcc7203f..7d232a948739 100644 --- a/packages/scope-manager/tests/fixtures/type-declaration/interface-heritage1.ts.shot +++ b/packages/scope-manager/tests/fixtures/type-declaration/interface-heritage1.ts.shot @@ -3,7 +3,8 @@ exports[`type-declaration interface-heritage1 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ TypeDefinition$1 { name: Identifier<"Parent">, @@ -18,13 +19,13 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: false, isTypeVariable: true, }, - Variable$2 { + Variable$3 { defs: Array [ TypeDefinition$2 { name: Identifier<"Foo">, @@ -45,14 +46,16 @@ ScopeManager { Reference$1, ], set: Map { - "Parent" => Variable$1, - "Foo" => Variable$2, + "const" => ImplicitGlobalConstTypeVariable, + "Parent" => Variable$2, + "Foo" => Variable$3, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, Variable$2, + Variable$3, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/type-declaration/interface-heritage2.ts.shot b/packages/scope-manager/tests/fixtures/type-declaration/interface-heritage2.ts.shot index 9c124485301b..e5e580cf99d9 100644 --- a/packages/scope-manager/tests/fixtures/type-declaration/interface-heritage2.ts.shot +++ b/packages/scope-manager/tests/fixtures/type-declaration/interface-heritage2.ts.shot @@ -3,7 +3,8 @@ exports[`type-declaration interface-heritage2 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ TypeDefinition$1 { name: Identifier<"unreferenced">, @@ -15,7 +16,7 @@ ScopeManager { isValueVariable: false, isTypeVariable: true, }, - Variable$2 { + Variable$3 { defs: Array [ TSModuleNameDefinition$2 { name: Identifier<"Member">, @@ -30,13 +31,13 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$2, + resolved: Variable$3, }, ], isValueVariable: true, isTypeVariable: true, }, - Variable$3 { + Variable$4 { defs: Array [ TypeDefinition$3 { name: Identifier<"unreferenced">, @@ -48,7 +49,7 @@ ScopeManager { isValueVariable: false, isTypeVariable: true, }, - Variable$4 { + Variable$5 { defs: Array [ TypeDefinition$4 { name: Identifier<"Foo">, @@ -69,16 +70,18 @@ ScopeManager { Reference$1, ], set: Map { - "unreferenced" => Variable$1, - "Member" => Variable$2, - "Foo" => Variable$4, + "const" => ImplicitGlobalConstTypeVariable, + "unreferenced" => Variable$2, + "Member" => Variable$3, + "Foo" => Variable$5, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, Variable$2, - Variable$4, + Variable$3, + Variable$5, ], }, TSModuleScope$2 { @@ -86,12 +89,12 @@ ScopeManager { isStrict: true, references: Array [], set: Map { - "unreferenced" => Variable$3, + "unreferenced" => Variable$4, }, type: "tsModule", upper: GlobalScope$1, variables: Array [ - Variable$3, + Variable$4, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/type-declaration/interface1.ts.shot b/packages/scope-manager/tests/fixtures/type-declaration/interface1.ts.shot index d9529e5c0b93..2ed17026820c 100644 --- a/packages/scope-manager/tests/fixtures/type-declaration/interface1.ts.shot +++ b/packages/scope-manager/tests/fixtures/type-declaration/interface1.ts.shot @@ -3,7 +3,8 @@ exports[`type-declaration interface1 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ TypeDefinition$1 { name: Identifier<"A">, @@ -22,12 +23,14 @@ ScopeManager { isStrict: false, references: Array [], set: Map { - "A" => Variable$1, + "const" => ImplicitGlobalConstTypeVariable, + "A" => Variable$2, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, + Variable$2, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/type-declaration/interface2.ts.shot b/packages/scope-manager/tests/fixtures/type-declaration/interface2.ts.shot index a8896ad86cda..2348f347e79a 100644 --- a/packages/scope-manager/tests/fixtures/type-declaration/interface2.ts.shot +++ b/packages/scope-manager/tests/fixtures/type-declaration/interface2.ts.shot @@ -3,7 +3,8 @@ exports[`type-declaration interface2 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ TypeDefinition$1 { name: Identifier<"A">, @@ -18,13 +19,13 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: false, isTypeVariable: true, }, - Variable$2 { + Variable$3 { defs: Array [ TypeDefinition$2 { name: Identifier<"B">, @@ -45,14 +46,16 @@ ScopeManager { Reference$1, ], set: Map { - "A" => Variable$1, - "B" => Variable$2, + "const" => ImplicitGlobalConstTypeVariable, + "A" => Variable$2, + "B" => Variable$3, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, Variable$2, + Variable$3, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/type-declaration/mapped.ts.shot b/packages/scope-manager/tests/fixtures/type-declaration/mapped.ts.shot index d51a5e991f46..793a715be50a 100644 --- a/packages/scope-manager/tests/fixtures/type-declaration/mapped.ts.shot +++ b/packages/scope-manager/tests/fixtures/type-declaration/mapped.ts.shot @@ -3,7 +3,8 @@ exports[`type-declaration mapped 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ TypeDefinition$1 { name: Identifier<"T">, @@ -18,13 +19,13 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: false, isTypeVariable: true, }, - Variable$2 { + Variable$3 { defs: Array [ TypeDefinition$2 { name: Identifier<"A">, @@ -36,7 +37,7 @@ ScopeManager { isValueVariable: false, isTypeVariable: true, }, - Variable$3 { + Variable$4 { defs: Array [ TypeDefinition$3 { name: Identifier<"k">, @@ -51,7 +52,7 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$3, + resolved: Variable$4, }, ], isValueVariable: false, @@ -73,14 +74,16 @@ ScopeManager { }, ], set: Map { - "T" => Variable$1, - "A" => Variable$2, + "const" => ImplicitGlobalConstTypeVariable, + "T" => Variable$2, + "A" => Variable$3, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, Variable$2, + Variable$3, ], }, MappedTypeScope$2 { @@ -91,12 +94,12 @@ ScopeManager { Reference$3, ], set: Map { - "k" => Variable$3, + "k" => Variable$4, }, type: "mappedType", upper: GlobalScope$1, variables: Array [ - Variable$3, + Variable$4, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/type-declaration/qualified-name.ts.shot b/packages/scope-manager/tests/fixtures/type-declaration/qualified-name.ts.shot index 3bc7db7e9f68..45bbe7d5ba42 100644 --- a/packages/scope-manager/tests/fixtures/type-declaration/qualified-name.ts.shot +++ b/packages/scope-manager/tests/fixtures/type-declaration/qualified-name.ts.shot @@ -3,7 +3,8 @@ exports[`type-declaration qualified-name 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ TypeDefinition$1 { name: Identifier<"T">, @@ -18,13 +19,13 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: false, isTypeVariable: true, }, - Variable$2 { + Variable$3 { defs: Array [ TypeDefinition$2 { name: Identifier<"A">, @@ -45,14 +46,16 @@ ScopeManager { Reference$1, ], set: Map { - "T" => Variable$1, - "A" => Variable$2, + "const" => ImplicitGlobalConstTypeVariable, + "T" => Variable$2, + "A" => Variable$3, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, Variable$2, + Variable$3, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/type-declaration/signatures/call-generics.ts.shot b/packages/scope-manager/tests/fixtures/type-declaration/signatures/call-generics.ts.shot index 7d922cfbe0e2..f34706c71a2f 100644 --- a/packages/scope-manager/tests/fixtures/type-declaration/signatures/call-generics.ts.shot +++ b/packages/scope-manager/tests/fixtures/type-declaration/signatures/call-generics.ts.shot @@ -3,7 +3,8 @@ exports[`type-declaration signatures call-generics 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ TypeDefinition$1 { name: Identifier<"T">, @@ -18,13 +19,13 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: false, isTypeVariable: true, }, - Variable$2 { + Variable$3 { defs: Array [ TypeDefinition$2 { name: Identifier<"A">, @@ -36,7 +37,7 @@ ScopeManager { isValueVariable: false, isTypeVariable: true, }, - Variable$3 { + Variable$4 { defs: Array [ TypeDefinition$3 { name: Identifier<"U">, @@ -51,13 +52,13 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$3, + resolved: Variable$4, }, ], isValueVariable: false, isTypeVariable: true, }, - Variable$4 { + Variable$5 { defs: Array [ ParameterDefinition$4 { name: Identifier<"arg">, @@ -76,14 +77,16 @@ ScopeManager { isStrict: false, references: Array [], set: Map { - "T" => Variable$1, - "A" => Variable$2, + "const" => ImplicitGlobalConstTypeVariable, + "T" => Variable$2, + "A" => Variable$3, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, Variable$2, + Variable$3, ], }, FunctionTypeScope$2 { @@ -94,14 +97,14 @@ ScopeManager { Reference$2, ], set: Map { - "U" => Variable$3, - "arg" => Variable$4, + "U" => Variable$4, + "arg" => Variable$5, }, type: "functionType", upper: GlobalScope$1, variables: Array [ - Variable$3, Variable$4, + Variable$5, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/type-declaration/signatures/call.ts.shot b/packages/scope-manager/tests/fixtures/type-declaration/signatures/call.ts.shot index 1589b3a4abfc..1d3fd59a25f9 100644 --- a/packages/scope-manager/tests/fixtures/type-declaration/signatures/call.ts.shot +++ b/packages/scope-manager/tests/fixtures/type-declaration/signatures/call.ts.shot @@ -3,7 +3,8 @@ exports[`type-declaration signatures call 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ TypeDefinition$1 { name: Identifier<"T">, @@ -18,7 +19,7 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, Reference$2 { identifier: Identifier<"T">, @@ -26,13 +27,13 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: false, isTypeVariable: true, }, - Variable$2 { + Variable$3 { defs: Array [ TypeDefinition$2 { name: Identifier<"A">, @@ -44,7 +45,7 @@ ScopeManager { isValueVariable: false, isTypeVariable: true, }, - Variable$3 { + Variable$4 { defs: Array [ ParameterDefinition$3 { name: Identifier<"arg">, @@ -63,14 +64,16 @@ ScopeManager { isStrict: false, references: Array [], set: Map { - "T" => Variable$1, - "A" => Variable$2, + "const" => ImplicitGlobalConstTypeVariable, + "T" => Variable$2, + "A" => Variable$3, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, Variable$2, + Variable$3, ], }, FunctionTypeScope$2 { @@ -81,12 +84,12 @@ ScopeManager { Reference$2, ], set: Map { - "arg" => Variable$3, + "arg" => Variable$4, }, type: "functionType", upper: GlobalScope$1, variables: Array [ - Variable$3, + Variable$4, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/type-declaration/signatures/construct-generics.ts.shot b/packages/scope-manager/tests/fixtures/type-declaration/signatures/construct-generics.ts.shot index 52500f8b0459..1e970692dd86 100644 --- a/packages/scope-manager/tests/fixtures/type-declaration/signatures/construct-generics.ts.shot +++ b/packages/scope-manager/tests/fixtures/type-declaration/signatures/construct-generics.ts.shot @@ -3,7 +3,8 @@ exports[`type-declaration signatures construct-generics 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ TypeDefinition$1 { name: Identifier<"T">, @@ -18,13 +19,13 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: false, isTypeVariable: true, }, - Variable$2 { + Variable$3 { defs: Array [ TypeDefinition$2 { name: Identifier<"A">, @@ -36,7 +37,7 @@ ScopeManager { isValueVariable: false, isTypeVariable: true, }, - Variable$3 { + Variable$4 { defs: Array [ TypeDefinition$3 { name: Identifier<"U">, @@ -51,13 +52,13 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$3, + resolved: Variable$4, }, ], isValueVariable: false, isTypeVariable: true, }, - Variable$4 { + Variable$5 { defs: Array [ ParameterDefinition$4 { name: Identifier<"arg">, @@ -76,14 +77,16 @@ ScopeManager { isStrict: false, references: Array [], set: Map { - "T" => Variable$1, - "A" => Variable$2, + "const" => ImplicitGlobalConstTypeVariable, + "T" => Variable$2, + "A" => Variable$3, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, Variable$2, + Variable$3, ], }, FunctionTypeScope$2 { @@ -94,14 +97,14 @@ ScopeManager { Reference$2, ], set: Map { - "U" => Variable$3, - "arg" => Variable$4, + "U" => Variable$4, + "arg" => Variable$5, }, type: "functionType", upper: GlobalScope$1, variables: Array [ - Variable$3, Variable$4, + Variable$5, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/type-declaration/signatures/construct.ts.shot b/packages/scope-manager/tests/fixtures/type-declaration/signatures/construct.ts.shot index 91e2cb0cc687..6f3b14b78acb 100644 --- a/packages/scope-manager/tests/fixtures/type-declaration/signatures/construct.ts.shot +++ b/packages/scope-manager/tests/fixtures/type-declaration/signatures/construct.ts.shot @@ -3,7 +3,8 @@ exports[`type-declaration signatures construct 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ TypeDefinition$1 { name: Identifier<"T">, @@ -18,7 +19,7 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, Reference$2 { identifier: Identifier<"T">, @@ -26,13 +27,13 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: false, isTypeVariable: true, }, - Variable$2 { + Variable$3 { defs: Array [ TypeDefinition$2 { name: Identifier<"A">, @@ -44,7 +45,7 @@ ScopeManager { isValueVariable: false, isTypeVariable: true, }, - Variable$3 { + Variable$4 { defs: Array [ ParameterDefinition$3 { name: Identifier<"arg">, @@ -63,14 +64,16 @@ ScopeManager { isStrict: false, references: Array [], set: Map { - "T" => Variable$1, - "A" => Variable$2, + "const" => ImplicitGlobalConstTypeVariable, + "T" => Variable$2, + "A" => Variable$3, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, Variable$2, + Variable$3, ], }, FunctionTypeScope$2 { @@ -81,12 +84,12 @@ ScopeManager { Reference$2, ], set: Map { - "arg" => Variable$3, + "arg" => Variable$4, }, type: "functionType", upper: GlobalScope$1, variables: Array [ - Variable$3, + Variable$4, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/type-declaration/signatures/index-sig.ts.shot b/packages/scope-manager/tests/fixtures/type-declaration/signatures/index-sig.ts.shot index a3f332dc0c67..bef377e02c54 100644 --- a/packages/scope-manager/tests/fixtures/type-declaration/signatures/index-sig.ts.shot +++ b/packages/scope-manager/tests/fixtures/type-declaration/signatures/index-sig.ts.shot @@ -3,7 +3,8 @@ exports[`type-declaration signatures index-sig 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ TypeDefinition$1 { name: Identifier<"T">, @@ -18,13 +19,13 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: false, isTypeVariable: true, }, - Variable$2 { + Variable$3 { defs: Array [ TypeDefinition$2 { name: Identifier<"A">, @@ -45,14 +46,16 @@ ScopeManager { Reference$1, ], set: Map { - "T" => Variable$1, - "A" => Variable$2, + "const" => ImplicitGlobalConstTypeVariable, + "T" => Variable$2, + "A" => Variable$3, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, Variable$2, + Variable$3, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/type-declaration/signatures/method-computed-name.ts.shot b/packages/scope-manager/tests/fixtures/type-declaration/signatures/method-computed-name.ts.shot index e3a6781c3dab..08df5624f01d 100644 --- a/packages/scope-manager/tests/fixtures/type-declaration/signatures/method-computed-name.ts.shot +++ b/packages/scope-manager/tests/fixtures/type-declaration/signatures/method-computed-name.ts.shot @@ -3,7 +3,8 @@ exports[`type-declaration signatures method-computed-name 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ VariableDefinition$1 { name: Identifier<"x">, @@ -19,7 +20,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$1, + resolved: Variable$2, writeExpr: Literal$2, }, Reference$2 { @@ -28,13 +29,13 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$2 { + Variable$3 { defs: Array [ TypeDefinition$2 { name: Identifier<"T">, @@ -49,7 +50,7 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$2, + resolved: Variable$3, }, Reference$4 { identifier: Identifier<"T">, @@ -57,13 +58,13 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$2, + resolved: Variable$3, }, ], isValueVariable: false, isTypeVariable: true, }, - Variable$3 { + Variable$4 { defs: Array [ TypeDefinition$3 { name: Identifier<"A">, @@ -75,7 +76,7 @@ ScopeManager { isValueVariable: false, isTypeVariable: true, }, - Variable$4 { + Variable$5 { defs: Array [ ParameterDefinition$4 { name: Identifier<"arg">, @@ -97,16 +98,18 @@ ScopeManager { Reference$2, ], set: Map { - "x" => Variable$1, - "T" => Variable$2, - "A" => Variable$3, + "const" => ImplicitGlobalConstTypeVariable, + "x" => Variable$2, + "T" => Variable$3, + "A" => Variable$4, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, Variable$2, Variable$3, + Variable$4, ], }, FunctionTypeScope$2 { @@ -117,12 +120,12 @@ ScopeManager { Reference$4, ], set: Map { - "arg" => Variable$4, + "arg" => Variable$5, }, type: "functionType", upper: GlobalScope$1, variables: Array [ - Variable$4, + Variable$5, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/type-declaration/signatures/method-computed-name2.ts.shot b/packages/scope-manager/tests/fixtures/type-declaration/signatures/method-computed-name2.ts.shot index 6e1a985c54fa..04dc3906220e 100644 --- a/packages/scope-manager/tests/fixtures/type-declaration/signatures/method-computed-name2.ts.shot +++ b/packages/scope-manager/tests/fixtures/type-declaration/signatures/method-computed-name2.ts.shot @@ -3,7 +3,8 @@ exports[`type-declaration signatures method-computed-name2 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ TSEnumNameDefinition$1 { name: Identifier<"Foo">, @@ -18,13 +19,13 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: true, isTypeVariable: true, }, - Variable$2 { + Variable$3 { defs: Array [ TSEnumNameDefinition$2 { name: Identifier<"Foo">, @@ -36,7 +37,7 @@ ScopeManager { isValueVariable: true, isTypeVariable: true, }, - Variable$3 { + Variable$4 { defs: Array [ TSEnumMemberDefinition$3 { name: Identifier<"a">, @@ -48,7 +49,7 @@ ScopeManager { isValueVariable: true, isTypeVariable: true, }, - Variable$4 { + Variable$5 { defs: Array [ TypeDefinition$4 { name: Identifier<"A">, @@ -69,14 +70,16 @@ ScopeManager { Reference$1, ], set: Map { - "Foo" => Variable$1, - "A" => Variable$4, + "const" => ImplicitGlobalConstTypeVariable, + "Foo" => Variable$2, + "A" => Variable$5, }, type: "global", upper: null, variables: Array [ - Variable$1, - Variable$4, + ImplicitGlobalConstTypeVariable, + Variable$2, + Variable$5, ], }, TSEnumScope$2 { @@ -84,14 +87,14 @@ ScopeManager { isStrict: true, references: Array [], set: Map { - "Foo" => Variable$2, - "a" => Variable$3, + "Foo" => Variable$3, + "a" => Variable$4, }, type: "tsEnum", upper: GlobalScope$1, variables: Array [ - Variable$2, Variable$3, + Variable$4, ], }, FunctionTypeScope$3 { diff --git a/packages/scope-manager/tests/fixtures/type-declaration/signatures/method-generics.ts.shot b/packages/scope-manager/tests/fixtures/type-declaration/signatures/method-generics.ts.shot index 91a52f5ee20d..41dc907f616a 100644 --- a/packages/scope-manager/tests/fixtures/type-declaration/signatures/method-generics.ts.shot +++ b/packages/scope-manager/tests/fixtures/type-declaration/signatures/method-generics.ts.shot @@ -3,7 +3,8 @@ exports[`type-declaration signatures method-generics 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ TypeDefinition$1 { name: Identifier<"T">, @@ -18,13 +19,13 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: false, isTypeVariable: true, }, - Variable$2 { + Variable$3 { defs: Array [ TypeDefinition$2 { name: Identifier<"A">, @@ -36,7 +37,7 @@ ScopeManager { isValueVariable: false, isTypeVariable: true, }, - Variable$3 { + Variable$4 { defs: Array [ TypeDefinition$3 { name: Identifier<"U">, @@ -51,13 +52,13 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$3, + resolved: Variable$4, }, ], isValueVariable: false, isTypeVariable: true, }, - Variable$4 { + Variable$5 { defs: Array [ ParameterDefinition$4 { name: Identifier<"arg">, @@ -76,14 +77,16 @@ ScopeManager { isStrict: false, references: Array [], set: Map { - "T" => Variable$1, - "A" => Variable$2, + "const" => ImplicitGlobalConstTypeVariable, + "T" => Variable$2, + "A" => Variable$3, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, Variable$2, + Variable$3, ], }, FunctionTypeScope$2 { @@ -94,14 +97,14 @@ ScopeManager { Reference$2, ], set: Map { - "U" => Variable$3, - "arg" => Variable$4, + "U" => Variable$4, + "arg" => Variable$5, }, type: "functionType", upper: GlobalScope$1, variables: Array [ - Variable$3, Variable$4, + Variable$5, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/type-declaration/signatures/method.ts.shot b/packages/scope-manager/tests/fixtures/type-declaration/signatures/method.ts.shot index dc72693a5542..ee4e5972e2dd 100644 --- a/packages/scope-manager/tests/fixtures/type-declaration/signatures/method.ts.shot +++ b/packages/scope-manager/tests/fixtures/type-declaration/signatures/method.ts.shot @@ -3,7 +3,8 @@ exports[`type-declaration signatures method 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ TypeDefinition$1 { name: Identifier<"T">, @@ -18,7 +19,7 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, Reference$2 { identifier: Identifier<"T">, @@ -26,13 +27,13 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: false, isTypeVariable: true, }, - Variable$2 { + Variable$3 { defs: Array [ TypeDefinition$2 { name: Identifier<"A">, @@ -44,7 +45,7 @@ ScopeManager { isValueVariable: false, isTypeVariable: true, }, - Variable$3 { + Variable$4 { defs: Array [ ParameterDefinition$3 { name: Identifier<"arg">, @@ -63,14 +64,16 @@ ScopeManager { isStrict: false, references: Array [], set: Map { - "T" => Variable$1, - "A" => Variable$2, + "const" => ImplicitGlobalConstTypeVariable, + "T" => Variable$2, + "A" => Variable$3, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, Variable$2, + Variable$3, ], }, FunctionTypeScope$2 { @@ -81,12 +84,12 @@ ScopeManager { Reference$2, ], set: Map { - "arg" => Variable$3, + "arg" => Variable$4, }, type: "functionType", upper: GlobalScope$1, variables: Array [ - Variable$3, + Variable$4, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/type-declaration/signatures/property-computed-name.ts.shot b/packages/scope-manager/tests/fixtures/type-declaration/signatures/property-computed-name.ts.shot index 760c455cecbc..3adccad9c5a3 100644 --- a/packages/scope-manager/tests/fixtures/type-declaration/signatures/property-computed-name.ts.shot +++ b/packages/scope-manager/tests/fixtures/type-declaration/signatures/property-computed-name.ts.shot @@ -3,7 +3,8 @@ exports[`type-declaration signatures property-computed-name 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ VariableDefinition$1 { name: Identifier<"x">, @@ -19,7 +20,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$1, + resolved: Variable$2, writeExpr: Literal$2, }, Reference$2 { @@ -28,13 +29,13 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$2 { + Variable$3 { defs: Array [ TypeDefinition$2 { name: Identifier<"T">, @@ -49,13 +50,13 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$2, + resolved: Variable$3, }, ], isValueVariable: false, isTypeVariable: true, }, - Variable$3 { + Variable$4 { defs: Array [ TypeDefinition$3 { name: Identifier<"A">, @@ -78,16 +79,18 @@ ScopeManager { Reference$3, ], set: Map { - "x" => Variable$1, - "T" => Variable$2, - "A" => Variable$3, + "const" => ImplicitGlobalConstTypeVariable, + "x" => Variable$2, + "T" => Variable$3, + "A" => Variable$4, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, Variable$2, Variable$3, + Variable$4, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/type-declaration/signatures/property-computed-name2.ts.shot b/packages/scope-manager/tests/fixtures/type-declaration/signatures/property-computed-name2.ts.shot index 6990f46221b6..a723f32c995d 100644 --- a/packages/scope-manager/tests/fixtures/type-declaration/signatures/property-computed-name2.ts.shot +++ b/packages/scope-manager/tests/fixtures/type-declaration/signatures/property-computed-name2.ts.shot @@ -3,7 +3,8 @@ exports[`type-declaration signatures property-computed-name2 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ TSEnumNameDefinition$1 { name: Identifier<"Foo">, @@ -18,13 +19,13 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: true, isTypeVariable: true, }, - Variable$2 { + Variable$3 { defs: Array [ TSEnumNameDefinition$2 { name: Identifier<"Foo">, @@ -36,7 +37,7 @@ ScopeManager { isValueVariable: true, isTypeVariable: true, }, - Variable$3 { + Variable$4 { defs: Array [ TSEnumMemberDefinition$3 { name: Identifier<"a">, @@ -48,7 +49,7 @@ ScopeManager { isValueVariable: true, isTypeVariable: true, }, - Variable$4 { + Variable$5 { defs: Array [ TypeDefinition$4 { name: Identifier<"A">, @@ -69,14 +70,16 @@ ScopeManager { Reference$1, ], set: Map { - "Foo" => Variable$1, - "A" => Variable$4, + "const" => ImplicitGlobalConstTypeVariable, + "Foo" => Variable$2, + "A" => Variable$5, }, type: "global", upper: null, variables: Array [ - Variable$1, - Variable$4, + ImplicitGlobalConstTypeVariable, + Variable$2, + Variable$5, ], }, TSEnumScope$2 { @@ -84,14 +87,14 @@ ScopeManager { isStrict: true, references: Array [], set: Map { - "Foo" => Variable$2, - "a" => Variable$3, + "Foo" => Variable$3, + "a" => Variable$4, }, type: "tsEnum", upper: GlobalScope$1, variables: Array [ - Variable$2, Variable$3, + Variable$4, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/type-declaration/signatures/property.ts.shot b/packages/scope-manager/tests/fixtures/type-declaration/signatures/property.ts.shot index 141b1ed8573f..4526e0803064 100644 --- a/packages/scope-manager/tests/fixtures/type-declaration/signatures/property.ts.shot +++ b/packages/scope-manager/tests/fixtures/type-declaration/signatures/property.ts.shot @@ -3,7 +3,8 @@ exports[`type-declaration signatures property 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ TypeDefinition$1 { name: Identifier<"T">, @@ -18,13 +19,13 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: false, isTypeVariable: true, }, - Variable$2 { + Variable$3 { defs: Array [ TypeDefinition$2 { name: Identifier<"A">, @@ -45,14 +46,16 @@ ScopeManager { Reference$1, ], set: Map { - "T" => Variable$1, - "A" => Variable$2, + "const" => ImplicitGlobalConstTypeVariable, + "T" => Variable$2, + "A" => Variable$3, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, Variable$2, + Variable$3, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/type-declaration/tuple-labelled-rest.ts.shot b/packages/scope-manager/tests/fixtures/type-declaration/tuple-labelled-rest.ts.shot index aa19e53592c8..ee18e019f8bd 100644 --- a/packages/scope-manager/tests/fixtures/type-declaration/tuple-labelled-rest.ts.shot +++ b/packages/scope-manager/tests/fixtures/type-declaration/tuple-labelled-rest.ts.shot @@ -3,7 +3,8 @@ exports[`type-declaration tuple-labelled-rest 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ TypeDefinition$1 { name: Identifier<"T">, @@ -18,13 +19,13 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: false, isTypeVariable: true, }, - Variable$2 { + Variable$3 { defs: Array [ TypeDefinition$2 { name: Identifier<"A">, @@ -45,14 +46,16 @@ ScopeManager { Reference$1, ], set: Map { - "T" => Variable$1, - "A" => Variable$2, + "const" => ImplicitGlobalConstTypeVariable, + "T" => Variable$2, + "A" => Variable$3, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, Variable$2, + Variable$3, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/type-declaration/tuple-labelled.ts.shot b/packages/scope-manager/tests/fixtures/type-declaration/tuple-labelled.ts.shot index 3f85c59ef202..c6217bd67802 100644 --- a/packages/scope-manager/tests/fixtures/type-declaration/tuple-labelled.ts.shot +++ b/packages/scope-manager/tests/fixtures/type-declaration/tuple-labelled.ts.shot @@ -3,7 +3,8 @@ exports[`type-declaration tuple-labelled 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ TypeDefinition$1 { name: Identifier<"T1">, @@ -18,13 +19,13 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: false, isTypeVariable: true, }, - Variable$2 { + Variable$3 { defs: Array [ TypeDefinition$2 { name: Identifier<"T2">, @@ -39,13 +40,13 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$2, + resolved: Variable$3, }, ], isValueVariable: false, isTypeVariable: true, }, - Variable$3 { + Variable$4 { defs: Array [ TypeDefinition$3 { name: Identifier<"A">, @@ -67,16 +68,18 @@ ScopeManager { Reference$2, ], set: Map { - "T1" => Variable$1, - "T2" => Variable$2, - "A" => Variable$3, + "const" => ImplicitGlobalConstTypeVariable, + "T1" => Variable$2, + "T2" => Variable$3, + "A" => Variable$4, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, Variable$2, Variable$3, + Variable$4, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/type-declaration/tuple-rest.ts.shot b/packages/scope-manager/tests/fixtures/type-declaration/tuple-rest.ts.shot index 0a366c9afef7..51e162440a49 100644 --- a/packages/scope-manager/tests/fixtures/type-declaration/tuple-rest.ts.shot +++ b/packages/scope-manager/tests/fixtures/type-declaration/tuple-rest.ts.shot @@ -3,7 +3,8 @@ exports[`type-declaration tuple-rest 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ TypeDefinition$1 { name: Identifier<"T">, @@ -18,13 +19,13 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: false, isTypeVariable: true, }, - Variable$2 { + Variable$3 { defs: Array [ TypeDefinition$2 { name: Identifier<"A">, @@ -45,14 +46,16 @@ ScopeManager { Reference$1, ], set: Map { - "T" => Variable$1, - "A" => Variable$2, + "const" => ImplicitGlobalConstTypeVariable, + "T" => Variable$2, + "A" => Variable$3, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, Variable$2, + Variable$3, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/type-declaration/tuple.ts.shot b/packages/scope-manager/tests/fixtures/type-declaration/tuple.ts.shot index 900b5aa4b7ad..d47d7eef009c 100644 --- a/packages/scope-manager/tests/fixtures/type-declaration/tuple.ts.shot +++ b/packages/scope-manager/tests/fixtures/type-declaration/tuple.ts.shot @@ -3,7 +3,8 @@ exports[`type-declaration tuple 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ TypeDefinition$1 { name: Identifier<"T">, @@ -18,13 +19,13 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: false, isTypeVariable: true, }, - Variable$2 { + Variable$3 { defs: Array [ TypeDefinition$2 { name: Identifier<"A">, @@ -45,14 +46,16 @@ ScopeManager { Reference$1, ], set: Map { - "T" => Variable$1, - "A" => Variable$2, + "const" => ImplicitGlobalConstTypeVariable, + "T" => Variable$2, + "A" => Variable$3, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, Variable$2, + Variable$3, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/type-declaration/type-parameters/interface/body-reference.ts.shot b/packages/scope-manager/tests/fixtures/type-declaration/type-parameters/interface/body-reference.ts.shot index 7747bfe26651..b3c29ba227d8 100644 --- a/packages/scope-manager/tests/fixtures/type-declaration/type-parameters/interface/body-reference.ts.shot +++ b/packages/scope-manager/tests/fixtures/type-declaration/type-parameters/interface/body-reference.ts.shot @@ -3,7 +3,8 @@ exports[`type-declaration type-parameters interface body-reference 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ TypeDefinition$1 { name: Identifier<"Foo">, @@ -15,7 +16,7 @@ ScopeManager { isValueVariable: false, isTypeVariable: true, }, - Variable$2 { + Variable$3 { defs: Array [ TypeDefinition$2 { name: Identifier<"T">, @@ -30,7 +31,7 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$2, + resolved: Variable$3, }, ], isValueVariable: false, @@ -43,12 +44,14 @@ ScopeManager { isStrict: false, references: Array [], set: Map { - "Foo" => Variable$1, + "const" => ImplicitGlobalConstTypeVariable, + "Foo" => Variable$2, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, + Variable$2, ], }, TypeScope$2 { @@ -58,12 +61,12 @@ ScopeManager { Reference$1, ], set: Map { - "T" => Variable$2, + "T" => Variable$3, }, type: "type", upper: GlobalScope$1, variables: Array [ - Variable$2, + Variable$3, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/type-declaration/type-parameters/interface/extends-reference.ts.shot b/packages/scope-manager/tests/fixtures/type-declaration/type-parameters/interface/extends-reference.ts.shot index a118b1bd50c4..0ae78c63d470 100644 --- a/packages/scope-manager/tests/fixtures/type-declaration/type-parameters/interface/extends-reference.ts.shot +++ b/packages/scope-manager/tests/fixtures/type-declaration/type-parameters/interface/extends-reference.ts.shot @@ -3,7 +3,8 @@ exports[`type-declaration type-parameters interface extends-reference 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ TypeDefinition$1 { name: Identifier<"A">, @@ -18,13 +19,13 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: false, isTypeVariable: true, }, - Variable$2 { + Variable$3 { defs: Array [ TypeDefinition$2 { name: Identifier<"T">, @@ -36,7 +37,7 @@ ScopeManager { isValueVariable: false, isTypeVariable: true, }, - Variable$3 { + Variable$4 { defs: Array [ TypeDefinition$3 { name: Identifier<"Foo">, @@ -48,7 +49,7 @@ ScopeManager { isValueVariable: false, isTypeVariable: true, }, - Variable$4 { + Variable$5 { defs: Array [ TypeDefinition$4 { name: Identifier<"T">, @@ -63,7 +64,7 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$4, + resolved: Variable$5, }, ], isValueVariable: false, @@ -76,14 +77,16 @@ ScopeManager { isStrict: false, references: Array [], set: Map { - "A" => Variable$1, - "Foo" => Variable$3, + "const" => ImplicitGlobalConstTypeVariable, + "A" => Variable$2, + "Foo" => Variable$4, }, type: "global", upper: null, variables: Array [ - Variable$1, - Variable$3, + ImplicitGlobalConstTypeVariable, + Variable$2, + Variable$4, ], }, TypeScope$2 { @@ -91,12 +94,12 @@ ScopeManager { isStrict: true, references: Array [], set: Map { - "T" => Variable$2, + "T" => Variable$3, }, type: "type", upper: GlobalScope$1, variables: Array [ - Variable$2, + Variable$3, ], }, TypeScope$3 { @@ -107,12 +110,12 @@ ScopeManager { Reference$2, ], set: Map { - "T" => Variable$4, + "T" => Variable$5, }, type: "type", upper: GlobalScope$1, variables: Array [ - Variable$4, + Variable$5, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/type-declaration/type-parameters/interface/type-param-reference.ts.shot b/packages/scope-manager/tests/fixtures/type-declaration/type-parameters/interface/type-param-reference.ts.shot index d42193f3e7b0..0556d9dfca19 100644 --- a/packages/scope-manager/tests/fixtures/type-declaration/type-parameters/interface/type-param-reference.ts.shot +++ b/packages/scope-manager/tests/fixtures/type-declaration/type-parameters/interface/type-param-reference.ts.shot @@ -3,7 +3,8 @@ exports[`type-declaration type-parameters interface type-param-reference 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ TypeDefinition$1 { name: Identifier<"Foo">, @@ -15,7 +16,7 @@ ScopeManager { isValueVariable: false, isTypeVariable: true, }, - Variable$2 { + Variable$3 { defs: Array [ TypeDefinition$2 { name: Identifier<"T">, @@ -30,13 +31,13 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$2, + resolved: Variable$3, }, ], isValueVariable: false, isTypeVariable: true, }, - Variable$3 { + Variable$4 { defs: Array [ TypeDefinition$3 { name: Identifier<"U">, @@ -55,12 +56,14 @@ ScopeManager { isStrict: false, references: Array [], set: Map { - "Foo" => Variable$1, + "const" => ImplicitGlobalConstTypeVariable, + "Foo" => Variable$2, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, + Variable$2, ], }, TypeScope$2 { @@ -70,14 +73,14 @@ ScopeManager { Reference$1, ], set: Map { - "T" => Variable$2, - "U" => Variable$3, + "T" => Variable$3, + "U" => Variable$4, }, type: "type", upper: GlobalScope$1, variables: Array [ - Variable$2, Variable$3, + Variable$4, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/type-declaration/type-parameters/interface/type-parameter-declaration-extends.ts.shot b/packages/scope-manager/tests/fixtures/type-declaration/type-parameters/interface/type-parameter-declaration-extends.ts.shot index b0a8f67b10d4..f69b99b5f1fa 100644 --- a/packages/scope-manager/tests/fixtures/type-declaration/type-parameters/interface/type-parameter-declaration-extends.ts.shot +++ b/packages/scope-manager/tests/fixtures/type-declaration/type-parameters/interface/type-parameter-declaration-extends.ts.shot @@ -3,7 +3,8 @@ exports[`type-declaration type-parameters interface type-parameter-declaration-extends 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ TypeDefinition$1 { name: Identifier<"Foo">, @@ -15,7 +16,7 @@ ScopeManager { isValueVariable: false, isTypeVariable: true, }, - Variable$2 { + Variable$3 { defs: Array [ TypeDefinition$2 { name: Identifier<"T">, @@ -30,13 +31,13 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$2, + resolved: Variable$3, }, ], isValueVariable: false, isTypeVariable: true, }, - Variable$3 { + Variable$4 { defs: Array [ TypeDefinition$3 { name: Identifier<"U">, @@ -55,12 +56,14 @@ ScopeManager { isStrict: false, references: Array [], set: Map { - "Foo" => Variable$1, + "const" => ImplicitGlobalConstTypeVariable, + "Foo" => Variable$2, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, + Variable$2, ], }, TypeScope$2 { @@ -70,14 +73,14 @@ ScopeManager { Reference$1, ], set: Map { - "T" => Variable$2, - "U" => Variable$3, + "T" => Variable$3, + "U" => Variable$4, }, type: "type", upper: GlobalScope$1, variables: Array [ - Variable$2, Variable$3, + Variable$4, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/type-declaration/type-parameters/interface/type-parameter-declaration.ts.shot b/packages/scope-manager/tests/fixtures/type-declaration/type-parameters/interface/type-parameter-declaration.ts.shot index 9c02a51b1bf4..e0d9a8d70736 100644 --- a/packages/scope-manager/tests/fixtures/type-declaration/type-parameters/interface/type-parameter-declaration.ts.shot +++ b/packages/scope-manager/tests/fixtures/type-declaration/type-parameters/interface/type-parameter-declaration.ts.shot @@ -3,7 +3,8 @@ exports[`type-declaration type-parameters interface type-parameter-declaration 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ TypeDefinition$1 { name: Identifier<"Foo">, @@ -15,7 +16,7 @@ ScopeManager { isValueVariable: false, isTypeVariable: true, }, - Variable$2 { + Variable$3 { defs: Array [ TypeDefinition$2 { name: Identifier<"T">, @@ -27,7 +28,7 @@ ScopeManager { isValueVariable: false, isTypeVariable: true, }, - Variable$3 { + Variable$4 { defs: Array [ TypeDefinition$3 { name: Identifier<"Unresolved">, @@ -55,14 +56,16 @@ ScopeManager { }, ], set: Map { - "Foo" => Variable$1, - "Unresolved" => Variable$3, + "const" => ImplicitGlobalConstTypeVariable, + "Foo" => Variable$2, + "Unresolved" => Variable$4, }, type: "global", upper: null, variables: Array [ - Variable$1, - Variable$3, + ImplicitGlobalConstTypeVariable, + Variable$2, + Variable$4, ], }, TypeScope$2 { @@ -70,12 +73,12 @@ ScopeManager { isStrict: true, references: Array [], set: Map { - "T" => Variable$2, + "T" => Variable$3, }, type: "type", upper: GlobalScope$1, variables: Array [ - Variable$2, + Variable$3, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/type-declaration/type-parameters/tagged-template.ts.shot b/packages/scope-manager/tests/fixtures/type-declaration/type-parameters/tagged-template.ts.shot index 20b355c1df3b..51d496f17c39 100644 --- a/packages/scope-manager/tests/fixtures/type-declaration/type-parameters/tagged-template.ts.shot +++ b/packages/scope-manager/tests/fixtures/type-declaration/type-parameters/tagged-template.ts.shot @@ -3,7 +3,8 @@ exports[`type-declaration type-parameters tagged-template 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ TypeDefinition$1 { name: Identifier<"StyledPaymentProps">, @@ -18,13 +19,13 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: false, isTypeVariable: true, }, - Variable$2 { + Variable$3 { defs: Array [ FunctionNameDefinition$2 { name: Identifier<"div">, @@ -39,20 +40,20 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$2, + resolved: Variable$3, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$3 { + Variable$4 { defs: Array [], name: "arguments", references: Array [], isValueVariable: true, isTypeVariable: true, }, - Variable$4 { + Variable$5 { defs: Array [ ParameterDefinition$3 { name: Identifier<"arg">, @@ -64,7 +65,7 @@ ScopeManager { isValueVariable: true, isTypeVariable: false, }, - Variable$5 { + Variable$6 { defs: Array [ TypeDefinition$4 { name: Identifier<"T">, @@ -76,7 +77,7 @@ ScopeManager { isValueVariable: false, isTypeVariable: true, }, - Variable$6 { + Variable$7 { defs: Array [ VariableDefinition$5 { name: Identifier<"StyledPayment">, @@ -92,7 +93,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$6, + resolved: Variable$7, writeExpr: TaggedTemplateExpression$5, }, ], @@ -110,16 +111,18 @@ ScopeManager { Reference$3, ], set: Map { - "StyledPaymentProps" => Variable$1, - "div" => Variable$2, - "StyledPayment" => Variable$6, + "const" => ImplicitGlobalConstTypeVariable, + "StyledPaymentProps" => Variable$2, + "div" => Variable$3, + "StyledPayment" => Variable$7, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, Variable$2, - Variable$6, + Variable$3, + Variable$7, ], }, FunctionScope$2 { @@ -127,16 +130,16 @@ ScopeManager { isStrict: false, references: Array [], set: Map { - "arguments" => Variable$3, - "arg" => Variable$4, - "T" => Variable$5, + "arguments" => Variable$4, + "arg" => Variable$5, + "T" => Variable$6, }, type: "function", upper: GlobalScope$1, variables: Array [ - Variable$3, Variable$4, Variable$5, + Variable$6, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/type-declaration/type-parameters/type-decl/body-reference.ts.shot b/packages/scope-manager/tests/fixtures/type-declaration/type-parameters/type-decl/body-reference.ts.shot index 9918099ea500..708f3b64ab7c 100644 --- a/packages/scope-manager/tests/fixtures/type-declaration/type-parameters/type-decl/body-reference.ts.shot +++ b/packages/scope-manager/tests/fixtures/type-declaration/type-parameters/type-decl/body-reference.ts.shot @@ -3,7 +3,8 @@ exports[`type-declaration type-parameters type-decl body-reference 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ TypeDefinition$1 { name: Identifier<"Foo">, @@ -15,7 +16,7 @@ ScopeManager { isValueVariable: false, isTypeVariable: true, }, - Variable$2 { + Variable$3 { defs: Array [ TypeDefinition$2 { name: Identifier<"T">, @@ -30,7 +31,7 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$2, + resolved: Variable$3, }, ], isValueVariable: false, @@ -43,12 +44,14 @@ ScopeManager { isStrict: false, references: Array [], set: Map { - "Foo" => Variable$1, + "const" => ImplicitGlobalConstTypeVariable, + "Foo" => Variable$2, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, + Variable$2, ], }, TypeScope$2 { @@ -58,12 +61,12 @@ ScopeManager { Reference$1, ], set: Map { - "T" => Variable$2, + "T" => Variable$3, }, type: "type", upper: GlobalScope$1, variables: Array [ - Variable$2, + Variable$3, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/type-declaration/type-parameters/type-decl/type-param-reference.ts.shot b/packages/scope-manager/tests/fixtures/type-declaration/type-parameters/type-decl/type-param-reference.ts.shot index f578e66c181a..e0c4773c4739 100644 --- a/packages/scope-manager/tests/fixtures/type-declaration/type-parameters/type-decl/type-param-reference.ts.shot +++ b/packages/scope-manager/tests/fixtures/type-declaration/type-parameters/type-decl/type-param-reference.ts.shot @@ -3,7 +3,8 @@ exports[`type-declaration type-parameters type-decl type-param-reference 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ TypeDefinition$1 { name: Identifier<"Foo">, @@ -15,7 +16,7 @@ ScopeManager { isValueVariable: false, isTypeVariable: true, }, - Variable$2 { + Variable$3 { defs: Array [ TypeDefinition$2 { name: Identifier<"T">, @@ -30,13 +31,13 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$2, + resolved: Variable$3, }, ], isValueVariable: false, isTypeVariable: true, }, - Variable$3 { + Variable$4 { defs: Array [ TypeDefinition$3 { name: Identifier<"U">, @@ -55,12 +56,14 @@ ScopeManager { isStrict: false, references: Array [], set: Map { - "Foo" => Variable$1, + "const" => ImplicitGlobalConstTypeVariable, + "Foo" => Variable$2, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, + Variable$2, ], }, TypeScope$2 { @@ -70,14 +73,14 @@ ScopeManager { Reference$1, ], set: Map { - "T" => Variable$2, - "U" => Variable$3, + "T" => Variable$3, + "U" => Variable$4, }, type: "type", upper: GlobalScope$1, variables: Array [ - Variable$2, Variable$3, + Variable$4, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/type-declaration/type-parameters/type-decl/type-parameter-declaration-extends.ts.shot b/packages/scope-manager/tests/fixtures/type-declaration/type-parameters/type-decl/type-parameter-declaration-extends.ts.shot index 79cd31f22818..ffd470e8a167 100644 --- a/packages/scope-manager/tests/fixtures/type-declaration/type-parameters/type-decl/type-parameter-declaration-extends.ts.shot +++ b/packages/scope-manager/tests/fixtures/type-declaration/type-parameters/type-decl/type-parameter-declaration-extends.ts.shot @@ -3,7 +3,8 @@ exports[`type-declaration type-parameters type-decl type-parameter-declaration-extends 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ TypeDefinition$1 { name: Identifier<"Foo">, @@ -15,7 +16,7 @@ ScopeManager { isValueVariable: false, isTypeVariable: true, }, - Variable$2 { + Variable$3 { defs: Array [ TypeDefinition$2 { name: Identifier<"T">, @@ -30,13 +31,13 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$2, + resolved: Variable$3, }, ], isValueVariable: false, isTypeVariable: true, }, - Variable$3 { + Variable$4 { defs: Array [ TypeDefinition$3 { name: Identifier<"U">, @@ -55,12 +56,14 @@ ScopeManager { isStrict: false, references: Array [], set: Map { - "Foo" => Variable$1, + "const" => ImplicitGlobalConstTypeVariable, + "Foo" => Variable$2, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, + Variable$2, ], }, TypeScope$2 { @@ -70,14 +73,14 @@ ScopeManager { Reference$1, ], set: Map { - "T" => Variable$2, - "U" => Variable$3, + "T" => Variable$3, + "U" => Variable$4, }, type: "type", upper: GlobalScope$1, variables: Array [ - Variable$2, Variable$3, + Variable$4, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/type-declaration/type-parameters/type-decl/type-parameter-declaration.ts.shot b/packages/scope-manager/tests/fixtures/type-declaration/type-parameters/type-decl/type-parameter-declaration.ts.shot index ec17c73dbacb..3aad34fefaab 100644 --- a/packages/scope-manager/tests/fixtures/type-declaration/type-parameters/type-decl/type-parameter-declaration.ts.shot +++ b/packages/scope-manager/tests/fixtures/type-declaration/type-parameters/type-decl/type-parameter-declaration.ts.shot @@ -3,7 +3,8 @@ exports[`type-declaration type-parameters type-decl type-parameter-declaration 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ TypeDefinition$1 { name: Identifier<"Foo">, @@ -15,7 +16,7 @@ ScopeManager { isValueVariable: false, isTypeVariable: true, }, - Variable$2 { + Variable$3 { defs: Array [ TypeDefinition$2 { name: Identifier<"T">, @@ -27,7 +28,7 @@ ScopeManager { isValueVariable: false, isTypeVariable: true, }, - Variable$3 { + Variable$4 { defs: Array [ TypeDefinition$3 { name: Identifier<"Unresolved">, @@ -55,14 +56,16 @@ ScopeManager { }, ], set: Map { - "Foo" => Variable$1, - "Unresolved" => Variable$3, + "const" => ImplicitGlobalConstTypeVariable, + "Foo" => Variable$2, + "Unresolved" => Variable$4, }, type: "global", upper: null, variables: Array [ - Variable$1, - Variable$3, + ImplicitGlobalConstTypeVariable, + Variable$2, + Variable$4, ], }, TypeScope$2 { @@ -70,12 +73,12 @@ ScopeManager { isStrict: true, references: Array [], set: Map { - "T" => Variable$2, + "T" => Variable$3, }, type: "type", upper: GlobalScope$1, variables: Array [ - Variable$2, + Variable$3, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/type-declaration/type-query.ts.shot b/packages/scope-manager/tests/fixtures/type-declaration/type-query.ts.shot index c34e6437e7b1..c59a91eee9dc 100644 --- a/packages/scope-manager/tests/fixtures/type-declaration/type-query.ts.shot +++ b/packages/scope-manager/tests/fixtures/type-declaration/type-query.ts.shot @@ -3,7 +3,8 @@ exports[`type-declaration type-query 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ VariableDefinition$1 { name: Identifier<"x">, @@ -19,7 +20,7 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: true, - resolved: Variable$1, + resolved: Variable$2, writeExpr: Literal$2, }, Reference$2 { @@ -28,13 +29,13 @@ ScopeManager { isTypeReference: false, isValueReference: true, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: true, isTypeVariable: false, }, - Variable$2 { + Variable$3 { defs: Array [ TypeDefinition$2 { name: Identifier<"T">, @@ -46,7 +47,7 @@ ScopeManager { isValueVariable: false, isTypeVariable: true, }, - Variable$3 { + Variable$4 { defs: Array [ TypeDefinition$3 { name: Identifier<"Unresolved">, @@ -76,16 +77,18 @@ ScopeManager { }, ], set: Map { - "x" => Variable$1, - "T" => Variable$2, - "Unresolved" => Variable$3, + "const" => ImplicitGlobalConstTypeVariable, + "x" => Variable$2, + "T" => Variable$3, + "Unresolved" => Variable$4, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, Variable$2, Variable$3, + Variable$4, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/type-declaration/type1.ts.shot b/packages/scope-manager/tests/fixtures/type-declaration/type1.ts.shot index 9328ce21e141..fd26de02af9a 100644 --- a/packages/scope-manager/tests/fixtures/type-declaration/type1.ts.shot +++ b/packages/scope-manager/tests/fixtures/type-declaration/type1.ts.shot @@ -3,7 +3,8 @@ exports[`type-declaration type1 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ TypeDefinition$1 { name: Identifier<"T">, @@ -22,12 +23,14 @@ ScopeManager { isStrict: false, references: Array [], set: Map { - "T" => Variable$1, + "const" => ImplicitGlobalConstTypeVariable, + "T" => Variable$2, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, + Variable$2, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/type-declaration/type2.ts.shot b/packages/scope-manager/tests/fixtures/type-declaration/type2.ts.shot index 670f3979593d..d3ee411e1d7c 100644 --- a/packages/scope-manager/tests/fixtures/type-declaration/type2.ts.shot +++ b/packages/scope-manager/tests/fixtures/type-declaration/type2.ts.shot @@ -3,7 +3,8 @@ exports[`type-declaration type2 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ TypeDefinition$1 { name: Identifier<"A">, @@ -18,13 +19,13 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: false, isTypeVariable: true, }, - Variable$2 { + Variable$3 { defs: Array [ TypeDefinition$2 { name: Identifier<"B">, @@ -45,14 +46,16 @@ ScopeManager { Reference$1, ], set: Map { - "A" => Variable$1, - "B" => Variable$2, + "const" => ImplicitGlobalConstTypeVariable, + "A" => Variable$2, + "B" => Variable$3, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, Variable$2, + Variable$3, ], }, ], diff --git a/packages/scope-manager/tests/fixtures/type-declaration/type3.ts.shot b/packages/scope-manager/tests/fixtures/type-declaration/type3.ts.shot index 89aab769a7e9..32a193ed0df6 100644 --- a/packages/scope-manager/tests/fixtures/type-declaration/type3.ts.shot +++ b/packages/scope-manager/tests/fixtures/type-declaration/type3.ts.shot @@ -3,7 +3,8 @@ exports[`type-declaration type3 1`] = ` ScopeManager { variables: Array [ - Variable$1 { + ImplicitGlobalConstTypeVariable, + Variable$2 { defs: Array [ TypeDefinition$1 { name: Identifier<"T">, @@ -18,13 +19,13 @@ ScopeManager { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$1, + resolved: Variable$2, }, ], isValueVariable: false, isTypeVariable: true, }, - Variable$2 { + Variable$3 { defs: Array [ TypeDefinition$2 { name: Identifier<"A">, @@ -45,14 +46,16 @@ ScopeManager { Reference$1, ], set: Map { - "T" => Variable$1, - "A" => Variable$2, + "const" => ImplicitGlobalConstTypeVariable, + "T" => Variable$2, + "A" => Variable$3, }, type: "global", upper: null, variables: Array [ - Variable$1, + ImplicitGlobalConstTypeVariable, Variable$2, + Variable$3, ], }, ], diff --git a/packages/scope-manager/tests/lib.test.ts b/packages/scope-manager/tests/lib.test.ts index 941532bd475a..97573cef7da1 100644 --- a/packages/scope-manager/tests/lib.test.ts +++ b/packages/scope-manager/tests/lib.test.ts @@ -8,7 +8,7 @@ describe('implicit lib definitions', () => { }); const variables = scopeManager.variables; - expect(variables).toHaveLength(0); + expect(variables).toHaveLength(1); }); it('should define implicit variables', () => { @@ -17,7 +17,7 @@ describe('implicit lib definitions', () => { }); const variables = scopeManager.variables; - expect(variables.length).toBeGreaterThan(0); + expect(variables.length).toBeGreaterThan(1); const variable = variables[0]; expect(variable).toBeInstanceOf(ImplicitLibVariable); diff --git a/packages/scope-manager/tests/types/variable-definition.test.ts b/packages/scope-manager/tests/types/variable-definition.test.ts index 3e25c94aef34..e7ea065516af 100644 --- a/packages/scope-manager/tests/types/variable-definition.test.ts +++ b/packages/scope-manager/tests/types/variable-definition.test.ts @@ -9,7 +9,7 @@ describe('variable definition', () => { const node = getSpecificNode(ast, AST_NODE_TYPES.TSTypeAliasDeclaration); expect(scopeManager.getDeclaredVariables(node)).toMatchInlineSnapshot(` Array [ - Variable$1 { + Variable$2 { defs: Array [ TypeDefinition$1 { name: Identifier<"TypeDecl">, @@ -34,7 +34,7 @@ describe('variable definition', () => { const node = getSpecificNode(ast, AST_NODE_TYPES.TSInterfaceDeclaration); expect(scopeManager.getDeclaredVariables(node)).toMatchInlineSnapshot(` Array [ - Variable$1 { + Variable$2 { defs: Array [ TypeDefinition$1 { name: Identifier<"InterfaceDecl">, @@ -57,7 +57,7 @@ describe('variable definition', () => { const node = getSpecificNode(ast, AST_NODE_TYPES.TSTypeParameter); expect(scopeManager.getDeclaredVariables(node)).toMatchInlineSnapshot(` Array [ - Variable$2 { + Variable$3 { defs: Array [ TypeDefinition$2 { name: Identifier<"TypeParam">, @@ -84,7 +84,7 @@ describe('variable definition', () => { ); expect(scopeManager.getDeclaredVariables(node)).toMatchInlineSnapshot(` Array [ - Variable$3 { + Variable$4 { defs: Array [ TypeDefinition$3 { name: Identifier<"Inferred">, @@ -99,7 +99,7 @@ describe('variable definition', () => { isTypeReference: true, isValueReference: false, isWrite: false, - resolved: Variable$3, + resolved: Variable$4, }, ], isValueVariable: false, diff --git a/packages/scope-manager/tests/util/index.ts b/packages/scope-manager/tests/util/index.ts index 295dda41ae72..ff8b65133d46 100644 --- a/packages/scope-manager/tests/util/index.ts +++ b/packages/scope-manager/tests/util/index.ts @@ -1,3 +1,4 @@ export * from './expect'; export * from './getSpecificNode'; +export * from './misc'; export * from './parse'; diff --git a/packages/scope-manager/tests/util/misc.ts b/packages/scope-manager/tests/util/misc.ts new file mode 100644 index 000000000000..8a7062a5bf45 --- /dev/null +++ b/packages/scope-manager/tests/util/misc.ts @@ -0,0 +1,7 @@ +import { ImplicitLibVariable, Variable } from '../../src'; + +function getRealVariables(variables: Variable[]): Variable[] { + return variables.filter(v => !(v instanceof ImplicitLibVariable)); +} + +export { getRealVariables }; diff --git a/packages/scope-manager/tests/util/serializers/Variable.ts b/packages/scope-manager/tests/util/serializers/Variable.ts index 55dbe2fa9b83..504bdc516ce3 100644 --- a/packages/scope-manager/tests/util/serializers/Variable.ts +++ b/packages/scope-manager/tests/util/serializers/Variable.ts @@ -1,5 +1,5 @@ import { createSerializer } from './baseSerializer'; -import { Variable } from '../../../src/variable'; +import { ImplicitLibVariable, Variable } from '../../../src/variable'; const serializer = createSerializer(Variable, [ // @@ -9,5 +9,13 @@ const serializer = createSerializer(Variable, [ 'isValueVariable', 'isTypeVariable', ]); +const implicitLibVarSerializer = createSerializer(ImplicitLibVariable, [ + // + 'defs', + 'name', + 'references', + 'isValueVariable', + 'isTypeVariable', +]); -export { serializer }; +export { serializer, implicitLibVarSerializer }; diff --git a/packages/scope-manager/tests/util/serializers/baseSerializer.ts b/packages/scope-manager/tests/util/serializers/baseSerializer.ts index df8ba1fba119..d30ba31b1380 100644 --- a/packages/scope-manager/tests/util/serializers/baseSerializer.ts +++ b/packages/scope-manager/tests/util/serializers/baseSerializer.ts @@ -35,6 +35,10 @@ function createSerializer( // If `type` is a base class, we should print out the name of the subclass const constructorName = Object.getPrototypeOf(thing).constructor.name; + if (constructorName === 'ImplicitLibVariable' && thing.name === 'const') { + return 'ImplicitGlobalConstTypeVariable'; + } + const name = `${constructorName}${id}`; if (thing.$id) { diff --git a/packages/scope-manager/tests/util/serializers/index.ts b/packages/scope-manager/tests/util/serializers/index.ts index d2e024d7f6c1..d4bbed92941f 100644 --- a/packages/scope-manager/tests/util/serializers/index.ts +++ b/packages/scope-manager/tests/util/serializers/index.ts @@ -14,6 +14,7 @@ const serializers = [ ScopeManager.serializer, TSESTreeNode.serializer, Variable.serializer, + Variable.implicitLibVarSerializer, ]; for (const serializer of serializers) { diff --git a/packages/scope-manager/tools/generate-lib.ts b/packages/scope-manager/tools/generate-lib.ts index 3a9fff754965..e1b33689f63c 100644 --- a/packages/scope-manager/tools/generate-lib.ts +++ b/packages/scope-manager/tools/generate-lib.ts @@ -155,7 +155,6 @@ function main(): void { isTypeVariable: variable.isTypeVariable, isValueVariable: variable.isValueVariable, name: variable.name, - writeable: false, })},`, ); } From 3b0e58f8b06975539f574edabaae5911f5db38a8 Mon Sep 17 00:00:00 2001 From: Daniel Nixon Date: Sun, 6 Sep 2020 14:50:49 +1000 Subject: [PATCH 16/22] docs: fix broken TOC link (#2501) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 9f96d4bf0557..e46c5eb441c2 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ - [Supported ESLint version](#supported-eslint-version) - [Supported Node version](#supported-node-version) - [License](#license) -- [Contributors](#contributors) +- [Contributors](#code-contributors) - [Contributing Guide](#contributing-guide) ## Getting Started / Installation From 5afeeab24ad013142f2431750f24e6085d0a6f3a Mon Sep 17 00:00:00 2001 From: Brad Zacher Date: Sun, 6 Sep 2020 11:08:16 -0700 Subject: [PATCH 17/22] fix(eslint-plugin): [no-use-before-define] false positive with jsx pragma reference (#2503) Fixes #2502 --- .../src/rules/no-use-before-define.ts | 2 +- .../tests/rules/no-use-before-define.test.ts | 53 +++++++++++++++++++ 2 files changed, 54 insertions(+), 1 deletion(-) diff --git a/packages/eslint-plugin/src/rules/no-use-before-define.ts b/packages/eslint-plugin/src/rules/no-use-before-define.ts index 08d12645d6a3..1e26e4729f93 100644 --- a/packages/eslint-plugin/src/rules/no-use-before-define.ts +++ b/packages/eslint-plugin/src/rules/no-use-before-define.ts @@ -258,7 +258,7 @@ export default util.createRule({ reference.init || !variable || variable.identifiers.length === 0 || - (variable.identifiers[0].range[1] < reference.identifier.range[1] && + (variable.identifiers[0].range[1] <= reference.identifier.range[1] && !isInInitializer(variable, reference)) || !isForbidden(variable, reference) ) { diff --git a/packages/eslint-plugin/tests/rules/no-use-before-define.test.ts b/packages/eslint-plugin/tests/rules/no-use-before-define.test.ts index dd8e2e7271e0..85dec218d112 100644 --- a/packages/eslint-plugin/tests/rules/no-use-before-define.test.ts +++ b/packages/eslint-plugin/tests/rules/no-use-before-define.test.ts @@ -290,6 +290,59 @@ enum Foo { `, options: [{ enums: false }], }, + // https://github.com/typescript-eslint/typescript-eslint/issues/2502 + { + code: ` +import * as React from 'react'; + +
; + `, + parserOptions: { + sourceType: 'module', + ecmaFeatures: { + jsx: true, + }, + }, + }, + { + code: ` +import React from 'react'; + +
; + `, + parserOptions: { + sourceType: 'module', + ecmaFeatures: { + jsx: true, + }, + }, + }, + { + code: ` +import { h } from 'preact'; + +
; + `, + parserOptions: { + sourceType: 'module', + jsxPragma: 'h', + ecmaFeatures: { + jsx: true, + }, + }, + }, + { + code: ` +const React = require('react'); + +
; + `, + parserOptions: { + ecmaFeatures: { + jsx: true, + }, + }, + }, ], invalid: [ { From cdb9807a5a368a136856cd03048b68e0f2dfb405 Mon Sep 17 00:00:00 2001 From: Brad Zacher Date: Sun, 6 Sep 2020 11:28:41 -0700 Subject: [PATCH 18/22] fix(scope-manager): don't create references for intrinsic JSX elements (#2504) --- .../tests/eslint-rules/no-undef.test.ts | 21 ++++ .../src/referencer/Referencer.ts | 15 ++- .../tests/fixtures/jsx/children.tsx.shot | 8 -- .../fixtures/jsx/component-intrinsic-name.tsx | 2 + .../jsx/component-intrinsic-name.tsx.shot | 58 ++++++++++ ...mespaced.tsx => component-namespaced1.tsx} | 0 ...sx.shot => component-namespaced1.tsx.shot} | 2 +- .../fixtures/jsx/component-namespaced2.tsx | 6 + .../jsx/component-namespaced2.tsx.shot | 106 ++++++++++++++++++ 9 files changed, 208 insertions(+), 10 deletions(-) create mode 100644 packages/scope-manager/tests/fixtures/jsx/component-intrinsic-name.tsx create mode 100644 packages/scope-manager/tests/fixtures/jsx/component-intrinsic-name.tsx.shot rename packages/scope-manager/tests/fixtures/jsx/{component-namespaced.tsx => component-namespaced1.tsx} (100%) rename packages/scope-manager/tests/fixtures/jsx/{component-namespaced.tsx.shot => component-namespaced1.tsx.shot} (98%) create mode 100644 packages/scope-manager/tests/fixtures/jsx/component-namespaced2.tsx create mode 100644 packages/scope-manager/tests/fixtures/jsx/component-namespaced2.tsx.shot diff --git a/packages/eslint-plugin/tests/eslint-rules/no-undef.test.ts b/packages/eslint-plugin/tests/eslint-rules/no-undef.test.ts index 7e1d179e4073..58baeeeaeac2 100644 --- a/packages/eslint-plugin/tests/eslint-rules/no-undef.test.ts +++ b/packages/eslint-plugin/tests/eslint-rules/no-undef.test.ts @@ -199,6 +199,27 @@ function Foo() {} }, }, }, + // intrinsic elements should not cause errors + { + code: ` +
; + `, + parserOptions: { + ecmaFeatures: { + jsx: true, + }, + }, + }, + { + code: ` +; + `, + parserOptions: { + ecmaFeatures: { + jsx: true, + }, + }, + }, // https://github.com/typescript-eslint/typescript-eslint/issues/2477 ` const x = 1 as const; diff --git a/packages/scope-manager/src/referencer/Referencer.ts b/packages/scope-manager/src/referencer/Referencer.ts index d329eca2d173..6cccab10428c 100644 --- a/packages/scope-manager/src/referencer/Referencer.ts +++ b/packages/scope-manager/src/referencer/Referencer.ts @@ -558,6 +558,10 @@ class Referencer extends Visitor { this.visit(node.value); } + protected JSXClosingElement(): void { + // should not be counted as a reference + } + protected JSXFragment(node: TSESTree.JSXFragment): void { this.referenceJsxPragma(); this.referenceJsxFragment(); @@ -575,7 +579,16 @@ class Referencer extends Visitor { protected JSXOpeningElement(node: TSESTree.JSXOpeningElement): void { this.referenceJsxPragma(); - this.visit(node.name); + if (node.name.type === AST_NODE_TYPES.JSXIdentifier) { + if (node.name.name[0].toUpperCase() === node.name.name[0]) { + // lower cased component names are always treated as "intrinsic" names, and are converted to a string, + // not a variable by JSX transforms: + //
=> React.createElement("div", null) + this.visit(node.name); + } + } else { + this.visit(node.name); + } this.visitType(node.typeParameters); for (const attr of node.attributes) { this.visit(attr); diff --git a/packages/scope-manager/tests/fixtures/jsx/children.tsx.shot b/packages/scope-manager/tests/fixtures/jsx/children.tsx.shot index 65e4f3202314..964f735f3c58 100644 --- a/packages/scope-manager/tests/fixtures/jsx/children.tsx.shot +++ b/packages/scope-manager/tests/fixtures/jsx/children.tsx.shot @@ -51,14 +51,6 @@ ScopeManager { resolved: null, }, Reference$3, - Reference$4 { - identifier: JSXIdentifier$5, - isRead: true, - isTypeReference: false, - isValueReference: true, - isWrite: false, - resolved: null, - }, ], set: Map { "const" => ImplicitGlobalConstTypeVariable, diff --git a/packages/scope-manager/tests/fixtures/jsx/component-intrinsic-name.tsx b/packages/scope-manager/tests/fixtures/jsx/component-intrinsic-name.tsx new file mode 100644 index 000000000000..300235b4fc60 --- /dev/null +++ b/packages/scope-manager/tests/fixtures/jsx/component-intrinsic-name.tsx @@ -0,0 +1,2 @@ +function div() {} // should not be referenced +
; diff --git a/packages/scope-manager/tests/fixtures/jsx/component-intrinsic-name.tsx.shot b/packages/scope-manager/tests/fixtures/jsx/component-intrinsic-name.tsx.shot new file mode 100644 index 000000000000..f67914bac29c --- /dev/null +++ b/packages/scope-manager/tests/fixtures/jsx/component-intrinsic-name.tsx.shot @@ -0,0 +1,58 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`jsx component-intrinsic-name 1`] = ` +ScopeManager { + variables: Array [ + ImplicitGlobalConstTypeVariable, + Variable$2 { + defs: Array [ + FunctionNameDefinition$1 { + name: Identifier<"div">, + node: FunctionDeclaration$1, + }, + ], + name: "div", + references: Array [], + isValueVariable: true, + isTypeVariable: false, + }, + Variable$3 { + defs: Array [], + name: "arguments", + references: Array [], + isValueVariable: true, + isTypeVariable: true, + }, + ], + scopes: Array [ + GlobalScope$1 { + block: Program$2, + isStrict: false, + references: Array [], + set: Map { + "const" => ImplicitGlobalConstTypeVariable, + "div" => Variable$2, + }, + type: "global", + upper: null, + variables: Array [ + ImplicitGlobalConstTypeVariable, + Variable$2, + ], + }, + FunctionScope$2 { + block: FunctionDeclaration$1, + isStrict: false, + references: Array [], + set: Map { + "arguments" => Variable$3, + }, + type: "function", + upper: GlobalScope$1, + variables: Array [ + Variable$3, + ], + }, + ], +} +`; diff --git a/packages/scope-manager/tests/fixtures/jsx/component-namespaced.tsx b/packages/scope-manager/tests/fixtures/jsx/component-namespaced1.tsx similarity index 100% rename from packages/scope-manager/tests/fixtures/jsx/component-namespaced.tsx rename to packages/scope-manager/tests/fixtures/jsx/component-namespaced1.tsx diff --git a/packages/scope-manager/tests/fixtures/jsx/component-namespaced.tsx.shot b/packages/scope-manager/tests/fixtures/jsx/component-namespaced1.tsx.shot similarity index 98% rename from packages/scope-manager/tests/fixtures/jsx/component-namespaced.tsx.shot rename to packages/scope-manager/tests/fixtures/jsx/component-namespaced1.tsx.shot index 5a3d3327032a..291e01032323 100644 --- a/packages/scope-manager/tests/fixtures/jsx/component-namespaced.tsx.shot +++ b/packages/scope-manager/tests/fixtures/jsx/component-namespaced1.tsx.shot @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`jsx component-namespaced 1`] = ` +exports[`jsx component-namespaced1 1`] = ` ScopeManager { variables: Array [ ImplicitGlobalConstTypeVariable, diff --git a/packages/scope-manager/tests/fixtures/jsx/component-namespaced2.tsx b/packages/scope-manager/tests/fixtures/jsx/component-namespaced2.tsx new file mode 100644 index 000000000000..8f8879ffb739 --- /dev/null +++ b/packages/scope-manager/tests/fixtures/jsx/component-namespaced2.tsx @@ -0,0 +1,6 @@ +const x = { + Foo() {}, +}; +const Foo = 1; // should be unreferenced + +; // lower cased namespaces should still create a reference diff --git a/packages/scope-manager/tests/fixtures/jsx/component-namespaced2.tsx.shot b/packages/scope-manager/tests/fixtures/jsx/component-namespaced2.tsx.shot new file mode 100644 index 000000000000..29a55db86ad0 --- /dev/null +++ b/packages/scope-manager/tests/fixtures/jsx/component-namespaced2.tsx.shot @@ -0,0 +1,106 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`jsx component-namespaced2 1`] = ` +ScopeManager { + variables: Array [ + ImplicitGlobalConstTypeVariable, + Variable$2 { + defs: Array [ + VariableDefinition$1 { + name: Identifier<"x">, + node: VariableDeclarator$1, + }, + ], + name: "x", + references: Array [ + Reference$1 { + identifier: Identifier<"x">, + init: true, + isRead: false, + isTypeReference: false, + isValueReference: true, + isWrite: true, + resolved: Variable$2, + writeExpr: ObjectExpression$2, + }, + Reference$3 { + identifier: JSXIdentifier$3, + 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 [ + VariableDefinition$2 { + name: Identifier<"Foo">, + node: VariableDeclarator$4, + }, + ], + name: "Foo", + references: Array [ + Reference$2 { + identifier: Identifier<"Foo">, + init: true, + isRead: false, + isTypeReference: false, + isValueReference: true, + isWrite: true, + resolved: Variable$4, + writeExpr: Literal$5, + }, + ], + isValueVariable: true, + isTypeVariable: false, + }, + ], + scopes: Array [ + GlobalScope$1 { + block: Program$6, + isStrict: false, + references: Array [ + Reference$1, + Reference$2, + Reference$3, + ], + set: Map { + "const" => ImplicitGlobalConstTypeVariable, + "x" => Variable$2, + "Foo" => Variable$4, + }, + type: "global", + upper: null, + variables: Array [ + ImplicitGlobalConstTypeVariable, + Variable$2, + Variable$4, + ], + }, + FunctionScope$2 { + block: FunctionExpression$7, + isStrict: false, + references: Array [], + set: Map { + "arguments" => Variable$3, + }, + type: "function", + upper: GlobalScope$1, + variables: Array [ + Variable$3, + ], + }, + ], +} +`; From 2ada5aff1ef37bc260d7a0eaafe9ff04f8a08fe4 Mon Sep 17 00:00:00 2001 From: Gaon Kim Date: Mon, 7 Sep 2020 03:30:59 +0900 Subject: [PATCH 19/22] fix(eslint-plugin): [typedef] false positive for rest parameter with array destructuring (#2441) --- packages/eslint-plugin/src/rules/typedef.ts | 6 ++++++ .../eslint-plugin/tests/rules/typedef.test.ts | 16 ++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/packages/eslint-plugin/src/rules/typedef.ts b/packages/eslint-plugin/src/rules/typedef.ts index 1d66cff42902..766401040224 100644 --- a/packages/eslint-plugin/src/rules/typedef.ts +++ b/packages/eslint-plugin/src/rules/typedef.ts @@ -141,6 +141,12 @@ export default util.createRule<[Options], MessageIds>({ return { ArrayPattern(node): void { + if ( + node.parent?.type === AST_NODE_TYPES.RestElement && + node.parent.typeAnnotation + ) { + return; + } if ( options[OptionKeys.ArrayDestructuring] && !node.typeAnnotation && diff --git a/packages/eslint-plugin/tests/rules/typedef.test.ts b/packages/eslint-plugin/tests/rules/typedef.test.ts index f3c240077168..09a4764a0ba3 100644 --- a/packages/eslint-plugin/tests/rules/typedef.test.ts +++ b/packages/eslint-plugin/tests/rules/typedef.test.ts @@ -14,6 +14,22 @@ const ruleTester = new RuleTester({ ruleTester.run('typedef', rule, { valid: [ // Array destructuring + { + code: 'function foo(...[a]: string[]) {}', + options: [ + { + arrayDestructuring: true, + }, + ], + }, + { + code: 'const foo = (...[a]: string[]) => {};', + options: [ + { + arrayDestructuring: true, + }, + ], + }, { code: 'const [a]: [number] = [1];', options: [ From 3d07a99faa0a5fc1b44acdb43ddbfc90a5105833 Mon Sep 17 00:00:00 2001 From: Brad Zacher Date: Sun, 6 Sep 2020 13:20:23 -0700 Subject: [PATCH 20/22] fix(eslint-plugin): [no-unused-vars] correct detection of unused vars in a declared module with `export =` (#2505) If a `declare module` has an `export =` in its body, then TS will only export that. If it doesn't have an `export =`, then all things are ambiently exported. This adds handling to correctly detect this case. --- .../src/rules/adjacent-overload-signatures.ts | 5 ++- packages/eslint-plugin/src/rules/indent.ts | 2 +- .../eslint-plugin/src/rules/no-unused-vars.ts | 37 +++++++++++++++++-- .../tests/rules/no-unused-vars.test.ts | 32 ++++++++++++++++ .../eslint-plugin/typings/eslint-rules.d.ts | 1 - packages/scope-manager/src/scope/ScopeBase.ts | 26 +++++++++---- packages/types/src/ts-estree.ts | 18 ++++++++- 7 files changed, 105 insertions(+), 16 deletions(-) diff --git a/packages/eslint-plugin/src/rules/adjacent-overload-signatures.ts b/packages/eslint-plugin/src/rules/adjacent-overload-signatures.ts index c7cd7be84b4d..05f120b4cf24 100644 --- a/packages/eslint-plugin/src/rules/adjacent-overload-signatures.ts +++ b/packages/eslint-plugin/src/rules/adjacent-overload-signatures.ts @@ -10,7 +10,10 @@ type RuleNode = | TSESTree.TSModuleBlock | TSESTree.TSTypeLiteral | TSESTree.TSInterfaceBody; -type Member = TSESTree.ClassElement | TSESTree.Statement | TSESTree.TypeElement; +type Member = + | TSESTree.ClassElement + | TSESTree.ProgramStatement + | TSESTree.TypeElement; export default util.createRule({ name: 'adjacent-overload-signatures', diff --git a/packages/eslint-plugin/src/rules/indent.ts b/packages/eslint-plugin/src/rules/indent.ts index 34ec40151798..9ac6a1593d9c 100644 --- a/packages/eslint-plugin/src/rules/indent.ts +++ b/packages/eslint-plugin/src/rules/indent.ts @@ -410,7 +410,7 @@ export default util.createRule({ // transform it to a BlockStatement return rules['BlockStatement, ClassBody']({ type: AST_NODE_TYPES.BlockStatement, - body: node.body, + body: node.body as any, // location data parent: node.parent, diff --git a/packages/eslint-plugin/src/rules/no-unused-vars.ts b/packages/eslint-plugin/src/rules/no-unused-vars.ts index d3dc72049ce6..03c27d406167 100644 --- a/packages/eslint-plugin/src/rules/no-unused-vars.ts +++ b/packages/eslint-plugin/src/rules/no-unused-vars.ts @@ -29,6 +29,7 @@ export default util.createRule({ create(context) { const rules = baseRule.create(context); const filename = context.getFilename(); + const MODULE_DECL_CACHE = new Map(); /** * Gets a list of TS module definitions for a specified variable. @@ -209,7 +210,7 @@ export default util.createRule({ }, // declaration file handling - [declarationSelector(AST_NODE_TYPES.Program, true)]( + [ambientDeclarationSelector(AST_NODE_TYPES.Program, true)]( node: DeclarationSelectorNode, ): void { if (!util.isDefinitionFile(filename)) { @@ -219,14 +220,44 @@ export default util.createRule({ }, // declared namespace handling - [declarationSelector( + [ambientDeclarationSelector( 'TSModuleDeclaration[declare = true] > TSModuleBlock', false, )](node: DeclarationSelectorNode): void { + const moduleDecl = util.nullThrows( + node.parent?.parent, + util.NullThrowsReasons.MissingParent, + ) as TSESTree.TSModuleDeclaration; + + // declared modules with an `export =` statement will only export that one thing + // all other statements are not automatically exported in this case + if (checkModuleDeclForExportEquals(moduleDecl)) { + return; + } + markDeclarationChildAsUsed(node); }, }; + function checkModuleDeclForExportEquals( + node: TSESTree.TSModuleDeclaration, + ): boolean { + const cached = MODULE_DECL_CACHE.get(node); + if (cached != null) { + return cached; + } + + for (const statement of node.body?.body ?? []) { + if (statement.type === AST_NODE_TYPES.TSExportAssignment) { + MODULE_DECL_CACHE.set(node, true); + return true; + } + } + + MODULE_DECL_CACHE.set(node, false); + return false; + } + type DeclarationSelectorNode = | TSESTree.TSInterfaceDeclaration | TSESTree.TSTypeAliasDeclaration @@ -236,7 +267,7 @@ export default util.createRule({ | TSESTree.TSEnumDeclaration | TSESTree.TSModuleDeclaration | TSESTree.VariableDeclaration; - function declarationSelector( + function ambientDeclarationSelector( parent: string, childDeclare: boolean, ): string { diff --git a/packages/eslint-plugin/tests/rules/no-unused-vars.test.ts b/packages/eslint-plugin/tests/rules/no-unused-vars.test.ts index 837246f45835..fbb468e375f5 100644 --- a/packages/eslint-plugin/tests/rules/no-unused-vars.test.ts +++ b/packages/eslint-plugin/tests/rules/no-unused-vars.test.ts @@ -848,6 +848,18 @@ export type Test = U extends (arg: { jsxFragmentName: 'Fragment', }, }, + ` +declare module 'foo' { + type Test = 1; +} + `, + ` +declare module 'foo' { + type Test = 1; + const x: Test = 1; + export = x; +} + `, ], invalid: [ @@ -1424,5 +1436,25 @@ export const ComponentFoo = () => { }, ], }, + { + code: ` +declare module 'foo' { + type Test = any; + const x = 1; + export = x; +} + `, + errors: [ + { + messageId: 'unusedVar', + line: 3, + data: { + varName: 'Test', + action: 'defined', + additional: '', + }, + }, + ], + }, ], }); diff --git a/packages/eslint-plugin/typings/eslint-rules.d.ts b/packages/eslint-plugin/typings/eslint-rules.d.ts index 9117f06c6c1e..7cabdf8a3c97 100644 --- a/packages/eslint-plugin/typings/eslint-rules.d.ts +++ b/packages/eslint-plugin/typings/eslint-rules.d.ts @@ -48,7 +48,6 @@ declare module 'eslint/lib/rules/camelcase' { declare module 'eslint/lib/rules/indent' { import { TSESLint, TSESTree } from '@typescript-eslint/experimental-utils'; - type Listener = (node: TSESTree.Node) => void; type ElementList = number | 'first' | 'off'; const rule: TSESLint.RuleModule< 'wrongIndentation', diff --git a/packages/scope-manager/src/scope/ScopeBase.ts b/packages/scope-manager/src/scope/ScopeBase.ts index 9b852dcff6ad..04f38e8a65f3 100644 --- a/packages/scope-manager/src/scope/ScopeBase.ts +++ b/packages/scope-manager/src/scope/ScopeBase.ts @@ -15,6 +15,7 @@ import { ReferenceTypeFlag, } from '../referencer/Reference'; import { Variable } from '../variable'; +import { TSModuleScope } from './TSModuleScope'; /** * Test if scope is strict @@ -124,6 +125,14 @@ function registerScope(scopeManager: ScopeManager, scope: Scope): void { const generator = createIdGenerator(); +type VariableScope = GlobalScope | FunctionScope | ModuleScope | TSModuleScope; +const VARIABLE_SCOPE_TYPES = new Set([ + ScopeType.global, + ScopeType.function, + ScopeType.module, + ScopeType.tsModule, +]); + type AnyScope = ScopeBase; abstract class ScopeBase< TType extends ScopeType, @@ -209,11 +218,11 @@ abstract class ScopeBase< */ public readonly variables: Variable[] = []; /** - * For 'global', 'function', and 'module' scopes, this is a self-reference. + * For scopes that can contain variable declarations, this is a self-reference. * For other scope types this is the *variableScope* value of the parent scope. * @public */ - public readonly variableScope: GlobalScope | FunctionScope | ModuleScope; + public readonly variableScope: VariableScope; constructor( scopeManager: ScopeManager, @@ -228,12 +237,9 @@ abstract class ScopeBase< this.#dynamic = this.type === ScopeType.global || this.type === ScopeType.with; this.block = block; - this.variableScope = - this.type === 'global' || - this.type === 'function' || - this.type === 'module' - ? (this as AnyScope['variableScope']) - : upperScopeAsScopeBase.variableScope; + this.variableScope = this.isVariableScope() + ? this + : upperScopeAsScopeBase.variableScope; this.upper = upperScope; /** @@ -252,6 +258,10 @@ abstract class ScopeBase< registerScope(scopeManager, this as Scope); } + private isVariableScope(): this is VariableScope { + return VARIABLE_SCOPE_TYPES.has(this.type); + } + public shouldStaticallyClose(): boolean { return !this.#dynamic; } diff --git a/packages/types/src/ts-estree.ts b/packages/types/src/ts-estree.ts index 61e6bc097a50..31b051d8b9d2 100644 --- a/packages/types/src/ts-estree.ts +++ b/packages/types/src/ts-estree.ts @@ -457,6 +457,20 @@ export type PrimaryExpression = | TemplateLiteral | ThisExpression | TSNullKeyword; +export type ProgramStatement = + | ClassDeclaration + | ExportAllDeclaration + | ExportDefaultDeclaration + | ExportNamedDeclaration + | ImportDeclaration + | Statement + | TSDeclareFunction + | TSEnumDeclaration + | TSExportAssignment + | TSImportEqualsDeclaration + | TSInterfaceDeclaration + | TSNamespaceExportDeclaration + | TSTypeAliasDeclaration; export type Property = PropertyComputedName | PropertyNonComputedName; export type PropertyName = PropertyNameComputed | PropertyNameNonComputed; export type PropertyNameComputed = Expression; @@ -1146,7 +1160,7 @@ export interface ObjectPattern extends BaseNode { export interface Program extends BaseNode { type: AST_NODE_TYPES.Program; - body: Statement[]; + body: ProgramStatement[]; sourceType: 'module' | 'script'; comments?: Comment[]; tokens?: Token[]; @@ -1473,7 +1487,7 @@ export interface TSMethodSignatureNonComputedName export interface TSModuleBlock extends BaseNode { type: AST_NODE_TYPES.TSModuleBlock; - body: Statement[]; + body: ProgramStatement[]; } export interface TSModuleDeclaration extends BaseNode { From 86936537bd6f1075cbceeb8d2d4e254d75188409 Mon Sep 17 00:00:00 2001 From: Tadhg McDonald-Jensen Date: Sun, 6 Sep 2020 16:46:13 -0400 Subject: [PATCH 21/22] fix(eslint-plugin): [explicit-module-boundary-types] cyclical reference infinite recursion crash (#2482) Co-authored-by: Tadhg McDonald-Jensen --- .../src/rules/explicit-module-boundary-types.ts | 7 ++++++- .../tests/rules/explicit-module-boundary-types.test.ts | 5 +++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/packages/eslint-plugin/src/rules/explicit-module-boundary-types.ts b/packages/eslint-plugin/src/rules/explicit-module-boundary-types.ts index 5671e36dbdd2..f4c73ef0d9b9 100644 --- a/packages/eslint-plugin/src/rules/explicit-module-boundary-types.ts +++ b/packages/eslint-plugin/src/rules/explicit-module-boundary-types.ts @@ -96,6 +96,10 @@ export default util.createRule({ // tracks functions that were found whilst traversing const foundFunctions: FunctionNode[] = []; + // all nodes visited, avoids infinite recursion for cyclic references + // (such as class member referring to itself) + const alreadyVisited = new Set(); + /* # How the rule works: @@ -311,9 +315,10 @@ export default util.createRule({ } function checkNode(node: TSESTree.Node | null): void { - if (node == null) { + if (node == null || alreadyVisited.has(node)) { return; } + alreadyVisited.add(node); switch (node.type) { case AST_NODE_TYPES.ArrowFunctionExpression: diff --git a/packages/eslint-plugin/tests/rules/explicit-module-boundary-types.test.ts b/packages/eslint-plugin/tests/rules/explicit-module-boundary-types.test.ts index c79cc34a314a..25b70794843c 100644 --- a/packages/eslint-plugin/tests/rules/explicit-module-boundary-types.test.ts +++ b/packages/eslint-plugin/tests/rules/explicit-module-boundary-types.test.ts @@ -654,6 +654,11 @@ export abstract class Foo { ` export declare class Foo { set time(seconds: number); +} + `, + ` +export class A { + b = A; } `, ], From 00a24706222254774121ee62038e67d0efa993e7 Mon Sep 17 00:00:00 2001 From: James Henry Date: Mon, 7 Sep 2020 17:02:25 +0000 Subject: [PATCH 22/22] chore: publish v4.1.0 --- CHANGELOG.md | 33 ++++++++++++++++++-- lerna.json | 2 +- packages/eslint-plugin-internal/CHANGELOG.md | 10 ++++-- packages/eslint-plugin-internal/package.json | 4 +-- packages/eslint-plugin-tslint/CHANGELOG.md | 10 ++++-- packages/eslint-plugin-tslint/package.json | 6 ++-- packages/eslint-plugin/CHANGELOG.md | 32 +++++++++++++++++-- packages/eslint-plugin/package.json | 6 ++-- packages/experimental-utils/CHANGELOG.md | 10 ++++-- packages/experimental-utils/package.json | 8 ++--- packages/parser/CHANGELOG.md | 13 ++++++-- packages/parser/package.json | 12 +++---- packages/scope-manager/CHANGELOG.md | 26 +++++++++++++-- packages/scope-manager/package.json | 8 ++--- packages/shared-fixtures/CHANGELOG.md | 10 ++++-- packages/shared-fixtures/package.json | 2 +- packages/types/CHANGELOG.md | 18 +++++++++-- 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, 191 insertions(+), 49 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fcc5ce4c7ec4..549fa2afd906 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,39 @@ # Change Log All notable changes to this project will be documented in this file. -This file is just a history of the commits included in each release. -**For full release notes, please see [the github releases page](https://github.com/typescript-eslint/typescript-eslint/releases)** See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [4.1.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.0.1...v4.1.0) (2020-09-07) + + +### Bug Fixes + +* **eslint-plugin:** [explicit-module-boundary-types] cyclical reference infinite recursion crash ([#2482](https://github.com/typescript-eslint/typescript-eslint/issues/2482)) ([8693653](https://github.com/typescript-eslint/typescript-eslint/commit/86936537bd6f1075cbceeb8d2d4e254d75188409)) +* **eslint-plugin:** [no-unused-vars] correct detection of unused vars in a declared module with `export =` ([#2505](https://github.com/typescript-eslint/typescript-eslint/issues/2505)) ([3d07a99](https://github.com/typescript-eslint/typescript-eslint/commit/3d07a99faa0a5fc1b44acdb43ddbfc90a5105833)) +* **eslint-plugin:** [no-unused-vars] properly handle ambient declaration exports ([#2496](https://github.com/typescript-eslint/typescript-eslint/issues/2496)) ([4d3ce5f](https://github.com/typescript-eslint/typescript-eslint/commit/4d3ce5f696985389bf53a31d62766041c703c70c)) +* **eslint-plugin:** [no-use-before-define] false positive with jsx pragma reference ([#2503](https://github.com/typescript-eslint/typescript-eslint/issues/2503)) ([5afeeab](https://github.com/typescript-eslint/typescript-eslint/commit/5afeeab24ad013142f2431750f24e6085d0a6f3a)), closes [#2502](https://github.com/typescript-eslint/typescript-eslint/issues/2502) +* **eslint-plugin:** [typedef] false positive for rest parameter with array destructuring ([#2441](https://github.com/typescript-eslint/typescript-eslint/issues/2441)) ([2ada5af](https://github.com/typescript-eslint/typescript-eslint/commit/2ada5aff1ef37bc260d7a0eaafe9ff04f8a08fe4)) +* **eslint-plugin:** handle missing message IDs in eslint v5/v6 ([#2461](https://github.com/typescript-eslint/typescript-eslint/issues/2461)) ([ffdfade](https://github.com/typescript-eslint/typescript-eslint/commit/ffdfade106d602bcc12b074bdfa489e9f661491e)) +* **scope-manager:** add `const` as a global type variable ([#2499](https://github.com/typescript-eslint/typescript-eslint/issues/2499)) ([eb3f6e3](https://github.com/typescript-eslint/typescript-eslint/commit/eb3f6e39391d62ac424baa305a15e61806b2fd65)) +* **scope-manager:** correctly handle inferred types in nested type scopes ([#2497](https://github.com/typescript-eslint/typescript-eslint/issues/2497)) ([95f6bf4](https://github.com/typescript-eslint/typescript-eslint/commit/95f6bf4818cdec48a0583bf82f928c598af22736)) +* **scope-manager:** don't create references for intrinsic JSX elements ([#2504](https://github.com/typescript-eslint/typescript-eslint/issues/2504)) ([cdb9807](https://github.com/typescript-eslint/typescript-eslint/commit/cdb9807a5a368a136856cd03048b68e0f2dfb405)) +* **scope-manager:** fallback to lib 'esnext' or 'es5' when ecma version is unsupported ([#2474](https://github.com/typescript-eslint/typescript-eslint/issues/2474)) ([20a7dcc](https://github.com/typescript-eslint/typescript-eslint/commit/20a7dcc808a39cd447d6e52fc5a1e1373d7122e9)) +* **scope-manager:** support rest function type parameters ([#2491](https://github.com/typescript-eslint/typescript-eslint/issues/2491)) ([9d8b4c4](https://github.com/typescript-eslint/typescript-eslint/commit/9d8b4c479c98623e4198aa07639321929a8a876f)), closes [#2449](https://github.com/typescript-eslint/typescript-eslint/issues/2449) +* **scope-manager:** support tagged template string generic type parameters ([#2492](https://github.com/typescript-eslint/typescript-eslint/issues/2492)) ([a2686c0](https://github.com/typescript-eslint/typescript-eslint/commit/a2686c04293ab9070c1500a0dab7e205bd1fa9d2)) +* **scope-manager:** support type predicates ([#2493](https://github.com/typescript-eslint/typescript-eslint/issues/2493)) ([a40f54c](https://github.com/typescript-eslint/typescript-eslint/commit/a40f54c39d59096a0d12a492807dcd52fbcdc384)), closes [#2462](https://github.com/typescript-eslint/typescript-eslint/issues/2462) +* **scope-manager:** treat type imports as both values and types ([#2494](https://github.com/typescript-eslint/typescript-eslint/issues/2494)) ([916e95a](https://github.com/typescript-eslint/typescript-eslint/commit/916e95a505689746dda38a67148c95cc7d207d9f)), closes [#2453](https://github.com/typescript-eslint/typescript-eslint/issues/2453) + + +### Features + +* **eslint-plugin:** [no-shadow] add option `ignoreFunctionTypeParameterNameValueShadow` ([#2470](https://github.com/typescript-eslint/typescript-eslint/issues/2470)) ([bfe255f](https://github.com/typescript-eslint/typescript-eslint/commit/bfe255fde0cb5fe5e32c02eb5ba35d27fb23d9ea)) +* **eslint-plugin:** add extension rule `no-loop-func` ([#2490](https://github.com/typescript-eslint/typescript-eslint/issues/2490)) ([36305df](https://github.com/typescript-eslint/typescript-eslint/commit/36305df74b3c26b60364f7ec13390be492b4b2ec)) +* **scope-manager:** add support for JSX scope analysis ([#2498](https://github.com/typescript-eslint/typescript-eslint/issues/2498)) ([f887ab5](https://github.com/typescript-eslint/typescript-eslint/commit/f887ab51f58c1b3571f9a14832864bc0ca59623f)), closes [#2455](https://github.com/typescript-eslint/typescript-eslint/issues/2455) [#2477](https://github.com/typescript-eslint/typescript-eslint/issues/2477) + + + + + ## [4.0.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.0.0...v4.0.1) (2020-08-31) diff --git a/lerna.json b/lerna.json index f0ae338f455f..ac3c715ea746 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "4.0.1", + "version": "4.1.0", "npmClient": "yarn", "useWorkspaces": true, "stream": true diff --git a/packages/eslint-plugin-internal/CHANGELOG.md b/packages/eslint-plugin-internal/CHANGELOG.md index 8c528d2a56e8..824ea25060cc 100644 --- a/packages/eslint-plugin-internal/CHANGELOG.md +++ b/packages/eslint-plugin-internal/CHANGELOG.md @@ -1,10 +1,16 @@ # Change Log All notable changes to this project will be documented in this file. -This file is just a history of the commits included in each release. -**For full release notes, please see [the github releases page](https://github.com/typescript-eslint/typescript-eslint/releases)** See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [4.1.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.0.1...v4.1.0) (2020-09-07) + +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal + + + + + ## [4.0.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.0.0...v4.0.1) (2020-08-31) **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 b95d4e295760..3393d3b4ddee 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": "4.0.1", + "version": "4.1.0", "private": true, "main": "dist/index.js", "scripts": { @@ -14,7 +14,7 @@ }, "dependencies": { "@types/prettier": "*", - "@typescript-eslint/experimental-utils": "4.0.1", + "@typescript-eslint/experimental-utils": "4.1.0", "prettier": "*" } } diff --git a/packages/eslint-plugin-tslint/CHANGELOG.md b/packages/eslint-plugin-tslint/CHANGELOG.md index b6bd6b6d1a4e..cce913d83422 100644 --- a/packages/eslint-plugin-tslint/CHANGELOG.md +++ b/packages/eslint-plugin-tslint/CHANGELOG.md @@ -1,10 +1,16 @@ # Change Log All notable changes to this project will be documented in this file. -This file is just a history of the commits included in each release. -**For full release notes, please see [the github releases page](https://github.com/typescript-eslint/typescript-eslint/releases)** See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [4.1.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.0.1...v4.1.0) (2020-09-07) + +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint + + + + + ## [4.0.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.0.0...v4.0.1) (2020-08-31) **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 14e3febf99a7..460838fadcb5 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": "4.0.1", + "version": "4.1.0", "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/experimental-utils": "4.0.1", + "@typescript-eslint/experimental-utils": "4.1.0", "lodash": "^4.17.15" }, "peerDependencies": { @@ -48,6 +48,6 @@ }, "devDependencies": { "@types/lodash": "*", - "@typescript-eslint/parser": "4.0.1" + "@typescript-eslint/parser": "4.1.0" } } diff --git a/packages/eslint-plugin/CHANGELOG.md b/packages/eslint-plugin/CHANGELOG.md index 985da3c8304f..7bc2c3c4d1aa 100644 --- a/packages/eslint-plugin/CHANGELOG.md +++ b/packages/eslint-plugin/CHANGELOG.md @@ -1,10 +1,38 @@ # Change Log All notable changes to this project will be documented in this file. -This file is just a history of the commits included in each release. -**For full release notes, please see [the github releases page](https://github.com/typescript-eslint/typescript-eslint/releases)** See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [4.1.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.0.1...v4.1.0) (2020-09-07) + + +### Bug Fixes + +* **eslint-plugin:** [explicit-module-boundary-types] cyclical reference infinite recursion crash ([#2482](https://github.com/typescript-eslint/typescript-eslint/issues/2482)) ([8693653](https://github.com/typescript-eslint/typescript-eslint/commit/86936537bd6f1075cbceeb8d2d4e254d75188409)) +* **eslint-plugin:** [no-unused-vars] correct detection of unused vars in a declared module with `export =` ([#2505](https://github.com/typescript-eslint/typescript-eslint/issues/2505)) ([3d07a99](https://github.com/typescript-eslint/typescript-eslint/commit/3d07a99faa0a5fc1b44acdb43ddbfc90a5105833)) +* **eslint-plugin:** [no-unused-vars] properly handle ambient declaration exports ([#2496](https://github.com/typescript-eslint/typescript-eslint/issues/2496)) ([4d3ce5f](https://github.com/typescript-eslint/typescript-eslint/commit/4d3ce5f696985389bf53a31d62766041c703c70c)) +* **eslint-plugin:** [no-use-before-define] false positive with jsx pragma reference ([#2503](https://github.com/typescript-eslint/typescript-eslint/issues/2503)) ([5afeeab](https://github.com/typescript-eslint/typescript-eslint/commit/5afeeab24ad013142f2431750f24e6085d0a6f3a)), closes [#2502](https://github.com/typescript-eslint/typescript-eslint/issues/2502) +* **eslint-plugin:** [typedef] false positive for rest parameter with array destructuring ([#2441](https://github.com/typescript-eslint/typescript-eslint/issues/2441)) ([2ada5af](https://github.com/typescript-eslint/typescript-eslint/commit/2ada5aff1ef37bc260d7a0eaafe9ff04f8a08fe4)) +* **eslint-plugin:** handle missing message IDs in eslint v5/v6 ([#2461](https://github.com/typescript-eslint/typescript-eslint/issues/2461)) ([ffdfade](https://github.com/typescript-eslint/typescript-eslint/commit/ffdfade106d602bcc12b074bdfa489e9f661491e)) +* **scope-manager:** add `const` as a global type variable ([#2499](https://github.com/typescript-eslint/typescript-eslint/issues/2499)) ([eb3f6e3](https://github.com/typescript-eslint/typescript-eslint/commit/eb3f6e39391d62ac424baa305a15e61806b2fd65)) +* **scope-manager:** correctly handle inferred types in nested type scopes ([#2497](https://github.com/typescript-eslint/typescript-eslint/issues/2497)) ([95f6bf4](https://github.com/typescript-eslint/typescript-eslint/commit/95f6bf4818cdec48a0583bf82f928c598af22736)) +* **scope-manager:** don't create references for intrinsic JSX elements ([#2504](https://github.com/typescript-eslint/typescript-eslint/issues/2504)) ([cdb9807](https://github.com/typescript-eslint/typescript-eslint/commit/cdb9807a5a368a136856cd03048b68e0f2dfb405)) +* **scope-manager:** support rest function type parameters ([#2491](https://github.com/typescript-eslint/typescript-eslint/issues/2491)) ([9d8b4c4](https://github.com/typescript-eslint/typescript-eslint/commit/9d8b4c479c98623e4198aa07639321929a8a876f)), closes [#2449](https://github.com/typescript-eslint/typescript-eslint/issues/2449) +* **scope-manager:** support tagged template string generic type parameters ([#2492](https://github.com/typescript-eslint/typescript-eslint/issues/2492)) ([a2686c0](https://github.com/typescript-eslint/typescript-eslint/commit/a2686c04293ab9070c1500a0dab7e205bd1fa9d2)) +* **scope-manager:** support type predicates ([#2493](https://github.com/typescript-eslint/typescript-eslint/issues/2493)) ([a40f54c](https://github.com/typescript-eslint/typescript-eslint/commit/a40f54c39d59096a0d12a492807dcd52fbcdc384)), closes [#2462](https://github.com/typescript-eslint/typescript-eslint/issues/2462) +* **scope-manager:** treat type imports as both values and types ([#2494](https://github.com/typescript-eslint/typescript-eslint/issues/2494)) ([916e95a](https://github.com/typescript-eslint/typescript-eslint/commit/916e95a505689746dda38a67148c95cc7d207d9f)), closes [#2453](https://github.com/typescript-eslint/typescript-eslint/issues/2453) + + +### Features + +* **eslint-plugin:** [no-shadow] add option `ignoreFunctionTypeParameterNameValueShadow` ([#2470](https://github.com/typescript-eslint/typescript-eslint/issues/2470)) ([bfe255f](https://github.com/typescript-eslint/typescript-eslint/commit/bfe255fde0cb5fe5e32c02eb5ba35d27fb23d9ea)) +* **eslint-plugin:** add extension rule `no-loop-func` ([#2490](https://github.com/typescript-eslint/typescript-eslint/issues/2490)) ([36305df](https://github.com/typescript-eslint/typescript-eslint/commit/36305df74b3c26b60364f7ec13390be492b4b2ec)) +* **scope-manager:** add support for JSX scope analysis ([#2498](https://github.com/typescript-eslint/typescript-eslint/issues/2498)) ([f887ab5](https://github.com/typescript-eslint/typescript-eslint/commit/f887ab51f58c1b3571f9a14832864bc0ca59623f)), closes [#2455](https://github.com/typescript-eslint/typescript-eslint/issues/2455) [#2477](https://github.com/typescript-eslint/typescript-eslint/issues/2477) + + + + + ## [4.0.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.0.0...v4.0.1) (2020-08-31) diff --git a/packages/eslint-plugin/package.json b/packages/eslint-plugin/package.json index d02008f597e4..581610236872 100644 --- a/packages/eslint-plugin/package.json +++ b/packages/eslint-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/eslint-plugin", - "version": "4.0.1", + "version": "4.1.0", "description": "TypeScript plugin for ESLint", "keywords": [ "eslint", @@ -42,8 +42,8 @@ "typecheck": "tsc -p tsconfig.json --noEmit" }, "dependencies": { - "@typescript-eslint/experimental-utils": "4.0.1", - "@typescript-eslint/scope-manager": "4.0.1", + "@typescript-eslint/experimental-utils": "4.1.0", + "@typescript-eslint/scope-manager": "4.1.0", "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 27434ea7eb30..b32112bea0ec 100644 --- a/packages/experimental-utils/CHANGELOG.md +++ b/packages/experimental-utils/CHANGELOG.md @@ -1,10 +1,16 @@ # Change Log All notable changes to this project will be documented in this file. -This file is just a history of the commits included in each release. -**For full release notes, please see [the github releases page](https://github.com/typescript-eslint/typescript-eslint/releases)** See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [4.1.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.0.1...v4.1.0) (2020-09-07) + +**Note:** Version bump only for package @typescript-eslint/experimental-utils + + + + + ## [4.0.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.0.0...v4.0.1) (2020-08-31) **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 cc6d5716257e..4663aed76229 100644 --- a/packages/experimental-utils/package.json +++ b/packages/experimental-utils/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/experimental-utils", - "version": "4.0.1", + "version": "4.1.0", "description": "(Experimental) Utilities for working with TypeScript + ESLint together", "keywords": [ "eslint", @@ -40,9 +40,9 @@ }, "dependencies": { "@types/json-schema": "^7.0.3", - "@typescript-eslint/scope-manager": "4.0.1", - "@typescript-eslint/types": "4.0.1", - "@typescript-eslint/typescript-estree": "4.0.1", + "@typescript-eslint/scope-manager": "4.1.0", + "@typescript-eslint/types": "4.1.0", + "@typescript-eslint/typescript-estree": "4.1.0", "eslint-scope": "^5.0.0", "eslint-utils": "^2.0.0" }, diff --git a/packages/parser/CHANGELOG.md b/packages/parser/CHANGELOG.md index 5ffef9538962..8007f5601dbf 100644 --- a/packages/parser/CHANGELOG.md +++ b/packages/parser/CHANGELOG.md @@ -1,10 +1,19 @@ # Change Log All notable changes to this project will be documented in this file. -This file is just a history of the commits included in each release. -**For full release notes, please see [the github releases page](https://github.com/typescript-eslint/typescript-eslint/releases)** See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [4.1.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.0.1...v4.1.0) (2020-09-07) + + +### Features + +* **scope-manager:** add support for JSX scope analysis ([#2498](https://github.com/typescript-eslint/typescript-eslint/issues/2498)) ([f887ab5](https://github.com/typescript-eslint/typescript-eslint/commit/f887ab51f58c1b3571f9a14832864bc0ca59623f)), closes [#2455](https://github.com/typescript-eslint/typescript-eslint/issues/2455) [#2477](https://github.com/typescript-eslint/typescript-eslint/issues/2477) + + + + + ## [4.0.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.0.0...v4.0.1) (2020-08-31) **Note:** Version bump only for package @typescript-eslint/parser diff --git a/packages/parser/package.json b/packages/parser/package.json index ab6845ea1121..43c6d09f30f1 100644 --- a/packages/parser/package.json +++ b/packages/parser/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/parser", - "version": "4.0.1", + "version": "4.1.0", "description": "An ESLint custom parser which leverages TypeScript ESTree", "main": "dist/index.js", "types": "dist/index.d.ts", @@ -44,15 +44,15 @@ "eslint": "^5.0.0 || ^6.0.0 || ^7.0.0" }, "dependencies": { - "@typescript-eslint/scope-manager": "4.0.1", - "@typescript-eslint/types": "4.0.1", - "@typescript-eslint/typescript-estree": "4.0.1", + "@typescript-eslint/scope-manager": "4.1.0", + "@typescript-eslint/types": "4.1.0", + "@typescript-eslint/typescript-estree": "4.1.0", "debug": "^4.1.1" }, "devDependencies": { "@types/glob": "*", - "@typescript-eslint/experimental-utils": "4.0.1", - "@typescript-eslint/shared-fixtures": "4.0.1", + "@typescript-eslint/experimental-utils": "4.1.0", + "@typescript-eslint/shared-fixtures": "4.1.0", "glob": "*", "typescript": "*" }, diff --git a/packages/scope-manager/CHANGELOG.md b/packages/scope-manager/CHANGELOG.md index 32214ad72f08..cf0ad482f407 100644 --- a/packages/scope-manager/CHANGELOG.md +++ b/packages/scope-manager/CHANGELOG.md @@ -1,10 +1,32 @@ # Change Log All notable changes to this project will be documented in this file. -This file is just a history of the commits included in each release. -**For full release notes, please see [the github releases page](https://github.com/typescript-eslint/typescript-eslint/releases)** See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [4.1.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.0.1...v4.1.0) (2020-09-07) + + +### Bug Fixes + +* **eslint-plugin:** [no-unused-vars] correct detection of unused vars in a declared module with `export =` ([#2505](https://github.com/typescript-eslint/typescript-eslint/issues/2505)) ([3d07a99](https://github.com/typescript-eslint/typescript-eslint/commit/3d07a99faa0a5fc1b44acdb43ddbfc90a5105833)) +* **scope-manager:** add `const` as a global type variable ([#2499](https://github.com/typescript-eslint/typescript-eslint/issues/2499)) ([eb3f6e3](https://github.com/typescript-eslint/typescript-eslint/commit/eb3f6e39391d62ac424baa305a15e61806b2fd65)) +* **scope-manager:** correctly handle inferred types in nested type scopes ([#2497](https://github.com/typescript-eslint/typescript-eslint/issues/2497)) ([95f6bf4](https://github.com/typescript-eslint/typescript-eslint/commit/95f6bf4818cdec48a0583bf82f928c598af22736)) +* **scope-manager:** don't create references for intrinsic JSX elements ([#2504](https://github.com/typescript-eslint/typescript-eslint/issues/2504)) ([cdb9807](https://github.com/typescript-eslint/typescript-eslint/commit/cdb9807a5a368a136856cd03048b68e0f2dfb405)) +* **scope-manager:** fallback to lib 'esnext' or 'es5' when ecma version is unsupported ([#2474](https://github.com/typescript-eslint/typescript-eslint/issues/2474)) ([20a7dcc](https://github.com/typescript-eslint/typescript-eslint/commit/20a7dcc808a39cd447d6e52fc5a1e1373d7122e9)) +* **scope-manager:** support rest function type parameters ([#2491](https://github.com/typescript-eslint/typescript-eslint/issues/2491)) ([9d8b4c4](https://github.com/typescript-eslint/typescript-eslint/commit/9d8b4c479c98623e4198aa07639321929a8a876f)), closes [#2449](https://github.com/typescript-eslint/typescript-eslint/issues/2449) +* **scope-manager:** support tagged template string generic type parameters ([#2492](https://github.com/typescript-eslint/typescript-eslint/issues/2492)) ([a2686c0](https://github.com/typescript-eslint/typescript-eslint/commit/a2686c04293ab9070c1500a0dab7e205bd1fa9d2)) +* **scope-manager:** support type predicates ([#2493](https://github.com/typescript-eslint/typescript-eslint/issues/2493)) ([a40f54c](https://github.com/typescript-eslint/typescript-eslint/commit/a40f54c39d59096a0d12a492807dcd52fbcdc384)), closes [#2462](https://github.com/typescript-eslint/typescript-eslint/issues/2462) +* **scope-manager:** treat type imports as both values and types ([#2494](https://github.com/typescript-eslint/typescript-eslint/issues/2494)) ([916e95a](https://github.com/typescript-eslint/typescript-eslint/commit/916e95a505689746dda38a67148c95cc7d207d9f)), closes [#2453](https://github.com/typescript-eslint/typescript-eslint/issues/2453) + + +### Features + +* **scope-manager:** add support for JSX scope analysis ([#2498](https://github.com/typescript-eslint/typescript-eslint/issues/2498)) ([f887ab5](https://github.com/typescript-eslint/typescript-eslint/commit/f887ab51f58c1b3571f9a14832864bc0ca59623f)), closes [#2455](https://github.com/typescript-eslint/typescript-eslint/issues/2455) [#2477](https://github.com/typescript-eslint/typescript-eslint/issues/2477) + + + + + ## [4.0.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.0.0...v4.0.1) (2020-08-31) **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 ab79e41b08ce..e742ca647030 100644 --- a/packages/scope-manager/package.json +++ b/packages/scope-manager/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/scope-manager", - "version": "4.0.1", + "version": "4.1.0", "description": "TypeScript scope analyser for ESLint", "keywords": [ "eslint", @@ -39,12 +39,12 @@ "typecheck": "tsc -p tsconfig.json --noEmit" }, "dependencies": { - "@typescript-eslint/types": "4.0.1", - "@typescript-eslint/visitor-keys": "4.0.1" + "@typescript-eslint/types": "4.1.0", + "@typescript-eslint/visitor-keys": "4.1.0" }, "devDependencies": { "@types/glob": "*", - "@typescript-eslint/typescript-estree": "4.0.1", + "@typescript-eslint/typescript-estree": "4.1.0", "glob": "*", "jest-specific-snapshot": "*", "make-dir": "*", diff --git a/packages/shared-fixtures/CHANGELOG.md b/packages/shared-fixtures/CHANGELOG.md index 78d31dafa610..cb24845533c0 100644 --- a/packages/shared-fixtures/CHANGELOG.md +++ b/packages/shared-fixtures/CHANGELOG.md @@ -1,10 +1,16 @@ # Change Log All notable changes to this project will be documented in this file. -This file is just a history of the commits included in each release. -**For full release notes, please see [the github releases page](https://github.com/typescript-eslint/typescript-eslint/releases)** See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [4.1.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.0.1...v4.1.0) (2020-09-07) + +**Note:** Version bump only for package @typescript-eslint/shared-fixtures + + + + + ## [4.0.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.0.0...v4.0.1) (2020-08-31) **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 4e518cf53fbd..7b4fb65a6f27 100644 --- a/packages/shared-fixtures/package.json +++ b/packages/shared-fixtures/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/shared-fixtures", - "version": "4.0.1", + "version": "4.1.0", "private": true, "scripts": { "build": "tsc -b tsconfig.build.json", diff --git a/packages/types/CHANGELOG.md b/packages/types/CHANGELOG.md index 31cc40b144df..43d03464c10d 100644 --- a/packages/types/CHANGELOG.md +++ b/packages/types/CHANGELOG.md @@ -1,10 +1,24 @@ # Change Log All notable changes to this project will be documented in this file. -This file is just a history of the commits included in each release. -**For full release notes, please see [the github releases page](https://github.com/typescript-eslint/typescript-eslint/releases)** See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [4.1.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.0.1...v4.1.0) (2020-09-07) + + +### Bug Fixes + +* **eslint-plugin:** [no-unused-vars] correct detection of unused vars in a declared module with `export =` ([#2505](https://github.com/typescript-eslint/typescript-eslint/issues/2505)) ([3d07a99](https://github.com/typescript-eslint/typescript-eslint/commit/3d07a99faa0a5fc1b44acdb43ddbfc90a5105833)) + + +### Features + +* **scope-manager:** add support for JSX scope analysis ([#2498](https://github.com/typescript-eslint/typescript-eslint/issues/2498)) ([f887ab5](https://github.com/typescript-eslint/typescript-eslint/commit/f887ab51f58c1b3571f9a14832864bc0ca59623f)), closes [#2455](https://github.com/typescript-eslint/typescript-eslint/issues/2455) [#2477](https://github.com/typescript-eslint/typescript-eslint/issues/2477) + + + + + ## [4.0.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.0.0...v4.0.1) (2020-08-31) **Note:** Version bump only for package @typescript-eslint/types diff --git a/packages/types/package.json b/packages/types/package.json index 7b57aa17177b..5ea0f558132b 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/types", - "version": "4.0.1", + "version": "4.1.0", "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 10ce70ee0136..284d90a3f8cf 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. +# [4.1.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.0.1...v4.1.0) (2020-09-07) + +**Note:** Version bump only for package @typescript-eslint/typescript-estree + + + + + ## [4.0.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.0.0...v4.0.1) (2020-08-31) **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 73e20c4e5e6e..ea0874a899c2 100644 --- a/packages/typescript-estree/package.json +++ b/packages/typescript-estree/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/typescript-estree", - "version": "4.0.1", + "version": "4.1.0", "description": "A parser that converts TypeScript source code into an ESTree compatible form", "main": "dist/index.js", "types": "dist/index.d.ts", @@ -41,8 +41,8 @@ "typecheck": "tsc -p tsconfig.json --noEmit" }, "dependencies": { - "@typescript-eslint/types": "4.0.1", - "@typescript-eslint/visitor-keys": "4.0.1", + "@typescript-eslint/types": "4.1.0", + "@typescript-eslint/visitor-keys": "4.1.0", "debug": "^4.1.1", "globby": "^11.0.1", "is-glob": "^4.0.1", @@ -61,7 +61,7 @@ "@types/lodash": "*", "@types/semver": "^7.1.0", "@types/tmp": "^0.2.0", - "@typescript-eslint/shared-fixtures": "4.0.1", + "@typescript-eslint/shared-fixtures": "4.1.0", "glob": "*", "jest-specific-snapshot": "*", "make-dir": "*", diff --git a/packages/visitor-keys/CHANGELOG.md b/packages/visitor-keys/CHANGELOG.md index 2033d375bae1..ef433031f8e3 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. +# [4.1.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.0.1...v4.1.0) (2020-09-07) + +**Note:** Version bump only for package @typescript-eslint/visitor-keys + + + + + ## [4.0.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.0.0...v4.0.1) (2020-08-31) **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 abb7ba1375fe..4096c33ba645 100644 --- a/packages/visitor-keys/package.json +++ b/packages/visitor-keys/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/visitor-keys", - "version": "4.0.1", + "version": "4.1.0", "description": "Visitor keys used to help traverse the TypeScript-ESTree AST", "keywords": [ "eslint", @@ -38,7 +38,7 @@ "typecheck": "tsc -p tsconfig.json --noEmit" }, "dependencies": { - "@typescript-eslint/types": "4.0.1", + "@typescript-eslint/types": "4.1.0", "eslint-visitor-keys": "^2.0.0" }, "devDependencies": {