From 6039da785e946d12d53ba19313f9787e3d061681 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Sat, 5 Aug 2023 20:46:00 +0000 Subject: [PATCH 1/9] chore(deps): update dependency prettier to v3 --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 79bf068a1d27..0cf38e7b2f4f 100644 --- a/package.json +++ b/package.json @@ -110,7 +110,7 @@ "nx-cloud": "16.1.1", "nx": "16.5.3", "patch-package": "^8.0.0", - "prettier": "^2.8.4", + "prettier": "^3.0.0", "pretty-format": "^29.6.1", "raw-loader": "^4.0.2", "rimraf": "^5.0.1", diff --git a/yarn.lock b/yarn.lock index 991a6a67adcf..16d9d3c8c356 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12272,10 +12272,10 @@ prepend-http@^2.0.0: resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-2.0.0.tgz#e92434bfa5ea8c19f41cdfd401d741a3c819d897" integrity sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc= -prettier@*, prettier@^2.8.4: - version "2.8.4" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.4.tgz#34dd2595629bfbb79d344ac4a91ff948694463c3" - integrity sha512-vIS4Rlc2FNh0BySk3Wkd6xmwxB0FpOndW5fisM5H8hsZSxU2VWVB5CWIkIjWvrHjIhxk2g3bfMKM87zNTrZddw== +prettier@*, prettier@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.0.1.tgz#65271fc9320ce4913c57747a70ce635b30beaa40" + integrity sha512-fcOWSnnpCrovBsmFZIGIy9UqK2FaI7Hqax+DIO0A9UxeVoY4iweyaFjS5TavZN97Hfehph0nhsZnjlVKzEQSrQ== pretty-bytes@^5.3.0: version "5.6.0" From 6c86761d8fdd243005cecb0d14d53f8641e0cbec Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Tue, 15 Aug 2023 15:20:07 -0400 Subject: [PATCH 2/9] Updated for new API and re-ran format --- .../nested-internal-module/fixture.ts | 5 +- packages/eslint-plugin-internal/package.json | 1 + .../src/rules/plugin-test-formatting.ts | 14 +++-- .../eslint-plugin-tslint/src/custom-linter.ts | 5 +- .../docs/rules/default-param-last.md | 20 ++++-- .../rules/explicit-function-return-type.md | 8 +-- .../rules/explicit-member-accessibility.md | 15 ++++- .../rules/explicit-module-boundary-types.md | 4 +- .../docs/rules/strict-boolean-expressions.md | 2 +- packages/eslint-plugin/package.json | 1 + packages/eslint-plugin/tests/schemas.test.ts | 6 +- .../eslint-plugin/tools/generate-configs.ts | 4 +- packages/repo-tools/src/generate-sponsors.ts | 4 +- .../package.json | 1 + .../src/index.ts | 6 +- packages/scope-manager/package.json | 1 + .../fixtures/decorators/parameter-property.ts | 5 +- packages/scope-manager/tools/generate-lib.ts | 6 +- packages/website/package.json | 1 + .../website/plugins/generated-rule-docs.ts | 6 +- .../src/components/ErrorsViewer.module.css | 4 +- .../components/RulesTable/styles.module.css | 6 +- .../src/components/ast/ASTViewer.module.css | 4 +- .../components/config/ConfigEditor.module.css | 3 +- .../components/inputs/CopyButton.module.css | 4 +- .../src/components/layout/Expander.module.css | 3 +- .../components/layout/InputLabel.module.css | 3 +- .../website/tools/generate-website-dts.ts | 2 +- yarn.lock | 62 +++++++++++++------ 29 files changed, 139 insertions(+), 67 deletions(-) diff --git a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/nested-internal-module/fixture.ts b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/nested-internal-module/fixture.ts index fb115370b27e..171ad43b5470 100644 --- a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/nested-internal-module/fixture.ts +++ b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/nested-internal-module/fixture.ts @@ -3,7 +3,10 @@ module A { export var x = 'hello world'; export class Point { - constructor(public x: number, public y: number) {} + constructor( + public x: number, + public y: number, + ) {} } export module B { export interface Id { diff --git a/packages/eslint-plugin-internal/package.json b/packages/eslint-plugin-internal/package.json index 91ab1d0c7f27..14efbd7ce256 100644 --- a/packages/eslint-plugin-internal/package.json +++ b/packages/eslint-plugin-internal/package.json @@ -13,6 +13,7 @@ "typecheck": "tsc -p tsconfig.json --noEmit" }, "dependencies": { + "@prettier/sync": "*", "@types/prettier": "*", "@typescript-eslint/rule-tester": "6.2.1", "@typescript-eslint/scope-manager": "6.2.1", diff --git a/packages/eslint-plugin-internal/src/rules/plugin-test-formatting.ts b/packages/eslint-plugin-internal/src/rules/plugin-test-formatting.ts index be81846a116a..553a8af71f26 100644 --- a/packages/eslint-plugin-internal/src/rules/plugin-test-formatting.ts +++ b/packages/eslint-plugin-internal/src/rules/plugin-test-formatting.ts @@ -1,7 +1,7 @@ +import prettier from '@prettier/sync'; import { getContextualType } from '@typescript-eslint/type-utils'; import type { TSESTree } from '@typescript-eslint/utils'; import { AST_NODE_TYPES, ESLintUtils } from '@typescript-eslint/utils'; -import { format, resolveConfig } from 'prettier'; import { createRule } from '../util'; @@ -45,7 +45,7 @@ const a = 1; ] */ -const prettierConfig = resolveConfig.sync(__dirname) ?? {}; +const prettierConfig = prettier.resolveConfig(__dirname) ?? {}; const START_OF_LINE_WHITESPACE_MATCHER = /^([ ]*)/; const BACKTICK_REGEX = /`/g; const TEMPLATE_EXPR_OPENER = /\$\{/g; @@ -162,10 +162,12 @@ export default createRule({ } try { - return format(code, { - ...prettierConfig, - parser: 'typescript', - }).trimEnd(); // prettier will insert a new line at the end of the code + return prettier + .format(code, { + ...prettierConfig, + parser: 'typescript', + }) + .trimEnd(); // prettier will insert a new line at the end of the code } catch (ex) { // adapted from https://github.com/prettier/eslint-plugin-prettier/blob/185b1064d3dd674538456fb2fad97fbfcde49e0d/eslint-plugin-prettier.js#L242-L257 if (!(ex instanceof SyntaxError)) { diff --git a/packages/eslint-plugin-tslint/src/custom-linter.ts b/packages/eslint-plugin-tslint/src/custom-linter.ts index bd8ce6a5be1a..b4e8d753b8f9 100644 --- a/packages/eslint-plugin-tslint/src/custom-linter.ts +++ b/packages/eslint-plugin-tslint/src/custom-linter.ts @@ -4,7 +4,10 @@ import type { Program, SourceFile } from 'typescript'; // @ts-expect-error - We need to access the program, but Linter has private program already export class CustomLinter extends Linter { - constructor(options: ILinterOptions, private readonly program: Program) { + constructor( + options: ILinterOptions, + private readonly program: Program, + ) { super(options, program); } diff --git a/packages/eslint-plugin/docs/rules/default-param-last.md b/packages/eslint-plugin/docs/rules/default-param-last.md index 62c3889012b7..909f9ac10d0f 100644 --- a/packages/eslint-plugin/docs/rules/default-param-last.md +++ b/packages/eslint-plugin/docs/rules/default-param-last.md @@ -20,10 +20,16 @@ function f(a = 0, b: number) {} function f(a: number, b = 0, c: number) {} function f(a: number, b?: number, c: number) {} class Foo { - constructor(public a = 10, private b: number) {} + constructor( + public a = 10, + private b: number, + ) {} } class Foo { - constructor(public a?: number, private b: number) {} + constructor( + public a?: number, + private b: number, + ) {} } ``` @@ -38,9 +44,15 @@ function f(a: number, b?: number) {} function f(a: number, b?: number, c = 0) {} function f(a: number, b = 0, c?: number) {} class Foo { - constructor(public a, private b = 0) {} + constructor( + public a, + private b = 0, + ) {} } class Foo { - constructor(public a, private b?: number) {} + constructor( + public a, + private b?: number, + ) {} } ``` diff --git a/packages/eslint-plugin/docs/rules/explicit-function-return-type.md b/packages/eslint-plugin/docs/rules/explicit-function-return-type.md index 0d0e476d576c..687aa704ea91 100644 --- a/packages/eslint-plugin/docs/rules/explicit-function-return-type.md +++ b/packages/eslint-plugin/docs/rules/explicit-function-return-type.md @@ -209,14 +209,14 @@ Examples of code for this rule with `{ allowDirectConstAssertionInArrowFunctions #### ❌ Incorrect ```ts -const func = (value: number) => ({ type: 'X', value } as any); -const func = (value: number) => ({ type: 'X', value } as Action); +const func = (value: number) => ({ type: 'X', value }) as any; +const func = (value: number) => ({ type: 'X', value }) as Action; ``` #### ✅ Correct ```ts -const func = (value: number) => ({ foo: 'bar', value } as const); +const func = (value: number) => ({ foo: 'bar', value }) as const; const func = () => x as const; ``` @@ -255,7 +255,7 @@ function foo(t: T) { return t; } -const bar = (t: T) => t; +const bar = (t: T) => t; ``` #### ✅ Correct diff --git a/packages/eslint-plugin/docs/rules/explicit-member-accessibility.md b/packages/eslint-plugin/docs/rules/explicit-member-accessibility.md index 51fa8523582f..fe74bfce0273 100644 --- a/packages/eslint-plugin/docs/rules/explicit-member-accessibility.md +++ b/packages/eslint-plugin/docs/rules/explicit-member-accessibility.md @@ -90,7 +90,10 @@ The following patterns are considered correct with the default options `{ access ```ts class Animal { - public constructor(public breed, name) { + public constructor( + public breed, + name, + ) { // Parameter property and constructor this.animalName = name; } @@ -113,7 +116,10 @@ The following patterns are considered incorrect with the accessibility set to ** ```ts class Animal { - public constructor(public breed, name) { + public constructor( + public breed, + name, + ) { // Parameter property and constructor this.animalName = name; } @@ -136,7 +142,10 @@ The following patterns are considered correct with the accessibility set to **no ```ts class Animal { - constructor(protected breed, name) { + constructor( + protected breed, + name, + ) { // Parameter property and constructor this.name = name; } diff --git a/packages/eslint-plugin/docs/rules/explicit-module-boundary-types.md b/packages/eslint-plugin/docs/rules/explicit-module-boundary-types.md index e48af85195d8..d10515e261cd 100644 --- a/packages/eslint-plugin/docs/rules/explicit-module-boundary-types.md +++ b/packages/eslint-plugin/docs/rules/explicit-module-boundary-types.md @@ -131,11 +131,11 @@ export const bar = () => 1; #### ✅ Correct ```ts -export const func = (value: number) => ({ type: 'X', value } as const); +export const func = (value: number) => ({ type: 'X', value }) as const; export const foo = () => ({ bar: true, - } as const); + }) as const; export const bar = () => 1 as const; ``` diff --git a/packages/eslint-plugin/docs/rules/strict-boolean-expressions.md b/packages/eslint-plugin/docs/rules/strict-boolean-expressions.md index 45a7f8f94962..7a55b6f69fd5 100644 --- a/packages/eslint-plugin/docs/rules/strict-boolean-expressions.md +++ b/packages/eslint-plugin/docs/rules/strict-boolean-expressions.md @@ -46,7 +46,7 @@ function foo(bool?: boolean) { } // `any`, unconstrained generics and unions of more than one primitive type are disallowed -const foo = (arg: T) => (arg ? 1 : 0); +const foo = (arg: T) => (arg ? 1 : 0); // always-truthy and always-falsy types are disallowed let obj = {}; diff --git a/packages/eslint-plugin/package.json b/packages/eslint-plugin/package.json index cecb078d9ac3..c376e537355e 100644 --- a/packages/eslint-plugin/package.json +++ b/packages/eslint-plugin/package.json @@ -70,6 +70,7 @@ "ts-api-utils": "^1.0.1" }, "devDependencies": { + "@prettier/sync": "*", "@types/debug": "*", "@types/marked": "*", "@types/natural-compare": "*", diff --git a/packages/eslint-plugin/tests/schemas.test.ts b/packages/eslint-plugin/tests/schemas.test.ts index 8ac28f96d82d..5524203d1815 100644 --- a/packages/eslint-plugin/tests/schemas.test.ts +++ b/packages/eslint-plugin/tests/schemas.test.ts @@ -3,8 +3,8 @@ import 'jest-specific-snapshot'; import fs from 'node:fs'; import path from 'node:path'; +import prettier from '@prettier/sync'; import { compile } from '@typescript-eslint/rule-schema-to-typescript-types'; -import { format, resolveConfig } from 'prettier'; import rules from '../src/rules/index'; import { areOptionsValid } from './areOptionsValid'; @@ -17,7 +17,7 @@ try { } const prettierConfigJson = { - ...(resolveConfig.sync(__filename) ?? {}), + ...(prettier.resolveConfig(__filename) ?? {}), filepath: path.join(__dirname, 'schema.json'), }; @@ -34,7 +34,7 @@ describe('Rule schemas should be convertible to TS types for documentation purpo } (ruleName === ONLY ? it.only : it)(ruleName, () => { - const schemaString = format( + const schemaString = prettier.format( JSON.stringify( ruleDef.meta.schema, (k, v: unknown) => { diff --git a/packages/eslint-plugin/tools/generate-configs.ts b/packages/eslint-plugin/tools/generate-configs.ts index 8fac06d16687..fdd536d47179 100644 --- a/packages/eslint-plugin/tools/generate-configs.ts +++ b/packages/eslint-plugin/tools/generate-configs.ts @@ -1,7 +1,7 @@ +import prettier from '@prettier/sync'; import type { TSESLint } from '@typescript-eslint/utils'; import * as fs from 'fs'; import * as path from 'path'; -import prettier from 'prettier'; import * as url from 'url'; import type RulesFile from '../src/rules'; @@ -45,7 +45,7 @@ async function main(): Promise { ].join('\n'); } - const prettierConfig = prettier.resolveConfig.sync(__dirname); + const prettierConfig = prettier.resolveConfig(__dirname); type LinterConfigRules = Record; diff --git a/packages/repo-tools/src/generate-sponsors.ts b/packages/repo-tools/src/generate-sponsors.ts index cbec8141ddc1..c8b7a3b9cebc 100644 --- a/packages/repo-tools/src/generate-sponsors.ts +++ b/packages/repo-tools/src/generate-sponsors.ts @@ -1,7 +1,7 @@ import fetch from 'cross-fetch'; import * as fs from 'fs'; import * as path from 'path'; -import * as prettier from 'prettier'; +import prettier from 'prettier'; const graphqlEndpoint = 'https://api.opencollective.com/graphql/v2'; @@ -184,7 +184,7 @@ async function stringifyObject( 2, ); - return prettier.format(text, { + return await prettier.format(text, { ...config, parser: 'json', }); diff --git a/packages/rule-schema-to-typescript-types/package.json b/packages/rule-schema-to-typescript-types/package.json index 3bfa00ab937a..ee01f14bb997 100644 --- a/packages/rule-schema-to-typescript-types/package.json +++ b/packages/rule-schema-to-typescript-types/package.json @@ -33,6 +33,7 @@ "typecheck": "tsc -p tsconfig.json --noEmit" }, "dependencies": { + "@prettier/sync": "*", "@typescript-eslint/type-utils": "6.2.1", "@typescript-eslint/utils": "6.2.1", "natural-compare": "^1.4.0", diff --git a/packages/rule-schema-to-typescript-types/src/index.ts b/packages/rule-schema-to-typescript-types/src/index.ts index e998719a3060..90a553e2fd7d 100644 --- a/packages/rule-schema-to-typescript-types/src/index.ts +++ b/packages/rule-schema-to-typescript-types/src/index.ts @@ -1,7 +1,7 @@ +import prettier from '@prettier/sync'; import { TSUtils } from '@typescript-eslint/utils'; import type { JSONSchema4 } from '@typescript-eslint/utils/json-schema'; import path from 'path'; -import { format as prettierFormat, resolveConfig } from 'prettier'; import { generateType } from './generateType'; import { optimizeAST } from './optimizeAST'; @@ -9,7 +9,7 @@ import { printTypeAlias } from './printAST'; import type { AST } from './types'; const prettierConfig = { - ...(resolveConfig.sync(__filename) ?? {}), + ...(prettier.resolveConfig(__filename) ?? {}), filepath: path.join(__dirname, 'schema.ts'), }; @@ -52,7 +52,7 @@ export function compile( const unformattedCode = [...refTypes, optionsType].join('\n\n'); try { - return prettierFormat(unformattedCode, prettierConfig); + return prettier.format(unformattedCode, prettierConfig); } catch (e) { if (e instanceof Error) { e.message = e.message + `\n\nUnformatted Code:\n${unformattedCode}`; diff --git a/packages/scope-manager/package.json b/packages/scope-manager/package.json index 3229dd7bbbfa..1d4fa62f362d 100644 --- a/packages/scope-manager/package.json +++ b/packages/scope-manager/package.json @@ -48,6 +48,7 @@ "@typescript-eslint/visitor-keys": "6.2.1" }, "devDependencies": { + "@prettier/sync": "*", "@types/glob": "*", "@typescript-eslint/typescript-estree": "6.2.1", "glob": "*", diff --git a/packages/scope-manager/tests/fixtures/decorators/parameter-property.ts b/packages/scope-manager/tests/fixtures/decorators/parameter-property.ts index 1b2a5356f7c4..b3d208fd3f01 100644 --- a/packages/scope-manager/tests/fixtures/decorators/parameter-property.ts +++ b/packages/scope-manager/tests/fixtures/decorators/parameter-property.ts @@ -1,4 +1,7 @@ function decorator() {} class Foo { - constructor(@decorator readonly a, @decorator readonly b = 1) {} + constructor( + @decorator readonly a, + @decorator readonly b = 1, + ) {} } diff --git a/packages/scope-manager/tools/generate-lib.ts b/packages/scope-manager/tools/generate-lib.ts index 13cc9eaec093..ba6615aef672 100644 --- a/packages/scope-manager/tools/generate-lib.ts +++ b/packages/scope-manager/tools/generate-lib.ts @@ -1,8 +1,8 @@ +import prettier from '@prettier/sync'; import type { TSESTree } from '@typescript-eslint/types'; import { AST_TOKEN_TYPES } from '@typescript-eslint/types'; import * as fs from 'fs'; import * as path from 'path'; -import { format, resolveConfig } from 'prettier'; import { rimraf } from 'rimraf'; import * as ts from 'typescript'; @@ -34,7 +34,7 @@ function addAutoGeneratedComment(code: string[]): string { ].join('\n'); } -const PRETTIER_CONFIG = resolveConfig.sync(__dirname); +const PRETTIER_CONFIG = prettier.resolveConfig(__dirname); const TS_LIB_FOLDER = path.resolve( __dirname, '..', @@ -66,7 +66,7 @@ enum BASE_CONFIG_EXPORT_NAMES { } function formatCode(code: string[]): string { - return format(addAutoGeneratedComment(code), { + return prettier.format(addAutoGeneratedComment(code), { parser: 'typescript', ...PRETTIER_CONFIG, }); diff --git a/packages/website/package.json b/packages/website/package.json index beed0fd3a0b9..3ee96f1294cb 100644 --- a/packages/website/package.json +++ b/packages/website/package.json @@ -24,6 +24,7 @@ "@docusaurus/remark-plugin-npm2yarn": "~2.4.1", "@docusaurus/theme-common": "~2.4.1", "@mdx-js/react": "1.6.22", + "@prettier/sync": "*", "@typescript-eslint/parser": "6.2.1", "@typescript-eslint/website-eslint": "6.2.1", "clsx": "^2.0.0", diff --git a/packages/website/plugins/generated-rule-docs.ts b/packages/website/plugins/generated-rule-docs.ts index 9f4d013d5455..207b11720bff 100644 --- a/packages/website/plugins/generated-rule-docs.ts +++ b/packages/website/plugins/generated-rule-docs.ts @@ -1,3 +1,4 @@ +import prettier from '@prettier/sync'; import pluginRules from '@typescript-eslint/eslint-plugin/use-at-your-own-risk/rules'; import { compile } from '@typescript-eslint/rule-schema-to-typescript-types'; import * as fs from 'fs'; @@ -5,7 +6,6 @@ import * as lz from 'lz-string'; import type * as mdast from 'mdast'; import { EOL } from 'os'; import * as path from 'path'; -import { format, resolveConfig } from 'prettier'; import type { Plugin } from 'unified'; import type * as unist from 'unist'; @@ -29,7 +29,7 @@ const SPECIAL_CASE_DEFAULTS = new Map([ ]); const prettierConfig = { - ...(resolveConfig.sync(__filename) ?? {}), + ...(prettier.resolveConfig(__filename) ?? {}), filepath: path.join(__dirname, 'defaults.ts'), }; @@ -287,7 +287,7 @@ export const generatedRuleDocs: Plugin = () => { type: 'code', value: [ compile(rule.meta.schema), - format( + prettier.format( `const defaultOptions: Options = ${defaults};`, prettierConfig, ), diff --git a/packages/website/src/components/ErrorsViewer.module.css b/packages/website/src/components/ErrorsViewer.module.css index 4cfc2e15d18c..83d29207fd59 100644 --- a/packages/website/src/components/ErrorsViewer.module.css +++ b/packages/website/src/components/ErrorsViewer.module.css @@ -7,7 +7,9 @@ font-size: 13px; line-height: 18px; letter-spacing: 0; - font-feature-settings: 'liga' 0, 'calt' 0; + font-feature-settings: + 'liga' 0, + 'calt' 0; box-sizing: border-box; margin: 0; white-space: break-spaces; diff --git a/packages/website/src/components/RulesTable/styles.module.css b/packages/website/src/components/RulesTable/styles.module.css index 2f9aefd132d7..3ffcec037609 100644 --- a/packages/website/src/components/RulesTable/styles.module.css +++ b/packages/website/src/components/RulesTable/styles.module.css @@ -104,8 +104,10 @@ margin-left: 0; opacity: 0; width: 0; - transition: margin-left var(--ifm-transition-fast), - opacity var(--ifm-transition-fast), width var(--ifm-transition-fast); + transition: + margin-left var(--ifm-transition-fast), + opacity var(--ifm-transition-fast), + width var(--ifm-transition-fast); } .visual.visual-exclude::after, diff --git a/packages/website/src/components/ast/ASTViewer.module.css b/packages/website/src/components/ast/ASTViewer.module.css index b986c95305e6..b872078b8d06 100644 --- a/packages/website/src/components/ast/ASTViewer.module.css +++ b/packages/website/src/components/ast/ASTViewer.module.css @@ -6,7 +6,9 @@ font-size: 13px; line-height: 18px; letter-spacing: 0; - font-feature-settings: 'liga' 0, 'calt' 0; + font-feature-settings: + 'liga' 0, + 'calt' 0; position: relative; min-width: 100%; } diff --git a/packages/website/src/components/config/ConfigEditor.module.css b/packages/website/src/components/config/ConfigEditor.module.css index 940c7a825ee9..ceab4a98c419 100644 --- a/packages/website/src/components/config/ConfigEditor.module.css +++ b/packages/website/src/components/config/ConfigEditor.module.css @@ -12,7 +12,8 @@ .searchResult { margin: 0; - transition: background-color var(--ifm-transition-fast) + transition: + background-color var(--ifm-transition-fast) var(--ifm-transition-timing-default), color var(--ifm-transition-fast) var(--ifm-transition-timing-default); } diff --git a/packages/website/src/components/inputs/CopyButton.module.css b/packages/website/src/components/inputs/CopyButton.module.css index c60c53bb5453..9967e6ddf82f 100644 --- a/packages/website/src/components/inputs/CopyButton.module.css +++ b/packages/website/src/components/inputs/CopyButton.module.css @@ -22,7 +22,9 @@ align-items: center; display: flex; line-height: 0; - transition: opacity 0.2s ease-in-out, border-color 0.4s ease-in-out, + transition: + opacity 0.2s ease-in-out, + border-color 0.4s ease-in-out, color 0.4s ease-in-out; } diff --git a/packages/website/src/components/layout/Expander.module.css b/packages/website/src/components/layout/Expander.module.css index 79699d0ee783..2e77070b22e6 100644 --- a/packages/website/src/components/layout/Expander.module.css +++ b/packages/website/src/components/layout/Expander.module.css @@ -9,7 +9,8 @@ display: flex; flex-direction: row; align-items: center; - transition: background-color var(--ifm-transition-fast) + transition: + background-color var(--ifm-transition-fast) var(--ifm-transition-timing-default), color var(--ifm-transition-fast) var(--ifm-transition-timing-default); color: var(--ifm-color-emphasis-900); diff --git a/packages/website/src/components/layout/InputLabel.module.css b/packages/website/src/components/layout/InputLabel.module.css index 7c4e4491e6a5..1d9440616f13 100644 --- a/packages/website/src/components/layout/InputLabel.module.css +++ b/packages/website/src/components/layout/InputLabel.module.css @@ -7,7 +7,8 @@ font-size: 0.75rem; margin: 0; padding: 0.4rem 0.8rem; - transition: background-color var(--ifm-transition-fast) + transition: + background-color var(--ifm-transition-fast) var(--ifm-transition-timing-default), color var(--ifm-transition-fast) var(--ifm-transition-timing-default); color: var(--ifm-font-color-secondary); diff --git a/packages/website/tools/generate-website-dts.ts b/packages/website/tools/generate-website-dts.ts index 6f7525b9f0da..303615e1fe08 100644 --- a/packages/website/tools/generate-website-dts.ts +++ b/packages/website/tools/generate-website-dts.ts @@ -35,7 +35,7 @@ async function getFileAndStoreLocally( let contents = await response.text(); contents = [...banner, '', editFunc(contents)].join('\n'); - contents = prettier.format(contents, { + contents = await prettier.format(contents, { parser: 'typescript', ...config, }); diff --git a/yarn.lock b/yarn.lock index 16d9d3c8c356..cae7b7e66cf9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3347,6 +3347,11 @@ resolved "https://registry.yarnpkg.com/@polka/url/-/url-1.0.0-next.21.tgz#5de5a2385a35309427f6011992b544514d559aa1" integrity sha512-a5Sab1C4/icpTZVzZc5Ghpz88yQtGOyNqYXcZgOssB2uuAr+wF/MvN6bgtW32q7HHrvBki+BsZ0OuNv6EV3K9g== +"@prettier/sync@*": + version "0.3.0" + resolved "https://registry.yarnpkg.com/@prettier/sync/-/sync-0.3.0.tgz#91f2cfc23490a21586d1cf89c6f72157c000ca1e" + integrity sha512-3dcmCyAxIcxy036h1I7MQU/uEEBq8oLwf1CE3xeze+MPlgkdlb/+w6rGR/1dhp6Hqi17fRS6nvwnOzkESxEkOw== + "@rollup/plugin-babel@^5.2.0": version "5.3.1" resolved "https://registry.yarnpkg.com/@rollup/plugin-babel/-/plugin-babel-5.3.1.tgz#04bc0608f4aa4b2e4b1aebf284344d0f68fda283" @@ -3629,10 +3634,12 @@ "@svgr/plugin-svgo" "^6.2.0" "@swc/core-android-arm-eabi@link:./tools/dummypkg": - version "1.0.0" + version "0.0.0" + uid "" "@swc/core-android-arm64@link:./tools/dummypkg": - version "1.0.0" + version "0.0.0" + uid "" "@swc/core-darwin-arm64@1.3.74": version "1.3.74" @@ -3645,25 +3652,32 @@ integrity sha512-KKEGE1wXneYXe15fWDRM8/oekd/Q4yAuccA0vWY/7i6nOSPqWYcSDR0nRtR030ltDxWt0rk/eCTmNkrOWrKs3A== "@swc/core-freebsd-x64@link:./tools/dummypkg": - version "1.0.0" + version "0.0.0" + uid "" "@swc/core-linux-arm-gnueabihf@1.3.74": - version "1.0.0" + version "0.0.0" + uid "" "@swc/core-linux-arm-gnueabihf@link:./tools/dummypkg": - version "1.0.0" + version "0.0.0" + uid "" "@swc/core-linux-arm64-gnu@1.3.74": - version "1.0.0" + version "0.0.0" + uid "" "@swc/core-linux-arm64-gnu@link:./tools/dummypkg": - version "1.0.0" + version "0.0.0" + uid "" "@swc/core-linux-arm64-musl@1.3.74": - version "1.0.0" + version "0.0.0" + uid "" "@swc/core-linux-arm64-musl@link:./tools/dummypkg": - version "1.0.0" + version "0.0.0" + uid "" "@swc/core-linux-x64-gnu@1.3.74": version "1.3.74" @@ -3676,16 +3690,20 @@ integrity sha512-sxsFctbFMZEFmDE7CmYljG0dMumH8XBTwwtGr8s6z0fYAzXBGNq2AFPcmEh2np9rPWkt7pE1m0ByESD+dMkbxQ== "@swc/core-win32-arm64-msvc@1.3.74": - version "1.0.0" + version "0.0.0" + uid "" "@swc/core-win32-arm64-msvc@link:./tools/dummypkg": - version "1.0.0" + version "0.0.0" + uid "" "@swc/core-win32-ia32-msvc@1.3.74": - version "1.0.0" + version "0.0.0" + uid "" "@swc/core-win32-ia32-msvc@link:./tools/dummypkg": - version "1.0.0" + version "0.0.0" + uid "" "@swc/core-win32-x64-msvc@1.3.74": version "1.3.74" @@ -3847,10 +3865,12 @@ "@types/ms" "*" "@types/eslint-scope@^3.7.3": - version "1.0.0" + version "0.0.0" + uid "" "@types/eslint-scope@link:./tools/dummypkg": - version "1.0.0" + version "0.0.0" + uid "" "@types/eslint-visitor-keys@*": version "3.3.0" @@ -3860,16 +3880,20 @@ eslint-visitor-keys "*" "@types/eslint@link:./tools/dummypkg": - version "1.0.0" + version "0.0.0" + uid "" "@types/estree@0.0.39": - version "1.0.0" + version "0.0.0" + uid "" "@types/estree@^1.0.0": - version "1.0.0" + version "0.0.0" + uid "" "@types/estree@link:./tools/dummypkg": - version "1.0.0" + version "0.0.0" + uid "" "@types/express-serve-static-core@*", "@types/express-serve-static-core@^4.17.18": version "4.17.28" From c555c5d84e9f8e723432a34d4e110baa23c22c65 Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Tue, 15 Aug 2023 15:48:56 -0400 Subject: [PATCH 3/9] Updated snapshots --- .../snapshots/1-TSESTree-AST.shot | 32 ++-- .../snapshots/2-TSESTree-Tokens.shot | 46 ++--- .../snapshots/3-Babel-AST.shot | 31 ++- .../snapshots/4-Babel-Tokens.shot | 46 ++--- .../snapshots/5-AST-Alignment-AST.shot | 49 +++-- .../snapshots/1-TSESTree-AST.shot | 32 ++-- .../snapshots/2-TSESTree-Tokens.shot | 46 ++--- .../snapshots/3-Babel-AST.shot | 31 ++- .../snapshots/4-Babel-Tokens.shot | 46 ++--- .../snapshots/5-AST-Alignment-AST.shot | 49 +++-- .../snapshots/1-TSESTree-AST.shot | 93 ++++----- .../snapshots/2-TSESTree-Tokens.shot | 46 ++--- .../snapshots/3-Babel-AST.shot | 73 +++---- .../snapshots/4-Babel-Tokens.shot | 46 ++--- .../snapshots/5-AST-Alignment-AST.shot | 135 ++++++------- .../snapshots/1-TSESTree-AST.shot | 44 ++--- .../snapshots/2-TSESTree-Tokens.shot | 58 +++--- .../snapshots/3-Babel-AST.shot | 43 +++-- .../snapshots/4-Babel-Tokens.shot | 58 +++--- .../snapshots/5-AST-Alignment-AST.shot | 97 +++++----- .../snapshots/1-TSESTree-AST.shot | 113 +++++------ .../snapshots/2-TSESTree-Tokens.shot | 68 +++---- .../snapshots/3-Babel-AST.shot | 86 ++++----- .../snapshots/4-Babel-Tokens.shot | 68 +++---- .../snapshots/5-AST-Alignment-AST.shot | 177 ++++++++--------- .../snapshots/1-TSESTree-AST.shot | 113 +++++------ .../snapshots/2-TSESTree-Tokens.shot | 58 +++--- .../snapshots/3-Babel-AST.shot | 87 ++++----- .../snapshots/4-Babel-Tokens.shot | 58 +++--- .../snapshots/5-AST-Alignment-AST.shot | 175 ++++++++--------- .../snapshots/1-TSESTree-AST.shot | 158 ++++++++-------- .../snapshots/2-TSESTree-Tokens.shot | 178 +++++++++--------- .../snapshots/3-Babel-AST.shot | 158 ++++++++-------- .../snapshots/4-Babel-Tokens.shot | 178 +++++++++--------- .../snapshots/5-AST-Alignment-AST.shot | 158 ++++++++-------- .../snapshots/6-AST-Alignment-Tokens.shot | 178 +++++++++--------- .../src/rules/plugin-test-formatting.ts | 7 +- packages/eslint-plugin-internal/tsconfig.json | 1 + .../schema-snapshots/naming-convention.shot | 4 +- 39 files changed, 1446 insertions(+), 1678 deletions(-) diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-declare/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-declare/snapshots/1-TSESTree-AST.shot index a17505651b98..7ec22fb3a5e4 100644 --- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-declare/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-declare/snapshots/1-TSESTree-AST.shot @@ -10,13 +10,13 @@ Program { type: "TSModuleBlock", body: [], - range: [26, 28], + range: [18, 20], loc: { - start: { column: 26, line: 1 }, - end: { column: 28, line: 1 }, + start: { column: 18, line: 1 }, + end: { column: 20, line: 1 }, }, }, - declare: true, + declare: false, global: false, id: TSQualifiedName { type: "TSQualifiedName", @@ -26,10 +26,10 @@ Program { name: "abd", optional: false, - range: [18, 21], + range: [10, 13], loc: { - start: { column: 18, line: 1 }, - end: { column: 21, line: 1 }, + start: { column: 10, line: 1 }, + end: { column: 13, line: 1 }, }, }, right: Identifier { @@ -38,31 +38,31 @@ Program { name: "def", optional: false, - range: [22, 25], + range: [14, 17], loc: { - start: { column: 22, line: 1 }, - end: { column: 25, line: 1 }, + start: { column: 14, line: 1 }, + end: { column: 17, line: 1 }, }, }, - range: [18, 25], + range: [10, 17], loc: { - start: { column: 18, line: 1 }, - end: { column: 25, line: 1 }, + start: { column: 10, line: 1 }, + end: { column: 17, line: 1 }, }, }, kind: "namespace", - range: [0, 28], + range: [0, 20], loc: { start: { column: 0, line: 1 }, - end: { column: 28, line: 1 }, + end: { column: 20, line: 1 }, }, }, ], sourceType: "script", - range: [0, 29], + range: [0, 21], loc: { start: { column: 0, line: 1 }, end: { column: 0, line: 2 }, diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-declare/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-declare/snapshots/2-TSESTree-Tokens.shot index 8769bf5f46b5..af2f03ff202a 100644 --- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-declare/snapshots/2-TSESTree-Tokens.shot +++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-declare/snapshots/2-TSESTree-Tokens.shot @@ -2,74 +2,64 @@ exports[`AST Fixtures declaration TSModuleDeclaration namespace-nested-once-declare TSESTree - Tokens 1`] = ` [ - Identifier { - type: "Identifier", - value: "declare", - - range: [0, 7], - loc: { - start: { column: 0, line: 1 }, - end: { column: 7, line: 1 }, - }, - }, Identifier { type: "Identifier", value: "namespace", - range: [8, 17], + range: [0, 9], loc: { - start: { column: 8, line: 1 }, - end: { column: 17, line: 1 }, + start: { column: 0, line: 1 }, + end: { column: 9, line: 1 }, }, }, Identifier { type: "Identifier", value: "abd", - range: [18, 21], + range: [10, 13], loc: { - start: { column: 18, line: 1 }, - end: { column: 21, line: 1 }, + start: { column: 10, line: 1 }, + end: { column: 13, line: 1 }, }, }, Punctuator { type: "Punctuator", value: ".", - range: [21, 22], + range: [13, 14], loc: { - start: { column: 21, line: 1 }, - end: { column: 22, line: 1 }, + start: { column: 13, line: 1 }, + end: { column: 14, line: 1 }, }, }, Identifier { type: "Identifier", value: "def", - range: [22, 25], + range: [14, 17], loc: { - start: { column: 22, line: 1 }, - end: { column: 25, line: 1 }, + start: { column: 14, line: 1 }, + end: { column: 17, line: 1 }, }, }, Punctuator { type: "Punctuator", value: "{", - range: [26, 27], + range: [18, 19], loc: { - start: { column: 26, line: 1 }, - end: { column: 27, line: 1 }, + start: { column: 18, line: 1 }, + end: { column: 19, line: 1 }, }, }, Punctuator { type: "Punctuator", value: "}", - range: [27, 28], + range: [19, 20], loc: { - start: { column: 27, line: 1 }, - end: { column: 28, line: 1 }, + start: { column: 19, line: 1 }, + end: { column: 20, line: 1 }, }, }, ] diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-declare/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-declare/snapshots/3-Babel-AST.shot index df75ba2eea9b..1efc65bcf8f9 100644 --- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-declare/snapshots/3-Babel-AST.shot +++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-declare/snapshots/3-Babel-AST.shot @@ -12,51 +12,50 @@ Program { type: "TSModuleBlock", body: [], - range: [26, 28], + range: [18, 20], loc: { - start: { column: 26, line: 1 }, - end: { column: 28, line: 1 }, + start: { column: 18, line: 1 }, + end: { column: 20, line: 1 }, }, }, id: Identifier { type: "Identifier", name: "def", - range: [22, 25], + range: [14, 17], loc: { - start: { column: 22, line: 1 }, - end: { column: 25, line: 1 }, + start: { column: 14, line: 1 }, + end: { column: 17, line: 1 }, }, }, - range: [22, 28], + range: [14, 20], loc: { - start: { column: 22, line: 1 }, - end: { column: 28, line: 1 }, + start: { column: 14, line: 1 }, + end: { column: 20, line: 1 }, }, }, - declare: true, id: Identifier { type: "Identifier", name: "abd", - range: [18, 21], + range: [10, 13], loc: { - start: { column: 18, line: 1 }, - end: { column: 21, line: 1 }, + start: { column: 10, line: 1 }, + end: { column: 13, line: 1 }, }, }, - range: [0, 28], + range: [0, 20], loc: { start: { column: 0, line: 1 }, - end: { column: 28, line: 1 }, + end: { column: 20, line: 1 }, }, }, ], sourceType: "script", - range: [0, 29], + range: [0, 21], loc: { start: { column: 0, line: 1 }, end: { column: 0, line: 2 }, diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-declare/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-declare/snapshots/4-Babel-Tokens.shot index be0128d5d6fe..764dcbb1512c 100644 --- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-declare/snapshots/4-Babel-Tokens.shot +++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-declare/snapshots/4-Babel-Tokens.shot @@ -2,74 +2,64 @@ exports[`AST Fixtures declaration TSModuleDeclaration namespace-nested-once-declare Babel - Tokens 1`] = ` [ - Identifier { - type: "Identifier", - value: "declare", - - range: [0, 7], - loc: { - start: { column: 0, line: 1 }, - end: { column: 7, line: 1 }, - }, - }, Identifier { type: "Identifier", value: "namespace", - range: [8, 17], + range: [0, 9], loc: { - start: { column: 8, line: 1 }, - end: { column: 17, line: 1 }, + start: { column: 0, line: 1 }, + end: { column: 9, line: 1 }, }, }, Identifier { type: "Identifier", value: "abd", - range: [18, 21], + range: [10, 13], loc: { - start: { column: 18, line: 1 }, - end: { column: 21, line: 1 }, + start: { column: 10, line: 1 }, + end: { column: 13, line: 1 }, }, }, Punctuator { type: "Punctuator", value: ".", - range: [21, 22], + range: [13, 14], loc: { - start: { column: 21, line: 1 }, - end: { column: 22, line: 1 }, + start: { column: 13, line: 1 }, + end: { column: 14, line: 1 }, }, }, Identifier { type: "Identifier", value: "def", - range: [22, 25], + range: [14, 17], loc: { - start: { column: 22, line: 1 }, - end: { column: 25, line: 1 }, + start: { column: 14, line: 1 }, + end: { column: 17, line: 1 }, }, }, Punctuator { type: "Punctuator", value: "{", - range: [26, 27], + range: [18, 19], loc: { - start: { column: 26, line: 1 }, - end: { column: 27, line: 1 }, + start: { column: 18, line: 1 }, + end: { column: 19, line: 1 }, }, }, Punctuator { type: "Punctuator", value: "}", - range: [27, 28], + range: [19, 20], loc: { - start: { column: 27, line: 1 }, - end: { column: 28, line: 1 }, + start: { column: 19, line: 1 }, + end: { column: 20, line: 1 }, }, }, ] diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-declare/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-declare/snapshots/5-AST-Alignment-AST.shot index 26c71097e831..82b507e93169 100644 --- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-declare/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-declare/snapshots/5-AST-Alignment-AST.shot @@ -14,13 +14,13 @@ exports[`AST Fixtures declaration TSModuleDeclaration namespace-nested-once-decl - type: 'TSModuleBlock', - body: Array [], - -- range: [26, 28], +- range: [18, 20], - loc: { -- start: { column: 26, line: 1 }, -- end: { column: 28, line: 1 }, +- start: { column: 18, line: 1 }, +- end: { column: 20, line: 1 }, - }, - }, -- declare: true, +- declare: false, - global: false, - id: TSQualifiedName { - type: 'TSQualifiedName', @@ -35,13 +35,13 @@ exports[`AST Fixtures declaration TSModuleDeclaration namespace-nested-once-decl + type: 'TSModuleBlock', + body: Array [], -- range: [18, 21], -+ range: [26, 28], +- range: [10, 13], ++ range: [18, 20], loc: { -- start: { column: 18, line: 1 }, -- end: { column: 21, line: 1 }, -+ start: { column: 26, line: 1 }, -+ end: { column: 28, line: 1 }, +- start: { column: 10, line: 1 }, +- end: { column: 13, line: 1 }, ++ start: { column: 18, line: 1 }, ++ end: { column: 20, line: 1 }, }, }, - right: Identifier { @@ -51,44 +51,43 @@ exports[`AST Fixtures declaration TSModuleDeclaration namespace-nested-once-decl name: 'def', - optional: false, - range: [22, 25], + range: [14, 17], loc: { - start: { column: 22, line: 1 }, - end: { column: 25, line: 1 }, + start: { column: 14, line: 1 }, + end: { column: 17, line: 1 }, }, }, -- range: [18, 25], -+ range: [22, 28], +- range: [10, 17], ++ range: [14, 20], + loc: { -+ start: { column: 22, line: 1 }, -+ end: { column: 28, line: 1 }, ++ start: { column: 14, line: 1 }, ++ end: { column: 20, line: 1 }, + }, + }, -+ declare: true, + id: Identifier { + type: 'Identifier', + name: 'abd', + -+ range: [18, 21], ++ range: [10, 13], loc: { - start: { column: 18, line: 1 }, -- end: { column: 25, line: 1 }, -+ end: { column: 21, line: 1 }, + start: { column: 10, line: 1 }, +- end: { column: 17, line: 1 }, ++ end: { column: 13, line: 1 }, }, }, - kind: 'namespace', - range: [0, 28], + range: [0, 20], loc: { start: { column: 0, line: 1 }, - end: { column: 28, line: 1 }, + end: { column: 20, line: 1 }, }, }, ], sourceType: 'script', - range: [0, 29], + range: [0, 21], loc: { start: { column: 0, line: 1 }, end: { column: 0, line: 2 }, diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-export-declare/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-export-declare/snapshots/1-TSESTree-AST.shot index fefe4f69faf0..2f57c85523d2 100644 --- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-export-declare/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-export-declare/snapshots/1-TSESTree-AST.shot @@ -10,13 +10,13 @@ Program { type: "TSModuleBlock", body: [], - range: [26, 28], + range: [18, 20], loc: { - start: { column: 26, line: 1 }, - end: { column: 28, line: 1 }, + start: { column: 18, line: 1 }, + end: { column: 20, line: 1 }, }, }, - declare: true, + declare: false, global: false, id: TSQualifiedName { type: "TSQualifiedName", @@ -26,10 +26,10 @@ Program { name: "abd", optional: false, - range: [18, 21], + range: [10, 13], loc: { - start: { column: 18, line: 1 }, - end: { column: 21, line: 1 }, + start: { column: 10, line: 1 }, + end: { column: 13, line: 1 }, }, }, right: Identifier { @@ -38,31 +38,31 @@ Program { name: "def", optional: false, - range: [22, 25], + range: [14, 17], loc: { - start: { column: 22, line: 1 }, - end: { column: 25, line: 1 }, + start: { column: 14, line: 1 }, + end: { column: 17, line: 1 }, }, }, - range: [18, 25], + range: [10, 17], loc: { - start: { column: 18, line: 1 }, - end: { column: 25, line: 1 }, + start: { column: 10, line: 1 }, + end: { column: 17, line: 1 }, }, }, kind: "namespace", - range: [0, 28], + range: [0, 20], loc: { start: { column: 0, line: 1 }, - end: { column: 28, line: 1 }, + end: { column: 20, line: 1 }, }, }, ], sourceType: "script", - range: [0, 29], + range: [0, 21], loc: { start: { column: 0, line: 1 }, end: { column: 0, line: 2 }, diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-export-declare/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-export-declare/snapshots/2-TSESTree-Tokens.shot index a5081116fc4f..6c6f235df6f2 100644 --- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-export-declare/snapshots/2-TSESTree-Tokens.shot +++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-export-declare/snapshots/2-TSESTree-Tokens.shot @@ -2,74 +2,64 @@ exports[`AST Fixtures declaration TSModuleDeclaration namespace-nested-once-export-declare TSESTree - Tokens 1`] = ` [ - Identifier { - type: "Identifier", - value: "declare", - - range: [0, 7], - loc: { - start: { column: 0, line: 1 }, - end: { column: 7, line: 1 }, - }, - }, Identifier { type: "Identifier", value: "namespace", - range: [8, 17], + range: [0, 9], loc: { - start: { column: 8, line: 1 }, - end: { column: 17, line: 1 }, + start: { column: 0, line: 1 }, + end: { column: 9, line: 1 }, }, }, Identifier { type: "Identifier", value: "abd", - range: [18, 21], + range: [10, 13], loc: { - start: { column: 18, line: 1 }, - end: { column: 21, line: 1 }, + start: { column: 10, line: 1 }, + end: { column: 13, line: 1 }, }, }, Punctuator { type: "Punctuator", value: ".", - range: [21, 22], + range: [13, 14], loc: { - start: { column: 21, line: 1 }, - end: { column: 22, line: 1 }, + start: { column: 13, line: 1 }, + end: { column: 14, line: 1 }, }, }, Identifier { type: "Identifier", value: "def", - range: [22, 25], + range: [14, 17], loc: { - start: { column: 22, line: 1 }, - end: { column: 25, line: 1 }, + start: { column: 14, line: 1 }, + end: { column: 17, line: 1 }, }, }, Punctuator { type: "Punctuator", value: "{", - range: [26, 27], + range: [18, 19], loc: { - start: { column: 26, line: 1 }, - end: { column: 27, line: 1 }, + start: { column: 18, line: 1 }, + end: { column: 19, line: 1 }, }, }, Punctuator { type: "Punctuator", value: "}", - range: [27, 28], + range: [19, 20], loc: { - start: { column: 27, line: 1 }, - end: { column: 28, line: 1 }, + start: { column: 19, line: 1 }, + end: { column: 20, line: 1 }, }, }, ] diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-export-declare/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-export-declare/snapshots/3-Babel-AST.shot index eebbcb70adb1..cb7d94b164c6 100644 --- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-export-declare/snapshots/3-Babel-AST.shot +++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-export-declare/snapshots/3-Babel-AST.shot @@ -12,51 +12,50 @@ Program { type: "TSModuleBlock", body: [], - range: [26, 28], + range: [18, 20], loc: { - start: { column: 26, line: 1 }, - end: { column: 28, line: 1 }, + start: { column: 18, line: 1 }, + end: { column: 20, line: 1 }, }, }, id: Identifier { type: "Identifier", name: "def", - range: [22, 25], + range: [14, 17], loc: { - start: { column: 22, line: 1 }, - end: { column: 25, line: 1 }, + start: { column: 14, line: 1 }, + end: { column: 17, line: 1 }, }, }, - range: [22, 28], + range: [14, 20], loc: { - start: { column: 22, line: 1 }, - end: { column: 28, line: 1 }, + start: { column: 14, line: 1 }, + end: { column: 20, line: 1 }, }, }, - declare: true, id: Identifier { type: "Identifier", name: "abd", - range: [18, 21], + range: [10, 13], loc: { - start: { column: 18, line: 1 }, - end: { column: 21, line: 1 }, + start: { column: 10, line: 1 }, + end: { column: 13, line: 1 }, }, }, - range: [0, 28], + range: [0, 20], loc: { start: { column: 0, line: 1 }, - end: { column: 28, line: 1 }, + end: { column: 20, line: 1 }, }, }, ], sourceType: "script", - range: [0, 29], + range: [0, 21], loc: { start: { column: 0, line: 1 }, end: { column: 0, line: 2 }, diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-export-declare/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-export-declare/snapshots/4-Babel-Tokens.shot index a2a9ddd576d8..85a0e9791811 100644 --- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-export-declare/snapshots/4-Babel-Tokens.shot +++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-export-declare/snapshots/4-Babel-Tokens.shot @@ -2,74 +2,64 @@ exports[`AST Fixtures declaration TSModuleDeclaration namespace-nested-once-export-declare Babel - Tokens 1`] = ` [ - Identifier { - type: "Identifier", - value: "declare", - - range: [0, 7], - loc: { - start: { column: 0, line: 1 }, - end: { column: 7, line: 1 }, - }, - }, Identifier { type: "Identifier", value: "namespace", - range: [8, 17], + range: [0, 9], loc: { - start: { column: 8, line: 1 }, - end: { column: 17, line: 1 }, + start: { column: 0, line: 1 }, + end: { column: 9, line: 1 }, }, }, Identifier { type: "Identifier", value: "abd", - range: [18, 21], + range: [10, 13], loc: { - start: { column: 18, line: 1 }, - end: { column: 21, line: 1 }, + start: { column: 10, line: 1 }, + end: { column: 13, line: 1 }, }, }, Punctuator { type: "Punctuator", value: ".", - range: [21, 22], + range: [13, 14], loc: { - start: { column: 21, line: 1 }, - end: { column: 22, line: 1 }, + start: { column: 13, line: 1 }, + end: { column: 14, line: 1 }, }, }, Identifier { type: "Identifier", value: "def", - range: [22, 25], + range: [14, 17], loc: { - start: { column: 22, line: 1 }, - end: { column: 25, line: 1 }, + start: { column: 14, line: 1 }, + end: { column: 17, line: 1 }, }, }, Punctuator { type: "Punctuator", value: "{", - range: [26, 27], + range: [18, 19], loc: { - start: { column: 26, line: 1 }, - end: { column: 27, line: 1 }, + start: { column: 18, line: 1 }, + end: { column: 19, line: 1 }, }, }, Punctuator { type: "Punctuator", value: "}", - range: [27, 28], + range: [19, 20], loc: { - start: { column: 27, line: 1 }, - end: { column: 28, line: 1 }, + start: { column: 19, line: 1 }, + end: { column: 20, line: 1 }, }, }, ] diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-export-declare/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-export-declare/snapshots/5-AST-Alignment-AST.shot index c6c7a44f6b38..bd63b4012d73 100644 --- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-export-declare/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-export-declare/snapshots/5-AST-Alignment-AST.shot @@ -14,13 +14,13 @@ exports[`AST Fixtures declaration TSModuleDeclaration namespace-nested-once-expo - type: 'TSModuleBlock', - body: Array [], - -- range: [26, 28], +- range: [18, 20], - loc: { -- start: { column: 26, line: 1 }, -- end: { column: 28, line: 1 }, +- start: { column: 18, line: 1 }, +- end: { column: 20, line: 1 }, - }, - }, -- declare: true, +- declare: false, - global: false, - id: TSQualifiedName { - type: 'TSQualifiedName', @@ -35,13 +35,13 @@ exports[`AST Fixtures declaration TSModuleDeclaration namespace-nested-once-expo + type: 'TSModuleBlock', + body: Array [], -- range: [18, 21], -+ range: [26, 28], +- range: [10, 13], ++ range: [18, 20], loc: { -- start: { column: 18, line: 1 }, -- end: { column: 21, line: 1 }, -+ start: { column: 26, line: 1 }, -+ end: { column: 28, line: 1 }, +- start: { column: 10, line: 1 }, +- end: { column: 13, line: 1 }, ++ start: { column: 18, line: 1 }, ++ end: { column: 20, line: 1 }, }, }, - right: Identifier { @@ -51,44 +51,43 @@ exports[`AST Fixtures declaration TSModuleDeclaration namespace-nested-once-expo name: 'def', - optional: false, - range: [22, 25], + range: [14, 17], loc: { - start: { column: 22, line: 1 }, - end: { column: 25, line: 1 }, + start: { column: 14, line: 1 }, + end: { column: 17, line: 1 }, }, }, -- range: [18, 25], -+ range: [22, 28], +- range: [10, 17], ++ range: [14, 20], + loc: { -+ start: { column: 22, line: 1 }, -+ end: { column: 28, line: 1 }, ++ start: { column: 14, line: 1 }, ++ end: { column: 20, line: 1 }, + }, + }, -+ declare: true, + id: Identifier { + type: 'Identifier', + name: 'abd', + -+ range: [18, 21], ++ range: [10, 13], loc: { - start: { column: 18, line: 1 }, -- end: { column: 25, line: 1 }, -+ end: { column: 21, line: 1 }, + start: { column: 10, line: 1 }, +- end: { column: 17, line: 1 }, ++ end: { column: 13, line: 1 }, }, }, - kind: 'namespace', - range: [0, 28], + range: [0, 20], loc: { start: { column: 0, line: 1 }, - end: { column: 28, line: 1 }, + end: { column: 20, line: 1 }, }, }, ], sourceType: 'script', - range: [0, 29], + range: [0, 21], loc: { start: { column: 0, line: 1 }, end: { column: 0, line: 2 }, diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-export/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-export/snapshots/1-TSESTree-AST.shot index d8b2ef582c99..2d5c92dfb62c 100644 --- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-export/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-export/snapshots/1-TSESTree-AST.shot @@ -4,78 +4,65 @@ exports[`AST Fixtures declaration TSModuleDeclaration namespace-nested-once-expo Program { type: "Program", body: [ - ExportNamedDeclaration { - type: "ExportNamedDeclaration", - assertions: [], - declaration: TSModuleDeclaration { - type: "TSModuleDeclaration", - body: TSModuleBlock { - type: "TSModuleBlock", - body: [], + TSModuleDeclaration { + type: "TSModuleDeclaration", + body: TSModuleBlock { + type: "TSModuleBlock", + body: [], - range: [25, 27], - loc: { - start: { column: 25, line: 1 }, - end: { column: 27, line: 1 }, - }, + range: [18, 20], + loc: { + start: { column: 18, line: 1 }, + end: { column: 20, line: 1 }, }, - declare: false, - global: false, - id: TSQualifiedName { - type: "TSQualifiedName", - left: Identifier { - type: "Identifier", - decorators: [], - name: "abd", - optional: false, - - range: [17, 20], - loc: { - start: { column: 17, line: 1 }, - end: { column: 20, line: 1 }, - }, - }, - right: Identifier { - type: "Identifier", - decorators: [], - name: "def", - optional: false, + }, + declare: false, + global: false, + id: TSQualifiedName { + type: "TSQualifiedName", + left: Identifier { + type: "Identifier", + decorators: [], + name: "abd", + optional: false, - range: [21, 24], - loc: { - start: { column: 21, line: 1 }, - end: { column: 24, line: 1 }, - }, + range: [10, 13], + loc: { + start: { column: 10, line: 1 }, + end: { column: 13, line: 1 }, }, + }, + right: Identifier { + type: "Identifier", + decorators: [], + name: "def", + optional: false, - range: [17, 24], + range: [14, 17], loc: { - start: { column: 17, line: 1 }, - end: { column: 24, line: 1 }, + start: { column: 14, line: 1 }, + end: { column: 17, line: 1 }, }, }, - kind: "namespace", - range: [7, 27], + range: [10, 17], loc: { - start: { column: 7, line: 1 }, - end: { column: 27, line: 1 }, + start: { column: 10, line: 1 }, + end: { column: 17, line: 1 }, }, }, - exportKind: "value", - source: null, - specifiers: [], + kind: "namespace", - range: [0, 27], + range: [0, 20], loc: { start: { column: 0, line: 1 }, - end: { column: 27, line: 1 }, + end: { column: 20, line: 1 }, }, }, ], - sourceType: "module", + sourceType: "script", - range: [0, 28], + range: [0, 21], loc: { start: { column: 0, line: 1 }, end: { column: 0, line: 2 }, diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-export/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-export/snapshots/2-TSESTree-Tokens.shot index 04c548168627..8f044e487680 100644 --- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-export/snapshots/2-TSESTree-Tokens.shot +++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-export/snapshots/2-TSESTree-Tokens.shot @@ -2,74 +2,64 @@ exports[`AST Fixtures declaration TSModuleDeclaration namespace-nested-once-export TSESTree - Tokens 1`] = ` [ - Keyword { - type: "Keyword", - value: "export", - - range: [0, 6], - loc: { - start: { column: 0, line: 1 }, - end: { column: 6, line: 1 }, - }, - }, Identifier { type: "Identifier", value: "namespace", - range: [7, 16], + range: [0, 9], loc: { - start: { column: 7, line: 1 }, - end: { column: 16, line: 1 }, + start: { column: 0, line: 1 }, + end: { column: 9, line: 1 }, }, }, Identifier { type: "Identifier", value: "abd", - range: [17, 20], + range: [10, 13], loc: { - start: { column: 17, line: 1 }, - end: { column: 20, line: 1 }, + start: { column: 10, line: 1 }, + end: { column: 13, line: 1 }, }, }, Punctuator { type: "Punctuator", value: ".", - range: [20, 21], + range: [13, 14], loc: { - start: { column: 20, line: 1 }, - end: { column: 21, line: 1 }, + start: { column: 13, line: 1 }, + end: { column: 14, line: 1 }, }, }, Identifier { type: "Identifier", value: "def", - range: [21, 24], + range: [14, 17], loc: { - start: { column: 21, line: 1 }, - end: { column: 24, line: 1 }, + start: { column: 14, line: 1 }, + end: { column: 17, line: 1 }, }, }, Punctuator { type: "Punctuator", value: "{", - range: [25, 26], + range: [18, 19], loc: { - start: { column: 25, line: 1 }, - end: { column: 26, line: 1 }, + start: { column: 18, line: 1 }, + end: { column: 19, line: 1 }, }, }, Punctuator { type: "Punctuator", value: "}", - range: [26, 27], + range: [19, 20], loc: { - start: { column: 26, line: 1 }, - end: { column: 27, line: 1 }, + start: { column: 19, line: 1 }, + end: { column: 20, line: 1 }, }, }, ] diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-export/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-export/snapshots/3-Babel-AST.shot index 969e672365c7..fd3f89f94fed 100644 --- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-export/snapshots/3-Babel-AST.shot +++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-export/snapshots/3-Babel-AST.shot @@ -4,71 +4,58 @@ exports[`AST Fixtures declaration TSModuleDeclaration namespace-nested-once-expo Program { type: "Program", body: [ - ExportNamedDeclaration { - type: "ExportNamedDeclaration", - assertions: [], - declaration: TSModuleDeclaration { + TSModuleDeclaration { + type: "TSModuleDeclaration", + body: TSModuleDeclaration { type: "TSModuleDeclaration", - body: TSModuleDeclaration { - type: "TSModuleDeclaration", - body: TSModuleBlock { - type: "TSModuleBlock", - body: [], + body: TSModuleBlock { + type: "TSModuleBlock", + body: [], - range: [25, 27], - loc: { - start: { column: 25, line: 1 }, - end: { column: 27, line: 1 }, - }, - }, - id: Identifier { - type: "Identifier", - name: "def", - - range: [21, 24], - loc: { - start: { column: 21, line: 1 }, - end: { column: 24, line: 1 }, - }, - }, - - range: [21, 27], + range: [18, 20], loc: { - start: { column: 21, line: 1 }, - end: { column: 27, line: 1 }, + start: { column: 18, line: 1 }, + end: { column: 20, line: 1 }, }, }, id: Identifier { type: "Identifier", - name: "abd", + name: "def", - range: [17, 20], + range: [14, 17], loc: { - start: { column: 17, line: 1 }, - end: { column: 20, line: 1 }, + start: { column: 14, line: 1 }, + end: { column: 17, line: 1 }, }, }, - range: [7, 27], + range: [14, 20], + loc: { + start: { column: 14, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "abd", + + range: [10, 13], loc: { - start: { column: 7, line: 1 }, - end: { column: 27, line: 1 }, + start: { column: 10, line: 1 }, + end: { column: 13, line: 1 }, }, }, - exportKind: "value", - source: null, - specifiers: [], - range: [0, 27], + range: [0, 20], loc: { start: { column: 0, line: 1 }, - end: { column: 27, line: 1 }, + end: { column: 20, line: 1 }, }, }, ], - sourceType: "module", + sourceType: "script", - range: [0, 28], + range: [0, 21], loc: { start: { column: 0, line: 1 }, end: { column: 0, line: 2 }, diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-export/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-export/snapshots/4-Babel-Tokens.shot index 8eecdd08473d..2af335b020c7 100644 --- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-export/snapshots/4-Babel-Tokens.shot +++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-export/snapshots/4-Babel-Tokens.shot @@ -2,74 +2,64 @@ exports[`AST Fixtures declaration TSModuleDeclaration namespace-nested-once-export Babel - Tokens 1`] = ` [ - Keyword { - type: "Keyword", - value: "export", - - range: [0, 6], - loc: { - start: { column: 0, line: 1 }, - end: { column: 6, line: 1 }, - }, - }, Identifier { type: "Identifier", value: "namespace", - range: [7, 16], + range: [0, 9], loc: { - start: { column: 7, line: 1 }, - end: { column: 16, line: 1 }, + start: { column: 0, line: 1 }, + end: { column: 9, line: 1 }, }, }, Identifier { type: "Identifier", value: "abd", - range: [17, 20], + range: [10, 13], loc: { - start: { column: 17, line: 1 }, - end: { column: 20, line: 1 }, + start: { column: 10, line: 1 }, + end: { column: 13, line: 1 }, }, }, Punctuator { type: "Punctuator", value: ".", - range: [20, 21], + range: [13, 14], loc: { - start: { column: 20, line: 1 }, - end: { column: 21, line: 1 }, + start: { column: 13, line: 1 }, + end: { column: 14, line: 1 }, }, }, Identifier { type: "Identifier", value: "def", - range: [21, 24], + range: [14, 17], loc: { - start: { column: 21, line: 1 }, - end: { column: 24, line: 1 }, + start: { column: 14, line: 1 }, + end: { column: 17, line: 1 }, }, }, Punctuator { type: "Punctuator", value: "{", - range: [25, 26], + range: [18, 19], loc: { - start: { column: 25, line: 1 }, - end: { column: 26, line: 1 }, + start: { column: 18, line: 1 }, + end: { column: 19, line: 1 }, }, }, Punctuator { type: "Punctuator", value: "}", - range: [26, 27], + range: [19, 20], loc: { - start: { column: 26, line: 1 }, - end: { column: 27, line: 1 }, + start: { column: 19, line: 1 }, + end: { column: 20, line: 1 }, }, }, ] diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-export/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-export/snapshots/5-AST-Alignment-AST.shot index 84f061a5ebde..7c6db3a4e911 100644 --- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-export/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-export/snapshots/5-AST-Alignment-AST.shot @@ -8,99 +8,86 @@ exports[`AST Fixtures declaration TSModuleDeclaration namespace-nested-once-expo Program { type: 'Program', body: Array [ - ExportNamedDeclaration { - type: 'ExportNamedDeclaration', - assertions: Array [], - declaration: TSModuleDeclaration { - type: 'TSModuleDeclaration', -- body: TSModuleBlock { -- type: 'TSModuleBlock', -- body: Array [], + TSModuleDeclaration { + type: 'TSModuleDeclaration', +- body: TSModuleBlock { +- type: 'TSModuleBlock', +- body: Array [], - -- range: [25, 27], -- loc: { -- start: { column: 25, line: 1 }, -- end: { column: 27, line: 1 }, -- }, +- range: [18, 20], +- loc: { +- start: { column: 18, line: 1 }, +- end: { column: 20, line: 1 }, - }, -- declare: false, -- global: false, -- id: TSQualifiedName { -- type: 'TSQualifiedName', -- left: Identifier { -- type: 'Identifier', -- decorators: Array [], -- name: 'abd', -- optional: false, -+ body: TSModuleDeclaration { -+ type: 'TSModuleDeclaration', -+ body: TSModuleBlock { -+ type: 'TSModuleBlock', -+ body: Array [], +- }, +- declare: false, +- global: false, +- id: TSQualifiedName { +- type: 'TSQualifiedName', +- left: Identifier { +- type: 'Identifier', +- decorators: Array [], +- name: 'abd', +- optional: false, ++ body: TSModuleDeclaration { ++ type: 'TSModuleDeclaration', ++ body: TSModuleBlock { ++ type: 'TSModuleBlock', ++ body: Array [], -- range: [17, 20], -+ range: [25, 27], - loc: { -- start: { column: 17, line: 1 }, -- end: { column: 20, line: 1 }, -+ start: { column: 25, line: 1 }, -+ end: { column: 27, line: 1 }, - }, - }, -- right: Identifier { -+ id: Identifier { - type: 'Identifier', -- decorators: Array [], - name: 'def', -- optional: false, - - range: [21, 24], - loc: { - start: { column: 21, line: 1 }, - end: { column: 24, line: 1 }, - }, +- range: [10, 13], ++ range: [18, 20], + loc: { +- start: { column: 10, line: 1 }, +- end: { column: 13, line: 1 }, ++ start: { column: 18, line: 1 }, ++ end: { column: 20, line: 1 }, }, - -- range: [17, 24], -+ range: [21, 27], -+ loc: { -+ start: { column: 21, line: 1 }, -+ end: { column: 27, line: 1 }, -+ }, -+ }, + }, +- right: Identifier { + id: Identifier { -+ type: 'Identifier', -+ name: 'abd', -+ -+ range: [17, 20], + type: 'Identifier', +- decorators: Array [], + name: 'def', +- optional: false, + + range: [14, 17], loc: { - start: { column: 17, line: 1 }, -- end: { column: 24, line: 1 }, -+ end: { column: 20, line: 1 }, + start: { column: 14, line: 1 }, + end: { column: 17, line: 1 }, }, }, -- kind: 'namespace', - range: [7, 27], +- range: [10, 17], ++ range: [14, 20], ++ loc: { ++ start: { column: 14, line: 1 }, ++ end: { column: 20, line: 1 }, ++ }, ++ }, ++ id: Identifier { ++ type: 'Identifier', ++ name: 'abd', ++ ++ range: [10, 13], loc: { - start: { column: 7, line: 1 }, - end: { column: 27, line: 1 }, + start: { column: 10, line: 1 }, +- end: { column: 17, line: 1 }, ++ end: { column: 13, line: 1 }, }, }, - exportKind: 'value', - source: null, - specifiers: Array [], +- kind: 'namespace', - range: [0, 27], + range: [0, 20], loc: { start: { column: 0, line: 1 }, - end: { column: 27, line: 1 }, + end: { column: 20, line: 1 }, }, }, ], - sourceType: 'module', + sourceType: 'script', - range: [0, 28], + range: [0, 21], loc: { start: { column: 0, line: 1 }, end: { column: 0, line: 2 }, diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-declare/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-declare/snapshots/1-TSESTree-AST.shot index bc92ba905b7e..6defb2e2c587 100644 --- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-declare/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-declare/snapshots/1-TSESTree-AST.shot @@ -10,13 +10,13 @@ Program { type: "TSModuleBlock", body: [], - range: [30, 32], + range: [22, 24], loc: { - start: { column: 30, line: 1 }, - end: { column: 32, line: 1 }, + start: { column: 22, line: 1 }, + end: { column: 24, line: 1 }, }, }, - declare: true, + declare: false, global: false, id: TSQualifiedName { type: "TSQualifiedName", @@ -28,10 +28,10 @@ Program { name: "abc", optional: false, - range: [18, 21], + range: [10, 13], loc: { - start: { column: 18, line: 1 }, - end: { column: 21, line: 1 }, + start: { column: 10, line: 1 }, + end: { column: 13, line: 1 }, }, }, right: Identifier { @@ -40,17 +40,17 @@ Program { name: "def", optional: false, - range: [22, 25], + range: [14, 17], loc: { - start: { column: 22, line: 1 }, - end: { column: 25, line: 1 }, + start: { column: 14, line: 1 }, + end: { column: 17, line: 1 }, }, }, - range: [18, 25], + range: [10, 17], loc: { - start: { column: 18, line: 1 }, - end: { column: 25, line: 1 }, + start: { column: 10, line: 1 }, + end: { column: 17, line: 1 }, }, }, right: Identifier { @@ -59,31 +59,31 @@ Program { name: "ghi", optional: false, - range: [26, 29], + range: [18, 21], loc: { - start: { column: 26, line: 1 }, - end: { column: 29, line: 1 }, + start: { column: 18, line: 1 }, + end: { column: 21, line: 1 }, }, }, - range: [18, 29], + range: [10, 21], loc: { - start: { column: 18, line: 1 }, - end: { column: 29, line: 1 }, + start: { column: 10, line: 1 }, + end: { column: 21, line: 1 }, }, }, kind: "namespace", - range: [0, 32], + range: [0, 24], loc: { start: { column: 0, line: 1 }, - end: { column: 32, line: 1 }, + end: { column: 24, line: 1 }, }, }, ], sourceType: "script", - range: [0, 33], + range: [0, 25], loc: { start: { column: 0, line: 1 }, end: { column: 0, line: 2 }, diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-declare/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-declare/snapshots/2-TSESTree-Tokens.shot index b9d36f117910..651beb82f3ad 100644 --- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-declare/snapshots/2-TSESTree-Tokens.shot +++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-declare/snapshots/2-TSESTree-Tokens.shot @@ -2,94 +2,84 @@ exports[`AST Fixtures declaration TSModuleDeclaration namespace-nested-twice-declare TSESTree - Tokens 1`] = ` [ - Identifier { - type: "Identifier", - value: "declare", - - range: [0, 7], - loc: { - start: { column: 0, line: 1 }, - end: { column: 7, line: 1 }, - }, - }, Identifier { type: "Identifier", value: "namespace", - range: [8, 17], + range: [0, 9], loc: { - start: { column: 8, line: 1 }, - end: { column: 17, line: 1 }, + start: { column: 0, line: 1 }, + end: { column: 9, line: 1 }, }, }, Identifier { type: "Identifier", value: "abc", - range: [18, 21], + range: [10, 13], loc: { - start: { column: 18, line: 1 }, - end: { column: 21, line: 1 }, + start: { column: 10, line: 1 }, + end: { column: 13, line: 1 }, }, }, Punctuator { type: "Punctuator", value: ".", - range: [21, 22], + range: [13, 14], loc: { - start: { column: 21, line: 1 }, - end: { column: 22, line: 1 }, + start: { column: 13, line: 1 }, + end: { column: 14, line: 1 }, }, }, Identifier { type: "Identifier", value: "def", - range: [22, 25], + range: [14, 17], loc: { - start: { column: 22, line: 1 }, - end: { column: 25, line: 1 }, + start: { column: 14, line: 1 }, + end: { column: 17, line: 1 }, }, }, Punctuator { type: "Punctuator", value: ".", - range: [25, 26], + range: [17, 18], loc: { - start: { column: 25, line: 1 }, - end: { column: 26, line: 1 }, + start: { column: 17, line: 1 }, + end: { column: 18, line: 1 }, }, }, Identifier { type: "Identifier", value: "ghi", - range: [26, 29], + range: [18, 21], loc: { - start: { column: 26, line: 1 }, - end: { column: 29, line: 1 }, + start: { column: 18, line: 1 }, + end: { column: 21, line: 1 }, }, }, Punctuator { type: "Punctuator", value: "{", - range: [30, 31], + range: [22, 23], loc: { - start: { column: 30, line: 1 }, - end: { column: 31, line: 1 }, + start: { column: 22, line: 1 }, + end: { column: 23, line: 1 }, }, }, Punctuator { type: "Punctuator", value: "}", - range: [31, 32], + range: [23, 24], loc: { - start: { column: 31, line: 1 }, - end: { column: 32, line: 1 }, + start: { column: 23, line: 1 }, + end: { column: 24, line: 1 }, }, }, ] diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-declare/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-declare/snapshots/3-Babel-AST.shot index c42e6dea3a33..6fc9b2f250a9 100644 --- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-declare/snapshots/3-Babel-AST.shot +++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-declare/snapshots/3-Babel-AST.shot @@ -14,68 +14,67 @@ Program { type: "TSModuleBlock", body: [], - range: [30, 32], + range: [22, 24], loc: { - start: { column: 30, line: 1 }, - end: { column: 32, line: 1 }, + start: { column: 22, line: 1 }, + end: { column: 24, line: 1 }, }, }, id: Identifier { type: "Identifier", name: "ghi", - range: [26, 29], + range: [18, 21], loc: { - start: { column: 26, line: 1 }, - end: { column: 29, line: 1 }, + start: { column: 18, line: 1 }, + end: { column: 21, line: 1 }, }, }, - range: [26, 32], + range: [18, 24], loc: { - start: { column: 26, line: 1 }, - end: { column: 32, line: 1 }, + start: { column: 18, line: 1 }, + end: { column: 24, line: 1 }, }, }, id: Identifier { type: "Identifier", name: "def", - range: [22, 25], + range: [14, 17], loc: { - start: { column: 22, line: 1 }, - end: { column: 25, line: 1 }, + start: { column: 14, line: 1 }, + end: { column: 17, line: 1 }, }, }, - range: [22, 32], + range: [14, 24], loc: { - start: { column: 22, line: 1 }, - end: { column: 32, line: 1 }, + start: { column: 14, line: 1 }, + end: { column: 24, line: 1 }, }, }, - declare: true, id: Identifier { type: "Identifier", name: "abc", - range: [18, 21], + range: [10, 13], loc: { - start: { column: 18, line: 1 }, - end: { column: 21, line: 1 }, + start: { column: 10, line: 1 }, + end: { column: 13, line: 1 }, }, }, - range: [0, 32], + range: [0, 24], loc: { start: { column: 0, line: 1 }, - end: { column: 32, line: 1 }, + end: { column: 24, line: 1 }, }, }, ], sourceType: "script", - range: [0, 33], + range: [0, 25], loc: { start: { column: 0, line: 1 }, end: { column: 0, line: 2 }, diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-declare/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-declare/snapshots/4-Babel-Tokens.shot index 9c3b20aa1fb6..2e4663c88edb 100644 --- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-declare/snapshots/4-Babel-Tokens.shot +++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-declare/snapshots/4-Babel-Tokens.shot @@ -2,94 +2,84 @@ exports[`AST Fixtures declaration TSModuleDeclaration namespace-nested-twice-declare Babel - Tokens 1`] = ` [ - Identifier { - type: "Identifier", - value: "declare", - - range: [0, 7], - loc: { - start: { column: 0, line: 1 }, - end: { column: 7, line: 1 }, - }, - }, Identifier { type: "Identifier", value: "namespace", - range: [8, 17], + range: [0, 9], loc: { - start: { column: 8, line: 1 }, - end: { column: 17, line: 1 }, + start: { column: 0, line: 1 }, + end: { column: 9, line: 1 }, }, }, Identifier { type: "Identifier", value: "abc", - range: [18, 21], + range: [10, 13], loc: { - start: { column: 18, line: 1 }, - end: { column: 21, line: 1 }, + start: { column: 10, line: 1 }, + end: { column: 13, line: 1 }, }, }, Punctuator { type: "Punctuator", value: ".", - range: [21, 22], + range: [13, 14], loc: { - start: { column: 21, line: 1 }, - end: { column: 22, line: 1 }, + start: { column: 13, line: 1 }, + end: { column: 14, line: 1 }, }, }, Identifier { type: "Identifier", value: "def", - range: [22, 25], + range: [14, 17], loc: { - start: { column: 22, line: 1 }, - end: { column: 25, line: 1 }, + start: { column: 14, line: 1 }, + end: { column: 17, line: 1 }, }, }, Punctuator { type: "Punctuator", value: ".", - range: [25, 26], + range: [17, 18], loc: { - start: { column: 25, line: 1 }, - end: { column: 26, line: 1 }, + start: { column: 17, line: 1 }, + end: { column: 18, line: 1 }, }, }, Identifier { type: "Identifier", value: "ghi", - range: [26, 29], + range: [18, 21], loc: { - start: { column: 26, line: 1 }, - end: { column: 29, line: 1 }, + start: { column: 18, line: 1 }, + end: { column: 21, line: 1 }, }, }, Punctuator { type: "Punctuator", value: "{", - range: [30, 31], + range: [22, 23], loc: { - start: { column: 30, line: 1 }, - end: { column: 31, line: 1 }, + start: { column: 22, line: 1 }, + end: { column: 23, line: 1 }, }, }, Punctuator { type: "Punctuator", value: "}", - range: [31, 32], + range: [23, 24], loc: { - start: { column: 31, line: 1 }, - end: { column: 32, line: 1 }, + start: { column: 23, line: 1 }, + end: { column: 24, line: 1 }, }, }, ] diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-declare/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-declare/snapshots/5-AST-Alignment-AST.shot index 7a97e14281ea..86531c5d9159 100644 --- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-declare/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-declare/snapshots/5-AST-Alignment-AST.shot @@ -13,21 +13,14 @@ exports[`AST Fixtures declaration TSModuleDeclaration namespace-nested-twice-dec - body: TSModuleBlock { - type: 'TSModuleBlock', - body: Array [], -+ body: TSModuleDeclaration { -+ type: 'TSModuleDeclaration', -+ body: TSModuleDeclaration { -+ type: 'TSModuleDeclaration', -+ body: TSModuleBlock { -+ type: 'TSModuleBlock', -+ body: Array [], - -- range: [30, 32], +- +- range: [22, 24], - loc: { -- start: { column: 30, line: 1 }, -- end: { column: 32, line: 1 }, +- start: { column: 22, line: 1 }, +- end: { column: 24, line: 1 }, - }, - }, -- declare: true, +- declare: false, - global: false, - id: TSQualifiedName { - type: 'TSQualifiedName', @@ -38,14 +31,21 @@ exports[`AST Fixtures declaration TSModuleDeclaration namespace-nested-twice-dec - decorators: Array [], - name: 'abc', - optional: false, -- -- range: [18, 21], -+ range: [30, 32], ++ body: TSModuleDeclaration { ++ type: 'TSModuleDeclaration', ++ body: TSModuleDeclaration { ++ type: 'TSModuleDeclaration', ++ body: TSModuleBlock { ++ type: 'TSModuleBlock', ++ body: Array [], + +- range: [10, 13], ++ range: [22, 24], loc: { -- start: { column: 18, line: 1 }, -- end: { column: 21, line: 1 }, -+ start: { column: 30, line: 1 }, -+ end: { column: 32, line: 1 }, +- start: { column: 10, line: 1 }, +- end: { column: 13, line: 1 }, ++ start: { column: 22, line: 1 }, ++ end: { column: 24, line: 1 }, }, }, - right: Identifier { @@ -56,23 +56,23 @@ exports[`AST Fixtures declaration TSModuleDeclaration namespace-nested-twice-dec - optional: false, + name: 'ghi', -- range: [22, 25], -+ range: [26, 29], +- range: [14, 17], ++ range: [18, 21], loc: { -- start: { column: 22, line: 1 }, -- end: { column: 25, line: 1 }, -+ start: { column: 26, line: 1 }, -+ end: { column: 29, line: 1 }, +- start: { column: 14, line: 1 }, +- end: { column: 17, line: 1 }, ++ start: { column: 18, line: 1 }, ++ end: { column: 21, line: 1 }, }, }, -- range: [18, 25], -+ range: [26, 32], +- range: [10, 17], ++ range: [18, 24], loc: { -- start: { column: 18, line: 1 }, -- end: { column: 25, line: 1 }, -+ start: { column: 26, line: 1 }, -+ end: { column: 32, line: 1 }, +- start: { column: 10, line: 1 }, +- end: { column: 17, line: 1 }, ++ start: { column: 18, line: 1 }, ++ end: { column: 24, line: 1 }, }, }, - right: Identifier { @@ -83,47 +83,46 @@ exports[`AST Fixtures declaration TSModuleDeclaration namespace-nested-twice-dec - optional: false, + name: 'def', -- range: [26, 29], -+ range: [22, 25], +- range: [18, 21], ++ range: [14, 17], loc: { -- start: { column: 26, line: 1 }, -- end: { column: 29, line: 1 }, -+ start: { column: 22, line: 1 }, -+ end: { column: 25, line: 1 }, +- start: { column: 18, line: 1 }, +- end: { column: 21, line: 1 }, ++ start: { column: 14, line: 1 }, ++ end: { column: 17, line: 1 }, }, }, -- range: [18, 29], -+ range: [22, 32], +- range: [10, 21], ++ range: [14, 24], + loc: { -+ start: { column: 22, line: 1 }, -+ end: { column: 32, line: 1 }, ++ start: { column: 14, line: 1 }, ++ end: { column: 24, line: 1 }, + }, + }, -+ declare: true, + id: Identifier { + type: 'Identifier', + name: 'abc', + -+ range: [18, 21], ++ range: [10, 13], loc: { - start: { column: 18, line: 1 }, -- end: { column: 29, line: 1 }, -+ end: { column: 21, line: 1 }, + start: { column: 10, line: 1 }, +- end: { column: 21, line: 1 }, ++ end: { column: 13, line: 1 }, }, }, - kind: 'namespace', - range: [0, 32], + range: [0, 24], loc: { start: { column: 0, line: 1 }, - end: { column: 32, line: 1 }, + end: { column: 24, line: 1 }, }, }, ], sourceType: 'script', - range: [0, 33], + range: [0, 25], loc: { start: { column: 0, line: 1 }, end: { column: 0, line: 2 }, diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-export-declare/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-export-declare/snapshots/1-TSESTree-AST.shot index d725dc2ec655..eab4e1bf61df 100644 --- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-export-declare/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-export-declare/snapshots/1-TSESTree-AST.shot @@ -4,99 +4,86 @@ exports[`AST Fixtures declaration TSModuleDeclaration namespace-nested-twice-exp Program { type: "Program", body: [ - ExportNamedDeclaration { - type: "ExportNamedDeclaration", - assertions: [], - declaration: TSModuleDeclaration { - type: "TSModuleDeclaration", - body: TSModuleBlock { - type: "TSModuleBlock", - body: [], + TSModuleDeclaration { + type: "TSModuleDeclaration", + body: TSModuleBlock { + type: "TSModuleBlock", + body: [], - range: [37, 39], - loc: { - start: { column: 37, line: 1 }, - end: { column: 39, line: 1 }, - }, + range: [22, 24], + loc: { + start: { column: 22, line: 1 }, + end: { column: 24, line: 1 }, }, - declare: true, - global: false, - id: TSQualifiedName { + }, + declare: false, + global: false, + id: TSQualifiedName { + type: "TSQualifiedName", + left: TSQualifiedName { type: "TSQualifiedName", - left: TSQualifiedName { - type: "TSQualifiedName", - left: Identifier { - type: "Identifier", - decorators: [], - name: "abc", - optional: false, - - range: [25, 28], - loc: { - start: { column: 25, line: 1 }, - end: { column: 28, line: 1 }, - }, - }, - right: Identifier { - type: "Identifier", - decorators: [], - name: "def", - optional: false, - - range: [29, 32], - loc: { - start: { column: 29, line: 1 }, - end: { column: 32, line: 1 }, - }, - }, + left: Identifier { + type: "Identifier", + decorators: [], + name: "abc", + optional: false, - range: [25, 32], + range: [10, 13], loc: { - start: { column: 25, line: 1 }, - end: { column: 32, line: 1 }, + start: { column: 10, line: 1 }, + end: { column: 13, line: 1 }, }, }, right: Identifier { type: "Identifier", decorators: [], - name: "ghi", + name: "def", optional: false, - range: [33, 36], + range: [14, 17], loc: { - start: { column: 33, line: 1 }, - end: { column: 36, line: 1 }, + start: { column: 14, line: 1 }, + end: { column: 17, line: 1 }, }, }, - range: [25, 36], + range: [10, 17], + loc: { + start: { column: 10, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + right: Identifier { + type: "Identifier", + decorators: [], + name: "ghi", + optional: false, + + range: [18, 21], loc: { - start: { column: 25, line: 1 }, - end: { column: 36, line: 1 }, + start: { column: 18, line: 1 }, + end: { column: 21, line: 1 }, }, }, - kind: "namespace", - range: [7, 39], + range: [10, 21], loc: { - start: { column: 7, line: 1 }, - end: { column: 39, line: 1 }, + start: { column: 10, line: 1 }, + end: { column: 21, line: 1 }, }, }, - exportKind: "type", - source: null, - specifiers: [], + kind: "namespace", - range: [0, 39], + range: [0, 24], loc: { start: { column: 0, line: 1 }, - end: { column: 39, line: 1 }, + end: { column: 24, line: 1 }, }, }, ], - sourceType: "module", + sourceType: "script", - range: [0, 40], + range: [0, 25], loc: { start: { column: 0, line: 1 }, end: { column: 0, line: 2 }, diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-export-declare/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-export-declare/snapshots/2-TSESTree-Tokens.shot index cce80b8f5e4e..c041e84c88e3 100644 --- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-export-declare/snapshots/2-TSESTree-Tokens.shot +++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-export-declare/snapshots/2-TSESTree-Tokens.shot @@ -2,104 +2,84 @@ exports[`AST Fixtures declaration TSModuleDeclaration namespace-nested-twice-export-declare TSESTree - Tokens 1`] = ` [ - Keyword { - type: "Keyword", - value: "export", - - range: [0, 6], - loc: { - start: { column: 0, line: 1 }, - end: { column: 6, line: 1 }, - }, - }, - Identifier { - type: "Identifier", - value: "declare", - - range: [7, 14], - loc: { - start: { column: 7, line: 1 }, - end: { column: 14, line: 1 }, - }, - }, Identifier { type: "Identifier", value: "namespace", - range: [15, 24], + range: [0, 9], loc: { - start: { column: 15, line: 1 }, - end: { column: 24, line: 1 }, + start: { column: 0, line: 1 }, + end: { column: 9, line: 1 }, }, }, Identifier { type: "Identifier", value: "abc", - range: [25, 28], + range: [10, 13], loc: { - start: { column: 25, line: 1 }, - end: { column: 28, line: 1 }, + start: { column: 10, line: 1 }, + end: { column: 13, line: 1 }, }, }, Punctuator { type: "Punctuator", value: ".", - range: [28, 29], + range: [13, 14], loc: { - start: { column: 28, line: 1 }, - end: { column: 29, line: 1 }, + start: { column: 13, line: 1 }, + end: { column: 14, line: 1 }, }, }, Identifier { type: "Identifier", value: "def", - range: [29, 32], + range: [14, 17], loc: { - start: { column: 29, line: 1 }, - end: { column: 32, line: 1 }, + start: { column: 14, line: 1 }, + end: { column: 17, line: 1 }, }, }, Punctuator { type: "Punctuator", value: ".", - range: [32, 33], + range: [17, 18], loc: { - start: { column: 32, line: 1 }, - end: { column: 33, line: 1 }, + start: { column: 17, line: 1 }, + end: { column: 18, line: 1 }, }, }, Identifier { type: "Identifier", value: "ghi", - range: [33, 36], + range: [18, 21], loc: { - start: { column: 33, line: 1 }, - end: { column: 36, line: 1 }, + start: { column: 18, line: 1 }, + end: { column: 21, line: 1 }, }, }, Punctuator { type: "Punctuator", value: "{", - range: [37, 38], + range: [22, 23], loc: { - start: { column: 37, line: 1 }, - end: { column: 38, line: 1 }, + start: { column: 22, line: 1 }, + end: { column: 23, line: 1 }, }, }, Punctuator { type: "Punctuator", value: "}", - range: [38, 39], + range: [23, 24], loc: { - start: { column: 38, line: 1 }, - end: { column: 39, line: 1 }, + start: { column: 23, line: 1 }, + end: { column: 24, line: 1 }, }, }, ] diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-export-declare/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-export-declare/snapshots/3-Babel-AST.shot index 22193550e2ea..14c350bd62d6 100644 --- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-export-declare/snapshots/3-Babel-AST.shot +++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-export-declare/snapshots/3-Babel-AST.shot @@ -4,91 +4,77 @@ exports[`AST Fixtures declaration TSModuleDeclaration namespace-nested-twice-exp Program { type: "Program", body: [ - ExportNamedDeclaration { - type: "ExportNamedDeclaration", - assertions: [], - declaration: TSModuleDeclaration { + TSModuleDeclaration { + type: "TSModuleDeclaration", + body: TSModuleDeclaration { type: "TSModuleDeclaration", body: TSModuleDeclaration { type: "TSModuleDeclaration", - body: TSModuleDeclaration { - type: "TSModuleDeclaration", - body: TSModuleBlock { - type: "TSModuleBlock", - body: [], + body: TSModuleBlock { + type: "TSModuleBlock", + body: [], - range: [37, 39], - loc: { - start: { column: 37, line: 1 }, - end: { column: 39, line: 1 }, - }, - }, - id: Identifier { - type: "Identifier", - name: "ghi", - - range: [33, 36], - loc: { - start: { column: 33, line: 1 }, - end: { column: 36, line: 1 }, - }, - }, - - range: [33, 39], + range: [22, 24], loc: { - start: { column: 33, line: 1 }, - end: { column: 39, line: 1 }, + start: { column: 22, line: 1 }, + end: { column: 24, line: 1 }, }, }, id: Identifier { type: "Identifier", - name: "def", + name: "ghi", - range: [29, 32], + range: [18, 21], loc: { - start: { column: 29, line: 1 }, - end: { column: 32, line: 1 }, + start: { column: 18, line: 1 }, + end: { column: 21, line: 1 }, }, }, - range: [29, 39], + range: [18, 24], loc: { - start: { column: 29, line: 1 }, - end: { column: 39, line: 1 }, + start: { column: 18, line: 1 }, + end: { column: 24, line: 1 }, }, }, - declare: true, id: Identifier { type: "Identifier", - name: "abc", + name: "def", - range: [25, 28], + range: [14, 17], loc: { - start: { column: 25, line: 1 }, - end: { column: 28, line: 1 }, + start: { column: 14, line: 1 }, + end: { column: 17, line: 1 }, }, }, - range: [7, 39], + range: [14, 24], + loc: { + start: { column: 14, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "abc", + + range: [10, 13], loc: { - start: { column: 7, line: 1 }, - end: { column: 39, line: 1 }, + start: { column: 10, line: 1 }, + end: { column: 13, line: 1 }, }, }, - exportKind: "type", - source: null, - specifiers: [], - range: [0, 39], + range: [0, 24], loc: { start: { column: 0, line: 1 }, - end: { column: 39, line: 1 }, + end: { column: 24, line: 1 }, }, }, ], sourceType: "script", - range: [0, 40], + range: [0, 25], loc: { start: { column: 0, line: 1 }, end: { column: 0, line: 2 }, diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-export-declare/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-export-declare/snapshots/4-Babel-Tokens.shot index 94038375b350..5b816bdbfbf8 100644 --- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-export-declare/snapshots/4-Babel-Tokens.shot +++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-export-declare/snapshots/4-Babel-Tokens.shot @@ -2,104 +2,84 @@ exports[`AST Fixtures declaration TSModuleDeclaration namespace-nested-twice-export-declare Babel - Tokens 1`] = ` [ - Keyword { - type: "Keyword", - value: "export", - - range: [0, 6], - loc: { - start: { column: 0, line: 1 }, - end: { column: 6, line: 1 }, - }, - }, - Identifier { - type: "Identifier", - value: "declare", - - range: [7, 14], - loc: { - start: { column: 7, line: 1 }, - end: { column: 14, line: 1 }, - }, - }, Identifier { type: "Identifier", value: "namespace", - range: [15, 24], + range: [0, 9], loc: { - start: { column: 15, line: 1 }, - end: { column: 24, line: 1 }, + start: { column: 0, line: 1 }, + end: { column: 9, line: 1 }, }, }, Identifier { type: "Identifier", value: "abc", - range: [25, 28], + range: [10, 13], loc: { - start: { column: 25, line: 1 }, - end: { column: 28, line: 1 }, + start: { column: 10, line: 1 }, + end: { column: 13, line: 1 }, }, }, Punctuator { type: "Punctuator", value: ".", - range: [28, 29], + range: [13, 14], loc: { - start: { column: 28, line: 1 }, - end: { column: 29, line: 1 }, + start: { column: 13, line: 1 }, + end: { column: 14, line: 1 }, }, }, Identifier { type: "Identifier", value: "def", - range: [29, 32], + range: [14, 17], loc: { - start: { column: 29, line: 1 }, - end: { column: 32, line: 1 }, + start: { column: 14, line: 1 }, + end: { column: 17, line: 1 }, }, }, Punctuator { type: "Punctuator", value: ".", - range: [32, 33], + range: [17, 18], loc: { - start: { column: 32, line: 1 }, - end: { column: 33, line: 1 }, + start: { column: 17, line: 1 }, + end: { column: 18, line: 1 }, }, }, Identifier { type: "Identifier", value: "ghi", - range: [33, 36], + range: [18, 21], loc: { - start: { column: 33, line: 1 }, - end: { column: 36, line: 1 }, + start: { column: 18, line: 1 }, + end: { column: 21, line: 1 }, }, }, Punctuator { type: "Punctuator", value: "{", - range: [37, 38], + range: [22, 23], loc: { - start: { column: 37, line: 1 }, - end: { column: 38, line: 1 }, + start: { column: 22, line: 1 }, + end: { column: 23, line: 1 }, }, }, Punctuator { type: "Punctuator", value: "}", - range: [38, 39], + range: [23, 24], loc: { - start: { column: 38, line: 1 }, - end: { column: 39, line: 1 }, + start: { column: 23, line: 1 }, + end: { column: 24, line: 1 }, }, }, ] diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-export-declare/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-export-declare/snapshots/5-AST-Alignment-AST.shot index dc9a53f795df..a19aa5c21f51 100644 --- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-export-declare/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-export-declare/snapshots/5-AST-Alignment-AST.shot @@ -8,136 +8,121 @@ exports[`AST Fixtures declaration TSModuleDeclaration namespace-nested-twice-exp Program { type: 'Program', body: Array [ - ExportNamedDeclaration { - type: 'ExportNamedDeclaration', - assertions: Array [], - declaration: TSModuleDeclaration { - type: 'TSModuleDeclaration', -- body: TSModuleBlock { -- type: 'TSModuleBlock', -- body: Array [], + TSModuleDeclaration { + type: 'TSModuleDeclaration', +- body: TSModuleBlock { +- type: 'TSModuleBlock', +- body: Array [], - -- range: [37, 39], -- loc: { -- start: { column: 37, line: 1 }, -- end: { column: 39, line: 1 }, -- }, +- range: [22, 24], +- loc: { +- start: { column: 22, line: 1 }, +- end: { column: 24, line: 1 }, - }, -- declare: true, -- global: false, -- id: TSQualifiedName { +- }, +- declare: false, +- global: false, +- id: TSQualifiedName { +- type: 'TSQualifiedName', +- left: TSQualifiedName { - type: 'TSQualifiedName', -- left: TSQualifiedName { -- type: 'TSQualifiedName', -- left: Identifier { -- type: 'Identifier', -- decorators: Array [], -- name: 'abc', -- optional: false, +- left: Identifier { +- type: 'Identifier', +- decorators: Array [], +- name: 'abc', +- optional: false, ++ body: TSModuleDeclaration { ++ type: 'TSModuleDeclaration', + body: TSModuleDeclaration { + type: 'TSModuleDeclaration', -+ body: TSModuleDeclaration { -+ type: 'TSModuleDeclaration', -+ body: TSModuleBlock { -+ type: 'TSModuleBlock', -+ body: Array [], - -- range: [25, 28], -+ range: [37, 39], - loc: { -- start: { column: 25, line: 1 }, -- end: { column: 28, line: 1 }, -+ start: { column: 37, line: 1 }, -+ end: { column: 39, line: 1 }, - }, - }, -- right: Identifier { -+ id: Identifier { - type: 'Identifier', -- decorators: Array [], -- name: 'def', -- optional: false, -+ name: 'ghi', ++ body: TSModuleBlock { ++ type: 'TSModuleBlock', ++ body: Array [], -- range: [29, 32], -+ range: [33, 36], - loc: { -- start: { column: 29, line: 1 }, -- end: { column: 32, line: 1 }, -+ start: { column: 33, line: 1 }, -+ end: { column: 36, line: 1 }, - }, - }, - -- range: [25, 32], -+ range: [33, 39], +- range: [10, 13], ++ range: [22, 24], loc: { -- start: { column: 25, line: 1 }, -- end: { column: 32, line: 1 }, -+ start: { column: 33, line: 1 }, -+ end: { column: 39, line: 1 }, +- start: { column: 10, line: 1 }, +- end: { column: 13, line: 1 }, ++ start: { column: 22, line: 1 }, ++ end: { column: 24, line: 1 }, }, }, - right: Identifier { + id: Identifier { type: 'Identifier', - decorators: Array [], -- name: 'ghi', +- name: 'def', - optional: false, -+ name: 'def', ++ name: 'ghi', -- range: [33, 36], -+ range: [29, 32], +- range: [14, 17], ++ range: [18, 21], loc: { -- start: { column: 33, line: 1 }, -- end: { column: 36, line: 1 }, -+ start: { column: 29, line: 1 }, -+ end: { column: 32, line: 1 }, +- start: { column: 14, line: 1 }, +- end: { column: 17, line: 1 }, ++ start: { column: 18, line: 1 }, ++ end: { column: 21, line: 1 }, }, }, -- range: [25, 36], -+ range: [29, 39], -+ loc: { -+ start: { column: 29, line: 1 }, -+ end: { column: 39, line: 1 }, -+ }, -+ }, -+ declare: true, +- range: [10, 17], ++ range: [18, 24], + loc: { +- start: { column: 10, line: 1 }, +- end: { column: 17, line: 1 }, ++ start: { column: 18, line: 1 }, ++ end: { column: 24, line: 1 }, + }, + }, +- right: Identifier { + id: Identifier { -+ type: 'Identifier', -+ name: 'abc', -+ -+ range: [25, 28], + type: 'Identifier', +- decorators: Array [], +- name: 'ghi', +- optional: false, ++ name: 'def', + +- range: [18, 21], ++ range: [14, 17], loc: { - start: { column: 25, line: 1 }, -- end: { column: 36, line: 1 }, -+ end: { column: 28, line: 1 }, +- start: { column: 18, line: 1 }, +- end: { column: 21, line: 1 }, ++ start: { column: 14, line: 1 }, ++ end: { column: 17, line: 1 }, }, }, -- kind: 'namespace', - range: [7, 39], +- range: [10, 21], ++ range: [14, 24], ++ loc: { ++ start: { column: 14, line: 1 }, ++ end: { column: 24, line: 1 }, ++ }, ++ }, ++ id: Identifier { ++ type: 'Identifier', ++ name: 'abc', ++ ++ range: [10, 13], loc: { - start: { column: 7, line: 1 }, - end: { column: 39, line: 1 }, + start: { column: 10, line: 1 }, +- end: { column: 21, line: 1 }, ++ end: { column: 13, line: 1 }, }, }, - exportKind: 'type', - source: null, - specifiers: Array [], +- kind: 'namespace', - range: [0, 39], + range: [0, 24], loc: { start: { column: 0, line: 1 }, - end: { column: 39, line: 1 }, + end: { column: 24, line: 1 }, }, }, ], -- sourceType: 'module', -+ sourceType: 'script', + sourceType: 'script', - range: [0, 40], + range: [0, 25], loc: { start: { column: 0, line: 1 }, end: { column: 0, line: 2 }, diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-export/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-export/snapshots/1-TSESTree-AST.shot index 2446e9b95087..da6c6e19177b 100644 --- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-export/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-export/snapshots/1-TSESTree-AST.shot @@ -4,99 +4,86 @@ exports[`AST Fixtures declaration TSModuleDeclaration namespace-nested-twice-exp Program { type: "Program", body: [ - ExportNamedDeclaration { - type: "ExportNamedDeclaration", - assertions: [], - declaration: TSModuleDeclaration { - type: "TSModuleDeclaration", - body: TSModuleBlock { - type: "TSModuleBlock", - body: [], + TSModuleDeclaration { + type: "TSModuleDeclaration", + body: TSModuleBlock { + type: "TSModuleBlock", + body: [], - range: [29, 31], - loc: { - start: { column: 29, line: 1 }, - end: { column: 31, line: 1 }, - }, + range: [22, 24], + loc: { + start: { column: 22, line: 1 }, + end: { column: 24, line: 1 }, }, - declare: false, - global: false, - id: TSQualifiedName { + }, + declare: false, + global: false, + id: TSQualifiedName { + type: "TSQualifiedName", + left: TSQualifiedName { type: "TSQualifiedName", - left: TSQualifiedName { - type: "TSQualifiedName", - left: Identifier { - type: "Identifier", - decorators: [], - name: "abc", - optional: false, - - range: [17, 20], - loc: { - start: { column: 17, line: 1 }, - end: { column: 20, line: 1 }, - }, - }, - right: Identifier { - type: "Identifier", - decorators: [], - name: "def", - optional: false, - - range: [21, 24], - loc: { - start: { column: 21, line: 1 }, - end: { column: 24, line: 1 }, - }, - }, + left: Identifier { + type: "Identifier", + decorators: [], + name: "abc", + optional: false, - range: [17, 24], + range: [10, 13], loc: { - start: { column: 17, line: 1 }, - end: { column: 24, line: 1 }, + start: { column: 10, line: 1 }, + end: { column: 13, line: 1 }, }, }, right: Identifier { type: "Identifier", decorators: [], - name: "ghi", + name: "def", optional: false, - range: [25, 28], + range: [14, 17], loc: { - start: { column: 25, line: 1 }, - end: { column: 28, line: 1 }, + start: { column: 14, line: 1 }, + end: { column: 17, line: 1 }, }, }, - range: [17, 28], + range: [10, 17], + loc: { + start: { column: 10, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + right: Identifier { + type: "Identifier", + decorators: [], + name: "ghi", + optional: false, + + range: [18, 21], loc: { - start: { column: 17, line: 1 }, - end: { column: 28, line: 1 }, + start: { column: 18, line: 1 }, + end: { column: 21, line: 1 }, }, }, - kind: "namespace", - range: [7, 31], + range: [10, 21], loc: { - start: { column: 7, line: 1 }, - end: { column: 31, line: 1 }, + start: { column: 10, line: 1 }, + end: { column: 21, line: 1 }, }, }, - exportKind: "value", - source: null, - specifiers: [], + kind: "namespace", - range: [0, 31], + range: [0, 24], loc: { start: { column: 0, line: 1 }, - end: { column: 31, line: 1 }, + end: { column: 24, line: 1 }, }, }, ], - sourceType: "module", + sourceType: "script", - range: [0, 32], + range: [0, 25], loc: { start: { column: 0, line: 1 }, end: { column: 0, line: 2 }, diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-export/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-export/snapshots/2-TSESTree-Tokens.shot index faf98fe4cdc4..15eb0cd8944e 100644 --- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-export/snapshots/2-TSESTree-Tokens.shot +++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-export/snapshots/2-TSESTree-Tokens.shot @@ -2,94 +2,84 @@ exports[`AST Fixtures declaration TSModuleDeclaration namespace-nested-twice-export TSESTree - Tokens 1`] = ` [ - Keyword { - type: "Keyword", - value: "export", - - range: [0, 6], - loc: { - start: { column: 0, line: 1 }, - end: { column: 6, line: 1 }, - }, - }, Identifier { type: "Identifier", value: "namespace", - range: [7, 16], + range: [0, 9], loc: { - start: { column: 7, line: 1 }, - end: { column: 16, line: 1 }, + start: { column: 0, line: 1 }, + end: { column: 9, line: 1 }, }, }, Identifier { type: "Identifier", value: "abc", - range: [17, 20], + range: [10, 13], loc: { - start: { column: 17, line: 1 }, - end: { column: 20, line: 1 }, + start: { column: 10, line: 1 }, + end: { column: 13, line: 1 }, }, }, Punctuator { type: "Punctuator", value: ".", - range: [20, 21], + range: [13, 14], loc: { - start: { column: 20, line: 1 }, - end: { column: 21, line: 1 }, + start: { column: 13, line: 1 }, + end: { column: 14, line: 1 }, }, }, Identifier { type: "Identifier", value: "def", - range: [21, 24], + range: [14, 17], loc: { - start: { column: 21, line: 1 }, - end: { column: 24, line: 1 }, + start: { column: 14, line: 1 }, + end: { column: 17, line: 1 }, }, }, Punctuator { type: "Punctuator", value: ".", - range: [24, 25], + range: [17, 18], loc: { - start: { column: 24, line: 1 }, - end: { column: 25, line: 1 }, + start: { column: 17, line: 1 }, + end: { column: 18, line: 1 }, }, }, Identifier { type: "Identifier", value: "ghi", - range: [25, 28], + range: [18, 21], loc: { - start: { column: 25, line: 1 }, - end: { column: 28, line: 1 }, + start: { column: 18, line: 1 }, + end: { column: 21, line: 1 }, }, }, Punctuator { type: "Punctuator", value: "{", - range: [29, 30], + range: [22, 23], loc: { - start: { column: 29, line: 1 }, - end: { column: 30, line: 1 }, + start: { column: 22, line: 1 }, + end: { column: 23, line: 1 }, }, }, Punctuator { type: "Punctuator", value: "}", - range: [30, 31], + range: [23, 24], loc: { - start: { column: 30, line: 1 }, - end: { column: 31, line: 1 }, + start: { column: 23, line: 1 }, + end: { column: 24, line: 1 }, }, }, ] diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-export/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-export/snapshots/3-Babel-AST.shot index 288e992909fb..d35201b965d3 100644 --- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-export/snapshots/3-Babel-AST.shot +++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-export/snapshots/3-Babel-AST.shot @@ -4,90 +4,77 @@ exports[`AST Fixtures declaration TSModuleDeclaration namespace-nested-twice-exp Program { type: "Program", body: [ - ExportNamedDeclaration { - type: "ExportNamedDeclaration", - assertions: [], - declaration: TSModuleDeclaration { + TSModuleDeclaration { + type: "TSModuleDeclaration", + body: TSModuleDeclaration { type: "TSModuleDeclaration", body: TSModuleDeclaration { type: "TSModuleDeclaration", - body: TSModuleDeclaration { - type: "TSModuleDeclaration", - body: TSModuleBlock { - type: "TSModuleBlock", - body: [], + body: TSModuleBlock { + type: "TSModuleBlock", + body: [], - range: [29, 31], - loc: { - start: { column: 29, line: 1 }, - end: { column: 31, line: 1 }, - }, - }, - id: Identifier { - type: "Identifier", - name: "ghi", - - range: [25, 28], - loc: { - start: { column: 25, line: 1 }, - end: { column: 28, line: 1 }, - }, - }, - - range: [25, 31], + range: [22, 24], loc: { - start: { column: 25, line: 1 }, - end: { column: 31, line: 1 }, + start: { column: 22, line: 1 }, + end: { column: 24, line: 1 }, }, }, id: Identifier { type: "Identifier", - name: "def", + name: "ghi", - range: [21, 24], + range: [18, 21], loc: { - start: { column: 21, line: 1 }, - end: { column: 24, line: 1 }, + start: { column: 18, line: 1 }, + end: { column: 21, line: 1 }, }, }, - range: [21, 31], + range: [18, 24], loc: { - start: { column: 21, line: 1 }, - end: { column: 31, line: 1 }, + start: { column: 18, line: 1 }, + end: { column: 24, line: 1 }, }, }, id: Identifier { type: "Identifier", - name: "abc", + name: "def", - range: [17, 20], + range: [14, 17], loc: { - start: { column: 17, line: 1 }, - end: { column: 20, line: 1 }, + start: { column: 14, line: 1 }, + end: { column: 17, line: 1 }, }, }, - range: [7, 31], + range: [14, 24], + loc: { + start: { column: 14, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "abc", + + range: [10, 13], loc: { - start: { column: 7, line: 1 }, - end: { column: 31, line: 1 }, + start: { column: 10, line: 1 }, + end: { column: 13, line: 1 }, }, }, - exportKind: "value", - source: null, - specifiers: [], - range: [0, 31], + range: [0, 24], loc: { start: { column: 0, line: 1 }, - end: { column: 31, line: 1 }, + end: { column: 24, line: 1 }, }, }, ], - sourceType: "module", + sourceType: "script", - range: [0, 32], + range: [0, 25], loc: { start: { column: 0, line: 1 }, end: { column: 0, line: 2 }, diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-export/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-export/snapshots/4-Babel-Tokens.shot index 718198bf40dd..bb39fc8f2ec5 100644 --- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-export/snapshots/4-Babel-Tokens.shot +++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-export/snapshots/4-Babel-Tokens.shot @@ -2,94 +2,84 @@ exports[`AST Fixtures declaration TSModuleDeclaration namespace-nested-twice-export Babel - Tokens 1`] = ` [ - Keyword { - type: "Keyword", - value: "export", - - range: [0, 6], - loc: { - start: { column: 0, line: 1 }, - end: { column: 6, line: 1 }, - }, - }, Identifier { type: "Identifier", value: "namespace", - range: [7, 16], + range: [0, 9], loc: { - start: { column: 7, line: 1 }, - end: { column: 16, line: 1 }, + start: { column: 0, line: 1 }, + end: { column: 9, line: 1 }, }, }, Identifier { type: "Identifier", value: "abc", - range: [17, 20], + range: [10, 13], loc: { - start: { column: 17, line: 1 }, - end: { column: 20, line: 1 }, + start: { column: 10, line: 1 }, + end: { column: 13, line: 1 }, }, }, Punctuator { type: "Punctuator", value: ".", - range: [20, 21], + range: [13, 14], loc: { - start: { column: 20, line: 1 }, - end: { column: 21, line: 1 }, + start: { column: 13, line: 1 }, + end: { column: 14, line: 1 }, }, }, Identifier { type: "Identifier", value: "def", - range: [21, 24], + range: [14, 17], loc: { - start: { column: 21, line: 1 }, - end: { column: 24, line: 1 }, + start: { column: 14, line: 1 }, + end: { column: 17, line: 1 }, }, }, Punctuator { type: "Punctuator", value: ".", - range: [24, 25], + range: [17, 18], loc: { - start: { column: 24, line: 1 }, - end: { column: 25, line: 1 }, + start: { column: 17, line: 1 }, + end: { column: 18, line: 1 }, }, }, Identifier { type: "Identifier", value: "ghi", - range: [25, 28], + range: [18, 21], loc: { - start: { column: 25, line: 1 }, - end: { column: 28, line: 1 }, + start: { column: 18, line: 1 }, + end: { column: 21, line: 1 }, }, }, Punctuator { type: "Punctuator", value: "{", - range: [29, 30], + range: [22, 23], loc: { - start: { column: 29, line: 1 }, - end: { column: 30, line: 1 }, + start: { column: 22, line: 1 }, + end: { column: 23, line: 1 }, }, }, Punctuator { type: "Punctuator", value: "}", - range: [30, 31], + range: [23, 24], loc: { - start: { column: 30, line: 1 }, - end: { column: 31, line: 1 }, + start: { column: 23, line: 1 }, + end: { column: 24, line: 1 }, }, }, ] diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-export/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-export/snapshots/5-AST-Alignment-AST.shot index 26c9b1396134..529296da870b 100644 --- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-export/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-export/snapshots/5-AST-Alignment-AST.shot @@ -8,134 +8,121 @@ exports[`AST Fixtures declaration TSModuleDeclaration namespace-nested-twice-exp Program { type: 'Program', body: Array [ - ExportNamedDeclaration { - type: 'ExportNamedDeclaration', - assertions: Array [], - declaration: TSModuleDeclaration { - type: 'TSModuleDeclaration', -- body: TSModuleBlock { -- type: 'TSModuleBlock', -- body: Array [], + TSModuleDeclaration { + type: 'TSModuleDeclaration', +- body: TSModuleBlock { +- type: 'TSModuleBlock', +- body: Array [], - -- range: [29, 31], -- loc: { -- start: { column: 29, line: 1 }, -- end: { column: 31, line: 1 }, -- }, +- range: [22, 24], +- loc: { +- start: { column: 22, line: 1 }, +- end: { column: 24, line: 1 }, - }, -- declare: false, -- global: false, -- id: TSQualifiedName { +- }, +- declare: false, +- global: false, +- id: TSQualifiedName { +- type: 'TSQualifiedName', +- left: TSQualifiedName { - type: 'TSQualifiedName', -- left: TSQualifiedName { -- type: 'TSQualifiedName', -- left: Identifier { -- type: 'Identifier', -- decorators: Array [], -- name: 'abc', -- optional: false, +- left: Identifier { +- type: 'Identifier', +- decorators: Array [], +- name: 'abc', +- optional: false, ++ body: TSModuleDeclaration { ++ type: 'TSModuleDeclaration', + body: TSModuleDeclaration { + type: 'TSModuleDeclaration', -+ body: TSModuleDeclaration { -+ type: 'TSModuleDeclaration', -+ body: TSModuleBlock { -+ type: 'TSModuleBlock', -+ body: Array [], - -- range: [17, 20], -+ range: [29, 31], - loc: { -- start: { column: 17, line: 1 }, -- end: { column: 20, line: 1 }, -+ start: { column: 29, line: 1 }, -+ end: { column: 31, line: 1 }, - }, - }, -- right: Identifier { -+ id: Identifier { - type: 'Identifier', -- decorators: Array [], -- name: 'def', -- optional: false, -+ name: 'ghi', ++ body: TSModuleBlock { ++ type: 'TSModuleBlock', ++ body: Array [], -- range: [21, 24], -+ range: [25, 28], - loc: { -- start: { column: 21, line: 1 }, -- end: { column: 24, line: 1 }, -+ start: { column: 25, line: 1 }, -+ end: { column: 28, line: 1 }, - }, - }, - -- range: [17, 24], -+ range: [25, 31], +- range: [10, 13], ++ range: [22, 24], loc: { -- start: { column: 17, line: 1 }, -- end: { column: 24, line: 1 }, -+ start: { column: 25, line: 1 }, -+ end: { column: 31, line: 1 }, +- start: { column: 10, line: 1 }, +- end: { column: 13, line: 1 }, ++ start: { column: 22, line: 1 }, ++ end: { column: 24, line: 1 }, }, }, - right: Identifier { + id: Identifier { type: 'Identifier', - decorators: Array [], -- name: 'ghi', +- name: 'def', - optional: false, -+ name: 'def', ++ name: 'ghi', -- range: [25, 28], -+ range: [21, 24], +- range: [14, 17], ++ range: [18, 21], loc: { -- start: { column: 25, line: 1 }, -- end: { column: 28, line: 1 }, -+ start: { column: 21, line: 1 }, -+ end: { column: 24, line: 1 }, +- start: { column: 14, line: 1 }, +- end: { column: 17, line: 1 }, ++ start: { column: 18, line: 1 }, ++ end: { column: 21, line: 1 }, }, }, -- range: [17, 28], -+ range: [21, 31], -+ loc: { -+ start: { column: 21, line: 1 }, -+ end: { column: 31, line: 1 }, -+ }, -+ }, +- range: [10, 17], ++ range: [18, 24], + loc: { +- start: { column: 10, line: 1 }, +- end: { column: 17, line: 1 }, ++ start: { column: 18, line: 1 }, ++ end: { column: 24, line: 1 }, + }, + }, +- right: Identifier { + id: Identifier { -+ type: 'Identifier', -+ name: 'abc', -+ -+ range: [17, 20], + type: 'Identifier', +- decorators: Array [], +- name: 'ghi', +- optional: false, ++ name: 'def', + +- range: [18, 21], ++ range: [14, 17], loc: { - start: { column: 17, line: 1 }, -- end: { column: 28, line: 1 }, -+ end: { column: 20, line: 1 }, +- start: { column: 18, line: 1 }, +- end: { column: 21, line: 1 }, ++ start: { column: 14, line: 1 }, ++ end: { column: 17, line: 1 }, }, }, -- kind: 'namespace', - range: [7, 31], +- range: [10, 21], ++ range: [14, 24], ++ loc: { ++ start: { column: 14, line: 1 }, ++ end: { column: 24, line: 1 }, ++ }, ++ }, ++ id: Identifier { ++ type: 'Identifier', ++ name: 'abc', ++ ++ range: [10, 13], loc: { - start: { column: 7, line: 1 }, - end: { column: 31, line: 1 }, + start: { column: 10, line: 1 }, +- end: { column: 21, line: 1 }, ++ end: { column: 13, line: 1 }, }, }, - exportKind: 'value', - source: null, - specifiers: Array [], +- kind: 'namespace', - range: [0, 31], + range: [0, 24], loc: { start: { column: 0, line: 1 }, - end: { column: 31, line: 1 }, + end: { column: 24, line: 1 }, }, }, ], - sourceType: 'module', + sourceType: 'script', - range: [0, 32], + range: [0, 25], loc: { start: { column: 0, line: 1 }, end: { column: 0, line: 2 }, diff --git a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/nested-internal-module/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/nested-internal-module/snapshots/1-TSESTree-AST.shot index 1c290645bdc6..c4a8a3d48712 100644 --- a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/nested-internal-module/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/nested-internal-module/snapshots/1-TSESTree-AST.shot @@ -104,10 +104,10 @@ Program { type: "BlockStatement", body: [], - range: [191, 193], + range: [210, 212], loc: { - start: { column: 52, line: 6 }, - end: { column: 54, line: 6 }, + start: { column: 6, line: 9 }, + end: { column: 8, line: 9 }, }, }, declare: false, @@ -130,33 +130,33 @@ Program { typeAnnotation: TSNumberKeyword { type: "TSNumberKeyword", - range: [165, 171], + range: [172, 178], loc: { - start: { column: 26, line: 6 }, - end: { column: 32, line: 6 }, + start: { column: 16, line: 7 }, + end: { column: 22, line: 7 }, }, }, - range: [163, 171], + range: [170, 178], loc: { - start: { column: 24, line: 6 }, - end: { column: 32, line: 6 }, + start: { column: 14, line: 7 }, + end: { column: 22, line: 7 }, }, }, - range: [162, 171], + range: [169, 178], loc: { - start: { column: 23, line: 6 }, - end: { column: 32, line: 6 }, + start: { column: 13, line: 7 }, + end: { column: 22, line: 7 }, }, }, readonly: false, static: false, - range: [155, 171], + range: [162, 178], loc: { - start: { column: 16, line: 6 }, - end: { column: 32, line: 6 }, + start: { column: 6, line: 7 }, + end: { column: 22, line: 7 }, }, }, TSParameterProperty { @@ -174,56 +174,56 @@ Program { typeAnnotation: TSNumberKeyword { type: "TSNumberKeyword", - range: [183, 189], + range: [196, 202], loc: { - start: { column: 44, line: 6 }, - end: { column: 50, line: 6 }, + start: { column: 16, line: 8 }, + end: { column: 22, line: 8 }, }, }, - range: [181, 189], + range: [194, 202], loc: { - start: { column: 42, line: 6 }, - end: { column: 50, line: 6 }, + start: { column: 14, line: 8 }, + end: { column: 22, line: 8 }, }, }, - range: [180, 189], + range: [193, 202], loc: { - start: { column: 41, line: 6 }, - end: { column: 50, line: 6 }, + start: { column: 13, line: 8 }, + end: { column: 22, line: 8 }, }, }, readonly: false, static: false, - range: [173, 189], + range: [186, 202], loc: { - start: { column: 34, line: 6 }, - end: { column: 50, line: 6 }, + start: { column: 6, line: 8 }, + end: { column: 22, line: 8 }, }, }, ], - range: [154, 193], + range: [154, 212], loc: { start: { column: 15, line: 6 }, - end: { column: 54, line: 6 }, + end: { column: 8, line: 9 }, }, }, - range: [143, 193], + range: [143, 212], loc: { start: { column: 4, line: 6 }, - end: { column: 54, line: 6 }, + end: { column: 8, line: 9 }, }, }, ], - range: [137, 197], + range: [137, 216], loc: { start: { column: 21, line: 5 }, - end: { column: 3, line: 7 }, + end: { column: 3, line: 10 }, }, }, declare: false, @@ -243,20 +243,20 @@ Program { implements: [], superClass: null, - range: [125, 197], + range: [125, 216], loc: { start: { column: 9, line: 5 }, - end: { column: 3, line: 7 }, + end: { column: 3, line: 10 }, }, }, exportKind: "value", source: null, specifiers: [], - range: [118, 197], + range: [118, 216], loc: { start: { column: 2, line: 5 }, - end: { column: 3, line: 7 }, + end: { column: 3, line: 10 }, }, }, ExportNamedDeclaration { @@ -284,10 +284,10 @@ Program { name: "name", optional: false, - range: [250, 254], + range: [269, 273], loc: { - start: { column: 6, line: 10 }, - end: { column: 10, line: 10 }, + start: { column: 6, line: 13 }, + end: { column: 10, line: 13 }, }, }, optional: false, @@ -298,32 +298,32 @@ Program { typeAnnotation: TSStringKeyword { type: "TSStringKeyword", - range: [256, 262], + range: [275, 281], loc: { - start: { column: 12, line: 10 }, - end: { column: 18, line: 10 }, + start: { column: 12, line: 13 }, + end: { column: 18, line: 13 }, }, }, - range: [254, 262], + range: [273, 281], loc: { - start: { column: 10, line: 10 }, - end: { column: 18, line: 10 }, + start: { column: 10, line: 13 }, + end: { column: 18, line: 13 }, }, }, - range: [250, 263], + range: [269, 282], loc: { - start: { column: 6, line: 10 }, - end: { column: 19, line: 10 }, + start: { column: 6, line: 13 }, + end: { column: 19, line: 13 }, }, }, ], - range: [242, 269], + range: [261, 288], loc: { - start: { column: 24, line: 9 }, - end: { column: 5, line: 11 }, + start: { column: 24, line: 12 }, + end: { column: 5, line: 14 }, }, }, declare: false, @@ -334,35 +334,35 @@ Program { name: "Id", optional: false, - range: [239, 241], + range: [258, 260], loc: { - start: { column: 21, line: 9 }, - end: { column: 23, line: 9 }, + start: { column: 21, line: 12 }, + end: { column: 23, line: 12 }, }, }, - range: [229, 269], + range: [248, 288], loc: { - start: { column: 11, line: 9 }, - end: { column: 5, line: 11 }, + start: { column: 11, line: 12 }, + end: { column: 5, line: 14 }, }, }, exportKind: "type", source: null, specifiers: [], - range: [222, 269], + range: [241, 288], loc: { - start: { column: 4, line: 9 }, - end: { column: 5, line: 11 }, + start: { column: 4, line: 12 }, + end: { column: 5, line: 14 }, }, }, ], - range: [216, 273], + range: [235, 292], loc: { - start: { column: 18, line: 8 }, - end: { column: 3, line: 12 }, + start: { column: 18, line: 11 }, + end: { column: 3, line: 15 }, }, }, declare: false, @@ -373,36 +373,36 @@ Program { name: "B", optional: false, - range: [214, 215], + range: [233, 234], loc: { - start: { column: 16, line: 8 }, - end: { column: 17, line: 8 }, + start: { column: 16, line: 11 }, + end: { column: 17, line: 11 }, }, }, kind: "module", - range: [207, 273], + range: [226, 292], loc: { - start: { column: 9, line: 8 }, - end: { column: 3, line: 12 }, + start: { column: 9, line: 11 }, + end: { column: 3, line: 15 }, }, }, exportKind: "value", source: null, specifiers: [], - range: [200, 273], + range: [219, 292], loc: { - start: { column: 2, line: 8 }, - end: { column: 3, line: 12 }, + start: { column: 2, line: 11 }, + end: { column: 3, line: 15 }, }, }, ], - range: [82, 275], + range: [82, 294], loc: { start: { column: 9, line: 3 }, - end: { column: 1, line: 13 }, + end: { column: 1, line: 16 }, }, }, declare: false, @@ -421,19 +421,19 @@ Program { }, kind: "module", - range: [73, 275], + range: [73, 294], loc: { start: { column: 0, line: 3 }, - end: { column: 1, line: 13 }, + end: { column: 1, line: 16 }, }, }, ], sourceType: "script", - range: [73, 276], + range: [73, 295], loc: { start: { column: 0, line: 3 }, - end: { column: 0, line: 14 }, + end: { column: 0, line: 17 }, }, } `; diff --git a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/nested-internal-module/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/nested-internal-module/snapshots/2-TSESTree-Tokens.shot index e3447023c759..ab5325cefc81 100644 --- a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/nested-internal-module/snapshots/2-TSESTree-Tokens.shot +++ b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/nested-internal-module/snapshots/2-TSESTree-Tokens.shot @@ -156,280 +156,290 @@ exports[`AST Fixtures legacy-fixtures namespaces-and-modules nested-internal-mod type: "Keyword", value: "public", - range: [155, 161], + range: [162, 168], loc: { - start: { column: 16, line: 6 }, - end: { column: 22, line: 6 }, + start: { column: 6, line: 7 }, + end: { column: 12, line: 7 }, }, }, Identifier { type: "Identifier", value: "x", - range: [162, 163], + range: [169, 170], loc: { - start: { column: 23, line: 6 }, - end: { column: 24, line: 6 }, + start: { column: 13, line: 7 }, + end: { column: 14, line: 7 }, }, }, Punctuator { type: "Punctuator", value: ":", - range: [163, 164], + range: [170, 171], loc: { - start: { column: 24, line: 6 }, - end: { column: 25, line: 6 }, + start: { column: 14, line: 7 }, + end: { column: 15, line: 7 }, }, }, Identifier { type: "Identifier", value: "number", - range: [165, 171], + range: [172, 178], loc: { - start: { column: 26, line: 6 }, - end: { column: 32, line: 6 }, + start: { column: 16, line: 7 }, + end: { column: 22, line: 7 }, }, }, Punctuator { type: "Punctuator", value: ",", - range: [171, 172], + range: [178, 179], loc: { - start: { column: 32, line: 6 }, - end: { column: 33, line: 6 }, + start: { column: 22, line: 7 }, + end: { column: 23, line: 7 }, }, }, Keyword { type: "Keyword", value: "public", - range: [173, 179], + range: [186, 192], loc: { - start: { column: 34, line: 6 }, - end: { column: 40, line: 6 }, + start: { column: 6, line: 8 }, + end: { column: 12, line: 8 }, }, }, Identifier { type: "Identifier", value: "y", - range: [180, 181], + range: [193, 194], loc: { - start: { column: 41, line: 6 }, - end: { column: 42, line: 6 }, + start: { column: 13, line: 8 }, + end: { column: 14, line: 8 }, }, }, Punctuator { type: "Punctuator", value: ":", - range: [181, 182], + range: [194, 195], loc: { - start: { column: 42, line: 6 }, - end: { column: 43, line: 6 }, + start: { column: 14, line: 8 }, + end: { column: 15, line: 8 }, }, }, Identifier { type: "Identifier", value: "number", - range: [183, 189], + range: [196, 202], loc: { - start: { column: 44, line: 6 }, - end: { column: 50, line: 6 }, + start: { column: 16, line: 8 }, + end: { column: 22, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [202, 203], + loc: { + start: { column: 22, line: 8 }, + end: { column: 23, line: 8 }, }, }, Punctuator { type: "Punctuator", value: ")", - range: [189, 190], + range: [208, 209], loc: { - start: { column: 50, line: 6 }, - end: { column: 51, line: 6 }, + start: { column: 4, line: 9 }, + end: { column: 5, line: 9 }, }, }, Punctuator { type: "Punctuator", value: "{", - range: [191, 192], + range: [210, 211], loc: { - start: { column: 52, line: 6 }, - end: { column: 53, line: 6 }, + start: { column: 6, line: 9 }, + end: { column: 7, line: 9 }, }, }, Punctuator { type: "Punctuator", value: "}", - range: [192, 193], + range: [211, 212], loc: { - start: { column: 53, line: 6 }, - end: { column: 54, line: 6 }, + start: { column: 7, line: 9 }, + end: { column: 8, line: 9 }, }, }, Punctuator { type: "Punctuator", value: "}", - range: [196, 197], + range: [215, 216], loc: { - start: { column: 2, line: 7 }, - end: { column: 3, line: 7 }, + start: { column: 2, line: 10 }, + end: { column: 3, line: 10 }, }, }, Keyword { type: "Keyword", value: "export", - range: [200, 206], + range: [219, 225], loc: { - start: { column: 2, line: 8 }, - end: { column: 8, line: 8 }, + start: { column: 2, line: 11 }, + end: { column: 8, line: 11 }, }, }, Identifier { type: "Identifier", value: "module", - range: [207, 213], + range: [226, 232], loc: { - start: { column: 9, line: 8 }, - end: { column: 15, line: 8 }, + start: { column: 9, line: 11 }, + end: { column: 15, line: 11 }, }, }, Identifier { type: "Identifier", value: "B", - range: [214, 215], + range: [233, 234], loc: { - start: { column: 16, line: 8 }, - end: { column: 17, line: 8 }, + start: { column: 16, line: 11 }, + end: { column: 17, line: 11 }, }, }, Punctuator { type: "Punctuator", value: "{", - range: [216, 217], + range: [235, 236], loc: { - start: { column: 18, line: 8 }, - end: { column: 19, line: 8 }, + start: { column: 18, line: 11 }, + end: { column: 19, line: 11 }, }, }, Keyword { type: "Keyword", value: "export", - range: [222, 228], + range: [241, 247], loc: { - start: { column: 4, line: 9 }, - end: { column: 10, line: 9 }, + start: { column: 4, line: 12 }, + end: { column: 10, line: 12 }, }, }, Keyword { type: "Keyword", value: "interface", - range: [229, 238], + range: [248, 257], loc: { - start: { column: 11, line: 9 }, - end: { column: 20, line: 9 }, + start: { column: 11, line: 12 }, + end: { column: 20, line: 12 }, }, }, Identifier { type: "Identifier", value: "Id", - range: [239, 241], + range: [258, 260], loc: { - start: { column: 21, line: 9 }, - end: { column: 23, line: 9 }, + start: { column: 21, line: 12 }, + end: { column: 23, line: 12 }, }, }, Punctuator { type: "Punctuator", value: "{", - range: [242, 243], + range: [261, 262], loc: { - start: { column: 24, line: 9 }, - end: { column: 25, line: 9 }, + start: { column: 24, line: 12 }, + end: { column: 25, line: 12 }, }, }, Identifier { type: "Identifier", value: "name", - range: [250, 254], + range: [269, 273], loc: { - start: { column: 6, line: 10 }, - end: { column: 10, line: 10 }, + start: { column: 6, line: 13 }, + end: { column: 10, line: 13 }, }, }, Punctuator { type: "Punctuator", value: ":", - range: [254, 255], + range: [273, 274], loc: { - start: { column: 10, line: 10 }, - end: { column: 11, line: 10 }, + start: { column: 10, line: 13 }, + end: { column: 11, line: 13 }, }, }, Identifier { type: "Identifier", value: "string", - range: [256, 262], + range: [275, 281], loc: { - start: { column: 12, line: 10 }, - end: { column: 18, line: 10 }, + start: { column: 12, line: 13 }, + end: { column: 18, line: 13 }, }, }, Punctuator { type: "Punctuator", value: ";", - range: [262, 263], + range: [281, 282], loc: { - start: { column: 18, line: 10 }, - end: { column: 19, line: 10 }, + start: { column: 18, line: 13 }, + end: { column: 19, line: 13 }, }, }, Punctuator { type: "Punctuator", value: "}", - range: [268, 269], + range: [287, 288], loc: { - start: { column: 4, line: 11 }, - end: { column: 5, line: 11 }, + start: { column: 4, line: 14 }, + end: { column: 5, line: 14 }, }, }, Punctuator { type: "Punctuator", value: "}", - range: [272, 273], + range: [291, 292], loc: { - start: { column: 2, line: 12 }, - end: { column: 3, line: 12 }, + start: { column: 2, line: 15 }, + end: { column: 3, line: 15 }, }, }, Punctuator { type: "Punctuator", value: "}", - range: [274, 275], + range: [293, 294], loc: { - start: { column: 0, line: 13 }, - end: { column: 1, line: 13 }, + start: { column: 0, line: 16 }, + end: { column: 1, line: 16 }, }, }, ] diff --git a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/nested-internal-module/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/nested-internal-module/snapshots/3-Babel-AST.shot index 779d97cdbd1c..a3ded8ae19b3 100644 --- a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/nested-internal-module/snapshots/3-Babel-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/nested-internal-module/snapshots/3-Babel-AST.shot @@ -94,10 +94,10 @@ Program { type: "BlockStatement", body: [], - range: [191, 193], + range: [210, 212], loc: { - start: { column: 52, line: 6 }, - end: { column: 54, line: 6 }, + start: { column: 6, line: 9 }, + end: { column: 8, line: 9 }, }, }, expression: false, @@ -115,31 +115,31 @@ Program { typeAnnotation: TSNumberKeyword { type: "TSNumberKeyword", - range: [165, 171], + range: [172, 178], loc: { - start: { column: 26, line: 6 }, - end: { column: 32, line: 6 }, + start: { column: 16, line: 7 }, + end: { column: 22, line: 7 }, }, }, - range: [163, 171], + range: [170, 178], loc: { - start: { column: 24, line: 6 }, - end: { column: 32, line: 6 }, + start: { column: 14, line: 7 }, + end: { column: 22, line: 7 }, }, }, - range: [162, 171], + range: [169, 178], loc: { - start: { column: 23, line: 6 }, - end: { column: 32, line: 6 }, + start: { column: 13, line: 7 }, + end: { column: 22, line: 7 }, }, }, - range: [155, 171], + range: [162, 178], loc: { - start: { column: 16, line: 6 }, - end: { column: 32, line: 6 }, + start: { column: 6, line: 7 }, + end: { column: 22, line: 7 }, }, }, TSParameterProperty { @@ -153,54 +153,54 @@ Program { typeAnnotation: TSNumberKeyword { type: "TSNumberKeyword", - range: [183, 189], + range: [196, 202], loc: { - start: { column: 44, line: 6 }, - end: { column: 50, line: 6 }, + start: { column: 16, line: 8 }, + end: { column: 22, line: 8 }, }, }, - range: [181, 189], + range: [194, 202], loc: { - start: { column: 42, line: 6 }, - end: { column: 50, line: 6 }, + start: { column: 14, line: 8 }, + end: { column: 22, line: 8 }, }, }, - range: [180, 189], + range: [193, 202], loc: { - start: { column: 41, line: 6 }, - end: { column: 50, line: 6 }, + start: { column: 13, line: 8 }, + end: { column: 22, line: 8 }, }, }, - range: [173, 189], + range: [186, 202], loc: { - start: { column: 34, line: 6 }, - end: { column: 50, line: 6 }, + start: { column: 6, line: 8 }, + end: { column: 22, line: 8 }, }, }, ], - range: [154, 193], + range: [154, 212], loc: { start: { column: 15, line: 6 }, - end: { column: 54, line: 6 }, + end: { column: 8, line: 9 }, }, }, - range: [143, 193], + range: [143, 212], loc: { start: { column: 4, line: 6 }, - end: { column: 54, line: 6 }, + end: { column: 8, line: 9 }, }, }, ], - range: [137, 197], + range: [137, 216], loc: { start: { column: 21, line: 5 }, - end: { column: 3, line: 7 }, + end: { column: 3, line: 10 }, }, }, id: Identifier { @@ -215,20 +215,20 @@ Program { }, superClass: null, - range: [125, 197], + range: [125, 216], loc: { start: { column: 9, line: 5 }, - end: { column: 3, line: 7 }, + end: { column: 3, line: 10 }, }, }, exportKind: "value", source: null, specifiers: [], - range: [118, 197], + range: [118, 216], loc: { start: { column: 2, line: 5 }, - end: { column: 3, line: 7 }, + end: { column: 3, line: 10 }, }, }, ExportNamedDeclaration { @@ -254,10 +254,10 @@ Program { type: "Identifier", name: "name", - range: [250, 254], + range: [269, 273], loc: { - start: { column: 6, line: 10 }, - end: { column: 10, line: 10 }, + start: { column: 6, line: 13 }, + end: { column: 10, line: 13 }, }, }, typeAnnotation: TSTypeAnnotation { @@ -265,102 +265,102 @@ Program { typeAnnotation: TSStringKeyword { type: "TSStringKeyword", - range: [256, 262], + range: [275, 281], loc: { - start: { column: 12, line: 10 }, - end: { column: 18, line: 10 }, + start: { column: 12, line: 13 }, + end: { column: 18, line: 13 }, }, }, - range: [254, 262], + range: [273, 281], loc: { - start: { column: 10, line: 10 }, - end: { column: 18, line: 10 }, + start: { column: 10, line: 13 }, + end: { column: 18, line: 13 }, }, }, - range: [250, 263], + range: [269, 282], loc: { - start: { column: 6, line: 10 }, - end: { column: 19, line: 10 }, + start: { column: 6, line: 13 }, + end: { column: 19, line: 13 }, }, }, ], - range: [242, 269], + range: [261, 288], loc: { - start: { column: 24, line: 9 }, - end: { column: 5, line: 11 }, + start: { column: 24, line: 12 }, + end: { column: 5, line: 14 }, }, }, id: Identifier { type: "Identifier", name: "Id", - range: [239, 241], + range: [258, 260], loc: { - start: { column: 21, line: 9 }, - end: { column: 23, line: 9 }, + start: { column: 21, line: 12 }, + end: { column: 23, line: 12 }, }, }, - range: [229, 269], + range: [248, 288], loc: { - start: { column: 11, line: 9 }, - end: { column: 5, line: 11 }, + start: { column: 11, line: 12 }, + end: { column: 5, line: 14 }, }, }, exportKind: "type", source: null, specifiers: [], - range: [222, 269], + range: [241, 288], loc: { - start: { column: 4, line: 9 }, - end: { column: 5, line: 11 }, + start: { column: 4, line: 12 }, + end: { column: 5, line: 14 }, }, }, ], - range: [216, 273], + range: [235, 292], loc: { - start: { column: 18, line: 8 }, - end: { column: 3, line: 12 }, + start: { column: 18, line: 11 }, + end: { column: 3, line: 15 }, }, }, id: Identifier { type: "Identifier", name: "B", - range: [214, 215], + range: [233, 234], loc: { - start: { column: 16, line: 8 }, - end: { column: 17, line: 8 }, + start: { column: 16, line: 11 }, + end: { column: 17, line: 11 }, }, }, - range: [207, 273], + range: [226, 292], loc: { - start: { column: 9, line: 8 }, - end: { column: 3, line: 12 }, + start: { column: 9, line: 11 }, + end: { column: 3, line: 15 }, }, }, exportKind: "value", source: null, specifiers: [], - range: [200, 273], + range: [219, 292], loc: { - start: { column: 2, line: 8 }, - end: { column: 3, line: 12 }, + start: { column: 2, line: 11 }, + end: { column: 3, line: 15 }, }, }, ], - range: [82, 275], + range: [82, 294], loc: { start: { column: 9, line: 3 }, - end: { column: 1, line: 13 }, + end: { column: 1, line: 16 }, }, }, id: Identifier { @@ -374,19 +374,19 @@ Program { }, }, - range: [73, 275], + range: [73, 294], loc: { start: { column: 0, line: 3 }, - end: { column: 1, line: 13 }, + end: { column: 1, line: 16 }, }, }, ], sourceType: "module", - range: [73, 276], + range: [73, 295], loc: { start: { column: 0, line: 3 }, - end: { column: 0, line: 14 }, + end: { column: 0, line: 17 }, }, } `; diff --git a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/nested-internal-module/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/nested-internal-module/snapshots/4-Babel-Tokens.shot index 7819eee28a12..318246ae6292 100644 --- a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/nested-internal-module/snapshots/4-Babel-Tokens.shot +++ b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/nested-internal-module/snapshots/4-Babel-Tokens.shot @@ -156,280 +156,290 @@ exports[`AST Fixtures legacy-fixtures namespaces-and-modules nested-internal-mod type: "Identifier", value: "public", - range: [155, 161], + range: [162, 168], loc: { - start: { column: 16, line: 6 }, - end: { column: 22, line: 6 }, + start: { column: 6, line: 7 }, + end: { column: 12, line: 7 }, }, }, Identifier { type: "Identifier", value: "x", - range: [162, 163], + range: [169, 170], loc: { - start: { column: 23, line: 6 }, - end: { column: 24, line: 6 }, + start: { column: 13, line: 7 }, + end: { column: 14, line: 7 }, }, }, Punctuator { type: "Punctuator", value: ":", - range: [163, 164], + range: [170, 171], loc: { - start: { column: 24, line: 6 }, - end: { column: 25, line: 6 }, + start: { column: 14, line: 7 }, + end: { column: 15, line: 7 }, }, }, Identifier { type: "Identifier", value: "number", - range: [165, 171], + range: [172, 178], loc: { - start: { column: 26, line: 6 }, - end: { column: 32, line: 6 }, + start: { column: 16, line: 7 }, + end: { column: 22, line: 7 }, }, }, Punctuator { type: "Punctuator", value: ",", - range: [171, 172], + range: [178, 179], loc: { - start: { column: 32, line: 6 }, - end: { column: 33, line: 6 }, + start: { column: 22, line: 7 }, + end: { column: 23, line: 7 }, }, }, Identifier { type: "Identifier", value: "public", - range: [173, 179], + range: [186, 192], loc: { - start: { column: 34, line: 6 }, - end: { column: 40, line: 6 }, + start: { column: 6, line: 8 }, + end: { column: 12, line: 8 }, }, }, Identifier { type: "Identifier", value: "y", - range: [180, 181], + range: [193, 194], loc: { - start: { column: 41, line: 6 }, - end: { column: 42, line: 6 }, + start: { column: 13, line: 8 }, + end: { column: 14, line: 8 }, }, }, Punctuator { type: "Punctuator", value: ":", - range: [181, 182], + range: [194, 195], loc: { - start: { column: 42, line: 6 }, - end: { column: 43, line: 6 }, + start: { column: 14, line: 8 }, + end: { column: 15, line: 8 }, }, }, Identifier { type: "Identifier", value: "number", - range: [183, 189], + range: [196, 202], loc: { - start: { column: 44, line: 6 }, - end: { column: 50, line: 6 }, + start: { column: 16, line: 8 }, + end: { column: 22, line: 8 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [202, 203], + loc: { + start: { column: 22, line: 8 }, + end: { column: 23, line: 8 }, }, }, Punctuator { type: "Punctuator", value: ")", - range: [189, 190], + range: [208, 209], loc: { - start: { column: 50, line: 6 }, - end: { column: 51, line: 6 }, + start: { column: 4, line: 9 }, + end: { column: 5, line: 9 }, }, }, Punctuator { type: "Punctuator", value: "{", - range: [191, 192], + range: [210, 211], loc: { - start: { column: 52, line: 6 }, - end: { column: 53, line: 6 }, + start: { column: 6, line: 9 }, + end: { column: 7, line: 9 }, }, }, Punctuator { type: "Punctuator", value: "}", - range: [192, 193], + range: [211, 212], loc: { - start: { column: 53, line: 6 }, - end: { column: 54, line: 6 }, + start: { column: 7, line: 9 }, + end: { column: 8, line: 9 }, }, }, Punctuator { type: "Punctuator", value: "}", - range: [196, 197], + range: [215, 216], loc: { - start: { column: 2, line: 7 }, - end: { column: 3, line: 7 }, + start: { column: 2, line: 10 }, + end: { column: 3, line: 10 }, }, }, Keyword { type: "Keyword", value: "export", - range: [200, 206], + range: [219, 225], loc: { - start: { column: 2, line: 8 }, - end: { column: 8, line: 8 }, + start: { column: 2, line: 11 }, + end: { column: 8, line: 11 }, }, }, Identifier { type: "Identifier", value: "module", - range: [207, 213], + range: [226, 232], loc: { - start: { column: 9, line: 8 }, - end: { column: 15, line: 8 }, + start: { column: 9, line: 11 }, + end: { column: 15, line: 11 }, }, }, Identifier { type: "Identifier", value: "B", - range: [214, 215], + range: [233, 234], loc: { - start: { column: 16, line: 8 }, - end: { column: 17, line: 8 }, + start: { column: 16, line: 11 }, + end: { column: 17, line: 11 }, }, }, Punctuator { type: "Punctuator", value: "{", - range: [216, 217], + range: [235, 236], loc: { - start: { column: 18, line: 8 }, - end: { column: 19, line: 8 }, + start: { column: 18, line: 11 }, + end: { column: 19, line: 11 }, }, }, Keyword { type: "Keyword", value: "export", - range: [222, 228], + range: [241, 247], loc: { - start: { column: 4, line: 9 }, - end: { column: 10, line: 9 }, + start: { column: 4, line: 12 }, + end: { column: 10, line: 12 }, }, }, Identifier { type: "Identifier", value: "interface", - range: [229, 238], + range: [248, 257], loc: { - start: { column: 11, line: 9 }, - end: { column: 20, line: 9 }, + start: { column: 11, line: 12 }, + end: { column: 20, line: 12 }, }, }, Identifier { type: "Identifier", value: "Id", - range: [239, 241], + range: [258, 260], loc: { - start: { column: 21, line: 9 }, - end: { column: 23, line: 9 }, + start: { column: 21, line: 12 }, + end: { column: 23, line: 12 }, }, }, Punctuator { type: "Punctuator", value: "{", - range: [242, 243], + range: [261, 262], loc: { - start: { column: 24, line: 9 }, - end: { column: 25, line: 9 }, + start: { column: 24, line: 12 }, + end: { column: 25, line: 12 }, }, }, Identifier { type: "Identifier", value: "name", - range: [250, 254], + range: [269, 273], loc: { - start: { column: 6, line: 10 }, - end: { column: 10, line: 10 }, + start: { column: 6, line: 13 }, + end: { column: 10, line: 13 }, }, }, Punctuator { type: "Punctuator", value: ":", - range: [254, 255], + range: [273, 274], loc: { - start: { column: 10, line: 10 }, - end: { column: 11, line: 10 }, + start: { column: 10, line: 13 }, + end: { column: 11, line: 13 }, }, }, Identifier { type: "Identifier", value: "string", - range: [256, 262], + range: [275, 281], loc: { - start: { column: 12, line: 10 }, - end: { column: 18, line: 10 }, + start: { column: 12, line: 13 }, + end: { column: 18, line: 13 }, }, }, Punctuator { type: "Punctuator", value: ";", - range: [262, 263], + range: [281, 282], loc: { - start: { column: 18, line: 10 }, - end: { column: 19, line: 10 }, + start: { column: 18, line: 13 }, + end: { column: 19, line: 13 }, }, }, Punctuator { type: "Punctuator", value: "}", - range: [268, 269], + range: [287, 288], loc: { - start: { column: 4, line: 11 }, - end: { column: 5, line: 11 }, + start: { column: 4, line: 14 }, + end: { column: 5, line: 14 }, }, }, Punctuator { type: "Punctuator", value: "}", - range: [272, 273], + range: [291, 292], loc: { - start: { column: 2, line: 12 }, - end: { column: 3, line: 12 }, + start: { column: 2, line: 15 }, + end: { column: 3, line: 15 }, }, }, Punctuator { type: "Punctuator", value: "}", - range: [274, 275], + range: [293, 294], loc: { - start: { column: 0, line: 13 }, - end: { column: 1, line: 13 }, + start: { column: 0, line: 16 }, + end: { column: 1, line: 16 }, }, }, ] diff --git a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/nested-internal-module/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/nested-internal-module/snapshots/5-AST-Alignment-AST.shot index dd7ddcca6f73..f54c0978f19e 100644 --- a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/nested-internal-module/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/nested-internal-module/snapshots/5-AST-Alignment-AST.shot @@ -108,10 +108,10 @@ exports[`AST Fixtures legacy-fixtures namespaces-and-modules nested-internal-mod type: 'BlockStatement', body: Array [], - range: [191, 193], + range: [210, 212], loc: { - start: { column: 52, line: 6 }, - end: { column: 54, line: 6 }, + start: { column: 6, line: 9 }, + end: { column: 8, line: 9 }, }, }, - declare: false, @@ -134,33 +134,33 @@ exports[`AST Fixtures legacy-fixtures namespaces-and-modules nested-internal-mod typeAnnotation: TSNumberKeyword { type: 'TSNumberKeyword', - range: [165, 171], + range: [172, 178], loc: { - start: { column: 26, line: 6 }, - end: { column: 32, line: 6 }, + start: { column: 16, line: 7 }, + end: { column: 22, line: 7 }, }, }, - range: [163, 171], + range: [170, 178], loc: { - start: { column: 24, line: 6 }, - end: { column: 32, line: 6 }, + start: { column: 14, line: 7 }, + end: { column: 22, line: 7 }, }, }, - range: [162, 171], + range: [169, 178], loc: { - start: { column: 23, line: 6 }, - end: { column: 32, line: 6 }, + start: { column: 13, line: 7 }, + end: { column: 22, line: 7 }, }, }, - readonly: false, - static: false, - range: [155, 171], + range: [162, 178], loc: { - start: { column: 16, line: 6 }, - end: { column: 32, line: 6 }, + start: { column: 6, line: 7 }, + end: { column: 22, line: 7 }, }, }, TSParameterProperty { @@ -178,56 +178,56 @@ exports[`AST Fixtures legacy-fixtures namespaces-and-modules nested-internal-mod typeAnnotation: TSNumberKeyword { type: 'TSNumberKeyword', - range: [183, 189], + range: [196, 202], loc: { - start: { column: 44, line: 6 }, - end: { column: 50, line: 6 }, + start: { column: 16, line: 8 }, + end: { column: 22, line: 8 }, }, }, - range: [181, 189], + range: [194, 202], loc: { - start: { column: 42, line: 6 }, - end: { column: 50, line: 6 }, + start: { column: 14, line: 8 }, + end: { column: 22, line: 8 }, }, }, - range: [180, 189], + range: [193, 202], loc: { - start: { column: 41, line: 6 }, - end: { column: 50, line: 6 }, + start: { column: 13, line: 8 }, + end: { column: 22, line: 8 }, }, }, - readonly: false, - static: false, - range: [173, 189], + range: [186, 202], loc: { - start: { column: 34, line: 6 }, - end: { column: 50, line: 6 }, + start: { column: 6, line: 8 }, + end: { column: 22, line: 8 }, }, }, ], - range: [154, 193], + range: [154, 212], loc: { start: { column: 15, line: 6 }, - end: { column: 54, line: 6 }, + end: { column: 8, line: 9 }, }, }, - range: [143, 193], + range: [143, 212], loc: { start: { column: 4, line: 6 }, - end: { column: 54, line: 6 }, + end: { column: 8, line: 9 }, }, }, ], - range: [137, 197], + range: [137, 216], loc: { start: { column: 21, line: 5 }, - end: { column: 3, line: 7 }, + end: { column: 3, line: 10 }, }, }, - declare: false, @@ -247,20 +247,20 @@ exports[`AST Fixtures legacy-fixtures namespaces-and-modules nested-internal-mod - implements: Array [], superClass: null, - range: [125, 197], + range: [125, 216], loc: { start: { column: 9, line: 5 }, - end: { column: 3, line: 7 }, + end: { column: 3, line: 10 }, }, }, exportKind: 'value', source: null, specifiers: Array [], - range: [118, 197], + range: [118, 216], loc: { start: { column: 2, line: 5 }, - end: { column: 3, line: 7 }, + end: { column: 3, line: 10 }, }, }, ExportNamedDeclaration { @@ -288,10 +288,10 @@ exports[`AST Fixtures legacy-fixtures namespaces-and-modules nested-internal-mod name: 'name', - optional: false, - range: [250, 254], + range: [269, 273], loc: { - start: { column: 6, line: 10 }, - end: { column: 10, line: 10 }, + start: { column: 6, line: 13 }, + end: { column: 10, line: 13 }, }, }, - optional: false, @@ -302,32 +302,32 @@ exports[`AST Fixtures legacy-fixtures namespaces-and-modules nested-internal-mod typeAnnotation: TSStringKeyword { type: 'TSStringKeyword', - range: [256, 262], + range: [275, 281], loc: { - start: { column: 12, line: 10 }, - end: { column: 18, line: 10 }, + start: { column: 12, line: 13 }, + end: { column: 18, line: 13 }, }, }, - range: [254, 262], + range: [273, 281], loc: { - start: { column: 10, line: 10 }, - end: { column: 18, line: 10 }, + start: { column: 10, line: 13 }, + end: { column: 18, line: 13 }, }, }, - range: [250, 263], + range: [269, 282], loc: { - start: { column: 6, line: 10 }, - end: { column: 19, line: 10 }, + start: { column: 6, line: 13 }, + end: { column: 19, line: 13 }, }, }, ], - range: [242, 269], + range: [261, 288], loc: { - start: { column: 24, line: 9 }, - end: { column: 5, line: 11 }, + start: { column: 24, line: 12 }, + end: { column: 5, line: 14 }, }, }, - declare: false, @@ -338,35 +338,35 @@ exports[`AST Fixtures legacy-fixtures namespaces-and-modules nested-internal-mod name: 'Id', - optional: false, - range: [239, 241], + range: [258, 260], loc: { - start: { column: 21, line: 9 }, - end: { column: 23, line: 9 }, + start: { column: 21, line: 12 }, + end: { column: 23, line: 12 }, }, }, - range: [229, 269], + range: [248, 288], loc: { - start: { column: 11, line: 9 }, - end: { column: 5, line: 11 }, + start: { column: 11, line: 12 }, + end: { column: 5, line: 14 }, }, }, exportKind: 'type', source: null, specifiers: Array [], - range: [222, 269], + range: [241, 288], loc: { - start: { column: 4, line: 9 }, - end: { column: 5, line: 11 }, + start: { column: 4, line: 12 }, + end: { column: 5, line: 14 }, }, }, ], - range: [216, 273], + range: [235, 292], loc: { - start: { column: 18, line: 8 }, - end: { column: 3, line: 12 }, + start: { column: 18, line: 11 }, + end: { column: 3, line: 15 }, }, }, - declare: false, @@ -377,36 +377,36 @@ exports[`AST Fixtures legacy-fixtures namespaces-and-modules nested-internal-mod name: 'B', - optional: false, - range: [214, 215], + range: [233, 234], loc: { - start: { column: 16, line: 8 }, - end: { column: 17, line: 8 }, + start: { column: 16, line: 11 }, + end: { column: 17, line: 11 }, }, }, - kind: 'module', - range: [207, 273], + range: [226, 292], loc: { - start: { column: 9, line: 8 }, - end: { column: 3, line: 12 }, + start: { column: 9, line: 11 }, + end: { column: 3, line: 15 }, }, }, exportKind: 'value', source: null, specifiers: Array [], - range: [200, 273], + range: [219, 292], loc: { - start: { column: 2, line: 8 }, - end: { column: 3, line: 12 }, + start: { column: 2, line: 11 }, + end: { column: 3, line: 15 }, }, }, ], - range: [82, 275], + range: [82, 294], loc: { start: { column: 9, line: 3 }, - end: { column: 1, line: 13 }, + end: { column: 1, line: 16 }, }, }, - declare: false, @@ -425,20 +425,20 @@ exports[`AST Fixtures legacy-fixtures namespaces-and-modules nested-internal-mod }, - kind: 'module', - range: [73, 275], + range: [73, 294], loc: { start: { column: 0, line: 3 }, - end: { column: 1, line: 13 }, + end: { column: 1, line: 16 }, }, }, ], - sourceType: 'script', + sourceType: 'module', - range: [73, 276], + range: [73, 295], loc: { start: { column: 0, line: 3 }, - end: { column: 0, line: 14 }, + end: { column: 0, line: 17 }, }, }" `; diff --git a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/nested-internal-module/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/nested-internal-module/snapshots/6-AST-Alignment-Tokens.shot index 22adb3f05ccf..0a1136396ff5 100644 --- a/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/nested-internal-module/snapshots/6-AST-Alignment-Tokens.shot +++ b/packages/ast-spec/src/legacy-fixtures/namespaces-and-modules/fixtures/nested-internal-module/snapshots/6-AST-Alignment-Tokens.shot @@ -162,50 +162,50 @@ exports[`AST Fixtures legacy-fixtures namespaces-and-modules nested-internal-mod + type: 'Identifier', value: 'public', - range: [155, 161], + range: [162, 168], loc: { - start: { column: 16, line: 6 }, - end: { column: 22, line: 6 }, + start: { column: 6, line: 7 }, + end: { column: 12, line: 7 }, }, }, Identifier { type: 'Identifier', value: 'x', - range: [162, 163], + range: [169, 170], loc: { - start: { column: 23, line: 6 }, - end: { column: 24, line: 6 }, + start: { column: 13, line: 7 }, + end: { column: 14, line: 7 }, }, }, Punctuator { type: 'Punctuator', value: ':', - range: [163, 164], + range: [170, 171], loc: { - start: { column: 24, line: 6 }, - end: { column: 25, line: 6 }, + start: { column: 14, line: 7 }, + end: { column: 15, line: 7 }, }, }, Identifier { type: 'Identifier', value: 'number', - range: [165, 171], + range: [172, 178], loc: { - start: { column: 26, line: 6 }, - end: { column: 32, line: 6 }, + start: { column: 16, line: 7 }, + end: { column: 22, line: 7 }, }, }, Punctuator { type: 'Punctuator', value: ',', - range: [171, 172], + range: [178, 179], loc: { - start: { column: 32, line: 6 }, - end: { column: 33, line: 6 }, + start: { column: 22, line: 7 }, + end: { column: 23, line: 7 }, }, }, - Keyword { @@ -214,130 +214,140 @@ exports[`AST Fixtures legacy-fixtures namespaces-and-modules nested-internal-mod + type: 'Identifier', value: 'public', - range: [173, 179], + range: [186, 192], loc: { - start: { column: 34, line: 6 }, - end: { column: 40, line: 6 }, + start: { column: 6, line: 8 }, + end: { column: 12, line: 8 }, }, }, Identifier { type: 'Identifier', value: 'y', - range: [180, 181], + range: [193, 194], loc: { - start: { column: 41, line: 6 }, - end: { column: 42, line: 6 }, + start: { column: 13, line: 8 }, + end: { column: 14, line: 8 }, }, }, Punctuator { type: 'Punctuator', value: ':', - range: [181, 182], + range: [194, 195], loc: { - start: { column: 42, line: 6 }, - end: { column: 43, line: 6 }, + start: { column: 14, line: 8 }, + end: { column: 15, line: 8 }, }, }, Identifier { type: 'Identifier', value: 'number', - range: [183, 189], + range: [196, 202], loc: { - start: { column: 44, line: 6 }, - end: { column: 50, line: 6 }, + start: { column: 16, line: 8 }, + end: { column: 22, line: 8 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ',', + + range: [202, 203], + loc: { + start: { column: 22, line: 8 }, + end: { column: 23, line: 8 }, }, }, Punctuator { type: 'Punctuator', value: ')', - range: [189, 190], + range: [208, 209], loc: { - start: { column: 50, line: 6 }, - end: { column: 51, line: 6 }, + start: { column: 4, line: 9 }, + end: { column: 5, line: 9 }, }, }, Punctuator { type: 'Punctuator', value: '{', - range: [191, 192], + range: [210, 211], loc: { - start: { column: 52, line: 6 }, - end: { column: 53, line: 6 }, + start: { column: 6, line: 9 }, + end: { column: 7, line: 9 }, }, }, Punctuator { type: 'Punctuator', value: '}', - range: [192, 193], + range: [211, 212], loc: { - start: { column: 53, line: 6 }, - end: { column: 54, line: 6 }, + start: { column: 7, line: 9 }, + end: { column: 8, line: 9 }, }, }, Punctuator { type: 'Punctuator', value: '}', - range: [196, 197], + range: [215, 216], loc: { - start: { column: 2, line: 7 }, - end: { column: 3, line: 7 }, + start: { column: 2, line: 10 }, + end: { column: 3, line: 10 }, }, }, Keyword { type: 'Keyword', value: 'export', - range: [200, 206], + range: [219, 225], loc: { - start: { column: 2, line: 8 }, - end: { column: 8, line: 8 }, + start: { column: 2, line: 11 }, + end: { column: 8, line: 11 }, }, }, Identifier { type: 'Identifier', value: 'module', - range: [207, 213], + range: [226, 232], loc: { - start: { column: 9, line: 8 }, - end: { column: 15, line: 8 }, + start: { column: 9, line: 11 }, + end: { column: 15, line: 11 }, }, }, Identifier { type: 'Identifier', value: 'B', - range: [214, 215], + range: [233, 234], loc: { - start: { column: 16, line: 8 }, - end: { column: 17, line: 8 }, + start: { column: 16, line: 11 }, + end: { column: 17, line: 11 }, }, }, Punctuator { type: 'Punctuator', value: '{', - range: [216, 217], + range: [235, 236], loc: { - start: { column: 18, line: 8 }, - end: { column: 19, line: 8 }, + start: { column: 18, line: 11 }, + end: { column: 19, line: 11 }, }, }, Keyword { type: 'Keyword', value: 'export', - range: [222, 228], + range: [241, 247], loc: { - start: { column: 4, line: 9 }, - end: { column: 10, line: 9 }, + start: { column: 4, line: 12 }, + end: { column: 10, line: 12 }, }, }, - Keyword { @@ -346,100 +356,100 @@ exports[`AST Fixtures legacy-fixtures namespaces-and-modules nested-internal-mod + type: 'Identifier', value: 'interface', - range: [229, 238], + range: [248, 257], loc: { - start: { column: 11, line: 9 }, - end: { column: 20, line: 9 }, + start: { column: 11, line: 12 }, + end: { column: 20, line: 12 }, }, }, Identifier { type: 'Identifier', value: 'Id', - range: [239, 241], + range: [258, 260], loc: { - start: { column: 21, line: 9 }, - end: { column: 23, line: 9 }, + start: { column: 21, line: 12 }, + end: { column: 23, line: 12 }, }, }, Punctuator { type: 'Punctuator', value: '{', - range: [242, 243], + range: [261, 262], loc: { - start: { column: 24, line: 9 }, - end: { column: 25, line: 9 }, + start: { column: 24, line: 12 }, + end: { column: 25, line: 12 }, }, }, Identifier { type: 'Identifier', value: 'name', - range: [250, 254], + range: [269, 273], loc: { - start: { column: 6, line: 10 }, - end: { column: 10, line: 10 }, + start: { column: 6, line: 13 }, + end: { column: 10, line: 13 }, }, }, Punctuator { type: 'Punctuator', value: ':', - range: [254, 255], + range: [273, 274], loc: { - start: { column: 10, line: 10 }, - end: { column: 11, line: 10 }, + start: { column: 10, line: 13 }, + end: { column: 11, line: 13 }, }, }, Identifier { type: 'Identifier', value: 'string', - range: [256, 262], + range: [275, 281], loc: { - start: { column: 12, line: 10 }, - end: { column: 18, line: 10 }, + start: { column: 12, line: 13 }, + end: { column: 18, line: 13 }, }, }, Punctuator { type: 'Punctuator', value: ';', - range: [262, 263], + range: [281, 282], loc: { - start: { column: 18, line: 10 }, - end: { column: 19, line: 10 }, + start: { column: 18, line: 13 }, + end: { column: 19, line: 13 }, }, }, Punctuator { type: 'Punctuator', value: '}', - range: [268, 269], + range: [287, 288], loc: { - start: { column: 4, line: 11 }, - end: { column: 5, line: 11 }, + start: { column: 4, line: 14 }, + end: { column: 5, line: 14 }, }, }, Punctuator { type: 'Punctuator', value: '}', - range: [272, 273], + range: [291, 292], loc: { - start: { column: 2, line: 12 }, - end: { column: 3, line: 12 }, + start: { column: 2, line: 15 }, + end: { column: 3, line: 15 }, }, }, Punctuator { type: 'Punctuator', value: '}', - range: [274, 275], + range: [293, 294], loc: { - start: { column: 0, line: 13 }, - end: { column: 1, line: 13 }, + start: { column: 0, line: 16 }, + end: { column: 1, line: 16 }, }, }, ]" diff --git a/packages/eslint-plugin-internal/src/rules/plugin-test-formatting.ts b/packages/eslint-plugin-internal/src/rules/plugin-test-formatting.ts index 553a8af71f26..f55b9e96950c 100644 --- a/packages/eslint-plugin-internal/src/rules/plugin-test-formatting.ts +++ b/packages/eslint-plugin-internal/src/rules/plugin-test-formatting.ts @@ -169,8 +169,11 @@ export default createRule({ }) .trimEnd(); // prettier will insert a new line at the end of the code } catch (ex) { - // adapted from https://github.com/prettier/eslint-plugin-prettier/blob/185b1064d3dd674538456fb2fad97fbfcde49e0d/eslint-plugin-prettier.js#L242-L257 - if (!(ex instanceof SyntaxError)) { + // ex instanceof Error is false as of @prettier/sync@0.3.0, as is ex instanceof SyntaxError + if ( + (ex as Partial | undefined)?.constructor?.name !== + 'SyntaxError' + ) { throw ex; } const err = ex as Error & { diff --git a/packages/eslint-plugin-internal/tsconfig.json b/packages/eslint-plugin-internal/tsconfig.json index 12e8b67a5a34..cc78ba59388e 100644 --- a/packages/eslint-plugin-internal/tsconfig.json +++ b/packages/eslint-plugin-internal/tsconfig.json @@ -2,6 +2,7 @@ "extends": "./tsconfig.build.json", "compilerOptions": { "composite": false, + "target": "ES2022", "rootDir": "." }, "include": ["src", "typings", "tests"], diff --git a/packages/eslint-plugin/tests/schema-snapshots/naming-convention.shot b/packages/eslint-plugin/tests/schema-snapshots/naming-convention.shot index 1f360bc55c29..771cbd226f41 100644 --- a/packages/eslint-plugin/tests/schema-snapshots/naming-convention.shot +++ b/packages/eslint-plugin/tests/schema-snapshots/naming-convention.shot @@ -1729,7 +1729,7 @@ type Options = /** Multiple selectors in one config */ filter?: MatchRegexConfig | string; format: FormatOptionsConfig; leadingUnderscore?: UnderscoreOptions; - modifiers?: ('requiresQuotes')[]; + modifiers?: 'requiresQuotes'[]; prefix?: PrefixSuffixConfig; selector: 'enumMember'; suffix?: PrefixSuffixConfig; @@ -1934,7 +1934,7 @@ type Options = /** Multiple selectors in one config */ filter?: MatchRegexConfig | string; format: FormatOptionsConfig; leadingUnderscore?: UnderscoreOptions; - modifiers?: ('unused')[]; + modifiers?: 'unused'[]; prefix?: PrefixSuffixConfig; selector: 'typeParameter'; suffix?: PrefixSuffixConfig; From 9a7c2b2aae7ef5265e7a93e13b19f9075af035c3 Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Tue, 15 Aug 2023 15:50:24 -0400 Subject: [PATCH 4/9] lint --fix ish --- .../tests/eslint-rules/arrow-parens.test.ts | 12 +-- .../tests/rules/default-param-last.test.ts | 58 ++++++++++--- .../explicit-function-return-type.test.ts | 14 +-- .../explicit-module-boundary-types.test.ts | 15 ++-- .../naming-convention.test.ts | 10 ++- .../tests/rules/no-invalid-void-type.test.ts | 2 +- .../no-unnecessary-type-constraint.test.ts | 2 +- .../no-unused-vars/no-unused-vars.test.ts | 17 ++-- .../tests/rules/parameter-properties.test.ts | 85 +++++++++++++++---- 9 files changed, 160 insertions(+), 55 deletions(-) diff --git a/packages/eslint-plugin/tests/eslint-rules/arrow-parens.test.ts b/packages/eslint-plugin/tests/eslint-rules/arrow-parens.test.ts index de6a73e536ca..825eceb29d97 100644 --- a/packages/eslint-plugin/tests/eslint-rules/arrow-parens.test.ts +++ b/packages/eslint-plugin/tests/eslint-rules/arrow-parens.test.ts @@ -12,12 +12,12 @@ ruleTester.run('arrow-parens', rule, { valid: [ // https://github.com/typescript-eslint/typescript-eslint/issues/14 noFormat`const foo = (t) => {};`, - 'const foo = (t) => {};', - 'const foo = (t: T) => {};', + 'const foo = (t) => {};', + 'const foo = (t: T) => {};', 'const foo = ((t: T) => {});', 'const foo = function (t: T) {};', ` -const foo = (bar: any): void => { +const foo = (bar: any): void => { // Do nothing }; `, @@ -26,7 +26,7 @@ const foo = (bar: any): void => { options: ['as-needed'], }, { - code: 'const foo = (t) => {};', + code: 'const foo = (t) => {};', options: ['as-needed'], }, { @@ -34,11 +34,11 @@ const foo = (bar: any): void => { options: ['as-needed'], }, { - code: 'const foo = (t: T) => {};', + code: 'const foo = (t: T) => {};', options: ['as-needed'], }, { - code: 'const foo = (t: T) => ({});', + code: 'const foo = (t: T) => ({});', options: ['as-needed', { requireForBlockBody: true }], }, ], diff --git a/packages/eslint-plugin/tests/rules/default-param-last.test.ts b/packages/eslint-plugin/tests/rules/default-param-last.test.ts index 317434d9d445..c9fbe5c0b339 100644 --- a/packages/eslint-plugin/tests/rules/default-param-last.test.ts +++ b/packages/eslint-plugin/tests/rules/default-param-last.test.ts @@ -60,32 +60,56 @@ class Foo { `, ` class Foo { - constructor(public a: number, protected b: number, private c: number) {} + constructor( + public a: number, + protected b: number, + private c: number, + ) {} } `, ` class Foo { - constructor(public a: number, protected b?: number, private c = 10) {} + constructor( + public a: number, + protected b?: number, + private c = 10, + ) {} } `, ` class Foo { - constructor(public a: number, protected b = 10, private c?: number) {} + constructor( + public a: number, + protected b = 10, + private c?: number, + ) {} } `, ` class Foo { - constructor(a: number, protected b?: number, private c = 0) {} + constructor( + a: number, + protected b?: number, + private c = 0, + ) {} } `, ` class Foo { - constructor(a: number, b?: number, private c = 0) {} + constructor( + a: number, + b?: number, + private c = 0, + ) {} } `, ` class Foo { - constructor(a: number, private b?: number, c = 0) {} + constructor( + a: number, + private b?: number, + c = 0, + ) {} } `, ], @@ -576,7 +600,11 @@ class Foo { { code: ` class Foo { - constructor(public a: number, protected b?: number, private c: number) {} + constructor( + public a: number, + protected b?: number, + private c: number, + ) {} } `, errors: [ @@ -591,7 +619,11 @@ class Foo { { code: ` class Foo { - constructor(public a: number, protected b = 0, private c: number) {} + constructor( + public a: number, + protected b = 0, + private c: number, + ) {} } `, errors: [ @@ -606,7 +638,10 @@ class Foo { { code: ` class Foo { - constructor(public a?: number, private b: number) {} + constructor( + public a?: number, + private b: number, + ) {} } `, errors: [ @@ -621,7 +656,10 @@ class Foo { { code: ` class Foo { - constructor(public a = 0, private b: number) {} + constructor( + public a = 0, + private b: number, + ) {} } `, errors: [ diff --git a/packages/eslint-plugin/tests/rules/explicit-function-return-type.test.ts b/packages/eslint-plugin/tests/rules/explicit-function-return-type.test.ts index d65263a9c023..0036b5f94d90 100644 --- a/packages/eslint-plugin/tests/rules/explicit-function-return-type.test.ts +++ b/packages/eslint-plugin/tests/rules/explicit-function-return-type.test.ts @@ -338,8 +338,8 @@ foo({ }, { code: ` -const func = (value: number) => ({ type: 'X', value } as const); -const func = (value: number) => ({ type: 'X', value } as const); +const func = (value: number) => ({ type: 'X', value }) as const; +const func = (value: number) => ({ type: 'X', value }) as const; const func = (value: number) => x as const; const func = (value: number) => x as const; `, @@ -369,7 +369,7 @@ new Foo(1, () => {}); options: [{ allowFunctionsWithoutTypeParameters: true }], }, { - code: 'const log = (a: A): A => a;', + code: 'const log = (a: A): A => a;', options: [{ allowFunctionsWithoutTypeParameters: true }], }, { @@ -1320,8 +1320,8 @@ const x: HigherOrderType = () => arg1 => arg2 => 'foo'; }, { code: ` -const func = (value: number) => ({ type: 'X', value } as any); -const func = (value: number) => ({ type: 'X', value } as Action); +const func = (value: number) => ({ type: 'X', value }) as any; +const func = (value: number) => ({ type: 'X', value }) as Action; `, options: [ { @@ -1347,7 +1347,7 @@ const func = (value: number) => ({ type: 'X', value } as Action); }, { code: ` -const func = (value: number) => ({ type: 'X', value } as const); +const func = (value: number) => ({ type: 'X', value }) as const; `, options: [ { @@ -1397,7 +1397,7 @@ const func = (value: number) => ({ type: 'X', value } as const); ], }, { - code: 'const log = (a: A) => a;', + code: 'const log = (a: A) => a;', errors: [{ messageId: 'missingReturnType' }], options: [{ allowFunctionsWithoutTypeParameters: true }], }, 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 ce9176c136b4..f3f7a83c7114 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 @@ -334,8 +334,8 @@ new Accumulator().accumulate(() => 1); }, { code: ` -export const func1 = (value: number) => ({ type: 'X', value } as const); -export const func2 = (value: number) => ({ type: 'X', value } as const); +export const func1 = (value: number) => ({ type: 'X', value }) as const; +export const func2 = (value: number) => ({ type: 'X', value }) as const; export const func3 = (value: number) => x as const; export const func4 = (value: number) => x as const; `, @@ -1133,8 +1133,8 @@ export default () => () => { }, { code: ` -export const func1 = (value: number) => ({ type: 'X', value } as any); -export const func2 = (value: number) => ({ type: 'X', value } as Action); +export const func1 = (value: number) => ({ type: 'X', value }) as any; +export const func2 = (value: number) => ({ type: 'X', value }) as Action; `, options: [ { @@ -1160,7 +1160,7 @@ export const func2 = (value: number) => ({ type: 'X', value } as Action); }, { code: ` -export const func = (value: number) => ({ type: 'X', value } as const); +export const func = (value: number) => ({ type: 'X', value }) as const; `, options: [ { @@ -1217,7 +1217,10 @@ export class Test { { code: ` export class Test { - constructor(public foo, private ...bar) {} + constructor( + public foo, + private ...bar, + ) {} } `, errors: [ diff --git a/packages/eslint-plugin/tests/rules/naming-convention/naming-convention.test.ts b/packages/eslint-plugin/tests/rules/naming-convention/naming-convention.test.ts index 75156ebb2ce7..6054d2a646cf 100644 --- a/packages/eslint-plugin/tests/rules/naming-convention/naming-convention.test.ts +++ b/packages/eslint-plugin/tests/rules/naming-convention/naming-convention.test.ts @@ -568,7 +568,10 @@ ruleTester.run('naming-convention', rule, { { code: ` class Ignored { - constructor(private readonly some_name, IgnoredDueToModifiers) {} + constructor( + private readonly some_name, + IgnoredDueToModifiers, + ) {} } `, options: [ @@ -1528,7 +1531,10 @@ ruleTester.run('naming-convention', rule, { { code: ` class Ignored { - constructor(private readonly some_name, IgnoredDueToModifiers) {} + constructor( + private readonly some_name, + IgnoredDueToModifiers, + ) {} } `, options: [ diff --git a/packages/eslint-plugin/tests/rules/no-invalid-void-type.test.ts b/packages/eslint-plugin/tests/rules/no-invalid-void-type.test.ts index 00ba6e4a51f7..7252bd3501c2 100644 --- a/packages/eslint-plugin/tests/rules/no-invalid-void-type.test.ts +++ b/packages/eslint-plugin/tests/rules/no-invalid-void-type.test.ts @@ -120,7 +120,7 @@ ruleTester.run('allowInGenericTypeArguments: true', rule, { 'type Generic = [T];', 'type voidPromiseUnion = void | Promise;', 'type promiseNeverUnion = Promise | never;', - 'const arrowGeneric1 = (arg: T) => {};', + 'const arrowGeneric1 = (arg: T) => {};', 'declare function functionDeclaration1(arg: T): void;', ], invalid: [ diff --git a/packages/eslint-plugin/tests/rules/no-unnecessary-type-constraint.test.ts b/packages/eslint-plugin/tests/rules/no-unnecessary-type-constraint.test.ts index 121378f78fd6..2b1f6841f2c1 100644 --- a/packages/eslint-plugin/tests/rules/no-unnecessary-type-constraint.test.ts +++ b/packages/eslint-plugin/tests/rules/no-unnecessary-type-constraint.test.ts @@ -22,7 +22,7 @@ type TODO = any; function data() {} `, 'const data = () => {};', - 'const data = () => {};', + 'const data = () => {};', 'const data = () => {};', 'const data = () => {};', 'const data = () => {};', diff --git a/packages/eslint-plugin/tests/rules/no-unused-vars/no-unused-vars.test.ts b/packages/eslint-plugin/tests/rules/no-unused-vars/no-unused-vars.test.ts index 2646f3ce55bc..636e2fe8d2c1 100644 --- a/packages/eslint-plugin/tests/rules/no-unused-vars/no-unused-vars.test.ts +++ b/packages/eslint-plugin/tests/rules/no-unused-vars/no-unused-vars.test.ts @@ -147,12 +147,12 @@ bar(); `, ` import { Foo } from 'foo'; -const bar = (): T => {}; +const bar = (): T => {}; bar(); `, ` import { Foo } from 'foo'; -((): T => {})(); +((): T => {})(); `, ` import { Nullable } from 'nullable'; @@ -469,7 +469,10 @@ export class App { `, ` export class App { - constructor(baz: string, private logger: Logger) { + constructor( + baz: string, + private logger: Logger, + ) { console.log(baz); console.log(this.logger); } @@ -477,7 +480,11 @@ export class App { `, ` export class App { - constructor(baz: string, private logger: Logger, private bar: () => void) { + constructor( + baz: string, + private logger: Logger, + private bar: () => void, + ) { console.log(this.logger); this.bar(); } @@ -699,7 +706,7 @@ export namespace Foo { } `, ` -export namespace foo.bar { +namespace foo.bar { export interface User { name: string; } diff --git a/packages/eslint-plugin/tests/rules/parameter-properties.test.ts b/packages/eslint-plugin/tests/rules/parameter-properties.test.ts index 6a60e06ee893..a3e78b80f6d8 100644 --- a/packages/eslint-plugin/tests/rules/parameter-properties.test.ts +++ b/packages/eslint-plugin/tests/rules/parameter-properties.test.ts @@ -96,7 +96,10 @@ class Foo { { code: ` class Foo { - constructor(readonly name: string, private age: number) {} + constructor( + readonly name: string, + private age: number, + ) {} } `, options: [{ allow: ['readonly', 'private'] }], @@ -104,7 +107,10 @@ class Foo { { code: ` class Foo { - constructor(public readonly name: string, private age: number) {} + constructor( + public readonly name: string, + private age: number, + ) {} } `, options: [{ allow: ['public readonly', 'private'] }], @@ -148,7 +154,10 @@ class Foo { { code: ` class Foo { - constructor(private age: string, ...name: string[]) {} + constructor( + private age: string, + ...name: string[] + ) {} } `, options: [{ prefer: 'parameter-property' }], @@ -437,7 +446,10 @@ class Foo { { code: ` class Foo { - constructor(public name: string, age: number) {} + constructor( + public name: string, + age: number, + ) {} } `, errors: [ @@ -454,7 +466,10 @@ class Foo { { code: ` class Foo { - constructor(private name: string, private age: number) {} + constructor( + private name: string, + private age: number, + ) {} } `, errors: [ @@ -479,7 +494,10 @@ class Foo { { code: ` class Foo { - constructor(protected name: string, protected age: number) {} + constructor( + protected name: string, + protected age: number, + ) {} } `, errors: [ @@ -504,7 +522,10 @@ class Foo { { code: ` class Foo { - constructor(public name: string, public age: number) {} + constructor( + public name: string, + public age: number, + ) {} } `, errors: [ @@ -530,7 +551,10 @@ class Foo { code: ` class Foo { constructor(name: string) {} - constructor(private name: string, age?: number) {} + constructor( + private name: string, + age?: number, + ) {} } `, errors: [ @@ -548,7 +572,10 @@ class Foo { code: ` class Foo { constructor(private name: string) {} - constructor(private name: string, age?: number) {} + constructor( + private name: string, + age?: number, + ) {} } `, errors: [ @@ -574,7 +601,10 @@ class Foo { code: ` class Foo { constructor(private name: string) {} - constructor(private name: string, private age?: number) {} + constructor( + private name: string, + private age?: number, + ) {} } `, errors: [ @@ -608,7 +638,10 @@ class Foo { code: ` class Foo { constructor(name: string) {} - constructor(protected name: string, age?: number) {} + constructor( + protected name: string, + age?: number, + ) {} } `, errors: [ @@ -626,7 +659,10 @@ class Foo { code: ` class Foo { constructor(protected name: string) {} - constructor(protected name: string, age?: number) {} + constructor( + protected name: string, + age?: number, + ) {} } `, errors: [ @@ -652,7 +688,10 @@ class Foo { code: ` class Foo { constructor(protected name: string) {} - constructor(protected name: string, protected age?: number) {} + constructor( + protected name: string, + protected age?: number, + ) {} } `, errors: [ @@ -686,7 +725,10 @@ class Foo { code: ` class Foo { constructor(name: string) {} - constructor(public name: string, age?: number) {} + constructor( + public name: string, + age?: number, + ) {} } `, errors: [ @@ -704,7 +746,10 @@ class Foo { code: ` class Foo { constructor(public name: string) {} - constructor(public name: string, age?: number) {} + constructor( + public name: string, + age?: number, + ) {} } `, errors: [ @@ -730,7 +775,10 @@ class Foo { code: ` class Foo { constructor(public name: string) {} - constructor(public name: string, public age?: number) {} + constructor( + public name: string, + public age?: number, + ) {} } `, errors: [ @@ -896,7 +944,10 @@ class Foo { code: ` class Foo { constructor(private name: string) {} - constructor(private name: string, protected age?: number) {} + constructor( + private name: string, + protected age?: number, + ) {} } `, options: [{ allow: ['private'] }], From 32465cc176d16ac55ff6d95698bca5d933ffbed8 Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Thu, 17 Aug 2023 08:57:33 -0400 Subject: [PATCH 5/9] Fixed eslint-plugin tests --- .../tests/rules/default-param-last.test.ts | 24 +++--- .../explicit-module-boundary-types.test.ts | 8 +- .../tests/rules/parameter-properties.test.ts | 80 +++++++++---------- 3 files changed, 56 insertions(+), 56 deletions(-) diff --git a/packages/eslint-plugin/tests/rules/default-param-last.test.ts b/packages/eslint-plugin/tests/rules/default-param-last.test.ts index c9fbe5c0b339..33be682be7c5 100644 --- a/packages/eslint-plugin/tests/rules/default-param-last.test.ts +++ b/packages/eslint-plugin/tests/rules/default-param-last.test.ts @@ -610,9 +610,9 @@ class Foo { errors: [ { messageId: 'shouldBeLast', - line: 3, - column: 33, - endColumn: 53, + line: 5, + column: 5, + endColumn: 25, }, ], }, @@ -629,9 +629,9 @@ class Foo { errors: [ { messageId: 'shouldBeLast', - line: 3, - column: 33, - endColumn: 48, + line: 5, + column: 5, + endColumn: 20, }, ], }, @@ -647,9 +647,9 @@ class Foo { errors: [ { messageId: 'shouldBeLast', - line: 3, - column: 15, - endColumn: 32, + line: 4, + column: 5, + endColumn: 22, }, ], }, @@ -665,9 +665,9 @@ class Foo { errors: [ { messageId: 'shouldBeLast', - line: 3, - column: 15, - endColumn: 27, + line: 4, + column: 5, + endColumn: 17, }, ], }, 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 f3f7a83c7114..8a945ceca631 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 @@ -1226,16 +1226,16 @@ export class Test { errors: [ { messageId: 'missingArgType', - line: 3, - column: 22, + line: 4, + column: 12, data: { name: 'foo', }, }, { messageId: 'missingArgType', - line: 3, - column: 27, + line: 5, + column: 5, data: { name: 'bar', }, diff --git a/packages/eslint-plugin/tests/rules/parameter-properties.test.ts b/packages/eslint-plugin/tests/rules/parameter-properties.test.ts index a3e78b80f6d8..6323a5858bba 100644 --- a/packages/eslint-plugin/tests/rules/parameter-properties.test.ts +++ b/packages/eslint-plugin/tests/rules/parameter-properties.test.ts @@ -458,8 +458,8 @@ class Foo { data: { parameter: 'name', }, - line: 3, - column: 15, + line: 4, + column: 5, }, ], }, @@ -478,16 +478,16 @@ class Foo { data: { parameter: 'name', }, - line: 3, - column: 15, + line: 4, + column: 5, }, { messageId: 'preferClassProperty', data: { parameter: 'age', }, - line: 3, - column: 37, + line: 5, + column: 5, }, ], }, @@ -506,16 +506,16 @@ class Foo { data: { parameter: 'name', }, - line: 3, - column: 15, + line: 4, + column: 5, }, { messageId: 'preferClassProperty', data: { parameter: 'age', }, - line: 3, - column: 39, + line: 5, + column: 5, }, ], }, @@ -534,16 +534,16 @@ class Foo { data: { parameter: 'name', }, - line: 3, - column: 15, + line: 4, + column: 5, }, { messageId: 'preferClassProperty', data: { parameter: 'age', }, - line: 3, - column: 36, + line: 5, + column: 5, }, ], }, @@ -563,8 +563,8 @@ class Foo { data: { parameter: 'name', }, - line: 4, - column: 15, + line: 5, + column: 5, }, ], }, @@ -592,8 +592,8 @@ class Foo { data: { parameter: 'name', }, - line: 4, - column: 15, + line: 5, + column: 5, }, ], }, @@ -621,16 +621,16 @@ class Foo { data: { parameter: 'name', }, - line: 4, - column: 15, + line: 5, + column: 5, }, { messageId: 'preferClassProperty', data: { parameter: 'age', }, - line: 4, - column: 37, + line: 6, + column: 5, }, ], }, @@ -650,8 +650,8 @@ class Foo { data: { parameter: 'name', }, - line: 4, - column: 15, + line: 5, + column: 5, }, ], }, @@ -679,8 +679,8 @@ class Foo { data: { parameter: 'name', }, - line: 4, - column: 15, + line: 5, + column: 5, }, ], }, @@ -708,16 +708,16 @@ class Foo { data: { parameter: 'name', }, - line: 4, - column: 15, + line: 5, + column: 5, }, { messageId: 'preferClassProperty', data: { parameter: 'age', }, - line: 4, - column: 39, + line: 6, + column: 5, }, ], }, @@ -737,8 +737,8 @@ class Foo { data: { parameter: 'name', }, - line: 4, - column: 15, + line: 5, + column: 5, }, ], }, @@ -766,8 +766,8 @@ class Foo { data: { parameter: 'name', }, - line: 4, - column: 15, + line: 5, + column: 5, }, ], }, @@ -795,16 +795,16 @@ class Foo { data: { parameter: 'name', }, - line: 4, - column: 15, + line: 5, + column: 5, }, { messageId: 'preferClassProperty', data: { parameter: 'age', }, - line: 4, - column: 36, + line: 6, + column: 5, }, ], }, @@ -957,8 +957,8 @@ class Foo { data: { parameter: 'age', }, - line: 4, - column: 37, + line: 6, + column: 5, }, ], }, From ca4efd20ef59b02efe781b2d08af5cd6bd6f7839 Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Thu, 17 Aug 2023 15:13:37 -0400 Subject: [PATCH 6/9] 3.0.2 --- package.json | 2 +- .../fixtures/namespace-nested-once-declare/fixture.ts | 2 +- .../namespace-nested-once-export-declare/fixture.ts | 2 +- .../fixtures/namespace-nested-once-export/fixture.ts | 2 +- .../fixtures/namespace-nested-twice-declare/fixture.ts | 2 +- .../namespace-nested-twice-export-declare/fixture.ts | 2 +- .../fixtures/namespace-nested-twice-export/fixture.ts | 2 +- yarn.lock | 7 ++++++- 8 files changed, 13 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index de03b7e720e1..ba57e2094217 100644 --- a/package.json +++ b/package.json @@ -110,7 +110,7 @@ "nx-cloud": "16.1.1", "nx": "16.5.3", "patch-package": "^8.0.0", - "prettier": "^3.0.0", + "prettier": "^3.0.2", "pretty-format": "^29.6.1", "raw-loader": "^4.0.2", "rimraf": "^5.0.1", diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-declare/fixture.ts b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-declare/fixture.ts index e4db463ec8fe..56c4bfb8a217 100644 --- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-declare/fixture.ts +++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-declare/fixture.ts @@ -1 +1 @@ -namespace abd.def {} +declare namespace abd.def {} diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-export-declare/fixture.ts b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-export-declare/fixture.ts index e4db463ec8fe..56c4bfb8a217 100644 --- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-export-declare/fixture.ts +++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-export-declare/fixture.ts @@ -1 +1 @@ -namespace abd.def {} +declare namespace abd.def {} diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-export/fixture.ts b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-export/fixture.ts index e4db463ec8fe..ce4dee7565ff 100644 --- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-export/fixture.ts +++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-export/fixture.ts @@ -1 +1 @@ -namespace abd.def {} +export namespace abd.def {} diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-declare/fixture.ts b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-declare/fixture.ts index aa16edb5ae59..ab821cb92af0 100644 --- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-declare/fixture.ts +++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-declare/fixture.ts @@ -1 +1 @@ -namespace abc.def.ghi {} +declare namespace abc.def.ghi {} diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-export-declare/fixture.ts b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-export-declare/fixture.ts index aa16edb5ae59..7620f0a1fa99 100644 --- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-export-declare/fixture.ts +++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-export-declare/fixture.ts @@ -1 +1 @@ -namespace abc.def.ghi {} +export declare namespace abc.def.ghi {} diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-export/fixture.ts b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-export/fixture.ts index aa16edb5ae59..4f50cefb1012 100644 --- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-export/fixture.ts +++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-export/fixture.ts @@ -1 +1 @@ -namespace abc.def.ghi {} +export namespace abc.def.ghi {} diff --git a/yarn.lock b/yarn.lock index 28a3ea2a6f8b..17f6e97b74df 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12345,11 +12345,16 @@ prepend-http@^2.0.0: resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-2.0.0.tgz#e92434bfa5ea8c19f41cdfd401d741a3c819d897" integrity sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc= -prettier@*, prettier@^3.0.0: +prettier@*: version "3.0.1" resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.0.1.tgz#65271fc9320ce4913c57747a70ce635b30beaa40" integrity sha512-fcOWSnnpCrovBsmFZIGIy9UqK2FaI7Hqax+DIO0A9UxeVoY4iweyaFjS5TavZN97Hfehph0nhsZnjlVKzEQSrQ== +prettier@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.0.2.tgz#78fcecd6d870551aa5547437cdae39d4701dca5b" + integrity sha512-o2YR9qtniXvwEZlOKbveKfDQVyqxbEIWn48Z8m3ZJjBjcCmUy3xZGIv+7AkaeuaTr6yPXJjwv07ZWlsWbEy1rQ== + pretty-bytes@^5.3.0: version "5.6.0" resolved "https://registry.yarnpkg.com/pretty-bytes/-/pretty-bytes-5.6.0.tgz#356256f643804773c82f64723fe78c92c62beaeb" From b3c3fa6822fca7fa8a8779454141646f6a21388b Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Thu, 17 Aug 2023 15:15:33 -0400 Subject: [PATCH 7/9] Corrected prettier/sync dep and snapshots --- package.json | 1 + .../snapshots/1-TSESTree-AST.shot | 32 ++-- .../snapshots/2-TSESTree-Tokens.shot | 46 +++-- .../snapshots/3-Babel-AST.shot | 31 +-- .../snapshots/4-Babel-Tokens.shot | 46 +++-- .../snapshots/5-AST-Alignment-AST.shot | 49 ++--- .../snapshots/1-TSESTree-AST.shot | 32 ++-- .../snapshots/2-TSESTree-Tokens.shot | 46 +++-- .../snapshots/3-Babel-AST.shot | 31 +-- .../snapshots/4-Babel-Tokens.shot | 46 +++-- .../snapshots/5-AST-Alignment-AST.shot | 49 ++--- .../snapshots/1-TSESTree-AST.shot | 93 +++++---- .../snapshots/2-TSESTree-Tokens.shot | 46 +++-- .../snapshots/3-Babel-AST.shot | 73 +++++--- .../snapshots/4-Babel-Tokens.shot | 46 +++-- .../snapshots/5-AST-Alignment-AST.shot | 135 +++++++------ .../snapshots/1-TSESTree-AST.shot | 44 ++--- .../snapshots/2-TSESTree-Tokens.shot | 58 +++--- .../snapshots/3-Babel-AST.shot | 43 ++--- .../snapshots/4-Babel-Tokens.shot | 58 +++--- .../snapshots/5-AST-Alignment-AST.shot | 97 +++++----- .../snapshots/1-TSESTree-AST.shot | 113 ++++++----- .../snapshots/2-TSESTree-Tokens.shot | 68 ++++--- .../snapshots/3-Babel-AST.shot | 86 +++++---- .../snapshots/4-Babel-Tokens.shot | 68 ++++--- .../snapshots/5-AST-Alignment-AST.shot | 177 ++++++++++-------- .../snapshots/1-TSESTree-AST.shot | 113 ++++++----- .../snapshots/2-TSESTree-Tokens.shot | 58 +++--- .../snapshots/3-Babel-AST.shot | 87 +++++---- .../snapshots/4-Babel-Tokens.shot | 58 +++--- .../snapshots/5-AST-Alignment-AST.shot | 175 +++++++++-------- yarn.lock | 2 +- 32 files changed, 1187 insertions(+), 920 deletions(-) diff --git a/package.json b/package.json index ba57e2094217..d651ac5e9282 100644 --- a/package.json +++ b/package.json @@ -64,6 +64,7 @@ "@nx/jest": "16.5.3", "@nx/linter": "16.5.3", "@nx/workspace": "16.5.3", + "@prettier/sync": "^0.3.0", "@swc/core": "^1.3.68", "@swc/jest": "^0.2.26", "@types/babel__code-frame": "^7.0.3", diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-declare/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-declare/snapshots/1-TSESTree-AST.shot index 7ec22fb3a5e4..a17505651b98 100644 --- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-declare/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-declare/snapshots/1-TSESTree-AST.shot @@ -10,13 +10,13 @@ Program { type: "TSModuleBlock", body: [], - range: [18, 20], + range: [26, 28], loc: { - start: { column: 18, line: 1 }, - end: { column: 20, line: 1 }, + start: { column: 26, line: 1 }, + end: { column: 28, line: 1 }, }, }, - declare: false, + declare: true, global: false, id: TSQualifiedName { type: "TSQualifiedName", @@ -26,10 +26,10 @@ Program { name: "abd", optional: false, - range: [10, 13], + range: [18, 21], loc: { - start: { column: 10, line: 1 }, - end: { column: 13, line: 1 }, + start: { column: 18, line: 1 }, + end: { column: 21, line: 1 }, }, }, right: Identifier { @@ -38,31 +38,31 @@ Program { name: "def", optional: false, - range: [14, 17], + range: [22, 25], loc: { - start: { column: 14, line: 1 }, - end: { column: 17, line: 1 }, + start: { column: 22, line: 1 }, + end: { column: 25, line: 1 }, }, }, - range: [10, 17], + range: [18, 25], loc: { - start: { column: 10, line: 1 }, - end: { column: 17, line: 1 }, + start: { column: 18, line: 1 }, + end: { column: 25, line: 1 }, }, }, kind: "namespace", - range: [0, 20], + range: [0, 28], loc: { start: { column: 0, line: 1 }, - end: { column: 20, line: 1 }, + end: { column: 28, line: 1 }, }, }, ], sourceType: "script", - range: [0, 21], + range: [0, 29], loc: { start: { column: 0, line: 1 }, end: { column: 0, line: 2 }, diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-declare/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-declare/snapshots/2-TSESTree-Tokens.shot index af2f03ff202a..8769bf5f46b5 100644 --- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-declare/snapshots/2-TSESTree-Tokens.shot +++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-declare/snapshots/2-TSESTree-Tokens.shot @@ -4,62 +4,72 @@ exports[`AST Fixtures declaration TSModuleDeclaration namespace-nested-once-decl [ Identifier { type: "Identifier", - value: "namespace", + value: "declare", - range: [0, 9], + range: [0, 7], loc: { start: { column: 0, line: 1 }, - end: { column: 9, line: 1 }, + end: { column: 7, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "namespace", + + range: [8, 17], + loc: { + start: { column: 8, line: 1 }, + end: { column: 17, line: 1 }, }, }, Identifier { type: "Identifier", value: "abd", - range: [10, 13], + range: [18, 21], loc: { - start: { column: 10, line: 1 }, - end: { column: 13, line: 1 }, + start: { column: 18, line: 1 }, + end: { column: 21, line: 1 }, }, }, Punctuator { type: "Punctuator", value: ".", - range: [13, 14], + range: [21, 22], loc: { - start: { column: 13, line: 1 }, - end: { column: 14, line: 1 }, + start: { column: 21, line: 1 }, + end: { column: 22, line: 1 }, }, }, Identifier { type: "Identifier", value: "def", - range: [14, 17], + range: [22, 25], loc: { - start: { column: 14, line: 1 }, - end: { column: 17, line: 1 }, + start: { column: 22, line: 1 }, + end: { column: 25, line: 1 }, }, }, Punctuator { type: "Punctuator", value: "{", - range: [18, 19], + range: [26, 27], loc: { - start: { column: 18, line: 1 }, - end: { column: 19, line: 1 }, + start: { column: 26, line: 1 }, + end: { column: 27, line: 1 }, }, }, Punctuator { type: "Punctuator", value: "}", - range: [19, 20], + range: [27, 28], loc: { - start: { column: 19, line: 1 }, - end: { column: 20, line: 1 }, + start: { column: 27, line: 1 }, + end: { column: 28, line: 1 }, }, }, ] diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-declare/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-declare/snapshots/3-Babel-AST.shot index 1efc65bcf8f9..df75ba2eea9b 100644 --- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-declare/snapshots/3-Babel-AST.shot +++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-declare/snapshots/3-Babel-AST.shot @@ -12,50 +12,51 @@ Program { type: "TSModuleBlock", body: [], - range: [18, 20], + range: [26, 28], loc: { - start: { column: 18, line: 1 }, - end: { column: 20, line: 1 }, + start: { column: 26, line: 1 }, + end: { column: 28, line: 1 }, }, }, id: Identifier { type: "Identifier", name: "def", - range: [14, 17], + range: [22, 25], loc: { - start: { column: 14, line: 1 }, - end: { column: 17, line: 1 }, + start: { column: 22, line: 1 }, + end: { column: 25, line: 1 }, }, }, - range: [14, 20], + range: [22, 28], loc: { - start: { column: 14, line: 1 }, - end: { column: 20, line: 1 }, + start: { column: 22, line: 1 }, + end: { column: 28, line: 1 }, }, }, + declare: true, id: Identifier { type: "Identifier", name: "abd", - range: [10, 13], + range: [18, 21], loc: { - start: { column: 10, line: 1 }, - end: { column: 13, line: 1 }, + start: { column: 18, line: 1 }, + end: { column: 21, line: 1 }, }, }, - range: [0, 20], + range: [0, 28], loc: { start: { column: 0, line: 1 }, - end: { column: 20, line: 1 }, + end: { column: 28, line: 1 }, }, }, ], sourceType: "script", - range: [0, 21], + range: [0, 29], loc: { start: { column: 0, line: 1 }, end: { column: 0, line: 2 }, diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-declare/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-declare/snapshots/4-Babel-Tokens.shot index 764dcbb1512c..be0128d5d6fe 100644 --- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-declare/snapshots/4-Babel-Tokens.shot +++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-declare/snapshots/4-Babel-Tokens.shot @@ -4,62 +4,72 @@ exports[`AST Fixtures declaration TSModuleDeclaration namespace-nested-once-decl [ Identifier { type: "Identifier", - value: "namespace", + value: "declare", - range: [0, 9], + range: [0, 7], loc: { start: { column: 0, line: 1 }, - end: { column: 9, line: 1 }, + end: { column: 7, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "namespace", + + range: [8, 17], + loc: { + start: { column: 8, line: 1 }, + end: { column: 17, line: 1 }, }, }, Identifier { type: "Identifier", value: "abd", - range: [10, 13], + range: [18, 21], loc: { - start: { column: 10, line: 1 }, - end: { column: 13, line: 1 }, + start: { column: 18, line: 1 }, + end: { column: 21, line: 1 }, }, }, Punctuator { type: "Punctuator", value: ".", - range: [13, 14], + range: [21, 22], loc: { - start: { column: 13, line: 1 }, - end: { column: 14, line: 1 }, + start: { column: 21, line: 1 }, + end: { column: 22, line: 1 }, }, }, Identifier { type: "Identifier", value: "def", - range: [14, 17], + range: [22, 25], loc: { - start: { column: 14, line: 1 }, - end: { column: 17, line: 1 }, + start: { column: 22, line: 1 }, + end: { column: 25, line: 1 }, }, }, Punctuator { type: "Punctuator", value: "{", - range: [18, 19], + range: [26, 27], loc: { - start: { column: 18, line: 1 }, - end: { column: 19, line: 1 }, + start: { column: 26, line: 1 }, + end: { column: 27, line: 1 }, }, }, Punctuator { type: "Punctuator", value: "}", - range: [19, 20], + range: [27, 28], loc: { - start: { column: 19, line: 1 }, - end: { column: 20, line: 1 }, + start: { column: 27, line: 1 }, + end: { column: 28, line: 1 }, }, }, ] diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-declare/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-declare/snapshots/5-AST-Alignment-AST.shot index 82b507e93169..26c71097e831 100644 --- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-declare/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-declare/snapshots/5-AST-Alignment-AST.shot @@ -14,13 +14,13 @@ exports[`AST Fixtures declaration TSModuleDeclaration namespace-nested-once-decl - type: 'TSModuleBlock', - body: Array [], - -- range: [18, 20], +- range: [26, 28], - loc: { -- start: { column: 18, line: 1 }, -- end: { column: 20, line: 1 }, +- start: { column: 26, line: 1 }, +- end: { column: 28, line: 1 }, - }, - }, -- declare: false, +- declare: true, - global: false, - id: TSQualifiedName { - type: 'TSQualifiedName', @@ -35,13 +35,13 @@ exports[`AST Fixtures declaration TSModuleDeclaration namespace-nested-once-decl + type: 'TSModuleBlock', + body: Array [], -- range: [10, 13], -+ range: [18, 20], +- range: [18, 21], ++ range: [26, 28], loc: { -- start: { column: 10, line: 1 }, -- end: { column: 13, line: 1 }, -+ start: { column: 18, line: 1 }, -+ end: { column: 20, line: 1 }, +- start: { column: 18, line: 1 }, +- end: { column: 21, line: 1 }, ++ start: { column: 26, line: 1 }, ++ end: { column: 28, line: 1 }, }, }, - right: Identifier { @@ -51,43 +51,44 @@ exports[`AST Fixtures declaration TSModuleDeclaration namespace-nested-once-decl name: 'def', - optional: false, - range: [14, 17], + range: [22, 25], loc: { - start: { column: 14, line: 1 }, - end: { column: 17, line: 1 }, + start: { column: 22, line: 1 }, + end: { column: 25, line: 1 }, }, }, -- range: [10, 17], -+ range: [14, 20], +- range: [18, 25], ++ range: [22, 28], + loc: { -+ start: { column: 14, line: 1 }, -+ end: { column: 20, line: 1 }, ++ start: { column: 22, line: 1 }, ++ end: { column: 28, line: 1 }, + }, + }, ++ declare: true, + id: Identifier { + type: 'Identifier', + name: 'abd', + -+ range: [10, 13], ++ range: [18, 21], loc: { - start: { column: 10, line: 1 }, -- end: { column: 17, line: 1 }, -+ end: { column: 13, line: 1 }, + start: { column: 18, line: 1 }, +- end: { column: 25, line: 1 }, ++ end: { column: 21, line: 1 }, }, }, - kind: 'namespace', - range: [0, 20], + range: [0, 28], loc: { start: { column: 0, line: 1 }, - end: { column: 20, line: 1 }, + end: { column: 28, line: 1 }, }, }, ], sourceType: 'script', - range: [0, 21], + range: [0, 29], loc: { start: { column: 0, line: 1 }, end: { column: 0, line: 2 }, diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-export-declare/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-export-declare/snapshots/1-TSESTree-AST.shot index 2f57c85523d2..fefe4f69faf0 100644 --- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-export-declare/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-export-declare/snapshots/1-TSESTree-AST.shot @@ -10,13 +10,13 @@ Program { type: "TSModuleBlock", body: [], - range: [18, 20], + range: [26, 28], loc: { - start: { column: 18, line: 1 }, - end: { column: 20, line: 1 }, + start: { column: 26, line: 1 }, + end: { column: 28, line: 1 }, }, }, - declare: false, + declare: true, global: false, id: TSQualifiedName { type: "TSQualifiedName", @@ -26,10 +26,10 @@ Program { name: "abd", optional: false, - range: [10, 13], + range: [18, 21], loc: { - start: { column: 10, line: 1 }, - end: { column: 13, line: 1 }, + start: { column: 18, line: 1 }, + end: { column: 21, line: 1 }, }, }, right: Identifier { @@ -38,31 +38,31 @@ Program { name: "def", optional: false, - range: [14, 17], + range: [22, 25], loc: { - start: { column: 14, line: 1 }, - end: { column: 17, line: 1 }, + start: { column: 22, line: 1 }, + end: { column: 25, line: 1 }, }, }, - range: [10, 17], + range: [18, 25], loc: { - start: { column: 10, line: 1 }, - end: { column: 17, line: 1 }, + start: { column: 18, line: 1 }, + end: { column: 25, line: 1 }, }, }, kind: "namespace", - range: [0, 20], + range: [0, 28], loc: { start: { column: 0, line: 1 }, - end: { column: 20, line: 1 }, + end: { column: 28, line: 1 }, }, }, ], sourceType: "script", - range: [0, 21], + range: [0, 29], loc: { start: { column: 0, line: 1 }, end: { column: 0, line: 2 }, diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-export-declare/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-export-declare/snapshots/2-TSESTree-Tokens.shot index 6c6f235df6f2..a5081116fc4f 100644 --- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-export-declare/snapshots/2-TSESTree-Tokens.shot +++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-export-declare/snapshots/2-TSESTree-Tokens.shot @@ -4,62 +4,72 @@ exports[`AST Fixtures declaration TSModuleDeclaration namespace-nested-once-expo [ Identifier { type: "Identifier", - value: "namespace", + value: "declare", - range: [0, 9], + range: [0, 7], loc: { start: { column: 0, line: 1 }, - end: { column: 9, line: 1 }, + end: { column: 7, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "namespace", + + range: [8, 17], + loc: { + start: { column: 8, line: 1 }, + end: { column: 17, line: 1 }, }, }, Identifier { type: "Identifier", value: "abd", - range: [10, 13], + range: [18, 21], loc: { - start: { column: 10, line: 1 }, - end: { column: 13, line: 1 }, + start: { column: 18, line: 1 }, + end: { column: 21, line: 1 }, }, }, Punctuator { type: "Punctuator", value: ".", - range: [13, 14], + range: [21, 22], loc: { - start: { column: 13, line: 1 }, - end: { column: 14, line: 1 }, + start: { column: 21, line: 1 }, + end: { column: 22, line: 1 }, }, }, Identifier { type: "Identifier", value: "def", - range: [14, 17], + range: [22, 25], loc: { - start: { column: 14, line: 1 }, - end: { column: 17, line: 1 }, + start: { column: 22, line: 1 }, + end: { column: 25, line: 1 }, }, }, Punctuator { type: "Punctuator", value: "{", - range: [18, 19], + range: [26, 27], loc: { - start: { column: 18, line: 1 }, - end: { column: 19, line: 1 }, + start: { column: 26, line: 1 }, + end: { column: 27, line: 1 }, }, }, Punctuator { type: "Punctuator", value: "}", - range: [19, 20], + range: [27, 28], loc: { - start: { column: 19, line: 1 }, - end: { column: 20, line: 1 }, + start: { column: 27, line: 1 }, + end: { column: 28, line: 1 }, }, }, ] diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-export-declare/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-export-declare/snapshots/3-Babel-AST.shot index cb7d94b164c6..eebbcb70adb1 100644 --- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-export-declare/snapshots/3-Babel-AST.shot +++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-export-declare/snapshots/3-Babel-AST.shot @@ -12,50 +12,51 @@ Program { type: "TSModuleBlock", body: [], - range: [18, 20], + range: [26, 28], loc: { - start: { column: 18, line: 1 }, - end: { column: 20, line: 1 }, + start: { column: 26, line: 1 }, + end: { column: 28, line: 1 }, }, }, id: Identifier { type: "Identifier", name: "def", - range: [14, 17], + range: [22, 25], loc: { - start: { column: 14, line: 1 }, - end: { column: 17, line: 1 }, + start: { column: 22, line: 1 }, + end: { column: 25, line: 1 }, }, }, - range: [14, 20], + range: [22, 28], loc: { - start: { column: 14, line: 1 }, - end: { column: 20, line: 1 }, + start: { column: 22, line: 1 }, + end: { column: 28, line: 1 }, }, }, + declare: true, id: Identifier { type: "Identifier", name: "abd", - range: [10, 13], + range: [18, 21], loc: { - start: { column: 10, line: 1 }, - end: { column: 13, line: 1 }, + start: { column: 18, line: 1 }, + end: { column: 21, line: 1 }, }, }, - range: [0, 20], + range: [0, 28], loc: { start: { column: 0, line: 1 }, - end: { column: 20, line: 1 }, + end: { column: 28, line: 1 }, }, }, ], sourceType: "script", - range: [0, 21], + range: [0, 29], loc: { start: { column: 0, line: 1 }, end: { column: 0, line: 2 }, diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-export-declare/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-export-declare/snapshots/4-Babel-Tokens.shot index 85a0e9791811..a2a9ddd576d8 100644 --- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-export-declare/snapshots/4-Babel-Tokens.shot +++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-export-declare/snapshots/4-Babel-Tokens.shot @@ -4,62 +4,72 @@ exports[`AST Fixtures declaration TSModuleDeclaration namespace-nested-once-expo [ Identifier { type: "Identifier", - value: "namespace", + value: "declare", - range: [0, 9], + range: [0, 7], loc: { start: { column: 0, line: 1 }, - end: { column: 9, line: 1 }, + end: { column: 7, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "namespace", + + range: [8, 17], + loc: { + start: { column: 8, line: 1 }, + end: { column: 17, line: 1 }, }, }, Identifier { type: "Identifier", value: "abd", - range: [10, 13], + range: [18, 21], loc: { - start: { column: 10, line: 1 }, - end: { column: 13, line: 1 }, + start: { column: 18, line: 1 }, + end: { column: 21, line: 1 }, }, }, Punctuator { type: "Punctuator", value: ".", - range: [13, 14], + range: [21, 22], loc: { - start: { column: 13, line: 1 }, - end: { column: 14, line: 1 }, + start: { column: 21, line: 1 }, + end: { column: 22, line: 1 }, }, }, Identifier { type: "Identifier", value: "def", - range: [14, 17], + range: [22, 25], loc: { - start: { column: 14, line: 1 }, - end: { column: 17, line: 1 }, + start: { column: 22, line: 1 }, + end: { column: 25, line: 1 }, }, }, Punctuator { type: "Punctuator", value: "{", - range: [18, 19], + range: [26, 27], loc: { - start: { column: 18, line: 1 }, - end: { column: 19, line: 1 }, + start: { column: 26, line: 1 }, + end: { column: 27, line: 1 }, }, }, Punctuator { type: "Punctuator", value: "}", - range: [19, 20], + range: [27, 28], loc: { - start: { column: 19, line: 1 }, - end: { column: 20, line: 1 }, + start: { column: 27, line: 1 }, + end: { column: 28, line: 1 }, }, }, ] diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-export-declare/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-export-declare/snapshots/5-AST-Alignment-AST.shot index bd63b4012d73..c6c7a44f6b38 100644 --- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-export-declare/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-export-declare/snapshots/5-AST-Alignment-AST.shot @@ -14,13 +14,13 @@ exports[`AST Fixtures declaration TSModuleDeclaration namespace-nested-once-expo - type: 'TSModuleBlock', - body: Array [], - -- range: [18, 20], +- range: [26, 28], - loc: { -- start: { column: 18, line: 1 }, -- end: { column: 20, line: 1 }, +- start: { column: 26, line: 1 }, +- end: { column: 28, line: 1 }, - }, - }, -- declare: false, +- declare: true, - global: false, - id: TSQualifiedName { - type: 'TSQualifiedName', @@ -35,13 +35,13 @@ exports[`AST Fixtures declaration TSModuleDeclaration namespace-nested-once-expo + type: 'TSModuleBlock', + body: Array [], -- range: [10, 13], -+ range: [18, 20], +- range: [18, 21], ++ range: [26, 28], loc: { -- start: { column: 10, line: 1 }, -- end: { column: 13, line: 1 }, -+ start: { column: 18, line: 1 }, -+ end: { column: 20, line: 1 }, +- start: { column: 18, line: 1 }, +- end: { column: 21, line: 1 }, ++ start: { column: 26, line: 1 }, ++ end: { column: 28, line: 1 }, }, }, - right: Identifier { @@ -51,43 +51,44 @@ exports[`AST Fixtures declaration TSModuleDeclaration namespace-nested-once-expo name: 'def', - optional: false, - range: [14, 17], + range: [22, 25], loc: { - start: { column: 14, line: 1 }, - end: { column: 17, line: 1 }, + start: { column: 22, line: 1 }, + end: { column: 25, line: 1 }, }, }, -- range: [10, 17], -+ range: [14, 20], +- range: [18, 25], ++ range: [22, 28], + loc: { -+ start: { column: 14, line: 1 }, -+ end: { column: 20, line: 1 }, ++ start: { column: 22, line: 1 }, ++ end: { column: 28, line: 1 }, + }, + }, ++ declare: true, + id: Identifier { + type: 'Identifier', + name: 'abd', + -+ range: [10, 13], ++ range: [18, 21], loc: { - start: { column: 10, line: 1 }, -- end: { column: 17, line: 1 }, -+ end: { column: 13, line: 1 }, + start: { column: 18, line: 1 }, +- end: { column: 25, line: 1 }, ++ end: { column: 21, line: 1 }, }, }, - kind: 'namespace', - range: [0, 20], + range: [0, 28], loc: { start: { column: 0, line: 1 }, - end: { column: 20, line: 1 }, + end: { column: 28, line: 1 }, }, }, ], sourceType: 'script', - range: [0, 21], + range: [0, 29], loc: { start: { column: 0, line: 1 }, end: { column: 0, line: 2 }, diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-export/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-export/snapshots/1-TSESTree-AST.shot index 2d5c92dfb62c..d8b2ef582c99 100644 --- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-export/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-export/snapshots/1-TSESTree-AST.shot @@ -4,65 +4,78 @@ exports[`AST Fixtures declaration TSModuleDeclaration namespace-nested-once-expo Program { type: "Program", body: [ - TSModuleDeclaration { - type: "TSModuleDeclaration", - body: TSModuleBlock { - type: "TSModuleBlock", - body: [], + ExportNamedDeclaration { + type: "ExportNamedDeclaration", + assertions: [], + declaration: TSModuleDeclaration { + type: "TSModuleDeclaration", + body: TSModuleBlock { + type: "TSModuleBlock", + body: [], - range: [18, 20], - loc: { - start: { column: 18, line: 1 }, - end: { column: 20, line: 1 }, - }, - }, - declare: false, - global: false, - id: TSQualifiedName { - type: "TSQualifiedName", - left: Identifier { - type: "Identifier", - decorators: [], - name: "abd", - optional: false, - - range: [10, 13], + range: [25, 27], loc: { - start: { column: 10, line: 1 }, - end: { column: 13, line: 1 }, + start: { column: 25, line: 1 }, + end: { column: 27, line: 1 }, }, }, - right: Identifier { - type: "Identifier", - decorators: [], - name: "def", - optional: false, + declare: false, + global: false, + id: TSQualifiedName { + type: "TSQualifiedName", + left: Identifier { + type: "Identifier", + decorators: [], + name: "abd", + optional: false, + + range: [17, 20], + loc: { + start: { column: 17, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + right: Identifier { + type: "Identifier", + decorators: [], + name: "def", + optional: false, + + range: [21, 24], + loc: { + start: { column: 21, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, - range: [14, 17], + range: [17, 24], loc: { - start: { column: 14, line: 1 }, - end: { column: 17, line: 1 }, + start: { column: 17, line: 1 }, + end: { column: 24, line: 1 }, }, }, + kind: "namespace", - range: [10, 17], + range: [7, 27], loc: { - start: { column: 10, line: 1 }, - end: { column: 17, line: 1 }, + start: { column: 7, line: 1 }, + end: { column: 27, line: 1 }, }, }, - kind: "namespace", + exportKind: "value", + source: null, + specifiers: [], - range: [0, 20], + range: [0, 27], loc: { start: { column: 0, line: 1 }, - end: { column: 20, line: 1 }, + end: { column: 27, line: 1 }, }, }, ], - sourceType: "script", + sourceType: "module", - range: [0, 21], + range: [0, 28], loc: { start: { column: 0, line: 1 }, end: { column: 0, line: 2 }, diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-export/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-export/snapshots/2-TSESTree-Tokens.shot index 8f044e487680..04c548168627 100644 --- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-export/snapshots/2-TSESTree-Tokens.shot +++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-export/snapshots/2-TSESTree-Tokens.shot @@ -2,64 +2,74 @@ exports[`AST Fixtures declaration TSModuleDeclaration namespace-nested-once-export TSESTree - Tokens 1`] = ` [ + Keyword { + type: "Keyword", + value: "export", + + range: [0, 6], + loc: { + start: { column: 0, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, Identifier { type: "Identifier", value: "namespace", - range: [0, 9], + range: [7, 16], loc: { - start: { column: 0, line: 1 }, - end: { column: 9, line: 1 }, + start: { column: 7, line: 1 }, + end: { column: 16, line: 1 }, }, }, Identifier { type: "Identifier", value: "abd", - range: [10, 13], + range: [17, 20], loc: { - start: { column: 10, line: 1 }, - end: { column: 13, line: 1 }, + start: { column: 17, line: 1 }, + end: { column: 20, line: 1 }, }, }, Punctuator { type: "Punctuator", value: ".", - range: [13, 14], + range: [20, 21], loc: { - start: { column: 13, line: 1 }, - end: { column: 14, line: 1 }, + start: { column: 20, line: 1 }, + end: { column: 21, line: 1 }, }, }, Identifier { type: "Identifier", value: "def", - range: [14, 17], + range: [21, 24], loc: { - start: { column: 14, line: 1 }, - end: { column: 17, line: 1 }, + start: { column: 21, line: 1 }, + end: { column: 24, line: 1 }, }, }, Punctuator { type: "Punctuator", value: "{", - range: [18, 19], + range: [25, 26], loc: { - start: { column: 18, line: 1 }, - end: { column: 19, line: 1 }, + start: { column: 25, line: 1 }, + end: { column: 26, line: 1 }, }, }, Punctuator { type: "Punctuator", value: "}", - range: [19, 20], + range: [26, 27], loc: { - start: { column: 19, line: 1 }, - end: { column: 20, line: 1 }, + start: { column: 26, line: 1 }, + end: { column: 27, line: 1 }, }, }, ] diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-export/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-export/snapshots/3-Babel-AST.shot index fd3f89f94fed..969e672365c7 100644 --- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-export/snapshots/3-Babel-AST.shot +++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-export/snapshots/3-Babel-AST.shot @@ -4,58 +4,71 @@ exports[`AST Fixtures declaration TSModuleDeclaration namespace-nested-once-expo Program { type: "Program", body: [ - TSModuleDeclaration { - type: "TSModuleDeclaration", - body: TSModuleDeclaration { + ExportNamedDeclaration { + type: "ExportNamedDeclaration", + assertions: [], + declaration: TSModuleDeclaration { type: "TSModuleDeclaration", - body: TSModuleBlock { - type: "TSModuleBlock", - body: [], + body: TSModuleDeclaration { + type: "TSModuleDeclaration", + body: TSModuleBlock { + type: "TSModuleBlock", + body: [], - range: [18, 20], + range: [25, 27], + loc: { + start: { column: 25, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "def", + + range: [21, 24], + loc: { + start: { column: 21, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, + + range: [21, 27], loc: { - start: { column: 18, line: 1 }, - end: { column: 20, line: 1 }, + start: { column: 21, line: 1 }, + end: { column: 27, line: 1 }, }, }, id: Identifier { type: "Identifier", - name: "def", + name: "abd", - range: [14, 17], + range: [17, 20], loc: { - start: { column: 14, line: 1 }, - end: { column: 17, line: 1 }, + start: { column: 17, line: 1 }, + end: { column: 20, line: 1 }, }, }, - range: [14, 20], - loc: { - start: { column: 14, line: 1 }, - end: { column: 20, line: 1 }, - }, - }, - id: Identifier { - type: "Identifier", - name: "abd", - - range: [10, 13], + range: [7, 27], loc: { - start: { column: 10, line: 1 }, - end: { column: 13, line: 1 }, + start: { column: 7, line: 1 }, + end: { column: 27, line: 1 }, }, }, + exportKind: "value", + source: null, + specifiers: [], - range: [0, 20], + range: [0, 27], loc: { start: { column: 0, line: 1 }, - end: { column: 20, line: 1 }, + end: { column: 27, line: 1 }, }, }, ], - sourceType: "script", + sourceType: "module", - range: [0, 21], + range: [0, 28], loc: { start: { column: 0, line: 1 }, end: { column: 0, line: 2 }, diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-export/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-export/snapshots/4-Babel-Tokens.shot index 2af335b020c7..8eecdd08473d 100644 --- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-export/snapshots/4-Babel-Tokens.shot +++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-export/snapshots/4-Babel-Tokens.shot @@ -2,64 +2,74 @@ exports[`AST Fixtures declaration TSModuleDeclaration namespace-nested-once-export Babel - Tokens 1`] = ` [ + Keyword { + type: "Keyword", + value: "export", + + range: [0, 6], + loc: { + start: { column: 0, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, Identifier { type: "Identifier", value: "namespace", - range: [0, 9], + range: [7, 16], loc: { - start: { column: 0, line: 1 }, - end: { column: 9, line: 1 }, + start: { column: 7, line: 1 }, + end: { column: 16, line: 1 }, }, }, Identifier { type: "Identifier", value: "abd", - range: [10, 13], + range: [17, 20], loc: { - start: { column: 10, line: 1 }, - end: { column: 13, line: 1 }, + start: { column: 17, line: 1 }, + end: { column: 20, line: 1 }, }, }, Punctuator { type: "Punctuator", value: ".", - range: [13, 14], + range: [20, 21], loc: { - start: { column: 13, line: 1 }, - end: { column: 14, line: 1 }, + start: { column: 20, line: 1 }, + end: { column: 21, line: 1 }, }, }, Identifier { type: "Identifier", value: "def", - range: [14, 17], + range: [21, 24], loc: { - start: { column: 14, line: 1 }, - end: { column: 17, line: 1 }, + start: { column: 21, line: 1 }, + end: { column: 24, line: 1 }, }, }, Punctuator { type: "Punctuator", value: "{", - range: [18, 19], + range: [25, 26], loc: { - start: { column: 18, line: 1 }, - end: { column: 19, line: 1 }, + start: { column: 25, line: 1 }, + end: { column: 26, line: 1 }, }, }, Punctuator { type: "Punctuator", value: "}", - range: [19, 20], + range: [26, 27], loc: { - start: { column: 19, line: 1 }, - end: { column: 20, line: 1 }, + start: { column: 26, line: 1 }, + end: { column: 27, line: 1 }, }, }, ] diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-export/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-export/snapshots/5-AST-Alignment-AST.shot index 7c6db3a4e911..84f061a5ebde 100644 --- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-export/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-once-export/snapshots/5-AST-Alignment-AST.shot @@ -8,86 +8,99 @@ exports[`AST Fixtures declaration TSModuleDeclaration namespace-nested-once-expo Program { type: 'Program', body: Array [ - TSModuleDeclaration { - type: 'TSModuleDeclaration', -- body: TSModuleBlock { -- type: 'TSModuleBlock', -- body: Array [], + ExportNamedDeclaration { + type: 'ExportNamedDeclaration', + assertions: Array [], + declaration: TSModuleDeclaration { + type: 'TSModuleDeclaration', +- body: TSModuleBlock { +- type: 'TSModuleBlock', +- body: Array [], - -- range: [18, 20], -- loc: { -- start: { column: 18, line: 1 }, -- end: { column: 20, line: 1 }, +- range: [25, 27], +- loc: { +- start: { column: 25, line: 1 }, +- end: { column: 27, line: 1 }, +- }, - }, -- }, -- declare: false, -- global: false, -- id: TSQualifiedName { -- type: 'TSQualifiedName', -- left: Identifier { -- type: 'Identifier', -- decorators: Array [], -- name: 'abd', -- optional: false, -+ body: TSModuleDeclaration { -+ type: 'TSModuleDeclaration', -+ body: TSModuleBlock { -+ type: 'TSModuleBlock', -+ body: Array [], +- declare: false, +- global: false, +- id: TSQualifiedName { +- type: 'TSQualifiedName', +- left: Identifier { +- type: 'Identifier', +- decorators: Array [], +- name: 'abd', +- optional: false, ++ body: TSModuleDeclaration { ++ type: 'TSModuleDeclaration', ++ body: TSModuleBlock { ++ type: 'TSModuleBlock', ++ body: Array [], -- range: [10, 13], -+ range: [18, 20], - loc: { -- start: { column: 10, line: 1 }, -- end: { column: 13, line: 1 }, -+ start: { column: 18, line: 1 }, -+ end: { column: 20, line: 1 }, +- range: [17, 20], ++ range: [25, 27], + loc: { +- start: { column: 17, line: 1 }, +- end: { column: 20, line: 1 }, ++ start: { column: 25, line: 1 }, ++ end: { column: 27, line: 1 }, + }, }, - }, -- right: Identifier { -+ id: Identifier { - type: 'Identifier', -- decorators: Array [], - name: 'def', -- optional: false, +- right: Identifier { ++ id: Identifier { + type: 'Identifier', +- decorators: Array [], + name: 'def', +- optional: false, - range: [14, 17], - loc: { - start: { column: 14, line: 1 }, - end: { column: 17, line: 1 }, + range: [21, 24], + loc: { + start: { column: 21, line: 1 }, + end: { column: 24, line: 1 }, + }, }, - }, -- range: [10, 17], -+ range: [14, 20], -+ loc: { -+ start: { column: 14, line: 1 }, -+ end: { column: 20, line: 1 }, +- range: [17, 24], ++ range: [21, 27], ++ loc: { ++ start: { column: 21, line: 1 }, ++ end: { column: 27, line: 1 }, ++ }, + }, -+ }, -+ id: Identifier { -+ type: 'Identifier', -+ name: 'abd', ++ id: Identifier { ++ type: 'Identifier', ++ name: 'abd', + -+ range: [10, 13], ++ range: [17, 20], + loc: { + start: { column: 17, line: 1 }, +- end: { column: 24, line: 1 }, ++ end: { column: 20, line: 1 }, + }, + }, +- kind: 'namespace', + + range: [7, 27], loc: { - start: { column: 10, line: 1 }, -- end: { column: 17, line: 1 }, -+ end: { column: 13, line: 1 }, + start: { column: 7, line: 1 }, + end: { column: 27, line: 1 }, }, }, -- kind: 'namespace', + exportKind: 'value', + source: null, + specifiers: Array [], - range: [0, 20], + range: [0, 27], loc: { start: { column: 0, line: 1 }, - end: { column: 20, line: 1 }, + end: { column: 27, line: 1 }, }, }, ], - sourceType: 'script', + sourceType: 'module', - range: [0, 21], + range: [0, 28], loc: { start: { column: 0, line: 1 }, end: { column: 0, line: 2 }, diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-declare/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-declare/snapshots/1-TSESTree-AST.shot index 6defb2e2c587..bc92ba905b7e 100644 --- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-declare/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-declare/snapshots/1-TSESTree-AST.shot @@ -10,13 +10,13 @@ Program { type: "TSModuleBlock", body: [], - range: [22, 24], + range: [30, 32], loc: { - start: { column: 22, line: 1 }, - end: { column: 24, line: 1 }, + start: { column: 30, line: 1 }, + end: { column: 32, line: 1 }, }, }, - declare: false, + declare: true, global: false, id: TSQualifiedName { type: "TSQualifiedName", @@ -28,10 +28,10 @@ Program { name: "abc", optional: false, - range: [10, 13], + range: [18, 21], loc: { - start: { column: 10, line: 1 }, - end: { column: 13, line: 1 }, + start: { column: 18, line: 1 }, + end: { column: 21, line: 1 }, }, }, right: Identifier { @@ -40,17 +40,17 @@ Program { name: "def", optional: false, - range: [14, 17], + range: [22, 25], loc: { - start: { column: 14, line: 1 }, - end: { column: 17, line: 1 }, + start: { column: 22, line: 1 }, + end: { column: 25, line: 1 }, }, }, - range: [10, 17], + range: [18, 25], loc: { - start: { column: 10, line: 1 }, - end: { column: 17, line: 1 }, + start: { column: 18, line: 1 }, + end: { column: 25, line: 1 }, }, }, right: Identifier { @@ -59,31 +59,31 @@ Program { name: "ghi", optional: false, - range: [18, 21], + range: [26, 29], loc: { - start: { column: 18, line: 1 }, - end: { column: 21, line: 1 }, + start: { column: 26, line: 1 }, + end: { column: 29, line: 1 }, }, }, - range: [10, 21], + range: [18, 29], loc: { - start: { column: 10, line: 1 }, - end: { column: 21, line: 1 }, + start: { column: 18, line: 1 }, + end: { column: 29, line: 1 }, }, }, kind: "namespace", - range: [0, 24], + range: [0, 32], loc: { start: { column: 0, line: 1 }, - end: { column: 24, line: 1 }, + end: { column: 32, line: 1 }, }, }, ], sourceType: "script", - range: [0, 25], + range: [0, 33], loc: { start: { column: 0, line: 1 }, end: { column: 0, line: 2 }, diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-declare/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-declare/snapshots/2-TSESTree-Tokens.shot index 651beb82f3ad..b9d36f117910 100644 --- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-declare/snapshots/2-TSESTree-Tokens.shot +++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-declare/snapshots/2-TSESTree-Tokens.shot @@ -4,82 +4,92 @@ exports[`AST Fixtures declaration TSModuleDeclaration namespace-nested-twice-dec [ Identifier { type: "Identifier", - value: "namespace", + value: "declare", - range: [0, 9], + range: [0, 7], loc: { start: { column: 0, line: 1 }, - end: { column: 9, line: 1 }, + end: { column: 7, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "namespace", + + range: [8, 17], + loc: { + start: { column: 8, line: 1 }, + end: { column: 17, line: 1 }, }, }, Identifier { type: "Identifier", value: "abc", - range: [10, 13], + range: [18, 21], loc: { - start: { column: 10, line: 1 }, - end: { column: 13, line: 1 }, + start: { column: 18, line: 1 }, + end: { column: 21, line: 1 }, }, }, Punctuator { type: "Punctuator", value: ".", - range: [13, 14], + range: [21, 22], loc: { - start: { column: 13, line: 1 }, - end: { column: 14, line: 1 }, + start: { column: 21, line: 1 }, + end: { column: 22, line: 1 }, }, }, Identifier { type: "Identifier", value: "def", - range: [14, 17], + range: [22, 25], loc: { - start: { column: 14, line: 1 }, - end: { column: 17, line: 1 }, + start: { column: 22, line: 1 }, + end: { column: 25, line: 1 }, }, }, Punctuator { type: "Punctuator", value: ".", - range: [17, 18], + range: [25, 26], loc: { - start: { column: 17, line: 1 }, - end: { column: 18, line: 1 }, + start: { column: 25, line: 1 }, + end: { column: 26, line: 1 }, }, }, Identifier { type: "Identifier", value: "ghi", - range: [18, 21], + range: [26, 29], loc: { - start: { column: 18, line: 1 }, - end: { column: 21, line: 1 }, + start: { column: 26, line: 1 }, + end: { column: 29, line: 1 }, }, }, Punctuator { type: "Punctuator", value: "{", - range: [22, 23], + range: [30, 31], loc: { - start: { column: 22, line: 1 }, - end: { column: 23, line: 1 }, + start: { column: 30, line: 1 }, + end: { column: 31, line: 1 }, }, }, Punctuator { type: "Punctuator", value: "}", - range: [23, 24], + range: [31, 32], loc: { - start: { column: 23, line: 1 }, - end: { column: 24, line: 1 }, + start: { column: 31, line: 1 }, + end: { column: 32, line: 1 }, }, }, ] diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-declare/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-declare/snapshots/3-Babel-AST.shot index 6fc9b2f250a9..c42e6dea3a33 100644 --- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-declare/snapshots/3-Babel-AST.shot +++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-declare/snapshots/3-Babel-AST.shot @@ -14,67 +14,68 @@ Program { type: "TSModuleBlock", body: [], - range: [22, 24], + range: [30, 32], loc: { - start: { column: 22, line: 1 }, - end: { column: 24, line: 1 }, + start: { column: 30, line: 1 }, + end: { column: 32, line: 1 }, }, }, id: Identifier { type: "Identifier", name: "ghi", - range: [18, 21], + range: [26, 29], loc: { - start: { column: 18, line: 1 }, - end: { column: 21, line: 1 }, + start: { column: 26, line: 1 }, + end: { column: 29, line: 1 }, }, }, - range: [18, 24], + range: [26, 32], loc: { - start: { column: 18, line: 1 }, - end: { column: 24, line: 1 }, + start: { column: 26, line: 1 }, + end: { column: 32, line: 1 }, }, }, id: Identifier { type: "Identifier", name: "def", - range: [14, 17], + range: [22, 25], loc: { - start: { column: 14, line: 1 }, - end: { column: 17, line: 1 }, + start: { column: 22, line: 1 }, + end: { column: 25, line: 1 }, }, }, - range: [14, 24], + range: [22, 32], loc: { - start: { column: 14, line: 1 }, - end: { column: 24, line: 1 }, + start: { column: 22, line: 1 }, + end: { column: 32, line: 1 }, }, }, + declare: true, id: Identifier { type: "Identifier", name: "abc", - range: [10, 13], + range: [18, 21], loc: { - start: { column: 10, line: 1 }, - end: { column: 13, line: 1 }, + start: { column: 18, line: 1 }, + end: { column: 21, line: 1 }, }, }, - range: [0, 24], + range: [0, 32], loc: { start: { column: 0, line: 1 }, - end: { column: 24, line: 1 }, + end: { column: 32, line: 1 }, }, }, ], sourceType: "script", - range: [0, 25], + range: [0, 33], loc: { start: { column: 0, line: 1 }, end: { column: 0, line: 2 }, diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-declare/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-declare/snapshots/4-Babel-Tokens.shot index 2e4663c88edb..9c3b20aa1fb6 100644 --- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-declare/snapshots/4-Babel-Tokens.shot +++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-declare/snapshots/4-Babel-Tokens.shot @@ -4,82 +4,92 @@ exports[`AST Fixtures declaration TSModuleDeclaration namespace-nested-twice-dec [ Identifier { type: "Identifier", - value: "namespace", + value: "declare", - range: [0, 9], + range: [0, 7], loc: { start: { column: 0, line: 1 }, - end: { column: 9, line: 1 }, + end: { column: 7, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "namespace", + + range: [8, 17], + loc: { + start: { column: 8, line: 1 }, + end: { column: 17, line: 1 }, }, }, Identifier { type: "Identifier", value: "abc", - range: [10, 13], + range: [18, 21], loc: { - start: { column: 10, line: 1 }, - end: { column: 13, line: 1 }, + start: { column: 18, line: 1 }, + end: { column: 21, line: 1 }, }, }, Punctuator { type: "Punctuator", value: ".", - range: [13, 14], + range: [21, 22], loc: { - start: { column: 13, line: 1 }, - end: { column: 14, line: 1 }, + start: { column: 21, line: 1 }, + end: { column: 22, line: 1 }, }, }, Identifier { type: "Identifier", value: "def", - range: [14, 17], + range: [22, 25], loc: { - start: { column: 14, line: 1 }, - end: { column: 17, line: 1 }, + start: { column: 22, line: 1 }, + end: { column: 25, line: 1 }, }, }, Punctuator { type: "Punctuator", value: ".", - range: [17, 18], + range: [25, 26], loc: { - start: { column: 17, line: 1 }, - end: { column: 18, line: 1 }, + start: { column: 25, line: 1 }, + end: { column: 26, line: 1 }, }, }, Identifier { type: "Identifier", value: "ghi", - range: [18, 21], + range: [26, 29], loc: { - start: { column: 18, line: 1 }, - end: { column: 21, line: 1 }, + start: { column: 26, line: 1 }, + end: { column: 29, line: 1 }, }, }, Punctuator { type: "Punctuator", value: "{", - range: [22, 23], + range: [30, 31], loc: { - start: { column: 22, line: 1 }, - end: { column: 23, line: 1 }, + start: { column: 30, line: 1 }, + end: { column: 31, line: 1 }, }, }, Punctuator { type: "Punctuator", value: "}", - range: [23, 24], + range: [31, 32], loc: { - start: { column: 23, line: 1 }, - end: { column: 24, line: 1 }, + start: { column: 31, line: 1 }, + end: { column: 32, line: 1 }, }, }, ] diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-declare/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-declare/snapshots/5-AST-Alignment-AST.shot index 86531c5d9159..7a97e14281ea 100644 --- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-declare/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-declare/snapshots/5-AST-Alignment-AST.shot @@ -13,14 +13,21 @@ exports[`AST Fixtures declaration TSModuleDeclaration namespace-nested-twice-dec - body: TSModuleBlock { - type: 'TSModuleBlock', - body: Array [], -- -- range: [22, 24], ++ body: TSModuleDeclaration { ++ type: 'TSModuleDeclaration', ++ body: TSModuleDeclaration { ++ type: 'TSModuleDeclaration', ++ body: TSModuleBlock { ++ type: 'TSModuleBlock', ++ body: Array [], + +- range: [30, 32], - loc: { -- start: { column: 22, line: 1 }, -- end: { column: 24, line: 1 }, +- start: { column: 30, line: 1 }, +- end: { column: 32, line: 1 }, - }, - }, -- declare: false, +- declare: true, - global: false, - id: TSQualifiedName { - type: 'TSQualifiedName', @@ -31,21 +38,14 @@ exports[`AST Fixtures declaration TSModuleDeclaration namespace-nested-twice-dec - decorators: Array [], - name: 'abc', - optional: false, -+ body: TSModuleDeclaration { -+ type: 'TSModuleDeclaration', -+ body: TSModuleDeclaration { -+ type: 'TSModuleDeclaration', -+ body: TSModuleBlock { -+ type: 'TSModuleBlock', -+ body: Array [], - -- range: [10, 13], -+ range: [22, 24], +- +- range: [18, 21], ++ range: [30, 32], loc: { -- start: { column: 10, line: 1 }, -- end: { column: 13, line: 1 }, -+ start: { column: 22, line: 1 }, -+ end: { column: 24, line: 1 }, +- start: { column: 18, line: 1 }, +- end: { column: 21, line: 1 }, ++ start: { column: 30, line: 1 }, ++ end: { column: 32, line: 1 }, }, }, - right: Identifier { @@ -56,23 +56,23 @@ exports[`AST Fixtures declaration TSModuleDeclaration namespace-nested-twice-dec - optional: false, + name: 'ghi', -- range: [14, 17], -+ range: [18, 21], +- range: [22, 25], ++ range: [26, 29], loc: { -- start: { column: 14, line: 1 }, -- end: { column: 17, line: 1 }, -+ start: { column: 18, line: 1 }, -+ end: { column: 21, line: 1 }, +- start: { column: 22, line: 1 }, +- end: { column: 25, line: 1 }, ++ start: { column: 26, line: 1 }, ++ end: { column: 29, line: 1 }, }, }, -- range: [10, 17], -+ range: [18, 24], +- range: [18, 25], ++ range: [26, 32], loc: { -- start: { column: 10, line: 1 }, -- end: { column: 17, line: 1 }, -+ start: { column: 18, line: 1 }, -+ end: { column: 24, line: 1 }, +- start: { column: 18, line: 1 }, +- end: { column: 25, line: 1 }, ++ start: { column: 26, line: 1 }, ++ end: { column: 32, line: 1 }, }, }, - right: Identifier { @@ -83,46 +83,47 @@ exports[`AST Fixtures declaration TSModuleDeclaration namespace-nested-twice-dec - optional: false, + name: 'def', -- range: [18, 21], -+ range: [14, 17], +- range: [26, 29], ++ range: [22, 25], loc: { -- start: { column: 18, line: 1 }, -- end: { column: 21, line: 1 }, -+ start: { column: 14, line: 1 }, -+ end: { column: 17, line: 1 }, +- start: { column: 26, line: 1 }, +- end: { column: 29, line: 1 }, ++ start: { column: 22, line: 1 }, ++ end: { column: 25, line: 1 }, }, }, -- range: [10, 21], -+ range: [14, 24], +- range: [18, 29], ++ range: [22, 32], + loc: { -+ start: { column: 14, line: 1 }, -+ end: { column: 24, line: 1 }, ++ start: { column: 22, line: 1 }, ++ end: { column: 32, line: 1 }, + }, + }, ++ declare: true, + id: Identifier { + type: 'Identifier', + name: 'abc', + -+ range: [10, 13], ++ range: [18, 21], loc: { - start: { column: 10, line: 1 }, -- end: { column: 21, line: 1 }, -+ end: { column: 13, line: 1 }, + start: { column: 18, line: 1 }, +- end: { column: 29, line: 1 }, ++ end: { column: 21, line: 1 }, }, }, - kind: 'namespace', - range: [0, 24], + range: [0, 32], loc: { start: { column: 0, line: 1 }, - end: { column: 24, line: 1 }, + end: { column: 32, line: 1 }, }, }, ], sourceType: 'script', - range: [0, 25], + range: [0, 33], loc: { start: { column: 0, line: 1 }, end: { column: 0, line: 2 }, diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-export-declare/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-export-declare/snapshots/1-TSESTree-AST.shot index eab4e1bf61df..d725dc2ec655 100644 --- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-export-declare/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-export-declare/snapshots/1-TSESTree-AST.shot @@ -4,86 +4,99 @@ exports[`AST Fixtures declaration TSModuleDeclaration namespace-nested-twice-exp Program { type: "Program", body: [ - TSModuleDeclaration { - type: "TSModuleDeclaration", - body: TSModuleBlock { - type: "TSModuleBlock", - body: [], + ExportNamedDeclaration { + type: "ExportNamedDeclaration", + assertions: [], + declaration: TSModuleDeclaration { + type: "TSModuleDeclaration", + body: TSModuleBlock { + type: "TSModuleBlock", + body: [], - range: [22, 24], - loc: { - start: { column: 22, line: 1 }, - end: { column: 24, line: 1 }, + range: [37, 39], + loc: { + start: { column: 37, line: 1 }, + end: { column: 39, line: 1 }, + }, }, - }, - declare: false, - global: false, - id: TSQualifiedName { - type: "TSQualifiedName", - left: TSQualifiedName { + declare: true, + global: false, + id: TSQualifiedName { type: "TSQualifiedName", - left: Identifier { - type: "Identifier", - decorators: [], - name: "abc", - optional: false, + left: TSQualifiedName { + type: "TSQualifiedName", + left: Identifier { + type: "Identifier", + decorators: [], + name: "abc", + optional: false, - range: [10, 13], + range: [25, 28], + loc: { + start: { column: 25, line: 1 }, + end: { column: 28, line: 1 }, + }, + }, + right: Identifier { + type: "Identifier", + decorators: [], + name: "def", + optional: false, + + range: [29, 32], + loc: { + start: { column: 29, line: 1 }, + end: { column: 32, line: 1 }, + }, + }, + + range: [25, 32], loc: { - start: { column: 10, line: 1 }, - end: { column: 13, line: 1 }, + start: { column: 25, line: 1 }, + end: { column: 32, line: 1 }, }, }, right: Identifier { type: "Identifier", decorators: [], - name: "def", + name: "ghi", optional: false, - range: [14, 17], + range: [33, 36], loc: { - start: { column: 14, line: 1 }, - end: { column: 17, line: 1 }, + start: { column: 33, line: 1 }, + end: { column: 36, line: 1 }, }, }, - range: [10, 17], - loc: { - start: { column: 10, line: 1 }, - end: { column: 17, line: 1 }, - }, - }, - right: Identifier { - type: "Identifier", - decorators: [], - name: "ghi", - optional: false, - - range: [18, 21], + range: [25, 36], loc: { - start: { column: 18, line: 1 }, - end: { column: 21, line: 1 }, + start: { column: 25, line: 1 }, + end: { column: 36, line: 1 }, }, }, + kind: "namespace", - range: [10, 21], + range: [7, 39], loc: { - start: { column: 10, line: 1 }, - end: { column: 21, line: 1 }, + start: { column: 7, line: 1 }, + end: { column: 39, line: 1 }, }, }, - kind: "namespace", + exportKind: "type", + source: null, + specifiers: [], - range: [0, 24], + range: [0, 39], loc: { start: { column: 0, line: 1 }, - end: { column: 24, line: 1 }, + end: { column: 39, line: 1 }, }, }, ], - sourceType: "script", + sourceType: "module", - range: [0, 25], + range: [0, 40], loc: { start: { column: 0, line: 1 }, end: { column: 0, line: 2 }, diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-export-declare/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-export-declare/snapshots/2-TSESTree-Tokens.shot index c041e84c88e3..cce80b8f5e4e 100644 --- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-export-declare/snapshots/2-TSESTree-Tokens.shot +++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-export-declare/snapshots/2-TSESTree-Tokens.shot @@ -2,84 +2,104 @@ exports[`AST Fixtures declaration TSModuleDeclaration namespace-nested-twice-export-declare TSESTree - Tokens 1`] = ` [ + Keyword { + type: "Keyword", + value: "export", + + range: [0, 6], + loc: { + start: { column: 0, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "declare", + + range: [7, 14], + loc: { + start: { column: 7, line: 1 }, + end: { column: 14, line: 1 }, + }, + }, Identifier { type: "Identifier", value: "namespace", - range: [0, 9], + range: [15, 24], loc: { - start: { column: 0, line: 1 }, - end: { column: 9, line: 1 }, + start: { column: 15, line: 1 }, + end: { column: 24, line: 1 }, }, }, Identifier { type: "Identifier", value: "abc", - range: [10, 13], + range: [25, 28], loc: { - start: { column: 10, line: 1 }, - end: { column: 13, line: 1 }, + start: { column: 25, line: 1 }, + end: { column: 28, line: 1 }, }, }, Punctuator { type: "Punctuator", value: ".", - range: [13, 14], + range: [28, 29], loc: { - start: { column: 13, line: 1 }, - end: { column: 14, line: 1 }, + start: { column: 28, line: 1 }, + end: { column: 29, line: 1 }, }, }, Identifier { type: "Identifier", value: "def", - range: [14, 17], + range: [29, 32], loc: { - start: { column: 14, line: 1 }, - end: { column: 17, line: 1 }, + start: { column: 29, line: 1 }, + end: { column: 32, line: 1 }, }, }, Punctuator { type: "Punctuator", value: ".", - range: [17, 18], + range: [32, 33], loc: { - start: { column: 17, line: 1 }, - end: { column: 18, line: 1 }, + start: { column: 32, line: 1 }, + end: { column: 33, line: 1 }, }, }, Identifier { type: "Identifier", value: "ghi", - range: [18, 21], + range: [33, 36], loc: { - start: { column: 18, line: 1 }, - end: { column: 21, line: 1 }, + start: { column: 33, line: 1 }, + end: { column: 36, line: 1 }, }, }, Punctuator { type: "Punctuator", value: "{", - range: [22, 23], + range: [37, 38], loc: { - start: { column: 22, line: 1 }, - end: { column: 23, line: 1 }, + start: { column: 37, line: 1 }, + end: { column: 38, line: 1 }, }, }, Punctuator { type: "Punctuator", value: "}", - range: [23, 24], + range: [38, 39], loc: { - start: { column: 23, line: 1 }, - end: { column: 24, line: 1 }, + start: { column: 38, line: 1 }, + end: { column: 39, line: 1 }, }, }, ] diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-export-declare/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-export-declare/snapshots/3-Babel-AST.shot index 14c350bd62d6..22193550e2ea 100644 --- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-export-declare/snapshots/3-Babel-AST.shot +++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-export-declare/snapshots/3-Babel-AST.shot @@ -4,77 +4,91 @@ exports[`AST Fixtures declaration TSModuleDeclaration namespace-nested-twice-exp Program { type: "Program", body: [ - TSModuleDeclaration { - type: "TSModuleDeclaration", - body: TSModuleDeclaration { + ExportNamedDeclaration { + type: "ExportNamedDeclaration", + assertions: [], + declaration: TSModuleDeclaration { type: "TSModuleDeclaration", body: TSModuleDeclaration { type: "TSModuleDeclaration", - body: TSModuleBlock { - type: "TSModuleBlock", - body: [], + body: TSModuleDeclaration { + type: "TSModuleDeclaration", + body: TSModuleBlock { + type: "TSModuleBlock", + body: [], - range: [22, 24], + range: [37, 39], + loc: { + start: { column: 37, line: 1 }, + end: { column: 39, line: 1 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "ghi", + + range: [33, 36], + loc: { + start: { column: 33, line: 1 }, + end: { column: 36, line: 1 }, + }, + }, + + range: [33, 39], loc: { - start: { column: 22, line: 1 }, - end: { column: 24, line: 1 }, + start: { column: 33, line: 1 }, + end: { column: 39, line: 1 }, }, }, id: Identifier { type: "Identifier", - name: "ghi", + name: "def", - range: [18, 21], + range: [29, 32], loc: { - start: { column: 18, line: 1 }, - end: { column: 21, line: 1 }, + start: { column: 29, line: 1 }, + end: { column: 32, line: 1 }, }, }, - range: [18, 24], + range: [29, 39], loc: { - start: { column: 18, line: 1 }, - end: { column: 24, line: 1 }, + start: { column: 29, line: 1 }, + end: { column: 39, line: 1 }, }, }, + declare: true, id: Identifier { type: "Identifier", - name: "def", + name: "abc", - range: [14, 17], + range: [25, 28], loc: { - start: { column: 14, line: 1 }, - end: { column: 17, line: 1 }, + start: { column: 25, line: 1 }, + end: { column: 28, line: 1 }, }, }, - range: [14, 24], - loc: { - start: { column: 14, line: 1 }, - end: { column: 24, line: 1 }, - }, - }, - id: Identifier { - type: "Identifier", - name: "abc", - - range: [10, 13], + range: [7, 39], loc: { - start: { column: 10, line: 1 }, - end: { column: 13, line: 1 }, + start: { column: 7, line: 1 }, + end: { column: 39, line: 1 }, }, }, + exportKind: "type", + source: null, + specifiers: [], - range: [0, 24], + range: [0, 39], loc: { start: { column: 0, line: 1 }, - end: { column: 24, line: 1 }, + end: { column: 39, line: 1 }, }, }, ], sourceType: "script", - range: [0, 25], + range: [0, 40], loc: { start: { column: 0, line: 1 }, end: { column: 0, line: 2 }, diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-export-declare/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-export-declare/snapshots/4-Babel-Tokens.shot index 5b816bdbfbf8..94038375b350 100644 --- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-export-declare/snapshots/4-Babel-Tokens.shot +++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-export-declare/snapshots/4-Babel-Tokens.shot @@ -2,84 +2,104 @@ exports[`AST Fixtures declaration TSModuleDeclaration namespace-nested-twice-export-declare Babel - Tokens 1`] = ` [ + Keyword { + type: "Keyword", + value: "export", + + range: [0, 6], + loc: { + start: { column: 0, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "declare", + + range: [7, 14], + loc: { + start: { column: 7, line: 1 }, + end: { column: 14, line: 1 }, + }, + }, Identifier { type: "Identifier", value: "namespace", - range: [0, 9], + range: [15, 24], loc: { - start: { column: 0, line: 1 }, - end: { column: 9, line: 1 }, + start: { column: 15, line: 1 }, + end: { column: 24, line: 1 }, }, }, Identifier { type: "Identifier", value: "abc", - range: [10, 13], + range: [25, 28], loc: { - start: { column: 10, line: 1 }, - end: { column: 13, line: 1 }, + start: { column: 25, line: 1 }, + end: { column: 28, line: 1 }, }, }, Punctuator { type: "Punctuator", value: ".", - range: [13, 14], + range: [28, 29], loc: { - start: { column: 13, line: 1 }, - end: { column: 14, line: 1 }, + start: { column: 28, line: 1 }, + end: { column: 29, line: 1 }, }, }, Identifier { type: "Identifier", value: "def", - range: [14, 17], + range: [29, 32], loc: { - start: { column: 14, line: 1 }, - end: { column: 17, line: 1 }, + start: { column: 29, line: 1 }, + end: { column: 32, line: 1 }, }, }, Punctuator { type: "Punctuator", value: ".", - range: [17, 18], + range: [32, 33], loc: { - start: { column: 17, line: 1 }, - end: { column: 18, line: 1 }, + start: { column: 32, line: 1 }, + end: { column: 33, line: 1 }, }, }, Identifier { type: "Identifier", value: "ghi", - range: [18, 21], + range: [33, 36], loc: { - start: { column: 18, line: 1 }, - end: { column: 21, line: 1 }, + start: { column: 33, line: 1 }, + end: { column: 36, line: 1 }, }, }, Punctuator { type: "Punctuator", value: "{", - range: [22, 23], + range: [37, 38], loc: { - start: { column: 22, line: 1 }, - end: { column: 23, line: 1 }, + start: { column: 37, line: 1 }, + end: { column: 38, line: 1 }, }, }, Punctuator { type: "Punctuator", value: "}", - range: [23, 24], + range: [38, 39], loc: { - start: { column: 23, line: 1 }, - end: { column: 24, line: 1 }, + start: { column: 38, line: 1 }, + end: { column: 39, line: 1 }, }, }, ] diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-export-declare/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-export-declare/snapshots/5-AST-Alignment-AST.shot index a19aa5c21f51..dc9a53f795df 100644 --- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-export-declare/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-export-declare/snapshots/5-AST-Alignment-AST.shot @@ -8,121 +8,136 @@ exports[`AST Fixtures declaration TSModuleDeclaration namespace-nested-twice-exp Program { type: 'Program', body: Array [ - TSModuleDeclaration { - type: 'TSModuleDeclaration', -- body: TSModuleBlock { -- type: 'TSModuleBlock', -- body: Array [], + ExportNamedDeclaration { + type: 'ExportNamedDeclaration', + assertions: Array [], + declaration: TSModuleDeclaration { + type: 'TSModuleDeclaration', +- body: TSModuleBlock { +- type: 'TSModuleBlock', +- body: Array [], - -- range: [22, 24], -- loc: { -- start: { column: 22, line: 1 }, -- end: { column: 24, line: 1 }, +- range: [37, 39], +- loc: { +- start: { column: 37, line: 1 }, +- end: { column: 39, line: 1 }, +- }, - }, -- }, -- declare: false, -- global: false, -- id: TSQualifiedName { -- type: 'TSQualifiedName', -- left: TSQualifiedName { +- declare: true, +- global: false, +- id: TSQualifiedName { - type: 'TSQualifiedName', -- left: Identifier { -- type: 'Identifier', -- decorators: Array [], -- name: 'abc', -- optional: false, -+ body: TSModuleDeclaration { -+ type: 'TSModuleDeclaration', +- left: TSQualifiedName { +- type: 'TSQualifiedName', +- left: Identifier { +- type: 'Identifier', +- decorators: Array [], +- name: 'abc', +- optional: false, + body: TSModuleDeclaration { + type: 'TSModuleDeclaration', -+ body: TSModuleBlock { -+ type: 'TSModuleBlock', -+ body: Array [], ++ body: TSModuleDeclaration { ++ type: 'TSModuleDeclaration', ++ body: TSModuleBlock { ++ type: 'TSModuleBlock', ++ body: Array [], + +- range: [25, 28], ++ range: [37, 39], + loc: { +- start: { column: 25, line: 1 }, +- end: { column: 28, line: 1 }, ++ start: { column: 37, line: 1 }, ++ end: { column: 39, line: 1 }, + }, + }, +- right: Identifier { ++ id: Identifier { + type: 'Identifier', +- decorators: Array [], +- name: 'def', +- optional: false, ++ name: 'ghi', -- range: [10, 13], -+ range: [22, 24], +- range: [29, 32], ++ range: [33, 36], + loc: { +- start: { column: 29, line: 1 }, +- end: { column: 32, line: 1 }, ++ start: { column: 33, line: 1 }, ++ end: { column: 36, line: 1 }, + }, + }, + +- range: [25, 32], ++ range: [33, 39], loc: { -- start: { column: 10, line: 1 }, -- end: { column: 13, line: 1 }, -+ start: { column: 22, line: 1 }, -+ end: { column: 24, line: 1 }, +- start: { column: 25, line: 1 }, +- end: { column: 32, line: 1 }, ++ start: { column: 33, line: 1 }, ++ end: { column: 39, line: 1 }, }, }, - right: Identifier { + id: Identifier { type: 'Identifier', - decorators: Array [], -- name: 'def', +- name: 'ghi', - optional: false, -+ name: 'ghi', ++ name: 'def', -- range: [14, 17], -+ range: [18, 21], +- range: [33, 36], ++ range: [29, 32], loc: { -- start: { column: 14, line: 1 }, -- end: { column: 17, line: 1 }, -+ start: { column: 18, line: 1 }, -+ end: { column: 21, line: 1 }, +- start: { column: 33, line: 1 }, +- end: { column: 36, line: 1 }, ++ start: { column: 29, line: 1 }, ++ end: { column: 32, line: 1 }, }, }, -- range: [10, 17], -+ range: [18, 24], - loc: { -- start: { column: 10, line: 1 }, -- end: { column: 17, line: 1 }, -+ start: { column: 18, line: 1 }, -+ end: { column: 24, line: 1 }, - }, - }, -- right: Identifier { +- range: [25, 36], ++ range: [29, 39], ++ loc: { ++ start: { column: 29, line: 1 }, ++ end: { column: 39, line: 1 }, ++ }, ++ }, ++ declare: true, + id: Identifier { - type: 'Identifier', -- decorators: Array [], -- name: 'ghi', -- optional: false, -+ name: 'def', - -- range: [18, 21], -+ range: [14, 17], ++ type: 'Identifier', ++ name: 'abc', ++ ++ range: [25, 28], loc: { -- start: { column: 18, line: 1 }, -- end: { column: 21, line: 1 }, -+ start: { column: 14, line: 1 }, -+ end: { column: 17, line: 1 }, + start: { column: 25, line: 1 }, +- end: { column: 36, line: 1 }, ++ end: { column: 28, line: 1 }, }, }, +- kind: 'namespace', -- range: [10, 21], -+ range: [14, 24], -+ loc: { -+ start: { column: 14, line: 1 }, -+ end: { column: 24, line: 1 }, -+ }, -+ }, -+ id: Identifier { -+ type: 'Identifier', -+ name: 'abc', -+ -+ range: [10, 13], + range: [7, 39], loc: { - start: { column: 10, line: 1 }, -- end: { column: 21, line: 1 }, -+ end: { column: 13, line: 1 }, + start: { column: 7, line: 1 }, + end: { column: 39, line: 1 }, }, }, -- kind: 'namespace', + exportKind: 'type', + source: null, + specifiers: Array [], - range: [0, 24], + range: [0, 39], loc: { start: { column: 0, line: 1 }, - end: { column: 24, line: 1 }, + end: { column: 39, line: 1 }, }, }, ], - sourceType: 'script', +- sourceType: 'module', ++ sourceType: 'script', - range: [0, 25], + range: [0, 40], loc: { start: { column: 0, line: 1 }, end: { column: 0, line: 2 }, diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-export/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-export/snapshots/1-TSESTree-AST.shot index da6c6e19177b..2446e9b95087 100644 --- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-export/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-export/snapshots/1-TSESTree-AST.shot @@ -4,86 +4,99 @@ exports[`AST Fixtures declaration TSModuleDeclaration namespace-nested-twice-exp Program { type: "Program", body: [ - TSModuleDeclaration { - type: "TSModuleDeclaration", - body: TSModuleBlock { - type: "TSModuleBlock", - body: [], + ExportNamedDeclaration { + type: "ExportNamedDeclaration", + assertions: [], + declaration: TSModuleDeclaration { + type: "TSModuleDeclaration", + body: TSModuleBlock { + type: "TSModuleBlock", + body: [], - range: [22, 24], - loc: { - start: { column: 22, line: 1 }, - end: { column: 24, line: 1 }, + range: [29, 31], + loc: { + start: { column: 29, line: 1 }, + end: { column: 31, line: 1 }, + }, }, - }, - declare: false, - global: false, - id: TSQualifiedName { - type: "TSQualifiedName", - left: TSQualifiedName { + declare: false, + global: false, + id: TSQualifiedName { type: "TSQualifiedName", - left: Identifier { - type: "Identifier", - decorators: [], - name: "abc", - optional: false, + left: TSQualifiedName { + type: "TSQualifiedName", + left: Identifier { + type: "Identifier", + decorators: [], + name: "abc", + optional: false, - range: [10, 13], + range: [17, 20], + loc: { + start: { column: 17, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + right: Identifier { + type: "Identifier", + decorators: [], + name: "def", + optional: false, + + range: [21, 24], + loc: { + start: { column: 21, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, + + range: [17, 24], loc: { - start: { column: 10, line: 1 }, - end: { column: 13, line: 1 }, + start: { column: 17, line: 1 }, + end: { column: 24, line: 1 }, }, }, right: Identifier { type: "Identifier", decorators: [], - name: "def", + name: "ghi", optional: false, - range: [14, 17], + range: [25, 28], loc: { - start: { column: 14, line: 1 }, - end: { column: 17, line: 1 }, + start: { column: 25, line: 1 }, + end: { column: 28, line: 1 }, }, }, - range: [10, 17], - loc: { - start: { column: 10, line: 1 }, - end: { column: 17, line: 1 }, - }, - }, - right: Identifier { - type: "Identifier", - decorators: [], - name: "ghi", - optional: false, - - range: [18, 21], + range: [17, 28], loc: { - start: { column: 18, line: 1 }, - end: { column: 21, line: 1 }, + start: { column: 17, line: 1 }, + end: { column: 28, line: 1 }, }, }, + kind: "namespace", - range: [10, 21], + range: [7, 31], loc: { - start: { column: 10, line: 1 }, - end: { column: 21, line: 1 }, + start: { column: 7, line: 1 }, + end: { column: 31, line: 1 }, }, }, - kind: "namespace", + exportKind: "value", + source: null, + specifiers: [], - range: [0, 24], + range: [0, 31], loc: { start: { column: 0, line: 1 }, - end: { column: 24, line: 1 }, + end: { column: 31, line: 1 }, }, }, ], - sourceType: "script", + sourceType: "module", - range: [0, 25], + range: [0, 32], loc: { start: { column: 0, line: 1 }, end: { column: 0, line: 2 }, diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-export/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-export/snapshots/2-TSESTree-Tokens.shot index 15eb0cd8944e..faf98fe4cdc4 100644 --- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-export/snapshots/2-TSESTree-Tokens.shot +++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-export/snapshots/2-TSESTree-Tokens.shot @@ -2,84 +2,94 @@ exports[`AST Fixtures declaration TSModuleDeclaration namespace-nested-twice-export TSESTree - Tokens 1`] = ` [ + Keyword { + type: "Keyword", + value: "export", + + range: [0, 6], + loc: { + start: { column: 0, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, Identifier { type: "Identifier", value: "namespace", - range: [0, 9], + range: [7, 16], loc: { - start: { column: 0, line: 1 }, - end: { column: 9, line: 1 }, + start: { column: 7, line: 1 }, + end: { column: 16, line: 1 }, }, }, Identifier { type: "Identifier", value: "abc", - range: [10, 13], + range: [17, 20], loc: { - start: { column: 10, line: 1 }, - end: { column: 13, line: 1 }, + start: { column: 17, line: 1 }, + end: { column: 20, line: 1 }, }, }, Punctuator { type: "Punctuator", value: ".", - range: [13, 14], + range: [20, 21], loc: { - start: { column: 13, line: 1 }, - end: { column: 14, line: 1 }, + start: { column: 20, line: 1 }, + end: { column: 21, line: 1 }, }, }, Identifier { type: "Identifier", value: "def", - range: [14, 17], + range: [21, 24], loc: { - start: { column: 14, line: 1 }, - end: { column: 17, line: 1 }, + start: { column: 21, line: 1 }, + end: { column: 24, line: 1 }, }, }, Punctuator { type: "Punctuator", value: ".", - range: [17, 18], + range: [24, 25], loc: { - start: { column: 17, line: 1 }, - end: { column: 18, line: 1 }, + start: { column: 24, line: 1 }, + end: { column: 25, line: 1 }, }, }, Identifier { type: "Identifier", value: "ghi", - range: [18, 21], + range: [25, 28], loc: { - start: { column: 18, line: 1 }, - end: { column: 21, line: 1 }, + start: { column: 25, line: 1 }, + end: { column: 28, line: 1 }, }, }, Punctuator { type: "Punctuator", value: "{", - range: [22, 23], + range: [29, 30], loc: { - start: { column: 22, line: 1 }, - end: { column: 23, line: 1 }, + start: { column: 29, line: 1 }, + end: { column: 30, line: 1 }, }, }, Punctuator { type: "Punctuator", value: "}", - range: [23, 24], + range: [30, 31], loc: { - start: { column: 23, line: 1 }, - end: { column: 24, line: 1 }, + start: { column: 30, line: 1 }, + end: { column: 31, line: 1 }, }, }, ] diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-export/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-export/snapshots/3-Babel-AST.shot index d35201b965d3..288e992909fb 100644 --- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-export/snapshots/3-Babel-AST.shot +++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-export/snapshots/3-Babel-AST.shot @@ -4,77 +4,90 @@ exports[`AST Fixtures declaration TSModuleDeclaration namespace-nested-twice-exp Program { type: "Program", body: [ - TSModuleDeclaration { - type: "TSModuleDeclaration", - body: TSModuleDeclaration { + ExportNamedDeclaration { + type: "ExportNamedDeclaration", + assertions: [], + declaration: TSModuleDeclaration { type: "TSModuleDeclaration", body: TSModuleDeclaration { type: "TSModuleDeclaration", - body: TSModuleBlock { - type: "TSModuleBlock", - body: [], + body: TSModuleDeclaration { + type: "TSModuleDeclaration", + body: TSModuleBlock { + type: "TSModuleBlock", + body: [], - range: [22, 24], + range: [29, 31], + loc: { + start: { column: 29, line: 1 }, + end: { column: 31, line: 1 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "ghi", + + range: [25, 28], + loc: { + start: { column: 25, line: 1 }, + end: { column: 28, line: 1 }, + }, + }, + + range: [25, 31], loc: { - start: { column: 22, line: 1 }, - end: { column: 24, line: 1 }, + start: { column: 25, line: 1 }, + end: { column: 31, line: 1 }, }, }, id: Identifier { type: "Identifier", - name: "ghi", + name: "def", - range: [18, 21], + range: [21, 24], loc: { - start: { column: 18, line: 1 }, - end: { column: 21, line: 1 }, + start: { column: 21, line: 1 }, + end: { column: 24, line: 1 }, }, }, - range: [18, 24], + range: [21, 31], loc: { - start: { column: 18, line: 1 }, - end: { column: 24, line: 1 }, + start: { column: 21, line: 1 }, + end: { column: 31, line: 1 }, }, }, id: Identifier { type: "Identifier", - name: "def", + name: "abc", - range: [14, 17], + range: [17, 20], loc: { - start: { column: 14, line: 1 }, - end: { column: 17, line: 1 }, + start: { column: 17, line: 1 }, + end: { column: 20, line: 1 }, }, }, - range: [14, 24], - loc: { - start: { column: 14, line: 1 }, - end: { column: 24, line: 1 }, - }, - }, - id: Identifier { - type: "Identifier", - name: "abc", - - range: [10, 13], + range: [7, 31], loc: { - start: { column: 10, line: 1 }, - end: { column: 13, line: 1 }, + start: { column: 7, line: 1 }, + end: { column: 31, line: 1 }, }, }, + exportKind: "value", + source: null, + specifiers: [], - range: [0, 24], + range: [0, 31], loc: { start: { column: 0, line: 1 }, - end: { column: 24, line: 1 }, + end: { column: 31, line: 1 }, }, }, ], - sourceType: "script", + sourceType: "module", - range: [0, 25], + range: [0, 32], loc: { start: { column: 0, line: 1 }, end: { column: 0, line: 2 }, diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-export/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-export/snapshots/4-Babel-Tokens.shot index bb39fc8f2ec5..718198bf40dd 100644 --- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-export/snapshots/4-Babel-Tokens.shot +++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-export/snapshots/4-Babel-Tokens.shot @@ -2,84 +2,94 @@ exports[`AST Fixtures declaration TSModuleDeclaration namespace-nested-twice-export Babel - Tokens 1`] = ` [ + Keyword { + type: "Keyword", + value: "export", + + range: [0, 6], + loc: { + start: { column: 0, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, Identifier { type: "Identifier", value: "namespace", - range: [0, 9], + range: [7, 16], loc: { - start: { column: 0, line: 1 }, - end: { column: 9, line: 1 }, + start: { column: 7, line: 1 }, + end: { column: 16, line: 1 }, }, }, Identifier { type: "Identifier", value: "abc", - range: [10, 13], + range: [17, 20], loc: { - start: { column: 10, line: 1 }, - end: { column: 13, line: 1 }, + start: { column: 17, line: 1 }, + end: { column: 20, line: 1 }, }, }, Punctuator { type: "Punctuator", value: ".", - range: [13, 14], + range: [20, 21], loc: { - start: { column: 13, line: 1 }, - end: { column: 14, line: 1 }, + start: { column: 20, line: 1 }, + end: { column: 21, line: 1 }, }, }, Identifier { type: "Identifier", value: "def", - range: [14, 17], + range: [21, 24], loc: { - start: { column: 14, line: 1 }, - end: { column: 17, line: 1 }, + start: { column: 21, line: 1 }, + end: { column: 24, line: 1 }, }, }, Punctuator { type: "Punctuator", value: ".", - range: [17, 18], + range: [24, 25], loc: { - start: { column: 17, line: 1 }, - end: { column: 18, line: 1 }, + start: { column: 24, line: 1 }, + end: { column: 25, line: 1 }, }, }, Identifier { type: "Identifier", value: "ghi", - range: [18, 21], + range: [25, 28], loc: { - start: { column: 18, line: 1 }, - end: { column: 21, line: 1 }, + start: { column: 25, line: 1 }, + end: { column: 28, line: 1 }, }, }, Punctuator { type: "Punctuator", value: "{", - range: [22, 23], + range: [29, 30], loc: { - start: { column: 22, line: 1 }, - end: { column: 23, line: 1 }, + start: { column: 29, line: 1 }, + end: { column: 30, line: 1 }, }, }, Punctuator { type: "Punctuator", value: "}", - range: [23, 24], + range: [30, 31], loc: { - start: { column: 23, line: 1 }, - end: { column: 24, line: 1 }, + start: { column: 30, line: 1 }, + end: { column: 31, line: 1 }, }, }, ] diff --git a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-export/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-export/snapshots/5-AST-Alignment-AST.shot index 529296da870b..26c9b1396134 100644 --- a/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-export/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/declaration/TSModuleDeclaration/fixtures/namespace-nested-twice-export/snapshots/5-AST-Alignment-AST.shot @@ -8,121 +8,134 @@ exports[`AST Fixtures declaration TSModuleDeclaration namespace-nested-twice-exp Program { type: 'Program', body: Array [ - TSModuleDeclaration { - type: 'TSModuleDeclaration', -- body: TSModuleBlock { -- type: 'TSModuleBlock', -- body: Array [], + ExportNamedDeclaration { + type: 'ExportNamedDeclaration', + assertions: Array [], + declaration: TSModuleDeclaration { + type: 'TSModuleDeclaration', +- body: TSModuleBlock { +- type: 'TSModuleBlock', +- body: Array [], - -- range: [22, 24], -- loc: { -- start: { column: 22, line: 1 }, -- end: { column: 24, line: 1 }, +- range: [29, 31], +- loc: { +- start: { column: 29, line: 1 }, +- end: { column: 31, line: 1 }, +- }, - }, -- }, -- declare: false, -- global: false, -- id: TSQualifiedName { -- type: 'TSQualifiedName', -- left: TSQualifiedName { +- declare: false, +- global: false, +- id: TSQualifiedName { - type: 'TSQualifiedName', -- left: Identifier { -- type: 'Identifier', -- decorators: Array [], -- name: 'abc', -- optional: false, -+ body: TSModuleDeclaration { -+ type: 'TSModuleDeclaration', +- left: TSQualifiedName { +- type: 'TSQualifiedName', +- left: Identifier { +- type: 'Identifier', +- decorators: Array [], +- name: 'abc', +- optional: false, + body: TSModuleDeclaration { + type: 'TSModuleDeclaration', -+ body: TSModuleBlock { -+ type: 'TSModuleBlock', -+ body: Array [], ++ body: TSModuleDeclaration { ++ type: 'TSModuleDeclaration', ++ body: TSModuleBlock { ++ type: 'TSModuleBlock', ++ body: Array [], + +- range: [17, 20], ++ range: [29, 31], + loc: { +- start: { column: 17, line: 1 }, +- end: { column: 20, line: 1 }, ++ start: { column: 29, line: 1 }, ++ end: { column: 31, line: 1 }, + }, + }, +- right: Identifier { ++ id: Identifier { + type: 'Identifier', +- decorators: Array [], +- name: 'def', +- optional: false, ++ name: 'ghi', -- range: [10, 13], -+ range: [22, 24], +- range: [21, 24], ++ range: [25, 28], + loc: { +- start: { column: 21, line: 1 }, +- end: { column: 24, line: 1 }, ++ start: { column: 25, line: 1 }, ++ end: { column: 28, line: 1 }, + }, + }, + +- range: [17, 24], ++ range: [25, 31], loc: { -- start: { column: 10, line: 1 }, -- end: { column: 13, line: 1 }, -+ start: { column: 22, line: 1 }, -+ end: { column: 24, line: 1 }, +- start: { column: 17, line: 1 }, +- end: { column: 24, line: 1 }, ++ start: { column: 25, line: 1 }, ++ end: { column: 31, line: 1 }, }, }, - right: Identifier { + id: Identifier { type: 'Identifier', - decorators: Array [], -- name: 'def', +- name: 'ghi', - optional: false, -+ name: 'ghi', ++ name: 'def', -- range: [14, 17], -+ range: [18, 21], +- range: [25, 28], ++ range: [21, 24], loc: { -- start: { column: 14, line: 1 }, -- end: { column: 17, line: 1 }, -+ start: { column: 18, line: 1 }, -+ end: { column: 21, line: 1 }, +- start: { column: 25, line: 1 }, +- end: { column: 28, line: 1 }, ++ start: { column: 21, line: 1 }, ++ end: { column: 24, line: 1 }, }, }, -- range: [10, 17], -+ range: [18, 24], - loc: { -- start: { column: 10, line: 1 }, -- end: { column: 17, line: 1 }, -+ start: { column: 18, line: 1 }, -+ end: { column: 24, line: 1 }, - }, - }, -- right: Identifier { +- range: [17, 28], ++ range: [21, 31], ++ loc: { ++ start: { column: 21, line: 1 }, ++ end: { column: 31, line: 1 }, ++ }, ++ }, + id: Identifier { - type: 'Identifier', -- decorators: Array [], -- name: 'ghi', -- optional: false, -+ name: 'def', - -- range: [18, 21], -+ range: [14, 17], ++ type: 'Identifier', ++ name: 'abc', ++ ++ range: [17, 20], loc: { -- start: { column: 18, line: 1 }, -- end: { column: 21, line: 1 }, -+ start: { column: 14, line: 1 }, -+ end: { column: 17, line: 1 }, + start: { column: 17, line: 1 }, +- end: { column: 28, line: 1 }, ++ end: { column: 20, line: 1 }, }, }, +- kind: 'namespace', -- range: [10, 21], -+ range: [14, 24], -+ loc: { -+ start: { column: 14, line: 1 }, -+ end: { column: 24, line: 1 }, -+ }, -+ }, -+ id: Identifier { -+ type: 'Identifier', -+ name: 'abc', -+ -+ range: [10, 13], + range: [7, 31], loc: { - start: { column: 10, line: 1 }, -- end: { column: 21, line: 1 }, -+ end: { column: 13, line: 1 }, + start: { column: 7, line: 1 }, + end: { column: 31, line: 1 }, }, }, -- kind: 'namespace', + exportKind: 'value', + source: null, + specifiers: Array [], - range: [0, 24], + range: [0, 31], loc: { start: { column: 0, line: 1 }, - end: { column: 24, line: 1 }, + end: { column: 31, line: 1 }, }, }, ], - sourceType: 'script', + sourceType: 'module', - range: [0, 25], + range: [0, 32], loc: { start: { column: 0, line: 1 }, end: { column: 0, line: 2 }, diff --git a/yarn.lock b/yarn.lock index 17f6e97b74df..317bb032bfb9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3401,7 +3401,7 @@ resolved "https://registry.yarnpkg.com/@polka/url/-/url-1.0.0-next.21.tgz#5de5a2385a35309427f6011992b544514d559aa1" integrity sha512-a5Sab1C4/icpTZVzZc5Ghpz88yQtGOyNqYXcZgOssB2uuAr+wF/MvN6bgtW32q7HHrvBki+BsZ0OuNv6EV3K9g== -"@prettier/sync@*": +"@prettier/sync@*", "@prettier/sync@^0.3.0": version "0.3.0" resolved "https://registry.yarnpkg.com/@prettier/sync/-/sync-0.3.0.tgz#91f2cfc23490a21586d1cf89c6f72157c000ca1e" integrity sha512-3dcmCyAxIcxy036h1I7MQU/uEEBq8oLwf1CE3xeze+MPlgkdlb/+w6rGR/1dhp6Hqi17fRS6nvwnOzkESxEkOw== From 39546cd15ceefd6485510a780b4ef7fcad18b946 Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Tue, 17 Oct 2023 16:17:31 -0400 Subject: [PATCH 8/9] Deduplicated versions and removed stub types --- package.json | 1 - packages/ast-spec/package.json | 2 +- packages/eslint-plugin-internal/package.json | 3 +- packages/eslint-plugin-tslint/package.json | 2 +- packages/eslint-plugin/package.json | 3 +- packages/parser/package.json | 2 +- packages/repo-tools/package.json | 2 +- .../package.json | 2 +- packages/type-utils/package.json | 2 +- packages/types/package.json | 2 +- packages/typescript-estree/package.json | 2 +- packages/utils/package.json | 2 +- packages/visitor-keys/package.json | 2 +- packages/website-eslint/package.json | 2 +- packages/website/package.json | 2 +- yarn.lock | 49 ++++++------------- 16 files changed, 29 insertions(+), 51 deletions(-) diff --git a/package.json b/package.json index 8e154afc2c49..e3fb4ce713f9 100644 --- a/package.json +++ b/package.json @@ -75,7 +75,6 @@ "@types/natural-compare": "^1.4.1", "@types/ncp": "^2.0.5", "@types/node": "^20.0.0", - "@types/prettier": "^2.7.2", "@types/semver": "^7.5.0", "@types/tmp": "^0.2.3", "console-fail-test": "^0.2.3", diff --git a/packages/ast-spec/package.json b/packages/ast-spec/package.json index 62f7009e1e38..545820b8f758 100644 --- a/packages/ast-spec/package.json +++ b/packages/ast-spec/package.json @@ -54,7 +54,7 @@ "jest-snapshot": "^29.6.2", "jest-specific-snapshot": "^8.0.0", "make-dir": "*", - "prettier": "^2.8.4", + "prettier": "^3.0.3", "pretty-format": "*", "rimraf": "*", "typescript": "*" diff --git a/packages/eslint-plugin-internal/package.json b/packages/eslint-plugin-internal/package.json index 9bcb192e278b..bb34f02287dd 100644 --- a/packages/eslint-plugin-internal/package.json +++ b/packages/eslint-plugin-internal/package.json @@ -14,12 +14,11 @@ }, "dependencies": { "@prettier/sync": "*", - "@types/prettier": "*", "@typescript-eslint/rule-tester": "6.8.0", "@typescript-eslint/scope-manager": "6.8.0", "@typescript-eslint/type-utils": "6.8.0", "@typescript-eslint/utils": "6.8.0", - "prettier": "^2.8.4" + "prettier": "^3.0.3" }, "devDependencies": { "jest": "29.7.0", diff --git a/packages/eslint-plugin-tslint/package.json b/packages/eslint-plugin-tslint/package.json index 3c9cdadfc377..29d4343d1c0d 100644 --- a/packages/eslint-plugin-tslint/package.json +++ b/packages/eslint-plugin-tslint/package.json @@ -57,7 +57,7 @@ "@types/lodash": "*", "@typescript-eslint/parser": "6.8.0", "jest": "29.7.0", - "prettier": "^2.8.4", + "prettier": "^3.0.3", "rimraf": "*" }, "funding": { diff --git a/packages/eslint-plugin/package.json b/packages/eslint-plugin/package.json index 1556c3acf5c3..9f8e069f77e4 100644 --- a/packages/eslint-plugin/package.json +++ b/packages/eslint-plugin/package.json @@ -73,7 +73,6 @@ "@types/debug": "*", "@types/marked": "*", "@types/natural-compare": "*", - "@types/prettier": "*", "@typescript-eslint/rule-schema-to-typescript-types": "6.8.0", "@typescript-eslint/rule-tester": "6.8.0", "ajv": "^6.12.6", @@ -85,7 +84,7 @@ "json-schema": "*", "markdown-table": "^3.0.3", "marked": "^5.1.1", - "prettier": "^2.8.4", + "prettier": "^3.0.3", "rimraf": "*", "title-case": "^3.0.3", "tsx": "*", diff --git a/packages/parser/package.json b/packages/parser/package.json index 060ae6868b8c..c960f6f52b3a 100644 --- a/packages/parser/package.json +++ b/packages/parser/package.json @@ -62,7 +62,7 @@ "downlevel-dts": "*", "glob": "*", "jest": "29.7.0", - "prettier": "^2.8.4", + "prettier": "^3.0.3", "rimraf": "*", "typescript": "*" }, diff --git a/packages/repo-tools/package.json b/packages/repo-tools/package.json index 78e130463252..203cf47dc7cd 100644 --- a/packages/repo-tools/package.json +++ b/packages/repo-tools/package.json @@ -17,7 +17,7 @@ "@nx/devkit": "*", "cross-fetch": "*", "execa": "*", - "prettier": "^2.8.4", + "prettier": "^3.0.3", "rimraf": "*", "tmp": "*", "typescript": "*" diff --git a/packages/rule-schema-to-typescript-types/package.json b/packages/rule-schema-to-typescript-types/package.json index 4aff29de8032..843c585ef7e6 100644 --- a/packages/rule-schema-to-typescript-types/package.json +++ b/packages/rule-schema-to-typescript-types/package.json @@ -37,7 +37,7 @@ "@typescript-eslint/type-utils": "6.8.0", "@typescript-eslint/utils": "6.8.0", "natural-compare": "^1.4.0", - "prettier": "^2.8.4" + "prettier": "^3.0.3" }, "funding": { "type": "opencollective", diff --git a/packages/type-utils/package.json b/packages/type-utils/package.json index 4bef583afa8a..a634ea6bea0d 100644 --- a/packages/type-utils/package.json +++ b/packages/type-utils/package.json @@ -55,7 +55,7 @@ "ajv": "^6.10.0", "downlevel-dts": "*", "jest": "29.7.0", - "prettier": "^2.8.4", + "prettier": "^3.0.3", "rimraf": "*", "typescript": "*" }, diff --git a/packages/types/package.json b/packages/types/package.json index 5c9215235be3..79b23109624d 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -74,7 +74,7 @@ }, "devDependencies": { "downlevel-dts": "*", - "prettier": "^2.8.4", + "prettier": "^3.0.3", "rimraf": "*", "tsx": "*", "typescript": "*" diff --git a/packages/typescript-estree/package.json b/packages/typescript-estree/package.json index e1393b9b35af..1f4d549d4ed5 100644 --- a/packages/typescript-estree/package.json +++ b/packages/typescript-estree/package.json @@ -67,7 +67,7 @@ "jest": "29.7.0", "jest-specific-snapshot": "^8.0.0", "make-dir": "*", - "prettier": "^2.8.4", + "prettier": "^3.0.3", "rimraf": "*", "tmp": "*", "typescript": "*" diff --git a/packages/utils/package.json b/packages/utils/package.json index c77e0d25816f..2d304d444bc2 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -80,7 +80,7 @@ "@typescript-eslint/parser": "6.8.0", "downlevel-dts": "*", "jest": "29.7.0", - "prettier": "^2.8.4", + "prettier": "^3.0.3", "rimraf": "*", "typescript": "*" }, diff --git a/packages/visitor-keys/package.json b/packages/visitor-keys/package.json index 97f987cf1708..3cf36f70cc49 100644 --- a/packages/visitor-keys/package.json +++ b/packages/visitor-keys/package.json @@ -52,7 +52,7 @@ "@types/eslint-visitor-keys": "*", "downlevel-dts": "*", "jest": "29.7.0", - "prettier": "^2.8.4", + "prettier": "^3.0.3", "rimraf": "*", "typescript": "*" }, diff --git a/packages/website-eslint/package.json b/packages/website-eslint/package.json index 8fe99d7a08c5..8fd2e543233f 100644 --- a/packages/website-eslint/package.json +++ b/packages/website-eslint/package.json @@ -36,7 +36,7 @@ "esbuild": "~0.19.0", "eslint": "*", "esquery": "*", - "prettier": "^2.8.4", + "prettier": "^3.0.3", "rollup": "^2.75.4", "rollup-plugin-terser": "^7.0.2", "semver": "^7.5.4", diff --git a/packages/website/package.json b/packages/website/package.json index 9947af345852..0b938368f914 100644 --- a/packages/website/package.json +++ b/packages/website/package.json @@ -32,7 +32,7 @@ "json5": "^2.2.3", "konamimojisplosion": "^0.5.2", "lz-string": "^1.5.0", - "prettier": "^2.8.4", + "prettier": "^3.0.3", "prism-react-renderer": "^1.3.3", "react": "^18.2.0", "react-dom": "^18.2.0", diff --git a/yarn.lock b/yarn.lock index 09cf51c148e5..ca2b159ca72c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5487,13 +5487,6 @@ __metadata: languageName: node linkType: hard -"@types/prettier@npm:*, @types/prettier@npm:^2.7.2": - version: 2.7.3 - resolution: "@types/prettier@npm:2.7.3" - checksum: 705384209cea6d1433ff6c187c80dcc0b95d99d5c5ce21a46a9a58060c527973506822e428789d842761e0280d25e3359300f017fbe77b9755bc772ab3dc2f83 - languageName: node - linkType: hard - "@types/prop-types@npm:*": version: 15.7.5 resolution: "@types/prop-types@npm:15.7.5" @@ -5711,7 +5704,7 @@ __metadata: jest-snapshot: ^29.6.2 jest-specific-snapshot: ^8.0.0 make-dir: "*" - prettier: ^2.8.4 + prettier: ^3.0.3 pretty-format: "*" rimraf: "*" typescript: "*" @@ -5723,13 +5716,12 @@ __metadata: resolution: "@typescript-eslint/eslint-plugin-internal@workspace:packages/eslint-plugin-internal" dependencies: "@prettier/sync": "*" - "@types/prettier": "*" "@typescript-eslint/rule-tester": 6.8.0 "@typescript-eslint/scope-manager": 6.8.0 "@typescript-eslint/type-utils": 6.8.0 "@typescript-eslint/utils": 6.8.0 jest: 29.7.0 - prettier: ^2.8.4 + prettier: ^3.0.3 rimraf: "*" languageName: unknown linkType: soft @@ -5742,7 +5734,7 @@ __metadata: "@typescript-eslint/parser": 6.8.0 "@typescript-eslint/utils": 6.8.0 jest: 29.7.0 - prettier: ^2.8.4 + prettier: ^3.0.3 rimraf: "*" peerDependencies: eslint: ^7.0.0 || ^8.0.0 @@ -5760,7 +5752,6 @@ __metadata: "@types/debug": "*" "@types/marked": "*" "@types/natural-compare": "*" - "@types/prettier": "*" "@typescript-eslint/rule-schema-to-typescript-types": 6.8.0 "@typescript-eslint/rule-tester": 6.8.0 "@typescript-eslint/scope-manager": 6.8.0 @@ -5780,7 +5771,7 @@ __metadata: markdown-table: ^3.0.3 marked: ^5.1.1 natural-compare: ^1.4.0 - prettier: ^2.8.4 + prettier: ^3.0.3 rimraf: "*" semver: ^7.5.4 title-case: ^3.0.3 @@ -5818,7 +5809,7 @@ __metadata: downlevel-dts: "*" glob: "*" jest: 29.7.0 - prettier: ^2.8.4 + prettier: ^3.0.3 rimraf: "*" typescript: "*" peerDependencies: @@ -5836,7 +5827,7 @@ __metadata: "@nx/devkit": "*" cross-fetch: "*" execa: "*" - prettier: ^2.8.4 + prettier: ^3.0.3 rimraf: "*" tmp: "*" typescript: "*" @@ -5851,7 +5842,7 @@ __metadata: "@typescript-eslint/type-utils": 6.8.0 "@typescript-eslint/utils": 6.8.0 natural-compare: ^1.4.0 - prettier: ^2.8.4 + prettier: ^3.0.3 languageName: unknown linkType: soft @@ -5914,7 +5905,7 @@ __metadata: debug: ^4.3.4 downlevel-dts: "*" jest: 29.7.0 - prettier: ^2.8.4 + prettier: ^3.0.3 rimraf: "*" ts-api-utils: ^1.0.1 typescript: "*" @@ -5931,7 +5922,7 @@ __metadata: resolution: "@typescript-eslint/types@workspace:packages/types" dependencies: downlevel-dts: "*" - prettier: ^2.8.4 + prettier: ^3.0.3 rimraf: "*" tsx: "*" typescript: "*" @@ -5972,7 +5963,6 @@ __metadata: "@types/natural-compare": ^1.4.1 "@types/ncp": ^2.0.5 "@types/node": ^20.0.0 - "@types/prettier": ^2.7.2 "@types/semver": ^7.5.0 "@types/tmp": ^0.2.3 console-fail-test: ^0.2.3 @@ -6032,7 +6022,7 @@ __metadata: jest: 29.7.0 jest-specific-snapshot: ^8.0.0 make-dir: "*" - prettier: ^2.8.4 + prettier: ^3.0.3 rimraf: "*" semver: ^7.5.4 tmp: "*" @@ -6075,7 +6065,7 @@ __metadata: "@typescript-eslint/typescript-estree": 6.8.0 downlevel-dts: "*" jest: 29.7.0 - prettier: ^2.8.4 + prettier: ^3.0.3 rimraf: "*" semver: ^7.5.4 typescript: "*" @@ -6111,7 +6101,7 @@ __metadata: downlevel-dts: "*" eslint-visitor-keys: ^3.4.1 jest: 29.7.0 - prettier: ^2.8.4 + prettier: ^3.0.3 rimraf: "*" typescript: "*" languageName: unknown @@ -6142,7 +6132,7 @@ __metadata: esbuild: ~0.19.0 eslint: "*" esquery: "*" - prettier: ^2.8.4 + prettier: ^3.0.3 rollup: ^2.75.4 rollup-plugin-terser: ^7.0.2 semver: ^7.5.4 @@ -16820,7 +16810,7 @@ __metadata: languageName: node linkType: hard -"prettier@npm:3.0.3": +"prettier@npm:3.0.3, prettier@npm:^3.0.3": version: 3.0.3 resolution: "prettier@npm:3.0.3" bin: @@ -16829,15 +16819,6 @@ __metadata: languageName: node linkType: hard -"prettier@npm:^2.8.4": - version: 2.8.8 - resolution: "prettier@npm:2.8.8" - bin: - prettier: bin-prettier.js - checksum: b49e409431bf129dd89238d64299ba80717b57ff5a6d1c1a8b1a28b590d998a34e083fa13573bc732bb8d2305becb4c9a4407f8486c81fa7d55100eb08263cf8 - languageName: node - linkType: hard - "pretty-bytes@npm:^5.3.0": version: 5.6.0 resolution: "pretty-bytes@npm:5.6.0" @@ -20788,7 +20769,7 @@ __metadata: lz-string: ^1.5.0 make-dir: "*" monaco-editor: ~0.43.0 - prettier: ^2.8.4 + prettier: ^3.0.3 prism-react-renderer: ^1.3.3 raw-loader: ^4.0.2 react: ^18.2.0 From a0d72bd1eefcb534c1f7e706bbd2ad4edacc5d0a Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Tue, 17 Oct 2023 17:33:50 -0400 Subject: [PATCH 9/9] Fix an extraneous dependency --- packages/repo-tools/package.json | 1 + yarn.lock | 1 + 2 files changed, 2 insertions(+) diff --git a/packages/repo-tools/package.json b/packages/repo-tools/package.json index 203cf47dc7cd..501b127ab905 100644 --- a/packages/repo-tools/package.json +++ b/packages/repo-tools/package.json @@ -15,6 +15,7 @@ }, "devDependencies": { "@nx/devkit": "*", + "@prettier/sync": "*", "cross-fetch": "*", "execa": "*", "prettier": "^3.0.3", diff --git a/yarn.lock b/yarn.lock index ca2b159ca72c..aabfe67553f0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5825,6 +5825,7 @@ __metadata: resolution: "@typescript-eslint/repo-tools@workspace:packages/repo-tools" dependencies: "@nx/devkit": "*" + "@prettier/sync": "*" cross-fetch: "*" execa: "*" prettier: ^3.0.3