diff --git a/.prettierignore b/.prettierignore index e3259c2c815b..6a9febb413a7 100644 --- a/.prettierignore +++ b/.prettierignore @@ -4,25 +4,25 @@ **/.nyc_output **/.vs CONTRIBUTORS.md -packages/ast-spec/src/*/*/fixtures/_error_/*/fixture.ts -packages/eslint-plugin/tests/fixtures/indent/ -# prettier errors on this case because it's semantically valid -packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-abstract-with-value/fixture.ts +.yarn/plugins +.yarn/releases -# prettier doesn't yet support `using` declaration -packages/ast-spec/src/declaration/VariableDeclaration/fixtures/await-using-multiple-declarations/fixture.ts -packages/ast-spec/src/declaration/VariableDeclaration/fixtures/await-using-with-value/fixture.ts -packages/ast-spec/src/declaration/VariableDeclaration/fixtures/using-multiple-declarations/fixture.ts -packages/ast-spec/src/declaration/VariableDeclaration/fixtures/using-with-value/fixture.ts -packages/ast-spec/src/statement/ForOfStatement/fixtures/using-decralation/fixture.ts +packages/eslint-plugin/tests/fixtures/indent/ -# prettier doesn't yet support `const` modifiers for type parameters -packages/ast-spec/src/special/TSTypeParameter/fixtures +# ignore all error fixtures cos they often have intentional syntax errors +packages/ast-spec/src/*/*/fixtures/_error_/*/fixture.ts -# prettier doesn't yet support JSX namespaced attributes -packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component/fixture.tsx -packages/scope-manager/tests/fixtures/jsx/namespaced-attribute.tsx +# TS 5.6 -- string literal import/export specifiers +# TODO - remove this once prettier supports it +packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-aliased-to-string-literal-with-source/fixture.ts +packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-aliased-to-string-literal-without-source/fixture.ts +packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-string-literal-aliased-to-identifier-with-source/fixture.ts +packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-string-literal-many-with-source/fixture.ts +packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-string-literal-with-source/fixture.ts +packages/ast-spec/src/declaration/ImportDeclaration/fixtures/named-string-literal-aliased-to-identifier/fixture.ts +packages/ast-spec/src/special/ExportSpecifier/fixtures/literal-specifier/fixture.ts +packages/ast-spec/src/special/ExportSpecifier/fixtures/value-export-specifier/fixture.ts # Ignore CHANGELOG.md files to avoid issues with automated release job CHANGELOG.md @@ -34,4 +34,4 @@ packages/website/build packages/rule-tester/tests/eslint-base /.nx/cache -/.nx/workspace-data \ No newline at end of file +/.nx/workspace-data diff --git a/.yarn/patches/@microsoft-api-extractor-npm-7.38.0-955f1e0725.patch b/.yarn/patches/@microsoft-api-extractor-npm-7.38.0-955f1e0725.patch deleted file mode 100644 index 4a88d8663c34..000000000000 --- a/.yarn/patches/@microsoft-api-extractor-npm-7.38.0-955f1e0725.patch +++ /dev/null @@ -1,46 +0,0 @@ -diff --git a/lib/analyzer/ExportAnalyzer.js b/lib/analyzer/ExportAnalyzer.js -index 51f31b4f2f253d82adc9594faa58d8dc031957e0..1fddac54b08665f5a5a717fef740613ae921cb7a 100644 ---- a/lib/analyzer/ExportAnalyzer.js -+++ b/lib/analyzer/ExportAnalyzer.js -@@ -193,7 +193,7 @@ class ExportAnalyzer { - const mode = specifier && ts.isStringLiteralLike(specifier) - ? TypeScriptInternals_1.TypeScriptInternals.getModeForUsageLocation(importOrExportDeclaration.getSourceFile(), specifier) - : undefined; -- const resolvedModule = TypeScriptInternals_1.TypeScriptInternals.getResolvedModule(importOrExportDeclaration.getSourceFile(), moduleSpecifier, mode); -+ const resolvedModule = TypeScriptInternals_1.TypeScriptInternals.getResolvedModule(this._program, importOrExportDeclaration.getSourceFile(), moduleSpecifier, mode); - if (resolvedModule === undefined) { - // The TS compiler API `getResolvedModule` cannot resolve ambient modules. Thus, to match API Extractor's - // previous behavior, simply treat all ambient modules as external. This bug is tracked by -@@ -666,7 +666,7 @@ class ExportAnalyzer { - ts.isStringLiteralLike(importOrExportDeclaration.moduleSpecifier) - ? TypeScriptInternals_1.TypeScriptInternals.getModeForUsageLocation(importOrExportDeclaration.getSourceFile(), importOrExportDeclaration.moduleSpecifier) - : undefined; -- const resolvedModule = TypeScriptInternals_1.TypeScriptInternals.getResolvedModule(importOrExportDeclaration.getSourceFile(), moduleSpecifier, mode); -+ const resolvedModule = TypeScriptInternals_1.TypeScriptInternals.getResolvedModule(this._program, importOrExportDeclaration.getSourceFile(), moduleSpecifier, mode); - if (resolvedModule === undefined) { - // Encountered in https://github.com/microsoft/rushstack/issues/1914. - // -diff --git a/lib/analyzer/TypeScriptInternals.js b/lib/analyzer/TypeScriptInternals.js -index ff13db7709ccf502fe202337869d4024431636c9..217c36b0303c3bf9871edabcd48fbf6e09f18561 100644 ---- a/lib/analyzer/TypeScriptInternals.js -+++ b/lib/analyzer/TypeScriptInternals.js -@@ -84,10 +84,16 @@ class TypeScriptInternals { - * Retrieves the (cached) module resolution information for a module name that was exported from a SourceFile. - * The compiler populates this cache as part of analyzing the source file. - */ -- static getResolvedModule(sourceFile, moduleNameText, mode) { -+ static getResolvedModule(program, sourceFile, moduleNameText, mode) { - // Compiler internal: -- // https://github.com/microsoft/TypeScript/blob/v4.7.2/src/compiler/utilities.ts#L161 -- return ts.getResolvedModule(sourceFile, moduleNameText, mode); -+ // https://github.com/microsoft/TypeScript/blob/v5.3-beta/src/compiler/types.ts#L4678 -+ const result = program.getResolvedModule( -+ sourceFile, -+ moduleNameText, -+ mode -+ ); -+ return result?.resolvedModule; -+ - } - /** - * Gets the mode required for module resolution required with the addition of Node16/nodenext diff --git a/docs/maintenance/pull-requests/Dependency_Version_Upgrades.mdx b/docs/maintenance/pull-requests/Dependency_Version_Upgrades.mdx index 15ae0340c358..596c7ea0611e 100644 --- a/docs/maintenance/pull-requests/Dependency_Version_Upgrades.mdx +++ b/docs/maintenance/pull-requests/Dependency_Version_Upgrades.mdx @@ -137,13 +137,11 @@ We generally start the process of supporting a new TypeScript version just after - In the parser's `getLib`, update the `switch (target)` and its preceding comment as needed (see [#6782](https://github.com/typescript-eslint/typescript-eslint/pull/6782)) - Change the `SUPPORTED_TYPESCRIPT_VERSIONS` constant's `<` version to the next version of TypeScript - Change the `SUPPORTED_PRERELEASE_RANGES` constant to equal `['X.Y.1-rc']` - - Rename and update `patches/typescript*` to the new TypeScript version - Run `yarn generate-lib` to update `scope-manager` 1. Once all PRs needed for the RC update PR are merged, merge the RC update PR 1. Once TypeScript releases the stable X.Y version, create and merge a PR with a title like `chore: bump TypeScript from X.YRC to X.Y` and the following changes: - In the root `package.json`, remove `|| X.Y.1-rc2` from the `dependency` on `typescript`, and bump its `<` version to the next version of TypeScript - In the root `package.json`, change the `resolutions` on `typescript` to `X.Y.3` - - Rename and update `patches/typescript*` to the new TypeScript version - Any other changes made necessary due to changes in TypeScript between the RC version and stable version 1. Send a PR that updates this documentation page to point to your newer issues and PRs - Also update any of these steps if you go with a different process diff --git a/package.json b/package.json index eaec4491d431..0b656908bd71 100644 --- a/package.json +++ b/package.json @@ -124,7 +124,7 @@ "semver": "7.6.2", "tmp": "^0.2.1", "tsx": "*", - "typescript": ">=4.8.4 <5.6.0", + "typescript": ">=4.8.4 <5.7.0", "typescript-eslint": "workspace:^", "yargs": "17.7.2" }, @@ -132,23 +132,23 @@ "@jest/create-cache-key-function": "^29", "@jest/reporters": "^29", "@jest/test-result": "^29", - "@microsoft/api-extractor@^7.38.0": "patch:@microsoft/api-extractor@npm%3A7.38.0#./.yarn/patches/@microsoft-api-extractor-npm-7.38.0-955f1e0725.patch", "@types/eslint-scope": "link:./tools/dummypkg", "@types/eslint": "link:./tools/dummypkg", "@types/estree": "link:./tools/dummypkg", "@types/node": "^20.0.0", "@types/react": "^18.2.14", "eslint": "^9", + "eslint-plugin-eslint-plugin@^5.5.0": "patch:eslint-plugin-eslint-plugin@npm%3A5.5.1#./.yarn/patches/eslint-plugin-eslint-plugin-npm-5.5.1-4206c2506d.patch", "eslint-visitor-keys": "^3.4.1", "jest-config": "^29", "jest-resolve": "^29", "jest-util": "^29", + "prettier": "3.3.2", "pretty-format": "^29", "react-split-pane@^0.1.92": "patch:react-split-pane@npm%3A0.1.92#./.yarn/patches/react-split-pane-npm-0.1.92-93dbf51dff.patch", "tmp": "0.2.1", "tsx": "^4.7.2", - "typescript": "5.5.2", - "eslint-plugin-eslint-plugin@^5.5.0": "patch:eslint-plugin-eslint-plugin@npm%3A5.5.1#./.yarn/patches/eslint-plugin-eslint-plugin-npm-5.5.1-4206c2506d.patch" + "typescript": "5.6.2" }, "packageManager": "yarn@3.8.2", "nx": { diff --git a/packages/ast-spec/package.json b/packages/ast-spec/package.json index 1dea62fb271f..691b74f0a14f 100644 --- a/packages/ast-spec/package.json +++ b/packages/ast-spec/package.json @@ -48,7 +48,7 @@ "@babel/core": "*", "@babel/eslint-parser": "*", "@jest/types": "29.6.3", - "@microsoft/api-extractor": "^7.43.0", + "@microsoft/api-extractor": "^7.47.11", "glob": "*", "jest": "29.7.0", "jest-diff": "^29.7.0", diff --git a/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/named-non-identifier/fixture.ts b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/named-non-identifier/fixture.ts deleted file mode 100644 index 8bab23b35992..000000000000 --- a/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/named-non-identifier/fixture.ts +++ /dev/null @@ -1 +0,0 @@ -export * as 'foo' from 'module'; diff --git a/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/named-non-identifier/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/named-non-identifier/snapshots/1-Babel-Error.shot deleted file mode 100644 index 04ccfb73d5bb..000000000000 --- a/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/named-non-identifier/snapshots/1-Babel-Error.shot +++ /dev/null @@ -1,3 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`AST Fixtures declaration ExportAllDeclaration _error_ named-non-identifier Babel - Error 1`] = `"NO ERROR"`; diff --git a/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/named-non-identifier/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/named-non-identifier/snapshots/1-TSESTree-Error.shot deleted file mode 100644 index cea1b9f24689..000000000000 --- a/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/named-non-identifier/snapshots/1-TSESTree-Error.shot +++ /dev/null @@ -1,8 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`AST Fixtures declaration ExportAllDeclaration _error_ named-non-identifier TSESTree - Error 1`] = ` -"TSError -> 1 | export * as 'foo' from 'module'; - | ^ Identifier expected. - 2 |" -`; diff --git a/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/named-non-identifier/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/named-non-identifier/snapshots/2-Alignment-Error.shot deleted file mode 100644 index 3e05e98bfafd..000000000000 --- a/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/named-non-identifier/snapshots/2-Alignment-Error.shot +++ /dev/null @@ -1,3 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`AST Fixtures declaration ExportAllDeclaration _error_ named-non-identifier Error Alignment 1`] = `"TSESTree errored but Babel didn't"`; diff --git a/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/named-non-identifier/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/named-non-identifier/snapshots/2-Babel-Error.shot deleted file mode 100644 index 04ccfb73d5bb..000000000000 --- a/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/named-non-identifier/snapshots/2-Babel-Error.shot +++ /dev/null @@ -1,3 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`AST Fixtures declaration ExportAllDeclaration _error_ named-non-identifier Babel - Error 1`] = `"NO ERROR"`; diff --git a/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/named-non-identifier/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/named-non-identifier/snapshots/3-Alignment-Error.shot deleted file mode 100644 index 3e05e98bfafd..000000000000 --- a/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/named-non-identifier/snapshots/3-Alignment-Error.shot +++ /dev/null @@ -1,3 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`AST Fixtures declaration ExportAllDeclaration _error_ named-non-identifier Error Alignment 1`] = `"TSESTree errored but Babel didn't"`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/aliased-literal/fixture.ts b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/aliased-literal/fixture.ts deleted file mode 100644 index 5faf31b8867a..000000000000 --- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/aliased-literal/fixture.ts +++ /dev/null @@ -1 +0,0 @@ -export { a as 'a' }; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-identifier-aliased-to-number-literal-with-source/fixture.ts b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-identifier-aliased-to-number-literal-with-source/fixture.ts new file mode 100644 index 000000000000..3f4367e53b55 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-identifier-aliased-to-number-literal-with-source/fixture.ts @@ -0,0 +1 @@ +export { a as 1 } from 'mod'; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-identifier-aliased-to-number-literal-with-source/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-identifier-aliased-to-number-literal-with-source/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..24f7b42f0b77 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-identifier-aliased-to-number-literal-with-source/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,8 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration _error_ braced-identifier-aliased-to-number-literal-with-source TSESTree - Error 1`] = ` +"TSError +> 1 | export { a as 1 } from 'mod'; + | ^ Identifier expected. + 2 |" +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-identifier-aliased-to-number-literal-with-source/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-identifier-aliased-to-number-literal-with-source/snapshots/2-Babel-Error.shot new file mode 100644 index 000000000000..b084f34a5da0 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-identifier-aliased-to-number-literal-with-source/snapshots/2-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration _error_ braced-identifier-aliased-to-number-literal-with-source Babel - Error 1`] = `[SyntaxError: Unexpected token (1:14)]`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-identifier-aliased-to-number-literal-with-source/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-identifier-aliased-to-number-literal-with-source/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..c8ad6c49c869 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-identifier-aliased-to-number-literal-with-source/snapshots/3-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration _error_ braced-identifier-aliased-to-number-literal-with-source Error Alignment 1`] = `"Both errored"`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-identifier-aliased-to-number-literal-without-source/fixture.ts b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-identifier-aliased-to-number-literal-without-source/fixture.ts new file mode 100644 index 000000000000..504dbf44ba01 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-identifier-aliased-to-number-literal-without-source/fixture.ts @@ -0,0 +1 @@ +export { a as 1 }; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/aliased-literal/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-identifier-aliased-to-number-literal-without-source/snapshots/1-TSESTree-Error.shot similarity index 60% rename from packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/aliased-literal/snapshots/1-TSESTree-Error.shot rename to packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-identifier-aliased-to-number-literal-without-source/snapshots/1-TSESTree-Error.shot index 015ff072aa2f..7b7fbf69df5c 100644 --- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/aliased-literal/snapshots/1-TSESTree-Error.shot +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-identifier-aliased-to-number-literal-without-source/snapshots/1-TSESTree-Error.shot @@ -1,8 +1,8 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration ExportNamedDeclaration _error_ aliased-literal TSESTree - Error 1`] = ` +exports[`AST Fixtures declaration ExportNamedDeclaration _error_ braced-identifier-aliased-to-number-literal-without-source TSESTree - Error 1`] = ` "TSError -> 1 | export { a as 'a' }; +> 1 | export { a as 1 }; | ^ Identifier expected. 2 |" `; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-identifier-aliased-to-number-literal-without-source/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-identifier-aliased-to-number-literal-without-source/snapshots/2-Babel-Error.shot new file mode 100644 index 000000000000..fcbf3dc6d452 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-identifier-aliased-to-number-literal-without-source/snapshots/2-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration _error_ braced-identifier-aliased-to-number-literal-without-source Babel - Error 1`] = `[SyntaxError: Unexpected token (1:14)]`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-identifier-aliased-to-number-literal-without-source/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-identifier-aliased-to-number-literal-without-source/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..922f7f21f6de --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-identifier-aliased-to-number-literal-without-source/snapshots/3-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration _error_ braced-identifier-aliased-to-number-literal-without-source Error Alignment 1`] = `"Both errored"`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-number-literal-with-source/fixture.ts b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-number-literal-with-source/fixture.ts new file mode 100644 index 000000000000..b74776276410 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-number-literal-with-source/fixture.ts @@ -0,0 +1 @@ +export { 1 } from 'mod'; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-number-literal-with-source/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-number-literal-with-source/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..4236bc62af00 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-number-literal-with-source/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,8 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration _error_ braced-number-literal-with-source TSESTree - Error 1`] = ` +"TSError +> 1 | export { 1 } from 'mod'; + | ^ Identifier expected. + 2 |" +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/aliased-literal/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-number-literal-with-source/snapshots/2-Babel-Error.shot similarity index 52% rename from packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/aliased-literal/snapshots/1-Babel-Error.shot rename to packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-number-literal-with-source/snapshots/2-Babel-Error.shot index dabc7d927d5d..f9d04b880622 100644 --- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/aliased-literal/snapshots/1-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-number-literal-with-source/snapshots/2-Babel-Error.shot @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration ExportNamedDeclaration _error_ aliased-literal Babel - Error 1`] = `"NO ERROR"`; +exports[`AST Fixtures declaration ExportNamedDeclaration _error_ braced-number-literal-with-source Babel - Error 1`] = `[SyntaxError: Unexpected token (1:9)]`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/literal-braced/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-number-literal-with-source/snapshots/3-Alignment-Error.shot similarity index 59% rename from packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/literal-braced/snapshots/3-Alignment-Error.shot rename to packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-number-literal-with-source/snapshots/3-Alignment-Error.shot index f2d4bb40cc50..7db9712e5305 100644 --- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/literal-braced/snapshots/3-Alignment-Error.shot +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-number-literal-with-source/snapshots/3-Alignment-Error.shot @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration ExportNamedDeclaration _error_ literal-braced Error Alignment 1`] = `"Both errored"`; +exports[`AST Fixtures declaration ExportNamedDeclaration _error_ braced-number-literal-with-source Error Alignment 1`] = `"Both errored"`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-number-literal-without-source/fixture.ts b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-number-literal-without-source/fixture.ts new file mode 100644 index 000000000000..fa1afc8165af --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-number-literal-without-source/fixture.ts @@ -0,0 +1 @@ +export { 1 }; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/literal-braced/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-number-literal-without-source/snapshots/1-TSESTree-Error.shot similarity index 66% rename from packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/literal-braced/snapshots/1-TSESTree-Error.shot rename to packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-number-literal-without-source/snapshots/1-TSESTree-Error.shot index 55c09361565e..b8091168e53b 100644 --- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/literal-braced/snapshots/1-TSESTree-Error.shot +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-number-literal-without-source/snapshots/1-TSESTree-Error.shot @@ -1,8 +1,8 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration ExportNamedDeclaration _error_ literal-braced TSESTree - Error 1`] = ` +exports[`AST Fixtures declaration ExportNamedDeclaration _error_ braced-number-literal-without-source TSESTree - Error 1`] = ` "TSError -> 1 | export { 'a' }; +> 1 | export { 1 }; | ^ Identifier expected. 2 |" `; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-number-literal-without-source/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-number-literal-without-source/snapshots/2-Babel-Error.shot new file mode 100644 index 000000000000..027935e43e47 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-number-literal-without-source/snapshots/2-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration _error_ braced-number-literal-without-source Babel - Error 1`] = `[SyntaxError: Unexpected token (1:9)]`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/aliased-literal/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-number-literal-without-source/snapshots/3-Alignment-Error.shot similarity index 58% rename from packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/aliased-literal/snapshots/3-Alignment-Error.shot rename to packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-number-literal-without-source/snapshots/3-Alignment-Error.shot index efb973998424..0b69103437fe 100644 --- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/aliased-literal/snapshots/3-Alignment-Error.shot +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-number-literal-without-source/snapshots/3-Alignment-Error.shot @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration ExportNamedDeclaration _error_ aliased-literal Error Alignment 1`] = `"TSESTree errored but Babel didn't"`; +exports[`AST Fixtures declaration ExportNamedDeclaration _error_ braced-number-literal-without-source Error Alignment 1`] = `"Both errored"`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-aliased-to-identifier-without-source/fixture.ts b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-aliased-to-identifier-without-source/fixture.ts new file mode 100644 index 000000000000..7bf13642b5a3 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-aliased-to-identifier-without-source/fixture.ts @@ -0,0 +1 @@ +export { 'a a' as b }; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-aliased-to-identifier-without-source/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-aliased-to-identifier-without-source/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..c0cb744a406c --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-aliased-to-identifier-without-source/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,8 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration _error_ braced-string-literal-aliased-to-identifier-without-source TSESTree - Error 1`] = ` +"TSError +> 1 | export { 'a a' as b }; + | ^^^^^ A string literal cannot be used as a local exported binding without \`from\`. + 2 |" +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-aliased-to-identifier-without-source/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-aliased-to-identifier-without-source/snapshots/2-Babel-Error.shot new file mode 100644 index 000000000000..8a5bd0de2a8c --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-aliased-to-identifier-without-source/snapshots/2-Babel-Error.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration _error_ braced-string-literal-aliased-to-identifier-without-source Babel - Error 1`] = ` +[SyntaxError: A string literal cannot be used as an exported binding without \`from\`. +- Did you mean \`export { 'a a' as 'b' } from 'some-module'\`? (1:9)] +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-aliased-to-identifier-without-source/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-aliased-to-identifier-without-source/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..f36da5abefdc --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-aliased-to-identifier-without-source/snapshots/3-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration _error_ braced-string-literal-aliased-to-identifier-without-source Error Alignment 1`] = `"Both errored"`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-aliased-to-number-literal-without-source/fixture.ts b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-aliased-to-number-literal-without-source/fixture.ts new file mode 100644 index 000000000000..f0ce06919277 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-aliased-to-number-literal-without-source/fixture.ts @@ -0,0 +1 @@ +export { 'a a' as 1 }; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-aliased-to-number-literal-without-source/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-aliased-to-number-literal-without-source/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..8e6e90c6f422 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-aliased-to-number-literal-without-source/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,8 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration _error_ braced-string-literal-aliased-to-number-literal-without-source TSESTree - Error 1`] = ` +"TSError +> 1 | export { 'a a' as 1 }; + | ^ Identifier expected. + 2 |" +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-aliased-to-number-literal-without-source/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-aliased-to-number-literal-without-source/snapshots/2-Babel-Error.shot new file mode 100644 index 000000000000..59e6552db777 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-aliased-to-number-literal-without-source/snapshots/2-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration _error_ braced-string-literal-aliased-to-number-literal-without-source Babel - Error 1`] = `[SyntaxError: Unexpected token (1:18)]`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-aliased-to-number-literal-without-source/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-aliased-to-number-literal-without-source/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..5d822c09ed07 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-aliased-to-number-literal-without-source/snapshots/3-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration _error_ braced-string-literal-aliased-to-number-literal-without-source Error Alignment 1`] = `"Both errored"`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-aliased-to-string-literal-without-source/fixture.ts b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-aliased-to-string-literal-without-source/fixture.ts new file mode 100644 index 000000000000..a54a56ad01ed --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-aliased-to-string-literal-without-source/fixture.ts @@ -0,0 +1 @@ +export { 'a a' as 'b b' }; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-aliased-to-string-literal-without-source/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-aliased-to-string-literal-without-source/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..abff37aa4a9e --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-aliased-to-string-literal-without-source/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,8 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration _error_ braced-string-literal-aliased-to-string-literal-without-source TSESTree - Error 1`] = ` +"TSError +> 1 | export { 'a a' as 'b b' }; + | ^^^^^ A string literal cannot be used as a local exported binding without \`from\`. + 2 |" +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-aliased-to-string-literal-without-source/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-aliased-to-string-literal-without-source/snapshots/2-Babel-Error.shot new file mode 100644 index 000000000000..383648bd3c68 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-aliased-to-string-literal-without-source/snapshots/2-Babel-Error.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration _error_ braced-string-literal-aliased-to-string-literal-without-source Babel - Error 1`] = ` +[SyntaxError: A string literal cannot be used as an exported binding without \`from\`. +- Did you mean \`export { 'a a' as 'b b' } from 'some-module'\`? (1:9)] +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-aliased-to-string-literal-without-source/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-aliased-to-string-literal-without-source/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..bd27647c8d0e --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-aliased-to-string-literal-without-source/snapshots/3-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration _error_ braced-string-literal-aliased-to-string-literal-without-source Error Alignment 1`] = `"Both errored"`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-many-without-source/fixture.ts b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-many-without-source/fixture.ts new file mode 100644 index 000000000000..93341fb488d5 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-many-without-source/fixture.ts @@ -0,0 +1 @@ +export { 'a a', 'b b' }; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-many-without-source/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-many-without-source/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..3b9ad821bd0c --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-many-without-source/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,8 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration _error_ braced-string-literal-many-without-source TSESTree - Error 1`] = ` +"TSError +> 1 | export { 'a a', 'b b' }; + | ^^^^^ A string literal cannot be used as a local exported binding without \`from\`. + 2 |" +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/literal-braced/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-many-without-source/snapshots/2-Babel-Error.shot similarity index 59% rename from packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/literal-braced/snapshots/1-Babel-Error.shot rename to packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-many-without-source/snapshots/2-Babel-Error.shot index 3ba27489473b..2ee71a5daf29 100644 --- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/literal-braced/snapshots/1-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-many-without-source/snapshots/2-Babel-Error.shot @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration ExportNamedDeclaration _error_ literal-braced Babel - Error 1`] = ` +exports[`AST Fixtures declaration ExportNamedDeclaration _error_ braced-string-literal-many-without-source Babel - Error 1`] = ` [SyntaxError: A string literal cannot be used as an exported binding without \`from\`. -- Did you mean \`export { 'a' as 'a' } from 'some-module'\`? (1:9)] +- Did you mean \`export { 'a a' as 'a a' } from 'some-module'\`? (1:9)] `; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/aliased-literal/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-many-without-source/snapshots/3-Alignment-Error.shot similarity index 56% rename from packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/aliased-literal/snapshots/2-Babel-Error.shot rename to packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-many-without-source/snapshots/3-Alignment-Error.shot index dabc7d927d5d..40240523bf45 100644 --- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/aliased-literal/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-many-without-source/snapshots/3-Alignment-Error.shot @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration ExportNamedDeclaration _error_ aliased-literal Babel - Error 1`] = `"NO ERROR"`; +exports[`AST Fixtures declaration ExportNamedDeclaration _error_ braced-string-literal-many-without-source Error Alignment 1`] = `"Both errored"`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-without-source/fixture.ts b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-without-source/fixture.ts new file mode 100644 index 000000000000..838871242b23 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-without-source/fixture.ts @@ -0,0 +1 @@ +export { 'a a' }; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-without-source/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-without-source/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..4aab1a3ea4a8 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-without-source/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,8 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration _error_ braced-string-literal-without-source TSESTree - Error 1`] = ` +"TSError +> 1 | export { 'a a' }; + | ^^^^^ A string literal cannot be used as a local exported binding without \`from\`. + 2 |" +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/literal-braced/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-without-source/snapshots/2-Babel-Error.shot similarity index 60% rename from packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/literal-braced/snapshots/2-Babel-Error.shot rename to packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-without-source/snapshots/2-Babel-Error.shot index 3ba27489473b..23fb23d4e816 100644 --- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/literal-braced/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-without-source/snapshots/2-Babel-Error.shot @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration ExportNamedDeclaration _error_ literal-braced Babel - Error 1`] = ` +exports[`AST Fixtures declaration ExportNamedDeclaration _error_ braced-string-literal-without-source Babel - Error 1`] = ` [SyntaxError: A string literal cannot be used as an exported binding without \`from\`. -- Did you mean \`export { 'a' as 'a' } from 'some-module'\`? (1:9)] +- Did you mean \`export { 'a a' as 'a a' } from 'some-module'\`? (1:9)] `; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/aliased-literal/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-without-source/snapshots/3-Alignment-Error.shot similarity index 58% rename from packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/aliased-literal/snapshots/2-Alignment-Error.shot rename to packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-without-source/snapshots/3-Alignment-Error.shot index efb973998424..1ca50acedcb8 100644 --- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/aliased-literal/snapshots/2-Alignment-Error.shot +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/braced-string-literal-without-source/snapshots/3-Alignment-Error.shot @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration ExportNamedDeclaration _error_ aliased-literal Error Alignment 1`] = `"TSESTree errored but Babel didn't"`; +exports[`AST Fixtures declaration ExportNamedDeclaration _error_ braced-string-literal-without-source Error Alignment 1`] = `"Both errored"`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/literal-braced/fixture.ts b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/literal-braced/fixture.ts deleted file mode 100644 index 7eec000d816d..000000000000 --- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/literal-braced/fixture.ts +++ /dev/null @@ -1 +0,0 @@ -export { 'a' }; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/literal-braced/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/literal-braced/snapshots/2-Alignment-Error.shot deleted file mode 100644 index f2d4bb40cc50..000000000000 --- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/literal-braced/snapshots/2-Alignment-Error.shot +++ /dev/null @@ -1,3 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`AST Fixtures declaration ExportNamedDeclaration _error_ literal-braced Error Alignment 1`] = `"Both errored"`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-aliased-to-identifier-with-source/fixture.ts b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-aliased-to-identifier-with-source/fixture.ts new file mode 100644 index 000000000000..7d1a5a7aa3a5 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-aliased-to-identifier-with-source/fixture.ts @@ -0,0 +1 @@ +export { a as b } from 'mod'; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-aliased-to-identifier-with-source/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-aliased-to-identifier-with-source/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..78f189622475 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-aliased-to-identifier-with-source/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,75 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration braced-identifier-aliased-to-identifier-with-source TSESTree - AST 1`] = ` +Program { + type: "Program", + body: [ + ExportNamedDeclaration { + type: "ExportNamedDeclaration", + attributes: [], + declaration: null, + exportKind: "value", + source: Literal { + type: "Literal", + raw: "'mod'", + value: "mod", + + range: [23, 28], + loc: { + start: { column: 23, line: 1 }, + end: { column: 28, line: 1 }, + }, + }, + specifiers: [ + ExportSpecifier { + type: "ExportSpecifier", + exported: Identifier { + type: "Identifier", + decorators: [], + name: "b", + optional: false, + + range: [14, 15], + loc: { + start: { column: 14, line: 1 }, + end: { column: 15, line: 1 }, + }, + }, + exportKind: "value", + local: Identifier { + type: "Identifier", + decorators: [], + name: "a", + optional: false, + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + + range: [9, 15], + loc: { + start: { column: 9, line: 1 }, + end: { column: 15, line: 1 }, + }, + }, + ], + + range: [0, 29], + loc: { + start: { column: 0, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + ], + sourceType: "module", + + range: [0, 30], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-aliased-to-identifier-with-source/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-aliased-to-identifier-with-source/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..b975c782fc4a --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-aliased-to-identifier-with-source/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,96 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration braced-identifier-aliased-to-identifier-with-source TSESTree - Tokens 1`] = ` +[ + Keyword { + type: "Keyword", + value: "export", + + range: [0, 6], + loc: { + start: { column: 0, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [7, 8], + loc: { + start: { column: 7, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "as", + + range: [11, 13], + loc: { + start: { column: 11, line: 1 }, + end: { column: 13, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "b", + + range: [14, 15], + loc: { + start: { column: 14, line: 1 }, + end: { column: 15, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [16, 17], + loc: { + start: { column: 16, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "from", + + range: [18, 22], + loc: { + start: { column: 18, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + String { + type: "String", + value: "'mod'", + + range: [23, 28], + loc: { + start: { column: 23, line: 1 }, + end: { column: 28, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [28, 29], + loc: { + start: { column: 28, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-aliased-to-identifier-with-source/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-aliased-to-identifier-with-source/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..20876dca3105 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-aliased-to-identifier-with-source/snapshots/3-Babel-AST.shot @@ -0,0 +1,71 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration braced-identifier-aliased-to-identifier-with-source Babel - AST 1`] = ` +Program { + type: "Program", + body: [ + ExportNamedDeclaration { + type: "ExportNamedDeclaration", + assertions: [], + declaration: null, + exportKind: "value", + source: Literal { + type: "Literal", + raw: "'mod'", + value: "mod", + + range: [23, 28], + loc: { + start: { column: 23, line: 1 }, + end: { column: 28, line: 1 }, + }, + }, + specifiers: [ + ExportSpecifier { + type: "ExportSpecifier", + exported: Identifier { + type: "Identifier", + name: "b", + + range: [14, 15], + loc: { + start: { column: 14, line: 1 }, + end: { column: 15, line: 1 }, + }, + }, + exportKind: "value", + local: Identifier { + type: "Identifier", + name: "a", + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + + range: [9, 15], + loc: { + start: { column: 9, line: 1 }, + end: { column: 15, line: 1 }, + }, + }, + ], + + range: [0, 29], + loc: { + start: { column: 0, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + ], + sourceType: "module", + + range: [0, 30], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-aliased-to-identifier-with-source/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-aliased-to-identifier-with-source/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..56aac5f39800 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-aliased-to-identifier-with-source/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,96 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration braced-identifier-aliased-to-identifier-with-source Babel - Tokens 1`] = ` +[ + Keyword { + type: "Keyword", + value: "export", + + range: [0, 6], + loc: { + start: { column: 0, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [7, 8], + loc: { + start: { column: 7, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "as", + + range: [11, 13], + loc: { + start: { column: 11, line: 1 }, + end: { column: 13, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "b", + + range: [14, 15], + loc: { + start: { column: 14, line: 1 }, + end: { column: 15, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [16, 17], + loc: { + start: { column: 16, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "from", + + range: [18, 22], + loc: { + start: { column: 18, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + String { + type: "String", + value: "'mod'", + + range: [23, 28], + loc: { + start: { column: 23, line: 1 }, + end: { column: 28, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [28, 29], + loc: { + start: { column: 28, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-aliased-to-identifier-with-source/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-aliased-to-identifier-with-source/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..91755224f540 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-aliased-to-identifier-with-source/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,80 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration braced-identifier-aliased-to-identifier-with-source AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ExportNamedDeclaration { + type: 'ExportNamedDeclaration', +- attributes: Array [], ++ assertions: Array [], + declaration: null, + exportKind: 'value', + source: Literal { + type: 'Literal', + raw: '\\'mod\\'', + value: 'mod', + + range: [23, 28], + loc: { + start: { column: 23, line: 1 }, + end: { column: 28, line: 1 }, + }, + }, + specifiers: Array [ + ExportSpecifier { + type: 'ExportSpecifier', + exported: Identifier { + type: 'Identifier', +- decorators: Array [], + name: 'b', +- optional: false, + + range: [14, 15], + loc: { + start: { column: 14, line: 1 }, + end: { column: 15, line: 1 }, + }, + }, + exportKind: 'value', + local: Identifier { + type: 'Identifier', +- decorators: Array [], + name: 'a', +- optional: false, + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + + range: [9, 15], + loc: { + start: { column: 9, line: 1 }, + end: { column: 15, line: 1 }, + }, + }, + ], + + range: [0, 29], + loc: { + start: { column: 0, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + ], + sourceType: 'module', + + range: [0, 30], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, + }" +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-aliased-to-identifier-with-source/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-aliased-to-identifier-with-source/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..5e0e4b49653a --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-aliased-to-identifier-with-source/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration braced-identifier-aliased-to-identifier-with-source AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/aliased/fixture.ts b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-aliased-to-identifier-without-source/fixture.ts similarity index 100% rename from packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/aliased/fixture.ts rename to packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-aliased-to-identifier-without-source/fixture.ts diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/aliased/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-aliased-to-identifier-without-source/snapshots/1-TSESTree-AST.shot similarity index 91% rename from packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/aliased/snapshots/1-TSESTree-AST.shot rename to packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-aliased-to-identifier-without-source/snapshots/1-TSESTree-AST.shot index 1b2d074fc6ef..f0e126d60d9e 100644 --- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/aliased/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-aliased-to-identifier-without-source/snapshots/1-TSESTree-AST.shot @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration ExportNamedDeclaration aliased TSESTree - AST 1`] = ` +exports[`AST Fixtures declaration ExportNamedDeclaration braced-identifier-aliased-to-identifier-without-source TSESTree - AST 1`] = ` Program { type: "Program", body: [ diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/aliased/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-aliased-to-identifier-without-source/snapshots/2-TSESTree-Tokens.shot similarity index 90% rename from packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/aliased/snapshots/2-TSESTree-Tokens.shot rename to packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-aliased-to-identifier-without-source/snapshots/2-TSESTree-Tokens.shot index 8bdbd3c34b8f..1b39423e8fe0 100644 --- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/aliased/snapshots/2-TSESTree-Tokens.shot +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-aliased-to-identifier-without-source/snapshots/2-TSESTree-Tokens.shot @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration ExportNamedDeclaration aliased TSESTree - Tokens 1`] = ` +exports[`AST Fixtures declaration ExportNamedDeclaration braced-identifier-aliased-to-identifier-without-source TSESTree - Tokens 1`] = ` [ Keyword { type: "Keyword", diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/aliased/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-aliased-to-identifier-without-source/snapshots/3-Babel-AST.shot similarity index 90% rename from packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/aliased/snapshots/3-Babel-AST.shot rename to packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-aliased-to-identifier-without-source/snapshots/3-Babel-AST.shot index 2027ecaf04ea..cb9de6bf21d8 100644 --- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/aliased/snapshots/3-Babel-AST.shot +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-aliased-to-identifier-without-source/snapshots/3-Babel-AST.shot @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration ExportNamedDeclaration aliased Babel - AST 1`] = ` +exports[`AST Fixtures declaration ExportNamedDeclaration braced-identifier-aliased-to-identifier-without-source Babel - AST 1`] = ` Program { type: "Program", body: [ diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/aliased/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-aliased-to-identifier-without-source/snapshots/4-Babel-Tokens.shot similarity index 90% rename from packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/aliased/snapshots/4-Babel-Tokens.shot rename to packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-aliased-to-identifier-without-source/snapshots/4-Babel-Tokens.shot index 68b9dbc1c3fd..f2cee18f8cc6 100644 --- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/aliased/snapshots/4-Babel-Tokens.shot +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-aliased-to-identifier-without-source/snapshots/4-Babel-Tokens.shot @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration ExportNamedDeclaration aliased Babel - Tokens 1`] = ` +exports[`AST Fixtures declaration ExportNamedDeclaration braced-identifier-aliased-to-identifier-without-source Babel - Tokens 1`] = ` [ Keyword { type: "Keyword", diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/aliased/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-aliased-to-identifier-without-source/snapshots/5-AST-Alignment-AST.shot similarity index 92% rename from packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/aliased/snapshots/5-AST-Alignment-AST.shot rename to packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-aliased-to-identifier-without-source/snapshots/5-AST-Alignment-AST.shot index 1fd302c11434..71c86d6ccd1a 100644 --- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/aliased/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-aliased-to-identifier-without-source/snapshots/5-AST-Alignment-AST.shot @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration ExportNamedDeclaration aliased AST Alignment - AST 1`] = ` +exports[`AST Fixtures declaration ExportNamedDeclaration braced-identifier-aliased-to-identifier-without-source AST Alignment - AST 1`] = ` "Snapshot Diff: - TSESTree + Babel diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-aliased-to-identifier-without-source/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-aliased-to-identifier-without-source/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..7a4d0886e2a1 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-aliased-to-identifier-without-source/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration braced-identifier-aliased-to-identifier-without-source AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-aliased-to-string-literal-with-source/fixture.ts b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-aliased-to-string-literal-with-source/fixture.ts new file mode 100644 index 000000000000..2793b054c40a --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-aliased-to-string-literal-with-source/fixture.ts @@ -0,0 +1 @@ +export { a as 'b' } from 'mod'; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-aliased-to-string-literal-with-source/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-aliased-to-string-literal-with-source/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..12303ecaa5d2 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-aliased-to-string-literal-with-source/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,74 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration braced-identifier-aliased-to-string-literal-with-source TSESTree - AST 1`] = ` +Program { + type: "Program", + body: [ + ExportNamedDeclaration { + type: "ExportNamedDeclaration", + attributes: [], + declaration: null, + exportKind: "value", + source: Literal { + type: "Literal", + raw: "'mod'", + value: "mod", + + range: [25, 30], + loc: { + start: { column: 25, line: 1 }, + end: { column: 30, line: 1 }, + }, + }, + specifiers: [ + ExportSpecifier { + type: "ExportSpecifier", + exported: Literal { + type: "Literal", + raw: "'b'", + value: "b", + + range: [14, 17], + loc: { + start: { column: 14, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + exportKind: "value", + local: Identifier { + type: "Identifier", + decorators: [], + name: "a", + optional: false, + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + + range: [9, 17], + loc: { + start: { column: 9, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + ], + + range: [0, 31], + loc: { + start: { column: 0, line: 1 }, + end: { column: 31, line: 1 }, + }, + }, + ], + sourceType: "module", + + range: [0, 32], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-aliased-to-string-literal-with-source/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-aliased-to-string-literal-with-source/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..1fd352d9bea5 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-aliased-to-string-literal-with-source/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,96 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration braced-identifier-aliased-to-string-literal-with-source TSESTree - Tokens 1`] = ` +[ + Keyword { + type: "Keyword", + value: "export", + + range: [0, 6], + loc: { + start: { column: 0, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [7, 8], + loc: { + start: { column: 7, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "as", + + range: [11, 13], + loc: { + start: { column: 11, line: 1 }, + end: { column: 13, line: 1 }, + }, + }, + String { + type: "String", + value: "'b'", + + range: [14, 17], + loc: { + start: { column: 14, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [18, 19], + loc: { + start: { column: 18, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "from", + + range: [20, 24], + loc: { + start: { column: 20, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, + String { + type: "String", + value: "'mod'", + + range: [25, 30], + loc: { + start: { column: 25, line: 1 }, + end: { column: 30, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [30, 31], + loc: { + start: { column: 30, line: 1 }, + end: { column: 31, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-aliased-to-string-literal-with-source/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-aliased-to-string-literal-with-source/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..f3e94f39ac59 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-aliased-to-string-literal-with-source/snapshots/3-Babel-AST.shot @@ -0,0 +1,72 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration braced-identifier-aliased-to-string-literal-with-source Babel - AST 1`] = ` +Program { + type: "Program", + body: [ + ExportNamedDeclaration { + type: "ExportNamedDeclaration", + assertions: [], + declaration: null, + exportKind: "value", + source: Literal { + type: "Literal", + raw: "'mod'", + value: "mod", + + range: [25, 30], + loc: { + start: { column: 25, line: 1 }, + end: { column: 30, line: 1 }, + }, + }, + specifiers: [ + ExportSpecifier { + type: "ExportSpecifier", + exported: Literal { + type: "Literal", + raw: "'b'", + value: "b", + + range: [14, 17], + loc: { + start: { column: 14, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + exportKind: "value", + local: Identifier { + type: "Identifier", + name: "a", + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + + range: [9, 17], + loc: { + start: { column: 9, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + ], + + range: [0, 31], + loc: { + start: { column: 0, line: 1 }, + end: { column: 31, line: 1 }, + }, + }, + ], + sourceType: "module", + + range: [0, 32], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-aliased-to-string-literal-with-source/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-aliased-to-string-literal-with-source/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..613532e02424 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-aliased-to-string-literal-with-source/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,96 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration braced-identifier-aliased-to-string-literal-with-source Babel - Tokens 1`] = ` +[ + Keyword { + type: "Keyword", + value: "export", + + range: [0, 6], + loc: { + start: { column: 0, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [7, 8], + loc: { + start: { column: 7, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "as", + + range: [11, 13], + loc: { + start: { column: 11, line: 1 }, + end: { column: 13, line: 1 }, + }, + }, + String { + type: "String", + value: "'b'", + + range: [14, 17], + loc: { + start: { column: 14, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [18, 19], + loc: { + start: { column: 18, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "from", + + range: [20, 24], + loc: { + start: { column: 20, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, + String { + type: "String", + value: "'mod'", + + range: [25, 30], + loc: { + start: { column: 25, line: 1 }, + end: { column: 30, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [30, 31], + loc: { + start: { column: 30, line: 1 }, + end: { column: 31, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-aliased-to-string-literal-with-source/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-aliased-to-string-literal-with-source/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..2ce277fa53a0 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-aliased-to-string-literal-with-source/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,79 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration braced-identifier-aliased-to-string-literal-with-source AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ExportNamedDeclaration { + type: 'ExportNamedDeclaration', +- attributes: Array [], ++ assertions: Array [], + declaration: null, + exportKind: 'value', + source: Literal { + type: 'Literal', + raw: '\\'mod\\'', + value: 'mod', + + range: [25, 30], + loc: { + start: { column: 25, line: 1 }, + end: { column: 30, line: 1 }, + }, + }, + specifiers: Array [ + ExportSpecifier { + type: 'ExportSpecifier', + exported: Literal { + type: 'Literal', + raw: '\\'b\\'', + value: 'b', + + range: [14, 17], + loc: { + start: { column: 14, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + exportKind: 'value', + local: Identifier { + type: 'Identifier', +- decorators: Array [], + name: 'a', +- optional: false, + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + + range: [9, 17], + loc: { + start: { column: 9, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + ], + + range: [0, 31], + loc: { + start: { column: 0, line: 1 }, + end: { column: 31, line: 1 }, + }, + }, + ], + sourceType: 'module', + + range: [0, 32], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, + }" +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-aliased-to-string-literal-with-source/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-aliased-to-string-literal-with-source/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..bef6c6e24d1f --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-aliased-to-string-literal-with-source/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration braced-identifier-aliased-to-string-literal-with-source AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-aliased-to-string-literal-without-source/fixture.ts b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-aliased-to-string-literal-without-source/fixture.ts new file mode 100644 index 000000000000..718bd08c02c3 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-aliased-to-string-literal-without-source/fixture.ts @@ -0,0 +1 @@ +export { a as 'b' }; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-aliased-to-string-literal-without-source/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-aliased-to-string-literal-without-source/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..0a001051a27d --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-aliased-to-string-literal-without-source/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,64 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration braced-identifier-aliased-to-string-literal-without-source TSESTree - AST 1`] = ` +Program { + type: "Program", + body: [ + ExportNamedDeclaration { + type: "ExportNamedDeclaration", + attributes: [], + declaration: null, + exportKind: "value", + source: null, + specifiers: [ + ExportSpecifier { + type: "ExportSpecifier", + exported: Literal { + type: "Literal", + raw: "'b'", + value: "b", + + range: [14, 17], + loc: { + start: { column: 14, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + exportKind: "value", + local: Identifier { + type: "Identifier", + decorators: [], + name: "a", + optional: false, + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + + range: [9, 17], + loc: { + start: { column: 9, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + ], + + range: [0, 20], + loc: { + start: { column: 0, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + ], + sourceType: "module", + + range: [0, 21], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-aliased-to-string-literal-without-source/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-aliased-to-string-literal-without-source/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..369411ea58fa --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-aliased-to-string-literal-without-source/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,76 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration braced-identifier-aliased-to-string-literal-without-source TSESTree - Tokens 1`] = ` +[ + Keyword { + type: "Keyword", + value: "export", + + range: [0, 6], + loc: { + start: { column: 0, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [7, 8], + loc: { + start: { column: 7, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "as", + + range: [11, 13], + loc: { + start: { column: 11, line: 1 }, + end: { column: 13, line: 1 }, + }, + }, + String { + type: "String", + value: "'b'", + + range: [14, 17], + loc: { + start: { column: 14, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [18, 19], + loc: { + start: { column: 18, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [19, 20], + loc: { + start: { column: 19, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-aliased-to-string-literal-without-source/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-aliased-to-string-literal-without-source/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..d3e072e4b7ad --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-aliased-to-string-literal-without-source/snapshots/3-Babel-AST.shot @@ -0,0 +1,62 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration braced-identifier-aliased-to-string-literal-without-source Babel - AST 1`] = ` +Program { + type: "Program", + body: [ + ExportNamedDeclaration { + type: "ExportNamedDeclaration", + assertions: [], + declaration: null, + exportKind: "value", + source: null, + specifiers: [ + ExportSpecifier { + type: "ExportSpecifier", + exported: Literal { + type: "Literal", + raw: "'b'", + value: "b", + + range: [14, 17], + loc: { + start: { column: 14, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + exportKind: "value", + local: Identifier { + type: "Identifier", + name: "a", + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + + range: [9, 17], + loc: { + start: { column: 9, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + ], + + range: [0, 20], + loc: { + start: { column: 0, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 21], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-aliased-to-string-literal-without-source/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-aliased-to-string-literal-without-source/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..f80606bb4cc2 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-aliased-to-string-literal-without-source/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,76 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration braced-identifier-aliased-to-string-literal-without-source Babel - Tokens 1`] = ` +[ + Keyword { + type: "Keyword", + value: "export", + + range: [0, 6], + loc: { + start: { column: 0, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [7, 8], + loc: { + start: { column: 7, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "as", + + range: [11, 13], + loc: { + start: { column: 11, line: 1 }, + end: { column: 13, line: 1 }, + }, + }, + String { + type: "String", + value: "'b'", + + range: [14, 17], + loc: { + start: { column: 14, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [18, 19], + loc: { + start: { column: 18, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [19, 20], + loc: { + start: { column: 19, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-aliased-to-string-literal-without-source/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-aliased-to-string-literal-without-source/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..c8778afd4bdc --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-aliased-to-string-literal-without-source/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,70 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration braced-identifier-aliased-to-string-literal-without-source AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ExportNamedDeclaration { + type: 'ExportNamedDeclaration', +- attributes: Array [], ++ assertions: Array [], + declaration: null, + exportKind: 'value', + source: null, + specifiers: Array [ + ExportSpecifier { + type: 'ExportSpecifier', + exported: Literal { + type: 'Literal', + raw: '\\'b\\'', + value: 'b', + + range: [14, 17], + loc: { + start: { column: 14, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + exportKind: 'value', + local: Identifier { + type: 'Identifier', +- decorators: Array [], + name: 'a', +- optional: false, + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + + range: [9, 17], + loc: { + start: { column: 9, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + ], + + range: [0, 20], + loc: { + start: { column: 0, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + ], +- sourceType: 'module', ++ sourceType: 'script', + + range: [0, 21], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, + }" +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-aliased-to-string-literal-without-source/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-aliased-to-string-literal-without-source/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..bd2fc2bc854b --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-aliased-to-string-literal-without-source/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration braced-identifier-aliased-to-string-literal-without-source AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-many-with-source/fixture.ts b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-many-with-source/fixture.ts new file mode 100644 index 000000000000..7143bbd8b1ad --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-many-with-source/fixture.ts @@ -0,0 +1 @@ +export { a, b } from 'mod'; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-many-with-source/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-many-with-source/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..ed5078361878 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-many-with-source/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,109 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration braced-identifier-many-with-source TSESTree - AST 1`] = ` +Program { + type: "Program", + body: [ + ExportNamedDeclaration { + type: "ExportNamedDeclaration", + attributes: [], + declaration: null, + exportKind: "value", + source: Literal { + type: "Literal", + raw: "'mod'", + value: "mod", + + range: [21, 26], + loc: { + start: { column: 21, line: 1 }, + end: { column: 26, line: 1 }, + }, + }, + specifiers: [ + ExportSpecifier { + type: "ExportSpecifier", + exported: Identifier { + type: "Identifier", + decorators: [], + name: "a", + optional: false, + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + exportKind: "value", + local: Identifier { + type: "Identifier", + decorators: [], + name: "a", + optional: false, + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + ExportSpecifier { + type: "ExportSpecifier", + exported: Identifier { + type: "Identifier", + decorators: [], + name: "b", + optional: false, + + range: [12, 13], + loc: { + start: { column: 12, line: 1 }, + end: { column: 13, line: 1 }, + }, + }, + exportKind: "value", + local: Identifier { + type: "Identifier", + decorators: [], + name: "b", + optional: false, + + range: [12, 13], + loc: { + start: { column: 12, line: 1 }, + end: { column: 13, line: 1 }, + }, + }, + + range: [12, 13], + loc: { + start: { column: 12, line: 1 }, + end: { column: 13, line: 1 }, + }, + }, + ], + + range: [0, 27], + loc: { + start: { column: 0, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, + ], + sourceType: "module", + + range: [0, 28], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-many-with-source/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-many-with-source/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..b8d689aea35c --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-many-with-source/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,96 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration braced-identifier-many-with-source TSESTree - Tokens 1`] = ` +[ + Keyword { + type: "Keyword", + value: "export", + + range: [0, 6], + loc: { + start: { column: 0, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [7, 8], + loc: { + start: { column: 7, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "b", + + range: [12, 13], + loc: { + start: { column: 12, line: 1 }, + end: { column: 13, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [14, 15], + loc: { + start: { column: 14, line: 1 }, + end: { column: 15, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "from", + + range: [16, 20], + loc: { + start: { column: 16, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + String { + type: "String", + value: "'mod'", + + range: [21, 26], + loc: { + start: { column: 21, line: 1 }, + end: { column: 26, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [26, 27], + loc: { + start: { column: 26, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-many-with-source/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-many-with-source/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..8fcb020372ca --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-many-with-source/snapshots/3-Babel-AST.shot @@ -0,0 +1,101 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration braced-identifier-many-with-source Babel - AST 1`] = ` +Program { + type: "Program", + body: [ + ExportNamedDeclaration { + type: "ExportNamedDeclaration", + assertions: [], + declaration: null, + exportKind: "value", + source: Literal { + type: "Literal", + raw: "'mod'", + value: "mod", + + range: [21, 26], + loc: { + start: { column: 21, line: 1 }, + end: { column: 26, line: 1 }, + }, + }, + specifiers: [ + ExportSpecifier { + type: "ExportSpecifier", + exported: Identifier { + type: "Identifier", + name: "a", + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + exportKind: "value", + local: Identifier { + type: "Identifier", + name: "a", + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + ExportSpecifier { + type: "ExportSpecifier", + exported: Identifier { + type: "Identifier", + name: "b", + + range: [12, 13], + loc: { + start: { column: 12, line: 1 }, + end: { column: 13, line: 1 }, + }, + }, + exportKind: "value", + local: Identifier { + type: "Identifier", + name: "b", + + range: [12, 13], + loc: { + start: { column: 12, line: 1 }, + end: { column: 13, line: 1 }, + }, + }, + + range: [12, 13], + loc: { + start: { column: 12, line: 1 }, + end: { column: 13, line: 1 }, + }, + }, + ], + + range: [0, 27], + loc: { + start: { column: 0, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, + ], + sourceType: "module", + + range: [0, 28], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-many-with-source/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-many-with-source/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..e3ead9bca995 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-many-with-source/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,96 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration braced-identifier-many-with-source Babel - Tokens 1`] = ` +[ + Keyword { + type: "Keyword", + value: "export", + + range: [0, 6], + loc: { + start: { column: 0, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [7, 8], + loc: { + start: { column: 7, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "b", + + range: [12, 13], + loc: { + start: { column: 12, line: 1 }, + end: { column: 13, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [14, 15], + loc: { + start: { column: 14, line: 1 }, + end: { column: 15, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "from", + + range: [16, 20], + loc: { + start: { column: 16, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + String { + type: "String", + value: "'mod'", + + range: [21, 26], + loc: { + start: { column: 21, line: 1 }, + end: { column: 26, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [26, 27], + loc: { + start: { column: 26, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-many-with-source/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-many-with-source/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..6113cba0e5c4 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-many-with-source/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,114 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration braced-identifier-many-with-source AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ExportNamedDeclaration { + type: 'ExportNamedDeclaration', +- attributes: Array [], ++ assertions: Array [], + declaration: null, + exportKind: 'value', + source: Literal { + type: 'Literal', + raw: '\\'mod\\'', + value: 'mod', + + range: [21, 26], + loc: { + start: { column: 21, line: 1 }, + end: { column: 26, line: 1 }, + }, + }, + specifiers: Array [ + ExportSpecifier { + type: 'ExportSpecifier', + exported: Identifier { + type: 'Identifier', +- decorators: Array [], + name: 'a', +- optional: false, + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + exportKind: 'value', + local: Identifier { + type: 'Identifier', +- decorators: Array [], + name: 'a', +- optional: false, + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + ExportSpecifier { + type: 'ExportSpecifier', + exported: Identifier { + type: 'Identifier', +- decorators: Array [], + name: 'b', +- optional: false, + + range: [12, 13], + loc: { + start: { column: 12, line: 1 }, + end: { column: 13, line: 1 }, + }, + }, + exportKind: 'value', + local: Identifier { + type: 'Identifier', +- decorators: Array [], + name: 'b', +- optional: false, + + range: [12, 13], + loc: { + start: { column: 12, line: 1 }, + end: { column: 13, line: 1 }, + }, + }, + + range: [12, 13], + loc: { + start: { column: 12, line: 1 }, + end: { column: 13, line: 1 }, + }, + }, + ], + + range: [0, 27], + loc: { + start: { column: 0, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, + ], + sourceType: 'module', + + range: [0, 28], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, + }" +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-many-with-source/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-many-with-source/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..2f3c7ca6ec43 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-many-with-source/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration braced-identifier-many-with-source AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/identifier-many/fixture.ts b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-many-without-source/fixture.ts similarity index 100% rename from packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/identifier-many/fixture.ts rename to packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-many-without-source/fixture.ts diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/identifier-many/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-many-without-source/snapshots/1-TSESTree-AST.shot similarity index 95% rename from packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/identifier-many/snapshots/1-TSESTree-AST.shot rename to packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-many-without-source/snapshots/1-TSESTree-AST.shot index 8892a61581c0..4cb3f5c2798b 100644 --- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/identifier-many/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-many-without-source/snapshots/1-TSESTree-AST.shot @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration ExportNamedDeclaration identifier-many TSESTree - AST 1`] = ` +exports[`AST Fixtures declaration ExportNamedDeclaration braced-identifier-many-without-source TSESTree - AST 1`] = ` Program { type: "Program", body: [ diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/identifier-many/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-many-without-source/snapshots/2-TSESTree-Tokens.shot similarity index 91% rename from packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/identifier-many/snapshots/2-TSESTree-Tokens.shot rename to packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-many-without-source/snapshots/2-TSESTree-Tokens.shot index 1a0506845dc5..c337f6f5329f 100644 --- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/identifier-many/snapshots/2-TSESTree-Tokens.shot +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-many-without-source/snapshots/2-TSESTree-Tokens.shot @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration ExportNamedDeclaration identifier-many TSESTree - Tokens 1`] = ` +exports[`AST Fixtures declaration ExportNamedDeclaration braced-identifier-many-without-source TSESTree - Tokens 1`] = ` [ Keyword { type: "Keyword", diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/identifier-many/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-many-without-source/snapshots/3-Babel-AST.shot similarity index 94% rename from packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/identifier-many/snapshots/3-Babel-AST.shot rename to packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-many-without-source/snapshots/3-Babel-AST.shot index 9b3deae0f972..4af1be81daeb 100644 --- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/identifier-many/snapshots/3-Babel-AST.shot +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-many-without-source/snapshots/3-Babel-AST.shot @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration ExportNamedDeclaration identifier-many Babel - AST 1`] = ` +exports[`AST Fixtures declaration ExportNamedDeclaration braced-identifier-many-without-source Babel - AST 1`] = ` Program { type: "Program", body: [ diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/identifier-many/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-many-without-source/snapshots/4-Babel-Tokens.shot similarity index 91% rename from packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/identifier-many/snapshots/4-Babel-Tokens.shot rename to packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-many-without-source/snapshots/4-Babel-Tokens.shot index f3da2541784c..9413931d9afc 100644 --- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/identifier-many/snapshots/4-Babel-Tokens.shot +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-many-without-source/snapshots/4-Babel-Tokens.shot @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration ExportNamedDeclaration identifier-many Babel - Tokens 1`] = ` +exports[`AST Fixtures declaration ExportNamedDeclaration braced-identifier-many-without-source Babel - Tokens 1`] = ` [ Keyword { type: "Keyword", diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/identifier-many/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-many-without-source/snapshots/5-AST-Alignment-AST.shot similarity index 95% rename from packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/identifier-many/snapshots/5-AST-Alignment-AST.shot rename to packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-many-without-source/snapshots/5-AST-Alignment-AST.shot index 00294e85963b..147b250042f7 100644 --- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/identifier-many/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-many-without-source/snapshots/5-AST-Alignment-AST.shot @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration ExportNamedDeclaration identifier-many AST Alignment - AST 1`] = ` +exports[`AST Fixtures declaration ExportNamedDeclaration braced-identifier-many-without-source AST Alignment - AST 1`] = ` "Snapshot Diff: - TSESTree + Babel diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-many-without-source/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-many-without-source/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..c4c3db65b420 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-many-without-source/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration braced-identifier-many-without-source AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-with-source/fixture.ts b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-with-source/fixture.ts new file mode 100644 index 000000000000..2987292f975a --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-with-source/fixture.ts @@ -0,0 +1 @@ +export { a } from 'mod'; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-with-source/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-with-source/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..f219e3cb7a43 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-with-source/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,75 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration braced-identifier-with-source TSESTree - AST 1`] = ` +Program { + type: "Program", + body: [ + ExportNamedDeclaration { + type: "ExportNamedDeclaration", + attributes: [], + declaration: null, + exportKind: "value", + source: Literal { + type: "Literal", + raw: "'mod'", + value: "mod", + + range: [18, 23], + loc: { + start: { column: 18, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, + specifiers: [ + ExportSpecifier { + type: "ExportSpecifier", + exported: Identifier { + type: "Identifier", + decorators: [], + name: "a", + optional: false, + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + exportKind: "value", + local: Identifier { + type: "Identifier", + decorators: [], + name: "a", + optional: false, + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + ], + + range: [0, 24], + loc: { + start: { column: 0, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, + ], + sourceType: "module", + + range: [0, 25], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-with-source/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-with-source/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..0b2f885efed9 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-with-source/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,76 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration braced-identifier-with-source TSESTree - Tokens 1`] = ` +[ + Keyword { + type: "Keyword", + value: "export", + + range: [0, 6], + loc: { + start: { column: 0, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [7, 8], + loc: { + start: { column: 7, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [11, 12], + loc: { + start: { column: 11, line: 1 }, + end: { column: 12, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "from", + + range: [13, 17], + loc: { + start: { column: 13, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + String { + type: "String", + value: "'mod'", + + range: [18, 23], + loc: { + start: { column: 18, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [23, 24], + loc: { + start: { column: 23, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-with-source/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-with-source/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..05f61dcf26ec --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-with-source/snapshots/3-Babel-AST.shot @@ -0,0 +1,71 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration braced-identifier-with-source Babel - AST 1`] = ` +Program { + type: "Program", + body: [ + ExportNamedDeclaration { + type: "ExportNamedDeclaration", + assertions: [], + declaration: null, + exportKind: "value", + source: Literal { + type: "Literal", + raw: "'mod'", + value: "mod", + + range: [18, 23], + loc: { + start: { column: 18, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, + specifiers: [ + ExportSpecifier { + type: "ExportSpecifier", + exported: Identifier { + type: "Identifier", + name: "a", + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + exportKind: "value", + local: Identifier { + type: "Identifier", + name: "a", + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + ], + + range: [0, 24], + loc: { + start: { column: 0, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, + ], + sourceType: "module", + + range: [0, 25], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-with-source/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-with-source/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..1b0626f17888 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-with-source/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,76 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration braced-identifier-with-source Babel - Tokens 1`] = ` +[ + Keyword { + type: "Keyword", + value: "export", + + range: [0, 6], + loc: { + start: { column: 0, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [7, 8], + loc: { + start: { column: 7, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "a", + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [11, 12], + loc: { + start: { column: 11, line: 1 }, + end: { column: 12, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "from", + + range: [13, 17], + loc: { + start: { column: 13, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + String { + type: "String", + value: "'mod'", + + range: [18, 23], + loc: { + start: { column: 18, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [23, 24], + loc: { + start: { column: 23, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-with-source/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-with-source/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..0bd08d542e76 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-with-source/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,80 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration braced-identifier-with-source AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ExportNamedDeclaration { + type: 'ExportNamedDeclaration', +- attributes: Array [], ++ assertions: Array [], + declaration: null, + exportKind: 'value', + source: Literal { + type: 'Literal', + raw: '\\'mod\\'', + value: 'mod', + + range: [18, 23], + loc: { + start: { column: 18, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, + specifiers: Array [ + ExportSpecifier { + type: 'ExportSpecifier', + exported: Identifier { + type: 'Identifier', +- decorators: Array [], + name: 'a', +- optional: false, + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + exportKind: 'value', + local: Identifier { + type: 'Identifier', +- decorators: Array [], + name: 'a', +- optional: false, + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + ], + + range: [0, 24], + loc: { + start: { column: 0, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, + ], + sourceType: 'module', + + range: [0, 25], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, + }" +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-with-source/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-with-source/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..3aac3b1d21cf --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-with-source/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration braced-identifier-with-source AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/identifier-braced/fixture.ts b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-without-source/fixture.ts similarity index 100% rename from packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/identifier-braced/fixture.ts rename to packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-without-source/fixture.ts diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/identifier-braced/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-without-source/snapshots/1-TSESTree-AST.shot similarity index 92% rename from packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/identifier-braced/snapshots/1-TSESTree-AST.shot rename to packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-without-source/snapshots/1-TSESTree-AST.shot index d9f0a0177742..2f5393b47088 100644 --- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/identifier-braced/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-without-source/snapshots/1-TSESTree-AST.shot @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration ExportNamedDeclaration identifier-braced TSESTree - AST 1`] = ` +exports[`AST Fixtures declaration ExportNamedDeclaration braced-identifier-without-source TSESTree - AST 1`] = ` Program { type: "Program", body: [ diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/identifier-braced/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-without-source/snapshots/2-TSESTree-Tokens.shot similarity index 88% rename from packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/identifier-braced/snapshots/2-TSESTree-Tokens.shot rename to packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-without-source/snapshots/2-TSESTree-Tokens.shot index 5d19014688b4..957c360c0894 100644 --- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/identifier-braced/snapshots/2-TSESTree-Tokens.shot +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-without-source/snapshots/2-TSESTree-Tokens.shot @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration ExportNamedDeclaration identifier-braced TSESTree - Tokens 1`] = ` +exports[`AST Fixtures declaration ExportNamedDeclaration braced-identifier-without-source TSESTree - Tokens 1`] = ` [ Keyword { type: "Keyword", diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/identifier-braced/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-without-source/snapshots/3-Babel-AST.shot similarity index 92% rename from packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/identifier-braced/snapshots/3-Babel-AST.shot rename to packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-without-source/snapshots/3-Babel-AST.shot index c99b8674c943..b6ee6e695f5f 100644 --- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/identifier-braced/snapshots/3-Babel-AST.shot +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-without-source/snapshots/3-Babel-AST.shot @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration ExportNamedDeclaration identifier-braced Babel - AST 1`] = ` +exports[`AST Fixtures declaration ExportNamedDeclaration braced-identifier-without-source Babel - AST 1`] = ` Program { type: "Program", body: [ diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/identifier-braced/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-without-source/snapshots/4-Babel-Tokens.shot similarity index 88% rename from packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/identifier-braced/snapshots/4-Babel-Tokens.shot rename to packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-without-source/snapshots/4-Babel-Tokens.shot index e31a37ad775b..c6dcc898382b 100644 --- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/identifier-braced/snapshots/4-Babel-Tokens.shot +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-without-source/snapshots/4-Babel-Tokens.shot @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration ExportNamedDeclaration identifier-braced Babel - Tokens 1`] = ` +exports[`AST Fixtures declaration ExportNamedDeclaration braced-identifier-without-source Babel - Tokens 1`] = ` [ Keyword { type: "Keyword", diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/identifier-braced/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-without-source/snapshots/5-AST-Alignment-AST.shot similarity index 93% rename from packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/identifier-braced/snapshots/5-AST-Alignment-AST.shot rename to packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-without-source/snapshots/5-AST-Alignment-AST.shot index 5336bc5c7c63..0e290454dc9c 100644 --- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/identifier-braced/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-without-source/snapshots/5-AST-Alignment-AST.shot @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration ExportNamedDeclaration identifier-braced AST Alignment - AST 1`] = ` +exports[`AST Fixtures declaration ExportNamedDeclaration braced-identifier-without-source AST Alignment - AST 1`] = ` "Snapshot Diff: - TSESTree + Babel diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-without-source/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-without-source/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..fa17826e0432 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-identifier-without-source/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration braced-identifier-without-source AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-string-literal-aliased-to-identifier-with-source/fixture.ts b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-string-literal-aliased-to-identifier-with-source/fixture.ts new file mode 100644 index 000000000000..cf1bc3a16691 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-string-literal-aliased-to-identifier-with-source/fixture.ts @@ -0,0 +1 @@ +export { 'a a' as b } from 'mod'; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-string-literal-aliased-to-identifier-with-source/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-string-literal-aliased-to-identifier-with-source/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..ed3db51ae89d --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-string-literal-aliased-to-identifier-with-source/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,74 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration braced-string-literal-aliased-to-identifier-with-source TSESTree - AST 1`] = ` +Program { + type: "Program", + body: [ + ExportNamedDeclaration { + type: "ExportNamedDeclaration", + attributes: [], + declaration: null, + exportKind: "value", + source: Literal { + type: "Literal", + raw: "'mod'", + value: "mod", + + range: [27, 32], + loc: { + start: { column: 27, line: 1 }, + end: { column: 32, line: 1 }, + }, + }, + specifiers: [ + ExportSpecifier { + type: "ExportSpecifier", + exported: Identifier { + type: "Identifier", + decorators: [], + name: "b", + optional: false, + + range: [18, 19], + loc: { + start: { column: 18, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + exportKind: "value", + local: Literal { + type: "Literal", + raw: "'a a'", + value: "a a", + + range: [9, 14], + loc: { + start: { column: 9, line: 1 }, + end: { column: 14, line: 1 }, + }, + }, + + range: [9, 19], + loc: { + start: { column: 9, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + ], + + range: [0, 33], + loc: { + start: { column: 0, line: 1 }, + end: { column: 33, line: 1 }, + }, + }, + ], + sourceType: "module", + + range: [0, 34], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-string-literal-aliased-to-identifier-with-source/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-string-literal-aliased-to-identifier-with-source/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..3da9372f680b --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-string-literal-aliased-to-identifier-with-source/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,96 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration braced-string-literal-aliased-to-identifier-with-source TSESTree - Tokens 1`] = ` +[ + Keyword { + type: "Keyword", + value: "export", + + range: [0, 6], + loc: { + start: { column: 0, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [7, 8], + loc: { + start: { column: 7, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + String { + type: "String", + value: "'a a'", + + range: [9, 14], + loc: { + start: { column: 9, line: 1 }, + end: { column: 14, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "as", + + range: [15, 17], + loc: { + start: { column: 15, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "b", + + range: [18, 19], + loc: { + start: { column: 18, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [20, 21], + loc: { + start: { column: 20, line: 1 }, + end: { column: 21, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "from", + + range: [22, 26], + loc: { + start: { column: 22, line: 1 }, + end: { column: 26, line: 1 }, + }, + }, + String { + type: "String", + value: "'mod'", + + range: [27, 32], + loc: { + start: { column: 27, line: 1 }, + end: { column: 32, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [32, 33], + loc: { + start: { column: 32, line: 1 }, + end: { column: 33, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-string-literal-aliased-to-identifier-with-source/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-string-literal-aliased-to-identifier-with-source/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..a4ce3b40a8d3 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-string-literal-aliased-to-identifier-with-source/snapshots/3-Babel-AST.shot @@ -0,0 +1,72 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration braced-string-literal-aliased-to-identifier-with-source Babel - AST 1`] = ` +Program { + type: "Program", + body: [ + ExportNamedDeclaration { + type: "ExportNamedDeclaration", + assertions: [], + declaration: null, + exportKind: "value", + source: Literal { + type: "Literal", + raw: "'mod'", + value: "mod", + + range: [27, 32], + loc: { + start: { column: 27, line: 1 }, + end: { column: 32, line: 1 }, + }, + }, + specifiers: [ + ExportSpecifier { + type: "ExportSpecifier", + exported: Identifier { + type: "Identifier", + name: "b", + + range: [18, 19], + loc: { + start: { column: 18, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + exportKind: "value", + local: Literal { + type: "Literal", + raw: "'a a'", + value: "a a", + + range: [9, 14], + loc: { + start: { column: 9, line: 1 }, + end: { column: 14, line: 1 }, + }, + }, + + range: [9, 19], + loc: { + start: { column: 9, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + ], + + range: [0, 33], + loc: { + start: { column: 0, line: 1 }, + end: { column: 33, line: 1 }, + }, + }, + ], + sourceType: "module", + + range: [0, 34], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-string-literal-aliased-to-identifier-with-source/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-string-literal-aliased-to-identifier-with-source/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..651a962c4fd5 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-string-literal-aliased-to-identifier-with-source/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,96 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration braced-string-literal-aliased-to-identifier-with-source Babel - Tokens 1`] = ` +[ + Keyword { + type: "Keyword", + value: "export", + + range: [0, 6], + loc: { + start: { column: 0, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [7, 8], + loc: { + start: { column: 7, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + String { + type: "String", + value: "'a a'", + + range: [9, 14], + loc: { + start: { column: 9, line: 1 }, + end: { column: 14, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "as", + + range: [15, 17], + loc: { + start: { column: 15, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "b", + + range: [18, 19], + loc: { + start: { column: 18, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [20, 21], + loc: { + start: { column: 20, line: 1 }, + end: { column: 21, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "from", + + range: [22, 26], + loc: { + start: { column: 22, line: 1 }, + end: { column: 26, line: 1 }, + }, + }, + String { + type: "String", + value: "'mod'", + + range: [27, 32], + loc: { + start: { column: 27, line: 1 }, + end: { column: 32, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [32, 33], + loc: { + start: { column: 32, line: 1 }, + end: { column: 33, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-string-literal-aliased-to-identifier-with-source/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-string-literal-aliased-to-identifier-with-source/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..bd501e07974f --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-string-literal-aliased-to-identifier-with-source/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,79 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration braced-string-literal-aliased-to-identifier-with-source AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ExportNamedDeclaration { + type: 'ExportNamedDeclaration', +- attributes: Array [], ++ assertions: Array [], + declaration: null, + exportKind: 'value', + source: Literal { + type: 'Literal', + raw: '\\'mod\\'', + value: 'mod', + + range: [27, 32], + loc: { + start: { column: 27, line: 1 }, + end: { column: 32, line: 1 }, + }, + }, + specifiers: Array [ + ExportSpecifier { + type: 'ExportSpecifier', + exported: Identifier { + type: 'Identifier', +- decorators: Array [], + name: 'b', +- optional: false, + + range: [18, 19], + loc: { + start: { column: 18, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + exportKind: 'value', + local: Literal { + type: 'Literal', + raw: '\\'a a\\'', + value: 'a a', + + range: [9, 14], + loc: { + start: { column: 9, line: 1 }, + end: { column: 14, line: 1 }, + }, + }, + + range: [9, 19], + loc: { + start: { column: 9, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + ], + + range: [0, 33], + loc: { + start: { column: 0, line: 1 }, + end: { column: 33, line: 1 }, + }, + }, + ], + sourceType: 'module', + + range: [0, 34], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, + }" +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-string-literal-aliased-to-identifier-with-source/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-string-literal-aliased-to-identifier-with-source/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..013676484cb0 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-string-literal-aliased-to-identifier-with-source/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration braced-string-literal-aliased-to-identifier-with-source AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-string-literal-many-with-source/fixture.ts b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-string-literal-many-with-source/fixture.ts new file mode 100644 index 000000000000..5ee1ca6e5a43 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-string-literal-many-with-source/fixture.ts @@ -0,0 +1 @@ +export { 'a a', 'b b' } from 'mod'; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-string-literal-many-with-source/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-string-literal-many-with-source/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..99062c83b78f --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-string-literal-many-with-source/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,105 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration braced-string-literal-many-with-source TSESTree - AST 1`] = ` +Program { + type: "Program", + body: [ + ExportNamedDeclaration { + type: "ExportNamedDeclaration", + attributes: [], + declaration: null, + exportKind: "value", + source: Literal { + type: "Literal", + raw: "'mod'", + value: "mod", + + range: [29, 34], + loc: { + start: { column: 29, line: 1 }, + end: { column: 34, line: 1 }, + }, + }, + specifiers: [ + ExportSpecifier { + type: "ExportSpecifier", + exported: Literal { + type: "Literal", + raw: "'a a'", + value: "a a", + + range: [9, 14], + loc: { + start: { column: 9, line: 1 }, + end: { column: 14, line: 1 }, + }, + }, + exportKind: "value", + local: Literal { + type: "Literal", + raw: "'a a'", + value: "a a", + + range: [9, 14], + loc: { + start: { column: 9, line: 1 }, + end: { column: 14, line: 1 }, + }, + }, + + range: [9, 14], + loc: { + start: { column: 9, line: 1 }, + end: { column: 14, line: 1 }, + }, + }, + ExportSpecifier { + type: "ExportSpecifier", + exported: Literal { + type: "Literal", + raw: "'b b'", + value: "b b", + + range: [16, 21], + loc: { + start: { column: 16, line: 1 }, + end: { column: 21, line: 1 }, + }, + }, + exportKind: "value", + local: Literal { + type: "Literal", + raw: "'b b'", + value: "b b", + + range: [16, 21], + loc: { + start: { column: 16, line: 1 }, + end: { column: 21, line: 1 }, + }, + }, + + range: [16, 21], + loc: { + start: { column: 16, line: 1 }, + end: { column: 21, line: 1 }, + }, + }, + ], + + range: [0, 35], + loc: { + start: { column: 0, line: 1 }, + end: { column: 35, line: 1 }, + }, + }, + ], + sourceType: "module", + + range: [0, 36], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-string-literal-many-with-source/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-string-literal-many-with-source/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..31ad2ecba3c5 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-string-literal-many-with-source/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,96 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration braced-string-literal-many-with-source TSESTree - Tokens 1`] = ` +[ + Keyword { + type: "Keyword", + value: "export", + + range: [0, 6], + loc: { + start: { column: 0, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [7, 8], + loc: { + start: { column: 7, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + String { + type: "String", + value: "'a a'", + + range: [9, 14], + loc: { + start: { column: 9, line: 1 }, + end: { column: 14, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [14, 15], + loc: { + start: { column: 14, line: 1 }, + end: { column: 15, line: 1 }, + }, + }, + String { + type: "String", + value: "'b b'", + + range: [16, 21], + loc: { + start: { column: 16, line: 1 }, + end: { column: 21, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [22, 23], + loc: { + start: { column: 22, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "from", + + range: [24, 28], + loc: { + start: { column: 24, line: 1 }, + end: { column: 28, line: 1 }, + }, + }, + String { + type: "String", + value: "'mod'", + + range: [29, 34], + loc: { + start: { column: 29, line: 1 }, + end: { column: 34, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [34, 35], + loc: { + start: { column: 34, line: 1 }, + end: { column: 35, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-string-literal-many-with-source/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-string-literal-many-with-source/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..9ff935acade5 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-string-literal-many-with-source/snapshots/3-Babel-AST.shot @@ -0,0 +1,105 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration braced-string-literal-many-with-source Babel - AST 1`] = ` +Program { + type: "Program", + body: [ + ExportNamedDeclaration { + type: "ExportNamedDeclaration", + assertions: [], + declaration: null, + exportKind: "value", + source: Literal { + type: "Literal", + raw: "'mod'", + value: "mod", + + range: [29, 34], + loc: { + start: { column: 29, line: 1 }, + end: { column: 34, line: 1 }, + }, + }, + specifiers: [ + ExportSpecifier { + type: "ExportSpecifier", + exported: Literal { + type: "Literal", + raw: "'a a'", + value: "a a", + + range: [9, 14], + loc: { + start: { column: 9, line: 1 }, + end: { column: 14, line: 1 }, + }, + }, + exportKind: "value", + local: Literal { + type: "Literal", + raw: "'a a'", + value: "a a", + + range: [9, 14], + loc: { + start: { column: 9, line: 1 }, + end: { column: 14, line: 1 }, + }, + }, + + range: [9, 14], + loc: { + start: { column: 9, line: 1 }, + end: { column: 14, line: 1 }, + }, + }, + ExportSpecifier { + type: "ExportSpecifier", + exported: Literal { + type: "Literal", + raw: "'b b'", + value: "b b", + + range: [16, 21], + loc: { + start: { column: 16, line: 1 }, + end: { column: 21, line: 1 }, + }, + }, + exportKind: "value", + local: Literal { + type: "Literal", + raw: "'b b'", + value: "b b", + + range: [16, 21], + loc: { + start: { column: 16, line: 1 }, + end: { column: 21, line: 1 }, + }, + }, + + range: [16, 21], + loc: { + start: { column: 16, line: 1 }, + end: { column: 21, line: 1 }, + }, + }, + ], + + range: [0, 35], + loc: { + start: { column: 0, line: 1 }, + end: { column: 35, line: 1 }, + }, + }, + ], + sourceType: "module", + + range: [0, 36], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-string-literal-many-with-source/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-string-literal-many-with-source/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..e6b87399cc54 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-string-literal-many-with-source/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,96 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration braced-string-literal-many-with-source Babel - Tokens 1`] = ` +[ + Keyword { + type: "Keyword", + value: "export", + + range: [0, 6], + loc: { + start: { column: 0, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [7, 8], + loc: { + start: { column: 7, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + String { + type: "String", + value: "'a a'", + + range: [9, 14], + loc: { + start: { column: 9, line: 1 }, + end: { column: 14, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [14, 15], + loc: { + start: { column: 14, line: 1 }, + end: { column: 15, line: 1 }, + }, + }, + String { + type: "String", + value: "'b b'", + + range: [16, 21], + loc: { + start: { column: 16, line: 1 }, + end: { column: 21, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [22, 23], + loc: { + start: { column: 22, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "from", + + range: [24, 28], + loc: { + start: { column: 24, line: 1 }, + end: { column: 28, line: 1 }, + }, + }, + String { + type: "String", + value: "'mod'", + + range: [29, 34], + loc: { + start: { column: 29, line: 1 }, + end: { column: 34, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [34, 35], + loc: { + start: { column: 34, line: 1 }, + end: { column: 35, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-string-literal-many-with-source/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-string-literal-many-with-source/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..23b269cc250f --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-string-literal-many-with-source/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,110 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration braced-string-literal-many-with-source AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ExportNamedDeclaration { + type: 'ExportNamedDeclaration', +- attributes: Array [], ++ assertions: Array [], + declaration: null, + exportKind: 'value', + source: Literal { + type: 'Literal', + raw: '\\'mod\\'', + value: 'mod', + + range: [29, 34], + loc: { + start: { column: 29, line: 1 }, + end: { column: 34, line: 1 }, + }, + }, + specifiers: Array [ + ExportSpecifier { + type: 'ExportSpecifier', + exported: Literal { + type: 'Literal', + raw: '\\'a a\\'', + value: 'a a', + + range: [9, 14], + loc: { + start: { column: 9, line: 1 }, + end: { column: 14, line: 1 }, + }, + }, + exportKind: 'value', + local: Literal { + type: 'Literal', + raw: '\\'a a\\'', + value: 'a a', + + range: [9, 14], + loc: { + start: { column: 9, line: 1 }, + end: { column: 14, line: 1 }, + }, + }, + + range: [9, 14], + loc: { + start: { column: 9, line: 1 }, + end: { column: 14, line: 1 }, + }, + }, + ExportSpecifier { + type: 'ExportSpecifier', + exported: Literal { + type: 'Literal', + raw: '\\'b b\\'', + value: 'b b', + + range: [16, 21], + loc: { + start: { column: 16, line: 1 }, + end: { column: 21, line: 1 }, + }, + }, + exportKind: 'value', + local: Literal { + type: 'Literal', + raw: '\\'b b\\'', + value: 'b b', + + range: [16, 21], + loc: { + start: { column: 16, line: 1 }, + end: { column: 21, line: 1 }, + }, + }, + + range: [16, 21], + loc: { + start: { column: 16, line: 1 }, + end: { column: 21, line: 1 }, + }, + }, + ], + + range: [0, 35], + loc: { + start: { column: 0, line: 1 }, + end: { column: 35, line: 1 }, + }, + }, + ], + sourceType: 'module', + + range: [0, 36], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, + }" +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-string-literal-many-with-source/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-string-literal-many-with-source/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..0e7d6a2b84dc --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-string-literal-many-with-source/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration braced-string-literal-many-with-source AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-string-literal-with-source/fixture.ts b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-string-literal-with-source/fixture.ts new file mode 100644 index 000000000000..96cea3b07692 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-string-literal-with-source/fixture.ts @@ -0,0 +1 @@ +export { 'a a' } from 'mod'; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-string-literal-with-source/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-string-literal-with-source/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..3d0653eea62d --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-string-literal-with-source/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,73 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration braced-string-literal-with-source TSESTree - AST 1`] = ` +Program { + type: "Program", + body: [ + ExportNamedDeclaration { + type: "ExportNamedDeclaration", + attributes: [], + declaration: null, + exportKind: "value", + source: Literal { + type: "Literal", + raw: "'mod'", + value: "mod", + + range: [22, 27], + loc: { + start: { column: 22, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, + specifiers: [ + ExportSpecifier { + type: "ExportSpecifier", + exported: Literal { + type: "Literal", + raw: "'a a'", + value: "a a", + + range: [9, 14], + loc: { + start: { column: 9, line: 1 }, + end: { column: 14, line: 1 }, + }, + }, + exportKind: "value", + local: Literal { + type: "Literal", + raw: "'a a'", + value: "a a", + + range: [9, 14], + loc: { + start: { column: 9, line: 1 }, + end: { column: 14, line: 1 }, + }, + }, + + range: [9, 14], + loc: { + start: { column: 9, line: 1 }, + end: { column: 14, line: 1 }, + }, + }, + ], + + range: [0, 28], + loc: { + start: { column: 0, line: 1 }, + end: { column: 28, line: 1 }, + }, + }, + ], + sourceType: "module", + + range: [0, 29], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-string-literal-with-source/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-string-literal-with-source/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..a6970cc620d9 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-string-literal-with-source/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,76 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration braced-string-literal-with-source TSESTree - Tokens 1`] = ` +[ + Keyword { + type: "Keyword", + value: "export", + + range: [0, 6], + loc: { + start: { column: 0, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [7, 8], + loc: { + start: { column: 7, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + String { + type: "String", + value: "'a a'", + + range: [9, 14], + loc: { + start: { column: 9, line: 1 }, + end: { column: 14, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [15, 16], + loc: { + start: { column: 15, line: 1 }, + end: { column: 16, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "from", + + range: [17, 21], + loc: { + start: { column: 17, line: 1 }, + end: { column: 21, line: 1 }, + }, + }, + String { + type: "String", + value: "'mod'", + + range: [22, 27], + loc: { + start: { column: 22, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [27, 28], + loc: { + start: { column: 27, line: 1 }, + end: { column: 28, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-string-literal-with-source/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-string-literal-with-source/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..0bd7dd4ea51a --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-string-literal-with-source/snapshots/3-Babel-AST.shot @@ -0,0 +1,73 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration braced-string-literal-with-source Babel - AST 1`] = ` +Program { + type: "Program", + body: [ + ExportNamedDeclaration { + type: "ExportNamedDeclaration", + assertions: [], + declaration: null, + exportKind: "value", + source: Literal { + type: "Literal", + raw: "'mod'", + value: "mod", + + range: [22, 27], + loc: { + start: { column: 22, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, + specifiers: [ + ExportSpecifier { + type: "ExportSpecifier", + exported: Literal { + type: "Literal", + raw: "'a a'", + value: "a a", + + range: [9, 14], + loc: { + start: { column: 9, line: 1 }, + end: { column: 14, line: 1 }, + }, + }, + exportKind: "value", + local: Literal { + type: "Literal", + raw: "'a a'", + value: "a a", + + range: [9, 14], + loc: { + start: { column: 9, line: 1 }, + end: { column: 14, line: 1 }, + }, + }, + + range: [9, 14], + loc: { + start: { column: 9, line: 1 }, + end: { column: 14, line: 1 }, + }, + }, + ], + + range: [0, 28], + loc: { + start: { column: 0, line: 1 }, + end: { column: 28, line: 1 }, + }, + }, + ], + sourceType: "module", + + range: [0, 29], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-string-literal-with-source/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-string-literal-with-source/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..9e79a0692088 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-string-literal-with-source/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,76 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration braced-string-literal-with-source Babel - Tokens 1`] = ` +[ + Keyword { + type: "Keyword", + value: "export", + + range: [0, 6], + loc: { + start: { column: 0, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [7, 8], + loc: { + start: { column: 7, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + String { + type: "String", + value: "'a a'", + + range: [9, 14], + loc: { + start: { column: 9, line: 1 }, + end: { column: 14, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [15, 16], + loc: { + start: { column: 15, line: 1 }, + end: { column: 16, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "from", + + range: [17, 21], + loc: { + start: { column: 17, line: 1 }, + end: { column: 21, line: 1 }, + }, + }, + String { + type: "String", + value: "'mod'", + + range: [22, 27], + loc: { + start: { column: 22, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [27, 28], + loc: { + start: { column: 27, line: 1 }, + end: { column: 28, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-string-literal-with-source/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-string-literal-with-source/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..732466bc7bd4 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-string-literal-with-source/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,78 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration braced-string-literal-with-source AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ExportNamedDeclaration { + type: 'ExportNamedDeclaration', +- attributes: Array [], ++ assertions: Array [], + declaration: null, + exportKind: 'value', + source: Literal { + type: 'Literal', + raw: '\\'mod\\'', + value: 'mod', + + range: [22, 27], + loc: { + start: { column: 22, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, + specifiers: Array [ + ExportSpecifier { + type: 'ExportSpecifier', + exported: Literal { + type: 'Literal', + raw: '\\'a a\\'', + value: 'a a', + + range: [9, 14], + loc: { + start: { column: 9, line: 1 }, + end: { column: 14, line: 1 }, + }, + }, + exportKind: 'value', + local: Literal { + type: 'Literal', + raw: '\\'a a\\'', + value: 'a a', + + range: [9, 14], + loc: { + start: { column: 9, line: 1 }, + end: { column: 14, line: 1 }, + }, + }, + + range: [9, 14], + loc: { + start: { column: 9, line: 1 }, + end: { column: 14, line: 1 }, + }, + }, + ], + + range: [0, 28], + loc: { + start: { column: 0, line: 1 }, + end: { column: 28, line: 1 }, + }, + }, + ], + sourceType: 'module', + + range: [0, 29], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, + }" +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-string-literal-with-source/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-string-literal-with-source/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..22bb3f9fcbf3 --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/braced-string-literal-with-source/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration braced-string-literal-with-source AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/identifier-braced/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/identifier-braced/snapshots/6-AST-Alignment-Tokens.shot deleted file mode 100644 index d3563662f8c1..000000000000 --- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/identifier-braced/snapshots/6-AST-Alignment-Tokens.shot +++ /dev/null @@ -1,6 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`AST Fixtures declaration ExportNamedDeclaration identifier-braced AST Alignment - Token 1`] = ` -"Snapshot Diff: -Compared values have no visual difference." -`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/spec.ts b/packages/ast-spec/src/declaration/ExportNamedDeclaration/spec.ts index 79c266d9b5fc..1fcb91b033ed 100644 --- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/spec.ts +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/spec.ts @@ -1,7 +1,10 @@ import type { AST_NODE_TYPES } from '../../ast-node-types'; import type { BaseNode } from '../../base/BaseNode'; import type { StringLiteral } from '../../expression/literal/StringLiteral/spec'; -import type { ExportSpecifier } from '../../special/ExportSpecifier/spec'; +import type { + ExportSpecifier, + ExportSpecifierWithIdentifierLocal, +} from '../../special/ExportSpecifier/spec'; import type { ImportAttribute } from '../../special/ImportAttribute/spec'; import type { NamedExportDeclarations } from '../../unions/ExportDeclaration'; import type { ExportKind } from '../ExportAndImportKind'; @@ -75,6 +78,8 @@ export interface ExportNamedDeclarationWithoutSourceWithMultiple attributes: ImportAttribute[]; declaration: null; source: null; + // Cannot have literal local without a source + specifiers: ExportSpecifierWithIdentifierLocal[]; } /** @@ -99,7 +104,7 @@ export interface ExportNamedDeclarationWithoutSourceWithSingle /** * This will always be an empty array. */ - specifiers: ExportSpecifier[]; + specifiers: ExportSpecifierWithIdentifierLocal[]; } /** @@ -114,6 +119,10 @@ export interface ExportNamedDeclarationWithSource source: StringLiteral; } +export type ExportNamedDeclarationWithoutSource = + | ExportNamedDeclarationWithoutSourceWithMultiple + | ExportNamedDeclarationWithoutSourceWithSingle; + export type ExportNamedDeclaration = | ExportNamedDeclarationWithoutSourceWithMultiple | ExportNamedDeclarationWithoutSourceWithSingle diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/default-and-named-and-namespace/fixture.ts b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/default-and-named-and-namespace/fixture.ts new file mode 100644 index 000000000000..54e0da9ee1d4 --- /dev/null +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/default-and-named-and-namespace/fixture.ts @@ -0,0 +1 @@ +import a, * as b, { c } from 'mod'; diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/default-and-named-and-namespace/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/default-and-named-and-namespace/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..4968c665b7f4 --- /dev/null +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/default-and-named-and-namespace/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,8 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ImportDeclaration _error_ default-and-named-and-namespace TSESTree - Error 1`] = ` +"TSError +> 1 | import a, * as b, { c } from 'mod'; + | ^ 'from' expected. + 2 |" +`; diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/default-and-named-and-namespace/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/default-and-named-and-namespace/snapshots/2-Babel-Error.shot new file mode 100644 index 000000000000..c937b0227c30 --- /dev/null +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/default-and-named-and-namespace/snapshots/2-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ImportDeclaration _error_ default-and-named-and-namespace Babel - Error 1`] = `[SyntaxError: Unexpected token, expected "from" (1:16)]`; diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/default-non-identifier/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/default-and-named-and-namespace/snapshots/3-Alignment-Error.shot similarity index 53% rename from packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/default-non-identifier/snapshots/1-Babel-Error.shot rename to packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/default-and-named-and-namespace/snapshots/3-Alignment-Error.shot index 438c9cdf7501..40b9a5a2bb0f 100644 --- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/default-non-identifier/snapshots/1-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/default-and-named-and-namespace/snapshots/3-Alignment-Error.shot @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration ImportDeclaration _error_ default-non-identifier Babel - Error 1`] = `[SyntaxError: Unexpected token, expected "{" (1:7)]`; +exports[`AST Fixtures declaration ImportDeclaration _error_ default-and-named-and-namespace Error Alignment 1`] = `"Both errored"`; diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/default-non-identifier/fixture.ts b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/default-number-literal/fixture.ts similarity index 100% rename from packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/default-non-identifier/fixture.ts rename to packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/default-number-literal/fixture.ts diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/default-non-identifier/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/default-number-literal/snapshots/1-TSESTree-Error.shot similarity index 81% rename from packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/default-non-identifier/snapshots/1-TSESTree-Error.shot rename to packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/default-number-literal/snapshots/1-TSESTree-Error.shot index 33e9c446a1ac..733e29a135bd 100644 --- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/default-non-identifier/snapshots/1-TSESTree-Error.shot +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/default-number-literal/snapshots/1-TSESTree-Error.shot @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration ImportDeclaration _error_ default-non-identifier TSESTree - Error 1`] = ` +exports[`AST Fixtures declaration ImportDeclaration _error_ default-number-literal TSESTree - Error 1`] = ` "TSError > 1 | import 1 from 'mod'; | ^ Declaration or statement expected. diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/default-non-identifier/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/default-number-literal/snapshots/2-Babel-Error.shot similarity index 68% rename from packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/default-non-identifier/snapshots/2-Babel-Error.shot rename to packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/default-number-literal/snapshots/2-Babel-Error.shot index 438c9cdf7501..edf91ca01db1 100644 --- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/default-non-identifier/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/default-number-literal/snapshots/2-Babel-Error.shot @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration ImportDeclaration _error_ default-non-identifier Babel - Error 1`] = `[SyntaxError: Unexpected token, expected "{" (1:7)]`; +exports[`AST Fixtures declaration ImportDeclaration _error_ default-number-literal Babel - Error 1`] = `[SyntaxError: Unexpected token, expected "{" (1:7)]`; diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/default-non-identifier/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/default-number-literal/snapshots/3-Alignment-Error.shot similarity index 64% rename from packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/default-non-identifier/snapshots/3-Alignment-Error.shot rename to packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/default-number-literal/snapshots/3-Alignment-Error.shot index 2e0bcbec5a5e..f3810de15bec 100644 --- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/default-non-identifier/snapshots/3-Alignment-Error.shot +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/default-number-literal/snapshots/3-Alignment-Error.shot @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration ImportDeclaration _error_ default-non-identifier Error Alignment 1`] = `"Both errored"`; +exports[`AST Fixtures declaration ImportDeclaration _error_ default-number-literal Error Alignment 1`] = `"Both errored"`; diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/default-string-literal/fixture.ts b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/default-string-literal/fixture.ts new file mode 100644 index 000000000000..65c0a923c510 --- /dev/null +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/default-string-literal/fixture.ts @@ -0,0 +1 @@ +import 'a a' from 'mod'; diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/default-string-literal/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/default-string-literal/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..db2f849a6462 --- /dev/null +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/default-string-literal/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,8 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ImportDeclaration _error_ default-string-literal TSESTree - Error 1`] = ` +"TSError +> 1 | import 'a a' from 'mod'; + | ^ ';' expected. + 2 |" +`; diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/default-string-literal/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/default-string-literal/snapshots/2-Babel-Error.shot new file mode 100644 index 000000000000..7f044aaf68a9 --- /dev/null +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/default-string-literal/snapshots/2-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ImportDeclaration _error_ default-string-literal Babel - Error 1`] = `[SyntaxError: Missing semicolon. (1:12)]`; diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/default-non-identifier/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/default-string-literal/snapshots/3-Alignment-Error.shot similarity index 64% rename from packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/default-non-identifier/snapshots/2-Alignment-Error.shot rename to packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/default-string-literal/snapshots/3-Alignment-Error.shot index 2e0bcbec5a5e..6aaccd724166 100644 --- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/default-non-identifier/snapshots/2-Alignment-Error.shot +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/default-string-literal/snapshots/3-Alignment-Error.shot @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration ImportDeclaration _error_ default-non-identifier Error Alignment 1`] = `"Both errored"`; +exports[`AST Fixtures declaration ImportDeclaration _error_ default-string-literal Error Alignment 1`] = `"Both errored"`; diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-identifier-aliased-to-number-literal/fixture.ts b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-identifier-aliased-to-number-literal/fixture.ts new file mode 100644 index 000000000000..e37d9c20f53f --- /dev/null +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-identifier-aliased-to-number-literal/fixture.ts @@ -0,0 +1 @@ +import { X as 1 } from 'mod'; diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-identifier-aliased-to-number-literal/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-identifier-aliased-to-number-literal/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..58be2d8119f6 --- /dev/null +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-identifier-aliased-to-number-literal/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,8 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ImportDeclaration _error_ named-identifier-aliased-to-number-literal TSESTree - Error 1`] = ` +"TSError +> 1 | import { X as 1 } from 'mod'; + | ^ Identifier expected. + 2 |" +`; diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-identifier-aliased-to-number-literal/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-identifier-aliased-to-number-literal/snapshots/2-Babel-Error.shot new file mode 100644 index 000000000000..d9a7cd7a0c2e --- /dev/null +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-identifier-aliased-to-number-literal/snapshots/2-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ImportDeclaration _error_ named-identifier-aliased-to-number-literal Babel - Error 1`] = `[SyntaxError: Unexpected token (1:14)]`; diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-and-namespace/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-identifier-aliased-to-number-literal/snapshots/3-Alignment-Error.shot similarity index 57% rename from packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-and-namespace/snapshots/2-Alignment-Error.shot rename to packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-identifier-aliased-to-number-literal/snapshots/3-Alignment-Error.shot index 89fae3fa27c3..8c894dfa107b 100644 --- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-and-namespace/snapshots/2-Alignment-Error.shot +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-identifier-aliased-to-number-literal/snapshots/3-Alignment-Error.shot @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration ImportDeclaration _error_ named-and-namespace Error Alignment 1`] = `"Both errored"`; +exports[`AST Fixtures declaration ImportDeclaration _error_ named-identifier-aliased-to-number-literal Error Alignment 1`] = `"Both errored"`; diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-identifier-aliased-to-string-literal/fixture.ts b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-identifier-aliased-to-string-literal/fixture.ts new file mode 100644 index 000000000000..6687e6e1bc00 --- /dev/null +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-identifier-aliased-to-string-literal/fixture.ts @@ -0,0 +1 @@ +import { X as 'a a' } from 'mod'; diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-identifier-aliased-to-string-literal/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-identifier-aliased-to-string-literal/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..531618494f56 --- /dev/null +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-identifier-aliased-to-string-literal/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,8 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ImportDeclaration _error_ named-identifier-aliased-to-string-literal TSESTree - Error 1`] = ` +"TSError +> 1 | import { X as 'a a' } from 'mod'; + | ^ Identifier expected. + 2 |" +`; diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-identifier-aliased-to-string-literal/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-identifier-aliased-to-string-literal/snapshots/2-Babel-Error.shot new file mode 100644 index 000000000000..7656a34c665f --- /dev/null +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-identifier-aliased-to-string-literal/snapshots/2-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ImportDeclaration _error_ named-identifier-aliased-to-string-literal Babel - Error 1`] = `[SyntaxError: Unexpected token (1:14)]`; diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/namespace-and-default/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-identifier-aliased-to-string-literal/snapshots/3-Alignment-Error.shot similarity index 57% rename from packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/namespace-and-default/snapshots/2-Alignment-Error.shot rename to packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-identifier-aliased-to-string-literal/snapshots/3-Alignment-Error.shot index 6e491db0e63b..a29f2cd12227 100644 --- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/namespace-and-default/snapshots/2-Alignment-Error.shot +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-identifier-aliased-to-string-literal/snapshots/3-Alignment-Error.shot @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration ImportDeclaration _error_ namespace-and-default Error Alignment 1`] = `"Both errored"`; +exports[`AST Fixtures declaration ImportDeclaration _error_ named-identifier-aliased-to-string-literal Error Alignment 1`] = `"Both errored"`; diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-number-literal-aliased-to-identifier/fixture.ts b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-number-literal-aliased-to-identifier/fixture.ts new file mode 100644 index 000000000000..099f3ad1726b --- /dev/null +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-number-literal-aliased-to-identifier/fixture.ts @@ -0,0 +1 @@ +import { 1 as X } from 'mod'; diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-number-literal-aliased-to-identifier/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-number-literal-aliased-to-identifier/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..e1122d1ce71d --- /dev/null +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-number-literal-aliased-to-identifier/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,8 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ImportDeclaration _error_ named-number-literal-aliased-to-identifier TSESTree - Error 1`] = ` +"TSError +> 1 | import { 1 as X } from 'mod'; + | ^ Identifier expected. + 2 |" +`; diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-and-namespace/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-number-literal-aliased-to-identifier/snapshots/2-Babel-Error.shot similarity index 51% rename from packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-and-namespace/snapshots/1-Babel-Error.shot rename to packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-number-literal-aliased-to-identifier/snapshots/2-Babel-Error.shot index 9cf4c4b719a9..58519208645e 100644 --- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-and-namespace/snapshots/1-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-number-literal-aliased-to-identifier/snapshots/2-Babel-Error.shot @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration ImportDeclaration _error_ named-and-namespace Babel - Error 1`] = `[SyntaxError: Unexpected token, expected "from" (1:12)]`; +exports[`AST Fixtures declaration ImportDeclaration _error_ named-number-literal-aliased-to-identifier Babel - Error 1`] = `[SyntaxError: Unexpected token (1:9)]`; diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-number-literal-aliased-to-identifier/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-number-literal-aliased-to-identifier/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..749860b2f02f --- /dev/null +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-number-literal-aliased-to-identifier/snapshots/3-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ImportDeclaration _error_ named-number-literal-aliased-to-identifier Error Alignment 1`] = `"Both errored"`; diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-number-literal-aliased-to-number-literal/fixture.ts b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-number-literal-aliased-to-number-literal/fixture.ts new file mode 100644 index 000000000000..fea36d1c3a0d --- /dev/null +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-number-literal-aliased-to-number-literal/fixture.ts @@ -0,0 +1 @@ +import { 1 as 1 } from 'mod'; diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-number-literal-aliased-to-number-literal/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-number-literal-aliased-to-number-literal/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..80f9adac9bcb --- /dev/null +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-number-literal-aliased-to-number-literal/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,8 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ImportDeclaration _error_ named-number-literal-aliased-to-number-literal TSESTree - Error 1`] = ` +"TSError +> 1 | import { 1 as 1 } from 'mod'; + | ^ Identifier expected. + 2 |" +`; diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-number-literal-aliased-to-number-literal/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-number-literal-aliased-to-number-literal/snapshots/2-Babel-Error.shot new file mode 100644 index 000000000000..0a7c831653fd --- /dev/null +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-number-literal-aliased-to-number-literal/snapshots/2-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ImportDeclaration _error_ named-number-literal-aliased-to-number-literal Babel - Error 1`] = `[SyntaxError: Unexpected token (1:9)]`; diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-number-literal-aliased-to-number-literal/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-number-literal-aliased-to-number-literal/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..2f287555e305 --- /dev/null +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-number-literal-aliased-to-number-literal/snapshots/3-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ImportDeclaration _error_ named-number-literal-aliased-to-number-literal Error Alignment 1`] = `"Both errored"`; diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-number-literal-aliased-to-string-literal/fixture.ts b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-number-literal-aliased-to-string-literal/fixture.ts new file mode 100644 index 000000000000..511385a56927 --- /dev/null +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-number-literal-aliased-to-string-literal/fixture.ts @@ -0,0 +1 @@ +import { 1 as 'a a' } from 'mod'; diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-number-literal-aliased-to-string-literal/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-number-literal-aliased-to-string-literal/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..ec1b36db89c2 --- /dev/null +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-number-literal-aliased-to-string-literal/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,8 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ImportDeclaration _error_ named-number-literal-aliased-to-string-literal TSESTree - Error 1`] = ` +"TSError +> 1 | import { 1 as 'a a' } from 'mod'; + | ^ Identifier expected. + 2 |" +`; diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-number-literal-aliased-to-string-literal/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-number-literal-aliased-to-string-literal/snapshots/2-Babel-Error.shot new file mode 100644 index 000000000000..19f6f28a36de --- /dev/null +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-number-literal-aliased-to-string-literal/snapshots/2-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ImportDeclaration _error_ named-number-literal-aliased-to-string-literal Babel - Error 1`] = `[SyntaxError: Unexpected token (1:9)]`; diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-number-literal-aliased-to-string-literal/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-number-literal-aliased-to-string-literal/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..7cf9b37ab9fd --- /dev/null +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-number-literal-aliased-to-string-literal/snapshots/3-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ImportDeclaration _error_ named-number-literal-aliased-to-string-literal Error Alignment 1`] = `"Both errored"`; diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-non-identifier/fixture.ts b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-number-literal/fixture.ts similarity index 100% rename from packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-non-identifier/fixture.ts rename to packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-number-literal/fixture.ts diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-non-identifier/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-number-literal/snapshots/1-Babel-Error.shot similarity index 100% rename from packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-non-identifier/snapshots/1-Babel-Error.shot rename to packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-number-literal/snapshots/1-Babel-Error.shot diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-non-identifier/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-number-literal/snapshots/1-TSESTree-Error.shot similarity index 82% rename from packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-non-identifier/snapshots/1-TSESTree-Error.shot rename to packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-number-literal/snapshots/1-TSESTree-Error.shot index a4b94678f3e0..08a52f136259 100644 --- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-non-identifier/snapshots/1-TSESTree-Error.shot +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-number-literal/snapshots/1-TSESTree-Error.shot @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration ImportDeclaration _error_ named-non-identifier TSESTree - Error 1`] = ` +exports[`AST Fixtures declaration ImportDeclaration _error_ named-number-literal TSESTree - Error 1`] = ` "TSError > 1 | import { 1 } from 'mod'; | ^ Identifier expected. diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-non-identifier/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-number-literal/snapshots/2-Alignment-Error.shot similarity index 100% rename from packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-non-identifier/snapshots/2-Alignment-Error.shot rename to packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-number-literal/snapshots/2-Alignment-Error.shot diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-non-identifier/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-number-literal/snapshots/2-Babel-Error.shot similarity index 65% rename from packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-non-identifier/snapshots/2-Babel-Error.shot rename to packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-number-literal/snapshots/2-Babel-Error.shot index 970528e3253d..e28da23b2a8f 100644 --- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-non-identifier/snapshots/2-Babel-Error.shot +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-number-literal/snapshots/2-Babel-Error.shot @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration ImportDeclaration _error_ named-non-identifier Babel - Error 1`] = `[SyntaxError: Unexpected token (1:9)]`; +exports[`AST Fixtures declaration ImportDeclaration _error_ named-number-literal Babel - Error 1`] = `[SyntaxError: Unexpected token (1:9)]`; diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-non-identifier/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-number-literal/snapshots/3-Alignment-Error.shot similarity index 65% rename from packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-non-identifier/snapshots/3-Alignment-Error.shot rename to packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-number-literal/snapshots/3-Alignment-Error.shot index fefbeef9c524..d79fe92b612a 100644 --- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-non-identifier/snapshots/3-Alignment-Error.shot +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-number-literal/snapshots/3-Alignment-Error.shot @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration ImportDeclaration _error_ named-non-identifier Error Alignment 1`] = `"Both errored"`; +exports[`AST Fixtures declaration ImportDeclaration _error_ named-number-literal Error Alignment 1`] = `"Both errored"`; diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-string-literal-aliased-to-number-literal/fixture.ts b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-string-literal-aliased-to-number-literal/fixture.ts new file mode 100644 index 000000000000..0a3e8d333471 --- /dev/null +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-string-literal-aliased-to-number-literal/fixture.ts @@ -0,0 +1 @@ +import { "😭" as 1 } from 'mod'; diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-string-literal-aliased-to-number-literal/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-string-literal-aliased-to-number-literal/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..96863c644aec --- /dev/null +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-string-literal-aliased-to-number-literal/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,8 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ImportDeclaration _error_ named-string-literal-aliased-to-number-literal TSESTree - Error 1`] = ` +"TSError +> 1 | import { "😭" as 1 } from 'mod'; + | ^ Identifier expected. + 2 |" +`; diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-string-literal-aliased-to-number-literal/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-string-literal-aliased-to-number-literal/snapshots/2-Babel-Error.shot new file mode 100644 index 000000000000..59bdc16bbe31 --- /dev/null +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-string-literal-aliased-to-number-literal/snapshots/2-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ImportDeclaration _error_ named-string-literal-aliased-to-number-literal Babel - Error 1`] = `[SyntaxError: Unexpected token (1:17)]`; diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-string-literal-aliased-to-number-literal/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-string-literal-aliased-to-number-literal/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..9fdcd1ad6d2f --- /dev/null +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-string-literal-aliased-to-number-literal/snapshots/3-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ImportDeclaration _error_ named-string-literal-aliased-to-number-literal Error Alignment 1`] = `"Both errored"`; diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-string-literal-aliased-to-string-literal/fixture.ts b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-string-literal-aliased-to-string-literal/fixture.ts new file mode 100644 index 000000000000..d2a4b3f84e80 --- /dev/null +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-string-literal-aliased-to-string-literal/fixture.ts @@ -0,0 +1 @@ +import { "😭" as 'a a' } from 'mod'; diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-string-literal-aliased-to-string-literal/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-string-literal-aliased-to-string-literal/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..31ba0b991eb4 --- /dev/null +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-string-literal-aliased-to-string-literal/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,8 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ImportDeclaration _error_ named-string-literal-aliased-to-string-literal TSESTree - Error 1`] = ` +"TSError +> 1 | import { "😭" as 'a a' } from 'mod'; + | ^ Identifier expected. + 2 |" +`; diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-string-literal-aliased-to-string-literal/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-string-literal-aliased-to-string-literal/snapshots/2-Babel-Error.shot new file mode 100644 index 000000000000..13f04b7d71f3 --- /dev/null +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-string-literal-aliased-to-string-literal/snapshots/2-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ImportDeclaration _error_ named-string-literal-aliased-to-string-literal Babel - Error 1`] = `[SyntaxError: Unexpected token (1:17)]`; diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-string-literal-aliased-to-string-literal/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-string-literal-aliased-to-string-literal/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..bac20b92c0dd --- /dev/null +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-string-literal-aliased-to-string-literal/snapshots/3-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ImportDeclaration _error_ named-string-literal-aliased-to-string-literal Error Alignment 1`] = `"Both errored"`; diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-string-literal/fixture.ts b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-string-literal/fixture.ts new file mode 100644 index 000000000000..db0db5b50afe --- /dev/null +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-string-literal/fixture.ts @@ -0,0 +1 @@ +import { "😭" } from 'mod'; diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-string-literal/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-string-literal/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..cb41ba55e998 --- /dev/null +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-string-literal/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,8 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ImportDeclaration _error_ named-string-literal TSESTree - Error 1`] = ` +"TSError +> 1 | import { "😭" } from 'mod'; + | ^ Identifier expected. + 2 |" +`; diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-string-literal/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-string-literal/snapshots/2-Babel-Error.shot new file mode 100644 index 000000000000..d3b922788498 --- /dev/null +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-string-literal/snapshots/2-Babel-Error.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ImportDeclaration _error_ named-string-literal Babel - Error 1`] = ` +[SyntaxError: A string literal cannot be used as an imported binding. +- Did you mean \`import { "😭" as foo }\`? (1:9)] +`; diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/namespace-and-named/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-string-literal/snapshots/3-Alignment-Error.shot similarity index 65% rename from packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/namespace-and-named/snapshots/2-Alignment-Error.shot rename to packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-string-literal/snapshots/3-Alignment-Error.shot index f1e891dbecaf..6980fcce0d80 100644 --- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/namespace-and-named/snapshots/2-Alignment-Error.shot +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/named-string-literal/snapshots/3-Alignment-Error.shot @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration ImportDeclaration _error_ namespace-and-named Error Alignment 1`] = `"Both errored"`; +exports[`AST Fixtures declaration ImportDeclaration _error_ named-string-literal Error Alignment 1`] = `"Both errored"`; diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/namespace-and-default/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/namespace-and-default/snapshots/1-Babel-Error.shot deleted file mode 100644 index 294d069aacc6..000000000000 --- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/namespace-and-default/snapshots/1-Babel-Error.shot +++ /dev/null @@ -1,3 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`AST Fixtures declaration ImportDeclaration _error_ namespace-and-default Babel - Error 1`] = `[SyntaxError: Unexpected token, expected "from" (1:13)]`; diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/namespace-and-named/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/namespace-and-named/snapshots/1-Babel-Error.shot deleted file mode 100644 index 605940a84336..000000000000 --- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/namespace-and-named/snapshots/1-Babel-Error.shot +++ /dev/null @@ -1,3 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`AST Fixtures declaration ImportDeclaration _error_ namespace-and-named Babel - Error 1`] = `[SyntaxError: Unexpected token, expected "from" (1:13)]`; diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/namespace-and-namespace/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/namespace-and-namespace/snapshots/1-Babel-Error.shot deleted file mode 100644 index 8efbfcaf5191..000000000000 --- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/namespace-and-namespace/snapshots/1-Babel-Error.shot +++ /dev/null @@ -1,3 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`AST Fixtures declaration ImportDeclaration _error_ namespace-and-namespace Babel - Error 1`] = `[SyntaxError: Unexpected token, expected "from" (1:13)]`; diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/namespace-and-namespace/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/namespace-and-namespace/snapshots/2-Alignment-Error.shot deleted file mode 100644 index e3c8c7a6288d..000000000000 --- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/namespace-and-namespace/snapshots/2-Alignment-Error.shot +++ /dev/null @@ -1,3 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`AST Fixtures declaration ImportDeclaration _error_ namespace-and-namespace Error Alignment 1`] = `"Both errored"`; diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/namespace-non-identifier/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/namespace-non-identifier/snapshots/1-Babel-Error.shot deleted file mode 100644 index a511cc6c94d3..000000000000 --- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/namespace-non-identifier/snapshots/1-Babel-Error.shot +++ /dev/null @@ -1,3 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`AST Fixtures declaration ImportDeclaration _error_ namespace-non-identifier Babel - Error 1`] = `[SyntaxError: Unexpected token (1:12)]`; diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/namespace-non-identifier/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/namespace-non-identifier/snapshots/2-Alignment-Error.shot deleted file mode 100644 index f0d97ae32bc8..000000000000 --- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/namespace-non-identifier/snapshots/2-Alignment-Error.shot +++ /dev/null @@ -1,3 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`AST Fixtures declaration ImportDeclaration _error_ namespace-non-identifier Error Alignment 1`] = `"Both errored"`; diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/non-string-source/snapshots/1-Babel-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/non-string-source/snapshots/1-Babel-Error.shot deleted file mode 100644 index 49abb8366621..000000000000 --- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/non-string-source/snapshots/1-Babel-Error.shot +++ /dev/null @@ -1,3 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`AST Fixtures declaration ImportDeclaration _error_ non-string-source Babel - Error 1`] = `[SyntaxError: Unexpected token (1:19)]`; diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/non-string-source/snapshots/2-Alignment-Error.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/non-string-source/snapshots/2-Alignment-Error.shot deleted file mode 100644 index 0d5964ffc24c..000000000000 --- a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/_error_/non-string-source/snapshots/2-Alignment-Error.shot +++ /dev/null @@ -1,3 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`AST Fixtures declaration ImportDeclaration _error_ non-string-source Error Alignment 1`] = `"Both errored"`; diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/named-string-literal-aliased-to-identifier/fixture.ts b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/named-string-literal-aliased-to-identifier/fixture.ts new file mode 100644 index 000000000000..dd77a2ba052f --- /dev/null +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/named-string-literal-aliased-to-identifier/fixture.ts @@ -0,0 +1 @@ +import { 'a a' as X } from 'mod'; diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/named-string-literal-aliased-to-identifier/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/named-string-literal-aliased-to-identifier/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..c17bff3bdbb9 --- /dev/null +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/named-string-literal-aliased-to-identifier/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,73 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ImportDeclaration named-string-literal-aliased-to-identifier TSESTree - AST 1`] = ` +Program { + type: "Program", + body: [ + ImportDeclaration { + type: "ImportDeclaration", + attributes: [], + importKind: "value", + source: Literal { + type: "Literal", + raw: "'mod'", + value: "mod", + + range: [27, 32], + loc: { + start: { column: 27, line: 1 }, + end: { column: 32, line: 1 }, + }, + }, + specifiers: [ + ImportSpecifier { + type: "ImportSpecifier", + imported: Literal { + type: "Literal", + raw: "'a a'", + value: "a a", + + range: [9, 14], + loc: { + start: { column: 9, line: 1 }, + end: { column: 14, line: 1 }, + }, + }, + importKind: "value", + local: Identifier { + type: "Identifier", + decorators: [], + name: "X", + optional: false, + + range: [18, 19], + loc: { + start: { column: 18, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + + range: [9, 19], + loc: { + start: { column: 9, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + ], + + range: [0, 33], + loc: { + start: { column: 0, line: 1 }, + end: { column: 33, line: 1 }, + }, + }, + ], + sourceType: "module", + + range: [0, 34], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/named-string-literal-aliased-to-identifier/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/named-string-literal-aliased-to-identifier/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..707ce3ff9c17 --- /dev/null +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/named-string-literal-aliased-to-identifier/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,96 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ImportDeclaration named-string-literal-aliased-to-identifier TSESTree - Tokens 1`] = ` +[ + Keyword { + type: "Keyword", + value: "import", + + range: [0, 6], + loc: { + start: { column: 0, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [7, 8], + loc: { + start: { column: 7, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + String { + type: "String", + value: "'a a'", + + range: [9, 14], + loc: { + start: { column: 9, line: 1 }, + end: { column: 14, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "as", + + range: [15, 17], + loc: { + start: { column: 15, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "X", + + range: [18, 19], + loc: { + start: { column: 18, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [20, 21], + loc: { + start: { column: 20, line: 1 }, + end: { column: 21, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "from", + + range: [22, 26], + loc: { + start: { column: 22, line: 1 }, + end: { column: 26, line: 1 }, + }, + }, + String { + type: "String", + value: "'mod'", + + range: [27, 32], + loc: { + start: { column: 27, line: 1 }, + end: { column: 32, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [32, 33], + loc: { + start: { column: 32, line: 1 }, + end: { column: 33, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/named-string-literal-aliased-to-identifier/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/named-string-literal-aliased-to-identifier/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..c8b8eaf484f7 --- /dev/null +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/named-string-literal-aliased-to-identifier/snapshots/3-Babel-AST.shot @@ -0,0 +1,71 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ImportDeclaration named-string-literal-aliased-to-identifier Babel - AST 1`] = ` +Program { + type: "Program", + body: [ + ImportDeclaration { + type: "ImportDeclaration", + assertions: [], + importKind: "value", + source: Literal { + type: "Literal", + raw: "'mod'", + value: "mod", + + range: [27, 32], + loc: { + start: { column: 27, line: 1 }, + end: { column: 32, line: 1 }, + }, + }, + specifiers: [ + ImportSpecifier { + type: "ImportSpecifier", + imported: Literal { + type: "Literal", + raw: "'a a'", + value: "a a", + + range: [9, 14], + loc: { + start: { column: 9, line: 1 }, + end: { column: 14, line: 1 }, + }, + }, + importKind: "value", + local: Identifier { + type: "Identifier", + name: "X", + + range: [18, 19], + loc: { + start: { column: 18, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + + range: [9, 19], + loc: { + start: { column: 9, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + ], + + range: [0, 33], + loc: { + start: { column: 0, line: 1 }, + end: { column: 33, line: 1 }, + }, + }, + ], + sourceType: "module", + + range: [0, 34], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/named-string-literal-aliased-to-identifier/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/named-string-literal-aliased-to-identifier/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..49688d3a6cb3 --- /dev/null +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/named-string-literal-aliased-to-identifier/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,96 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ImportDeclaration named-string-literal-aliased-to-identifier Babel - Tokens 1`] = ` +[ + Keyword { + type: "Keyword", + value: "import", + + range: [0, 6], + loc: { + start: { column: 0, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [7, 8], + loc: { + start: { column: 7, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + String { + type: "String", + value: "'a a'", + + range: [9, 14], + loc: { + start: { column: 9, line: 1 }, + end: { column: 14, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "as", + + range: [15, 17], + loc: { + start: { column: 15, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "X", + + range: [18, 19], + loc: { + start: { column: 18, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [20, 21], + loc: { + start: { column: 20, line: 1 }, + end: { column: 21, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "from", + + range: [22, 26], + loc: { + start: { column: 22, line: 1 }, + end: { column: 26, line: 1 }, + }, + }, + String { + type: "String", + value: "'mod'", + + range: [27, 32], + loc: { + start: { column: 27, line: 1 }, + end: { column: 32, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [32, 33], + loc: { + start: { column: 32, line: 1 }, + end: { column: 33, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/named-string-literal-aliased-to-identifier/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/named-string-literal-aliased-to-identifier/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..4e07e47433b7 --- /dev/null +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/named-string-literal-aliased-to-identifier/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,78 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ImportDeclaration named-string-literal-aliased-to-identifier AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ImportDeclaration { + type: 'ImportDeclaration', +- attributes: Array [], ++ assertions: Array [], + importKind: 'value', + source: Literal { + type: 'Literal', + raw: '\\'mod\\'', + value: 'mod', + + range: [27, 32], + loc: { + start: { column: 27, line: 1 }, + end: { column: 32, line: 1 }, + }, + }, + specifiers: Array [ + ImportSpecifier { + type: 'ImportSpecifier', + imported: Literal { + type: 'Literal', + raw: '\\'a a\\'', + value: 'a a', + + range: [9, 14], + loc: { + start: { column: 9, line: 1 }, + end: { column: 14, line: 1 }, + }, + }, + importKind: 'value', + local: Identifier { + type: 'Identifier', +- decorators: Array [], + name: 'X', +- optional: false, + + range: [18, 19], + loc: { + start: { column: 18, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + + range: [9, 19], + loc: { + start: { column: 9, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + ], + + range: [0, 33], + loc: { + start: { column: 0, line: 1 }, + end: { column: 33, line: 1 }, + }, + }, + ], + sourceType: 'module', + + range: [0, 34], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, + }" +`; diff --git a/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/named-string-literal-aliased-to-identifier/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/named-string-literal-aliased-to-identifier/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..a3c5da04f73a --- /dev/null +++ b/packages/ast-spec/src/declaration/ImportDeclaration/fixtures/named-string-literal-aliased-to-identifier/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ImportDeclaration named-string-literal-aliased-to-identifier AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/await-using-multiple-declarations/fixture.ts b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/await-using-multiple-declarations/fixture.ts index 9e48b70be733..58f984a20bd4 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/await-using-multiple-declarations/fixture.ts +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/await-using-multiple-declarations/fixture.ts @@ -1 +1,2 @@ -await using x = 1, y = 2; +await using x = 1, + y = 2; diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/await-using-multiple-declarations/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/await-using-multiple-declarations/snapshots/1-TSESTree-AST.shot index cc177f81242f..d54fd36f4f5e 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/await-using-multiple-declarations/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/await-using-multiple-declarations/snapshots/1-TSESTree-AST.shot @@ -49,10 +49,10 @@ Program { name: "y", optional: false, - range: [19, 20], + range: [21, 22], loc: { - start: { column: 19, line: 1 }, - end: { column: 20, line: 1 }, + start: { column: 2, line: 2 }, + end: { column: 3, line: 2 }, }, }, init: Literal { @@ -60,36 +60,36 @@ Program { raw: "2", value: 2, - range: [23, 24], + range: [25, 26], loc: { - start: { column: 23, line: 1 }, - end: { column: 24, line: 1 }, + start: { column: 6, line: 2 }, + end: { column: 7, line: 2 }, }, }, - range: [19, 24], + range: [21, 26], loc: { - start: { column: 19, line: 1 }, - end: { column: 24, line: 1 }, + start: { column: 2, line: 2 }, + end: { column: 7, line: 2 }, }, }, ], declare: false, kind: "await using", - range: [0, 25], + range: [0, 27], loc: { start: { column: 0, line: 1 }, - end: { column: 25, line: 1 }, + end: { column: 8, line: 2 }, }, }, ], sourceType: "script", - range: [0, 26], + range: [0, 28], loc: { start: { column: 0, line: 1 }, - end: { column: 0, line: 2 }, + end: { column: 0, line: 3 }, }, } `; diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/await-using-multiple-declarations/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/await-using-multiple-declarations/snapshots/2-TSESTree-Tokens.shot index c123deb06892..7411e75da579 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/await-using-multiple-declarations/snapshots/2-TSESTree-Tokens.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/await-using-multiple-declarations/snapshots/2-TSESTree-Tokens.shot @@ -66,40 +66,40 @@ exports[`AST Fixtures declaration VariableDeclaration await-using-multiple-decla type: "Identifier", value: "y", - range: [19, 20], + range: [21, 22], loc: { - start: { column: 19, line: 1 }, - end: { column: 20, line: 1 }, + start: { column: 2, line: 2 }, + end: { column: 3, line: 2 }, }, }, Punctuator { type: "Punctuator", value: "=", - range: [21, 22], + range: [23, 24], loc: { - start: { column: 21, line: 1 }, - end: { column: 22, line: 1 }, + start: { column: 4, line: 2 }, + end: { column: 5, line: 2 }, }, }, Numeric { type: "Numeric", value: "2", - range: [23, 24], + range: [25, 26], loc: { - start: { column: 23, line: 1 }, - end: { column: 24, line: 1 }, + start: { column: 6, line: 2 }, + end: { column: 7, line: 2 }, }, }, Punctuator { type: "Punctuator", value: ";", - range: [24, 25], + range: [26, 27], loc: { - start: { column: 24, line: 1 }, - end: { column: 25, line: 1 }, + start: { column: 7, line: 2 }, + end: { column: 8, line: 2 }, }, }, ] diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/await-using-multiple-declarations/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/await-using-multiple-declarations/snapshots/3-Babel-AST.shot index 56ed5f448201..19023e03c7ed 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/await-using-multiple-declarations/snapshots/3-Babel-AST.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/await-using-multiple-declarations/snapshots/3-Babel-AST.shot @@ -43,10 +43,10 @@ Program { type: "Identifier", name: "y", - range: [19, 20], + range: [21, 22], loc: { - start: { column: 19, line: 1 }, - end: { column: 20, line: 1 }, + start: { column: 2, line: 2 }, + end: { column: 3, line: 2 }, }, }, init: Literal { @@ -54,35 +54,35 @@ Program { raw: "2", value: 2, - range: [23, 24], + range: [25, 26], loc: { - start: { column: 23, line: 1 }, - end: { column: 24, line: 1 }, + start: { column: 6, line: 2 }, + end: { column: 7, line: 2 }, }, }, - range: [19, 24], + range: [21, 26], loc: { - start: { column: 19, line: 1 }, - end: { column: 24, line: 1 }, + start: { column: 2, line: 2 }, + end: { column: 7, line: 2 }, }, }, ], kind: "await using", - range: [0, 25], + range: [0, 27], loc: { start: { column: 0, line: 1 }, - end: { column: 25, line: 1 }, + end: { column: 8, line: 2 }, }, }, ], sourceType: "script", - range: [0, 26], + range: [0, 28], loc: { start: { column: 0, line: 1 }, - end: { column: 0, line: 2 }, + end: { column: 0, line: 3 }, }, } `; diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/await-using-multiple-declarations/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/await-using-multiple-declarations/snapshots/4-Babel-Tokens.shot index a4259e47cb7e..ff50696ccc37 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/await-using-multiple-declarations/snapshots/4-Babel-Tokens.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/await-using-multiple-declarations/snapshots/4-Babel-Tokens.shot @@ -66,40 +66,40 @@ exports[`AST Fixtures declaration VariableDeclaration await-using-multiple-decla type: "Identifier", value: "y", - range: [19, 20], + range: [21, 22], loc: { - start: { column: 19, line: 1 }, - end: { column: 20, line: 1 }, + start: { column: 2, line: 2 }, + end: { column: 3, line: 2 }, }, }, Punctuator { type: "Punctuator", value: "=", - range: [21, 22], + range: [23, 24], loc: { - start: { column: 21, line: 1 }, - end: { column: 22, line: 1 }, + start: { column: 4, line: 2 }, + end: { column: 5, line: 2 }, }, }, Numeric { type: "Numeric", value: "2", - range: [23, 24], + range: [25, 26], loc: { - start: { column: 23, line: 1 }, - end: { column: 24, line: 1 }, + start: { column: 6, line: 2 }, + end: { column: 7, line: 2 }, }, }, Punctuator { type: "Punctuator", value: ";", - range: [24, 25], + range: [26, 27], loc: { - start: { column: 24, line: 1 }, - end: { column: 25, line: 1 }, + start: { column: 7, line: 2 }, + end: { column: 8, line: 2 }, }, }, ] diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/await-using-multiple-declarations/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/await-using-multiple-declarations/snapshots/5-AST-Alignment-AST.shot index 4495e1e3efaf..5731e016531e 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/await-using-multiple-declarations/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/await-using-multiple-declarations/snapshots/5-AST-Alignment-AST.shot @@ -53,10 +53,10 @@ exports[`AST Fixtures declaration VariableDeclaration await-using-multiple-decla name: 'y', - optional: false, - range: [19, 20], + range: [21, 22], loc: { - start: { column: 19, line: 1 }, - end: { column: 20, line: 1 }, + start: { column: 2, line: 2 }, + end: { column: 3, line: 2 }, }, }, init: Literal { @@ -64,36 +64,36 @@ exports[`AST Fixtures declaration VariableDeclaration await-using-multiple-decla raw: '2', value: 2, - range: [23, 24], + range: [25, 26], loc: { - start: { column: 23, line: 1 }, - end: { column: 24, line: 1 }, + start: { column: 6, line: 2 }, + end: { column: 7, line: 2 }, }, }, - range: [19, 24], + range: [21, 26], loc: { - start: { column: 19, line: 1 }, - end: { column: 24, line: 1 }, + start: { column: 2, line: 2 }, + end: { column: 7, line: 2 }, }, }, ], - declare: false, kind: 'await using', - range: [0, 25], + range: [0, 27], loc: { start: { column: 0, line: 1 }, - end: { column: 25, line: 1 }, + end: { column: 8, line: 2 }, }, }, ], sourceType: 'script', - range: [0, 26], + range: [0, 28], loc: { start: { column: 0, line: 1 }, - end: { column: 0, line: 2 }, + end: { column: 0, line: 3 }, }, }" `; diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/using-multiple-declarations/fixture.ts b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/using-multiple-declarations/fixture.ts index dcce1ee2a42a..e1c8d6e78ad2 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/using-multiple-declarations/fixture.ts +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/using-multiple-declarations/fixture.ts @@ -1 +1,2 @@ -using x = 1, y = 2; +using x = 1, + y = 2; diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/using-multiple-declarations/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/using-multiple-declarations/snapshots/1-TSESTree-AST.shot index 0e6057adde39..085698cc3718 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/using-multiple-declarations/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/using-multiple-declarations/snapshots/1-TSESTree-AST.shot @@ -49,10 +49,10 @@ Program { name: "y", optional: false, - range: [13, 14], + range: [15, 16], loc: { - start: { column: 13, line: 1 }, - end: { column: 14, line: 1 }, + start: { column: 2, line: 2 }, + end: { column: 3, line: 2 }, }, }, init: Literal { @@ -60,36 +60,36 @@ Program { raw: "2", value: 2, - range: [17, 18], + range: [19, 20], loc: { - start: { column: 17, line: 1 }, - end: { column: 18, line: 1 }, + start: { column: 6, line: 2 }, + end: { column: 7, line: 2 }, }, }, - range: [13, 18], + range: [15, 20], loc: { - start: { column: 13, line: 1 }, - end: { column: 18, line: 1 }, + start: { column: 2, line: 2 }, + end: { column: 7, line: 2 }, }, }, ], declare: false, kind: "using", - range: [0, 19], + range: [0, 21], loc: { start: { column: 0, line: 1 }, - end: { column: 19, line: 1 }, + end: { column: 8, line: 2 }, }, }, ], sourceType: "script", - range: [0, 20], + range: [0, 22], loc: { start: { column: 0, line: 1 }, - end: { column: 0, line: 2 }, + end: { column: 0, line: 3 }, }, } `; diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/using-multiple-declarations/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/using-multiple-declarations/snapshots/2-TSESTree-Tokens.shot index 5199e67367c1..b07cd4d7ef5f 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/using-multiple-declarations/snapshots/2-TSESTree-Tokens.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/using-multiple-declarations/snapshots/2-TSESTree-Tokens.shot @@ -56,40 +56,40 @@ exports[`AST Fixtures declaration VariableDeclaration using-multiple-declaration type: "Identifier", value: "y", - range: [13, 14], + range: [15, 16], loc: { - start: { column: 13, line: 1 }, - end: { column: 14, line: 1 }, + start: { column: 2, line: 2 }, + end: { column: 3, line: 2 }, }, }, Punctuator { type: "Punctuator", value: "=", - range: [15, 16], + range: [17, 18], loc: { - start: { column: 15, line: 1 }, - end: { column: 16, line: 1 }, + start: { column: 4, line: 2 }, + end: { column: 5, line: 2 }, }, }, Numeric { type: "Numeric", value: "2", - range: [17, 18], + range: [19, 20], loc: { - start: { column: 17, line: 1 }, - end: { column: 18, line: 1 }, + start: { column: 6, line: 2 }, + end: { column: 7, line: 2 }, }, }, Punctuator { type: "Punctuator", value: ";", - range: [18, 19], + range: [20, 21], loc: { - start: { column: 18, line: 1 }, - end: { column: 19, line: 1 }, + start: { column: 7, line: 2 }, + end: { column: 8, line: 2 }, }, }, ] diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/using-multiple-declarations/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/using-multiple-declarations/snapshots/3-Babel-AST.shot index 291406b764a7..e42780ca03e4 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/using-multiple-declarations/snapshots/3-Babel-AST.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/using-multiple-declarations/snapshots/3-Babel-AST.shot @@ -43,10 +43,10 @@ Program { type: "Identifier", name: "y", - range: [13, 14], + range: [15, 16], loc: { - start: { column: 13, line: 1 }, - end: { column: 14, line: 1 }, + start: { column: 2, line: 2 }, + end: { column: 3, line: 2 }, }, }, init: Literal { @@ -54,35 +54,35 @@ Program { raw: "2", value: 2, - range: [17, 18], + range: [19, 20], loc: { - start: { column: 17, line: 1 }, - end: { column: 18, line: 1 }, + start: { column: 6, line: 2 }, + end: { column: 7, line: 2 }, }, }, - range: [13, 18], + range: [15, 20], loc: { - start: { column: 13, line: 1 }, - end: { column: 18, line: 1 }, + start: { column: 2, line: 2 }, + end: { column: 7, line: 2 }, }, }, ], kind: "using", - range: [0, 19], + range: [0, 21], loc: { start: { column: 0, line: 1 }, - end: { column: 19, line: 1 }, + end: { column: 8, line: 2 }, }, }, ], sourceType: "script", - range: [0, 20], + range: [0, 22], loc: { start: { column: 0, line: 1 }, - end: { column: 0, line: 2 }, + end: { column: 0, line: 3 }, }, } `; diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/using-multiple-declarations/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/using-multiple-declarations/snapshots/4-Babel-Tokens.shot index 1adcd3e551cd..500fb5e0772a 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/using-multiple-declarations/snapshots/4-Babel-Tokens.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/using-multiple-declarations/snapshots/4-Babel-Tokens.shot @@ -56,40 +56,40 @@ exports[`AST Fixtures declaration VariableDeclaration using-multiple-declaration type: "Identifier", value: "y", - range: [13, 14], + range: [15, 16], loc: { - start: { column: 13, line: 1 }, - end: { column: 14, line: 1 }, + start: { column: 2, line: 2 }, + end: { column: 3, line: 2 }, }, }, Punctuator { type: "Punctuator", value: "=", - range: [15, 16], + range: [17, 18], loc: { - start: { column: 15, line: 1 }, - end: { column: 16, line: 1 }, + start: { column: 4, line: 2 }, + end: { column: 5, line: 2 }, }, }, Numeric { type: "Numeric", value: "2", - range: [17, 18], + range: [19, 20], loc: { - start: { column: 17, line: 1 }, - end: { column: 18, line: 1 }, + start: { column: 6, line: 2 }, + end: { column: 7, line: 2 }, }, }, Punctuator { type: "Punctuator", value: ";", - range: [18, 19], + range: [20, 21], loc: { - start: { column: 18, line: 1 }, - end: { column: 19, line: 1 }, + start: { column: 7, line: 2 }, + end: { column: 8, line: 2 }, }, }, ] diff --git a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/using-multiple-declarations/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/using-multiple-declarations/snapshots/5-AST-Alignment-AST.shot index 5895a5a4d686..95f446ee6ff6 100644 --- a/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/using-multiple-declarations/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/declaration/VariableDeclaration/fixtures/using-multiple-declarations/snapshots/5-AST-Alignment-AST.shot @@ -53,10 +53,10 @@ exports[`AST Fixtures declaration VariableDeclaration using-multiple-declaration name: 'y', - optional: false, - range: [13, 14], + range: [15, 16], loc: { - start: { column: 13, line: 1 }, - end: { column: 14, line: 1 }, + start: { column: 2, line: 2 }, + end: { column: 3, line: 2 }, }, }, init: Literal { @@ -64,36 +64,36 @@ exports[`AST Fixtures declaration VariableDeclaration using-multiple-declaration raw: '2', value: 2, - range: [17, 18], + range: [19, 20], loc: { - start: { column: 17, line: 1 }, - end: { column: 18, line: 1 }, + start: { column: 6, line: 2 }, + end: { column: 7, line: 2 }, }, }, - range: [13, 18], + range: [15, 20], loc: { - start: { column: 13, line: 1 }, - end: { column: 18, line: 1 }, + start: { column: 2, line: 2 }, + end: { column: 7, line: 2 }, }, }, ], - declare: false, kind: 'using', - range: [0, 19], + range: [0, 21], loc: { start: { column: 0, line: 1 }, - end: { column: 19, line: 1 }, + end: { column: 8, line: 2 }, }, }, ], sourceType: 'script', - range: [0, 20], + range: [0, 22], loc: { start: { column: 0, line: 1 }, - end: { column: 0, line: 2 }, + end: { column: 0, line: 3 }, }, }" `; diff --git a/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component/fixture.tsx b/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component/fixture.tsx index 04117403f023..2e5c444e3f6c 100644 --- a/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component/fixture.tsx +++ b/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component/fixture.tsx @@ -1,10 +1,10 @@ const x = ; -const y = ; +const y = ; interface NamespacePropComponentProps { - "a:b": string; + 'a:b': string; } function NamespacePropComponent(props: NamespacePropComponentProps) { - return
{props["a:b"]}
; + return
{props['a:b']}
; } diff --git a/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component/snapshots/1-TSESTree-AST.shot index 71bbf93d4942..100fbb780b5a 100644 --- a/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component/snapshots/1-TSESTree-AST.shot @@ -154,10 +154,10 @@ Program { type: "JSXIdentifier", name: "b", - range: [96, 97], + range: [94, 95], loc: { - start: { column: 38, line: 2 }, - end: { column: 39, line: 2 }, + start: { column: 36, line: 2 }, + end: { column: 37, line: 2 }, }, }, namespace: JSXIdentifier { @@ -171,10 +171,10 @@ Program { }, }, - range: [92, 97], + range: [92, 95], loc: { start: { column: 34, line: 2 }, - end: { column: 39, line: 2 }, + end: { column: 37, line: 2 }, }, }, value: Literal { @@ -182,17 +182,17 @@ Program { raw: ""loose spacing"", value: "loose spacing", - range: [98, 113], + range: [96, 111], loc: { - start: { column: 40, line: 2 }, - end: { column: 55, line: 2 }, + start: { column: 38, line: 2 }, + end: { column: 53, line: 2 }, }, }, - range: [92, 113], + range: [92, 111], loc: { start: { column: 34, line: 2 }, - end: { column: 55, line: 2 }, + end: { column: 53, line: 2 }, }, }, ], @@ -208,34 +208,34 @@ Program { }, selfClosing: true, - range: [68, 116], + range: [68, 114], loc: { start: { column: 10, line: 2 }, - end: { column: 58, line: 2 }, + end: { column: 56, line: 2 }, }, }, - range: [68, 116], + range: [68, 114], loc: { start: { column: 10, line: 2 }, - end: { column: 58, line: 2 }, + end: { column: 56, line: 2 }, }, }, - range: [64, 116], + range: [64, 114], loc: { start: { column: 6, line: 2 }, - end: { column: 58, line: 2 }, + end: { column: 56, line: 2 }, }, }, ], declare: false, kind: "const", - range: [58, 117], + range: [58, 115], loc: { start: { column: 0, line: 2 }, - end: { column: 59, line: 2 }, + end: { column: 57, line: 2 }, }, }, TSInterfaceDeclaration { @@ -248,13 +248,13 @@ Program { computed: false, key: Literal { type: "Literal", - raw: ""a:b"", + raw: "'a:b'", value: "a:b", - range: [163, 168], + range: [159, 164], loc: { - start: { column: 4, line: 5 }, - end: { column: 9, line: 5 }, + start: { column: 2, line: 5 }, + end: { column: 7, line: 5 }, }, }, optional: false, @@ -265,29 +265,29 @@ Program { typeAnnotation: TSStringKeyword { type: "TSStringKeyword", - range: [170, 176], + range: [166, 172], loc: { - start: { column: 11, line: 5 }, - end: { column: 17, line: 5 }, + start: { column: 9, line: 5 }, + end: { column: 15, line: 5 }, }, }, - range: [168, 176], + range: [164, 172], loc: { - start: { column: 9, line: 5 }, - end: { column: 17, line: 5 }, + start: { column: 7, line: 5 }, + end: { column: 15, line: 5 }, }, }, - range: [163, 177], + range: [159, 173], loc: { - start: { column: 4, line: 5 }, - end: { column: 18, line: 5 }, + start: { column: 2, line: 5 }, + end: { column: 16, line: 5 }, }, }, ], - range: [157, 179], + range: [155, 175], loc: { start: { column: 38, line: 4 }, end: { column: 1, line: 6 }, @@ -301,14 +301,14 @@ Program { name: "NamespacePropComponentProps", optional: false, - range: [129, 156], + range: [127, 154], loc: { start: { column: 10, line: 4 }, end: { column: 37, line: 4 }, }, }, - range: [119, 179], + range: [117, 175], loc: { start: { column: 0, line: 4 }, end: { column: 1, line: 6 }, @@ -336,36 +336,36 @@ Program { name: "props", optional: false, - range: [268, 273], + range: [262, 267], loc: { - start: { column: 17, line: 9 }, - end: { column: 22, line: 9 }, + start: { column: 15, line: 9 }, + end: { column: 20, line: 9 }, }, }, optional: false, property: Literal { type: "Literal", - raw: ""a:b"", + raw: "'a:b'", value: "a:b", - range: [274, 279], + range: [268, 273], loc: { - start: { column: 23, line: 9 }, - end: { column: 28, line: 9 }, + start: { column: 21, line: 9 }, + end: { column: 26, line: 9 }, }, }, - range: [268, 280], + range: [262, 274], loc: { - start: { column: 17, line: 9 }, - end: { column: 29, line: 9 }, + start: { column: 15, line: 9 }, + end: { column: 27, line: 9 }, }, }, - range: [267, 281], + range: [261, 275], loc: { - start: { column: 16, line: 9 }, - end: { column: 30, line: 9 }, + start: { column: 14, line: 9 }, + end: { column: 28, line: 9 }, }, }, ], @@ -375,17 +375,17 @@ Program { type: "JSXIdentifier", name: "div", - range: [283, 286], + range: [277, 280], loc: { - start: { column: 32, line: 9 }, - end: { column: 35, line: 9 }, + start: { column: 30, line: 9 }, + end: { column: 33, line: 9 }, }, }, - range: [281, 287], + range: [275, 281], loc: { - start: { column: 30, line: 9 }, - end: { column: 36, line: 9 }, + start: { column: 28, line: 9 }, + end: { column: 34, line: 9 }, }, }, openingElement: JSXOpeningElement { @@ -395,37 +395,37 @@ Program { type: "JSXIdentifier", name: "div", - range: [263, 266], + range: [257, 260], loc: { - start: { column: 12, line: 9 }, - end: { column: 15, line: 9 }, + start: { column: 10, line: 9 }, + end: { column: 13, line: 9 }, }, }, selfClosing: false, - range: [262, 267], + range: [256, 261], loc: { - start: { column: 11, line: 9 }, - end: { column: 16, line: 9 }, + start: { column: 9, line: 9 }, + end: { column: 14, line: 9 }, }, }, - range: [262, 287], + range: [256, 281], loc: { - start: { column: 11, line: 9 }, - end: { column: 36, line: 9 }, + start: { column: 9, line: 9 }, + end: { column: 34, line: 9 }, }, }, - range: [255, 288], + range: [249, 282], loc: { - start: { column: 4, line: 9 }, - end: { column: 37, line: 9 }, + start: { column: 2, line: 9 }, + end: { column: 35, line: 9 }, }, }, ], - range: [249, 290], + range: [245, 284], loc: { start: { column: 68, line: 8 }, end: { column: 1, line: 10 }, @@ -440,7 +440,7 @@ Program { name: "NamespacePropComponent", optional: false, - range: [190, 212], + range: [186, 208], loc: { start: { column: 9, line: 8 }, end: { column: 31, line: 8 }, @@ -462,28 +462,28 @@ Program { name: "NamespacePropComponentProps", optional: false, - range: [220, 247], + range: [216, 243], loc: { start: { column: 39, line: 8 }, end: { column: 66, line: 8 }, }, }, - range: [220, 247], + range: [216, 243], loc: { start: { column: 39, line: 8 }, end: { column: 66, line: 8 }, }, }, - range: [218, 247], + range: [214, 243], loc: { start: { column: 37, line: 8 }, end: { column: 66, line: 8 }, }, }, - range: [213, 247], + range: [209, 243], loc: { start: { column: 32, line: 8 }, end: { column: 66, line: 8 }, @@ -491,7 +491,7 @@ Program { }, ], - range: [181, 290], + range: [177, 284], loc: { start: { column: 0, line: 8 }, end: { column: 1, line: 10 }, @@ -500,7 +500,7 @@ Program { ], sourceType: "script", - range: [0, 291], + range: [0, 285], loc: { start: { column: 0, line: 1 }, end: { column: 0, line: 11 }, diff --git a/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component/snapshots/2-TSESTree-Tokens.shot index 9352a620aac9..5a14d5aafb4a 100644 --- a/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component/snapshots/2-TSESTree-Tokens.shot +++ b/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component/snapshots/2-TSESTree-Tokens.shot @@ -196,77 +196,77 @@ exports[`AST Fixtures jsx JSXNamespacedName component TSESTree - Tokens 1`] = ` type: "Punctuator", value: ":", - range: [94, 95], + range: [93, 94], loc: { - start: { column: 36, line: 2 }, - end: { column: 37, line: 2 }, + start: { column: 35, line: 2 }, + end: { column: 36, line: 2 }, }, }, Identifier { type: "Identifier", value: "b", - range: [96, 97], + range: [94, 95], loc: { - start: { column: 38, line: 2 }, - end: { column: 39, line: 2 }, + start: { column: 36, line: 2 }, + end: { column: 37, line: 2 }, }, }, Punctuator { type: "Punctuator", value: "=", - range: [97, 98], + range: [95, 96], loc: { - start: { column: 39, line: 2 }, - end: { column: 40, line: 2 }, + start: { column: 37, line: 2 }, + end: { column: 38, line: 2 }, }, }, JSXText { type: "JSXText", value: ""loose spacing"", - range: [98, 113], + range: [96, 111], loc: { - start: { column: 40, line: 2 }, - end: { column: 55, line: 2 }, + start: { column: 38, line: 2 }, + end: { column: 53, line: 2 }, }, }, Punctuator { type: "Punctuator", value: "/", - range: [114, 115], + range: [112, 113], loc: { - start: { column: 56, line: 2 }, - end: { column: 57, line: 2 }, + start: { column: 54, line: 2 }, + end: { column: 55, line: 2 }, }, }, Punctuator { type: "Punctuator", value: ">", - range: [115, 116], + range: [113, 114], loc: { - start: { column: 57, line: 2 }, - end: { column: 58, line: 2 }, + start: { column: 55, line: 2 }, + end: { column: 56, line: 2 }, }, }, Punctuator { type: "Punctuator", value: ";", - range: [116, 117], + range: [114, 115], loc: { - start: { column: 58, line: 2 }, - end: { column: 59, line: 2 }, + start: { column: 56, line: 2 }, + end: { column: 57, line: 2 }, }, }, Keyword { type: "Keyword", value: "interface", - range: [119, 128], + range: [117, 126], loc: { start: { column: 0, line: 4 }, end: { column: 9, line: 4 }, @@ -276,7 +276,7 @@ exports[`AST Fixtures jsx JSXNamespacedName component TSESTree - Tokens 1`] = ` type: "Identifier", value: "NamespacePropComponentProps", - range: [129, 156], + range: [127, 154], loc: { start: { column: 10, line: 4 }, end: { column: 37, line: 4 }, @@ -286,7 +286,7 @@ exports[`AST Fixtures jsx JSXNamespacedName component TSESTree - Tokens 1`] = ` type: "Punctuator", value: "{", - range: [157, 158], + range: [155, 156], loc: { start: { column: 38, line: 4 }, end: { column: 39, line: 4 }, @@ -294,49 +294,49 @@ exports[`AST Fixtures jsx JSXNamespacedName component TSESTree - Tokens 1`] = ` }, String { type: "String", - value: ""a:b"", + value: "'a:b'", - range: [163, 168], + range: [159, 164], loc: { - start: { column: 4, line: 5 }, - end: { column: 9, line: 5 }, + start: { column: 2, line: 5 }, + end: { column: 7, line: 5 }, }, }, Punctuator { type: "Punctuator", value: ":", - range: [168, 169], + range: [164, 165], loc: { - start: { column: 9, line: 5 }, - end: { column: 10, line: 5 }, + start: { column: 7, line: 5 }, + end: { column: 8, line: 5 }, }, }, Identifier { type: "Identifier", value: "string", - range: [170, 176], + range: [166, 172], loc: { - start: { column: 11, line: 5 }, - end: { column: 17, line: 5 }, + start: { column: 9, line: 5 }, + end: { column: 15, line: 5 }, }, }, Punctuator { type: "Punctuator", value: ";", - range: [176, 177], + range: [172, 173], loc: { - start: { column: 17, line: 5 }, - end: { column: 18, line: 5 }, + start: { column: 15, line: 5 }, + end: { column: 16, line: 5 }, }, }, Punctuator { type: "Punctuator", value: "}", - range: [178, 179], + range: [174, 175], loc: { start: { column: 0, line: 6 }, end: { column: 1, line: 6 }, @@ -346,7 +346,7 @@ exports[`AST Fixtures jsx JSXNamespacedName component TSESTree - Tokens 1`] = ` type: "Keyword", value: "function", - range: [181, 189], + range: [177, 185], loc: { start: { column: 0, line: 8 }, end: { column: 8, line: 8 }, @@ -356,7 +356,7 @@ exports[`AST Fixtures jsx JSXNamespacedName component TSESTree - Tokens 1`] = ` type: "Identifier", value: "NamespacePropComponent", - range: [190, 212], + range: [186, 208], loc: { start: { column: 9, line: 8 }, end: { column: 31, line: 8 }, @@ -366,7 +366,7 @@ exports[`AST Fixtures jsx JSXNamespacedName component TSESTree - Tokens 1`] = ` type: "Punctuator", value: "(", - range: [212, 213], + range: [208, 209], loc: { start: { column: 31, line: 8 }, end: { column: 32, line: 8 }, @@ -376,7 +376,7 @@ exports[`AST Fixtures jsx JSXNamespacedName component TSESTree - Tokens 1`] = ` type: "Identifier", value: "props", - range: [213, 218], + range: [209, 214], loc: { start: { column: 32, line: 8 }, end: { column: 37, line: 8 }, @@ -386,7 +386,7 @@ exports[`AST Fixtures jsx JSXNamespacedName component TSESTree - Tokens 1`] = ` type: "Punctuator", value: ":", - range: [218, 219], + range: [214, 215], loc: { start: { column: 37, line: 8 }, end: { column: 38, line: 8 }, @@ -396,7 +396,7 @@ exports[`AST Fixtures jsx JSXNamespacedName component TSESTree - Tokens 1`] = ` type: "Identifier", value: "NamespacePropComponentProps", - range: [220, 247], + range: [216, 243], loc: { start: { column: 39, line: 8 }, end: { column: 66, line: 8 }, @@ -406,7 +406,7 @@ exports[`AST Fixtures jsx JSXNamespacedName component TSESTree - Tokens 1`] = ` type: "Punctuator", value: ")", - range: [247, 248], + range: [243, 244], loc: { start: { column: 66, line: 8 }, end: { column: 67, line: 8 }, @@ -416,7 +416,7 @@ exports[`AST Fixtures jsx JSXNamespacedName component TSESTree - Tokens 1`] = ` type: "Punctuator", value: "{", - range: [249, 250], + range: [245, 246], loc: { start: { column: 68, line: 8 }, end: { column: 69, line: 8 }, @@ -426,157 +426,157 @@ exports[`AST Fixtures jsx JSXNamespacedName component TSESTree - Tokens 1`] = ` type: "Keyword", value: "return", - range: [255, 261], + range: [249, 255], loc: { - start: { column: 4, line: 9 }, - end: { column: 10, line: 9 }, + start: { column: 2, line: 9 }, + end: { column: 8, line: 9 }, }, }, Punctuator { type: "Punctuator", value: "<", - range: [262, 263], + range: [256, 257], loc: { - start: { column: 11, line: 9 }, - end: { column: 12, line: 9 }, + start: { column: 9, line: 9 }, + end: { column: 10, line: 9 }, }, }, JSXIdentifier { type: "JSXIdentifier", value: "div", - range: [263, 266], + range: [257, 260], loc: { - start: { column: 12, line: 9 }, - end: { column: 15, line: 9 }, + start: { column: 10, line: 9 }, + end: { column: 13, line: 9 }, }, }, Punctuator { type: "Punctuator", value: ">", - range: [266, 267], + range: [260, 261], loc: { - start: { column: 15, line: 9 }, - end: { column: 16, line: 9 }, + start: { column: 13, line: 9 }, + end: { column: 14, line: 9 }, }, }, Punctuator { type: "Punctuator", value: "{", - range: [267, 268], + range: [261, 262], loc: { - start: { column: 16, line: 9 }, - end: { column: 17, line: 9 }, + start: { column: 14, line: 9 }, + end: { column: 15, line: 9 }, }, }, Identifier { type: "Identifier", value: "props", - range: [268, 273], + range: [262, 267], loc: { - start: { column: 17, line: 9 }, - end: { column: 22, line: 9 }, + start: { column: 15, line: 9 }, + end: { column: 20, line: 9 }, }, }, Punctuator { type: "Punctuator", value: "[", - range: [273, 274], + range: [267, 268], loc: { - start: { column: 22, line: 9 }, - end: { column: 23, line: 9 }, + start: { column: 20, line: 9 }, + end: { column: 21, line: 9 }, }, }, String { type: "String", - value: ""a:b"", + value: "'a:b'", - range: [274, 279], + range: [268, 273], loc: { - start: { column: 23, line: 9 }, - end: { column: 28, line: 9 }, + start: { column: 21, line: 9 }, + end: { column: 26, line: 9 }, }, }, Punctuator { type: "Punctuator", value: "]", - range: [279, 280], + range: [273, 274], loc: { - start: { column: 28, line: 9 }, - end: { column: 29, line: 9 }, + start: { column: 26, line: 9 }, + end: { column: 27, line: 9 }, }, }, Punctuator { type: "Punctuator", value: "}", - range: [280, 281], + range: [274, 275], loc: { - start: { column: 29, line: 9 }, - end: { column: 30, line: 9 }, + start: { column: 27, line: 9 }, + end: { column: 28, line: 9 }, }, }, Punctuator { type: "Punctuator", value: "<", - range: [281, 282], + range: [275, 276], loc: { - start: { column: 30, line: 9 }, - end: { column: 31, line: 9 }, + start: { column: 28, line: 9 }, + end: { column: 29, line: 9 }, }, }, Punctuator { type: "Punctuator", value: "/", - range: [282, 283], + range: [276, 277], loc: { - start: { column: 31, line: 9 }, - end: { column: 32, line: 9 }, + start: { column: 29, line: 9 }, + end: { column: 30, line: 9 }, }, }, JSXIdentifier { type: "JSXIdentifier", value: "div", - range: [283, 286], + range: [277, 280], loc: { - start: { column: 32, line: 9 }, - end: { column: 35, line: 9 }, + start: { column: 30, line: 9 }, + end: { column: 33, line: 9 }, }, }, Punctuator { type: "Punctuator", value: ">", - range: [286, 287], + range: [280, 281], loc: { - start: { column: 35, line: 9 }, - end: { column: 36, line: 9 }, + start: { column: 33, line: 9 }, + end: { column: 34, line: 9 }, }, }, Punctuator { type: "Punctuator", value: ";", - range: [287, 288], + range: [281, 282], loc: { - start: { column: 36, line: 9 }, - end: { column: 37, line: 9 }, + start: { column: 34, line: 9 }, + end: { column: 35, line: 9 }, }, }, Punctuator { type: "Punctuator", value: "}", - range: [289, 290], + range: [283, 284], loc: { start: { column: 0, line: 10 }, end: { column: 1, line: 10 }, diff --git a/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component/snapshots/3-Babel-AST.shot index 7582f7301e58..973ac01c6c92 100644 --- a/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component/snapshots/3-Babel-AST.shot +++ b/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component/snapshots/3-Babel-AST.shot @@ -147,10 +147,10 @@ Program { type: "JSXIdentifier", name: "b", - range: [96, 97], + range: [94, 95], loc: { - start: { column: 38, line: 2 }, - end: { column: 39, line: 2 }, + start: { column: 36, line: 2 }, + end: { column: 37, line: 2 }, }, }, namespace: JSXIdentifier { @@ -164,10 +164,10 @@ Program { }, }, - range: [92, 97], + range: [92, 95], loc: { start: { column: 34, line: 2 }, - end: { column: 39, line: 2 }, + end: { column: 37, line: 2 }, }, }, value: Literal { @@ -175,17 +175,17 @@ Program { raw: ""loose spacing"", value: "loose spacing", - range: [98, 113], + range: [96, 111], loc: { - start: { column: 40, line: 2 }, - end: { column: 55, line: 2 }, + start: { column: 38, line: 2 }, + end: { column: 53, line: 2 }, }, }, - range: [92, 113], + range: [92, 111], loc: { start: { column: 34, line: 2 }, - end: { column: 55, line: 2 }, + end: { column: 53, line: 2 }, }, }, ], @@ -201,33 +201,33 @@ Program { }, selfClosing: true, - range: [68, 116], + range: [68, 114], loc: { start: { column: 10, line: 2 }, - end: { column: 58, line: 2 }, + end: { column: 56, line: 2 }, }, }, - range: [68, 116], + range: [68, 114], loc: { start: { column: 10, line: 2 }, - end: { column: 58, line: 2 }, + end: { column: 56, line: 2 }, }, }, - range: [64, 116], + range: [64, 114], loc: { start: { column: 6, line: 2 }, - end: { column: 58, line: 2 }, + end: { column: 56, line: 2 }, }, }, ], kind: "const", - range: [58, 117], + range: [58, 115], loc: { start: { column: 0, line: 2 }, - end: { column: 59, line: 2 }, + end: { column: 57, line: 2 }, }, }, TSInterfaceDeclaration { @@ -240,13 +240,13 @@ Program { computed: false, key: Literal { type: "Literal", - raw: ""a:b"", + raw: "'a:b'", value: "a:b", - range: [163, 168], + range: [159, 164], loc: { - start: { column: 4, line: 5 }, - end: { column: 9, line: 5 }, + start: { column: 2, line: 5 }, + end: { column: 7, line: 5 }, }, }, typeAnnotation: TSTypeAnnotation { @@ -254,29 +254,29 @@ Program { typeAnnotation: TSStringKeyword { type: "TSStringKeyword", - range: [170, 176], + range: [166, 172], loc: { - start: { column: 11, line: 5 }, - end: { column: 17, line: 5 }, + start: { column: 9, line: 5 }, + end: { column: 15, line: 5 }, }, }, - range: [168, 176], + range: [164, 172], loc: { - start: { column: 9, line: 5 }, - end: { column: 17, line: 5 }, + start: { column: 7, line: 5 }, + end: { column: 15, line: 5 }, }, }, - range: [163, 177], + range: [159, 173], loc: { - start: { column: 4, line: 5 }, - end: { column: 18, line: 5 }, + start: { column: 2, line: 5 }, + end: { column: 16, line: 5 }, }, }, ], - range: [157, 179], + range: [155, 175], loc: { start: { column: 38, line: 4 }, end: { column: 1, line: 6 }, @@ -286,14 +286,14 @@ Program { type: "Identifier", name: "NamespacePropComponentProps", - range: [129, 156], + range: [127, 154], loc: { start: { column: 10, line: 4 }, end: { column: 37, line: 4 }, }, }, - range: [119, 179], + range: [117, 175], loc: { start: { column: 0, line: 4 }, end: { column: 1, line: 6 }, @@ -319,36 +319,36 @@ Program { type: "Identifier", name: "props", - range: [268, 273], + range: [262, 267], loc: { - start: { column: 17, line: 9 }, - end: { column: 22, line: 9 }, + start: { column: 15, line: 9 }, + end: { column: 20, line: 9 }, }, }, optional: false, property: Literal { type: "Literal", - raw: ""a:b"", + raw: "'a:b'", value: "a:b", - range: [274, 279], + range: [268, 273], loc: { - start: { column: 23, line: 9 }, - end: { column: 28, line: 9 }, + start: { column: 21, line: 9 }, + end: { column: 26, line: 9 }, }, }, - range: [268, 280], + range: [262, 274], loc: { - start: { column: 17, line: 9 }, - end: { column: 29, line: 9 }, + start: { column: 15, line: 9 }, + end: { column: 27, line: 9 }, }, }, - range: [267, 281], + range: [261, 275], loc: { - start: { column: 16, line: 9 }, - end: { column: 30, line: 9 }, + start: { column: 14, line: 9 }, + end: { column: 28, line: 9 }, }, }, ], @@ -358,17 +358,17 @@ Program { type: "JSXIdentifier", name: "div", - range: [283, 286], + range: [277, 280], loc: { - start: { column: 32, line: 9 }, - end: { column: 35, line: 9 }, + start: { column: 30, line: 9 }, + end: { column: 33, line: 9 }, }, }, - range: [281, 287], + range: [275, 281], loc: { - start: { column: 30, line: 9 }, - end: { column: 36, line: 9 }, + start: { column: 28, line: 9 }, + end: { column: 34, line: 9 }, }, }, openingElement: JSXOpeningElement { @@ -378,37 +378,37 @@ Program { type: "JSXIdentifier", name: "div", - range: [263, 266], + range: [257, 260], loc: { - start: { column: 12, line: 9 }, - end: { column: 15, line: 9 }, + start: { column: 10, line: 9 }, + end: { column: 13, line: 9 }, }, }, selfClosing: false, - range: [262, 267], + range: [256, 261], loc: { - start: { column: 11, line: 9 }, - end: { column: 16, line: 9 }, + start: { column: 9, line: 9 }, + end: { column: 14, line: 9 }, }, }, - range: [262, 287], + range: [256, 281], loc: { - start: { column: 11, line: 9 }, - end: { column: 36, line: 9 }, + start: { column: 9, line: 9 }, + end: { column: 34, line: 9 }, }, }, - range: [255, 288], + range: [249, 282], loc: { - start: { column: 4, line: 9 }, - end: { column: 37, line: 9 }, + start: { column: 2, line: 9 }, + end: { column: 35, line: 9 }, }, }, ], - range: [249, 290], + range: [245, 284], loc: { start: { column: 68, line: 8 }, end: { column: 1, line: 10 }, @@ -420,7 +420,7 @@ Program { type: "Identifier", name: "NamespacePropComponent", - range: [190, 212], + range: [186, 208], loc: { start: { column: 9, line: 8 }, end: { column: 31, line: 8 }, @@ -438,28 +438,28 @@ Program { type: "Identifier", name: "NamespacePropComponentProps", - range: [220, 247], + range: [216, 243], loc: { start: { column: 39, line: 8 }, end: { column: 66, line: 8 }, }, }, - range: [220, 247], + range: [216, 243], loc: { start: { column: 39, line: 8 }, end: { column: 66, line: 8 }, }, }, - range: [218, 247], + range: [214, 243], loc: { start: { column: 37, line: 8 }, end: { column: 66, line: 8 }, }, }, - range: [213, 247], + range: [209, 243], loc: { start: { column: 32, line: 8 }, end: { column: 66, line: 8 }, @@ -467,7 +467,7 @@ Program { }, ], - range: [181, 290], + range: [177, 284], loc: { start: { column: 0, line: 8 }, end: { column: 1, line: 10 }, @@ -476,7 +476,7 @@ Program { ], sourceType: "script", - range: [0, 291], + range: [0, 285], loc: { start: { column: 0, line: 1 }, end: { column: 0, line: 11 }, diff --git a/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component/snapshots/4-Babel-Tokens.shot index afdd8792c205..e746539dc618 100644 --- a/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component/snapshots/4-Babel-Tokens.shot +++ b/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component/snapshots/4-Babel-Tokens.shot @@ -196,77 +196,77 @@ exports[`AST Fixtures jsx JSXNamespacedName component Babel - Tokens 1`] = ` type: "Punctuator", value: ":", - range: [94, 95], + range: [93, 94], loc: { - start: { column: 36, line: 2 }, - end: { column: 37, line: 2 }, + start: { column: 35, line: 2 }, + end: { column: 36, line: 2 }, }, }, JSXIdentifier { type: "JSXIdentifier", value: "b", - range: [96, 97], + range: [94, 95], loc: { - start: { column: 38, line: 2 }, - end: { column: 39, line: 2 }, + start: { column: 36, line: 2 }, + end: { column: 37, line: 2 }, }, }, Punctuator { type: "Punctuator", value: "=", - range: [97, 98], + range: [95, 96], loc: { - start: { column: 39, line: 2 }, - end: { column: 40, line: 2 }, + start: { column: 37, line: 2 }, + end: { column: 38, line: 2 }, }, }, String { type: "String", value: ""loose spacing"", - range: [98, 113], + range: [96, 111], loc: { - start: { column: 40, line: 2 }, - end: { column: 55, line: 2 }, + start: { column: 38, line: 2 }, + end: { column: 53, line: 2 }, }, }, Punctuator { type: "Punctuator", value: "/", - range: [114, 115], + range: [112, 113], loc: { - start: { column: 56, line: 2 }, - end: { column: 57, line: 2 }, + start: { column: 54, line: 2 }, + end: { column: 55, line: 2 }, }, }, Punctuator { type: "Punctuator", value: ">", - range: [115, 116], + range: [113, 114], loc: { - start: { column: 57, line: 2 }, - end: { column: 58, line: 2 }, + start: { column: 55, line: 2 }, + end: { column: 56, line: 2 }, }, }, Punctuator { type: "Punctuator", value: ";", - range: [116, 117], + range: [114, 115], loc: { - start: { column: 58, line: 2 }, - end: { column: 59, line: 2 }, + start: { column: 56, line: 2 }, + end: { column: 57, line: 2 }, }, }, Identifier { type: "Identifier", value: "interface", - range: [119, 128], + range: [117, 126], loc: { start: { column: 0, line: 4 }, end: { column: 9, line: 4 }, @@ -276,7 +276,7 @@ exports[`AST Fixtures jsx JSXNamespacedName component Babel - Tokens 1`] = ` type: "Identifier", value: "NamespacePropComponentProps", - range: [129, 156], + range: [127, 154], loc: { start: { column: 10, line: 4 }, end: { column: 37, line: 4 }, @@ -286,7 +286,7 @@ exports[`AST Fixtures jsx JSXNamespacedName component Babel - Tokens 1`] = ` type: "Punctuator", value: "{", - range: [157, 158], + range: [155, 156], loc: { start: { column: 38, line: 4 }, end: { column: 39, line: 4 }, @@ -294,49 +294,49 @@ exports[`AST Fixtures jsx JSXNamespacedName component Babel - Tokens 1`] = ` }, String { type: "String", - value: ""a:b"", + value: "'a:b'", - range: [163, 168], + range: [159, 164], loc: { - start: { column: 4, line: 5 }, - end: { column: 9, line: 5 }, + start: { column: 2, line: 5 }, + end: { column: 7, line: 5 }, }, }, Punctuator { type: "Punctuator", value: ":", - range: [168, 169], + range: [164, 165], loc: { - start: { column: 9, line: 5 }, - end: { column: 10, line: 5 }, + start: { column: 7, line: 5 }, + end: { column: 8, line: 5 }, }, }, Identifier { type: "Identifier", value: "string", - range: [170, 176], + range: [166, 172], loc: { - start: { column: 11, line: 5 }, - end: { column: 17, line: 5 }, + start: { column: 9, line: 5 }, + end: { column: 15, line: 5 }, }, }, Punctuator { type: "Punctuator", value: ";", - range: [176, 177], + range: [172, 173], loc: { - start: { column: 17, line: 5 }, - end: { column: 18, line: 5 }, + start: { column: 15, line: 5 }, + end: { column: 16, line: 5 }, }, }, Punctuator { type: "Punctuator", value: "}", - range: [178, 179], + range: [174, 175], loc: { start: { column: 0, line: 6 }, end: { column: 1, line: 6 }, @@ -346,7 +346,7 @@ exports[`AST Fixtures jsx JSXNamespacedName component Babel - Tokens 1`] = ` type: "Keyword", value: "function", - range: [181, 189], + range: [177, 185], loc: { start: { column: 0, line: 8 }, end: { column: 8, line: 8 }, @@ -356,7 +356,7 @@ exports[`AST Fixtures jsx JSXNamespacedName component Babel - Tokens 1`] = ` type: "Identifier", value: "NamespacePropComponent", - range: [190, 212], + range: [186, 208], loc: { start: { column: 9, line: 8 }, end: { column: 31, line: 8 }, @@ -366,7 +366,7 @@ exports[`AST Fixtures jsx JSXNamespacedName component Babel - Tokens 1`] = ` type: "Punctuator", value: "(", - range: [212, 213], + range: [208, 209], loc: { start: { column: 31, line: 8 }, end: { column: 32, line: 8 }, @@ -376,7 +376,7 @@ exports[`AST Fixtures jsx JSXNamespacedName component Babel - Tokens 1`] = ` type: "Identifier", value: "props", - range: [213, 218], + range: [209, 214], loc: { start: { column: 32, line: 8 }, end: { column: 37, line: 8 }, @@ -386,7 +386,7 @@ exports[`AST Fixtures jsx JSXNamespacedName component Babel - Tokens 1`] = ` type: "Punctuator", value: ":", - range: [218, 219], + range: [214, 215], loc: { start: { column: 37, line: 8 }, end: { column: 38, line: 8 }, @@ -396,7 +396,7 @@ exports[`AST Fixtures jsx JSXNamespacedName component Babel - Tokens 1`] = ` type: "Identifier", value: "NamespacePropComponentProps", - range: [220, 247], + range: [216, 243], loc: { start: { column: 39, line: 8 }, end: { column: 66, line: 8 }, @@ -406,7 +406,7 @@ exports[`AST Fixtures jsx JSXNamespacedName component Babel - Tokens 1`] = ` type: "Punctuator", value: ")", - range: [247, 248], + range: [243, 244], loc: { start: { column: 66, line: 8 }, end: { column: 67, line: 8 }, @@ -416,7 +416,7 @@ exports[`AST Fixtures jsx JSXNamespacedName component Babel - Tokens 1`] = ` type: "Punctuator", value: "{", - range: [249, 250], + range: [245, 246], loc: { start: { column: 68, line: 8 }, end: { column: 69, line: 8 }, @@ -426,157 +426,157 @@ exports[`AST Fixtures jsx JSXNamespacedName component Babel - Tokens 1`] = ` type: "Keyword", value: "return", - range: [255, 261], + range: [249, 255], loc: { - start: { column: 4, line: 9 }, - end: { column: 10, line: 9 }, + start: { column: 2, line: 9 }, + end: { column: 8, line: 9 }, }, }, Punctuator { type: "Punctuator", value: "<", - range: [262, 263], + range: [256, 257], loc: { - start: { column: 11, line: 9 }, - end: { column: 12, line: 9 }, + start: { column: 9, line: 9 }, + end: { column: 10, line: 9 }, }, }, JSXIdentifier { type: "JSXIdentifier", value: "div", - range: [263, 266], + range: [257, 260], loc: { - start: { column: 12, line: 9 }, - end: { column: 15, line: 9 }, + start: { column: 10, line: 9 }, + end: { column: 13, line: 9 }, }, }, Punctuator { type: "Punctuator", value: ">", - range: [266, 267], + range: [260, 261], loc: { - start: { column: 15, line: 9 }, - end: { column: 16, line: 9 }, + start: { column: 13, line: 9 }, + end: { column: 14, line: 9 }, }, }, Punctuator { type: "Punctuator", value: "{", - range: [267, 268], + range: [261, 262], loc: { - start: { column: 16, line: 9 }, - end: { column: 17, line: 9 }, + start: { column: 14, line: 9 }, + end: { column: 15, line: 9 }, }, }, Identifier { type: "Identifier", value: "props", - range: [268, 273], + range: [262, 267], loc: { - start: { column: 17, line: 9 }, - end: { column: 22, line: 9 }, + start: { column: 15, line: 9 }, + end: { column: 20, line: 9 }, }, }, Punctuator { type: "Punctuator", value: "[", - range: [273, 274], + range: [267, 268], loc: { - start: { column: 22, line: 9 }, - end: { column: 23, line: 9 }, + start: { column: 20, line: 9 }, + end: { column: 21, line: 9 }, }, }, String { type: "String", - value: ""a:b"", + value: "'a:b'", - range: [274, 279], + range: [268, 273], loc: { - start: { column: 23, line: 9 }, - end: { column: 28, line: 9 }, + start: { column: 21, line: 9 }, + end: { column: 26, line: 9 }, }, }, Punctuator { type: "Punctuator", value: "]", - range: [279, 280], + range: [273, 274], loc: { - start: { column: 28, line: 9 }, - end: { column: 29, line: 9 }, + start: { column: 26, line: 9 }, + end: { column: 27, line: 9 }, }, }, Punctuator { type: "Punctuator", value: "}", - range: [280, 281], + range: [274, 275], loc: { - start: { column: 29, line: 9 }, - end: { column: 30, line: 9 }, + start: { column: 27, line: 9 }, + end: { column: 28, line: 9 }, }, }, Punctuator { type: "Punctuator", value: "<", - range: [281, 282], + range: [275, 276], loc: { - start: { column: 30, line: 9 }, - end: { column: 31, line: 9 }, + start: { column: 28, line: 9 }, + end: { column: 29, line: 9 }, }, }, Punctuator { type: "Punctuator", value: "/", - range: [282, 283], + range: [276, 277], loc: { - start: { column: 31, line: 9 }, - end: { column: 32, line: 9 }, + start: { column: 29, line: 9 }, + end: { column: 30, line: 9 }, }, }, JSXIdentifier { type: "JSXIdentifier", value: "div", - range: [283, 286], + range: [277, 280], loc: { - start: { column: 32, line: 9 }, - end: { column: 35, line: 9 }, + start: { column: 30, line: 9 }, + end: { column: 33, line: 9 }, }, }, Punctuator { type: "Punctuator", value: ">", - range: [286, 287], + range: [280, 281], loc: { - start: { column: 35, line: 9 }, - end: { column: 36, line: 9 }, + start: { column: 33, line: 9 }, + end: { column: 34, line: 9 }, }, }, Punctuator { type: "Punctuator", value: ";", - range: [287, 288], + range: [281, 282], loc: { - start: { column: 36, line: 9 }, - end: { column: 37, line: 9 }, + start: { column: 34, line: 9 }, + end: { column: 35, line: 9 }, }, }, Punctuator { type: "Punctuator", value: "}", - range: [289, 290], + range: [283, 284], loc: { start: { column: 0, line: 10 }, end: { column: 1, line: 10 }, diff --git a/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component/snapshots/5-AST-Alignment-AST.shot index 45ffcb1a2319..4bfa82416b40 100644 --- a/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component/snapshots/5-AST-Alignment-AST.shot @@ -158,10 +158,10 @@ exports[`AST Fixtures jsx JSXNamespacedName component AST Alignment - AST 1`] = type: 'JSXIdentifier', name: 'b', - range: [96, 97], + range: [94, 95], loc: { - start: { column: 38, line: 2 }, - end: { column: 39, line: 2 }, + start: { column: 36, line: 2 }, + end: { column: 37, line: 2 }, }, }, namespace: JSXIdentifier { @@ -175,10 +175,10 @@ exports[`AST Fixtures jsx JSXNamespacedName component AST Alignment - AST 1`] = }, }, - range: [92, 97], + range: [92, 95], loc: { start: { column: 34, line: 2 }, - end: { column: 39, line: 2 }, + end: { column: 37, line: 2 }, }, }, value: Literal { @@ -186,17 +186,17 @@ exports[`AST Fixtures jsx JSXNamespacedName component AST Alignment - AST 1`] = raw: '"loose spacing"', value: 'loose spacing', - range: [98, 113], + range: [96, 111], loc: { - start: { column: 40, line: 2 }, - end: { column: 55, line: 2 }, + start: { column: 38, line: 2 }, + end: { column: 53, line: 2 }, }, }, - range: [92, 113], + range: [92, 111], loc: { start: { column: 34, line: 2 }, - end: { column: 55, line: 2 }, + end: { column: 53, line: 2 }, }, }, ], @@ -212,34 +212,34 @@ exports[`AST Fixtures jsx JSXNamespacedName component AST Alignment - AST 1`] = }, selfClosing: true, - range: [68, 116], + range: [68, 114], loc: { start: { column: 10, line: 2 }, - end: { column: 58, line: 2 }, + end: { column: 56, line: 2 }, }, }, - range: [68, 116], + range: [68, 114], loc: { start: { column: 10, line: 2 }, - end: { column: 58, line: 2 }, + end: { column: 56, line: 2 }, }, }, - range: [64, 116], + range: [64, 114], loc: { start: { column: 6, line: 2 }, - end: { column: 58, line: 2 }, + end: { column: 56, line: 2 }, }, }, ], - declare: false, kind: 'const', - range: [58, 117], + range: [58, 115], loc: { start: { column: 0, line: 2 }, - end: { column: 59, line: 2 }, + end: { column: 57, line: 2 }, }, }, TSInterfaceDeclaration { @@ -252,13 +252,13 @@ exports[`AST Fixtures jsx JSXNamespacedName component AST Alignment - AST 1`] = computed: false, key: Literal { type: 'Literal', - raw: '"a:b"', + raw: '\\'a:b\\'', value: 'a:b', - range: [163, 168], + range: [159, 164], loc: { - start: { column: 4, line: 5 }, - end: { column: 9, line: 5 }, + start: { column: 2, line: 5 }, + end: { column: 7, line: 5 }, }, }, - optional: false, @@ -269,29 +269,29 @@ exports[`AST Fixtures jsx JSXNamespacedName component AST Alignment - AST 1`] = typeAnnotation: TSStringKeyword { type: 'TSStringKeyword', - range: [170, 176], + range: [166, 172], loc: { - start: { column: 11, line: 5 }, - end: { column: 17, line: 5 }, + start: { column: 9, line: 5 }, + end: { column: 15, line: 5 }, }, }, - range: [168, 176], + range: [164, 172], loc: { - start: { column: 9, line: 5 }, - end: { column: 17, line: 5 }, + start: { column: 7, line: 5 }, + end: { column: 15, line: 5 }, }, }, - range: [163, 177], + range: [159, 173], loc: { - start: { column: 4, line: 5 }, - end: { column: 18, line: 5 }, + start: { column: 2, line: 5 }, + end: { column: 16, line: 5 }, }, }, ], - range: [157, 179], + range: [155, 175], loc: { start: { column: 38, line: 4 }, end: { column: 1, line: 6 }, @@ -305,14 +305,14 @@ exports[`AST Fixtures jsx JSXNamespacedName component AST Alignment - AST 1`] = name: 'NamespacePropComponentProps', - optional: false, - range: [129, 156], + range: [127, 154], loc: { start: { column: 10, line: 4 }, end: { column: 37, line: 4 }, }, }, - range: [119, 179], + range: [117, 175], loc: { start: { column: 0, line: 4 }, end: { column: 1, line: 6 }, @@ -340,36 +340,36 @@ exports[`AST Fixtures jsx JSXNamespacedName component AST Alignment - AST 1`] = name: 'props', - optional: false, - range: [268, 273], + range: [262, 267], loc: { - start: { column: 17, line: 9 }, - end: { column: 22, line: 9 }, + start: { column: 15, line: 9 }, + end: { column: 20, line: 9 }, }, }, optional: false, property: Literal { type: 'Literal', - raw: '"a:b"', + raw: '\\'a:b\\'', value: 'a:b', - range: [274, 279], + range: [268, 273], loc: { - start: { column: 23, line: 9 }, - end: { column: 28, line: 9 }, + start: { column: 21, line: 9 }, + end: { column: 26, line: 9 }, }, }, - range: [268, 280], + range: [262, 274], loc: { - start: { column: 17, line: 9 }, - end: { column: 29, line: 9 }, + start: { column: 15, line: 9 }, + end: { column: 27, line: 9 }, }, }, - range: [267, 281], + range: [261, 275], loc: { - start: { column: 16, line: 9 }, - end: { column: 30, line: 9 }, + start: { column: 14, line: 9 }, + end: { column: 28, line: 9 }, }, }, ], @@ -379,17 +379,17 @@ exports[`AST Fixtures jsx JSXNamespacedName component AST Alignment - AST 1`] = type: 'JSXIdentifier', name: 'div', - range: [283, 286], + range: [277, 280], loc: { - start: { column: 32, line: 9 }, - end: { column: 35, line: 9 }, + start: { column: 30, line: 9 }, + end: { column: 33, line: 9 }, }, }, - range: [281, 287], + range: [275, 281], loc: { - start: { column: 30, line: 9 }, - end: { column: 36, line: 9 }, + start: { column: 28, line: 9 }, + end: { column: 34, line: 9 }, }, }, openingElement: JSXOpeningElement { @@ -399,37 +399,37 @@ exports[`AST Fixtures jsx JSXNamespacedName component AST Alignment - AST 1`] = type: 'JSXIdentifier', name: 'div', - range: [263, 266], + range: [257, 260], loc: { - start: { column: 12, line: 9 }, - end: { column: 15, line: 9 }, + start: { column: 10, line: 9 }, + end: { column: 13, line: 9 }, }, }, selfClosing: false, - range: [262, 267], + range: [256, 261], loc: { - start: { column: 11, line: 9 }, - end: { column: 16, line: 9 }, + start: { column: 9, line: 9 }, + end: { column: 14, line: 9 }, }, }, - range: [262, 287], + range: [256, 281], loc: { - start: { column: 11, line: 9 }, - end: { column: 36, line: 9 }, + start: { column: 9, line: 9 }, + end: { column: 34, line: 9 }, }, }, - range: [255, 288], + range: [249, 282], loc: { - start: { column: 4, line: 9 }, - end: { column: 37, line: 9 }, + start: { column: 2, line: 9 }, + end: { column: 35, line: 9 }, }, }, ], - range: [249, 290], + range: [245, 284], loc: { start: { column: 68, line: 8 }, end: { column: 1, line: 10 }, @@ -444,7 +444,7 @@ exports[`AST Fixtures jsx JSXNamespacedName component AST Alignment - AST 1`] = name: 'NamespacePropComponent', - optional: false, - range: [190, 212], + range: [186, 208], loc: { start: { column: 9, line: 8 }, end: { column: 31, line: 8 }, @@ -466,28 +466,28 @@ exports[`AST Fixtures jsx JSXNamespacedName component AST Alignment - AST 1`] = name: 'NamespacePropComponentProps', - optional: false, - range: [220, 247], + range: [216, 243], loc: { start: { column: 39, line: 8 }, end: { column: 66, line: 8 }, }, }, - range: [220, 247], + range: [216, 243], loc: { start: { column: 39, line: 8 }, end: { column: 66, line: 8 }, }, }, - range: [218, 247], + range: [214, 243], loc: { start: { column: 37, line: 8 }, end: { column: 66, line: 8 }, }, }, - range: [213, 247], + range: [209, 243], loc: { start: { column: 32, line: 8 }, end: { column: 66, line: 8 }, @@ -495,7 +495,7 @@ exports[`AST Fixtures jsx JSXNamespacedName component AST Alignment - AST 1`] = }, ], - range: [181, 290], + range: [177, 284], loc: { start: { column: 0, line: 8 }, end: { column: 1, line: 10 }, @@ -504,7 +504,7 @@ exports[`AST Fixtures jsx JSXNamespacedName component AST Alignment - AST 1`] = ], sourceType: 'script', - range: [0, 291], + range: [0, 285], loc: { start: { column: 0, line: 1 }, end: { column: 0, line: 11 }, diff --git a/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component/snapshots/6-AST-Alignment-Tokens.shot index 2a72ccaf2fef..b77749bc53ad 100644 --- a/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component/snapshots/6-AST-Alignment-Tokens.shot +++ b/packages/ast-spec/src/jsx/JSXNamespacedName/fixtures/component/snapshots/6-AST-Alignment-Tokens.shot @@ -208,10 +208,10 @@ exports[`AST Fixtures jsx JSXNamespacedName component AST Alignment - Token 1`] type: 'Punctuator', value: ':', - range: [94, 95], + range: [93, 94], loc: { - start: { column: 36, line: 2 }, - end: { column: 37, line: 2 }, + start: { column: 35, line: 2 }, + end: { column: 36, line: 2 }, }, }, - Identifier { @@ -220,20 +220,20 @@ exports[`AST Fixtures jsx JSXNamespacedName component AST Alignment - Token 1`] + type: 'JSXIdentifier', value: 'b', - range: [96, 97], + range: [94, 95], loc: { - start: { column: 38, line: 2 }, - end: { column: 39, line: 2 }, + start: { column: 36, line: 2 }, + end: { column: 37, line: 2 }, }, }, Punctuator { type: 'Punctuator', value: '=', - range: [97, 98], + range: [95, 96], loc: { - start: { column: 39, line: 2 }, - end: { column: 40, line: 2 }, + start: { column: 37, line: 2 }, + end: { column: 38, line: 2 }, }, }, - JSXText { @@ -242,40 +242,40 @@ exports[`AST Fixtures jsx JSXNamespacedName component AST Alignment - Token 1`] + type: 'String', value: '"loose spacing"', - range: [98, 113], + range: [96, 111], loc: { - start: { column: 40, line: 2 }, - end: { column: 55, line: 2 }, + start: { column: 38, line: 2 }, + end: { column: 53, line: 2 }, }, }, Punctuator { type: 'Punctuator', value: '/', - range: [114, 115], + range: [112, 113], loc: { - start: { column: 56, line: 2 }, - end: { column: 57, line: 2 }, + start: { column: 54, line: 2 }, + end: { column: 55, line: 2 }, }, }, Punctuator { type: 'Punctuator', value: '>', - range: [115, 116], + range: [113, 114], loc: { - start: { column: 57, line: 2 }, - end: { column: 58, line: 2 }, + start: { column: 55, line: 2 }, + end: { column: 56, line: 2 }, }, }, Punctuator { type: 'Punctuator', value: ';', - range: [116, 117], + range: [114, 115], loc: { - start: { column: 58, line: 2 }, - end: { column: 59, line: 2 }, + start: { column: 56, line: 2 }, + end: { column: 57, line: 2 }, }, }, - Keyword { @@ -284,7 +284,7 @@ exports[`AST Fixtures jsx JSXNamespacedName component AST Alignment - Token 1`] + type: 'Identifier', value: 'interface', - range: [119, 128], + range: [117, 126], loc: { start: { column: 0, line: 4 }, end: { column: 9, line: 4 }, @@ -294,7 +294,7 @@ exports[`AST Fixtures jsx JSXNamespacedName component AST Alignment - Token 1`] type: 'Identifier', value: 'NamespacePropComponentProps', - range: [129, 156], + range: [127, 154], loc: { start: { column: 10, line: 4 }, end: { column: 37, line: 4 }, @@ -304,7 +304,7 @@ exports[`AST Fixtures jsx JSXNamespacedName component AST Alignment - Token 1`] type: 'Punctuator', value: '{', - range: [157, 158], + range: [155, 156], loc: { start: { column: 38, line: 4 }, end: { column: 39, line: 4 }, @@ -312,49 +312,49 @@ exports[`AST Fixtures jsx JSXNamespacedName component AST Alignment - Token 1`] }, String { type: 'String', - value: '"a:b"', + value: '\\'a:b\\'', - range: [163, 168], + range: [159, 164], loc: { - start: { column: 4, line: 5 }, - end: { column: 9, line: 5 }, + start: { column: 2, line: 5 }, + end: { column: 7, line: 5 }, }, }, Punctuator { type: 'Punctuator', value: ':', - range: [168, 169], + range: [164, 165], loc: { - start: { column: 9, line: 5 }, - end: { column: 10, line: 5 }, + start: { column: 7, line: 5 }, + end: { column: 8, line: 5 }, }, }, Identifier { type: 'Identifier', value: 'string', - range: [170, 176], + range: [166, 172], loc: { - start: { column: 11, line: 5 }, - end: { column: 17, line: 5 }, + start: { column: 9, line: 5 }, + end: { column: 15, line: 5 }, }, }, Punctuator { type: 'Punctuator', value: ';', - range: [176, 177], + range: [172, 173], loc: { - start: { column: 17, line: 5 }, - end: { column: 18, line: 5 }, + start: { column: 15, line: 5 }, + end: { column: 16, line: 5 }, }, }, Punctuator { type: 'Punctuator', value: '}', - range: [178, 179], + range: [174, 175], loc: { start: { column: 0, line: 6 }, end: { column: 1, line: 6 }, @@ -364,7 +364,7 @@ exports[`AST Fixtures jsx JSXNamespacedName component AST Alignment - Token 1`] type: 'Keyword', value: 'function', - range: [181, 189], + range: [177, 185], loc: { start: { column: 0, line: 8 }, end: { column: 8, line: 8 }, @@ -374,7 +374,7 @@ exports[`AST Fixtures jsx JSXNamespacedName component AST Alignment - Token 1`] type: 'Identifier', value: 'NamespacePropComponent', - range: [190, 212], + range: [186, 208], loc: { start: { column: 9, line: 8 }, end: { column: 31, line: 8 }, @@ -384,7 +384,7 @@ exports[`AST Fixtures jsx JSXNamespacedName component AST Alignment - Token 1`] type: 'Punctuator', value: '(', - range: [212, 213], + range: [208, 209], loc: { start: { column: 31, line: 8 }, end: { column: 32, line: 8 }, @@ -394,7 +394,7 @@ exports[`AST Fixtures jsx JSXNamespacedName component AST Alignment - Token 1`] type: 'Identifier', value: 'props', - range: [213, 218], + range: [209, 214], loc: { start: { column: 32, line: 8 }, end: { column: 37, line: 8 }, @@ -404,7 +404,7 @@ exports[`AST Fixtures jsx JSXNamespacedName component AST Alignment - Token 1`] type: 'Punctuator', value: ':', - range: [218, 219], + range: [214, 215], loc: { start: { column: 37, line: 8 }, end: { column: 38, line: 8 }, @@ -414,7 +414,7 @@ exports[`AST Fixtures jsx JSXNamespacedName component AST Alignment - Token 1`] type: 'Identifier', value: 'NamespacePropComponentProps', - range: [220, 247], + range: [216, 243], loc: { start: { column: 39, line: 8 }, end: { column: 66, line: 8 }, @@ -424,7 +424,7 @@ exports[`AST Fixtures jsx JSXNamespacedName component AST Alignment - Token 1`] type: 'Punctuator', value: ')', - range: [247, 248], + range: [243, 244], loc: { start: { column: 66, line: 8 }, end: { column: 67, line: 8 }, @@ -434,7 +434,7 @@ exports[`AST Fixtures jsx JSXNamespacedName component AST Alignment - Token 1`] type: 'Punctuator', value: '{', - range: [249, 250], + range: [245, 246], loc: { start: { column: 68, line: 8 }, end: { column: 69, line: 8 }, @@ -444,157 +444,157 @@ exports[`AST Fixtures jsx JSXNamespacedName component AST Alignment - Token 1`] type: 'Keyword', value: 'return', - range: [255, 261], + range: [249, 255], loc: { - start: { column: 4, line: 9 }, - end: { column: 10, line: 9 }, + start: { column: 2, line: 9 }, + end: { column: 8, line: 9 }, }, }, Punctuator { type: 'Punctuator', value: '<', - range: [262, 263], + range: [256, 257], loc: { - start: { column: 11, line: 9 }, - end: { column: 12, line: 9 }, + start: { column: 9, line: 9 }, + end: { column: 10, line: 9 }, }, }, JSXIdentifier { type: 'JSXIdentifier', value: 'div', - range: [263, 266], + range: [257, 260], loc: { - start: { column: 12, line: 9 }, - end: { column: 15, line: 9 }, + start: { column: 10, line: 9 }, + end: { column: 13, line: 9 }, }, }, Punctuator { type: 'Punctuator', value: '>', - range: [266, 267], + range: [260, 261], loc: { - start: { column: 15, line: 9 }, - end: { column: 16, line: 9 }, + start: { column: 13, line: 9 }, + end: { column: 14, line: 9 }, }, }, Punctuator { type: 'Punctuator', value: '{', - range: [267, 268], + range: [261, 262], loc: { - start: { column: 16, line: 9 }, - end: { column: 17, line: 9 }, + start: { column: 14, line: 9 }, + end: { column: 15, line: 9 }, }, }, Identifier { type: 'Identifier', value: 'props', - range: [268, 273], + range: [262, 267], loc: { - start: { column: 17, line: 9 }, - end: { column: 22, line: 9 }, + start: { column: 15, line: 9 }, + end: { column: 20, line: 9 }, }, }, Punctuator { type: 'Punctuator', value: '[', - range: [273, 274], + range: [267, 268], loc: { - start: { column: 22, line: 9 }, - end: { column: 23, line: 9 }, + start: { column: 20, line: 9 }, + end: { column: 21, line: 9 }, }, }, String { type: 'String', - value: '"a:b"', + value: '\\'a:b\\'', - range: [274, 279], + range: [268, 273], loc: { - start: { column: 23, line: 9 }, - end: { column: 28, line: 9 }, + start: { column: 21, line: 9 }, + end: { column: 26, line: 9 }, }, }, Punctuator { type: 'Punctuator', value: ']', - range: [279, 280], + range: [273, 274], loc: { - start: { column: 28, line: 9 }, - end: { column: 29, line: 9 }, + start: { column: 26, line: 9 }, + end: { column: 27, line: 9 }, }, }, Punctuator { type: 'Punctuator', value: '}', - range: [280, 281], + range: [274, 275], loc: { - start: { column: 29, line: 9 }, - end: { column: 30, line: 9 }, + start: { column: 27, line: 9 }, + end: { column: 28, line: 9 }, }, }, Punctuator { type: 'Punctuator', value: '<', - range: [281, 282], + range: [275, 276], loc: { - start: { column: 30, line: 9 }, - end: { column: 31, line: 9 }, + start: { column: 28, line: 9 }, + end: { column: 29, line: 9 }, }, }, Punctuator { type: 'Punctuator', value: '/', - range: [282, 283], + range: [276, 277], loc: { - start: { column: 31, line: 9 }, - end: { column: 32, line: 9 }, + start: { column: 29, line: 9 }, + end: { column: 30, line: 9 }, }, }, JSXIdentifier { type: 'JSXIdentifier', value: 'div', - range: [283, 286], + range: [277, 280], loc: { - start: { column: 32, line: 9 }, - end: { column: 35, line: 9 }, + start: { column: 30, line: 9 }, + end: { column: 33, line: 9 }, }, }, Punctuator { type: 'Punctuator', value: '>', - range: [286, 287], + range: [280, 281], loc: { - start: { column: 35, line: 9 }, - end: { column: 36, line: 9 }, + start: { column: 33, line: 9 }, + end: { column: 34, line: 9 }, }, }, Punctuator { type: 'Punctuator', value: ';', - range: [287, 288], + range: [281, 282], loc: { - start: { column: 36, line: 9 }, - end: { column: 37, line: 9 }, + start: { column: 34, line: 9 }, + end: { column: 35, line: 9 }, }, }, Punctuator { type: 'Punctuator', value: '}', - range: [289, 290], + range: [283, 284], loc: { start: { column: 0, line: 10 }, end: { column: 1, line: 10 }, diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-export-specifiers/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-export-specifiers/fixture.ts deleted file mode 100644 index 5e97bf7c7bb7..000000000000 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-export-specifiers/fixture.ts +++ /dev/null @@ -1,3 +0,0 @@ -// TODO: This fixture might be too large, and if so should be split up. - -export { type A, type B } from 'mod'; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-export-specifiers/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-export-specifiers/snapshots/2-TSESTree-Tokens.shot deleted file mode 100644 index abc413b3fe60..000000000000 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-export-specifiers/snapshots/2-TSESTree-Tokens.shot +++ /dev/null @@ -1,116 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`AST Fixtures legacy-fixtures basics type-only-export-specifiers TSESTree - Tokens 1`] = ` -[ - Keyword { - type: "Keyword", - value: "export", - - range: [73, 79], - loc: { - start: { column: 0, line: 3 }, - end: { column: 6, line: 3 }, - }, - }, - Punctuator { - type: "Punctuator", - value: "{", - - range: [80, 81], - loc: { - start: { column: 7, line: 3 }, - end: { column: 8, line: 3 }, - }, - }, - Identifier { - type: "Identifier", - value: "type", - - range: [82, 86], - loc: { - start: { column: 9, line: 3 }, - end: { column: 13, line: 3 }, - }, - }, - Identifier { - type: "Identifier", - value: "A", - - range: [87, 88], - loc: { - start: { column: 14, line: 3 }, - end: { column: 15, line: 3 }, - }, - }, - Punctuator { - type: "Punctuator", - value: ",", - - range: [88, 89], - loc: { - start: { column: 15, line: 3 }, - end: { column: 16, line: 3 }, - }, - }, - Identifier { - type: "Identifier", - value: "type", - - range: [90, 94], - loc: { - start: { column: 17, line: 3 }, - end: { column: 21, line: 3 }, - }, - }, - Identifier { - type: "Identifier", - value: "B", - - range: [95, 96], - loc: { - start: { column: 22, line: 3 }, - end: { column: 23, line: 3 }, - }, - }, - Punctuator { - type: "Punctuator", - value: "}", - - range: [97, 98], - loc: { - start: { column: 24, line: 3 }, - end: { column: 25, line: 3 }, - }, - }, - Identifier { - type: "Identifier", - value: "from", - - range: [99, 103], - loc: { - start: { column: 26, line: 3 }, - end: { column: 30, line: 3 }, - }, - }, - String { - type: "String", - value: "'mod'", - - range: [104, 109], - loc: { - start: { column: 31, line: 3 }, - end: { column: 36, line: 3 }, - }, - }, - Punctuator { - type: "Punctuator", - value: ";", - - range: [109, 110], - loc: { - start: { column: 36, line: 3 }, - end: { column: 37, line: 3 }, - }, - }, -] -`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-export-specifiers/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-export-specifiers/snapshots/4-Babel-Tokens.shot deleted file mode 100644 index 9e084aa3850f..000000000000 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-export-specifiers/snapshots/4-Babel-Tokens.shot +++ /dev/null @@ -1,116 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`AST Fixtures legacy-fixtures basics type-only-export-specifiers Babel - Tokens 1`] = ` -[ - Keyword { - type: "Keyword", - value: "export", - - range: [73, 79], - loc: { - start: { column: 0, line: 3 }, - end: { column: 6, line: 3 }, - }, - }, - Punctuator { - type: "Punctuator", - value: "{", - - range: [80, 81], - loc: { - start: { column: 7, line: 3 }, - end: { column: 8, line: 3 }, - }, - }, - Identifier { - type: "Identifier", - value: "type", - - range: [82, 86], - loc: { - start: { column: 9, line: 3 }, - end: { column: 13, line: 3 }, - }, - }, - Identifier { - type: "Identifier", - value: "A", - - range: [87, 88], - loc: { - start: { column: 14, line: 3 }, - end: { column: 15, line: 3 }, - }, - }, - Punctuator { - type: "Punctuator", - value: ",", - - range: [88, 89], - loc: { - start: { column: 15, line: 3 }, - end: { column: 16, line: 3 }, - }, - }, - Identifier { - type: "Identifier", - value: "type", - - range: [90, 94], - loc: { - start: { column: 17, line: 3 }, - end: { column: 21, line: 3 }, - }, - }, - Identifier { - type: "Identifier", - value: "B", - - range: [95, 96], - loc: { - start: { column: 22, line: 3 }, - end: { column: 23, line: 3 }, - }, - }, - Punctuator { - type: "Punctuator", - value: "}", - - range: [97, 98], - loc: { - start: { column: 24, line: 3 }, - end: { column: 25, line: 3 }, - }, - }, - Identifier { - type: "Identifier", - value: "from", - - range: [99, 103], - loc: { - start: { column: 26, line: 3 }, - end: { column: 30, line: 3 }, - }, - }, - String { - type: "String", - value: "'mod'", - - range: [104, 109], - loc: { - start: { column: 31, line: 3 }, - end: { column: 36, line: 3 }, - }, - }, - Punctuator { - type: "Punctuator", - value: ";", - - range: [109, 110], - loc: { - start: { column: 36, line: 3 }, - end: { column: 37, line: 3 }, - }, - }, -] -`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-import-specifiers/fixture.ts b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-import-specifiers/fixture.ts deleted file mode 100644 index d069f3df8745..000000000000 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-import-specifiers/fixture.ts +++ /dev/null @@ -1,3 +0,0 @@ -// TODO: This fixture might be too large, and if so should be split up. - -import { type A, type B } from 'mod'; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-import-specifiers/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-import-specifiers/snapshots/2-TSESTree-Tokens.shot deleted file mode 100644 index 8b95ed9fa420..000000000000 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-import-specifiers/snapshots/2-TSESTree-Tokens.shot +++ /dev/null @@ -1,116 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`AST Fixtures legacy-fixtures basics type-only-import-specifiers TSESTree - Tokens 1`] = ` -[ - Keyword { - type: "Keyword", - value: "import", - - range: [73, 79], - loc: { - start: { column: 0, line: 3 }, - end: { column: 6, line: 3 }, - }, - }, - Punctuator { - type: "Punctuator", - value: "{", - - range: [80, 81], - loc: { - start: { column: 7, line: 3 }, - end: { column: 8, line: 3 }, - }, - }, - Identifier { - type: "Identifier", - value: "type", - - range: [82, 86], - loc: { - start: { column: 9, line: 3 }, - end: { column: 13, line: 3 }, - }, - }, - Identifier { - type: "Identifier", - value: "A", - - range: [87, 88], - loc: { - start: { column: 14, line: 3 }, - end: { column: 15, line: 3 }, - }, - }, - Punctuator { - type: "Punctuator", - value: ",", - - range: [88, 89], - loc: { - start: { column: 15, line: 3 }, - end: { column: 16, line: 3 }, - }, - }, - Identifier { - type: "Identifier", - value: "type", - - range: [90, 94], - loc: { - start: { column: 17, line: 3 }, - end: { column: 21, line: 3 }, - }, - }, - Identifier { - type: "Identifier", - value: "B", - - range: [95, 96], - loc: { - start: { column: 22, line: 3 }, - end: { column: 23, line: 3 }, - }, - }, - Punctuator { - type: "Punctuator", - value: "}", - - range: [97, 98], - loc: { - start: { column: 24, line: 3 }, - end: { column: 25, line: 3 }, - }, - }, - Identifier { - type: "Identifier", - value: "from", - - range: [99, 103], - loc: { - start: { column: 26, line: 3 }, - end: { column: 30, line: 3 }, - }, - }, - String { - type: "String", - value: "'mod'", - - range: [104, 109], - loc: { - start: { column: 31, line: 3 }, - end: { column: 36, line: 3 }, - }, - }, - Punctuator { - type: "Punctuator", - value: ";", - - range: [109, 110], - loc: { - start: { column: 36, line: 3 }, - end: { column: 37, line: 3 }, - }, - }, -] -`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-import-specifiers/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-import-specifiers/snapshots/4-Babel-Tokens.shot deleted file mode 100644 index a461fc4b32a4..000000000000 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-import-specifiers/snapshots/4-Babel-Tokens.shot +++ /dev/null @@ -1,116 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`AST Fixtures legacy-fixtures basics type-only-import-specifiers Babel - Tokens 1`] = ` -[ - Keyword { - type: "Keyword", - value: "import", - - range: [73, 79], - loc: { - start: { column: 0, line: 3 }, - end: { column: 6, line: 3 }, - }, - }, - Punctuator { - type: "Punctuator", - value: "{", - - range: [80, 81], - loc: { - start: { column: 7, line: 3 }, - end: { column: 8, line: 3 }, - }, - }, - Identifier { - type: "Identifier", - value: "type", - - range: [82, 86], - loc: { - start: { column: 9, line: 3 }, - end: { column: 13, line: 3 }, - }, - }, - Identifier { - type: "Identifier", - value: "A", - - range: [87, 88], - loc: { - start: { column: 14, line: 3 }, - end: { column: 15, line: 3 }, - }, - }, - Punctuator { - type: "Punctuator", - value: ",", - - range: [88, 89], - loc: { - start: { column: 15, line: 3 }, - end: { column: 16, line: 3 }, - }, - }, - Identifier { - type: "Identifier", - value: "type", - - range: [90, 94], - loc: { - start: { column: 17, line: 3 }, - end: { column: 21, line: 3 }, - }, - }, - Identifier { - type: "Identifier", - value: "B", - - range: [95, 96], - loc: { - start: { column: 22, line: 3 }, - end: { column: 23, line: 3 }, - }, - }, - Punctuator { - type: "Punctuator", - value: "}", - - range: [97, 98], - loc: { - start: { column: 24, line: 3 }, - end: { column: 25, line: 3 }, - }, - }, - Identifier { - type: "Identifier", - value: "from", - - range: [99, 103], - loc: { - start: { column: 26, line: 3 }, - end: { column: 30, line: 3 }, - }, - }, - String { - type: "String", - value: "'mod'", - - range: [104, 109], - loc: { - start: { column: 31, line: 3 }, - end: { column: 36, line: 3 }, - }, - }, - Punctuator { - type: "Punctuator", - value: ";", - - range: [109, 110], - loc: { - start: { column: 36, line: 3 }, - end: { column: 37, line: 3 }, - }, - }, -] -`; diff --git a/packages/ast-spec/src/special/ExportSpecifier/fixtures/_error_/literal-specifier/fixture.ts b/packages/ast-spec/src/special/ExportSpecifier/fixtures/_error_/literal-specifier/fixture.ts new file mode 100644 index 000000000000..4e5fb7826321 --- /dev/null +++ b/packages/ast-spec/src/special/ExportSpecifier/fixtures/_error_/literal-specifier/fixture.ts @@ -0,0 +1 @@ +export { 'A' as A }; diff --git a/packages/ast-spec/src/special/ExportSpecifier/fixtures/_error_/literal-specifier/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/special/ExportSpecifier/fixtures/_error_/literal-specifier/snapshots/1-TSESTree-Error.shot new file mode 100644 index 000000000000..ee76a4ad0f5a --- /dev/null +++ b/packages/ast-spec/src/special/ExportSpecifier/fixtures/_error_/literal-specifier/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,8 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special ExportSpecifier _error_ literal-specifier TSESTree - Error 1`] = ` +"TSError +> 1 | export { 'A' as A }; + | ^^^ A string literal cannot be used as a local exported binding without \`from\`. + 2 |" +`; diff --git a/packages/ast-spec/src/special/ExportSpecifier/fixtures/_error_/literal-specifier/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/special/ExportSpecifier/fixtures/_error_/literal-specifier/snapshots/2-Babel-Error.shot new file mode 100644 index 000000000000..371eef93ebcd --- /dev/null +++ b/packages/ast-spec/src/special/ExportSpecifier/fixtures/_error_/literal-specifier/snapshots/2-Babel-Error.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special ExportSpecifier _error_ literal-specifier Babel - Error 1`] = ` +[SyntaxError: A string literal cannot be used as an exported binding without \`from\`. +- Did you mean \`export { 'A' as 'A' } from 'some-module'\`? (1:9)] +`; diff --git a/packages/ast-spec/src/special/ExportSpecifier/fixtures/_error_/literal-specifier/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/special/ExportSpecifier/fixtures/_error_/literal-specifier/snapshots/3-Alignment-Error.shot new file mode 100644 index 000000000000..1b30c3094d7c --- /dev/null +++ b/packages/ast-spec/src/special/ExportSpecifier/fixtures/_error_/literal-specifier/snapshots/3-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special ExportSpecifier _error_ literal-specifier Error Alignment 1`] = `"Both errored"`; diff --git a/packages/ast-spec/src/special/ExportSpecifier/fixtures/literal-specifier/fixture.ts b/packages/ast-spec/src/special/ExportSpecifier/fixtures/literal-specifier/fixture.ts new file mode 100644 index 000000000000..a45b013df7fa --- /dev/null +++ b/packages/ast-spec/src/special/ExportSpecifier/fixtures/literal-specifier/fixture.ts @@ -0,0 +1 @@ +export { A as 'A' } from 'mod'; diff --git a/packages/ast-spec/src/special/ExportSpecifier/fixtures/literal-specifier/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/special/ExportSpecifier/fixtures/literal-specifier/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..b69c0578632e --- /dev/null +++ b/packages/ast-spec/src/special/ExportSpecifier/fixtures/literal-specifier/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,74 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special ExportSpecifier literal-specifier TSESTree - AST 1`] = ` +Program { + type: "Program", + body: [ + ExportNamedDeclaration { + type: "ExportNamedDeclaration", + attributes: [], + declaration: null, + exportKind: "value", + source: Literal { + type: "Literal", + raw: "'mod'", + value: "mod", + + range: [25, 30], + loc: { + start: { column: 25, line: 1 }, + end: { column: 30, line: 1 }, + }, + }, + specifiers: [ + ExportSpecifier { + type: "ExportSpecifier", + exported: Literal { + type: "Literal", + raw: "'A'", + value: "A", + + range: [14, 17], + loc: { + start: { column: 14, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + exportKind: "value", + local: Identifier { + type: "Identifier", + decorators: [], + name: "A", + optional: false, + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + + range: [9, 17], + loc: { + start: { column: 9, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + ], + + range: [0, 31], + loc: { + start: { column: 0, line: 1 }, + end: { column: 31, line: 1 }, + }, + }, + ], + sourceType: "module", + + range: [0, 32], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/special/ExportSpecifier/fixtures/literal-specifier/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/special/ExportSpecifier/fixtures/literal-specifier/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..fb7598ea9115 --- /dev/null +++ b/packages/ast-spec/src/special/ExportSpecifier/fixtures/literal-specifier/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,96 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special ExportSpecifier literal-specifier TSESTree - Tokens 1`] = ` +[ + Keyword { + type: "Keyword", + value: "export", + + range: [0, 6], + loc: { + start: { column: 0, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [7, 8], + loc: { + start: { column: 7, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "A", + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "as", + + range: [11, 13], + loc: { + start: { column: 11, line: 1 }, + end: { column: 13, line: 1 }, + }, + }, + String { + type: "String", + value: "'A'", + + range: [14, 17], + loc: { + start: { column: 14, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [18, 19], + loc: { + start: { column: 18, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "from", + + range: [20, 24], + loc: { + start: { column: 20, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, + String { + type: "String", + value: "'mod'", + + range: [25, 30], + loc: { + start: { column: 25, line: 1 }, + end: { column: 30, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [30, 31], + loc: { + start: { column: 30, line: 1 }, + end: { column: 31, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/special/ExportSpecifier/fixtures/literal-specifier/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/special/ExportSpecifier/fixtures/literal-specifier/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..359714d4fdb0 --- /dev/null +++ b/packages/ast-spec/src/special/ExportSpecifier/fixtures/literal-specifier/snapshots/3-Babel-AST.shot @@ -0,0 +1,72 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special ExportSpecifier literal-specifier Babel - AST 1`] = ` +Program { + type: "Program", + body: [ + ExportNamedDeclaration { + type: "ExportNamedDeclaration", + assertions: [], + declaration: null, + exportKind: "value", + source: Literal { + type: "Literal", + raw: "'mod'", + value: "mod", + + range: [25, 30], + loc: { + start: { column: 25, line: 1 }, + end: { column: 30, line: 1 }, + }, + }, + specifiers: [ + ExportSpecifier { + type: "ExportSpecifier", + exported: Literal { + type: "Literal", + raw: "'A'", + value: "A", + + range: [14, 17], + loc: { + start: { column: 14, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + exportKind: "value", + local: Identifier { + type: "Identifier", + name: "A", + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + + range: [9, 17], + loc: { + start: { column: 9, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + ], + + range: [0, 31], + loc: { + start: { column: 0, line: 1 }, + end: { column: 31, line: 1 }, + }, + }, + ], + sourceType: "module", + + range: [0, 32], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/special/ExportSpecifier/fixtures/literal-specifier/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/special/ExportSpecifier/fixtures/literal-specifier/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..c266c934e8af --- /dev/null +++ b/packages/ast-spec/src/special/ExportSpecifier/fixtures/literal-specifier/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,96 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special ExportSpecifier literal-specifier Babel - Tokens 1`] = ` +[ + Keyword { + type: "Keyword", + value: "export", + + range: [0, 6], + loc: { + start: { column: 0, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [7, 8], + loc: { + start: { column: 7, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "A", + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "as", + + range: [11, 13], + loc: { + start: { column: 11, line: 1 }, + end: { column: 13, line: 1 }, + }, + }, + String { + type: "String", + value: "'A'", + + range: [14, 17], + loc: { + start: { column: 14, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [18, 19], + loc: { + start: { column: 18, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "from", + + range: [20, 24], + loc: { + start: { column: 20, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, + String { + type: "String", + value: "'mod'", + + range: [25, 30], + loc: { + start: { column: 25, line: 1 }, + end: { column: 30, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [30, 31], + loc: { + start: { column: 30, line: 1 }, + end: { column: 31, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/special/ExportSpecifier/fixtures/literal-specifier/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/special/ExportSpecifier/fixtures/literal-specifier/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..f904d790041a --- /dev/null +++ b/packages/ast-spec/src/special/ExportSpecifier/fixtures/literal-specifier/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,79 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special ExportSpecifier literal-specifier AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ExportNamedDeclaration { + type: 'ExportNamedDeclaration', +- attributes: Array [], ++ assertions: Array [], + declaration: null, + exportKind: 'value', + source: Literal { + type: 'Literal', + raw: '\\'mod\\'', + value: 'mod', + + range: [25, 30], + loc: { + start: { column: 25, line: 1 }, + end: { column: 30, line: 1 }, + }, + }, + specifiers: Array [ + ExportSpecifier { + type: 'ExportSpecifier', + exported: Literal { + type: 'Literal', + raw: '\\'A\\'', + value: 'A', + + range: [14, 17], + loc: { + start: { column: 14, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + exportKind: 'value', + local: Identifier { + type: 'Identifier', +- decorators: Array [], + name: 'A', +- optional: false, + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + + range: [9, 17], + loc: { + start: { column: 9, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + ], + + range: [0, 31], + loc: { + start: { column: 0, line: 1 }, + end: { column: 31, line: 1 }, + }, + }, + ], + sourceType: 'module', + + range: [0, 32], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, + }" +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/aliased/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/special/ExportSpecifier/fixtures/literal-specifier/snapshots/6-AST-Alignment-Tokens.shot similarity index 52% rename from packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/aliased/snapshots/6-AST-Alignment-Tokens.shot rename to packages/ast-spec/src/special/ExportSpecifier/fixtures/literal-specifier/snapshots/6-AST-Alignment-Tokens.shot index ce523723d51e..e722c5c9970c 100644 --- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/aliased/snapshots/6-AST-Alignment-Tokens.shot +++ b/packages/ast-spec/src/special/ExportSpecifier/fixtures/literal-specifier/snapshots/6-AST-Alignment-Tokens.shot @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration ExportNamedDeclaration aliased AST Alignment - Token 1`] = ` +exports[`AST Fixtures special ExportSpecifier literal-specifier AST Alignment - Token 1`] = ` "Snapshot Diff: Compared values have no visual difference." `; diff --git a/packages/ast-spec/src/special/ExportSpecifier/fixtures/type-only-export-specifiers/fixture.ts b/packages/ast-spec/src/special/ExportSpecifier/fixtures/type-only-export-specifiers/fixture.ts new file mode 100644 index 000000000000..38ebd81da095 --- /dev/null +++ b/packages/ast-spec/src/special/ExportSpecifier/fixtures/type-only-export-specifiers/fixture.ts @@ -0,0 +1 @@ +export { type A, type B } from 'mod'; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-export-specifiers/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/special/ExportSpecifier/fixtures/type-only-export-specifiers/snapshots/1-TSESTree-AST.shot similarity index 57% rename from packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-export-specifiers/snapshots/1-TSESTree-AST.shot rename to packages/ast-spec/src/special/ExportSpecifier/fixtures/type-only-export-specifiers/snapshots/1-TSESTree-AST.shot index efc42fbfc7c4..4c6072d77e0d 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-export-specifiers/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/special/ExportSpecifier/fixtures/type-only-export-specifiers/snapshots/1-TSESTree-AST.shot @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures legacy-fixtures basics type-only-export-specifiers TSESTree - AST 1`] = ` +exports[`AST Fixtures special ExportSpecifier type-only-export-specifiers TSESTree - AST 1`] = ` Program { type: "Program", body: [ @@ -14,10 +14,10 @@ Program { raw: "'mod'", value: "mod", - range: [104, 109], + range: [31, 36], loc: { - start: { column: 31, line: 3 }, - end: { column: 36, line: 3 }, + start: { column: 31, line: 1 }, + end: { column: 36, line: 1 }, }, }, specifiers: [ @@ -29,10 +29,10 @@ Program { name: "A", optional: false, - range: [87, 88], + range: [14, 15], loc: { - start: { column: 14, line: 3 }, - end: { column: 15, line: 3 }, + start: { column: 14, line: 1 }, + end: { column: 15, line: 1 }, }, }, exportKind: "type", @@ -42,17 +42,17 @@ Program { name: "A", optional: false, - range: [87, 88], + range: [14, 15], loc: { - start: { column: 14, line: 3 }, - end: { column: 15, line: 3 }, + start: { column: 14, line: 1 }, + end: { column: 15, line: 1 }, }, }, - range: [82, 88], + range: [9, 15], loc: { - start: { column: 9, line: 3 }, - end: { column: 15, line: 3 }, + start: { column: 9, line: 1 }, + end: { column: 15, line: 1 }, }, }, ExportSpecifier { @@ -63,10 +63,10 @@ Program { name: "B", optional: false, - range: [95, 96], + range: [22, 23], loc: { - start: { column: 22, line: 3 }, - end: { column: 23, line: 3 }, + start: { column: 22, line: 1 }, + end: { column: 23, line: 1 }, }, }, exportKind: "type", @@ -76,34 +76,34 @@ Program { name: "B", optional: false, - range: [95, 96], + range: [22, 23], loc: { - start: { column: 22, line: 3 }, - end: { column: 23, line: 3 }, + start: { column: 22, line: 1 }, + end: { column: 23, line: 1 }, }, }, - range: [90, 96], + range: [17, 23], loc: { - start: { column: 17, line: 3 }, - end: { column: 23, line: 3 }, + start: { column: 17, line: 1 }, + end: { column: 23, line: 1 }, }, }, ], - range: [73, 110], + range: [0, 37], loc: { - start: { column: 0, line: 3 }, - end: { column: 37, line: 3 }, + start: { column: 0, line: 1 }, + end: { column: 37, line: 1 }, }, }, ], sourceType: "module", - range: [73, 111], + range: [0, 38], loc: { - start: { column: 0, line: 3 }, - end: { column: 0, line: 4 }, + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, }, } `; diff --git a/packages/ast-spec/src/special/ExportSpecifier/fixtures/type-only-export-specifiers/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/special/ExportSpecifier/fixtures/type-only-export-specifiers/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..95164c4fdb1e --- /dev/null +++ b/packages/ast-spec/src/special/ExportSpecifier/fixtures/type-only-export-specifiers/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,116 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special ExportSpecifier type-only-export-specifiers TSESTree - Tokens 1`] = ` +[ + Keyword { + type: "Keyword", + value: "export", + + range: [0, 6], + loc: { + start: { column: 0, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [7, 8], + loc: { + start: { column: 7, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "type", + + range: [9, 13], + loc: { + start: { column: 9, line: 1 }, + end: { column: 13, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "A", + + range: [14, 15], + loc: { + start: { column: 14, line: 1 }, + end: { column: 15, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [15, 16], + loc: { + start: { column: 15, line: 1 }, + end: { column: 16, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "type", + + range: [17, 21], + loc: { + start: { column: 17, line: 1 }, + end: { column: 21, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "B", + + range: [22, 23], + loc: { + start: { column: 22, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [24, 25], + loc: { + start: { column: 24, line: 1 }, + end: { column: 25, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "from", + + range: [26, 30], + loc: { + start: { column: 26, line: 1 }, + end: { column: 30, line: 1 }, + }, + }, + String { + type: "String", + value: "'mod'", + + range: [31, 36], + loc: { + start: { column: 31, line: 1 }, + end: { column: 36, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [36, 37], + loc: { + start: { column: 36, line: 1 }, + end: { column: 37, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-export-specifiers/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/special/ExportSpecifier/fixtures/type-only-export-specifiers/snapshots/3-Babel-AST.shot similarity index 53% rename from packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-export-specifiers/snapshots/3-Babel-AST.shot rename to packages/ast-spec/src/special/ExportSpecifier/fixtures/type-only-export-specifiers/snapshots/3-Babel-AST.shot index 63fad08067d5..0fbd9915e81a 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-export-specifiers/snapshots/3-Babel-AST.shot +++ b/packages/ast-spec/src/special/ExportSpecifier/fixtures/type-only-export-specifiers/snapshots/3-Babel-AST.shot @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures legacy-fixtures basics type-only-export-specifiers Babel - AST 1`] = ` +exports[`AST Fixtures special ExportSpecifier type-only-export-specifiers Babel - AST 1`] = ` Program { type: "Program", body: [ @@ -14,10 +14,10 @@ Program { raw: "'mod'", value: "mod", - range: [104, 109], + range: [31, 36], loc: { - start: { column: 31, line: 3 }, - end: { column: 36, line: 3 }, + start: { column: 31, line: 1 }, + end: { column: 36, line: 1 }, }, }, specifiers: [ @@ -27,10 +27,10 @@ Program { type: "Identifier", name: "A", - range: [87, 88], + range: [14, 15], loc: { - start: { column: 14, line: 3 }, - end: { column: 15, line: 3 }, + start: { column: 14, line: 1 }, + end: { column: 15, line: 1 }, }, }, exportKind: "type", @@ -38,17 +38,17 @@ Program { type: "Identifier", name: "A", - range: [87, 88], + range: [14, 15], loc: { - start: { column: 14, line: 3 }, - end: { column: 15, line: 3 }, + start: { column: 14, line: 1 }, + end: { column: 15, line: 1 }, }, }, - range: [82, 88], + range: [9, 15], loc: { - start: { column: 9, line: 3 }, - end: { column: 15, line: 3 }, + start: { column: 9, line: 1 }, + end: { column: 15, line: 1 }, }, }, ExportSpecifier { @@ -57,10 +57,10 @@ Program { type: "Identifier", name: "B", - range: [95, 96], + range: [22, 23], loc: { - start: { column: 22, line: 3 }, - end: { column: 23, line: 3 }, + start: { column: 22, line: 1 }, + end: { column: 23, line: 1 }, }, }, exportKind: "type", @@ -68,34 +68,34 @@ Program { type: "Identifier", name: "B", - range: [95, 96], + range: [22, 23], loc: { - start: { column: 22, line: 3 }, - end: { column: 23, line: 3 }, + start: { column: 22, line: 1 }, + end: { column: 23, line: 1 }, }, }, - range: [90, 96], + range: [17, 23], loc: { - start: { column: 17, line: 3 }, - end: { column: 23, line: 3 }, + start: { column: 17, line: 1 }, + end: { column: 23, line: 1 }, }, }, ], - range: [73, 110], + range: [0, 37], loc: { - start: { column: 0, line: 3 }, - end: { column: 37, line: 3 }, + start: { column: 0, line: 1 }, + end: { column: 37, line: 1 }, }, }, ], sourceType: "module", - range: [73, 111], + range: [0, 38], loc: { - start: { column: 0, line: 3 }, - end: { column: 0, line: 4 }, + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, }, } `; diff --git a/packages/ast-spec/src/special/ExportSpecifier/fixtures/type-only-export-specifiers/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/special/ExportSpecifier/fixtures/type-only-export-specifiers/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..753a74b9f5d1 --- /dev/null +++ b/packages/ast-spec/src/special/ExportSpecifier/fixtures/type-only-export-specifiers/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,116 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special ExportSpecifier type-only-export-specifiers Babel - Tokens 1`] = ` +[ + Keyword { + type: "Keyword", + value: "export", + + range: [0, 6], + loc: { + start: { column: 0, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [7, 8], + loc: { + start: { column: 7, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "type", + + range: [9, 13], + loc: { + start: { column: 9, line: 1 }, + end: { column: 13, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "A", + + range: [14, 15], + loc: { + start: { column: 14, line: 1 }, + end: { column: 15, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [15, 16], + loc: { + start: { column: 15, line: 1 }, + end: { column: 16, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "type", + + range: [17, 21], + loc: { + start: { column: 17, line: 1 }, + end: { column: 21, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "B", + + range: [22, 23], + loc: { + start: { column: 22, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [24, 25], + loc: { + start: { column: 24, line: 1 }, + end: { column: 25, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "from", + + range: [26, 30], + loc: { + start: { column: 26, line: 1 }, + end: { column: 30, line: 1 }, + }, + }, + String { + type: "String", + value: "'mod'", + + range: [31, 36], + loc: { + start: { column: 31, line: 1 }, + end: { column: 36, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [36, 37], + loc: { + start: { column: 36, line: 1 }, + end: { column: 37, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-export-specifiers/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/special/ExportSpecifier/fixtures/type-only-export-specifiers/snapshots/5-AST-Alignment-AST.shot similarity index 60% rename from packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-export-specifiers/snapshots/5-AST-Alignment-AST.shot rename to packages/ast-spec/src/special/ExportSpecifier/fixtures/type-only-export-specifiers/snapshots/5-AST-Alignment-AST.shot index 189f9140bbb1..0f14a2e61779 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-export-specifiers/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/special/ExportSpecifier/fixtures/type-only-export-specifiers/snapshots/5-AST-Alignment-AST.shot @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures legacy-fixtures basics type-only-export-specifiers AST Alignment - AST 1`] = ` +exports[`AST Fixtures special ExportSpecifier type-only-export-specifiers AST Alignment - AST 1`] = ` "Snapshot Diff: - TSESTree + Babel @@ -19,10 +19,10 @@ exports[`AST Fixtures legacy-fixtures basics type-only-export-specifiers AST Ali raw: '\\'mod\\'', value: 'mod', - range: [104, 109], + range: [31, 36], loc: { - start: { column: 31, line: 3 }, - end: { column: 36, line: 3 }, + start: { column: 31, line: 1 }, + end: { column: 36, line: 1 }, }, }, specifiers: Array [ @@ -34,10 +34,10 @@ exports[`AST Fixtures legacy-fixtures basics type-only-export-specifiers AST Ali name: 'A', - optional: false, - range: [87, 88], + range: [14, 15], loc: { - start: { column: 14, line: 3 }, - end: { column: 15, line: 3 }, + start: { column: 14, line: 1 }, + end: { column: 15, line: 1 }, }, }, exportKind: 'type', @@ -47,17 +47,17 @@ exports[`AST Fixtures legacy-fixtures basics type-only-export-specifiers AST Ali name: 'A', - optional: false, - range: [87, 88], + range: [14, 15], loc: { - start: { column: 14, line: 3 }, - end: { column: 15, line: 3 }, + start: { column: 14, line: 1 }, + end: { column: 15, line: 1 }, }, }, - range: [82, 88], + range: [9, 15], loc: { - start: { column: 9, line: 3 }, - end: { column: 15, line: 3 }, + start: { column: 9, line: 1 }, + end: { column: 15, line: 1 }, }, }, ExportSpecifier { @@ -68,10 +68,10 @@ exports[`AST Fixtures legacy-fixtures basics type-only-export-specifiers AST Ali name: 'B', - optional: false, - range: [95, 96], + range: [22, 23], loc: { - start: { column: 22, line: 3 }, - end: { column: 23, line: 3 }, + start: { column: 22, line: 1 }, + end: { column: 23, line: 1 }, }, }, exportKind: 'type', @@ -81,34 +81,34 @@ exports[`AST Fixtures legacy-fixtures basics type-only-export-specifiers AST Ali name: 'B', - optional: false, - range: [95, 96], + range: [22, 23], loc: { - start: { column: 22, line: 3 }, - end: { column: 23, line: 3 }, + start: { column: 22, line: 1 }, + end: { column: 23, line: 1 }, }, }, - range: [90, 96], + range: [17, 23], loc: { - start: { column: 17, line: 3 }, - end: { column: 23, line: 3 }, + start: { column: 17, line: 1 }, + end: { column: 23, line: 1 }, }, }, ], - range: [73, 110], + range: [0, 37], loc: { - start: { column: 0, line: 3 }, - end: { column: 37, line: 3 }, + start: { column: 0, line: 1 }, + end: { column: 37, line: 1 }, }, }, ], sourceType: 'module', - range: [73, 111], + range: [0, 38], loc: { - start: { column: 0, line: 3 }, - end: { column: 0, line: 4 }, + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, }, }" `; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-export-specifiers/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/special/ExportSpecifier/fixtures/type-only-export-specifiers/snapshots/6-AST-Alignment-Tokens.shot similarity index 50% rename from packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-export-specifiers/snapshots/6-AST-Alignment-Tokens.shot rename to packages/ast-spec/src/special/ExportSpecifier/fixtures/type-only-export-specifiers/snapshots/6-AST-Alignment-Tokens.shot index 1db1ef638f8d..fd90fbaead1c 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-export-specifiers/snapshots/6-AST-Alignment-Tokens.shot +++ b/packages/ast-spec/src/special/ExportSpecifier/fixtures/type-only-export-specifiers/snapshots/6-AST-Alignment-Tokens.shot @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures legacy-fixtures basics type-only-export-specifiers AST Alignment - Token 1`] = ` +exports[`AST Fixtures special ExportSpecifier type-only-export-specifiers AST Alignment - Token 1`] = ` "Snapshot Diff: Compared values have no visual difference." `; diff --git a/packages/ast-spec/src/special/ExportSpecifier/fixtures/value-export-specifier/fixture.ts b/packages/ast-spec/src/special/ExportSpecifier/fixtures/value-export-specifier/fixture.ts new file mode 100644 index 000000000000..a45b013df7fa --- /dev/null +++ b/packages/ast-spec/src/special/ExportSpecifier/fixtures/value-export-specifier/fixture.ts @@ -0,0 +1 @@ +export { A as 'A' } from 'mod'; diff --git a/packages/ast-spec/src/special/ExportSpecifier/fixtures/value-export-specifier/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/special/ExportSpecifier/fixtures/value-export-specifier/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..a78bbd9c862e --- /dev/null +++ b/packages/ast-spec/src/special/ExportSpecifier/fixtures/value-export-specifier/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,74 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special ExportSpecifier value-export-specifier TSESTree - AST 1`] = ` +Program { + type: "Program", + body: [ + ExportNamedDeclaration { + type: "ExportNamedDeclaration", + attributes: [], + declaration: null, + exportKind: "value", + source: Literal { + type: "Literal", + raw: "'mod'", + value: "mod", + + range: [25, 30], + loc: { + start: { column: 25, line: 1 }, + end: { column: 30, line: 1 }, + }, + }, + specifiers: [ + ExportSpecifier { + type: "ExportSpecifier", + exported: Literal { + type: "Literal", + raw: "'A'", + value: "A", + + range: [14, 17], + loc: { + start: { column: 14, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + exportKind: "value", + local: Identifier { + type: "Identifier", + decorators: [], + name: "A", + optional: false, + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + + range: [9, 17], + loc: { + start: { column: 9, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + ], + + range: [0, 31], + loc: { + start: { column: 0, line: 1 }, + end: { column: 31, line: 1 }, + }, + }, + ], + sourceType: "module", + + range: [0, 32], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/special/ExportSpecifier/fixtures/value-export-specifier/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/special/ExportSpecifier/fixtures/value-export-specifier/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..8e76817d8de0 --- /dev/null +++ b/packages/ast-spec/src/special/ExportSpecifier/fixtures/value-export-specifier/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,96 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special ExportSpecifier value-export-specifier TSESTree - Tokens 1`] = ` +[ + Keyword { + type: "Keyword", + value: "export", + + range: [0, 6], + loc: { + start: { column: 0, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [7, 8], + loc: { + start: { column: 7, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "A", + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "as", + + range: [11, 13], + loc: { + start: { column: 11, line: 1 }, + end: { column: 13, line: 1 }, + }, + }, + String { + type: "String", + value: "'A'", + + range: [14, 17], + loc: { + start: { column: 14, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [18, 19], + loc: { + start: { column: 18, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "from", + + range: [20, 24], + loc: { + start: { column: 20, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, + String { + type: "String", + value: "'mod'", + + range: [25, 30], + loc: { + start: { column: 25, line: 1 }, + end: { column: 30, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [30, 31], + loc: { + start: { column: 30, line: 1 }, + end: { column: 31, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/special/ExportSpecifier/fixtures/value-export-specifier/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/special/ExportSpecifier/fixtures/value-export-specifier/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..fda29c2069d0 --- /dev/null +++ b/packages/ast-spec/src/special/ExportSpecifier/fixtures/value-export-specifier/snapshots/3-Babel-AST.shot @@ -0,0 +1,72 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special ExportSpecifier value-export-specifier Babel - AST 1`] = ` +Program { + type: "Program", + body: [ + ExportNamedDeclaration { + type: "ExportNamedDeclaration", + assertions: [], + declaration: null, + exportKind: "value", + source: Literal { + type: "Literal", + raw: "'mod'", + value: "mod", + + range: [25, 30], + loc: { + start: { column: 25, line: 1 }, + end: { column: 30, line: 1 }, + }, + }, + specifiers: [ + ExportSpecifier { + type: "ExportSpecifier", + exported: Literal { + type: "Literal", + raw: "'A'", + value: "A", + + range: [14, 17], + loc: { + start: { column: 14, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + exportKind: "value", + local: Identifier { + type: "Identifier", + name: "A", + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + + range: [9, 17], + loc: { + start: { column: 9, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + ], + + range: [0, 31], + loc: { + start: { column: 0, line: 1 }, + end: { column: 31, line: 1 }, + }, + }, + ], + sourceType: "module", + + range: [0, 32], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/special/ExportSpecifier/fixtures/value-export-specifier/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/special/ExportSpecifier/fixtures/value-export-specifier/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..93b98c503ed2 --- /dev/null +++ b/packages/ast-spec/src/special/ExportSpecifier/fixtures/value-export-specifier/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,96 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special ExportSpecifier value-export-specifier Babel - Tokens 1`] = ` +[ + Keyword { + type: "Keyword", + value: "export", + + range: [0, 6], + loc: { + start: { column: 0, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [7, 8], + loc: { + start: { column: 7, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "A", + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "as", + + range: [11, 13], + loc: { + start: { column: 11, line: 1 }, + end: { column: 13, line: 1 }, + }, + }, + String { + type: "String", + value: "'A'", + + range: [14, 17], + loc: { + start: { column: 14, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [18, 19], + loc: { + start: { column: 18, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "from", + + range: [20, 24], + loc: { + start: { column: 20, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, + String { + type: "String", + value: "'mod'", + + range: [25, 30], + loc: { + start: { column: 25, line: 1 }, + end: { column: 30, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [30, 31], + loc: { + start: { column: 30, line: 1 }, + end: { column: 31, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/special/ExportSpecifier/fixtures/value-export-specifier/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/special/ExportSpecifier/fixtures/value-export-specifier/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..df7bfcd78711 --- /dev/null +++ b/packages/ast-spec/src/special/ExportSpecifier/fixtures/value-export-specifier/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,79 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special ExportSpecifier value-export-specifier AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ExportNamedDeclaration { + type: 'ExportNamedDeclaration', +- attributes: Array [], ++ assertions: Array [], + declaration: null, + exportKind: 'value', + source: Literal { + type: 'Literal', + raw: '\\'mod\\'', + value: 'mod', + + range: [25, 30], + loc: { + start: { column: 25, line: 1 }, + end: { column: 30, line: 1 }, + }, + }, + specifiers: Array [ + ExportSpecifier { + type: 'ExportSpecifier', + exported: Literal { + type: 'Literal', + raw: '\\'A\\'', + value: 'A', + + range: [14, 17], + loc: { + start: { column: 14, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + exportKind: 'value', + local: Identifier { + type: 'Identifier', +- decorators: Array [], + name: 'A', +- optional: false, + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + + range: [9, 17], + loc: { + start: { column: 9, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + ], + + range: [0, 31], + loc: { + start: { column: 0, line: 1 }, + end: { column: 31, line: 1 }, + }, + }, + ], + sourceType: 'module', + + range: [0, 32], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, + }" +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-import-specifiers/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/special/ExportSpecifier/fixtures/value-export-specifier/snapshots/6-AST-Alignment-Tokens.shot similarity index 50% rename from packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-import-specifiers/snapshots/6-AST-Alignment-Tokens.shot rename to packages/ast-spec/src/special/ExportSpecifier/fixtures/value-export-specifier/snapshots/6-AST-Alignment-Tokens.shot index f5edce33d5b5..f5be7bfe4cb7 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-import-specifiers/snapshots/6-AST-Alignment-Tokens.shot +++ b/packages/ast-spec/src/special/ExportSpecifier/fixtures/value-export-specifier/snapshots/6-AST-Alignment-Tokens.shot @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures legacy-fixtures basics type-only-import-specifiers AST Alignment - Token 1`] = ` +exports[`AST Fixtures special ExportSpecifier value-export-specifier AST Alignment - Token 1`] = ` "Snapshot Diff: Compared values have no visual difference." `; diff --git a/packages/ast-spec/src/special/ExportSpecifier/spec.ts b/packages/ast-spec/src/special/ExportSpecifier/spec.ts index cac5c06c2e43..5d4d355fc2c3 100644 --- a/packages/ast-spec/src/special/ExportSpecifier/spec.ts +++ b/packages/ast-spec/src/special/ExportSpecifier/spec.ts @@ -2,10 +2,25 @@ import type { AST_NODE_TYPES } from '../../ast-node-types'; import type { BaseNode } from '../../base/BaseNode'; import type { ExportKind } from '../../declaration/ExportAndImportKind'; import type { Identifier } from '../../expression/Identifier/spec'; +import type { StringLiteral } from '../../expression/literal/StringLiteral/spec'; -export interface ExportSpecifier extends BaseNode { +interface ExportSpecifierBase extends BaseNode { type: AST_NODE_TYPES.ExportSpecifier; - exported: Identifier; + exported: Identifier | StringLiteral; exportKind: ExportKind; + local: Identifier | StringLiteral; +} + +export interface ExportSpecifierWithIdentifierLocal + extends ExportSpecifierBase { local: Identifier; } + +export interface ExportSpecifierWithStringOrLiteralLocal + extends ExportSpecifierBase { + local: Identifier | StringLiteral; +} + +export type ExportSpecifier = + | ExportSpecifierWithIdentifierLocal + | ExportSpecifierWithStringOrLiteralLocal; diff --git a/packages/ast-spec/src/special/ImportSpecifier/fixtures/type-only-import-specifier/fixture.ts b/packages/ast-spec/src/special/ImportSpecifier/fixtures/type-only-import-specifier/fixture.ts new file mode 100644 index 000000000000..3c8d04710e4f --- /dev/null +++ b/packages/ast-spec/src/special/ImportSpecifier/fixtures/type-only-import-specifier/fixture.ts @@ -0,0 +1 @@ +import { type A } from 'mod'; diff --git a/packages/ast-spec/src/special/ImportSpecifier/fixtures/type-only-import-specifier/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/special/ImportSpecifier/fixtures/type-only-import-specifier/snapshots/1-TSESTree-AST.shot new file mode 100644 index 000000000000..abee47b05717 --- /dev/null +++ b/packages/ast-spec/src/special/ImportSpecifier/fixtures/type-only-import-specifier/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,74 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special ImportSpecifier type-only-import-specifier TSESTree - AST 1`] = ` +Program { + type: "Program", + body: [ + ImportDeclaration { + type: "ImportDeclaration", + attributes: [], + importKind: "value", + source: Literal { + type: "Literal", + raw: "'mod'", + value: "mod", + + range: [23, 28], + loc: { + start: { column: 23, line: 1 }, + end: { column: 28, line: 1 }, + }, + }, + specifiers: [ + ImportSpecifier { + type: "ImportSpecifier", + imported: Identifier { + type: "Identifier", + decorators: [], + name: "A", + optional: false, + + range: [14, 15], + loc: { + start: { column: 14, line: 1 }, + end: { column: 15, line: 1 }, + }, + }, + importKind: "type", + local: Identifier { + type: "Identifier", + decorators: [], + name: "A", + optional: false, + + range: [14, 15], + loc: { + start: { column: 14, line: 1 }, + end: { column: 15, line: 1 }, + }, + }, + + range: [9, 15], + loc: { + start: { column: 9, line: 1 }, + end: { column: 15, line: 1 }, + }, + }, + ], + + range: [0, 29], + loc: { + start: { column: 0, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + ], + sourceType: "module", + + range: [0, 30], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/special/ImportSpecifier/fixtures/type-only-import-specifier/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/special/ImportSpecifier/fixtures/type-only-import-specifier/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..dff80ff21838 --- /dev/null +++ b/packages/ast-spec/src/special/ImportSpecifier/fixtures/type-only-import-specifier/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,86 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special ImportSpecifier type-only-import-specifier TSESTree - Tokens 1`] = ` +[ + Keyword { + type: "Keyword", + value: "import", + + range: [0, 6], + loc: { + start: { column: 0, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [7, 8], + loc: { + start: { column: 7, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "type", + + range: [9, 13], + loc: { + start: { column: 9, line: 1 }, + end: { column: 13, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "A", + + range: [14, 15], + loc: { + start: { column: 14, line: 1 }, + end: { column: 15, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [16, 17], + loc: { + start: { column: 16, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "from", + + range: [18, 22], + loc: { + start: { column: 18, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + String { + type: "String", + value: "'mod'", + + range: [23, 28], + loc: { + start: { column: 23, line: 1 }, + end: { column: 28, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [28, 29], + loc: { + start: { column: 28, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/special/ImportSpecifier/fixtures/type-only-import-specifier/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/special/ImportSpecifier/fixtures/type-only-import-specifier/snapshots/3-Babel-AST.shot new file mode 100644 index 000000000000..643571d60716 --- /dev/null +++ b/packages/ast-spec/src/special/ImportSpecifier/fixtures/type-only-import-specifier/snapshots/3-Babel-AST.shot @@ -0,0 +1,70 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special ImportSpecifier type-only-import-specifier Babel - AST 1`] = ` +Program { + type: "Program", + body: [ + ImportDeclaration { + type: "ImportDeclaration", + assertions: [], + importKind: "value", + source: Literal { + type: "Literal", + raw: "'mod'", + value: "mod", + + range: [23, 28], + loc: { + start: { column: 23, line: 1 }, + end: { column: 28, line: 1 }, + }, + }, + specifiers: [ + ImportSpecifier { + type: "ImportSpecifier", + imported: Identifier { + type: "Identifier", + name: "A", + + range: [14, 15], + loc: { + start: { column: 14, line: 1 }, + end: { column: 15, line: 1 }, + }, + }, + importKind: "type", + local: Identifier { + type: "Identifier", + name: "A", + + range: [14, 15], + loc: { + start: { column: 14, line: 1 }, + end: { column: 15, line: 1 }, + }, + }, + + range: [9, 15], + loc: { + start: { column: 9, line: 1 }, + end: { column: 15, line: 1 }, + }, + }, + ], + + range: [0, 29], + loc: { + start: { column: 0, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + ], + sourceType: "module", + + range: [0, 30], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/special/ImportSpecifier/fixtures/type-only-import-specifier/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/special/ImportSpecifier/fixtures/type-only-import-specifier/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..e265e9d9061b --- /dev/null +++ b/packages/ast-spec/src/special/ImportSpecifier/fixtures/type-only-import-specifier/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,86 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special ImportSpecifier type-only-import-specifier Babel - Tokens 1`] = ` +[ + Keyword { + type: "Keyword", + value: "import", + + range: [0, 6], + loc: { + start: { column: 0, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [7, 8], + loc: { + start: { column: 7, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "type", + + range: [9, 13], + loc: { + start: { column: 9, line: 1 }, + end: { column: 13, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "A", + + range: [14, 15], + loc: { + start: { column: 14, line: 1 }, + end: { column: 15, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [16, 17], + loc: { + start: { column: 16, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "from", + + range: [18, 22], + loc: { + start: { column: 18, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + String { + type: "String", + value: "'mod'", + + range: [23, 28], + loc: { + start: { column: 23, line: 1 }, + end: { column: 28, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [28, 29], + loc: { + start: { column: 28, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/special/ImportSpecifier/fixtures/type-only-import-specifier/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/special/ImportSpecifier/fixtures/type-only-import-specifier/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 000000000000..6fab4ad34bca --- /dev/null +++ b/packages/ast-spec/src/special/ImportSpecifier/fixtures/type-only-import-specifier/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,79 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special ImportSpecifier type-only-import-specifier AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ImportDeclaration { + type: 'ImportDeclaration', +- attributes: Array [], ++ assertions: Array [], + importKind: 'value', + source: Literal { + type: 'Literal', + raw: '\\'mod\\'', + value: 'mod', + + range: [23, 28], + loc: { + start: { column: 23, line: 1 }, + end: { column: 28, line: 1 }, + }, + }, + specifiers: Array [ + ImportSpecifier { + type: 'ImportSpecifier', + imported: Identifier { + type: 'Identifier', +- decorators: Array [], + name: 'A', +- optional: false, + + range: [14, 15], + loc: { + start: { column: 14, line: 1 }, + end: { column: 15, line: 1 }, + }, + }, + importKind: 'type', + local: Identifier { + type: 'Identifier', +- decorators: Array [], + name: 'A', +- optional: false, + + range: [14, 15], + loc: { + start: { column: 14, line: 1 }, + end: { column: 15, line: 1 }, + }, + }, + + range: [9, 15], + loc: { + start: { column: 9, line: 1 }, + end: { column: 15, line: 1 }, + }, + }, + ], + + range: [0, 29], + loc: { + start: { column: 0, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + ], + sourceType: 'module', + + range: [0, 30], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, + }" +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/identifier-many/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/special/ImportSpecifier/fixtures/type-only-import-specifier/snapshots/6-AST-Alignment-Tokens.shot similarity index 50% rename from packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/identifier-many/snapshots/6-AST-Alignment-Tokens.shot rename to packages/ast-spec/src/special/ImportSpecifier/fixtures/type-only-import-specifier/snapshots/6-AST-Alignment-Tokens.shot index 939b36fc37cd..d24c34c94c95 100644 --- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/identifier-many/snapshots/6-AST-Alignment-Tokens.shot +++ b/packages/ast-spec/src/special/ImportSpecifier/fixtures/type-only-import-specifier/snapshots/6-AST-Alignment-Tokens.shot @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration ExportNamedDeclaration identifier-many AST Alignment - Token 1`] = ` +exports[`AST Fixtures special ImportSpecifier type-only-import-specifier AST Alignment - Token 1`] = ` "Snapshot Diff: Compared values have no visual difference." `; diff --git a/packages/ast-spec/src/special/ImportSpecifier/fixtures/type-only-import-specifiers/fixture.ts b/packages/ast-spec/src/special/ImportSpecifier/fixtures/type-only-import-specifiers/fixture.ts new file mode 100644 index 000000000000..26dcb4c1dc16 --- /dev/null +++ b/packages/ast-spec/src/special/ImportSpecifier/fixtures/type-only-import-specifiers/fixture.ts @@ -0,0 +1 @@ +import { type A, type B } from 'mod'; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-import-specifiers/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/special/ImportSpecifier/fixtures/type-only-import-specifiers/snapshots/1-TSESTree-AST.shot similarity index 57% rename from packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-import-specifiers/snapshots/1-TSESTree-AST.shot rename to packages/ast-spec/src/special/ImportSpecifier/fixtures/type-only-import-specifiers/snapshots/1-TSESTree-AST.shot index 82aea11224da..ee1f5a5aacad 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-import-specifiers/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/special/ImportSpecifier/fixtures/type-only-import-specifiers/snapshots/1-TSESTree-AST.shot @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures legacy-fixtures basics type-only-import-specifiers TSESTree - AST 1`] = ` +exports[`AST Fixtures special ImportSpecifier type-only-import-specifiers TSESTree - AST 1`] = ` Program { type: "Program", body: [ @@ -13,10 +13,10 @@ Program { raw: "'mod'", value: "mod", - range: [104, 109], + range: [31, 36], loc: { - start: { column: 31, line: 3 }, - end: { column: 36, line: 3 }, + start: { column: 31, line: 1 }, + end: { column: 36, line: 1 }, }, }, specifiers: [ @@ -28,10 +28,10 @@ Program { name: "A", optional: false, - range: [87, 88], + range: [14, 15], loc: { - start: { column: 14, line: 3 }, - end: { column: 15, line: 3 }, + start: { column: 14, line: 1 }, + end: { column: 15, line: 1 }, }, }, importKind: "type", @@ -41,17 +41,17 @@ Program { name: "A", optional: false, - range: [87, 88], + range: [14, 15], loc: { - start: { column: 14, line: 3 }, - end: { column: 15, line: 3 }, + start: { column: 14, line: 1 }, + end: { column: 15, line: 1 }, }, }, - range: [82, 88], + range: [9, 15], loc: { - start: { column: 9, line: 3 }, - end: { column: 15, line: 3 }, + start: { column: 9, line: 1 }, + end: { column: 15, line: 1 }, }, }, ImportSpecifier { @@ -62,10 +62,10 @@ Program { name: "B", optional: false, - range: [95, 96], + range: [22, 23], loc: { - start: { column: 22, line: 3 }, - end: { column: 23, line: 3 }, + start: { column: 22, line: 1 }, + end: { column: 23, line: 1 }, }, }, importKind: "type", @@ -75,34 +75,34 @@ Program { name: "B", optional: false, - range: [95, 96], + range: [22, 23], loc: { - start: { column: 22, line: 3 }, - end: { column: 23, line: 3 }, + start: { column: 22, line: 1 }, + end: { column: 23, line: 1 }, }, }, - range: [90, 96], + range: [17, 23], loc: { - start: { column: 17, line: 3 }, - end: { column: 23, line: 3 }, + start: { column: 17, line: 1 }, + end: { column: 23, line: 1 }, }, }, ], - range: [73, 110], + range: [0, 37], loc: { - start: { column: 0, line: 3 }, - end: { column: 37, line: 3 }, + start: { column: 0, line: 1 }, + end: { column: 37, line: 1 }, }, }, ], sourceType: "module", - range: [73, 111], + range: [0, 38], loc: { - start: { column: 0, line: 3 }, - end: { column: 0, line: 4 }, + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, }, } `; diff --git a/packages/ast-spec/src/special/ImportSpecifier/fixtures/type-only-import-specifiers/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/special/ImportSpecifier/fixtures/type-only-import-specifiers/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 000000000000..75ea97061ea2 --- /dev/null +++ b/packages/ast-spec/src/special/ImportSpecifier/fixtures/type-only-import-specifiers/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,116 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special ImportSpecifier type-only-import-specifiers TSESTree - Tokens 1`] = ` +[ + Keyword { + type: "Keyword", + value: "import", + + range: [0, 6], + loc: { + start: { column: 0, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [7, 8], + loc: { + start: { column: 7, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "type", + + range: [9, 13], + loc: { + start: { column: 9, line: 1 }, + end: { column: 13, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "A", + + range: [14, 15], + loc: { + start: { column: 14, line: 1 }, + end: { column: 15, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [15, 16], + loc: { + start: { column: 15, line: 1 }, + end: { column: 16, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "type", + + range: [17, 21], + loc: { + start: { column: 17, line: 1 }, + end: { column: 21, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "B", + + range: [22, 23], + loc: { + start: { column: 22, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [24, 25], + loc: { + start: { column: 24, line: 1 }, + end: { column: 25, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "from", + + range: [26, 30], + loc: { + start: { column: 26, line: 1 }, + end: { column: 30, line: 1 }, + }, + }, + String { + type: "String", + value: "'mod'", + + range: [31, 36], + loc: { + start: { column: 31, line: 1 }, + end: { column: 36, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [36, 37], + loc: { + start: { column: 36, line: 1 }, + end: { column: 37, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-import-specifiers/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/special/ImportSpecifier/fixtures/type-only-import-specifiers/snapshots/3-Babel-AST.shot similarity index 52% rename from packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-import-specifiers/snapshots/3-Babel-AST.shot rename to packages/ast-spec/src/special/ImportSpecifier/fixtures/type-only-import-specifiers/snapshots/3-Babel-AST.shot index 4cd73830077e..9d2ded63258e 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-import-specifiers/snapshots/3-Babel-AST.shot +++ b/packages/ast-spec/src/special/ImportSpecifier/fixtures/type-only-import-specifiers/snapshots/3-Babel-AST.shot @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures legacy-fixtures basics type-only-import-specifiers Babel - AST 1`] = ` +exports[`AST Fixtures special ImportSpecifier type-only-import-specifiers Babel - AST 1`] = ` Program { type: "Program", body: [ @@ -13,10 +13,10 @@ Program { raw: "'mod'", value: "mod", - range: [104, 109], + range: [31, 36], loc: { - start: { column: 31, line: 3 }, - end: { column: 36, line: 3 }, + start: { column: 31, line: 1 }, + end: { column: 36, line: 1 }, }, }, specifiers: [ @@ -26,10 +26,10 @@ Program { type: "Identifier", name: "A", - range: [87, 88], + range: [14, 15], loc: { - start: { column: 14, line: 3 }, - end: { column: 15, line: 3 }, + start: { column: 14, line: 1 }, + end: { column: 15, line: 1 }, }, }, importKind: "type", @@ -37,17 +37,17 @@ Program { type: "Identifier", name: "A", - range: [87, 88], + range: [14, 15], loc: { - start: { column: 14, line: 3 }, - end: { column: 15, line: 3 }, + start: { column: 14, line: 1 }, + end: { column: 15, line: 1 }, }, }, - range: [82, 88], + range: [9, 15], loc: { - start: { column: 9, line: 3 }, - end: { column: 15, line: 3 }, + start: { column: 9, line: 1 }, + end: { column: 15, line: 1 }, }, }, ImportSpecifier { @@ -56,10 +56,10 @@ Program { type: "Identifier", name: "B", - range: [95, 96], + range: [22, 23], loc: { - start: { column: 22, line: 3 }, - end: { column: 23, line: 3 }, + start: { column: 22, line: 1 }, + end: { column: 23, line: 1 }, }, }, importKind: "type", @@ -67,34 +67,34 @@ Program { type: "Identifier", name: "B", - range: [95, 96], + range: [22, 23], loc: { - start: { column: 22, line: 3 }, - end: { column: 23, line: 3 }, + start: { column: 22, line: 1 }, + end: { column: 23, line: 1 }, }, }, - range: [90, 96], + range: [17, 23], loc: { - start: { column: 17, line: 3 }, - end: { column: 23, line: 3 }, + start: { column: 17, line: 1 }, + end: { column: 23, line: 1 }, }, }, ], - range: [73, 110], + range: [0, 37], loc: { - start: { column: 0, line: 3 }, - end: { column: 37, line: 3 }, + start: { column: 0, line: 1 }, + end: { column: 37, line: 1 }, }, }, ], sourceType: "module", - range: [73, 111], + range: [0, 38], loc: { - start: { column: 0, line: 3 }, - end: { column: 0, line: 4 }, + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, }, } `; diff --git a/packages/ast-spec/src/special/ImportSpecifier/fixtures/type-only-import-specifiers/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/special/ImportSpecifier/fixtures/type-only-import-specifiers/snapshots/4-Babel-Tokens.shot new file mode 100644 index 000000000000..0e26034ffd30 --- /dev/null +++ b/packages/ast-spec/src/special/ImportSpecifier/fixtures/type-only-import-specifiers/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,116 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special ImportSpecifier type-only-import-specifiers Babel - Tokens 1`] = ` +[ + Keyword { + type: "Keyword", + value: "import", + + range: [0, 6], + loc: { + start: { column: 0, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [7, 8], + loc: { + start: { column: 7, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "type", + + range: [9, 13], + loc: { + start: { column: 9, line: 1 }, + end: { column: 13, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "A", + + range: [14, 15], + loc: { + start: { column: 14, line: 1 }, + end: { column: 15, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [15, 16], + loc: { + start: { column: 15, line: 1 }, + end: { column: 16, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "type", + + range: [17, 21], + loc: { + start: { column: 17, line: 1 }, + end: { column: 21, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "B", + + range: [22, 23], + loc: { + start: { column: 22, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [24, 25], + loc: { + start: { column: 24, line: 1 }, + end: { column: 25, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "from", + + range: [26, 30], + loc: { + start: { column: 26, line: 1 }, + end: { column: 30, line: 1 }, + }, + }, + String { + type: "String", + value: "'mod'", + + range: [31, 36], + loc: { + start: { column: 31, line: 1 }, + end: { column: 36, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [36, 37], + loc: { + start: { column: 36, line: 1 }, + end: { column: 37, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-import-specifiers/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/special/ImportSpecifier/fixtures/type-only-import-specifiers/snapshots/5-AST-Alignment-AST.shot similarity index 59% rename from packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-import-specifiers/snapshots/5-AST-Alignment-AST.shot rename to packages/ast-spec/src/special/ImportSpecifier/fixtures/type-only-import-specifiers/snapshots/5-AST-Alignment-AST.shot index 48020406f92a..e2b01ef26491 100644 --- a/packages/ast-spec/src/legacy-fixtures/basics/fixtures/type-only-import-specifiers/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/special/ImportSpecifier/fixtures/type-only-import-specifiers/snapshots/5-AST-Alignment-AST.shot @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures legacy-fixtures basics type-only-import-specifiers AST Alignment - AST 1`] = ` +exports[`AST Fixtures special ImportSpecifier type-only-import-specifiers AST Alignment - AST 1`] = ` "Snapshot Diff: - TSESTree + Babel @@ -18,10 +18,10 @@ exports[`AST Fixtures legacy-fixtures basics type-only-import-specifiers AST Ali raw: '\\'mod\\'', value: 'mod', - range: [104, 109], + range: [31, 36], loc: { - start: { column: 31, line: 3 }, - end: { column: 36, line: 3 }, + start: { column: 31, line: 1 }, + end: { column: 36, line: 1 }, }, }, specifiers: Array [ @@ -33,10 +33,10 @@ exports[`AST Fixtures legacy-fixtures basics type-only-import-specifiers AST Ali name: 'A', - optional: false, - range: [87, 88], + range: [14, 15], loc: { - start: { column: 14, line: 3 }, - end: { column: 15, line: 3 }, + start: { column: 14, line: 1 }, + end: { column: 15, line: 1 }, }, }, importKind: 'type', @@ -46,17 +46,17 @@ exports[`AST Fixtures legacy-fixtures basics type-only-import-specifiers AST Ali name: 'A', - optional: false, - range: [87, 88], + range: [14, 15], loc: { - start: { column: 14, line: 3 }, - end: { column: 15, line: 3 }, + start: { column: 14, line: 1 }, + end: { column: 15, line: 1 }, }, }, - range: [82, 88], + range: [9, 15], loc: { - start: { column: 9, line: 3 }, - end: { column: 15, line: 3 }, + start: { column: 9, line: 1 }, + end: { column: 15, line: 1 }, }, }, ImportSpecifier { @@ -67,10 +67,10 @@ exports[`AST Fixtures legacy-fixtures basics type-only-import-specifiers AST Ali name: 'B', - optional: false, - range: [95, 96], + range: [22, 23], loc: { - start: { column: 22, line: 3 }, - end: { column: 23, line: 3 }, + start: { column: 22, line: 1 }, + end: { column: 23, line: 1 }, }, }, importKind: 'type', @@ -80,34 +80,34 @@ exports[`AST Fixtures legacy-fixtures basics type-only-import-specifiers AST Ali name: 'B', - optional: false, - range: [95, 96], + range: [22, 23], loc: { - start: { column: 22, line: 3 }, - end: { column: 23, line: 3 }, + start: { column: 22, line: 1 }, + end: { column: 23, line: 1 }, }, }, - range: [90, 96], + range: [17, 23], loc: { - start: { column: 17, line: 3 }, - end: { column: 23, line: 3 }, + start: { column: 17, line: 1 }, + end: { column: 23, line: 1 }, }, }, ], - range: [73, 110], + range: [0, 37], loc: { - start: { column: 0, line: 3 }, - end: { column: 37, line: 3 }, + start: { column: 0, line: 1 }, + end: { column: 37, line: 1 }, }, }, ], sourceType: 'module', - range: [73, 111], + range: [0, 38], loc: { - start: { column: 0, line: 3 }, - end: { column: 0, line: 4 }, + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, }, }" `; diff --git a/packages/ast-spec/src/special/ImportSpecifier/fixtures/type-only-import-specifiers/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/special/ImportSpecifier/fixtures/type-only-import-specifiers/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 000000000000..bb6cbaf0b7ad --- /dev/null +++ b/packages/ast-spec/src/special/ImportSpecifier/fixtures/type-only-import-specifiers/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures special ImportSpecifier type-only-import-specifiers AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/special/ImportSpecifier/spec.ts b/packages/ast-spec/src/special/ImportSpecifier/spec.ts index 5a47d0211678..9e3606cac2fb 100644 --- a/packages/ast-spec/src/special/ImportSpecifier/spec.ts +++ b/packages/ast-spec/src/special/ImportSpecifier/spec.ts @@ -2,10 +2,11 @@ import type { AST_NODE_TYPES } from '../../ast-node-types'; import type { BaseNode } from '../../base/BaseNode'; import type { ImportKind } from '../../declaration/ExportAndImportKind'; import type { Identifier } from '../../expression/Identifier/spec'; +import type { StringLiteral } from '../../expression/literal/StringLiteral/spec'; export interface ImportSpecifier extends BaseNode { type: AST_NODE_TYPES.ImportSpecifier; - imported: Identifier; + imported: Identifier | StringLiteral; importKind: ImportKind; local: Identifier; } diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-in-const-modifier/fixture.ts b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-in-const-modifier/fixture.ts index 046c0ebea359..4f2e85735664 100644 --- a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-in-const-modifier/fixture.ts +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-in-const-modifier/fixture.ts @@ -1 +1 @@ -class D {} +class D {} diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-in-const-modifier/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-in-const-modifier/snapshots/2-TSESTree-Tokens.shot index c7afa0857168..489d673c2f2e 100644 --- a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-in-const-modifier/snapshots/2-TSESTree-Tokens.shot +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-in-const-modifier/snapshots/2-TSESTree-Tokens.shot @@ -34,21 +34,21 @@ exports[`AST Fixtures special TSTypeParameter class-decl-in-const-modifier TSEST }, Keyword { type: "Keyword", - value: "in", + value: "const", - range: [8, 10], + range: [8, 13], loc: { start: { column: 8, line: 1 }, - end: { column: 10, line: 1 }, + end: { column: 13, line: 1 }, }, }, Keyword { type: "Keyword", - value: "const", + value: "in", - range: [11, 16], + range: [14, 16], loc: { - start: { column: 11, line: 1 }, + start: { column: 14, line: 1 }, end: { column: 16, line: 1 }, }, }, diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-in-const-modifier/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-in-const-modifier/snapshots/4-Babel-Tokens.shot index 93b1ee573afd..42611a08d657 100644 --- a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-in-const-modifier/snapshots/4-Babel-Tokens.shot +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-decl-in-const-modifier/snapshots/4-Babel-Tokens.shot @@ -34,21 +34,21 @@ exports[`AST Fixtures special TSTypeParameter class-decl-in-const-modifier Babel }, Keyword { type: "Keyword", - value: "in", + value: "const", - range: [8, 10], + range: [8, 13], loc: { start: { column: 8, line: 1 }, - end: { column: 10, line: 1 }, + end: { column: 13, line: 1 }, }, }, Keyword { type: "Keyword", - value: "const", + value: "in", - range: [11, 16], + range: [14, 16], loc: { - start: { column: 11, line: 1 }, + start: { column: 14, line: 1 }, end: { column: 16, line: 1 }, }, }, diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-in-modifier/fixture.ts b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-in-modifier/fixture.ts index 7a02fba43020..7aab3b72c474 100644 --- a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-in-modifier/fixture.ts +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-in-modifier/fixture.ts @@ -1 +1 @@ -(class {}); +(class {}); diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-in-modifier/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-in-modifier/snapshots/1-TSESTree-AST.shot index 9d3bd6eaa128..468135a5f6f0 100644 --- a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-in-modifier/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-in-modifier/snapshots/1-TSESTree-AST.shot @@ -13,10 +13,10 @@ Program { type: "ClassBody", body: [], - range: [20, 22], + range: [19, 21], loc: { - start: { column: 20, line: 1 }, - end: { column: 22, line: 1 }, + start: { column: 19, line: 1 }, + end: { column: 21, line: 1 }, }, }, declare: false, @@ -37,46 +37,46 @@ Program { name: "T", optional: false, - range: [17, 18], + range: [16, 17], loc: { - start: { column: 17, line: 1 }, - end: { column: 18, line: 1 }, + start: { column: 16, line: 1 }, + end: { column: 17, line: 1 }, }, }, out: false, - range: [8, 18], + range: [7, 17], loc: { - start: { column: 8, line: 1 }, - end: { column: 18, line: 1 }, + start: { column: 7, line: 1 }, + end: { column: 17, line: 1 }, }, }, ], - range: [7, 19], + range: [6, 18], loc: { - start: { column: 7, line: 1 }, - end: { column: 19, line: 1 }, + start: { column: 6, line: 1 }, + end: { column: 18, line: 1 }, }, }, - range: [1, 22], + range: [1, 21], loc: { start: { column: 1, line: 1 }, - end: { column: 22, line: 1 }, + end: { column: 21, line: 1 }, }, }, - range: [0, 24], + range: [0, 23], loc: { start: { column: 0, line: 1 }, - end: { column: 24, line: 1 }, + end: { column: 23, line: 1 }, }, }, ], sourceType: "script", - range: [0, 25], + range: [0, 24], loc: { start: { column: 0, line: 1 }, end: { column: 0, line: 2 }, diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-in-modifier/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-in-modifier/snapshots/2-TSESTree-Tokens.shot index b72435e44963..a73b2203ca57 100644 --- a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-in-modifier/snapshots/2-TSESTree-Tokens.shot +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-in-modifier/snapshots/2-TSESTree-Tokens.shot @@ -26,36 +26,46 @@ exports[`AST Fixtures special TSTypeParameter class-expr-const-in-modifier TSEST type: "Punctuator", value: "<", - range: [7, 8], + range: [6, 7], loc: { - start: { column: 7, line: 1 }, - end: { column: 8, line: 1 }, + start: { column: 6, line: 1 }, + end: { column: 7, line: 1 }, }, }, Keyword { type: "Keyword", value: "const", - range: [8, 13], + range: [7, 12], loc: { - start: { column: 8, line: 1 }, - end: { column: 13, line: 1 }, + start: { column: 7, line: 1 }, + end: { column: 12, line: 1 }, }, }, Keyword { type: "Keyword", value: "in", - range: [14, 16], + range: [13, 15], loc: { - start: { column: 14, line: 1 }, - end: { column: 16, line: 1 }, + start: { column: 13, line: 1 }, + end: { column: 15, line: 1 }, }, }, Identifier { type: "Identifier", value: "T", + range: [16, 17], + loc: { + start: { column: 16, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + range: [17, 18], loc: { start: { column: 17, line: 1 }, @@ -64,17 +74,17 @@ exports[`AST Fixtures special TSTypeParameter class-expr-const-in-modifier TSEST }, Punctuator { type: "Punctuator", - value: ">", + value: "{", - range: [18, 19], + range: [19, 20], loc: { - start: { column: 18, line: 1 }, - end: { column: 19, line: 1 }, + start: { column: 19, line: 1 }, + end: { column: 20, line: 1 }, }, }, Punctuator { type: "Punctuator", - value: "{", + value: "}", range: [20, 21], loc: { @@ -84,7 +94,7 @@ exports[`AST Fixtures special TSTypeParameter class-expr-const-in-modifier TSEST }, Punctuator { type: "Punctuator", - value: "}", + value: ")", range: [21, 22], loc: { @@ -94,7 +104,7 @@ exports[`AST Fixtures special TSTypeParameter class-expr-const-in-modifier TSEST }, Punctuator { type: "Punctuator", - value: ")", + value: ";", range: [22, 23], loc: { @@ -102,15 +112,5 @@ exports[`AST Fixtures special TSTypeParameter class-expr-const-in-modifier TSEST end: { column: 23, line: 1 }, }, }, - Punctuator { - type: "Punctuator", - value: ";", - - range: [23, 24], - loc: { - start: { column: 23, line: 1 }, - end: { column: 24, line: 1 }, - }, - }, ] `; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-in-modifier/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-in-modifier/snapshots/3-Babel-AST.shot index b91328e335ff..7353592c4201 100644 --- a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-in-modifier/snapshots/3-Babel-AST.shot +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-in-modifier/snapshots/3-Babel-AST.shot @@ -12,10 +12,10 @@ Program { type: "ClassBody", body: [], - range: [20, 22], + range: [19, 21], loc: { - start: { column: 20, line: 1 }, - end: { column: 22, line: 1 }, + start: { column: 19, line: 1 }, + end: { column: 21, line: 1 }, }, }, id: null, @@ -29,38 +29,38 @@ Program { in: true, name: "T", - range: [8, 18], + range: [7, 17], loc: { - start: { column: 8, line: 1 }, - end: { column: 18, line: 1 }, + start: { column: 7, line: 1 }, + end: { column: 17, line: 1 }, }, }, ], - range: [7, 19], + range: [6, 18], loc: { - start: { column: 7, line: 1 }, - end: { column: 19, line: 1 }, + start: { column: 6, line: 1 }, + end: { column: 18, line: 1 }, }, }, - range: [1, 22], + range: [1, 21], loc: { start: { column: 1, line: 1 }, - end: { column: 22, line: 1 }, + end: { column: 21, line: 1 }, }, }, - range: [0, 24], + range: [0, 23], loc: { start: { column: 0, line: 1 }, - end: { column: 24, line: 1 }, + end: { column: 23, line: 1 }, }, }, ], sourceType: "script", - range: [0, 25], + range: [0, 24], loc: { start: { column: 0, line: 1 }, end: { column: 0, line: 2 }, diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-in-modifier/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-in-modifier/snapshots/4-Babel-Tokens.shot index 2bb229553460..7ee922ac0b52 100644 --- a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-in-modifier/snapshots/4-Babel-Tokens.shot +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-in-modifier/snapshots/4-Babel-Tokens.shot @@ -26,36 +26,46 @@ exports[`AST Fixtures special TSTypeParameter class-expr-const-in-modifier Babel type: "Punctuator", value: "<", - range: [7, 8], + range: [6, 7], loc: { - start: { column: 7, line: 1 }, - end: { column: 8, line: 1 }, + start: { column: 6, line: 1 }, + end: { column: 7, line: 1 }, }, }, Keyword { type: "Keyword", value: "const", - range: [8, 13], + range: [7, 12], loc: { - start: { column: 8, line: 1 }, - end: { column: 13, line: 1 }, + start: { column: 7, line: 1 }, + end: { column: 12, line: 1 }, }, }, Keyword { type: "Keyword", value: "in", - range: [14, 16], + range: [13, 15], loc: { - start: { column: 14, line: 1 }, - end: { column: 16, line: 1 }, + start: { column: 13, line: 1 }, + end: { column: 15, line: 1 }, }, }, Identifier { type: "Identifier", value: "T", + range: [16, 17], + loc: { + start: { column: 16, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + range: [17, 18], loc: { start: { column: 17, line: 1 }, @@ -64,17 +74,17 @@ exports[`AST Fixtures special TSTypeParameter class-expr-const-in-modifier Babel }, Punctuator { type: "Punctuator", - value: ">", + value: "{", - range: [18, 19], + range: [19, 20], loc: { - start: { column: 18, line: 1 }, - end: { column: 19, line: 1 }, + start: { column: 19, line: 1 }, + end: { column: 20, line: 1 }, }, }, Punctuator { type: "Punctuator", - value: "{", + value: "}", range: [20, 21], loc: { @@ -84,7 +94,7 @@ exports[`AST Fixtures special TSTypeParameter class-expr-const-in-modifier Babel }, Punctuator { type: "Punctuator", - value: "}", + value: ")", range: [21, 22], loc: { @@ -94,7 +104,7 @@ exports[`AST Fixtures special TSTypeParameter class-expr-const-in-modifier Babel }, Punctuator { type: "Punctuator", - value: ")", + value: ";", range: [22, 23], loc: { @@ -102,15 +112,5 @@ exports[`AST Fixtures special TSTypeParameter class-expr-const-in-modifier Babel end: { column: 23, line: 1 }, }, }, - Punctuator { - type: "Punctuator", - value: ";", - - range: [23, 24], - loc: { - start: { column: 23, line: 1 }, - end: { column: 24, line: 1 }, - }, - }, ] `; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-in-modifier/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-in-modifier/snapshots/5-AST-Alignment-AST.shot index 32a31c4e8e40..7104e6d4228c 100644 --- a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-in-modifier/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-in-modifier/snapshots/5-AST-Alignment-AST.shot @@ -17,10 +17,10 @@ exports[`AST Fixtures special TSTypeParameter class-expr-const-in-modifier AST A type: 'ClassBody', body: Array [], - range: [20, 22], + range: [19, 21], loc: { - start: { column: 20, line: 1 }, - end: { column: 22, line: 1 }, + start: { column: 19, line: 1 }, + end: { column: 21, line: 1 }, }, }, - declare: false, @@ -41,47 +41,47 @@ exports[`AST Fixtures special TSTypeParameter class-expr-const-in-modifier AST A - name: 'T', - optional: false, - -- range: [17, 18], +- range: [16, 17], - loc: { -- start: { column: 17, line: 1 }, -- end: { column: 18, line: 1 }, +- start: { column: 16, line: 1 }, +- end: { column: 17, line: 1 }, - }, - }, - out: false, + name: 'T', - range: [8, 18], + range: [7, 17], loc: { - start: { column: 8, line: 1 }, - end: { column: 18, line: 1 }, + start: { column: 7, line: 1 }, + end: { column: 17, line: 1 }, }, }, ], - range: [7, 19], + range: [6, 18], loc: { - start: { column: 7, line: 1 }, - end: { column: 19, line: 1 }, + start: { column: 6, line: 1 }, + end: { column: 18, line: 1 }, }, }, - range: [1, 22], + range: [1, 21], loc: { start: { column: 1, line: 1 }, - end: { column: 22, line: 1 }, + end: { column: 21, line: 1 }, }, }, - range: [0, 24], + range: [0, 23], loc: { start: { column: 0, line: 1 }, - end: { column: 24, line: 1 }, + end: { column: 23, line: 1 }, }, }, ], sourceType: 'script', - range: [0, 25], + range: [0, 24], loc: { start: { column: 0, line: 1 }, end: { column: 0, line: 2 }, diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier-extends/fixture.ts b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier-extends/fixture.ts index cd6ecc95bec3..141b8722a300 100644 --- a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier-extends/fixture.ts +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier-extends/fixture.ts @@ -1 +1 @@ -(class {}); +(class {}); diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier-extends/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier-extends/snapshots/1-TSESTree-AST.shot index 125a353ad2f2..b5540ee0a4e0 100644 --- a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier-extends/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier-extends/snapshots/1-TSESTree-AST.shot @@ -13,10 +13,10 @@ Program { type: "ClassBody", body: [], - range: [27, 29], + range: [26, 28], loc: { - start: { column: 27, line: 1 }, - end: { column: 29, line: 1 }, + start: { column: 26, line: 1 }, + end: { column: 28, line: 1 }, }, }, declare: false, @@ -38,17 +38,17 @@ Program { name: "U", optional: false, - range: [24, 25], + range: [23, 24], loc: { - start: { column: 24, line: 1 }, - end: { column: 25, line: 1 }, + start: { column: 23, line: 1 }, + end: { column: 24, line: 1 }, }, }, - range: [24, 25], + range: [23, 24], loc: { - start: { column: 24, line: 1 }, - end: { column: 25, line: 1 }, + start: { column: 23, line: 1 }, + end: { column: 24, line: 1 }, }, }, in: false, @@ -58,46 +58,46 @@ Program { name: "T", optional: false, - range: [14, 15], + range: [13, 14], loc: { - start: { column: 14, line: 1 }, - end: { column: 15, line: 1 }, + start: { column: 13, line: 1 }, + end: { column: 14, line: 1 }, }, }, out: false, - range: [8, 25], + range: [7, 24], loc: { - start: { column: 8, line: 1 }, - end: { column: 25, line: 1 }, + start: { column: 7, line: 1 }, + end: { column: 24, line: 1 }, }, }, ], - range: [7, 26], + range: [6, 25], loc: { - start: { column: 7, line: 1 }, - end: { column: 26, line: 1 }, + start: { column: 6, line: 1 }, + end: { column: 25, line: 1 }, }, }, - range: [1, 29], + range: [1, 28], loc: { start: { column: 1, line: 1 }, - end: { column: 29, line: 1 }, + end: { column: 28, line: 1 }, }, }, - range: [0, 31], + range: [0, 30], loc: { start: { column: 0, line: 1 }, - end: { column: 31, line: 1 }, + end: { column: 30, line: 1 }, }, }, ], sourceType: "script", - range: [0, 32], + range: [0, 31], loc: { start: { column: 0, line: 1 }, end: { column: 0, line: 2 }, diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier-extends/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier-extends/snapshots/2-TSESTree-Tokens.shot index 9cd407c13d33..83290557ac32 100644 --- a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier-extends/snapshots/2-TSESTree-Tokens.shot +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier-extends/snapshots/2-TSESTree-Tokens.shot @@ -26,46 +26,56 @@ exports[`AST Fixtures special TSTypeParameter class-expr-const-modifier-extends type: "Punctuator", value: "<", - range: [7, 8], + range: [6, 7], loc: { - start: { column: 7, line: 1 }, - end: { column: 8, line: 1 }, + start: { column: 6, line: 1 }, + end: { column: 7, line: 1 }, }, }, Keyword { type: "Keyword", value: "const", - range: [8, 13], + range: [7, 12], loc: { - start: { column: 8, line: 1 }, - end: { column: 13, line: 1 }, + start: { column: 7, line: 1 }, + end: { column: 12, line: 1 }, }, }, Identifier { type: "Identifier", value: "T", - range: [14, 15], + range: [13, 14], loc: { - start: { column: 14, line: 1 }, - end: { column: 15, line: 1 }, + start: { column: 13, line: 1 }, + end: { column: 14, line: 1 }, }, }, Keyword { type: "Keyword", value: "extends", - range: [16, 23], + range: [15, 22], loc: { - start: { column: 16, line: 1 }, - end: { column: 23, line: 1 }, + start: { column: 15, line: 1 }, + end: { column: 22, line: 1 }, }, }, Identifier { type: "Identifier", value: "U", + range: [23, 24], + loc: { + start: { column: 23, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + range: [24, 25], loc: { start: { column: 24, line: 1 }, @@ -74,17 +84,17 @@ exports[`AST Fixtures special TSTypeParameter class-expr-const-modifier-extends }, Punctuator { type: "Punctuator", - value: ">", + value: "{", - range: [25, 26], + range: [26, 27], loc: { - start: { column: 25, line: 1 }, - end: { column: 26, line: 1 }, + start: { column: 26, line: 1 }, + end: { column: 27, line: 1 }, }, }, Punctuator { type: "Punctuator", - value: "{", + value: "}", range: [27, 28], loc: { @@ -94,7 +104,7 @@ exports[`AST Fixtures special TSTypeParameter class-expr-const-modifier-extends }, Punctuator { type: "Punctuator", - value: "}", + value: ")", range: [28, 29], loc: { @@ -104,7 +114,7 @@ exports[`AST Fixtures special TSTypeParameter class-expr-const-modifier-extends }, Punctuator { type: "Punctuator", - value: ")", + value: ";", range: [29, 30], loc: { @@ -112,15 +122,5 @@ exports[`AST Fixtures special TSTypeParameter class-expr-const-modifier-extends end: { column: 30, line: 1 }, }, }, - Punctuator { - type: "Punctuator", - value: ";", - - range: [30, 31], - loc: { - start: { column: 30, line: 1 }, - end: { column: 31, line: 1 }, - }, - }, ] `; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier-extends/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier-extends/snapshots/3-Babel-AST.shot index 6f6690c12313..833f4168997e 100644 --- a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier-extends/snapshots/3-Babel-AST.shot +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier-extends/snapshots/3-Babel-AST.shot @@ -12,10 +12,10 @@ Program { type: "ClassBody", body: [], - range: [27, 29], + range: [26, 28], loc: { - start: { column: 27, line: 1 }, - end: { column: 29, line: 1 }, + start: { column: 26, line: 1 }, + end: { column: 28, line: 1 }, }, }, id: null, @@ -32,53 +32,53 @@ Program { type: "Identifier", name: "U", - range: [24, 25], + range: [23, 24], loc: { - start: { column: 24, line: 1 }, - end: { column: 25, line: 1 }, + start: { column: 23, line: 1 }, + end: { column: 24, line: 1 }, }, }, - range: [24, 25], + range: [23, 24], loc: { - start: { column: 24, line: 1 }, - end: { column: 25, line: 1 }, + start: { column: 23, line: 1 }, + end: { column: 24, line: 1 }, }, }, name: "T", - range: [8, 25], + range: [7, 24], loc: { - start: { column: 8, line: 1 }, - end: { column: 25, line: 1 }, + start: { column: 7, line: 1 }, + end: { column: 24, line: 1 }, }, }, ], - range: [7, 26], + range: [6, 25], loc: { - start: { column: 7, line: 1 }, - end: { column: 26, line: 1 }, + start: { column: 6, line: 1 }, + end: { column: 25, line: 1 }, }, }, - range: [1, 29], + range: [1, 28], loc: { start: { column: 1, line: 1 }, - end: { column: 29, line: 1 }, + end: { column: 28, line: 1 }, }, }, - range: [0, 31], + range: [0, 30], loc: { start: { column: 0, line: 1 }, - end: { column: 31, line: 1 }, + end: { column: 30, line: 1 }, }, }, ], sourceType: "script", - range: [0, 32], + range: [0, 31], loc: { start: { column: 0, line: 1 }, end: { column: 0, line: 2 }, diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier-extends/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier-extends/snapshots/4-Babel-Tokens.shot index 8878acf69126..79fc39d63dd8 100644 --- a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier-extends/snapshots/4-Babel-Tokens.shot +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier-extends/snapshots/4-Babel-Tokens.shot @@ -26,46 +26,56 @@ exports[`AST Fixtures special TSTypeParameter class-expr-const-modifier-extends type: "Punctuator", value: "<", - range: [7, 8], + range: [6, 7], loc: { - start: { column: 7, line: 1 }, - end: { column: 8, line: 1 }, + start: { column: 6, line: 1 }, + end: { column: 7, line: 1 }, }, }, Keyword { type: "Keyword", value: "const", - range: [8, 13], + range: [7, 12], loc: { - start: { column: 8, line: 1 }, - end: { column: 13, line: 1 }, + start: { column: 7, line: 1 }, + end: { column: 12, line: 1 }, }, }, Identifier { type: "Identifier", value: "T", - range: [14, 15], + range: [13, 14], loc: { - start: { column: 14, line: 1 }, - end: { column: 15, line: 1 }, + start: { column: 13, line: 1 }, + end: { column: 14, line: 1 }, }, }, Keyword { type: "Keyword", value: "extends", - range: [16, 23], + range: [15, 22], loc: { - start: { column: 16, line: 1 }, - end: { column: 23, line: 1 }, + start: { column: 15, line: 1 }, + end: { column: 22, line: 1 }, }, }, Identifier { type: "Identifier", value: "U", + range: [23, 24], + loc: { + start: { column: 23, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + range: [24, 25], loc: { start: { column: 24, line: 1 }, @@ -74,17 +84,17 @@ exports[`AST Fixtures special TSTypeParameter class-expr-const-modifier-extends }, Punctuator { type: "Punctuator", - value: ">", + value: "{", - range: [25, 26], + range: [26, 27], loc: { - start: { column: 25, line: 1 }, - end: { column: 26, line: 1 }, + start: { column: 26, line: 1 }, + end: { column: 27, line: 1 }, }, }, Punctuator { type: "Punctuator", - value: "{", + value: "}", range: [27, 28], loc: { @@ -94,7 +104,7 @@ exports[`AST Fixtures special TSTypeParameter class-expr-const-modifier-extends }, Punctuator { type: "Punctuator", - value: "}", + value: ")", range: [28, 29], loc: { @@ -104,7 +114,7 @@ exports[`AST Fixtures special TSTypeParameter class-expr-const-modifier-extends }, Punctuator { type: "Punctuator", - value: ")", + value: ";", range: [29, 30], loc: { @@ -112,15 +122,5 @@ exports[`AST Fixtures special TSTypeParameter class-expr-const-modifier-extends end: { column: 30, line: 1 }, }, }, - Punctuator { - type: "Punctuator", - value: ";", - - range: [30, 31], - loc: { - start: { column: 30, line: 1 }, - end: { column: 31, line: 1 }, - }, - }, ] `; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier-extends/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier-extends/snapshots/5-AST-Alignment-AST.shot index 076a347f025f..7080150612d3 100644 --- a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier-extends/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier-extends/snapshots/5-AST-Alignment-AST.shot @@ -17,10 +17,10 @@ exports[`AST Fixtures special TSTypeParameter class-expr-const-modifier-extends type: 'ClassBody', body: Array [], - range: [27, 29], + range: [26, 28], loc: { - start: { column: 27, line: 1 }, - end: { column: 29, line: 1 }, + start: { column: 26, line: 1 }, + end: { column: 28, line: 1 }, }, }, - declare: false, @@ -42,17 +42,17 @@ exports[`AST Fixtures special TSTypeParameter class-expr-const-modifier-extends name: 'U', - optional: false, - range: [24, 25], + range: [23, 24], loc: { - start: { column: 24, line: 1 }, - end: { column: 25, line: 1 }, + start: { column: 23, line: 1 }, + end: { column: 24, line: 1 }, }, }, - range: [24, 25], + range: [23, 24], loc: { - start: { column: 24, line: 1 }, - end: { column: 25, line: 1 }, + start: { column: 23, line: 1 }, + end: { column: 24, line: 1 }, }, }, - in: false, @@ -62,47 +62,47 @@ exports[`AST Fixtures special TSTypeParameter class-expr-const-modifier-extends - name: 'T', - optional: false, - -- range: [14, 15], +- range: [13, 14], - loc: { -- start: { column: 14, line: 1 }, -- end: { column: 15, line: 1 }, +- start: { column: 13, line: 1 }, +- end: { column: 14, line: 1 }, - }, - }, - out: false, + name: 'T', - range: [8, 25], + range: [7, 24], loc: { - start: { column: 8, line: 1 }, - end: { column: 25, line: 1 }, + start: { column: 7, line: 1 }, + end: { column: 24, line: 1 }, }, }, ], - range: [7, 26], + range: [6, 25], loc: { - start: { column: 7, line: 1 }, - end: { column: 26, line: 1 }, + start: { column: 6, line: 1 }, + end: { column: 25, line: 1 }, }, }, - range: [1, 29], + range: [1, 28], loc: { start: { column: 1, line: 1 }, - end: { column: 29, line: 1 }, + end: { column: 28, line: 1 }, }, }, - range: [0, 31], + range: [0, 30], loc: { start: { column: 0, line: 1 }, - end: { column: 31, line: 1 }, + end: { column: 30, line: 1 }, }, }, ], sourceType: 'script', - range: [0, 32], + range: [0, 31], loc: { start: { column: 0, line: 1 }, end: { column: 0, line: 2 }, diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier-multiple/fixture.ts b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier-multiple/fixture.ts index a0fd2dc36d9e..0f326968ac50 100644 --- a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier-multiple/fixture.ts +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier-multiple/fixture.ts @@ -1 +1 @@ -(class {}); +(class {}); diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier-multiple/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier-multiple/snapshots/1-TSESTree-AST.shot index a8c6cf44d81a..8abc80358098 100644 --- a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier-multiple/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier-multiple/snapshots/1-TSESTree-AST.shot @@ -13,10 +13,10 @@ Program { type: "ClassBody", body: [], - range: [20, 22], + range: [19, 21], loc: { - start: { column: 20, line: 1 }, - end: { column: 22, line: 1 }, + start: { column: 19, line: 1 }, + end: { column: 21, line: 1 }, }, }, declare: false, @@ -37,18 +37,18 @@ Program { name: "T", optional: false, - range: [8, 9], + range: [7, 8], loc: { - start: { column: 8, line: 1 }, - end: { column: 9, line: 1 }, + start: { column: 7, line: 1 }, + end: { column: 8, line: 1 }, }, }, out: false, - range: [8, 9], + range: [7, 8], loc: { - start: { column: 8, line: 1 }, - end: { column: 9, line: 1 }, + start: { column: 7, line: 1 }, + end: { column: 8, line: 1 }, }, }, TSTypeParameter { @@ -61,46 +61,46 @@ Program { name: "U", optional: false, - range: [17, 18], + range: [16, 17], loc: { - start: { column: 17, line: 1 }, - end: { column: 18, line: 1 }, + start: { column: 16, line: 1 }, + end: { column: 17, line: 1 }, }, }, out: false, - range: [11, 18], + range: [10, 17], loc: { - start: { column: 11, line: 1 }, - end: { column: 18, line: 1 }, + start: { column: 10, line: 1 }, + end: { column: 17, line: 1 }, }, }, ], - range: [7, 19], + range: [6, 18], loc: { - start: { column: 7, line: 1 }, - end: { column: 19, line: 1 }, + start: { column: 6, line: 1 }, + end: { column: 18, line: 1 }, }, }, - range: [1, 22], + range: [1, 21], loc: { start: { column: 1, line: 1 }, - end: { column: 22, line: 1 }, + end: { column: 21, line: 1 }, }, }, - range: [0, 24], + range: [0, 23], loc: { start: { column: 0, line: 1 }, - end: { column: 24, line: 1 }, + end: { column: 23, line: 1 }, }, }, ], sourceType: "script", - range: [0, 25], + range: [0, 24], loc: { start: { column: 0, line: 1 }, end: { column: 0, line: 2 }, diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier-multiple/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier-multiple/snapshots/2-TSESTree-Tokens.shot index 825375374759..91c2253f6df6 100644 --- a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier-multiple/snapshots/2-TSESTree-Tokens.shot +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier-multiple/snapshots/2-TSESTree-Tokens.shot @@ -26,46 +26,56 @@ exports[`AST Fixtures special TSTypeParameter class-expr-const-modifier-multiple type: "Punctuator", value: "<", - range: [7, 8], + range: [6, 7], loc: { - start: { column: 7, line: 1 }, - end: { column: 8, line: 1 }, + start: { column: 6, line: 1 }, + end: { column: 7, line: 1 }, }, }, Identifier { type: "Identifier", value: "T", - range: [8, 9], + range: [7, 8], loc: { - start: { column: 8, line: 1 }, - end: { column: 9, line: 1 }, + start: { column: 7, line: 1 }, + end: { column: 8, line: 1 }, }, }, Punctuator { type: "Punctuator", value: ",", - range: [9, 10], + range: [8, 9], loc: { - start: { column: 9, line: 1 }, - end: { column: 10, line: 1 }, + start: { column: 8, line: 1 }, + end: { column: 9, line: 1 }, }, }, Keyword { type: "Keyword", value: "const", - range: [11, 16], + range: [10, 15], loc: { - start: { column: 11, line: 1 }, - end: { column: 16, line: 1 }, + start: { column: 10, line: 1 }, + end: { column: 15, line: 1 }, }, }, Identifier { type: "Identifier", value: "U", + range: [16, 17], + loc: { + start: { column: 16, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + range: [17, 18], loc: { start: { column: 17, line: 1 }, @@ -74,17 +84,17 @@ exports[`AST Fixtures special TSTypeParameter class-expr-const-modifier-multiple }, Punctuator { type: "Punctuator", - value: ">", + value: "{", - range: [18, 19], + range: [19, 20], loc: { - start: { column: 18, line: 1 }, - end: { column: 19, line: 1 }, + start: { column: 19, line: 1 }, + end: { column: 20, line: 1 }, }, }, Punctuator { type: "Punctuator", - value: "{", + value: "}", range: [20, 21], loc: { @@ -94,7 +104,7 @@ exports[`AST Fixtures special TSTypeParameter class-expr-const-modifier-multiple }, Punctuator { type: "Punctuator", - value: "}", + value: ")", range: [21, 22], loc: { @@ -104,7 +114,7 @@ exports[`AST Fixtures special TSTypeParameter class-expr-const-modifier-multiple }, Punctuator { type: "Punctuator", - value: ")", + value: ";", range: [22, 23], loc: { @@ -112,15 +122,5 @@ exports[`AST Fixtures special TSTypeParameter class-expr-const-modifier-multiple end: { column: 23, line: 1 }, }, }, - Punctuator { - type: "Punctuator", - value: ";", - - range: [23, 24], - loc: { - start: { column: 23, line: 1 }, - end: { column: 24, line: 1 }, - }, - }, ] `; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier-multiple/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier-multiple/snapshots/3-Babel-AST.shot index 70dec76e302f..747e704ca760 100644 --- a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier-multiple/snapshots/3-Babel-AST.shot +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier-multiple/snapshots/3-Babel-AST.shot @@ -12,10 +12,10 @@ Program { type: "ClassBody", body: [], - range: [20, 22], + range: [19, 21], loc: { - start: { column: 20, line: 1 }, - end: { column: 22, line: 1 }, + start: { column: 19, line: 1 }, + end: { column: 21, line: 1 }, }, }, id: null, @@ -27,10 +27,10 @@ Program { type: "TSTypeParameter", name: "T", - range: [8, 9], + range: [7, 8], loc: { - start: { column: 8, line: 1 }, - end: { column: 9, line: 1 }, + start: { column: 7, line: 1 }, + end: { column: 8, line: 1 }, }, }, TSTypeParameter { @@ -38,38 +38,38 @@ Program { const: true, name: "U", - range: [11, 18], + range: [10, 17], loc: { - start: { column: 11, line: 1 }, - end: { column: 18, line: 1 }, + start: { column: 10, line: 1 }, + end: { column: 17, line: 1 }, }, }, ], - range: [7, 19], + range: [6, 18], loc: { - start: { column: 7, line: 1 }, - end: { column: 19, line: 1 }, + start: { column: 6, line: 1 }, + end: { column: 18, line: 1 }, }, }, - range: [1, 22], + range: [1, 21], loc: { start: { column: 1, line: 1 }, - end: { column: 22, line: 1 }, + end: { column: 21, line: 1 }, }, }, - range: [0, 24], + range: [0, 23], loc: { start: { column: 0, line: 1 }, - end: { column: 24, line: 1 }, + end: { column: 23, line: 1 }, }, }, ], sourceType: "script", - range: [0, 25], + range: [0, 24], loc: { start: { column: 0, line: 1 }, end: { column: 0, line: 2 }, diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier-multiple/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier-multiple/snapshots/4-Babel-Tokens.shot index dd07dc882c06..c116c98c12ed 100644 --- a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier-multiple/snapshots/4-Babel-Tokens.shot +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier-multiple/snapshots/4-Babel-Tokens.shot @@ -26,46 +26,56 @@ exports[`AST Fixtures special TSTypeParameter class-expr-const-modifier-multiple type: "Punctuator", value: "<", - range: [7, 8], + range: [6, 7], loc: { - start: { column: 7, line: 1 }, - end: { column: 8, line: 1 }, + start: { column: 6, line: 1 }, + end: { column: 7, line: 1 }, }, }, Identifier { type: "Identifier", value: "T", - range: [8, 9], + range: [7, 8], loc: { - start: { column: 8, line: 1 }, - end: { column: 9, line: 1 }, + start: { column: 7, line: 1 }, + end: { column: 8, line: 1 }, }, }, Punctuator { type: "Punctuator", value: ",", - range: [9, 10], + range: [8, 9], loc: { - start: { column: 9, line: 1 }, - end: { column: 10, line: 1 }, + start: { column: 8, line: 1 }, + end: { column: 9, line: 1 }, }, }, Keyword { type: "Keyword", value: "const", - range: [11, 16], + range: [10, 15], loc: { - start: { column: 11, line: 1 }, - end: { column: 16, line: 1 }, + start: { column: 10, line: 1 }, + end: { column: 15, line: 1 }, }, }, Identifier { type: "Identifier", value: "U", + range: [16, 17], + loc: { + start: { column: 16, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + range: [17, 18], loc: { start: { column: 17, line: 1 }, @@ -74,17 +84,17 @@ exports[`AST Fixtures special TSTypeParameter class-expr-const-modifier-multiple }, Punctuator { type: "Punctuator", - value: ">", + value: "{", - range: [18, 19], + range: [19, 20], loc: { - start: { column: 18, line: 1 }, - end: { column: 19, line: 1 }, + start: { column: 19, line: 1 }, + end: { column: 20, line: 1 }, }, }, Punctuator { type: "Punctuator", - value: "{", + value: "}", range: [20, 21], loc: { @@ -94,7 +104,7 @@ exports[`AST Fixtures special TSTypeParameter class-expr-const-modifier-multiple }, Punctuator { type: "Punctuator", - value: "}", + value: ")", range: [21, 22], loc: { @@ -104,7 +114,7 @@ exports[`AST Fixtures special TSTypeParameter class-expr-const-modifier-multiple }, Punctuator { type: "Punctuator", - value: ")", + value: ";", range: [22, 23], loc: { @@ -112,15 +122,5 @@ exports[`AST Fixtures special TSTypeParameter class-expr-const-modifier-multiple end: { column: 23, line: 1 }, }, }, - Punctuator { - type: "Punctuator", - value: ";", - - range: [23, 24], - loc: { - start: { column: 23, line: 1 }, - end: { column: 24, line: 1 }, - }, - }, ] `; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier-multiple/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier-multiple/snapshots/5-AST-Alignment-AST.shot index 8ff0271450e5..fa9b0915d71e 100644 --- a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier-multiple/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier-multiple/snapshots/5-AST-Alignment-AST.shot @@ -17,10 +17,10 @@ exports[`AST Fixtures special TSTypeParameter class-expr-const-modifier-multiple type: 'ClassBody', body: Array [], - range: [20, 22], + range: [19, 21], loc: { - start: { column: 20, line: 1 }, - end: { column: 22, line: 1 }, + start: { column: 19, line: 1 }, + end: { column: 21, line: 1 }, }, }, - declare: false, @@ -41,19 +41,19 @@ exports[`AST Fixtures special TSTypeParameter class-expr-const-modifier-multiple - name: 'T', - optional: false, - -- range: [8, 9], +- range: [7, 8], - loc: { -- start: { column: 8, line: 1 }, -- end: { column: 9, line: 1 }, +- start: { column: 7, line: 1 }, +- end: { column: 8, line: 1 }, - }, - }, - out: false, + name: 'T', - range: [8, 9], + range: [7, 8], loc: { - start: { column: 8, line: 1 }, - end: { column: 9, line: 1 }, + start: { column: 7, line: 1 }, + end: { column: 8, line: 1 }, }, }, TSTypeParameter { @@ -66,47 +66,47 @@ exports[`AST Fixtures special TSTypeParameter class-expr-const-modifier-multiple - name: 'U', - optional: false, - -- range: [17, 18], +- range: [16, 17], - loc: { -- start: { column: 17, line: 1 }, -- end: { column: 18, line: 1 }, +- start: { column: 16, line: 1 }, +- end: { column: 17, line: 1 }, - }, - }, - out: false, + name: 'U', - range: [11, 18], + range: [10, 17], loc: { - start: { column: 11, line: 1 }, - end: { column: 18, line: 1 }, + start: { column: 10, line: 1 }, + end: { column: 17, line: 1 }, }, }, ], - range: [7, 19], + range: [6, 18], loc: { - start: { column: 7, line: 1 }, - end: { column: 19, line: 1 }, + start: { column: 6, line: 1 }, + end: { column: 18, line: 1 }, }, }, - range: [1, 22], + range: [1, 21], loc: { start: { column: 1, line: 1 }, - end: { column: 22, line: 1 }, + end: { column: 21, line: 1 }, }, }, - range: [0, 24], + range: [0, 23], loc: { start: { column: 0, line: 1 }, - end: { column: 24, line: 1 }, + end: { column: 23, line: 1 }, }, }, ], sourceType: 'script', - range: [0, 25], + range: [0, 24], loc: { start: { column: 0, line: 1 }, end: { column: 0, line: 2 }, diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier/fixture.ts b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier/fixture.ts index e7c0e459e69f..6636f92bcff8 100644 --- a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier/fixture.ts +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier/fixture.ts @@ -1 +1 @@ -(class {}); +(class {}); diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier/snapshots/1-TSESTree-AST.shot index ffc7d16c1be6..247ae9c75e9e 100644 --- a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier/snapshots/1-TSESTree-AST.shot @@ -13,10 +13,10 @@ Program { type: "ClassBody", body: [], - range: [17, 19], + range: [16, 18], loc: { - start: { column: 17, line: 1 }, - end: { column: 19, line: 1 }, + start: { column: 16, line: 1 }, + end: { column: 18, line: 1 }, }, }, declare: false, @@ -37,46 +37,46 @@ Program { name: "T", optional: false, - range: [14, 15], + range: [13, 14], loc: { - start: { column: 14, line: 1 }, - end: { column: 15, line: 1 }, + start: { column: 13, line: 1 }, + end: { column: 14, line: 1 }, }, }, out: false, - range: [8, 15], + range: [7, 14], loc: { - start: { column: 8, line: 1 }, - end: { column: 15, line: 1 }, + start: { column: 7, line: 1 }, + end: { column: 14, line: 1 }, }, }, ], - range: [7, 16], + range: [6, 15], loc: { - start: { column: 7, line: 1 }, - end: { column: 16, line: 1 }, + start: { column: 6, line: 1 }, + end: { column: 15, line: 1 }, }, }, - range: [1, 19], + range: [1, 18], loc: { start: { column: 1, line: 1 }, - end: { column: 19, line: 1 }, + end: { column: 18, line: 1 }, }, }, - range: [0, 21], + range: [0, 20], loc: { start: { column: 0, line: 1 }, - end: { column: 21, line: 1 }, + end: { column: 20, line: 1 }, }, }, ], sourceType: "script", - range: [0, 22], + range: [0, 21], loc: { start: { column: 0, line: 1 }, end: { column: 0, line: 2 }, diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier/snapshots/2-TSESTree-Tokens.shot index a599070370a6..86f39a94072f 100644 --- a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier/snapshots/2-TSESTree-Tokens.shot +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier/snapshots/2-TSESTree-Tokens.shot @@ -26,26 +26,36 @@ exports[`AST Fixtures special TSTypeParameter class-expr-const-modifier TSESTree type: "Punctuator", value: "<", - range: [7, 8], + range: [6, 7], loc: { - start: { column: 7, line: 1 }, - end: { column: 8, line: 1 }, + start: { column: 6, line: 1 }, + end: { column: 7, line: 1 }, }, }, Keyword { type: "Keyword", value: "const", - range: [8, 13], + range: [7, 12], loc: { - start: { column: 8, line: 1 }, - end: { column: 13, line: 1 }, + start: { column: 7, line: 1 }, + end: { column: 12, line: 1 }, }, }, Identifier { type: "Identifier", value: "T", + range: [13, 14], + loc: { + start: { column: 13, line: 1 }, + end: { column: 14, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + range: [14, 15], loc: { start: { column: 14, line: 1 }, @@ -54,17 +64,17 @@ exports[`AST Fixtures special TSTypeParameter class-expr-const-modifier TSESTree }, Punctuator { type: "Punctuator", - value: ">", + value: "{", - range: [15, 16], + range: [16, 17], loc: { - start: { column: 15, line: 1 }, - end: { column: 16, line: 1 }, + start: { column: 16, line: 1 }, + end: { column: 17, line: 1 }, }, }, Punctuator { type: "Punctuator", - value: "{", + value: "}", range: [17, 18], loc: { @@ -74,7 +84,7 @@ exports[`AST Fixtures special TSTypeParameter class-expr-const-modifier TSESTree }, Punctuator { type: "Punctuator", - value: "}", + value: ")", range: [18, 19], loc: { @@ -84,7 +94,7 @@ exports[`AST Fixtures special TSTypeParameter class-expr-const-modifier TSESTree }, Punctuator { type: "Punctuator", - value: ")", + value: ";", range: [19, 20], loc: { @@ -92,15 +102,5 @@ exports[`AST Fixtures special TSTypeParameter class-expr-const-modifier TSESTree end: { column: 20, line: 1 }, }, }, - Punctuator { - type: "Punctuator", - value: ";", - - range: [20, 21], - loc: { - start: { column: 20, line: 1 }, - end: { column: 21, line: 1 }, - }, - }, ] `; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier/snapshots/3-Babel-AST.shot index 592ea11dcc9a..ebbfa104d17b 100644 --- a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier/snapshots/3-Babel-AST.shot +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier/snapshots/3-Babel-AST.shot @@ -12,10 +12,10 @@ Program { type: "ClassBody", body: [], - range: [17, 19], + range: [16, 18], loc: { - start: { column: 17, line: 1 }, - end: { column: 19, line: 1 }, + start: { column: 16, line: 1 }, + end: { column: 18, line: 1 }, }, }, id: null, @@ -28,38 +28,38 @@ Program { const: true, name: "T", - range: [8, 15], + range: [7, 14], loc: { - start: { column: 8, line: 1 }, - end: { column: 15, line: 1 }, + start: { column: 7, line: 1 }, + end: { column: 14, line: 1 }, }, }, ], - range: [7, 16], + range: [6, 15], loc: { - start: { column: 7, line: 1 }, - end: { column: 16, line: 1 }, + start: { column: 6, line: 1 }, + end: { column: 15, line: 1 }, }, }, - range: [1, 19], + range: [1, 18], loc: { start: { column: 1, line: 1 }, - end: { column: 19, line: 1 }, + end: { column: 18, line: 1 }, }, }, - range: [0, 21], + range: [0, 20], loc: { start: { column: 0, line: 1 }, - end: { column: 21, line: 1 }, + end: { column: 20, line: 1 }, }, }, ], sourceType: "script", - range: [0, 22], + range: [0, 21], loc: { start: { column: 0, line: 1 }, end: { column: 0, line: 2 }, diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier/snapshots/4-Babel-Tokens.shot index 0e54bfc1447d..08e1929b1700 100644 --- a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier/snapshots/4-Babel-Tokens.shot +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier/snapshots/4-Babel-Tokens.shot @@ -26,26 +26,36 @@ exports[`AST Fixtures special TSTypeParameter class-expr-const-modifier Babel - type: "Punctuator", value: "<", - range: [7, 8], + range: [6, 7], loc: { - start: { column: 7, line: 1 }, - end: { column: 8, line: 1 }, + start: { column: 6, line: 1 }, + end: { column: 7, line: 1 }, }, }, Keyword { type: "Keyword", value: "const", - range: [8, 13], + range: [7, 12], loc: { - start: { column: 8, line: 1 }, - end: { column: 13, line: 1 }, + start: { column: 7, line: 1 }, + end: { column: 12, line: 1 }, }, }, Identifier { type: "Identifier", value: "T", + range: [13, 14], + loc: { + start: { column: 13, line: 1 }, + end: { column: 14, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + range: [14, 15], loc: { start: { column: 14, line: 1 }, @@ -54,17 +64,17 @@ exports[`AST Fixtures special TSTypeParameter class-expr-const-modifier Babel - }, Punctuator { type: "Punctuator", - value: ">", + value: "{", - range: [15, 16], + range: [16, 17], loc: { - start: { column: 15, line: 1 }, - end: { column: 16, line: 1 }, + start: { column: 16, line: 1 }, + end: { column: 17, line: 1 }, }, }, Punctuator { type: "Punctuator", - value: "{", + value: "}", range: [17, 18], loc: { @@ -74,7 +84,7 @@ exports[`AST Fixtures special TSTypeParameter class-expr-const-modifier Babel - }, Punctuator { type: "Punctuator", - value: "}", + value: ")", range: [18, 19], loc: { @@ -84,7 +94,7 @@ exports[`AST Fixtures special TSTypeParameter class-expr-const-modifier Babel - }, Punctuator { type: "Punctuator", - value: ")", + value: ";", range: [19, 20], loc: { @@ -92,15 +102,5 @@ exports[`AST Fixtures special TSTypeParameter class-expr-const-modifier Babel - end: { column: 20, line: 1 }, }, }, - Punctuator { - type: "Punctuator", - value: ";", - - range: [20, 21], - loc: { - start: { column: 20, line: 1 }, - end: { column: 21, line: 1 }, - }, - }, ] `; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier/snapshots/5-AST-Alignment-AST.shot index 05e22d460f7e..ad1ae38b608b 100644 --- a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-const-modifier/snapshots/5-AST-Alignment-AST.shot @@ -17,10 +17,10 @@ exports[`AST Fixtures special TSTypeParameter class-expr-const-modifier AST Alig type: 'ClassBody', body: Array [], - range: [17, 19], + range: [16, 18], loc: { - start: { column: 17, line: 1 }, - end: { column: 19, line: 1 }, + start: { column: 16, line: 1 }, + end: { column: 18, line: 1 }, }, }, - declare: false, @@ -41,47 +41,47 @@ exports[`AST Fixtures special TSTypeParameter class-expr-const-modifier AST Alig - name: 'T', - optional: false, - -- range: [14, 15], +- range: [13, 14], - loc: { -- start: { column: 14, line: 1 }, -- end: { column: 15, line: 1 }, +- start: { column: 13, line: 1 }, +- end: { column: 14, line: 1 }, - }, - }, - out: false, + name: 'T', - range: [8, 15], + range: [7, 14], loc: { - start: { column: 8, line: 1 }, - end: { column: 15, line: 1 }, + start: { column: 7, line: 1 }, + end: { column: 14, line: 1 }, }, }, ], - range: [7, 16], + range: [6, 15], loc: { - start: { column: 7, line: 1 }, - end: { column: 16, line: 1 }, + start: { column: 6, line: 1 }, + end: { column: 15, line: 1 }, }, }, - range: [1, 19], + range: [1, 18], loc: { start: { column: 1, line: 1 }, - end: { column: 19, line: 1 }, + end: { column: 18, line: 1 }, }, }, - range: [0, 21], + range: [0, 20], loc: { start: { column: 0, line: 1 }, - end: { column: 21, line: 1 }, + end: { column: 20, line: 1 }, }, }, ], sourceType: 'script', - range: [0, 22], + range: [0, 21], loc: { start: { column: 0, line: 1 }, end: { column: 0, line: 2 }, diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-in-const-modifier/fixture.ts b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-in-const-modifier/fixture.ts index eb21599bf3b2..7aab3b72c474 100644 --- a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-in-const-modifier/fixture.ts +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-in-const-modifier/fixture.ts @@ -1 +1 @@ -(class {}); +(class {}); diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-in-const-modifier/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-in-const-modifier/snapshots/1-TSESTree-AST.shot index 5a7a38bb6cb9..466edfe36a9f 100644 --- a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-in-const-modifier/snapshots/1-TSESTree-AST.shot +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-in-const-modifier/snapshots/1-TSESTree-AST.shot @@ -13,10 +13,10 @@ Program { type: "ClassBody", body: [], - range: [20, 22], + range: [19, 21], loc: { - start: { column: 20, line: 1 }, - end: { column: 22, line: 1 }, + start: { column: 19, line: 1 }, + end: { column: 21, line: 1 }, }, }, declare: false, @@ -37,46 +37,46 @@ Program { name: "T", optional: false, - range: [17, 18], + range: [16, 17], loc: { - start: { column: 17, line: 1 }, - end: { column: 18, line: 1 }, + start: { column: 16, line: 1 }, + end: { column: 17, line: 1 }, }, }, out: false, - range: [8, 18], + range: [7, 17], loc: { - start: { column: 8, line: 1 }, - end: { column: 18, line: 1 }, + start: { column: 7, line: 1 }, + end: { column: 17, line: 1 }, }, }, ], - range: [7, 19], + range: [6, 18], loc: { - start: { column: 7, line: 1 }, - end: { column: 19, line: 1 }, + start: { column: 6, line: 1 }, + end: { column: 18, line: 1 }, }, }, - range: [1, 22], + range: [1, 21], loc: { start: { column: 1, line: 1 }, - end: { column: 22, line: 1 }, + end: { column: 21, line: 1 }, }, }, - range: [0, 24], + range: [0, 23], loc: { start: { column: 0, line: 1 }, - end: { column: 24, line: 1 }, + end: { column: 23, line: 1 }, }, }, ], sourceType: "script", - range: [0, 25], + range: [0, 24], loc: { start: { column: 0, line: 1 }, end: { column: 0, line: 2 }, diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-in-const-modifier/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-in-const-modifier/snapshots/2-TSESTree-Tokens.shot index 1046c2c28015..d7fac0446d86 100644 --- a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-in-const-modifier/snapshots/2-TSESTree-Tokens.shot +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-in-const-modifier/snapshots/2-TSESTree-Tokens.shot @@ -26,36 +26,46 @@ exports[`AST Fixtures special TSTypeParameter class-expr-in-const-modifier TSEST type: "Punctuator", value: "<", - range: [7, 8], + range: [6, 7], loc: { - start: { column: 7, line: 1 }, - end: { column: 8, line: 1 }, + start: { column: 6, line: 1 }, + end: { column: 7, line: 1 }, }, }, Keyword { type: "Keyword", - value: "in", + value: "const", - range: [8, 10], + range: [7, 12], loc: { - start: { column: 8, line: 1 }, - end: { column: 10, line: 1 }, + start: { column: 7, line: 1 }, + end: { column: 12, line: 1 }, }, }, Keyword { type: "Keyword", - value: "const", + value: "in", - range: [11, 16], + range: [13, 15], loc: { - start: { column: 11, line: 1 }, - end: { column: 16, line: 1 }, + start: { column: 13, line: 1 }, + end: { column: 15, line: 1 }, }, }, Identifier { type: "Identifier", value: "T", + range: [16, 17], + loc: { + start: { column: 16, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + range: [17, 18], loc: { start: { column: 17, line: 1 }, @@ -64,17 +74,17 @@ exports[`AST Fixtures special TSTypeParameter class-expr-in-const-modifier TSEST }, Punctuator { type: "Punctuator", - value: ">", + value: "{", - range: [18, 19], + range: [19, 20], loc: { - start: { column: 18, line: 1 }, - end: { column: 19, line: 1 }, + start: { column: 19, line: 1 }, + end: { column: 20, line: 1 }, }, }, Punctuator { type: "Punctuator", - value: "{", + value: "}", range: [20, 21], loc: { @@ -84,7 +94,7 @@ exports[`AST Fixtures special TSTypeParameter class-expr-in-const-modifier TSEST }, Punctuator { type: "Punctuator", - value: "}", + value: ")", range: [21, 22], loc: { @@ -94,7 +104,7 @@ exports[`AST Fixtures special TSTypeParameter class-expr-in-const-modifier TSEST }, Punctuator { type: "Punctuator", - value: ")", + value: ";", range: [22, 23], loc: { @@ -102,15 +112,5 @@ exports[`AST Fixtures special TSTypeParameter class-expr-in-const-modifier TSEST end: { column: 23, line: 1 }, }, }, - Punctuator { - type: "Punctuator", - value: ";", - - range: [23, 24], - loc: { - start: { column: 23, line: 1 }, - end: { column: 24, line: 1 }, - }, - }, ] `; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-in-const-modifier/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-in-const-modifier/snapshots/3-Babel-AST.shot index 3229c6fab61b..9993404c4e92 100644 --- a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-in-const-modifier/snapshots/3-Babel-AST.shot +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-in-const-modifier/snapshots/3-Babel-AST.shot @@ -12,10 +12,10 @@ Program { type: "ClassBody", body: [], - range: [20, 22], + range: [19, 21], loc: { - start: { column: 20, line: 1 }, - end: { column: 22, line: 1 }, + start: { column: 19, line: 1 }, + end: { column: 21, line: 1 }, }, }, id: null, @@ -29,38 +29,38 @@ Program { in: true, name: "T", - range: [8, 18], + range: [7, 17], loc: { - start: { column: 8, line: 1 }, - end: { column: 18, line: 1 }, + start: { column: 7, line: 1 }, + end: { column: 17, line: 1 }, }, }, ], - range: [7, 19], + range: [6, 18], loc: { - start: { column: 7, line: 1 }, - end: { column: 19, line: 1 }, + start: { column: 6, line: 1 }, + end: { column: 18, line: 1 }, }, }, - range: [1, 22], + range: [1, 21], loc: { start: { column: 1, line: 1 }, - end: { column: 22, line: 1 }, + end: { column: 21, line: 1 }, }, }, - range: [0, 24], + range: [0, 23], loc: { start: { column: 0, line: 1 }, - end: { column: 24, line: 1 }, + end: { column: 23, line: 1 }, }, }, ], sourceType: "script", - range: [0, 25], + range: [0, 24], loc: { start: { column: 0, line: 1 }, end: { column: 0, line: 2 }, diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-in-const-modifier/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-in-const-modifier/snapshots/4-Babel-Tokens.shot index 3cdb8cd44bc7..9f93e854f08d 100644 --- a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-in-const-modifier/snapshots/4-Babel-Tokens.shot +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-in-const-modifier/snapshots/4-Babel-Tokens.shot @@ -26,36 +26,46 @@ exports[`AST Fixtures special TSTypeParameter class-expr-in-const-modifier Babel type: "Punctuator", value: "<", - range: [7, 8], + range: [6, 7], loc: { - start: { column: 7, line: 1 }, - end: { column: 8, line: 1 }, + start: { column: 6, line: 1 }, + end: { column: 7, line: 1 }, }, }, Keyword { type: "Keyword", - value: "in", + value: "const", - range: [8, 10], + range: [7, 12], loc: { - start: { column: 8, line: 1 }, - end: { column: 10, line: 1 }, + start: { column: 7, line: 1 }, + end: { column: 12, line: 1 }, }, }, Keyword { type: "Keyword", - value: "const", + value: "in", - range: [11, 16], + range: [13, 15], loc: { - start: { column: 11, line: 1 }, - end: { column: 16, line: 1 }, + start: { column: 13, line: 1 }, + end: { column: 15, line: 1 }, }, }, Identifier { type: "Identifier", value: "T", + range: [16, 17], + loc: { + start: { column: 16, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ">", + range: [17, 18], loc: { start: { column: 17, line: 1 }, @@ -64,17 +74,17 @@ exports[`AST Fixtures special TSTypeParameter class-expr-in-const-modifier Babel }, Punctuator { type: "Punctuator", - value: ">", + value: "{", - range: [18, 19], + range: [19, 20], loc: { - start: { column: 18, line: 1 }, - end: { column: 19, line: 1 }, + start: { column: 19, line: 1 }, + end: { column: 20, line: 1 }, }, }, Punctuator { type: "Punctuator", - value: "{", + value: "}", range: [20, 21], loc: { @@ -84,7 +94,7 @@ exports[`AST Fixtures special TSTypeParameter class-expr-in-const-modifier Babel }, Punctuator { type: "Punctuator", - value: "}", + value: ")", range: [21, 22], loc: { @@ -94,7 +104,7 @@ exports[`AST Fixtures special TSTypeParameter class-expr-in-const-modifier Babel }, Punctuator { type: "Punctuator", - value: ")", + value: ";", range: [22, 23], loc: { @@ -102,15 +112,5 @@ exports[`AST Fixtures special TSTypeParameter class-expr-in-const-modifier Babel end: { column: 23, line: 1 }, }, }, - Punctuator { - type: "Punctuator", - value: ";", - - range: [23, 24], - loc: { - start: { column: 23, line: 1 }, - end: { column: 24, line: 1 }, - }, - }, ] `; diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-in-const-modifier/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-in-const-modifier/snapshots/5-AST-Alignment-AST.shot index e92dc3b1d949..700e89790ccf 100644 --- a/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-in-const-modifier/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/class-expr-in-const-modifier/snapshots/5-AST-Alignment-AST.shot @@ -17,10 +17,10 @@ exports[`AST Fixtures special TSTypeParameter class-expr-in-const-modifier AST A type: 'ClassBody', body: Array [], - range: [20, 22], + range: [19, 21], loc: { - start: { column: 20, line: 1 }, - end: { column: 22, line: 1 }, + start: { column: 19, line: 1 }, + end: { column: 21, line: 1 }, }, }, - declare: false, @@ -41,47 +41,47 @@ exports[`AST Fixtures special TSTypeParameter class-expr-in-const-modifier AST A - name: 'T', - optional: false, - -- range: [17, 18], +- range: [16, 17], - loc: { -- start: { column: 17, line: 1 }, -- end: { column: 18, line: 1 }, +- start: { column: 16, line: 1 }, +- end: { column: 17, line: 1 }, - }, - }, - out: false, + name: 'T', - range: [8, 18], + range: [7, 17], loc: { - start: { column: 8, line: 1 }, - end: { column: 18, line: 1 }, + start: { column: 7, line: 1 }, + end: { column: 17, line: 1 }, }, }, ], - range: [7, 19], + range: [6, 18], loc: { - start: { column: 7, line: 1 }, - end: { column: 19, line: 1 }, + start: { column: 6, line: 1 }, + end: { column: 18, line: 1 }, }, }, - range: [1, 22], + range: [1, 21], loc: { start: { column: 1, line: 1 }, - end: { column: 22, line: 1 }, + end: { column: 21, line: 1 }, }, }, - range: [0, 24], + range: [0, 23], loc: { start: { column: 0, line: 1 }, - end: { column: 24, line: 1 }, + end: { column: 23, line: 1 }, }, }, ], sourceType: 'script', - range: [0, 25], + range: [0, 24], loc: { start: { column: 0, line: 1 }, end: { column: 0, line: 2 }, diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-in-const-modifier-multiple/fixture.ts b/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-in-const-modifier-multiple/fixture.ts index 8dc6e2f6033f..256f473826bf 100644 --- a/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-in-const-modifier-multiple/fixture.ts +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-in-const-modifier-multiple/fixture.ts @@ -1 +1 @@ -interface L {} +interface L {} diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-in-const-modifier-multiple/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-in-const-modifier-multiple/snapshots/2-TSESTree-Tokens.shot index abc1c07187ed..ed7fba0e8d86 100644 --- a/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-in-const-modifier-multiple/snapshots/2-TSESTree-Tokens.shot +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-in-const-modifier-multiple/snapshots/2-TSESTree-Tokens.shot @@ -34,21 +34,21 @@ exports[`AST Fixtures special TSTypeParameter interface-in-const-modifier-multip }, Keyword { type: "Keyword", - value: "in", + value: "const", - range: [12, 14], + range: [12, 17], loc: { start: { column: 12, line: 1 }, - end: { column: 14, line: 1 }, + end: { column: 17, line: 1 }, }, }, Keyword { type: "Keyword", - value: "const", + value: "in", - range: [15, 20], + range: [18, 20], loc: { - start: { column: 15, line: 1 }, + start: { column: 18, line: 1 }, end: { column: 20, line: 1 }, }, }, diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-in-const-modifier-multiple/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-in-const-modifier-multiple/snapshots/4-Babel-Tokens.shot index b2701779685b..274070dae74e 100644 --- a/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-in-const-modifier-multiple/snapshots/4-Babel-Tokens.shot +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-in-const-modifier-multiple/snapshots/4-Babel-Tokens.shot @@ -34,21 +34,21 @@ exports[`AST Fixtures special TSTypeParameter interface-in-const-modifier-multip }, Keyword { type: "Keyword", - value: "in", + value: "const", - range: [12, 14], + range: [12, 17], loc: { start: { column: 12, line: 1 }, - end: { column: 14, line: 1 }, + end: { column: 17, line: 1 }, }, }, Keyword { type: "Keyword", - value: "const", + value: "in", - range: [15, 20], + range: [18, 20], loc: { - start: { column: 15, line: 1 }, + start: { column: 18, line: 1 }, end: { column: 20, line: 1 }, }, }, diff --git a/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-in-const-modifier-multiple/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-in-const-modifier-multiple/snapshots/6-AST-Alignment-Tokens.shot index 2968ea8bf5ea..4771009b4633 100644 --- a/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-in-const-modifier-multiple/snapshots/6-AST-Alignment-Tokens.shot +++ b/packages/ast-spec/src/special/TSTypeParameter/fixtures/interface-in-const-modifier-multiple/snapshots/6-AST-Alignment-Tokens.shot @@ -40,21 +40,21 @@ exports[`AST Fixtures special TSTypeParameter interface-in-const-modifier-multip }, Keyword { type: 'Keyword', - value: 'in', + value: 'const', - range: [12, 14], + range: [12, 17], loc: { start: { column: 12, line: 1 }, - end: { column: 14, line: 1 }, + end: { column: 17, line: 1 }, }, }, Keyword { type: 'Keyword', - value: 'const', + value: 'in', - range: [15, 20], + range: [18, 20], loc: { - start: { column: 15, line: 1 }, + start: { column: 18, line: 1 }, end: { column: 20, line: 1 }, }, }, diff --git a/packages/ast-spec/tests/fixtures-with-differences-ast.shot b/packages/ast-spec/tests/fixtures-with-differences-ast.shot index 25c67426f23f..d6c3ab00dc5d 100644 --- a/packages/ast-spec/tests/fixtures-with-differences-ast.shot +++ b/packages/ast-spec/tests/fixtures-with-differences-ast.shot @@ -27,13 +27,21 @@ exports[`AST Fixtures List fixtures with AST differences 1`] = ` "declaration/ExportDefaultDeclaration/fixtures/function/fixture.ts", "declaration/ExportDefaultDeclaration/fixtures/identifier/fixture.ts", "declaration/ExportDefaultDeclaration/fixtures/interface/fixture.ts", - "declaration/ExportNamedDeclaration/fixtures/aliased/fixture.ts", + "declaration/ExportNamedDeclaration/fixtures/braced-identifier-aliased-to-identifier-with-source/fixture.ts", + "declaration/ExportNamedDeclaration/fixtures/braced-identifier-aliased-to-identifier-without-source/fixture.ts", + "declaration/ExportNamedDeclaration/fixtures/braced-identifier-aliased-to-string-literal-with-source/fixture.ts", + "declaration/ExportNamedDeclaration/fixtures/braced-identifier-aliased-to-string-literal-without-source/fixture.ts", + "declaration/ExportNamedDeclaration/fixtures/braced-identifier-many-with-source/fixture.ts", + "declaration/ExportNamedDeclaration/fixtures/braced-identifier-many-without-source/fixture.ts", + "declaration/ExportNamedDeclaration/fixtures/braced-identifier-with-source/fixture.ts", + "declaration/ExportNamedDeclaration/fixtures/braced-identifier-without-source/fixture.ts", + "declaration/ExportNamedDeclaration/fixtures/braced-string-literal-aliased-to-identifier-with-source/fixture.ts", + "declaration/ExportNamedDeclaration/fixtures/braced-string-literal-many-with-source/fixture.ts", + "declaration/ExportNamedDeclaration/fixtures/braced-string-literal-with-source/fixture.ts", "declaration/ExportNamedDeclaration/fixtures/class/fixture.ts", "declaration/ExportNamedDeclaration/fixtures/declare-function/fixture.ts", "declaration/ExportNamedDeclaration/fixtures/enum/fixture.ts", "declaration/ExportNamedDeclaration/fixtures/function-declaration/fixture.ts", - "declaration/ExportNamedDeclaration/fixtures/identifier-braced/fixture.ts", - "declaration/ExportNamedDeclaration/fixtures/identifier-many/fixture.ts", "declaration/ExportNamedDeclaration/fixtures/interface/fixture.ts", "declaration/ExportNamedDeclaration/fixtures/namespace/fixture.ts", "declaration/ExportNamedDeclaration/fixtures/type-alias/fixture.ts", @@ -55,6 +63,7 @@ exports[`AST Fixtures List fixtures with AST differences 1`] = ` "declaration/ImportDeclaration/fixtures/named-many/fixture.ts", "declaration/ImportDeclaration/fixtures/named-none/fixture.ts", "declaration/ImportDeclaration/fixtures/named-one/fixture.ts", + "declaration/ImportDeclaration/fixtures/named-string-literal-aliased-to-identifier/fixture.ts", "declaration/ImportDeclaration/fixtures/side-effect/fixture.ts", "declaration/TSDeclareFunction/fixtures/async-ambient/fixture.ts", "declaration/TSDeclareFunction/fixtures/async-overload/fixture.ts", @@ -347,8 +356,6 @@ exports[`AST Fixtures List fixtures with AST differences 1`] = ` "legacy-fixtures/basics/fixtures/type-guard-in-method/fixture.ts", "legacy-fixtures/basics/fixtures/type-import-type-with-type-parameters-in-type-reference/fixture.ts", "legacy-fixtures/basics/fixtures/type-import-type/fixture.ts", - "legacy-fixtures/basics/fixtures/type-only-export-specifiers/fixture.ts", - "legacy-fixtures/basics/fixtures/type-only-import-specifiers/fixture.ts", "legacy-fixtures/basics/fixtures/type-parameters-comments-heritage/fixture.ts", "legacy-fixtures/basics/fixtures/type-parameters-comments/fixture.ts", "legacy-fixtures/basics/fixtures/type-reference-comments/fixture.ts", @@ -481,6 +488,11 @@ exports[`AST Fixtures List fixtures with AST differences 1`] = ` "legacy-fixtures/types/fixtures/union-type/fixture.ts", "special/Decorator/fixtures/decorator-class-member-super-with-parens/fixture.ts", "special/Decorator/fixtures/decorator-class-member-super-without-parens/fixture.ts", + "special/ExportSpecifier/fixtures/literal-specifier/fixture.ts", + "special/ExportSpecifier/fixtures/type-only-export-specifiers/fixture.ts", + "special/ExportSpecifier/fixtures/value-export-specifier/fixture.ts", + "special/ImportSpecifier/fixtures/type-only-import-specifier/fixture.ts", + "special/ImportSpecifier/fixtures/type-only-import-specifiers/fixture.ts", "special/TSTypeParameter/fixtures/arrow-const-modifier-extends/fixture.ts", "special/TSTypeParameter/fixtures/arrow-const-modifier/fixture.ts", "special/TSTypeParameter/fixtures/class-decl-const-in-modifier/fixture.ts", diff --git a/packages/ast-spec/tests/fixtures-with-differences-errors.shot b/packages/ast-spec/tests/fixtures-with-differences-errors.shot index a641afd174c2..505d0a51a3e3 100644 --- a/packages/ast-spec/tests/fixtures-with-differences-errors.shot +++ b/packages/ast-spec/tests/fixtures-with-differences-errors.shot @@ -51,8 +51,6 @@ exports[`AST Fixtures List fixtures with Error differences 1`] = ` "legacy-fixtures/parameter-decorators/fixtures/_error_/parameter-rest-element-decorator/fixture.ts", ], "TSESTree errored but Babel didn't": [ - "declaration/ExportAllDeclaration/fixtures/_error_/named-non-identifier/fixture.ts", - "declaration/ExportNamedDeclaration/fixtures/_error_/aliased-literal/fixture.ts", "declaration/TSDeclareFunction/fixtures/_error_/generator-ambient/fixture.ts", "declaration/TSDeclareFunction/fixtures/_error_/generator-overload/fixture.ts", "declaration/TSDeclareFunction/fixtures/_error_/generator/fixture.ts", diff --git a/packages/eslint-plugin/src/rules/consistent-type-exports.ts b/packages/eslint-plugin/src/rules/consistent-type-exports.ts index 4acd22ecf746..eb610ae84105 100644 --- a/packages/eslint-plugin/src/rules/consistent-type-exports.ts +++ b/packages/eslint-plugin/src/rules/consistent-type-exports.ts @@ -277,8 +277,10 @@ export default createRule({ } // We have both type and value violations. - const allExportNames = report.typeBasedSpecifiers.map( - specifier => specifier.local.name, + const allExportNames = report.typeBasedSpecifiers.map(specifier => + specifier.local.type === AST_NODE_TYPES.Identifier + ? specifier.local.name + : specifier.local.value, ); if (allExportNames.length === 1) { @@ -446,9 +448,16 @@ function getSourceFromExport( * the proper formatting. */ function getSpecifierText(specifier: TSESTree.ExportSpecifier): string { - return `${specifier.local.name}${ - specifier.exported.name !== specifier.local.name - ? ` as ${specifier.exported.name}` - : '' + const exportedName = + specifier.exported.type === AST_NODE_TYPES.Literal + ? specifier.exported.raw + : specifier.exported.name; + const localName = + specifier.local.type === AST_NODE_TYPES.Literal + ? specifier.local.raw + : specifier.local.name; + + return `${localName}${ + exportedName !== localName ? ` as ${exportedName}` : '' }`; } diff --git a/packages/eslint-plugin/src/rules/explicit-module-boundary-types.ts b/packages/eslint-plugin/src/rules/explicit-module-boundary-types.ts index ee8f691b7695..add712099646 100644 --- a/packages/eslint-plugin/src/rules/explicit-module-boundary-types.ts +++ b/packages/eslint-plugin/src/rules/explicit-module-boundary-types.ts @@ -148,7 +148,7 @@ export default createRule({ checkNode(node.declaration); }, 'ExportNamedDeclaration:not([source]):exit'( - node: TSESTree.ExportNamedDeclaration, + node: TSESTree.ExportNamedDeclarationWithoutSource, ): void { if (node.declaration) { checkNode(node.declaration); diff --git a/packages/eslint-plugin/src/rules/naming-convention.ts b/packages/eslint-plugin/src/rules/naming-convention.ts index 6363210b12e5..736bfdadc407 100644 --- a/packages/eslint-plugin/src/rules/naming-convention.ts +++ b/packages/eslint-plugin/src/rules/naming-convention.ts @@ -296,7 +296,10 @@ export default createRule({ break; case AST_NODE_TYPES.ImportSpecifier: // Handle `import { default as Foo }` - if (node.imported.name !== 'default') { + if ( + node.imported.type === AST_NODE_TYPES.Identifier && + node.imported.name !== 'default' + ) { return; } modifiers.add(Modifiers.default); diff --git a/packages/eslint-plugin/src/rules/no-unsafe-argument.ts b/packages/eslint-plugin/src/rules/no-unsafe-argument.ts index f89a7ddcec88..60a3e01a9d51 100644 --- a/packages/eslint-plugin/src/rules/no-unsafe-argument.ts +++ b/packages/eslint-plugin/src/rules/no-unsafe-argument.ts @@ -1,8 +1,8 @@ import type { TSESTree } from '@typescript-eslint/utils'; -import type * as ts from 'typescript'; import { AST_NODE_TYPES } from '@typescript-eslint/utils'; import * as tsutils from 'ts-api-utils'; +import * as ts from 'typescript'; import { createRule, @@ -270,7 +270,9 @@ export default createRule<[], MessageIds>({ }); } } - if (spreadArgType.target.hasRestElement) { + if ( + spreadArgType.target.combinedFlags & ts.ElementFlags.Variable + ) { // the last element was a rest - so all remaining defined arguments can be considered "consumed" // all remaining arguments should be compared against the rest type (if one exists) signature.consumeRemainingArguments(); diff --git a/packages/eslint-plugin/tests/rules/consistent-type-exports.test.ts b/packages/eslint-plugin/tests/rules/consistent-type-exports.test.ts index 880f4441047a..8508cd75ae77 100644 --- a/packages/eslint-plugin/tests/rules/consistent-type-exports.test.ts +++ b/packages/eslint-plugin/tests/rules/consistent-type-exports.test.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/internal/plugin-test-formatting -- Prettier doesn't yet support TS 5.6 string literal module identifiers */ import { noFormat, RuleTester } from '@typescript-eslint/rule-tester'; import rule from '../../src/rules/consistent-type-exports'; @@ -21,6 +22,7 @@ ruleTester.run('consistent-type-exports', rule, { "export type { Type1 } from './consistent-type-exports';", "export { value1 } from './consistent-type-exports';", + 'export { value1 as "🍎" } from \'./consistent-type-exports\';', "export type { value1 } from './consistent-type-exports';", ` const variable = 1; @@ -75,6 +77,18 @@ export { NonTypeNS }; ], output: "export type { Type1 } from './consistent-type-exports';", }, + { + code: 'export { Type1 as "🍎" } from \'./consistent-type-exports\';', + errors: [ + { + column: 1, + line: 1, + messageId: 'typeOverValue', + }, + ], + output: + 'export type { Type1 as "🍎" } from \'./consistent-type-exports\';', + }, { code: "export { Type1, value1 } from './consistent-type-exports';", 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 520e186a97c6..c43b293c686e 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 @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/internal/plugin-test-formatting -- Prettier doesn't yet support TS 5.6 string literal module identifiers */ /* eslint-disable @typescript-eslint/internal/prefer-ast-types-enum */ import { noFormat, RuleTester } from '@typescript-eslint/rule-tester'; @@ -1280,6 +1281,26 @@ ruleTester.run('naming-convention', rule, { }, ], }, + { + code: 'import { "🍎" as foo } from \'foo_bar\';', + errors: [ + { + data: { + formats: 'PascalCase', + name: 'foo', + type: 'Import', + }, + messageId: 'doesNotMatchFormat', + }, + ], + languageOptions: { parserOptions }, + options: [ + { + format: ['PascalCase'], + selector: ['import'], + }, + ], + }, ], valid: [ { @@ -2260,5 +2281,15 @@ ruleTester.run('naming-convention', rule, { }, ], }, + { + code: 'import { "🍎" as Foo } from \'foo_bar\';', + languageOptions: { parserOptions }, + options: [ + { + format: ['PascalCase'], + selector: ['import'], + }, + ], + }, ], }); diff --git a/packages/parser/src/parser.ts b/packages/parser/src/parser.ts index 6651a09183ae..42f938e980a2 100644 --- a/packages/parser/src/parser.ts +++ b/packages/parser/src/parser.ts @@ -69,6 +69,8 @@ function getLib(compilerOptions: ts.CompilerOptions): Lib[] { return ['es2021.full']; case ScriptTarget.ES2022: return ['es2022.full']; + case ScriptTarget.ES2023: + return ['es2023.full']; case ScriptTarget.ESNext: return ['esnext.full']; default: diff --git a/packages/scope-manager/package.json b/packages/scope-manager/package.json index 977525271531..71f5e5e2b79a 100644 --- a/packages/scope-manager/package.json +++ b/packages/scope-manager/package.json @@ -56,6 +56,7 @@ "glob": "*", "jest-specific-snapshot": "*", "make-dir": "*", + "prettier": "^3.2.5", "pretty-format": "*", "typescript": "*" }, diff --git a/packages/scope-manager/src/lib/dom.asynciterable.ts b/packages/scope-manager/src/lib/dom.asynciterable.ts index f552b6216662..761d03534d1f 100644 --- a/packages/scope-manager/src/lib/dom.asynciterable.ts +++ b/packages/scope-manager/src/lib/dom.asynciterable.ts @@ -9,5 +9,7 @@ import { TYPE } from './base-config'; export const dom_asynciterable = { FileSystemDirectoryHandle: TYPE, + FileSystemDirectoryHandleAsyncIterator: TYPE, ReadableStream: TYPE, + ReadableStreamAsyncIterator: TYPE, } as Record; diff --git a/packages/scope-manager/src/lib/dom.iterable.ts b/packages/scope-manager/src/lib/dom.iterable.ts index c8c7d40d7b71..74b45f7e08c8 100644 --- a/packages/scope-manager/src/lib/dom.iterable.ts +++ b/packages/scope-manager/src/lib/dom.iterable.ts @@ -30,7 +30,9 @@ export const dom_iterable = { FileList: TYPE, FontFaceSet: TYPE, FormData: TYPE, + FormDataIterator: TYPE, Headers: TYPE, + HeadersIterator: TYPE, Highlight: TYPE, HighlightRegistry: TYPE, HTMLAllCollection: TYPE, @@ -41,6 +43,7 @@ export const dom_iterable = { IDBDatabase: TYPE, IDBObjectStore: TYPE, MediaKeyStatusMap: TYPE, + MediaKeyStatusMapIterator: TYPE, MediaList: TYPE, MessageEvent: TYPE, MIDIInputMap: TYPE, @@ -59,6 +62,7 @@ export const dom_iterable = { SpeechRecognitionResult: TYPE, SpeechRecognitionResultList: TYPE, StylePropertyMapReadOnly: TYPE, + StylePropertyMapReadOnlyIterator: TYPE, StyleSheetList: TYPE, SubtleCrypto: TYPE, SVGLengthList: TYPE, @@ -70,6 +74,7 @@ export const dom_iterable = { TextTrackList: TYPE, TouchList: TYPE, URLSearchParams: TYPE, + URLSearchParamsIterator: TYPE, WEBGL_draw_buffers: TYPE, WEBGL_multi_draw: TYPE, WebGL2RenderingContextBase: TYPE, diff --git a/packages/scope-manager/src/lib/dom.ts b/packages/scope-manager/src/lib/dom.ts index d74830343eaf..c4bad4cc89aa 100644 --- a/packages/scope-manager/src/lib/dom.ts +++ b/packages/scope-manager/src/lib/dom.ts @@ -444,6 +444,7 @@ export const dom = { GeolocationPosition: TYPE_VALUE, GeolocationPositionError: TYPE_VALUE, GetAnimationsOptions: TYPE, + GetHTMLOptions: TYPE, GetNotificationOptions: TYPE, GetRootNodeOptions: TYPE, GLbitfield: TYPE, @@ -608,7 +609,6 @@ export const dom = { ImageOrientation: TYPE, ImageSmoothingQuality: TYPE, ImportMeta: TYPE, - InnerHTML: TYPE, InputDeviceInfo: TYPE_VALUE, InputEvent: TYPE_VALUE, InputEventInit: TYPE, @@ -675,6 +675,7 @@ export const dom = { MediaKeySessionClosedReason: TYPE, MediaKeySessionEventMap: TYPE, MediaKeySessionType: TYPE, + MediaKeysPolicy: TYPE, MediaKeysRequirement: TYPE, MediaKeyStatus: TYPE, MediaKeyStatusMap: TYPE_VALUE, @@ -700,6 +701,7 @@ export const dom = { MediaSessionPlaybackState: TYPE, MediaSource: TYPE_VALUE, MediaSourceEventMap: TYPE, + MediaSourceHandle: TYPE_VALUE, MediaStream: TYPE_VALUE, MediaStreamAudioDestinationNode: TYPE_VALUE, MediaStreamAudioSourceNode: TYPE_VALUE, @@ -875,6 +877,7 @@ export const dom = { PluginArray: TYPE_VALUE, PointerEvent: TYPE_VALUE, PointerEventInit: TYPE, + PointerLockOptions: TYPE, PopoverInvokerElement: TYPE, PopStateEvent: TYPE_VALUE, PopStateEventInit: TYPE, @@ -1037,7 +1040,6 @@ export const dom = { RTCRtcpParameters: TYPE, RTCRtpCapabilities: TYPE, RTCRtpCodec: TYPE, - RTCRtpCodecCapability: TYPE, RTCRtpCodecParameters: TYPE, RTCRtpCodingParameters: TYPE, RTCRtpContributingSource: TYPE, @@ -1259,6 +1261,7 @@ export const dom = { TextEncoderCommon: TYPE, TextEncoderEncodeIntoResult: TYPE, TextEncoderStream: TYPE_VALUE, + TextEvent: TYPE_VALUE, TextMetrics: TYPE_VALUE, TextTrack: TYPE_VALUE, TextTrackCue: TYPE_VALUE, @@ -1307,6 +1310,7 @@ export const dom = { UnderlyingSourceCancelCallback: TYPE, UnderlyingSourcePullCallback: TYPE, UnderlyingSourceStartCallback: TYPE, + UpdateCallback: TYPE, URL: TYPE_VALUE, URLSearchParams: TYPE_VALUE, UserActivation: TYPE_VALUE, @@ -1342,6 +1346,7 @@ export const dom = { VideoPixelFormat: TYPE, VideoPlaybackQuality: TYPE_VALUE, VideoTransferCharacteristics: TYPE, + ViewTransition: TYPE_VALUE, VisualViewport: TYPE_VALUE, VisualViewportEventMap: TYPE, VoidFunction: TYPE, diff --git a/packages/scope-manager/src/lib/es2015.iterable.ts b/packages/scope-manager/src/lib/es2015.iterable.ts index 0e16e6de70ee..9d90baccf6b0 100644 --- a/packages/scope-manager/src/lib/es2015.iterable.ts +++ b/packages/scope-manager/src/lib/es2015.iterable.ts @@ -12,6 +12,8 @@ export const es2015_iterable = { ...es2015_symbol, Array: TYPE, ArrayConstructor: TYPE, + ArrayIterator: TYPE, + BuiltinIteratorReturn: TYPE, Float32Array: TYPE, Float32ArrayConstructor: TYPE, Float64Array: TYPE, @@ -26,11 +28,13 @@ export const es2015_iterable = { Iterable: TYPE, IterableIterator: TYPE, Iterator: TYPE, + IteratorObject: TYPE, IteratorResult: TYPE, IteratorReturnResult: TYPE, IteratorYieldResult: TYPE, Map: TYPE, MapConstructor: TYPE, + MapIterator: TYPE, Promise: TYPE, PromiseConstructor: TYPE, ReadonlyArray: TYPE, @@ -38,7 +42,9 @@ export const es2015_iterable = { ReadonlySet: TYPE, Set: TYPE, SetConstructor: TYPE, + SetIterator: TYPE, String: TYPE, + StringIterator: TYPE, SymbolConstructor: TYPE, Uint16Array: TYPE, Uint16ArrayConstructor: TYPE, diff --git a/packages/scope-manager/src/lib/es2018.asynciterable.ts b/packages/scope-manager/src/lib/es2018.asynciterable.ts index be699549e4be..fc4be3a897fe 100644 --- a/packages/scope-manager/src/lib/es2018.asynciterable.ts +++ b/packages/scope-manager/src/lib/es2018.asynciterable.ts @@ -15,5 +15,6 @@ export const es2018_asynciterable = { AsyncIterable: TYPE, AsyncIterableIterator: TYPE, AsyncIterator: TYPE, + AsyncIteratorObject: TYPE, SymbolConstructor: TYPE, } as Record; diff --git a/packages/scope-manager/src/lib/es2020.string.ts b/packages/scope-manager/src/lib/es2020.string.ts index 1200f5ec93ea..5fac2e71e077 100644 --- a/packages/scope-manager/src/lib/es2020.string.ts +++ b/packages/scope-manager/src/lib/es2020.string.ts @@ -6,9 +6,9 @@ import type { ImplicitLibVariableOptions } from '../variable'; import { TYPE } from './base-config'; -import { es2015_iterable } from './es2015.iterable'; +import { es2020_symbol_wellknown } from './es2020.symbol.wellknown'; export const es2020_string = { - ...es2015_iterable, + ...es2020_symbol_wellknown, String: TYPE, } as Record; diff --git a/packages/scope-manager/src/lib/es2020.symbol.wellknown.ts b/packages/scope-manager/src/lib/es2020.symbol.wellknown.ts index 733a9bb91f77..15fc777dcbb9 100644 --- a/packages/scope-manager/src/lib/es2020.symbol.wellknown.ts +++ b/packages/scope-manager/src/lib/es2020.symbol.wellknown.ts @@ -13,5 +13,6 @@ export const es2020_symbol_wellknown = { ...es2015_iterable, ...es2015_symbol, RegExp: TYPE, + RegExpStringIterator: TYPE, SymbolConstructor: TYPE, } as Record; diff --git a/packages/scope-manager/src/lib/esnext.asynciterable.ts b/packages/scope-manager/src/lib/esnext.asynciterable.ts index 27eff6b90faa..137b63ece500 100644 --- a/packages/scope-manager/src/lib/esnext.asynciterable.ts +++ b/packages/scope-manager/src/lib/esnext.asynciterable.ts @@ -15,5 +15,6 @@ export const esnext_asynciterable = { AsyncIterable: TYPE, AsyncIterableIterator: TYPE, AsyncIterator: TYPE, + AsyncIteratorObject: TYPE, SymbolConstructor: TYPE, } as Record; diff --git a/packages/scope-manager/src/lib/esnext.disposable.ts b/packages/scope-manager/src/lib/esnext.disposable.ts index 35dbb3d6a4a4..cfb4363d0230 100644 --- a/packages/scope-manager/src/lib/esnext.disposable.ts +++ b/packages/scope-manager/src/lib/esnext.disposable.ts @@ -6,16 +6,22 @@ import type { ImplicitLibVariableOptions } from '../variable'; import { TYPE, TYPE_VALUE } from './base-config'; +import { es2015_iterable } from './es2015.iterable'; import { es2015_symbol } from './es2015.symbol'; +import { es2018_asynciterable } from './es2018.asynciterable'; export const esnext_disposable = { ...es2015_symbol, + ...es2015_iterable, + ...es2018_asynciterable, AsyncDisposable: TYPE, AsyncDisposableStack: TYPE_VALUE, AsyncDisposableStackConstructor: TYPE, + AsyncIteratorObject: TYPE, Disposable: TYPE, DisposableStack: TYPE_VALUE, DisposableStackConstructor: TYPE, + IteratorObject: TYPE, SuppressedError: TYPE_VALUE, SuppressedErrorConstructor: TYPE, SymbolConstructor: TYPE, diff --git a/packages/scope-manager/src/lib/esnext.iterator.ts b/packages/scope-manager/src/lib/esnext.iterator.ts new file mode 100644 index 000000000000..daf2305ebcb9 --- /dev/null +++ b/packages/scope-manager/src/lib/esnext.iterator.ts @@ -0,0 +1,15 @@ +// THIS CODE WAS AUTOMATICALLY GENERATED +// DO NOT EDIT THIS CODE BY HAND +// RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: +// npx nx generate-lib repo + +import type { ImplicitLibVariableOptions } from '../variable'; + +import { TYPE, TYPE_VALUE } from './base-config'; +import { es2015_iterable } from './es2015.iterable'; + +export const esnext_iterator = { + ...es2015_iterable, + Iterator: TYPE_VALUE, + IteratorObjectConstructor: TYPE, +} as Record; diff --git a/packages/scope-manager/src/lib/esnext.ts b/packages/scope-manager/src/lib/esnext.ts index fd5469c6d89f..c3e76d8bd05d 100644 --- a/packages/scope-manager/src/lib/esnext.ts +++ b/packages/scope-manager/src/lib/esnext.ts @@ -11,6 +11,7 @@ import { esnext_collection } from './esnext.collection'; import { esnext_decorators } from './esnext.decorators'; import { esnext_disposable } from './esnext.disposable'; import { esnext_intl } from './esnext.intl'; +import { esnext_iterator } from './esnext.iterator'; import { esnext_object } from './esnext.object'; import { esnext_promise } from './esnext.promise'; import { esnext_regexp } from './esnext.regexp'; @@ -27,4 +28,5 @@ export const esnext = { ...esnext_array, ...esnext_regexp, ...esnext_string, + ...esnext_iterator, } as Record; diff --git a/packages/scope-manager/src/lib/index.ts b/packages/scope-manager/src/lib/index.ts index 8ab8957b136f..181042154bc1 100644 --- a/packages/scope-manager/src/lib/index.ts +++ b/packages/scope-manager/src/lib/index.ts @@ -86,6 +86,7 @@ import { esnext_decorators } from './esnext.decorators'; import { esnext_disposable } from './esnext.disposable'; import { esnext_full } from './esnext.full'; import { esnext_intl } from './esnext.intl'; +import { esnext_iterator } from './esnext.iterator'; import { esnext_object } from './esnext.object'; import { esnext_promise } from './esnext.promise'; import { esnext_regexp } from './esnext.regexp'; @@ -183,6 +184,7 @@ const lib = { 'esnext.disposable': esnext_disposable, 'esnext.full': esnext_full, 'esnext.intl': esnext_intl, + 'esnext.iterator': esnext_iterator, 'esnext.object': esnext_object, 'esnext.promise': esnext_promise, 'esnext.regexp': esnext_regexp, diff --git a/packages/scope-manager/src/lib/webworker.asynciterable.ts b/packages/scope-manager/src/lib/webworker.asynciterable.ts index 3323c31620d3..bb74df8c9762 100644 --- a/packages/scope-manager/src/lib/webworker.asynciterable.ts +++ b/packages/scope-manager/src/lib/webworker.asynciterable.ts @@ -9,5 +9,7 @@ import { TYPE } from './base-config'; export const webworker_asynciterable = { FileSystemDirectoryHandle: TYPE, + FileSystemDirectoryHandleAsyncIterator: TYPE, ReadableStream: TYPE, + ReadableStreamAsyncIterator: TYPE, } as Record; diff --git a/packages/scope-manager/src/lib/webworker.iterable.ts b/packages/scope-manager/src/lib/webworker.iterable.ts index aa39f5181f16..20d889c162a7 100644 --- a/packages/scope-manager/src/lib/webworker.iterable.ts +++ b/packages/scope-manager/src/lib/webworker.iterable.ts @@ -19,13 +19,17 @@ export const webworker_iterable = { FileList: TYPE, FontFaceSet: TYPE, FormData: TYPE, + FormDataIterator: TYPE, Headers: TYPE, + HeadersIterator: TYPE, IDBDatabase: TYPE, IDBObjectStore: TYPE, MessageEvent: TYPE, StylePropertyMapReadOnly: TYPE, + StylePropertyMapReadOnlyIterator: TYPE, SubtleCrypto: TYPE, URLSearchParams: TYPE, + URLSearchParamsIterator: TYPE, WEBGL_draw_buffers: TYPE, WEBGL_multi_draw: TYPE, WebGL2RenderingContextBase: TYPE, diff --git a/packages/scope-manager/src/lib/webworker.ts b/packages/scope-manager/src/lib/webworker.ts index fb546c3004b9..6fd3903f3eeb 100644 --- a/packages/scope-manager/src/lib/webworker.ts +++ b/packages/scope-manager/src/lib/webworker.ts @@ -299,6 +299,9 @@ export const webworker = { MediaDecodingType: TYPE, MediaEncodingConfiguration: TYPE, MediaEncodingType: TYPE, + MediaSourceHandle: TYPE_VALUE, + MediaStreamTrackProcessor: TYPE_VALUE, + MediaStreamTrackProcessorInit: TYPE, MessageChannel: TYPE_VALUE, MessageEvent: TYPE_VALUE, MessageEventInit: TYPE, diff --git a/packages/scope-manager/src/referencer/ExportVisitor.ts b/packages/scope-manager/src/referencer/ExportVisitor.ts index f45fa8a213d1..723c4b0aab78 100644 --- a/packages/scope-manager/src/referencer/ExportVisitor.ts +++ b/packages/scope-manager/src/referencer/ExportVisitor.ts @@ -60,7 +60,10 @@ class ExportVisitor extends Visitor { } protected ExportSpecifier(node: TSESTree.ExportSpecifier): void { - if (node.exportKind === 'type') { + if ( + node.exportKind === 'type' && + node.local.type === AST_NODE_TYPES.Identifier + ) { // export { type T }; // type exports can only reference types // diff --git a/packages/scope-manager/tests/fixtures/jsx/namespaced-attribute.tsx b/packages/scope-manager/tests/fixtures/jsx/namespaced-attribute.tsx index b42f48eaefdb..a94dae741c41 100644 --- a/packages/scope-manager/tests/fixtures/jsx/namespaced-attribute.tsx +++ b/packages/scope-manager/tests/fixtures/jsx/namespaced-attribute.tsx @@ -1,13 +1,13 @@ -import * as React from "react"; +import * as React from 'react'; // Both of these are equivalent: const x = ; -const y = ; +const y = ; interface FooProps { - "a:b": string; + 'a:b': string; } function Foo(props: FooProps) { - return
{props["a:b"]}
; + return
{props['a:b']}
; } diff --git a/packages/types/src/lib.ts b/packages/types/src/lib.ts index 71c8f4334917..70690101ed96 100644 --- a/packages/types/src/lib.ts +++ b/packages/types/src/lib.ts @@ -87,6 +87,7 @@ type Lib = | 'esnext.disposable' | 'esnext.full' | 'esnext.intl' + | 'esnext.iterator' | 'esnext.object' | 'esnext.promise' | 'esnext.regexp' diff --git a/packages/types/src/ts-estree.ts b/packages/types/src/ts-estree.ts index 9656ea011dc7..4914055b1992 100644 --- a/packages/types/src/ts-estree.ts +++ b/packages/types/src/ts-estree.ts @@ -19,32 +19,28 @@ declare module './generated/ast-spec' { interface AccessorPropertyNonComputedName { parent: TSESTree.ClassBody; } + interface TSAbstractAccessorPropertyComputedName { + parent: TSESTree.ClassBody; + } + interface TSAbstractAccessorPropertyNonComputedName { + parent: TSESTree.ClassBody; + } interface VariableDeclaratorDefiniteAssignment { parent: TSESTree.VariableDeclaration; } - interface VariableDeclaratorMaybeInit { parent: TSESTree.VariableDeclaration; } - interface VariableDeclaratorNoInit { parent: TSESTree.VariableDeclaration; } - interface UsingInForOfDeclarator { parent: TSESTree.VariableDeclaration; } - interface UsingInNormalContextDeclarator { parent: TSESTree.VariableDeclaration; } - interface TSAbstractAccessorPropertyComputedName { - parent: TSESTree.ClassBody; - } - interface TSAbstractAccessorPropertyNonComputedName { - parent: TSESTree.ClassBody; - } interface CatchClause { parent: TSESTree.TryStatement; @@ -54,10 +50,6 @@ declare module './generated/ast-spec' { parent: TSESTree.ClassDeclaration | TSESTree.ClassExpression; } - interface ExportSpecifier { - parent: TSESTree.ExportNamedDeclaration; - } - interface ImportAttribute { parent: TSESTree.ImportDeclaration | TSESTree.ImportExpression; } @@ -220,6 +212,13 @@ declare module './generated/ast-spec' { | TSESTree.TSMappedType | TSESTree.TSTypeParameterDeclaration; } + + interface ExportSpecifierWithIdentifierLocal { + parent: TSESTree.ExportNamedDeclaration; + } + interface ExportSpecifierWithStringOrLiteralLocal { + parent: TSESTree.ExportNamedDeclaration; + } } export * as TSESTree from './generated/ast-spec'; diff --git a/packages/typescript-estree/src/convert.ts b/packages/typescript-estree/src/convert.ts index 26b22ad2aa74..5cb94c19e77e 100644 --- a/packages/typescript-estree/src/convert.ts +++ b/packages/typescript-estree/src/convert.ts @@ -2029,7 +2029,7 @@ export class Converter { type: AST_NODE_TYPES.ExportNamedDeclaration, source: this.convertChild(node.moduleSpecifier), specifiers: node.exportClause.elements.map(el => - this.convertChild(el), + this.convertChild(el, node), ), exportKind: node.isTypeOnly ? 'type' : 'value', declaration: null, @@ -2068,13 +2068,25 @@ export class Converter { ); } - case SyntaxKind.ExportSpecifier: + case SyntaxKind.ExportSpecifier: { + const local = node.propertyName ?? node.name; + if ( + local.kind === SyntaxKind.StringLiteral && + parent.kind === SyntaxKind.ExportDeclaration && + parent.moduleSpecifier?.kind !== SyntaxKind.StringLiteral + ) { + this.#throwError( + local, + 'A string literal cannot be used as a local exported binding without `from`.', + ); + } return this.createNode(node, { type: AST_NODE_TYPES.ExportSpecifier, - local: this.convertChild(node.propertyName ?? node.name), + local: this.convertChild(local), exported: this.convertChild(node.name), exportKind: node.isTypeOnly ? 'type' : 'value', }); + } case SyntaxKind.ExportAssignment: if (node.isExportEquals) { diff --git a/packages/typescript-estree/src/parseSettings/warnAboutTSVersion.ts b/packages/typescript-estree/src/parseSettings/warnAboutTSVersion.ts index c338c538bfec..3370da55be1b 100644 --- a/packages/typescript-estree/src/parseSettings/warnAboutTSVersion.ts +++ b/packages/typescript-estree/src/parseSettings/warnAboutTSVersion.ts @@ -6,7 +6,7 @@ import type { ParseSettings } from './index'; /** * This needs to be kept in sync with package.json in the typescript-eslint monorepo */ -const SUPPORTED_TYPESCRIPT_VERSIONS = '>=4.7.4 <5.6.0'; +const SUPPORTED_TYPESCRIPT_VERSIONS = '>=4.7.4 <5.7.0'; /* * The semver package will ignore prerelease ranges, and we don't want to explicitly document every one diff --git a/yarn.lock b/yarn.lock index 553065d9ab9a..797c02a5cd27 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3884,28 +3884,28 @@ __metadata: languageName: node linkType: hard -"@microsoft/api-extractor-model@npm:7.29.2": - version: 7.29.2 - resolution: "@microsoft/api-extractor-model@npm:7.29.2" +"@microsoft/api-extractor-model@npm:7.29.8": + version: 7.29.8 + resolution: "@microsoft/api-extractor-model@npm:7.29.8" dependencies: "@microsoft/tsdoc": ~0.15.0 "@microsoft/tsdoc-config": ~0.17.0 - "@rushstack/node-core-library": 5.4.1 - checksum: 71809004996b532f02f57b3d1191adeb08fa961d1f916ebbdc6eca2c29756278b2d08c40904d8e8e700af91699b36a062fba082ee61c72209c9a6e9b4aa3c9e9 + "@rushstack/node-core-library": 5.9.0 + checksum: 95a6b5df089d8bf44555f4565a6f0eda9323917266b2f4730b606aeb2c7f36df7c2cbcae9ca48a9198af7a33442cda8ce2c791e0f4c7c92f3bdaee6c3190b1f5 languageName: node linkType: hard -"@microsoft/api-extractor@npm:^7.43.0": - version: 7.47.0 - resolution: "@microsoft/api-extractor@npm:7.47.0" +"@microsoft/api-extractor@npm:^7.47.11": + version: 7.47.11 + resolution: "@microsoft/api-extractor@npm:7.47.11" dependencies: - "@microsoft/api-extractor-model": 7.29.2 + "@microsoft/api-extractor-model": 7.29.8 "@microsoft/tsdoc": ~0.15.0 "@microsoft/tsdoc-config": ~0.17.0 - "@rushstack/node-core-library": 5.4.1 - "@rushstack/rig-package": 0.5.2 - "@rushstack/terminal": 0.13.0 - "@rushstack/ts-command-line": 4.22.0 + "@rushstack/node-core-library": 5.9.0 + "@rushstack/rig-package": 0.5.3 + "@rushstack/terminal": 0.14.2 + "@rushstack/ts-command-line": 4.23.0 lodash: ~4.17.15 minimatch: ~3.0.3 resolve: ~1.22.1 @@ -3914,7 +3914,7 @@ __metadata: typescript: 5.4.2 bin: api-extractor: bin/api-extractor - checksum: 7db5ad493ce6ee4739a1d9ed36a503aaf6355e062a01eaaa7151073a3967b6e807a19b0279553d492956be68af35b0a7b76b9179d2dd25f43df3bea982ce30be + checksum: 1ae7634c21e20fe191b5297a03b87547b03e9db4ee3439809363e554bcc7610ebd43dd71d30db5fbee573b7f84a2e1fa6ab3bdf320500a266b7c7c1ccc6049b2 languageName: node linkType: hard @@ -4473,9 +4473,9 @@ __metadata: languageName: node linkType: hard -"@rushstack/node-core-library@npm:5.4.1": - version: 5.4.1 - resolution: "@rushstack/node-core-library@npm:5.4.1" +"@rushstack/node-core-library@npm:5.9.0": + version: 5.9.0 + resolution: "@rushstack/node-core-library@npm:5.9.0" dependencies: ajv: ~8.13.0 ajv-draft-04: ~1.0.0 @@ -4490,44 +4490,44 @@ __metadata: peerDependenciesMeta: "@types/node": optional: true - checksum: 1316dcec7056a8c16a967284c82f09f6e55bd77c8944a5c10576d2c8e41708f6b43194d853a2f84a769d843acd84346b616e792a1c9bc2cad59c608f1601335e + checksum: beb558f118a796260f7df38b48b6669a94bbdb9711715785e0c5a426bd3a38c14721c03fc05e7a33883ec25a331ef0fb9e36438bb451ace021a7248a4f1fc74b languageName: node linkType: hard -"@rushstack/rig-package@npm:0.5.2": - version: 0.5.2 - resolution: "@rushstack/rig-package@npm:0.5.2" +"@rushstack/rig-package@npm:0.5.3": + version: 0.5.3 + resolution: "@rushstack/rig-package@npm:0.5.3" dependencies: resolve: ~1.22.1 strip-json-comments: ~3.1.1 - checksum: cdfbca218d85f0daf865b308a8f1ad572835e465b64a2efa74e8ee0025d31bb7da8d77a5f2c34af7fd8993eb0e317ea14cce14557dcbe0fe3041020d4141704b + checksum: bf3eadfc434bff273893efd22b319fe159d0e3b95729cb32ce3ad9f4ab4b6fabe3c4dd7f03ee0ddc7b480f0d989e908349eae6d6dce3500f896728a085af7aab languageName: node linkType: hard -"@rushstack/terminal@npm:0.13.0": - version: 0.13.0 - resolution: "@rushstack/terminal@npm:0.13.0" +"@rushstack/terminal@npm:0.14.2": + version: 0.14.2 + resolution: "@rushstack/terminal@npm:0.14.2" dependencies: - "@rushstack/node-core-library": 5.4.1 + "@rushstack/node-core-library": 5.9.0 supports-color: ~8.1.1 peerDependencies: "@types/node": "*" peerDependenciesMeta: "@types/node": optional: true - checksum: d2a90806e2f72ff8bf1522d8ab54b39ab8829f00b2b7f2e3edda4828dc70003ccd8cbda3dc25ad9275c8173286e61ccf46be0a8e9e56a7ee1f0557f6ef8eeefc + checksum: 90d38e6979737dcd97fdfdcebcc378194eed32a994341846235769273b6446b702e53e51e18fc8a373e8ed989c5622216aa6804198b8c7ae0e65cd6b103b90a1 languageName: node linkType: hard -"@rushstack/ts-command-line@npm:4.22.0": - version: 4.22.0 - resolution: "@rushstack/ts-command-line@npm:4.22.0" +"@rushstack/ts-command-line@npm:4.23.0": + version: 4.23.0 + resolution: "@rushstack/ts-command-line@npm:4.23.0" dependencies: - "@rushstack/terminal": 0.13.0 + "@rushstack/terminal": 0.14.2 "@types/argparse": 1.0.38 argparse: ~1.0.9 string-argv: ~0.3.1 - checksum: fd51fe8ac7f2e8066b5cd7071f4031e79dc59074ec4a0354ebc248f4b5c9c5e42ad5b39d929c8cddb2fe5e27948ca50ae982e046c62729f642049ce2e2333594 + checksum: 4f3d77c5b2998bbc551d02e882f0c7b8e7aed0d97ad6e4ee45b2d6281a209087f738fc1a021397088ffbe666c4eae462c1d8c4a14dc031dddee2af055b12f794 languageName: node linkType: hard @@ -5625,7 +5625,7 @@ __metadata: "@babel/core": "*" "@babel/eslint-parser": "*" "@jest/types": 29.6.3 - "@microsoft/api-extractor": ^7.43.0 + "@microsoft/api-extractor": ^7.47.11 glob: "*" jest: 29.7.0 jest-diff: ^29.7.0 @@ -5788,6 +5788,7 @@ __metadata: glob: "*" jest-specific-snapshot: "*" make-dir: "*" + prettier: ^3.2.5 pretty-format: "*" typescript: "*" languageName: unknown @@ -5920,7 +5921,7 @@ __metadata: semver: 7.6.2 tmp: ^0.2.1 tsx: "*" - typescript: ">=4.8.4 <5.6.0" + typescript: ">=4.8.4 <5.7.0" typescript-eslint: "workspace:^" yargs: 17.7.2 languageName: unknown @@ -16697,7 +16698,7 @@ __metadata: languageName: node linkType: hard -"prettier@npm:3.3.2, prettier@npm:^3.2.5": +"prettier@npm:3.3.2": version: 3.3.2 resolution: "prettier@npm:3.3.2" bin: @@ -19632,23 +19633,23 @@ __metadata: languageName: unknown linkType: soft -"typescript@npm:5.5.2": - version: 5.5.2 - resolution: "typescript@npm:5.5.2" +"typescript@npm:5.6.2": + version: 5.6.2 + resolution: "typescript@npm:5.6.2" bin: tsc: bin/tsc tsserver: bin/tsserver - checksum: 9c5a7982dadcb2d38d129c575dd38645ae11588ae0d4a12852fb04482bbc5a1660b2371e48fd5b33b6b605cc57cefe777670054546856945a05e77bd22c8c2cd + checksum: 48777e1dabd9044519f56cd012b0296e3b72bafe12b7e8e34222751d45c67e0eba5387ecdaa6c14a53871a29361127798df6dc8d1d35643a0a47cb0b1c65a33a languageName: node linkType: hard -"typescript@patch:typescript@npm%3A5.5.2#~builtin": - version: 5.5.2 - resolution: "typescript@patch:typescript@npm%3A5.5.2#~builtin::version=5.5.2&hash=b45daf" +"typescript@patch:typescript@npm%3A5.6.2#~builtin": + version: 5.6.2 + resolution: "typescript@patch:typescript@npm%3A5.6.2#~builtin::version=5.6.2&hash=b45daf" bin: tsc: bin/tsc tsserver: bin/tsserver - checksum: 9d89bac0de650e15d6846485f238d1e65f1013f2c260d9e53e86a1da6ecf8109d9fad9402575c5c36a6592dc5d4370db090e12971c8630ae84453654baabb6b4 + checksum: c084ee1ab865f108c787e6233a5f63c126c482c0c8e87ec998ac5288a2ad54b603e1ea8b8b272355823b833eb31b9fabb99e8c6152283e1cb47e3a76bd6faf6c languageName: node linkType: hard pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy