diff --git a/.cspell.json b/.cspell.json index 0c5b1d6c286..21ca6f8fc23 100644 --- a/.cspell.json +++ b/.cspell.json @@ -47,11 +47,14 @@ "autofix", "autofixers", "autofixes", + "automations", "backticks", "bigint", "bivariant", "blockless", + "blurple", "camelcase", + "Cena", "codebases", "Codecov", "contravariant", @@ -59,6 +62,7 @@ "declarators", "destructure", "destructured", + "discoverability", "dprint", "errored", "erroring", @@ -68,6 +72,7 @@ "esquery", "esrecurse", "estree", + "globby", "IDE's", "IIFE", "IIFEs", @@ -100,12 +105,15 @@ "ruleset", "rulesets", "serializers", + "Sourcegraph", "superset", "thenables", "transpiled", "transpiles", "transpiling", + "triaging", "tsconfigs", + "tseslint", "tsutils", "tsvfs", "typedef", @@ -114,6 +122,7 @@ "unoptimized", "unprefixed", "upsert", + "warnonunsupportedtypescriptversion", "Zacher" ], "overrides": [ diff --git a/.eslintrc.js b/.eslintrc.js index 4d2673c632c..99f3f5d3e41 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,12 +1,13 @@ module.exports = { root: true, plugins: [ - 'eslint-plugin', '@typescript-eslint', - 'jest', - 'import', - 'eslint-comments', '@typescript-eslint/internal', + 'deprecation', + 'eslint-comments', + 'eslint-plugin', + 'import', + 'jest', 'simple-import-sort', ], env: { @@ -15,6 +16,7 @@ module.exports = { }, extends: [ 'eslint:recommended', + 'plugin:eslint-plugin/recommended', 'plugin:@typescript-eslint/recommended', 'plugin:@typescript-eslint/recommended-requiring-type-checking', ], @@ -38,8 +40,16 @@ module.exports = { tsconfigRootDir: __dirname, warnOnUnsupportedTypeScriptVersion: false, EXPERIMENTAL_useSourceOfProjectReferenceRedirect: false, + cacheLifetime: { + // we pretty well never create/change tsconfig structure - so need to ever evict the cache + // in the rare case that we do - just need to manually restart their IDE. + glob: 'Infinity', + }, }, rules: { + // make sure we're not leveraging any deprecated APIs + 'deprecation/deprecation': 'error', + // // our plugin :D // @@ -55,6 +65,10 @@ module.exports = { }, ], '@typescript-eslint/consistent-type-definitions': ['error', 'interface'], + '@typescript-eslint/consistent-type-imports': [ + 'error', + { prefer: 'type-imports', disallowTypeAnnotations: true }, + ], '@typescript-eslint/explicit-function-return-type': 'error', '@typescript-eslint/explicit-module-boundary-types': 'off', '@typescript-eslint/no-empty-function': [ @@ -97,6 +111,13 @@ module.exports = { // curly: ['error', 'all'], + eqeqeq: [ + 'error', + 'always', + { + null: 'never', + }, + ], 'no-mixed-operators': 'error', 'no-console': 'error', 'no-process-exit': 'error', @@ -151,8 +172,10 @@ module.exports = { 'import/no-absolute-path': 'error', // disallow AMD require/define 'import/no-amd': 'error', - // forbid default exports + // forbid default exports - we want to standardize on named exports so that imported names are consistent 'import/no-default-export': 'error', + // disallow imports from duplicate paths + 'import/no-duplicates': 'error', // Forbid the use of extraneous packages 'import/no-extraneous-dependencies': [ 'error', @@ -172,19 +195,24 @@ module.exports = { 'import/no-self-import': 'error', // Require modules with a single export to use a default export 'import/prefer-default-export': 'off', // we want everything to be named + + // enforce a sort order across the codebase + 'simple-import-sort/imports': 'error', + + 'one-var': ['error', 'never'], }, overrides: [ // all test files { files: [ - 'packages/*/tests/**/*.spec.ts', - 'packages/*/tests/**/*.test.ts', - 'packages/*/tests/**/spec.ts', - 'packages/*/tests/**/test.ts', - 'packages/parser/tests/**/*.ts', - 'tests/integration/**/*.test.ts', - 'tests/integration/integration-test-base.ts', - 'tests/integration/pack-packages.ts', + './packages/*/tests/**/*.spec.ts', + './packages/*/tests/**/*.test.ts', + './packages/*/tests/**/spec.ts', + './packages/*/tests/**/test.ts', + './packages/parser/tests/**/*.ts', + './tests/integration/**/*.test.ts', + './tests/integration/integration-test-base.ts', + './tests/integration/pack-packages.ts', ], env: { 'jest/globals': true, @@ -194,13 +222,12 @@ module.exports = { '@typescript-eslint/no-unsafe-call': 'off', '@typescript-eslint/no-unsafe-member-access': 'off', '@typescript-eslint/no-unsafe-return': 'off', - 'eslint-plugin/no-identical-tests': 'error', + 'eslint-plugin/consistent-output': 'off', // Might eventually be removed from `eslint-plugin/recommended`: https://github.com/not-an-aardvark/eslint-plugin-eslint-plugin/issues/284 'jest/no-disabled-tests': 'warn', 'jest/no-focused-tests': 'error', 'jest/no-alias-methods': 'error', 'jest/no-identical-title': 'error', 'jest/no-jasmine-globals': 'error', - 'jest/no-jest-import': 'error', 'jest/no-test-prefixes': 'error', 'jest/no-done-callback': 'error', 'jest/no-test-return-statement': 'error', @@ -226,9 +253,9 @@ module.exports = { // plugin source files { files: [ - 'packages/eslint-plugin-internal/**/*.ts', - 'packages/eslint-plugin-tslint/**/*.ts', - 'packages/eslint-plugin/**/*.ts', + './packages/eslint-plugin-internal/**/*.ts', + './packages/eslint-plugin-tslint/**/*.ts', + './packages/eslint-plugin/**/*.ts', ], rules: { '@typescript-eslint/internal/no-typescript-estree-import': 'error', @@ -237,23 +264,38 @@ module.exports = { // plugin rule source files { files: [ - 'packages/eslint-plugin-internal/src/rules/**/*.ts', - 'packages/eslint-plugin-tslint/src/rules/**/*.ts', - 'packages/eslint-plugin/src/configs/**/*.ts', - 'packages/eslint-plugin/src/rules/**/*.ts', + './packages/eslint-plugin-internal/src/rules/**/*.ts', + './packages/eslint-plugin-tslint/src/rules/**/*.ts', + './packages/eslint-plugin/src/configs/**/*.ts', + './packages/eslint-plugin/src/rules/**/*.ts', ], rules: { + 'eslint-plugin/require-meta-docs-description': [ + 'error', + { pattern: '^(Enforce|Require|Disallow) .+[^. ]$' }, + ], + // specifically for rules - default exports makes the tooling easier 'import/no-default-export': 'off', + + 'no-restricted-syntax': [ + 'error', + { + selector: + 'ExportDefaultDeclaration Property[key.name="create"] MemberExpression[object.name="context"][property.name="options"]', + message: + "Retrieve options from create's second parameter so that defaultOptions are applied.", + }, + ], }, }, // plugin rule tests { files: [ - 'packages/eslint-plugin-internal/tests/rules/**/*.test.ts', - 'packages/eslint-plugin-tslint/tests/rules/**/*.test.ts', - 'packages/eslint-plugin/tests/rules/**/*.test.ts', - 'packages/eslint-plugin/tests/eslint-rules/**/*.test.ts', + './packages/eslint-plugin-internal/tests/rules/**/*.test.ts', + './packages/eslint-plugin-tslint/tests/rules/**/*.test.ts', + './packages/eslint-plugin/tests/rules/**/*.test.ts', + './packages/eslint-plugin/tests/eslint-rules/**/*.test.ts', ], rules: { '@typescript-eslint/internal/plugin-test-formatting': 'error', @@ -261,7 +303,7 @@ module.exports = { }, // files which list all the things { - files: ['packages/eslint-plugin/src/rules/index.ts'], + files: ['./packages/eslint-plugin/src/rules/index.ts'], rules: { // enforce alphabetical ordering 'sort-keys': 'error', @@ -279,11 +321,10 @@ module.exports = { // generated files { files: [ - 'packages/scope-manager/src/lib/*.ts', - 'packages/eslint-plugin/src/configs/*.ts', + './packages/scope-manager/src/lib/*.ts', + './packages/eslint-plugin/src/configs/*.ts', ], rules: { - // allow console logs in tools and tests '@typescript-eslint/internal/no-poorly-typed-ts-props': 'off', '@typescript-eslint/internal/no-typescript-default-import': 'off', '@typescript-eslint/internal/prefer-ast-types-enum': 'off', @@ -291,18 +332,11 @@ module.exports = { }, // ast spec specific standardization { - files: ['packages/ast-spec/src/**/*.ts'], + files: ['./packages/ast-spec/src/**/*.ts'], rules: { - '@typescript-eslint/consistent-type-imports': [ - 'error', - { prefer: 'type-imports', disallowTypeAnnotations: true }, - ], + // disallow ALL unused vars '@typescript-eslint/no-unused-vars': 'error', - '@typescript-eslint/sort-type-union-intersection-members': 'error', - 'import/first': 'error', - 'import/newline-after-import': 'error', - 'import/no-duplicates': 'error', - 'simple-import-sort/imports': 'error', + '@typescript-eslint/sort-type-constituents': 'error', }, }, { @@ -312,9 +346,30 @@ module.exports = { }, }, { - files: ['packages/website/src/**/*.{ts,tsx}'], + files: ['./packages/website/'], + extends: [ + 'plugin:jsx-a11y/recommended', + 'plugin:react/recommended', + 'plugin:react-hooks/recommended', + ], + plugins: ['jsx-a11y', 'react', 'react-hooks'], + rules: { + 'react/jsx-no-target-blank': 'off', + 'react/no-unescaped-entities': 'off', + '@typescript-eslint/internal/prefer-ast-types-enum': 'off', + 'react-hooks/exhaustive-deps': 'off', // TODO: enable it later + }, + settings: { + react: { + version: 'detect', + }, + }, + }, + { + files: ['./packages/website/src/**/*.{ts,tsx}'], rules: { 'import/no-default-export': 'off', + // allow console logs in the website to help with debugging things in production 'no-console': 'off', }, }, diff --git a/.github/DISCUSSION_TEMPLATE/rfcs.yml b/.github/DISCUSSION_TEMPLATE/rfcs.yml new file mode 100644 index 00000000000..e9467392b44 --- /dev/null +++ b/.github/DISCUSSION_TEMPLATE/rfcs.yml @@ -0,0 +1,24 @@ +body: + - attributes: + label: RFC + value: | + Suggested changes... + id: rfc + type: textarea + - attributes: + label: Additional Info + value: | + Any additional info... + id: additional + type: textarea + - attributes: + label: Before you submit your RFC, please confirm the following. If any of these required steps are not taken, we may not be able to review your RFC. Help us to help you! + options: + - label: I have [searched for related discussions](https://github.com/typescript-eslint/typescript-eslint/discussions) and [searched for related issues](https://github.com/typescript-eslint/typescript-eslint/issues) and found none that match my proposal. + required: true + - label: I have [read the FAQ](https://typescript-eslint.io/linting/troubleshooting) and my problem is not listed. + required: true + id: required-checks + type: checkboxes +labels: ['rfc'] +title: Your Title Here diff --git a/.github/ISSUE_TEMPLATE/01-bug-report-plugin.yaml b/.github/ISSUE_TEMPLATE/01-bug-report-plugin.yaml index 47cf18170d2..1d38ce4425d 100644 --- a/.github/ISSUE_TEMPLATE/01-bug-report-plugin.yaml +++ b/.github/ISSUE_TEMPLATE/01-bug-report-plugin.yaml @@ -1,9 +1,9 @@ -name: "🐛 Report a Bug With a Rule" -description: "Report a bug you encountered with a lint rule" -title: "Bug: [rule name here] " +name: '🐛 Report a Bug With a Rule' +description: 'Report a bug you encountered with a lint rule' +title: 'Bug: [rule name here] ' labels: - bug - - "package: eslint-plugin" + - 'package: eslint-plugin' - triage body: - type: checkboxes @@ -16,9 +16,9 @@ body: required: true - label: I have updated to the latest version of the packages. required: true - - label: I have [searched for related issues](https://github.com/typescript-eslint/typescript-eslint/issues?q=is%3Aissue+label%3Abug+label%3A%22package%3A+eslint-plugin%22) and found none that matched my issue. + - label: I have [searched for related issues](https://github.com/typescript-eslint/typescript-eslint/issues?q=is%3Aissue+label%3A%22package%3A+eslint-plugin%22) and found none that matched my issue. required: true - - label: I have [read the FAQ](https://typescript-eslint.io/docs/linting/troubleshooting) and my problem is not listed. + - label: I have [read the FAQ](https://typescript-eslint.io/linting/troubleshooting) and my problem is not listed. required: true - type: input id: playground-link @@ -98,17 +98,3 @@ body: description: | Any additional info you'd like to provide. If ESLint threw an exception, please run your lint again with the `--debug` flag, and dump the output below. e.g. `eslint path/to/broken/file.ts --debug` - - type: textarea - id: versions - attributes: - label: Versions - value: | - | package | version | - | -------------------------------------- | ------- | - | `@typescript-eslint/eslint-plugin` | `X.Y.Z` | - | `@typescript-eslint/parser` | `X.Y.Z` | - | `TypeScript` | `X.Y.Z` | - | `ESLint` | `X.Y.Z` | - | `node` | `X.Y.Z` | - validations: - required: true diff --git a/.github/ISSUE_TEMPLATE/02-enhancement-rule-option.yaml b/.github/ISSUE_TEMPLATE/02-enhancement-rule-option.yaml index b04b5f2d127..ac65fbca8c1 100644 --- a/.github/ISSUE_TEMPLATE/02-enhancement-rule-option.yaml +++ b/.github/ISSUE_TEMPLATE/02-enhancement-rule-option.yaml @@ -1,9 +1,9 @@ -name: "✨ Propose a New Rule Option or Additional Checks" -description: "Propose a new lint rule option or propose that a lint rule checks more cases" -title: "Enhancement: [rule-name] " +name: '✨ Propose a New Rule Option or Additional Checks' +description: 'Propose a new lint rule option or propose that a lint rule checks more cases' +title: 'Enhancement: [rule-name] ' labels: - - "enhancement: plugin rule option" - - "package: eslint-plugin" + - 'enhancement: plugin rule option' + - 'package: eslint-plugin' - triage body: - type: checkboxes @@ -16,7 +16,7 @@ body: required: true - label: I have searched the [current rule list](https://typescript-eslint.io/rules/#supported-rules) and found no rules that match my proposal. required: true - - label: I have [read the FAQ](https://typescript-eslint.io/docs/linting/troubleshooting) and my problem is not listed. + - label: I have [read the FAQ](https://typescript-eslint.io/linting/troubleshooting) and my problem is not listed. required: true - type: checkboxes id: rule-fits-the-brief diff --git a/.github/ISSUE_TEMPLATE/03-enhancement-new-rule.yaml b/.github/ISSUE_TEMPLATE/03-enhancement-new-rule.yaml index b7481356d70..6bd61005bd6 100644 --- a/.github/ISSUE_TEMPLATE/03-enhancement-new-rule.yaml +++ b/.github/ISSUE_TEMPLATE/03-enhancement-new-rule.yaml @@ -1,9 +1,9 @@ -name: "✨ Propose a New Rule" -description: "Propose a new lint rule" -title: "Rule proposal: " +name: '✨ Propose a New Rule' +description: 'Propose a new lint rule' +title: 'Rule proposal: ' labels: - - "enhancement: new plugin rule" - - "package: eslint-plugin" + - 'enhancement: new plugin rule' + - 'package: eslint-plugin' - triage body: - type: checkboxes @@ -16,7 +16,7 @@ body: required: true - label: I have searched the [current rule list](https://typescript-eslint.io/rules/#supported-rules) and found no rules that match my proposal. required: true - - label: I have [read the FAQ](https://typescript-eslint.io/docs/linting/troubleshooting) and my problem is not listed. + - label: I have [read the FAQ](https://typescript-eslint.io/linting/troubleshooting) and my problem is not listed. required: true - type: checkboxes id: rule-fits-the-brief diff --git a/.github/ISSUE_TEMPLATE/04-enhancement-new-base-rule-extension.yaml b/.github/ISSUE_TEMPLATE/04-enhancement-new-base-rule-extension.yaml index ee30ab1f42f..8c0ca8d8694 100644 --- a/.github/ISSUE_TEMPLATE/04-enhancement-new-base-rule-extension.yaml +++ b/.github/ISSUE_TEMPLATE/04-enhancement-new-base-rule-extension.yaml @@ -1,9 +1,9 @@ -name: "✨ Propose a New Base Rule Extension" -description: "Propose a new base lint rule extension" -title: "Base rule extension: [rule-name] " +name: '✨ Propose a New Base Rule Extension' +description: 'Propose a new base lint rule extension' +title: 'Base rule extension: [rule-name] ' labels: - - "enhancement: new base rule extension" - - "package: eslint-plugin" + - 'enhancement: new base rule extension' + - 'package: eslint-plugin' - triage body: - type: markdown @@ -23,7 +23,7 @@ body: required: true - label: I have searched the [current extension rule list](https://typescript-eslint.io/rules/#extension-rules) and found no rules that match my proposal. required: true - - label: I have [read the FAQ](https://typescript-eslint.io/docs/linting/troubleshooting) and my problem is not listed. + - label: I have [read the FAQ](https://typescript-eslint.io/linting/troubleshooting) and my problem is not listed. required: true - type: checkboxes id: rule-fits-the-brief diff --git a/.github/ISSUE_TEMPLATE/05-documentation-request.yml b/.github/ISSUE_TEMPLATE/05-documentation-request.yml index 08a98658047..c140dc478d1 100644 --- a/.github/ISSUE_TEMPLATE/05-documentation-request.yml +++ b/.github/ISSUE_TEMPLATE/05-documentation-request.yml @@ -1,6 +1,6 @@ -name: "📝 Documentation Request" -description: "Request a change in documentation" -title: "Docs: " +name: '📝 Documentation Request' +description: 'Request a change in documentation' +title: 'Docs: ' labels: - documentation - triage @@ -12,7 +12,7 @@ body: options: - label: I have looked for existing [open or closed documentation requests](https://github.com/typescript-eslint/typescript-eslint/issues?q=is%3Aissue+label%3Adocumentation) that match my proposal. required: true - - label: I have [read the FAQ](https://typescript-eslint.io/docs/linting/troubleshooting) and my problem is not listed. + - label: I have [read the FAQ](https://typescript-eslint.io/linting/troubleshooting) and my problem is not listed. required: true - type: markdown attributes: diff --git a/.github/ISSUE_TEMPLATE/06-bug-report-other.yaml b/.github/ISSUE_TEMPLATE/06-bug-report-other.yaml index 015e3a05ba7..91f2cf35fd3 100644 --- a/.github/ISSUE_TEMPLATE/06-bug-report-other.yaml +++ b/.github/ISSUE_TEMPLATE/06-bug-report-other.yaml @@ -1,6 +1,6 @@ -name: "🐛 Report a Bug With Another Package" -description: "Report a bug you encountered with another one of our packages (parser, util, scope-manager, etc)" -title: "Bug: " +name: '🐛 Report a Bug With Another Package' +description: 'Report a bug you encountered with another one of our packages (parser, util, scope-manager, etc)' +title: 'Bug: ' labels: - bug - triage @@ -17,7 +17,7 @@ body: required: true - label: I have [searched for related issues](https://github.com/typescript-eslint/typescript-eslint/issues?q=is%3Aissue+label%3Abug) and found none that matched my issue. required: true - - label: I have [read the FAQ](https://typescript-eslint.io/docs/linting/troubleshooting) and my problem is not listed. + - label: I have [read the FAQ](https://typescript-eslint.io/linting/troubleshooting) and my problem is not listed. required: true - type: markdown id: complexity-note diff --git a/.github/ISSUE_TEMPLATE/07-enhancement-other.yaml b/.github/ISSUE_TEMPLATE/07-enhancement-other.yaml index d68dea5a65e..5f0ee6146c5 100644 --- a/.github/ISSUE_TEMPLATE/07-enhancement-other.yaml +++ b/.github/ISSUE_TEMPLATE/07-enhancement-other.yaml @@ -1,6 +1,6 @@ -name: "✨ Propose an Enhancement With Another Package" -description: "Report an enhancement to another one of our packages (parser, util, scope-manager, etc)" -title: "Enhancement: " +name: '✨ Propose an Enhancement With Another Package' +description: 'Report an enhancement to another one of our packages (parser, util, scope-manager, etc)' +title: 'Enhancement: ' labels: - enhancement - triage @@ -15,7 +15,7 @@ body: required: true - label: I have searched the [current rule list](https://typescript-eslint.io/rules/#supported-rules) and found no rules that match my proposal. required: true - - label: I have [read the FAQ](https://typescript-eslint.io/docs/linting/troubleshooting) and my problem is not listed. + - label: I have [read the FAQ](https://typescript-eslint.io/linting/troubleshooting) and my problem is not listed. required: true - type: dropdown id: package diff --git a/.github/ISSUE_TEMPLATE/08-bug-report-complex.yaml b/.github/ISSUE_TEMPLATE/08-bug-report-complex.yaml index 81fa9be184a..c0da8397fa8 100644 --- a/.github/ISSUE_TEMPLATE/08-bug-report-complex.yaml +++ b/.github/ISSUE_TEMPLATE/08-bug-report-complex.yaml @@ -1,6 +1,6 @@ -name: "🐛 Report a Complex Bug With a Reproduction Repository" +name: '🐛 Report a Complex Bug With a Reproduction Repository' description: Report a complex bug you encountered by providing an isolated reproduction repository -title: "Bug: " +title: 'Bug: ' labels: - bug - triage @@ -22,7 +22,7 @@ body: required: true - label: I have [searched for related issues](https://github.com/typescript-eslint/typescript-eslint/issues?q=is%3Aissue+label%3Abug) and found none that matched my issue. required: true - - label: I have [read the FAQ](https://typescript-eslint.io/docs/linting/troubleshooting) and my problem is not listed. + - label: I have [read the FAQ](https://typescript-eslint.io/linting/troubleshooting) and my problem is not listed. required: true - type: textarea id: description diff --git a/.github/ISSUE_TEMPLATE/09-config-change.yaml b/.github/ISSUE_TEMPLATE/09-config-change.yaml index b743f8ee4a5..c5323335a93 100644 --- a/.github/ISSUE_TEMPLATE/09-config-change.yaml +++ b/.github/ISSUE_TEMPLATE/09-config-change.yaml @@ -1,9 +1,9 @@ -name: "♻ Propose a Change to Preset Configurations" -description: "Propose an addition, removal, or general change to a preset config" -title: "Configs: " +name: '♻ Propose a Change to Preset Configurations' +description: 'Propose an addition, removal, or general change to a preset config' +title: 'Configs: ' labels: - - "package: eslint-plugin" - - "preset config change" + - 'package: eslint-plugin' + - 'preset config change' - triage body: - type: checkboxes @@ -14,7 +14,7 @@ body: options: - label: I have [searched for related issues](https://github.com/typescript-eslint/typescript-eslint/issues?q=is%3Aissue+label%3A%22preset+config+change%22+) and found none that match my proposal. required: true - - label: I have [read the FAQ](https://typescript-eslint.io/docs/linting/troubleshooting) and my problem is not listed. + - label: I have [read the FAQ](https://typescript-eslint.io/linting/troubleshooting) and my problem is not listed. required: true - type: textarea id: description diff --git a/.github/ISSUE_TEMPLATE/10-repo-maintenance.yaml b/.github/ISSUE_TEMPLATE/10-repo-maintenance.yaml index 1f35a7cd59b..55787d4d407 100644 --- a/.github/ISSUE_TEMPLATE/10-repo-maintenance.yaml +++ b/.github/ISSUE_TEMPLATE/10-repo-maintenance.yaml @@ -1,8 +1,8 @@ -name: "🏗 Suggest an Improvement with Repository Maintenance" +name: '🏗 Suggest an Improvement with Repository Maintenance' description: Report a bug or request a feature related to developing the typescript-eslint monorepo -title: "Repo: " +title: 'Repo: ' labels: - - "repo maintenance" + - 'repo maintenance' - triage body: - type: markdown diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index 42e6c62d54c..566c2f4fc8a 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -2,7 +2,7 @@ blank_issues_enabled: false contact_links: - name: FAQ about: Please check out our FAQ before filing new issues - url: https://typescript-eslint.io/docs/linting/troubleshooting + url: https://typescript-eslint.io/linting/troubleshooting - name: Getting Started Guide about: If you're looking for help setting up check out our getting started guide - url: https://typescript-eslint.io/docs/ + url: https://typescript-eslint.io diff --git a/.github/SECURITY.md b/.github/SECURITY.md new file mode 100644 index 00000000000..b7d6d324c54 --- /dev/null +++ b/.github/SECURITY.md @@ -0,0 +1,12 @@ +# Security Policy + +The typescript-eslint team and community take all security vulnerabilities seriously. +If you have a vulnerability or other security issues to disclose: + +- Thank you very much, please do! +- Please send them to us by emailing `typescripteslint@gmail.com` + +We appreciate your efforts and responsible disclosure and will make every effort to acknowledge your contributions. + +> We also adhere to the [Tidelift security process](https://support.tidelift.com/hc/en-us/articles/4406287910036-Security-process). +> See https://tidelift.com/security. diff --git a/.github/SPONSORSHIPS.md b/.github/SPONSORSHIPS.md new file mode 100644 index 00000000000..d746aff13ba --- /dev/null +++ b/.github/SPONSORSHIPS.md @@ -0,0 +1,53 @@ +# Sponsorship + +typescript-eslint is an entirely volunteer-run project. +We are not associated with any company or organization; our development is funded solely from community donations. + +## Why Sponsor typescript-eslint? + +Our tooling is used by the vast majority of TypeScript applications today, including nearly 10,000 dependent projects and 20 million weekly downloads on npm. +Our packages enable both ESLint and Prettier to run on TypeScript code. +We additionally provide a comprehensive suite of TypeScript-focused ESLint rules that, by enabling access to TypeScript's type checking APIs, can detect classifications of application bugs more advanced than ESLint alone can. +Sponsoring typescript-eslint helps keep our development process running reliably, which in turn directly allows us to: + +- Support new versions of TypeScript sooner after their release +- Continue improving our documentation and first-run experiences +- Fix bugs and add new features to existing rules +- Write more advanced rules to solve more areas of application correctness + +### Sponsorship Benefits + +In addition to benefitting the TypeScript ecosystem, sponsoring us on Open Collective helps promote your company and development brand. +Our top sponsors may have their link, logo, and/or name featured on the homepage of [typescript-eslint.io](https://typescript-eslint.io). + +At present, sponsors must have given at least $100 to be featured on the homepage. +Placement tiers are based on total donations: + +- Platinum sponsors: Top 6 donators +- Gold supporters: The next 10 donators +- Silver supporters: The next 18 donators + +You can always view all financial contributors on [opencollective.com/typescript-eslint](https://opencollective.com/typescript-eslint). + +> Got an idea for how to make sponsorship work for you? +> Let us know at `typescripteslint@gmail.com`! + +## Sponsorship Limitations + +### Project Direction + +typescript-eslint is always appreciative of organizations sponsoring the project. +However, we do not factor sponsorship amounts into issue prioritization or pull request reviews. +If you have a need to push forward an area of work in typescript-eslint more urgently than a general donation can provide, consider donating engineering time as well. + +### Website Placement + +We are inclusive by default and allow all organizations that newly meet a monetary threshold to be added. +However, at our discretion, we may remove organizations we feel we cannot promote in good conscience. +Organizations would most commonly be removed if their core charter and/or repeated organization-wide intentional activities: + +- Deny fundamental human rights +- Repeatedly spread large-scale harmful misinformation online +- Finance and/or promote other organizations that match these issues + +If you disagree with a choice made by the maintenance team, or would like a refund for your sponsorship, please let us know by emailing `typescripteslint@gmail.com`. diff --git a/.github/actions/prepare-build/action.yml b/.github/actions/prepare-build/action.yml index a83f403c0ff..d656587ca56 100644 --- a/.github/actions/prepare-build/action.yml +++ b/.github/actions/prepare-build/action.yml @@ -1,15 +1,15 @@ -name: "Prepare: Build" -description: "Prepares the repo for a job by running the build" +name: 'Prepare: Build' +description: 'Prepares the repo for a job by running the build' # inputs: - no inputs # outputs: - no outputs runs: - using: "composite" + using: 'composite' steps: - uses: actions/cache@v3 id: build-cache with: - path: "**/dist/**" + path: '**/dist/**' key: ${{ runner.os }}-build-${{ github.ref }} restore-keys: | ${{ runner.os }}-build- @@ -19,4 +19,4 @@ runs: shell: bash # Website will be built by the Netlify GitHub App run: | - yarn build --exclude website + npx nx run-many --target=build --parallel --exclude website diff --git a/.github/actions/prepare-install/action.yml b/.github/actions/prepare-install/action.yml index 4d28fccf7b2..b437dce9136 100644 --- a/.github/actions/prepare-install/action.yml +++ b/.github/actions/prepare-install/action.yml @@ -1,20 +1,33 @@ -name: "Prepare: Checkout and Install" -description: "Prepares the repo for a job by checking out and installing dependencies" +# IMPORTANT NOTE TO MAINTAINERS +# +# Changes to this composite action should be carefully considered and reviewed because it is referenced +# and executed by multiple workflows in our private-automations repository. +# +# Ensure that a member of @typescript-eslint/core-team tests changes there before merging. + +name: 'Prepare: Install' +description: 'Prepares the repo by installing dependencies' inputs: node-version: - description: "The node version to setup" + description: 'The node version to setup' required: true registry-url: - description: "Define registry-url" + description: 'Define registry-url' + required: false + # NOTE: This is required for our use-case of sharing this action across multiple repos + working-directory: + description: 'Override the working directory to run the installation in' required: false + default: '.' # outputs: - no outputs runs: - using: "composite" + using: 'composite' steps: - name: echo github.ref shell: bash + working-directory: ${{ inputs.working-directory }} run: echo ${{ github.ref }} - name: Use Node.js ${{ inputs.node-version }} @@ -26,14 +39,13 @@ runs: - name: Get yarn cache directory path shell: bash id: yarn-cache-dir-path - run: echo "::set-output name=dir::$(yarn cache dir)" + run: echo "yarn_cache_dir=$(yarn cache dir)" >> $GITHUB_ENV - uses: actions/cache@v3 id: yarn-cache with: path: | - ${{ steps.yarn-cache-dir-path.outputs.dir }} - ~/.cache/Cypress + ${{ env.yarn_cache_dir }} key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} restore-keys: | ${{ runner.os }}-yarn- @@ -41,6 +53,8 @@ runs: # if the cache was hit - this will run in <1s - name: Install dependencies shell: bash + working-directory: ${{ inputs.working-directory }} run: | yarn --ignore-engines --frozen-lockfile --ignore-scripts yarn check-clean-workspace-after-install + yarn patch-package diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index 0c40cbe5d13..00000000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,19 +0,0 @@ -version: 2 -updates: - - package-ecosystem: github-actions - directory: / - ignore: - - dependency-name: cypress - schedule: - interval: weekly - day: monday - - - package-ecosystem: npm - directory: / - schedule: - interval: weekly - day: monday - ignore: - - dependency-name: cypress - - dependency-name: typescript - - dependency-name: eslint diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 1c84b2de3d0..b5037407620 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -6,9 +6,9 @@ Otherwise we may not be able to review your PR. ## PR Checklist -- [ ] Addresses an existing open issue: fixes #000 -- [ ] That issue was marked as [accepting prs](https://github.com/typescript-eslint/typescript-eslint/issues?q=is%3Aopen+is%3Aissue+label%3A%22accepting+prs%22) -- [ ] Steps in [CONTRIBUTING.md](https://github.com/typescript-eslint/typescript-eslint/blob/main/CONTRIBUTING.md) were taken +- [ ] Addresses an existing open issue: fixes #000 +- [ ] That issue was marked as [accepting prs](https://github.com/typescript-eslint/typescript-eslint/issues?q=is%3Aopen+is%3Aissue+label%3A%22accepting+prs%22) +- [ ] Steps in [Contributing](https://typescript-eslint.io/contributing) were taken ## Overview diff --git a/.github/renovate.json5 b/.github/renovate.json5 new file mode 100644 index 00000000000..5d6c59a303a --- /dev/null +++ b/.github/renovate.json5 @@ -0,0 +1,79 @@ +{ + enabledManagers: ['github-actions', 'npm'], + ignoreDeps: [ + // globby is ESM so we can't go any higher right now + 'globby', + // this dep now uses package.json exports - we will be removing it next major + 'eslint-scope', + // this dep is now ESM only + 'execa', + // Some kind of weird caching issue: + // https://github.com/typescript-eslint/typescript-eslint/issues/6230 + 'ts-node', + // the nx packages get updated using the nx migrate CLI + '@nrwl/cli', + '@nrwl/devkit', + '@nrwl/jest', + '@nrwl/nx-cloud', + '@nrwl/tao', + ], + ignorePaths: [ + // integration test package.json's should never be updated as they're purposely fixed tests + 'tests/integration/fixtures', + ], + internalChecksFilter: 'strict', + labels: ['dependencies'], + packageRules: [ + // automerge everything but major updates + { + matchUpdateTypes: ['minor', 'patch', 'pin', 'digest'], + automerge: true, + automergeStrategy: 'squash', + }, + + // label PRs appropriately + { + matchManagers: ['npm'], + addLabels: ['javascript'], + }, + { + matchManagers: ['github-actions'], + addLabels: ['github-actions'], + }, + + // batch package sets together + { + extends: ['packages:react'], + groupName: 'react', + }, + { + extends: ['monorepo:docusaurus'], + groupName: 'docusaurus', + }, + { + extends: ['monorepo:nrwl'], + groupName: 'nx', + }, + { + extends: ['monorepo:babel'], + matchPackagePrefixes: ['@types/babel'], + groupName: 'babel', + }, + { + extends: ['monorepo:jest'], + matchPackageNames: ['ts-jest', 'pretty-format'], + matchPackagePrefixes: ['@types/jest'], + groupName: 'jest', + }, + { + matchPackagePrefixes: ['@rollup', 'rollup-'], + matchPackageNames: ['rollup'], + groupName: 'rollup', + }, + ], + postUpdateOptions: [ + // run yarn dedupe to cleanup the lockfile after updates + 'yarnDedupeHighest', + ], + stabilityDays: 3, +} diff --git a/.github/replies.yml b/.github/replies.yml new file mode 100644 index 00000000000..a1013724140 --- /dev/null +++ b/.github/replies.yml @@ -0,0 +1,77 @@ +replies: + - body: | + 👋 Hey @{{ author }}! Just checking in, is this still something you have time for? No worries if not - I just don't want to leave it hanging. + name: Checking In + - body: | + Thanks for posting! This is a duplicate of #. Before filing an issue, please [use our issue search](https://github.com/typescript-eslint/typescript-eslint/issues) to check for open and closed issues that already address what you're looking for. + name: Clearly Duplicate Issue + - body: | + Thanks for the issue! + \ + This is an extension rule. That means we take the base rule and extend it to support TS syntax or features. + \ + We don't break from the base rule to add new features unless they are specifically related to TS. + \ + In this instance — this request is not related to TS, thus we shall not implement it. If you'd like to see it, feel free to raise a request with the ESLint team. + \ + name: Extension Rule - Reject Due to Enhancement + - body: | + The fix has been merged to main, and will be released Monday, as per our [release schedule](https://github.com/typescript-eslint/typescript-eslint#versioning) + \ + If you need it sooner, please try the `canary` tag on NPM. + name: Fix Has Been Merged + - body: | + Thanks for the report @!\ + This might be a valid issue, but we can't tell because you haven't filled in enough information.\ + Please fill in the rest of the issue template so we can take a look.\ + Thanks! + name: Needs More Info + - body: | + Thanks for the report @!\ + I can't reproduce the issue using the repository you provided.\ + Could you please comment with instructions on how to reproduce the issue?\ + Thanks! + name: Needs Full Reproduction + - body: | + Thanks for the report @!\ + I can't reproduce the issue using the code you provided.\ + Could you please create an isolated reproduction in our playground (https://typescript-eslint.io/play) and comment back when you've got one?\ + We prefer an isolated reproduction so that we as volunteer maintainers can quickly reproduce the issue and more easily find the cause.\ + Thanks! + name: Needs Playground Reproduction + - body: | + With any issue opened in this project — it either has visible progress in the form of an attached PR, or it has no progress.\ + \ + We are a community-run project. The volunteer maintainers spend most of their time triaging issues and reviewing PRs. This means that most issues will not progress unless a member of the community steps up and champions it.\ + \ + If this issue is important to you — consider being that champion.\ + \ + If not — please just subscribe to the issue and wait patiently.\ + Commenting asking for status updates does not bump issue priority in any way and just serves to spam everyone subscribed to the issue. + name: Progress - Blunt + - body: | + We are a community run project. The **volunteer** maintainers spend most of their time triaging issues and reviewing PRs. This means that most issues *will not progress* unless a member of the community steps up and **champions** it. + \ + If this issue is important to you — consider being that champion. + If not — please use the subscribe function and wait patiently for someone else to implement this. + name: Progress - Nice + - body: | + Closing this issue as it's been stale for ~6 weeks without activity. Feel free to reopen @{{ author }} if you have time - but no worries if not! If anybody wants to drive it forward, please do either post here or in a new issue with the info we asked about. Thanks! 😊 + name: Pruning Stale Issue + - body: | + Closing this PR as it's been stale for ~6 weeks without activity. Feel free to reopen @{{ author }} if you have time - but no worries if not! If anybody wants to drive it forward, please do post your own PR - and if you use this as a start, consider adding `Co-authored-by: @{{ author }}` at the end of your PR description. Thanks! 😊 + name: Pruning Stale PR + - body: | + As per [our contributing guidelines](https://github.com/typescript-eslint/typescript-eslint/blob/master/CONTRIBUTING.md#addressing-feedback-and-beyond) this PR is in the queue of PRs to reviewed, and will be reviewed when we are able. + \ + This project is run by volunteer maintainers, so it might be a bit before we can find the time to get to it. + name: Review Queue + - body: | + We ***STRONGLY*** recommend you use automatic code formatters like [prettier](https://www.npmjs.com/package/prettier). + \ + Stylistic lint rules take a lot of effort to write, require ongoing maintenance to add more configuration as people want to fit their preferences, and are a large burden to maintain as new syntax is added. + The configurability also leads to huge fanout [making tests huge, and awful to maintain](https://github.com/typescript-eslint/typescript-eslint/blob/b814e635c1f34139c89e0176727480935dd45cac/packages/eslint-plugin/tests/rules/type-annotation-spacing.test.ts). + \ + It's for these reasons that [eslint has frozen all stylistic lint rule options, and will not accept any new ones](https://eslint.org/blog/2020/05/changes-to-rules-policies). + See also our [What About Formatting?](https://typescript-eslint.io/linting/troubleshooting/formatting) docs. + name: Use Prettier diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6363babb0df..def7977921b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,6 +4,7 @@ on: push: branches: - main + - v6 pull_request: branches: - '**' @@ -23,6 +24,9 @@ defaults: # 3) Run the steps that depend on the build # +permissions: + contents: read # to fetch code (actions/checkout) + jobs: install: name: Checkout and Install @@ -55,11 +59,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - lint-task: [ - "check-spelling", - "check-format", - "lint-markdown", - ] + lint-task: ['check-spelling', 'check-format', 'lint-markdown'] steps: - name: Checkout uses: actions/checkout@v3 @@ -78,10 +78,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - lint-task: [ - "lint", - "typecheck", - ] + lint-task: ['lint', 'typecheck'] steps: - name: Checkout uses: actions/checkout@v3 @@ -121,19 +118,20 @@ jobs: strategy: matrix: # just run on the oldest and latest supported versions and assume the intermediate versions are good - node-version: [12, 18] - package: [ - "ast-spec", - "eslint-plugin", - "eslint-plugin-internal", - "eslint-plugin-tslint", - "parser", - "scope-manager", - "type-utils", - "typescript-estree", - "utils", - "visitor-keys", - ] + node-version: [14, 18] + package: + [ + 'ast-spec', + 'eslint-plugin', + 'eslint-plugin-internal', + 'eslint-plugin-tslint', + 'parser', + 'scope-manager', + 'type-utils', + 'typescript-estree', + 'utils', + 'visitor-keys', + ] env: # Added the - at the end to function as a separator to improve readability in the PR comment from the Nx cloud app NX_CLOUD_ENV_NAME: 'Node ${{ matrix.node-version }} -' @@ -146,7 +144,7 @@ jobs: - name: Install uses: ./.github/actions/prepare-install with: - node-version: ${{ env.PRIMARY_NODE_VERSION }} + node-version: ${{ matrix.node-version }} - name: Build uses: ./.github/actions/prepare-build @@ -157,12 +155,12 @@ jobs: # would override the config - name: Run unit tests with coverage for ${{ matrix.package }} if: env.PRIMARY_NODE_VERSION == matrix.node-version - run: npx nx test @typescript-eslint/${{ matrix.package }} + run: npx nx test ${{ matrix.package }} env: CI: true - name: Run unit tests for ${{ matrix.package }} if: env.PRIMARY_NODE_VERSION != matrix.node-version - run: npx nx test @typescript-eslint/${{ matrix.package }} --coverage=false + run: npx nx test ${{ matrix.package }} --coverage=false env: CI: true @@ -176,6 +174,9 @@ jobs: retention-days: 1 website_tests: + permissions: + contents: read # to fetch code (actions/checkout) + name: Website tests needs: [build] runs-on: ubuntu-latest @@ -191,21 +192,18 @@ jobs: - name: Build uses: ./.github/actions/prepare-build - - name: Install Cypress - run: yarn cypress install + - name: Install Playwright Browsers + run: npx playwright install --with-deps - - name: Cypress run - uses: cypress-io/github-action@v2 - with: - project: ./packages/website - start: yarn start + - name: Run Playwright tests + run: yarn playwright test --reporter=list + working-directory: packages/website - - uses: actions/upload-artifact@v3 + - if: always() + uses: actions/upload-artifact@v3 with: - name: screenshots - path: | - packages/website/cypress/screenshots/ - packages/website/cypress/videos/ + name: playwright-report + path: packages/website/playwright-report upload_coverage: name: Upload Codecov Coverage @@ -228,17 +226,10 @@ jobs: flags: unittest name: codecov - publish_canary_version: name: Publish the latest code as a canary version runs-on: ubuntu-latest - needs: - [ - integration_tests, - lint_with_build, - lint_without_build, - unit_tests, - ] + needs: [integration_tests, lint_with_build, lint_without_build, unit_tests] if: github.repository == 'typescript-eslint/typescript-eslint' && github.ref == 'refs/heads/main' steps: - name: Checkout @@ -247,7 +238,7 @@ jobs: uses: ./.github/actions/prepare-install with: node-version: ${{ env.PRIMARY_NODE_VERSION }} - registry-url: "https://registry.npmjs.org" + registry-url: 'https://registry.npmjs.org' - name: Build uses: ./.github/actions/prepare-build @@ -259,3 +250,28 @@ jobs: run: npx lerna publish --loglevel=verbose --canary --exact --force-publish --yes env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + + publish_canary_version_v6: + name: Publish the next major version code as a canary version + runs-on: ubuntu-latest + needs: [integration_tests, lint_with_build, lint_without_build, unit_tests] + if: github.ref == 'refs/heads/v${major}' + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Install + uses: ./.github/actions/prepare-install + with: + node-version: ${{ env.PRIMARY_NODE_VERSION }} + registry-url: 'https://registry.npmjs.org' + - name: Build + uses: ./.github/actions/prepare-build + + # Fetch all history for all tags and branches in this job because lerna needs it + - run: | + git fetch --prune --unshallow + + - name: Publish all packages to npm + run: npx lerna publish premajor --loglevel=verbose --canary --exact --force-publish --yes --dist-tag rc-v${major} + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/lock.yml b/.github/workflows/lock.yml index 84152062b22..202088e5b17 100644 --- a/.github/workflows/lock.yml +++ b/.github/workflows/lock.yml @@ -1,19 +1,25 @@ -name: "Lock threads" +name: 'Lock threads' on: schedule: - - cron: "0 0 * * *" + - cron: '0 0 * * *' + +permissions: {} jobs: lock: + permissions: + issues: write # to lock issues (dessant/lock-threads) + pull-requests: write # to lock PRs (dessant/lock-threads) + runs-on: ubuntu-latest steps: - - uses: dessant/lock-threads@v3 + - uses: dessant/lock-threads@v4 with: github-token: ${{ github.token }} - issue-inactive-days: "30" - issue-lock-reason: "resolved" - issue-comment: "" - pr-inactive-days: "30" - pr-lock-reason: "resolved" - pr-comment: "" + issue-inactive-days: '7' + issue-lock-reason: 'resolved' + issue-comment: '' + pr-inactive-days: '7' + pr-lock-reason: 'resolved' + pr-comment: '' diff --git a/.github/workflows/nx-migrate.yml b/.github/workflows/nx-migrate.yml new file mode 100644 index 00000000000..af107f6c391 --- /dev/null +++ b/.github/workflows/nx-migrate.yml @@ -0,0 +1,85 @@ +# This workflow is used to augment the capabilities of the renovate GitHub app by running a full +# `nx migrate` when renovate opens a PR to change the version of @nrwl/workspace. +# +# You will therefore also notice that in the renovate configuration, we ignore any packages which +# Nx will manage for us as part of `nx migrate` such as the remaining @nrwl/* packages and jest. + +name: Nx Migrate + +on: + pull_request: + branches: [main] + paths: + - 'package.json' + +concurrency: + group: ${{ github.workflow }}-${{ github.event.number || github.ref }} + cancel-in-progress: true + +jobs: + maybe_nx_migrate: + # Only run if it was the renovate bot that triggered the workflow (otherwise we'll create a loop) + if: contains('["renovate[bot]"]', github.actor) == true + name: Run nx migrate if required + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + # To allow us to perform the git diff we need the git history + fetch-depth: 0 + # To ensure we can push from a different user (and therefore cause actions to rerun) + persist-credentials: false + + - name: Derive appropriate SHAs for base and head for `nx affected` commands + uses: nrwl/nx-set-shas@v3 + + - name: Check if @nrwl/workspace was changed as part of the latest commit on the PR + id: nrwl-workspace-package-check + run: | + git diff HEAD~1 -G"@nrwl/workspace" --exit-code package.json && echo "@nrwl/workspace unchanged" || echo "::set-output name=was-changed::true" + + - name: Run nx migrate if @nrwl/workspace changed and commit the results + if: ${{ steps.nrwl-workspace-package-check.outputs.was-changed == 'true' }} + env: + # We cannot use secrets.GITHUB_TOKEN for this because it is not permitted to kick off subsequent actions worfklow runs, so we use a PAT instead + GITHUB_TOKEN: ${{ secrets.JAMES_HENRY_GITHUB_TOKEN }} + # We don't want to run any of our postinstall logic when Nx is invoking install behind the scenes + SKIP_POSTINSTALL: 'true' + run: | + # Checkout the PR branch using the github CLI + gh pr checkout ${{ github.event.pull_request.number }} + + # Get the version of Nx we are migrating to + NX_VERSION=$(node -e "console.log(require('./package.json').devDependencies['@nrwl/workspace'])") + + # Revert renovate's changes to package.json and yarn.lock so that it is a clean migrate from the status quo + git checkout HEAD~1 -- package.json yarn.lock + + yarn --ignore-scripts + + npx nx migrate @nrwl/workspace@$NX_VERSION + + # Sometimes Nx can require config formatting changes after a migrate command + yarn --ignore-scripts + npx nx format + + # migrations.json may or may not exist after running nx migrate + if [ -f migrations.json ]; then + # This will also invoke yarn automatically + npx nx migrate --run-migrations=migrations.json + + # After we have run its migrations, we no longer need the migrations.json file + rm migrations.json + fi + + # Ensure all the changed files are formatted appropriately + yarn format + + # Commit all the changes to the PR (see note on not being able to use secrets.GITHUB_TOKEN for this) + git config --global user.email "james@henry.sc" + git config --global user.name "JamesHenry" + git remote set-url origin https://x-access-token:$GITHUB_TOKEN@github.com/$GITHUB_REPOSITORY.git + + git add --all + git commit -m "chore: run nx migrate for @nrwl/workspace v$NX_VERSION" + git push diff --git a/.github/workflows/semantic-pr-titles.yml b/.github/workflows/semantic-pr-titles.yml new file mode 100644 index 00000000000..98a7013beb7 --- /dev/null +++ b/.github/workflows/semantic-pr-titles.yml @@ -0,0 +1,52 @@ +name: Semantic PR Titles + +on: + pull_request_target: + types: + - opened + - edited + - synchronize + +jobs: + main: + name: Validate PR title + runs-on: ubuntu-latest + steps: + - uses: amannn/action-semantic-pull-request@v5 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + # keep this synchronized with /docs/contributing/Pull_Requests.mdx + types: | + docs + feat + fix + test + chore + # deps is used by renovate for its PRs + scopes: | + deps + ast-spec + eslint-plugin + eslint-plugin-internal + eslint-plugin-tslint + experimental-utils + parser + scope-manager + type-utils + types + typescript-estree + utils + visitor-keys + website + # we allow "cross package" PRs with no scope + requireScope: false + # ensure that the subject is lower-case first + # also allows "[rule-name] " / "[rule-name, rule-name] " prefix for eslint-plugin rule PRs + # https://regexr.com/73m7b + subjectPattern: ^(\[[a-z\-]+(, [a-z\-]+)*\] )?[a-z].+[^\.]$ + subjectPatternError: | + The "subject" must start with a lower-case letter and must not + end with a full-stop. + For PRs that add or change ESLint-plugin rules, you should begin + the title with "[rule-name] " diff --git a/.gitignore b/.gitignore index 5159aa25e16..0973f04542e 100644 --- a/.gitignore +++ b/.gitignore @@ -9,9 +9,10 @@ yarn-error.log* packages/website/.docusaurus packages/website/.cache-loader packages/website/build -packages/website/cypress/screenshots -packages/website/cypress/videos +packages/website/playwright-report +packages/website/playwright/.cache packages/website/static/sandbox +packages/website/test-results # Runtime data pids @@ -68,6 +69,9 @@ jspm_packages/ # Editor-specific metadata folders .vs +# nodejs cpu profiles +*.cpuprofile + .DS_Store .idea dist @@ -78,3 +82,12 @@ _ts3.4 # Files copied as part of the build packages/types/src/generated/**/*.ts + +# Yarn 3 +.pnp.* +.yarn/* +!.yarn/patches +!.yarn/plugins +!.yarn/releases +!.yarn/sdks +!.yarn/versions diff --git a/.lintstagedrc b/.lintstagedrc index 691f6e0eb0e..c4eebcd2f40 100644 --- a/.lintstagedrc +++ b/.lintstagedrc @@ -1,5 +1,3 @@ { - "*.{ts,mts,cts,tsx,js,mjs,cjs,jsx,json,md,css}": [ - "prettier --write" - ] + "*.{ts,mts,cts,tsx,js,mjs,cjs,jsx,json,md,css}": ["prettier --write"] } diff --git a/.markdownlint.json b/.markdownlint.json index 55f1ef99429..05206c4297d 100644 --- a/.markdownlint.json +++ b/.markdownlint.json @@ -61,16 +61,19 @@ "MD033": { "allowed_elements": [ "a", - "img", "br", - "sup", + "details", + "em", + "figcaption", + "figure", "h1", + "img", "p", - "details", + "RulesTable", "summary", - "Tabs", + "sup", "TabItem", - "RulesTable" + "Tabs" ] }, // MD034/no-bare-urls - Bare URL used @@ -96,11 +99,11 @@ // MD044/proper-names - Proper names should have the correct capitalization "MD044": { "names": [ + "ESLint", "JavaScript", - "TypeScript", "TSLint", - "ESLint", - "typescript-eslint" + "typescript-eslint", + "TypeScript" ], "code_blocks": false }, diff --git a/.prettierignore b/.prettierignore index 97e17b8a77e..edaa57ceac4 100644 --- a/.prettierignore +++ b/.prettierignore @@ -8,17 +8,12 @@ **/.nyc_output **/.vs packages/eslint-plugin-tslint/tests/test-tslint-rules-directory/alwaysFailRule.js -.github packages/eslint-plugin/src/configs/*.json -.all-contributorsrc CONTRIBUTORS.md packages/ast-spec/src/*/*/fixtures/_error_/*/fixture.ts -# Syntax not yet supported -packages/scope-manager/tests/fixtures/type-declaration/type-query-with-parameters.ts -packages/scope-manager/tests/fixtures/type-declaration/infer-type-constraint.ts -packages/scope-manager/tests/fixtures/instantiation-expressions/type-arguments1.ts -packages/scope-manager/tests/fixtures/instantiation-expressions/type-arguments2.ts +# prettier doesn't yet support auto-accessors +packages/ast-spec/src/element/AccessorProperty/fixtures # Ignore CHANGELOG.md files to avoid issues with automated release job CHANGELOG.md diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 3c84af70cc5..d4d111dbe6e 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -5,7 +5,8 @@ "editorconfig.editorconfig", "esbenp.prettier-vscode", "streetsidesoftware.code-spell-checker", - "tlent.jest-snapshot-language-support" + "tlent.jest-snapshot-language-support", + "mrmlnc.vscode-json5" ], "unwantedRecommendations": ["hookyqr.beautify", "dbaeumer.jshint"] } diff --git a/CHANGELOG.md b/CHANGELOG.md index f69637a73d7..9ad61e896af 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,2930 +3,2320 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. -# [5.31.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.7...v5.31.0) (2022-07-25) +# [5.50.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.49.0...v5.50.0) (2023-01-31) ### Bug Fixes -* **eslint-plugin:** [typedef] Support nested array destructuring with type annotation ([#5311](https://github.com/typescript-eslint/typescript-eslint/issues/5311)) ([6d19efe](https://github.com/typescript-eslint/typescript-eslint/commit/6d19efed16d1cf0357ad363b6373d2021c49a8c8)) -* **scope-manager:** handle typeParameters of TSInstantiationExpression ([#5355](https://github.com/typescript-eslint/typescript-eslint/issues/5355)) ([2595ccf](https://github.com/typescript-eslint/typescript-eslint/commit/2595ccf67cd5158edbd6bebd9ac2dbd8bbd8b99c)) +* **ast-spec:** a JSXEmptyExpression is not a possible JSXExpression ([#6321](https://github.com/typescript-eslint/typescript-eslint/issues/6321)) ([4b27777](https://github.com/typescript-eslint/typescript-eslint/commit/4b27777ed26cc83d6efc52a89b2d3fc6c01bc0d7)) +* **eslint-plugin:** [ban-ts-comment] counts graphemes instead of `String.prototype.length` ([#5704](https://github.com/typescript-eslint/typescript-eslint/issues/5704)) ([09d57ce](https://github.com/typescript-eslint/typescript-eslint/commit/09d57cec8901880c6b24ea80dfa7d9fcdc463930)) +* **eslint-plugin:** [prefer-optional-chain] fix `ThisExpression` and `PrivateIdentifier` errors ([#6028](https://github.com/typescript-eslint/typescript-eslint/issues/6028)) ([85e783c](https://github.com/typescript-eslint/typescript-eslint/commit/85e783c1fabe96d390729a5796d6d346e401692b)) +* **eslint-plugin:** [prefer-optional-chain] fixer produces wrong logic ([#5919](https://github.com/typescript-eslint/typescript-eslint/issues/5919)) ([b0f6c8e](https://github.com/typescript-eslint/typescript-eslint/commit/b0f6c8ec0b372696ef26ca3a2b4f82dafd9dc417)), closes [#1438](https://github.com/typescript-eslint/typescript-eslint/issues/1438) ### Features -* **eslint-plugin:** [consistent-generic-ctors] check class field declaration ([#5288](https://github.com/typescript-eslint/typescript-eslint/issues/5288)) ([48f996e](https://github.com/typescript-eslint/typescript-eslint/commit/48f996e8dda79c9c865e8ca6552069902836648b)) -* **eslint-plugin:** [prefer-nullish-coalescing] add ignoreTernaryTests option ([#4965](https://github.com/typescript-eslint/typescript-eslint/issues/4965)) ([f82727f](https://github.com/typescript-eslint/typescript-eslint/commit/f82727ffeb97475c07773ca1d1e5b9609fcc5e68)) +* **eslint-plugin:** add `key-spacing` rule extension for interface & type declarations ([#6211](https://github.com/typescript-eslint/typescript-eslint/issues/6211)) ([67706e7](https://github.com/typescript-eslint/typescript-eslint/commit/67706e72e332bf11c82fdf51f3d417d3c93a86cf)) -## [5.30.7](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.6...v5.30.7) (2022-07-18) +# [5.49.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.48.2...v5.49.0) (2023-01-23) ### Bug Fixes -* **eslint-plugin:** [no-inferrable] fix optional param to valid code ([#5342](https://github.com/typescript-eslint/typescript-eslint/issues/5342)) ([98f6d5e](https://github.com/typescript-eslint/typescript-eslint/commit/98f6d5e6d08d1eb9789da52a15f337f5f53438bd)) -* **eslint-plugin:** [no-unused-vars] highlight last write reference ([#5267](https://github.com/typescript-eslint/typescript-eslint/issues/5267)) ([c3f199a](https://github.com/typescript-eslint/typescript-eslint/commit/c3f199a65a16aa72f5bb83e81a1ce0ffb5f69772)) -* expose types supporting old versions of typescript ([#5339](https://github.com/typescript-eslint/typescript-eslint/issues/5339)) ([4ba9bdb](https://github.com/typescript-eslint/typescript-eslint/commit/4ba9bdb93f87e6bc370f13aa1de48f435abe3f88)) -* **scope-manager:** allow visiting of constraint in infer type ([#5331](https://github.com/typescript-eslint/typescript-eslint/issues/5331)) ([b2846a1](https://github.com/typescript-eslint/typescript-eslint/commit/b2846a16777a3aea7b1e6ac9d81b9b6dce0bb874)) +* **typescript-estree:** fix typo in FAQ link ([#6346](https://github.com/typescript-eslint/typescript-eslint/issues/6346)) ([eefc578](https://github.com/typescript-eslint/typescript-eslint/commit/eefc5781b0f455264e4e58e33c27f8a91b3ab5e3)) +### Features +* **eslint-plugin:** [naming-convention] add support for `#private` modifier on class members ([#6259](https://github.com/typescript-eslint/typescript-eslint/issues/6259)) ([c8a6d80](https://github.com/typescript-eslint/typescript-eslint/commit/c8a6d8096080228b6d122c861fe140ac97f17cbe)) -## [5.30.6](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.5...v5.30.6) (2022-07-11) -**Note:** Version bump only for package @typescript-eslint/typescript-eslint +## [5.48.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.48.1...v5.48.2) (2023-01-16) +**Note:** Version bump only for package @typescript-eslint/typescript-eslint -## [5.30.5](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.4...v5.30.5) (2022-07-04) -### Bug Fixes -* **eslint-plugin:** [consistent-indexed-object-style] fix record mode fixer for generics with a default value ([#5280](https://github.com/typescript-eslint/typescript-eslint/issues/5280)) ([57f032c](https://github.com/typescript-eslint/typescript-eslint/commit/57f032c2e6a822c049177713778d0077ee138d9a)) +## [5.48.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.48.0...v5.48.1) (2023-01-09) +**Note:** Version bump only for package @typescript-eslint/typescript-eslint -## [5.30.4](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.3...v5.30.4) (2022-07-03) -**Note:** Version bump only for package @typescript-eslint/typescript-eslint +# [5.48.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.47.1...v5.48.0) (2023-01-02) +### Bug Fixes +- **website:** fix typo ([#6285](https://github.com/typescript-eslint/typescript-eslint/issues/6285)) ([3f8d105](https://github.com/typescript-eslint/typescript-eslint/commit/3f8d105e9ee500428774b498083c4bc02bfd81b8)) +### Features +- **eslint-plugin:** specify which method is unbound and added test case ([#6281](https://github.com/typescript-eslint/typescript-eslint/issues/6281)) ([cf3ffdd](https://github.com/typescript-eslint/typescript-eslint/commit/cf3ffdd49aceb734ce18dc44ed6a11f7701f178e)) -## [5.30.3](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.2...v5.30.3) (2022-07-01) +## [5.47.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.47.0...v5.47.1) (2022-12-26) -**Note:** Version bump only for package @typescript-eslint/typescript-eslint +### Bug Fixes +- **ast-spec:** correct some incorrect ast types ([#6257](https://github.com/typescript-eslint/typescript-eslint/issues/6257)) ([0f3f645](https://github.com/typescript-eslint/typescript-eslint/commit/0f3f64571ea5d938081b1a9f3fd1495765201700)) +- **eslint-plugin:** [member-ordering] correctly invert optionalityOrder ([#6256](https://github.com/typescript-eslint/typescript-eslint/issues/6256)) ([ccd45d4](https://github.com/typescript-eslint/typescript-eslint/commit/ccd45d4a998946b7be1161f8c8216bc458e50b4e)) +# [5.47.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.46.1...v5.47.0) (2022-12-19) +### Features +- **eslint-plugin:** [no-floating-promises] add suggestion fixer to add an 'await' ([#5943](https://github.com/typescript-eslint/typescript-eslint/issues/5943)) ([9e35ef9](https://github.com/typescript-eslint/typescript-eslint/commit/9e35ef9af3ec51ab2dd49336699f3a94528bb4b1)) -## [5.30.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.1...v5.30.2) (2022-07-01) +## [5.46.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.46.0...v5.46.1) (2022-12-12) **Note:** Version bump only for package @typescript-eslint/typescript-eslint +# [5.46.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.45.1...v5.46.0) (2022-12-08) +### Bug Fixes +- **eslint-plugin:** [ban-types] update message to suggest `object` instead of `Record` ([#6079](https://github.com/typescript-eslint/typescript-eslint/issues/6079)) ([d91a5fc](https://github.com/typescript-eslint/typescript-eslint/commit/d91a5fc41be5bc2a0625574e9c9496f61fb7471d)) +### Features -## [5.30.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.0...v5.30.1) (2022-07-01) +- **eslint-plugin:** [prefer-nullish-coalescing] logic and test for strict null checks ([#6174](https://github.com/typescript-eslint/typescript-eslint/issues/6174)) ([8a91cbd](https://github.com/typescript-eslint/typescript-eslint/commit/8a91cbd9fbe5bc4cf750cd949d2b8d48ff4c311d)) +## [5.45.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.45.0...v5.45.1) (2022-12-05) ### Bug Fixes -* **eslint-plugin:** [no-base-to-string] add missing apostrophe to message ([#5270](https://github.com/typescript-eslint/typescript-eslint/issues/5270)) ([d320174](https://github.com/typescript-eslint/typescript-eslint/commit/58034e343a167ca7751b54d2b2a0e7d3852aabec)) - - - +- **eslint-plugin:** [keyword-spacing] unexpected space before/after in `import type` ([#6095](https://github.com/typescript-eslint/typescript-eslint/issues/6095)) ([98caa92](https://github.com/typescript-eslint/typescript-eslint/commit/98caa92ca89bdf0ca6ba6e4ff1f13c60221579e8)) +- **eslint-plugin:** [no-shadow] add call and method signatures to `ignoreFunctionTypeParameterNameValueShadow` ([#6129](https://github.com/typescript-eslint/typescript-eslint/issues/6129)) ([9d58b6b](https://github.com/typescript-eslint/typescript-eslint/commit/9d58b6be246507d20af67c84a5e9bb592d97cff5)) +- **eslint-plugin:** [prefer-optional-chain] collect MetaProperty type ([#6083](https://github.com/typescript-eslint/typescript-eslint/issues/6083)) ([d7114d3](https://github.com/typescript-eslint/typescript-eslint/commit/d7114d3ab09d1b93627d3b3dbb9862e37ee29c97)) +- **eslint-plugin:** [sort-type-constituents, sort-type-union-intersection-members] handle some required parentheses cases in the fixer ([#6118](https://github.com/typescript-eslint/typescript-eslint/issues/6118)) ([5d49d5d](https://github.com/typescript-eslint/typescript-eslint/commit/5d49d5dbee4425fc8bc01c5e748d161f3619477b)) +- **parser:** remove the jsx option requirement for automatic jsx pragma resolution ([#6134](https://github.com/typescript-eslint/typescript-eslint/issues/6134)) ([e777f5e](https://github.com/typescript-eslint/typescript-eslint/commit/e777f5e225b9ddfb6bb1eaa74cbc5171a17ac017)) +# [5.45.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.44.0...v5.45.0) (2022-11-28) -# [5.30.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.29.0...v5.30.0) (2022-06-27) +### Bug Fixes +- **eslint-plugin:** [array-type] --fix flag removes parentheses from type ([#5997](https://github.com/typescript-eslint/typescript-eslint/issues/5997)) ([42b33af](https://github.com/typescript-eslint/typescript-eslint/commit/42b33af256e5269feb214c7bb161079f770964fa)) +- **eslint-plugin:** [keyword-spacing] prevent crash on no options ([#6073](https://github.com/typescript-eslint/typescript-eslint/issues/6073)) ([1f19998](https://github.com/typescript-eslint/typescript-eslint/commit/1f19998e3ec6d592fc679a7490708e2e96816f4c)) +- **eslint-plugin:** [member-ordering] support private fields ([#5859](https://github.com/typescript-eslint/typescript-eslint/issues/5859)) ([f02761a](https://github.com/typescript-eslint/typescript-eslint/commit/f02761af19848a84b8d1832bd00fd6c95d38fa0c)) +- **eslint-plugin:** [prefer-readonly] report if a member's property is reassigned ([#6043](https://github.com/typescript-eslint/typescript-eslint/issues/6043)) ([6e079eb](https://github.com/typescript-eslint/typescript-eslint/commit/6e079eb35cfec79ba9965627477117f026d161ac)) +- **scope-manager:** add support for TS4.9 satisfies expression ([#6059](https://github.com/typescript-eslint/typescript-eslint/issues/6059)) ([44027db](https://github.com/typescript-eslint/typescript-eslint/commit/44027db379e6e074a16cda2755ef554c2b0a4c5a)) +- **typescript-estree:** stub out `ts.SatisfiesExpression` on old TS versions ([#6076](https://github.com/typescript-eslint/typescript-eslint/issues/6076)) ([1302b30](https://github.com/typescript-eslint/typescript-eslint/commit/1302b30ecad9eb55aa9f1daa5068d9fb72c3688e)) ### Features -* **eslint-plugin:** [no-shadow] add shadowed variable location to the error message ([#5183](https://github.com/typescript-eslint/typescript-eslint/issues/5183)) ([8ca08e9](https://github.com/typescript-eslint/typescript-eslint/commit/8ca08e9f18d59b29715c667fbb7d237f6e9a96ba)) -* treat `this` in `typeof this` as a `ThisExpression` ([#4382](https://github.com/typescript-eslint/typescript-eslint/issues/4382)) ([b04b2ce](https://github.com/typescript-eslint/typescript-eslint/commit/b04b2ce1ba90d94718891f2562dd210a6d7b8609)) - - +- **eslint-plugin:** [member-ordering] add a required option for required vs. optional member ordering ([#5965](https://github.com/typescript-eslint/typescript-eslint/issues/5965)) ([2abadc6](https://github.com/typescript-eslint/typescript-eslint/commit/2abadc6c26cd6300764157d405a2462b754d050b)) +- support Auto Accessor syntax ([#5926](https://github.com/typescript-eslint/typescript-eslint/issues/5926)) ([becd1f8](https://github.com/typescript-eslint/typescript-eslint/commit/becd1f8581c0013399dfe71be6c265e96cedb57a)) +# [5.44.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.43.0...v5.44.0) (2022-11-21) +### Bug Fixes -# [5.29.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.28.0...v5.29.0) (2022-06-20) - +- **eslint-plugin:** [no-empty-interface] disable autofix for declaration merging with class ([#5920](https://github.com/typescript-eslint/typescript-eslint/issues/5920)) ([a4f85b8](https://github.com/typescript-eslint/typescript-eslint/commit/a4f85b8cfe38ba8ea2a2ac4a56d9b11a81a8a15a)) +- **eslint-plugin:** [no-unnecessary-condition] handle index signature type ([#5912](https://github.com/typescript-eslint/typescript-eslint/issues/5912)) ([5baad08](https://github.com/typescript-eslint/typescript-eslint/commit/5baad0893f9a90633d57fffac69af7523bd1501e)) +- **eslint-plugin:** [prefer-optional-chain] handle binary expressions in negated or ([#5992](https://github.com/typescript-eslint/typescript-eslint/issues/5992)) ([2778ff0](https://github.com/typescript-eslint/typescript-eslint/commit/2778ff0c3db011148be93ed3bea5ce07af3c81ef)) +- **typescript-estree:** don't consider a cached program unless it's specified in the current `parserOptions.project` config ([#5999](https://github.com/typescript-eslint/typescript-eslint/issues/5999)) ([530e0e6](https://github.com/typescript-eslint/typescript-eslint/commit/530e0e618cdf4bb956149bf8a8484848e1b9a1f5)) ### Features -* **website:** open issue with rule name if only one rule is enabled ([#5190](https://github.com/typescript-eslint/typescript-eslint/issues/5190)) ([b229ee4](https://github.com/typescript-eslint/typescript-eslint/commit/b229ee4ace1417d2d4f7d6cafa039f073e845c3a)) +- **eslint-plugin:** [adjacent-overload-signatures] check BlockStatement nodes ([#5998](https://github.com/typescript-eslint/typescript-eslint/issues/5998)) ([97d3e56](https://github.com/typescript-eslint/typescript-eslint/commit/97d3e56709ee19fdec39fd8b99d080db90b306e9)) +- **eslint-plugin:** [keyword-spacing] Support spacing in import-type syntax ([#5977](https://github.com/typescript-eslint/typescript-eslint/issues/5977)) ([6a735e1](https://github.com/typescript-eslint/typescript-eslint/commit/6a735e142ef67f3af6497f922cf83706867eb6b7)) +- support parsing `satisfies` operators ([#5717](https://github.com/typescript-eslint/typescript-eslint/issues/5717)) ([20d7cae](https://github.com/typescript-eslint/typescript-eslint/commit/20d7caee35ab84ae6381fdf04338c9e2b9e2bc48)) +- update to TypeScript 4.9 ([#5716](https://github.com/typescript-eslint/typescript-eslint/issues/5716)) ([4d744ea](https://github.com/typescript-eslint/typescript-eslint/commit/4d744ea10ba03c66eebcb63e8722e9f0165fbeed)) +# [5.43.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.42.1...v5.43.0) (2022-11-14) +### Bug Fixes +- **eslint-plugin:** [no-shadow] handle false positives on generics and parameters ([#5902](https://github.com/typescript-eslint/typescript-eslint/issues/5902)) ([769e8c8](https://github.com/typescript-eslint/typescript-eslint/commit/769e8c8b9a51cd3448e47d13c7b0dab0468ee23c)) +- **eslint-plugin:** [promise-function-async] handle keyword token ([#5907](https://github.com/typescript-eslint/typescript-eslint/issues/5907)) ([f25a94f](https://github.com/typescript-eslint/typescript-eslint/commit/f25a94fa75e497a6b9ec29a008bcc89818eed60d)) +### Features -# [5.28.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.27.1...v5.28.0) (2022-06-13) +- **eslint-plugin:** [consistent-type-imports] support fixing to inline types ([#5050](https://github.com/typescript-eslint/typescript-eslint/issues/5050)) ([75dcdf1](https://github.com/typescript-eslint/typescript-eslint/commit/75dcdf164d206c5530ba7cc095c4599ec90abe35)) +- **eslint-plugin:** [naming-convention] add support for "override" and "async" modifiers ([#5310](https://github.com/typescript-eslint/typescript-eslint/issues/5310)) ([#5610](https://github.com/typescript-eslint/typescript-eslint/issues/5610)) ([c759da1](https://github.com/typescript-eslint/typescript-eslint/commit/c759da169390ba490eee9ef773cc9edc88a32817)) +- **eslint-plugin:** [prefer-optional-chain] support suggesting `!foo || !foo.bar` as a valid match for the rule ([#5594](https://github.com/typescript-eslint/typescript-eslint/issues/5594)) ([923d486](https://github.com/typescript-eslint/typescript-eslint/commit/923d486c8c9c9096deac425e7a6cb0b6457eacbd)) +## [5.42.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.42.0...v5.42.1) (2022-11-07) ### Bug Fixes -* [TS4.7] allow visiting of typeParameters in TSTypeQuery ([#5166](https://github.com/typescript-eslint/typescript-eslint/issues/5166)) ([dc1f930](https://github.com/typescript-eslint/typescript-eslint/commit/dc1f9309cf04aa7314e758980ac687558482f47f)) -* **eslint-plugin:** [space-infix-ops] support for optional property without type ([#5155](https://github.com/typescript-eslint/typescript-eslint/issues/5155)) ([1f25daf](https://github.com/typescript-eslint/typescript-eslint/commit/1f25daf74e5d45077199f9ee9fa9bf31107f4089)) +- **ast-spec:** correct misnamed ExportNamedDeclaration AST type ([#5913](https://github.com/typescript-eslint/typescript-eslint/issues/5913)) ([e88f4fa](https://github.com/typescript-eslint/typescript-eslint/commit/e88f4fa1d0127ba0ddeff578ec67f2e66a1de68b)) +- **eslint-plugin:** isTypeReadonly stack overflow ([#5875](https://github.com/typescript-eslint/typescript-eslint/issues/5875)) ([#5876](https://github.com/typescript-eslint/typescript-eslint/issues/5876)) ([2d9a33c](https://github.com/typescript-eslint/typescript-eslint/commit/2d9a33cfb2db53d76246a59253daaf2abb19ee57)) +# [5.42.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.41.0...v5.42.0) (2022-10-31) -### Features - -* **ast-spec:** extract `AssignmentOperatorToText` ([#3570](https://github.com/typescript-eslint/typescript-eslint/issues/3570)) ([45f75e6](https://github.com/typescript-eslint/typescript-eslint/commit/45f75e6b869f4160a45a6890d794aba004356ad7)) -* **eslint-plugin:** [consistent-generic-constructors] add rule ([#4924](https://github.com/typescript-eslint/typescript-eslint/issues/4924)) ([921cdf1](https://github.com/typescript-eslint/typescript-eslint/commit/921cdf17e548845311d0591249616ec844503926)) +### Bug Fixes +- **ast-spec:** add TSQualifiedName to TypeNode union ([#5906](https://github.com/typescript-eslint/typescript-eslint/issues/5906)) ([5c316c1](https://github.com/typescript-eslint/typescript-eslint/commit/5c316c12f09d58aee6ee634a8055533f361f1589)) +- **eslint-plugin:** [no-extra-parens] handle type assertion in extends clause ([#5901](https://github.com/typescript-eslint/typescript-eslint/issues/5901)) ([8ed7219](https://github.com/typescript-eslint/typescript-eslint/commit/8ed72192c274249d26628fb125796e71318b857a)) +- **eslint-plugin:** enable react/jsx-curly-brace-presence lint rule in website package ([#5894](https://github.com/typescript-eslint/typescript-eslint/issues/5894)) ([344322a](https://github.com/typescript-eslint/typescript-eslint/commit/344322add846d03c6c9981e486b09e6ba1196555)) +- **typescript-estree:** don't allow single-run unless we're in type-aware linting mode ([#5893](https://github.com/typescript-eslint/typescript-eslint/issues/5893)) ([891b087](https://github.com/typescript-eslint/typescript-eslint/commit/891b0879ba9c64a4722b8c0bf9e599a725b6d6df)) +### Features +- **eslint-plugin:** [member-ordering] add natural sort order ([#5662](https://github.com/typescript-eslint/typescript-eslint/issues/5662)) ([1eaae09](https://github.com/typescript-eslint/typescript-eslint/commit/1eaae09ecca359f366b94f6a04665403f48b05c7)) +- **eslint-plugin:** [no-invalid-void-type] better report message for void used as a constituent inside a function return type ([#5274](https://github.com/typescript-eslint/typescript-eslint/issues/5274)) ([d806bda](https://github.com/typescript-eslint/typescript-eslint/commit/d806bda82343712a24e3c78b9b34d4345dd1de3b)) +- **scope-manager:** ignore ECMA version ([#5881](https://github.com/typescript-eslint/typescript-eslint/issues/5881)) ([3b8d449](https://github.com/typescript-eslint/typescript-eslint/commit/3b8d449696c319690536a18a48ef32749dc2f559)) +- **typescript-estree:** clarify docs and error for program project without matching TSConfig ([#5762](https://github.com/typescript-eslint/typescript-eslint/issues/5762)) ([67744db](https://github.com/typescript-eslint/typescript-eslint/commit/67744db31f61acab14b5fe027fbc2844ba198c97)) +- **utils:** add `RuleTester` API for top-level dependency constraints ([#5896](https://github.com/typescript-eslint/typescript-eslint/issues/5896)) ([0520d53](https://github.com/typescript-eslint/typescript-eslint/commit/0520d53536af411d66ce2ce0dd478365e67adbac)) +- **website:** Add a happy message to playground output pane when no errors or AST ([#5868](https://github.com/typescript-eslint/typescript-eslint/issues/5868)) ([#5873](https://github.com/typescript-eslint/typescript-eslint/issues/5873)) ([c4e0d86](https://github.com/typescript-eslint/typescript-eslint/commit/c4e0d8678e0398f3ab85510f40ad6f97832b9e6d)) +### Reverts -## [5.27.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.27.0...v5.27.1) (2022-06-06) +- Revert "feat(scope-manager): ignore ECMA version" (#5888) ([2ee81df](https://github.com/typescript-eslint/typescript-eslint/commit/2ee81df5a365d82ef4b3dfc124d4ec39c7bcb725)), closes [#5888](https://github.com/typescript-eslint/typescript-eslint/issues/5888) [#5881](https://github.com/typescript-eslint/typescript-eslint/issues/5881) +# [5.41.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.40.1...v5.41.0) (2022-10-24) ### Bug Fixes -* **eslint-plugin:** [space-infix-ops] correct PropertyDefinition with typeAnnotation ([#5113](https://github.com/typescript-eslint/typescript-eslint/issues/5113)) ([d320174](https://github.com/typescript-eslint/typescript-eslint/commit/d320174f40a74b34e6b6e4c88128ef6e736311d8)) -* **eslint-plugin:** [space-infix-ops] regression fix for conditional types ([#5135](https://github.com/typescript-eslint/typescript-eslint/issues/5135)) ([e5238c8](https://github.com/typescript-eslint/typescript-eslint/commit/e5238c84e56e7c34174b2c6f1e3ea59456797c2f)) -* **eslint-plugin:** [space-infix-ops] regression fix for type aliases ([#5138](https://github.com/typescript-eslint/typescript-eslint/issues/5138)) ([4e13deb](https://github.com/typescript-eslint/typescript-eslint/commit/4e13deb05fbd8724996156b15b65f6a66794a7cc)) +- **eslint-plugin:** [no-base-to-string] ignore Error, URL, and URLSearchParams by default ([#5839](https://github.com/typescript-eslint/typescript-eslint/issues/5839)) ([96e1c6c](https://github.com/typescript-eslint/typescript-eslint/commit/96e1c6c171a34b0793c50c3dba853c3999a6bd49)) +- **type-utils:** prevent stack overflow in `isTypeReadonly` ([#5860](https://github.com/typescript-eslint/typescript-eslint/issues/5860)) ([a6d8f7e](https://github.com/typescript-eslint/typescript-eslint/commit/a6d8f7edb84f9f6dd59a76faf53bf686756e2aed)), closes [#4476](https://github.com/typescript-eslint/typescript-eslint/issues/4476) +### Features +- **eslint-plugin:** [no-unsafe-declaration-merging] switch to use scope analysis instead of type information ([#5865](https://github.com/typescript-eslint/typescript-eslint/issues/5865)) ([e70a10a](https://github.com/typescript-eslint/typescript-eslint/commit/e70a10aea684bc6bca05b69bfce3bae769a5f5ab)) +- **eslint-plugin:** add no-unsafe-declaration-merging ([#5840](https://github.com/typescript-eslint/typescript-eslint/issues/5840)) ([3728031](https://github.com/typescript-eslint/typescript-eslint/commit/3728031c659dabde7658cd54184951d4be9aabcb)) +## [5.40.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.40.0...v5.40.1) (2022-10-17) +### Bug Fixes -# [5.27.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.26.0...v5.27.0) (2022-05-30) +- **eslint-plugin:** Skip missing 'rest' tuple type arguments in no-misused-promises ([#5809](https://github.com/typescript-eslint/typescript-eslint/issues/5809)) ([c5beaa2](https://github.com/typescript-eslint/typescript-eslint/commit/c5beaa2ea340985211ca5c12821842c54f5170f0)), closes [#5807](https://github.com/typescript-eslint/typescript-eslint/issues/5807) +- **utils:** add missing dependency on `@types/semver` ([#5825](https://github.com/typescript-eslint/typescript-eslint/issues/5825)) ([17b8879](https://github.com/typescript-eslint/typescript-eslint/commit/17b887933a0640d6fe843622e0520c0315144bb7)) +# [5.40.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.39.0...v5.40.0) (2022-10-10) ### Bug Fixes -* **eslint-plugin:** [no-type-alias] handle Template Literal Types ([#5092](https://github.com/typescript-eslint/typescript-eslint/issues/5092)) ([8febf11](https://github.com/typescript-eslint/typescript-eslint/commit/8febf11a9296d1c0d7ccdf91ef9ab92ec8dfc39c)) -* **types:** remove leftovers from removal of useJSXTextNode ([#5091](https://github.com/typescript-eslint/typescript-eslint/issues/5091)) ([f9c3647](https://github.com/typescript-eslint/typescript-eslint/commit/f9c3647cb637c8d1ee461b471da9d817ccbde77c)) - +- **eslint-plugin:** [consistent-indexed-object-style] handle interface generic ([#5746](https://github.com/typescript-eslint/typescript-eslint/issues/5746)) ([7a8a0a3](https://github.com/typescript-eslint/typescript-eslint/commit/7a8a0a3c500ca726d2ab3bee0ae9f3fb9d8d39b8)) +- **eslint-plugin:** [no-unnecessary-condition] handle void ([#5766](https://github.com/typescript-eslint/typescript-eslint/issues/5766)) ([ac8f06b](https://github.com/typescript-eslint/typescript-eslint/commit/ac8f06b68dca7666bfb78fb38d6ccc07f676e435)) ### Features -* [4.7] support new extensions ([#5027](https://github.com/typescript-eslint/typescript-eslint/issues/5027)) ([efc147b](https://github.com/typescript-eslint/typescript-eslint/commit/efc147b04dce52ab17415b6a4ae4076b944b9036)) -* [TS4.7] support type parameters for `typeof` ([#5067](https://github.com/typescript-eslint/typescript-eslint/issues/5067)) ([836de79](https://github.com/typescript-eslint/typescript-eslint/commit/836de79e8d1bff43149168cc913a4c2b60e79bf6)) -* bump dependency ranges to TypeScript 4.7 ([#5082](https://github.com/typescript-eslint/typescript-eslint/issues/5082)) ([c4310b1](https://github.com/typescript-eslint/typescript-eslint/commit/c4310b1aac35c7d31b826f0602eca6a5900a09ee)) -* **eslint-plugin:** [ban-ts-comment] add descriptionFormat option ([#5026](https://github.com/typescript-eslint/typescript-eslint/issues/5026)) ([1fb31a4](https://github.com/typescript-eslint/typescript-eslint/commit/1fb31a4b3e05734f801ade0450fea33494e4d5e6)) -* **eslint-plugin:** [no-misused-promises] warn when spreading promises ([#5053](https://github.com/typescript-eslint/typescript-eslint/issues/5053)) ([61ffa9e](https://github.com/typescript-eslint/typescript-eslint/commit/61ffa9ed70e3cac6eca50a6c3cc5a0f1e7dec11c)) -* **eslint-plugin:** [space-infix-ops] missing error report for conditional types ([#5041](https://github.com/typescript-eslint/typescript-eslint/issues/5041)) ([0bfab6c](https://github.com/typescript-eslint/typescript-eslint/commit/0bfab6c9f5c5e243268200cf9368acf39ea099f8)) - +- **eslint-plugin:** Check 'rest' parameters in no-misused-promises ([#5731](https://github.com/typescript-eslint/typescript-eslint/issues/5731)) ([6477f38](https://github.com/typescript-eslint/typescript-eslint/commit/6477f3855627cc257edc021b859711d4a5847a12)), closes [#4015](https://github.com/typescript-eslint/typescript-eslint/issues/4015) +- **utils:** add dependency constraint filtering for `RuleTester` ([#5750](https://github.com/typescript-eslint/typescript-eslint/issues/5750)) ([121f4c0](https://github.com/typescript-eslint/typescript-eslint/commit/121f4c0e7252def95d917e4734e933e53e29d501)) +- **website:** store options TypeScript, Enable jsx and AST Viewer in browser's local storage ([#5769](https://github.com/typescript-eslint/typescript-eslint/issues/5769)) ([77d2336](https://github.com/typescript-eslint/typescript-eslint/commit/77d2336594ca10b47c0f7978ae64f87d24a25d33)) +# [5.39.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.38.1...v5.39.0) (2022-10-03) +### Features +- **eslint-plugin:** allow using void as a default type for a generic argument if allowInGenericTypeArguments is specified ([#5671](https://github.com/typescript-eslint/typescript-eslint/issues/5671)) ([bb46ef0](https://github.com/typescript-eslint/typescript-eslint/commit/bb46ef0817fe03ef71f8e0f3df0cf96bc355e068)) -# [5.26.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.25.0...v5.26.0) (2022-05-23) - - -### Bug Fixes +## [5.38.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.38.0...v5.38.1) (2022-09-26) -* **ast-spec:** add `SpreadElement` to `ArrayExpression.elements` ([#5025](https://github.com/typescript-eslint/typescript-eslint/issues/5025)) ([9f3121b](https://github.com/typescript-eslint/typescript-eslint/commit/9f3121b228b9c066bff7a6011aecf269ac55f17c)) -* **eslint-plugin:** [member-delimiter-style] autofixer result is not as expected when comments after the delimiter with option `delimiter: 'none'` ([#5029](https://github.com/typescript-eslint/typescript-eslint/issues/5029)) ([ed7b5f6](https://github.com/typescript-eslint/typescript-eslint/commit/ed7b5f61d93799fec3e38a87935ab9caa3abe279)) -* **eslint-plugin:** [member-delimiter-style] autofixer result is not as expected with option `delimiter: 'none'` ([#5023](https://github.com/typescript-eslint/typescript-eslint/issues/5023)) ([9e97a11](https://github.com/typescript-eslint/typescript-eslint/commit/9e97a11ecd80be5c63c980bfe8d8e57400221cec)) -* **eslint-plugin:** [prefer-readonly] correct issue with anonymus functions ([#4974](https://github.com/typescript-eslint/typescript-eslint/issues/4974)) ([952e2f0](https://github.com/typescript-eslint/typescript-eslint/commit/952e2f068862dde089ec03d3eb5452d1ee3e9271)), closes [#2590](https://github.com/typescript-eslint/typescript-eslint/issues/2590) +**Note:** Version bump only for package @typescript-eslint/typescript-eslint +# [5.38.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.37.0...v5.38.0) (2022-09-19) ### Features -* [4.7] support instantiation expressions ([#4938](https://github.com/typescript-eslint/typescript-eslint/issues/4938)) ([79fbc77](https://github.com/typescript-eslint/typescript-eslint/commit/79fbc7743ae5dce3190f8168776e0204755390ad)) -* [4.7] support optional variance annotation ([#4831](https://github.com/typescript-eslint/typescript-eslint/issues/4831)) ([7e7b24c](https://github.com/typescript-eslint/typescript-eslint/commit/7e7b24c196e6d968e48f97f46feae5e7027e22d2)) -* **typescript-estree:** `extends` constraints for `infer` ([#4830](https://github.com/typescript-eslint/typescript-eslint/issues/4830)) ([8cbbcc3](https://github.com/typescript-eslint/typescript-eslint/commit/8cbbcc3d317779e0dcba15d3835137f38383de34)) +- **website:** add warning on top of formatting rule docs pages ([#5598](https://github.com/typescript-eslint/typescript-eslint/issues/5598)) ([5dfa2e9](https://github.com/typescript-eslint/typescript-eslint/commit/5dfa2e9a33491905e99d8940dbdac0b31ada4858)) +# [5.37.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.36.2...v5.37.0) (2022-09-12) +### Bug Fixes +- **eslint-plugin:** [strict-boolean-expressions] check all conditions in a logical operator chain ([#5539](https://github.com/typescript-eslint/typescript-eslint/issues/5539)) ([77d76e2](https://github.com/typescript-eslint/typescript-eslint/commit/77d76e21cdc2e100c729c839c292e82ab7c554c5)) +- **website:** Use extended base rule name from file's meta ([#5621](https://github.com/typescript-eslint/typescript-eslint/issues/5621)) ([7fd2f89](https://github.com/typescript-eslint/typescript-eslint/commit/7fd2f89ae732ca12ec83fad278362032473ff3ca)) +### Features -# [5.25.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.24.0...v5.25.0) (2022-05-17) +- **docs:** always expanding collapsible sidebar menus under docs ([#5608](https://github.com/typescript-eslint/typescript-eslint/issues/5608)) ([8176fb1](https://github.com/typescript-eslint/typescript-eslint/commit/8176fb15299943cbf20385eb0ea7ba877e193285)) +## [5.36.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.36.1...v5.36.2) (2022-09-05) ### Bug Fixes -* **eslint-plugin:** [typedef] stop enforcing rule for assignment expressions ([#4958](https://github.com/typescript-eslint/typescript-eslint/issues/4958)) ([04a216c](https://github.com/typescript-eslint/typescript-eslint/commit/04a216c39c02085fe5d555ce81bdced0e563a7c4)) -* **eslint-plugin:** strict config should not extend recommended ([#5005](https://github.com/typescript-eslint/typescript-eslint/issues/5005)) ([05d71c2](https://github.com/typescript-eslint/typescript-eslint/commit/05d71c2ebd8e072aa4e8ee3ea8521de00e47d4ca)) -* **website:** correct Presets link to be Configs ([#5004](https://github.com/typescript-eslint/typescript-eslint/issues/5004)) ([e18e91c](https://github.com/typescript-eslint/typescript-eslint/commit/e18e91c6cfb1ee93bfff3770ea4d8f807d5ced0b)) +- **eslint-plugin:** [no-extra-parens] handle generic ts array type. ([#5550](https://github.com/typescript-eslint/typescript-eslint/issues/5550)) ([0d6a190](https://github.com/typescript-eslint/typescript-eslint/commit/0d6a190c56fb3489f9f554b9035a008e29cc08ec)) +- **scope-manager:** correct handling for class static blocks ([#5580](https://github.com/typescript-eslint/typescript-eslint/issues/5580)) ([35bb8dd](https://github.com/typescript-eslint/typescript-eslint/commit/35bb8ddac1b46397f6447c1a6e1e4e1774dd7957)) +- **typescript-estree:** don't double add decorators to a parameter property's parameter ([#5582](https://github.com/typescript-eslint/typescript-eslint/issues/5582)) ([863694c](https://github.com/typescript-eslint/typescript-eslint/commit/863694cbc71b5158ca6a018de8707c9f9fbc22c3)) +## [5.36.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.36.0...v5.36.1) (2022-08-30) -### Features +### Bug Fixes -* **eslint-plugin:** [no-empty-function] new allow option overrideMethods ([#4923](https://github.com/typescript-eslint/typescript-eslint/issues/4923)) ([13c05ae](https://github.com/typescript-eslint/typescript-eslint/commit/13c05aefb0e6531d320629e04b7207a3baebacb0)) -* **eslint-plugin:** deprecate `no-duplicate-imports` in favour of `import/no-duplicates` ([#4973](https://github.com/typescript-eslint/typescript-eslint/issues/4973)) ([1d2e41a](https://github.com/typescript-eslint/typescript-eslint/commit/1d2e41ada1979c081130d19b229c82bf1a69b7b4)) -* update to TypeScript 4.7-rc ([#4829](https://github.com/typescript-eslint/typescript-eslint/issues/4829)) ([6fe783c](https://github.com/typescript-eslint/typescript-eslint/commit/6fe783c20aebe26ef42b526e4a59a9be84dd5643)) +- **typescript-estree:** fix decorator regression for pre TS4.8 ([#5574](https://github.com/typescript-eslint/typescript-eslint/issues/5574)) ([a603015](https://github.com/typescript-eslint/typescript-eslint/commit/a603015c93a6ea96d500c57bec1e284340141b1f)) +# [5.36.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.35.1...v5.36.0) (2022-08-30) +### Bug Fixes +- **eslint-plugin:** revert [#5266](https://github.com/typescript-eslint/typescript-eslint/issues/5266) ([#5564](https://github.com/typescript-eslint/typescript-eslint/issues/5564)) ([7a8afe2](https://github.com/typescript-eslint/typescript-eslint/commit/7a8afe29039c6c80fe584acaf5d933424a4452a9)) +### Features -# [5.24.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.23.0...v5.24.0) (2022-05-16) +- support TypeScript 4.8 ([#5551](https://github.com/typescript-eslint/typescript-eslint/issues/5551)) ([81450ed](https://github.com/typescript-eslint/typescript-eslint/commit/81450ed7eaede74b384e9a91a84e9b4d34513866)) +## [5.35.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.35.0...v5.35.1) (2022-08-24) ### Bug Fixes -* **eslint-plugin:** [array-type] in fixer add missing parens for constructor types [#4756](https://github.com/typescript-eslint/typescript-eslint/issues/4756) ([#4971](https://github.com/typescript-eslint/typescript-eslint/issues/4971)) ([0377070](https://github.com/typescript-eslint/typescript-eslint/commit/03770708900da663eb64c19465b3f937bab55b3d)) -* **website:** missing colon before tip notes in configs.md ([#4982](https://github.com/typescript-eslint/typescript-eslint/issues/4982)) ([f3a1aba](https://github.com/typescript-eslint/typescript-eslint/commit/f3a1aba6704c5978c9f6002d6b1fc076421103d1)) +- **eslint-plugin:** correct rule schemas to pass ajv validation ([#5531](https://github.com/typescript-eslint/typescript-eslint/issues/5531)) ([dbf8b56](https://github.com/typescript-eslint/typescript-eslint/commit/dbf8b569dbada29e4a295d6c265976e55de1b2aa)) +# [5.35.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.34.0...v5.35.0) (2022-08-24) ### Features -* **eslint-plugin:** Add BigInt object type to default ban-types list ([#4970](https://github.com/typescript-eslint/typescript-eslint/issues/4970)) ([1867728](https://github.com/typescript-eslint/typescript-eslint/commit/1867728ba104a6a21941ed300828110964a43b96)) -* **eslint-plugin:** add new 'strict' config ([#4706](https://github.com/typescript-eslint/typescript-eslint/issues/4706)) ([4a500b2](https://github.com/typescript-eslint/typescript-eslint/commit/4a500b2d92a91873dbb729793d1ee1c36ef06ed8)) +- **eslint-plugin:** [explicit-member-accessibility] suggest adding explicit accessibility specifiers ([#5492](https://github.com/typescript-eslint/typescript-eslint/issues/5492)) ([0edb94a](https://github.com/typescript-eslint/typescript-eslint/commit/0edb94aee55e1ec6afa7f46f99a9b308bbb66301)) +# [5.34.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.33.1...v5.34.0) (2022-08-22) +### Bug Fixes +- **ast-spec:** NewExpression argument can be SpreadElement now ([#5422](https://github.com/typescript-eslint/typescript-eslint/issues/5422)) ([3ced62f](https://github.com/typescript-eslint/typescript-eslint/commit/3ced62fb8474ed377c1336ac3e855f0270ce9beb)) +- **eslint-plugin:** [no-useless-constructor] handle parameter decorator ([#5450](https://github.com/typescript-eslint/typescript-eslint/issues/5450)) ([864dbcf](https://github.com/typescript-eslint/typescript-eslint/commit/864dbcfccba274fe1b26eac8aeeaf2a2355b5969)) +- **scope-manager:** visit static blocks ([#5489](https://github.com/typescript-eslint/typescript-eslint/issues/5489)) ([78745c2](https://github.com/typescript-eslint/typescript-eslint/commit/78745c2092064446837b5683892001030a8bb4e2)) +### Features -# [5.23.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.22.0...v5.23.0) (2022-05-09) +- **eslint-plugin:** [prefer-optional-chain] support suggesting `!foo || !foo.bar` as a valid match for the rule ([#5266](https://github.com/typescript-eslint/typescript-eslint/issues/5266)) ([aca935c](https://github.com/typescript-eslint/typescript-eslint/commit/aca935c9696712d4aff18144c4690db4d6ba9bf9)) +- **types:** add unbound property in parser options ([#5419](https://github.com/typescript-eslint/typescript-eslint/issues/5419)) ([e08a9dd](https://github.com/typescript-eslint/typescript-eslint/commit/e08a9dd79365c1b1f5d0145ab69377f7d45f8a4f)) +## [5.33.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.33.0...v5.33.1) (2022-08-15) ### Bug Fixes -* **ast-spec:** correct `AwaitExpression.argument` type ([#4880](https://github.com/typescript-eslint/typescript-eslint/issues/4880)) ([3ec5f53](https://github.com/typescript-eslint/typescript-eslint/commit/3ec5f53bad79b133ef5dee71c402160b3acf13cf)) -* **eslint-plugin:** [no-restricted-imports] allow type import as long as there's one matching pattern ([#4898](https://github.com/typescript-eslint/typescript-eslint/issues/4898)) ([0419d28](https://github.com/typescript-eslint/typescript-eslint/commit/0419d287b637e805c33036a45760badc2498e19b)) -* **eslint-plugin:** [no-unnecessary-type-constraint] change to suggestion fix, fix multiple trailing comma failures ([#4901](https://github.com/typescript-eslint/typescript-eslint/issues/4901)) ([4507ac8](https://github.com/typescript-eslint/typescript-eslint/commit/4507ac84c76da0ced43b6679305afe1891e7afca)) +- missing placeholders in violation messages for `no-unnecessary-type-constraint` and `no-unsafe-argument` (and enable `eslint-plugin/recommended` rules internally) ([#5453](https://github.com/typescript-eslint/typescript-eslint/issues/5453)) ([d023910](https://github.com/typescript-eslint/typescript-eslint/commit/d0239104f4dbffd2b5ecdb19e520c7d4b71962e0)) +# [5.33.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.32.0...v5.33.0) (2022-08-08) -### Features +### Bug Fixes -* **utils:** update eslint types ([#4896](https://github.com/typescript-eslint/typescript-eslint/issues/4896)) ([da48527](https://github.com/typescript-eslint/typescript-eslint/commit/da485279f13cb95db1ee131a4f9c5367d54020fe)) +- **eslint-plugin:** [no-extra-parens] handle await with type assertion ([#5428](https://github.com/typescript-eslint/typescript-eslint/issues/5428)) ([e03826f](https://github.com/typescript-eslint/typescript-eslint/commit/e03826f08ce8bfdd6d6702025d975cfb7d867097)) +- **website:** add explicit frontmatter description to rule docs ([#5429](https://github.com/typescript-eslint/typescript-eslint/issues/5429)) ([63cba5f](https://github.com/typescript-eslint/typescript-eslint/commit/63cba5f4c1884e102927b3b14b18a00e96ac63a1)) +### Features +- **eslint-plugin:** [member-ordering] support static blocks ([#5417](https://github.com/typescript-eslint/typescript-eslint/issues/5417)) ([5983e5a](https://github.com/typescript-eslint/typescript-eslint/commit/5983e5ab3bfb94fec782bea54a37457fe31db545)) +- **eslint-plugin:** [prefer-as-const] adds support for class properties ([#5413](https://github.com/typescript-eslint/typescript-eslint/issues/5413)) ([d2394f8](https://github.com/typescript-eslint/typescript-eslint/commit/d2394f810960fda07b9c8affd47b769d16f4b8cb)) +# [5.32.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.31.0...v5.32.0) (2022-08-01) +### Features -# [5.22.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.21.0...v5.22.0) (2022-05-02) +- **eslint-plugin:** [no-use-before-define] add "allowNamedExports" option ([#5397](https://github.com/typescript-eslint/typescript-eslint/issues/5397)) ([ad412cd](https://github.com/typescript-eslint/typescript-eslint/commit/ad412cdd74dc5619fbe4bf27c0a5eb5c5a4b65ca)) +# [5.31.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.7...v5.31.0) (2022-07-25) ### Bug Fixes -* add rule to vscode settings ([#4881](https://github.com/typescript-eslint/typescript-eslint/issues/4881)) ([3eab889](https://github.com/typescript-eslint/typescript-eslint/commit/3eab889022c9d1617f275017d6951f663ea57f24)) -* **eslint-plugin:** [comma-spacing] verify `nextToken` exists ([#4868](https://github.com/typescript-eslint/typescript-eslint/issues/4868)) ([23746f8](https://github.com/typescript-eslint/typescript-eslint/commit/23746f8babace7c2354368d6fb0881be26e19c41)) - +- **eslint-plugin:** [typedef] Support nested array destructuring with type annotation ([#5311](https://github.com/typescript-eslint/typescript-eslint/issues/5311)) ([6d19efe](https://github.com/typescript-eslint/typescript-eslint/commit/6d19efed16d1cf0357ad363b6373d2021c49a8c8)) +- **scope-manager:** handle typeParameters of TSInstantiationExpression ([#5355](https://github.com/typescript-eslint/typescript-eslint/issues/5355)) ([2595ccf](https://github.com/typescript-eslint/typescript-eslint/commit/2595ccf67cd5158edbd6bebd9ac2dbd8bbd8b99c)) ### Features -* **ast-spec:** add fixture test framework and some initial fixtures ([#3258](https://github.com/typescript-eslint/typescript-eslint/issues/3258)) ([f3cf87b](https://github.com/typescript-eslint/typescript-eslint/commit/f3cf87bf20fd0542f92a96a318aa9ee5bf23c1f6)) -* **eslint-plugin:** [no-duplicate-enum-values] add rule ([#4833](https://github.com/typescript-eslint/typescript-eslint/issues/4833)) ([5899164](https://github.com/typescript-eslint/typescript-eslint/commit/5899164b35d91106512a2720b23ba92e1893132f)) +- **eslint-plugin:** [consistent-generic-ctors] check class field declaration ([#5288](https://github.com/typescript-eslint/typescript-eslint/issues/5288)) ([48f996e](https://github.com/typescript-eslint/typescript-eslint/commit/48f996e8dda79c9c865e8ca6552069902836648b)) +- **eslint-plugin:** [prefer-nullish-coalescing] add ignoreTernaryTests option ([#4965](https://github.com/typescript-eslint/typescript-eslint/issues/4965)) ([f82727f](https://github.com/typescript-eslint/typescript-eslint/commit/f82727ffeb97475c07773ca1d1e5b9609fcc5e68)) +## [5.30.7](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.6...v5.30.7) (2022-07-18) +### Bug Fixes +- **eslint-plugin:** [no-inferrable] fix optional param to valid code ([#5342](https://github.com/typescript-eslint/typescript-eslint/issues/5342)) ([98f6d5e](https://github.com/typescript-eslint/typescript-eslint/commit/98f6d5e6d08d1eb9789da52a15f337f5f53438bd)) +- **eslint-plugin:** [no-unused-vars] highlight last write reference ([#5267](https://github.com/typescript-eslint/typescript-eslint/issues/5267)) ([c3f199a](https://github.com/typescript-eslint/typescript-eslint/commit/c3f199a65a16aa72f5bb83e81a1ce0ffb5f69772)) +- expose types supporting old versions of typescript ([#5339](https://github.com/typescript-eslint/typescript-eslint/issues/5339)) ([4ba9bdb](https://github.com/typescript-eslint/typescript-eslint/commit/4ba9bdb93f87e6bc370f13aa1de48f435abe3f88)) +- **scope-manager:** allow visiting of constraint in infer type ([#5331](https://github.com/typescript-eslint/typescript-eslint/issues/5331)) ([b2846a1](https://github.com/typescript-eslint/typescript-eslint/commit/b2846a16777a3aea7b1e6ac9d81b9b6dce0bb874)) +## [5.30.6](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.5...v5.30.6) (2022-07-11) -# [5.21.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.20.0...v5.21.0) (2022-04-25) +**Note:** Version bump only for package @typescript-eslint/typescript-eslint +## [5.30.5](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.4...v5.30.5) (2022-07-04) ### Bug Fixes -* **eslint-plugin:** [no-misused-promises] prioritize false returns when checking whether a function returns only void ([#4841](https://github.com/typescript-eslint/typescript-eslint/issues/4841)) ([ccadb60](https://github.com/typescript-eslint/typescript-eslint/commit/ccadb6075d6977c4921ffc09fa40f515f4d497c5)) -* **eslint-plugin:** [no-namespace] fix false positive for exported namespaces when allowDeclarations=true ([#4844](https://github.com/typescript-eslint/typescript-eslint/issues/4844)) ([4e7c9be](https://github.com/typescript-eslint/typescript-eslint/commit/4e7c9be6ff7e2448f4151563d7921cd285c2e349)) -* **eslint-plugin:** [space-infix-ops] fix no error when right type is function ([#4848](https://github.com/typescript-eslint/typescript-eslint/issues/4848)) ([d74d559](https://github.com/typescript-eslint/typescript-eslint/commit/d74d559c25e336c3ebe917bf5c43e14ffa2de694)) +- **eslint-plugin:** [consistent-indexed-object-style] fix record mode fixer for generics with a default value ([#5280](https://github.com/typescript-eslint/typescript-eslint/issues/5280)) ([57f032c](https://github.com/typescript-eslint/typescript-eslint/commit/57f032c2e6a822c049177713778d0077ee138d9a)) +## [5.30.4](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.3...v5.30.4) (2022-07-03) -### Features +**Note:** Version bump only for package @typescript-eslint/typescript-eslint + +## [5.30.3](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.2...v5.30.3) (2022-07-01) -* **eslint-plugin:** [parameter-properties] add rule to replace `no-parameter-properties` ([#4622](https://github.com/typescript-eslint/typescript-eslint/issues/4622)) ([88ed9ec](https://github.com/typescript-eslint/typescript-eslint/commit/88ed9ec9d6b971a9533565920fdcd6890ea941e9)) +**Note:** Version bump only for package @typescript-eslint/typescript-eslint +## [5.30.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.1...v5.30.2) (2022-07-01) +**Note:** Version bump only for package @typescript-eslint/typescript-eslint +## [5.30.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.0...v5.30.1) (2022-07-01) +### Bug Fixes -# [5.20.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.19.0...v5.20.0) (2022-04-18) +- **eslint-plugin:** [no-base-to-string] add missing apostrophe to message ([#5270](https://github.com/typescript-eslint/typescript-eslint/issues/5270)) ([d320174](https://github.com/typescript-eslint/typescript-eslint/commit/58034e343a167ca7751b54d2b2a0e7d3852aabec)) +# [5.30.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.29.0...v5.30.0) (2022-06-27) ### Features -* **eslint-plugin:** [no-magic-numbers] ignoreTypeIndexes option ([#4789](https://github.com/typescript-eslint/typescript-eslint/issues/4789)) ([5e79451](https://github.com/typescript-eslint/typescript-eslint/commit/5e794512bf124c39de76d4e2cf8a3d6cfb08f1a8)) +- **eslint-plugin:** [no-shadow] add shadowed variable location to the error message ([#5183](https://github.com/typescript-eslint/typescript-eslint/issues/5183)) ([8ca08e9](https://github.com/typescript-eslint/typescript-eslint/commit/8ca08e9f18d59b29715c667fbb7d237f6e9a96ba)) +- treat `this` in `typeof this` as a `ThisExpression` ([#4382](https://github.com/typescript-eslint/typescript-eslint/issues/4382)) ([b04b2ce](https://github.com/typescript-eslint/typescript-eslint/commit/b04b2ce1ba90d94718891f2562dd210a6d7b8609)) +# [5.29.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.28.0...v5.29.0) (2022-06-20) +### Features +- **website:** open issue with rule name if only one rule is enabled ([#5190](https://github.com/typescript-eslint/typescript-eslint/issues/5190)) ([b229ee4](https://github.com/typescript-eslint/typescript-eslint/commit/b229ee4ace1417d2d4f7d6cafa039f073e845c3a)) +# [5.28.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.27.1...v5.28.0) (2022-06-13) -# [5.19.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.18.0...v5.19.0) (2022-04-11) +### Bug Fixes +- [TS4.7] allow visiting of typeParameters in TSTypeQuery ([#5166](https://github.com/typescript-eslint/typescript-eslint/issues/5166)) ([dc1f930](https://github.com/typescript-eslint/typescript-eslint/commit/dc1f9309cf04aa7314e758980ac687558482f47f)) +- **eslint-plugin:** [space-infix-ops] support for optional property without type ([#5155](https://github.com/typescript-eslint/typescript-eslint/issues/5155)) ([1f25daf](https://github.com/typescript-eslint/typescript-eslint/commit/1f25daf74e5d45077199f9ee9fa9bf31107f4089)) -### Bug Fixes +### Features -* **eslint-plugin:** update code to use estree range instead of ts pos/end [#4723](https://github.com/typescript-eslint/typescript-eslint/issues/4723) ([#4790](https://github.com/typescript-eslint/typescript-eslint/issues/4790)) ([a1e9fc4](https://github.com/typescript-eslint/typescript-eslint/commit/a1e9fc4cb19e7655613ebe6f4dd911b5427b0367)) +- **ast-spec:** extract `AssignmentOperatorToText` ([#3570](https://github.com/typescript-eslint/typescript-eslint/issues/3570)) ([45f75e6](https://github.com/typescript-eslint/typescript-eslint/commit/45f75e6b869f4160a45a6890d794aba004356ad7)) +- **eslint-plugin:** [consistent-generic-constructors] add rule ([#4924](https://github.com/typescript-eslint/typescript-eslint/issues/4924)) ([921cdf1](https://github.com/typescript-eslint/typescript-eslint/commit/921cdf17e548845311d0591249616ec844503926)) +## [5.27.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.27.0...v5.27.1) (2022-06-06) -### Features +### Bug Fixes -* **eslint-plugin:** [unified-signatures] add `ignoreDifferentlyNamedParameters` option ([#4659](https://github.com/typescript-eslint/typescript-eslint/issues/4659)) ([fdf95e0](https://github.com/typescript-eslint/typescript-eslint/commit/fdf95e02c45e137325c9ddd9d30e7f6b404f4514)) -* **eslint-plugin:** add support for valid number and bigint intersections in restrict-plus-operands rule ([#4795](https://github.com/typescript-eslint/typescript-eslint/issues/4795)) ([19c600a](https://github.com/typescript-eslint/typescript-eslint/commit/19c600a3dd485669cb87ae8f81b010e65eee1df8)) +- **eslint-plugin:** [space-infix-ops] correct PropertyDefinition with typeAnnotation ([#5113](https://github.com/typescript-eslint/typescript-eslint/issues/5113)) ([d320174](https://github.com/typescript-eslint/typescript-eslint/commit/d320174f40a74b34e6b6e4c88128ef6e736311d8)) +- **eslint-plugin:** [space-infix-ops] regression fix for conditional types ([#5135](https://github.com/typescript-eslint/typescript-eslint/issues/5135)) ([e5238c8](https://github.com/typescript-eslint/typescript-eslint/commit/e5238c84e56e7c34174b2c6f1e3ea59456797c2f)) +- **eslint-plugin:** [space-infix-ops] regression fix for type aliases ([#5138](https://github.com/typescript-eslint/typescript-eslint/issues/5138)) ([4e13deb](https://github.com/typescript-eslint/typescript-eslint/commit/4e13deb05fbd8724996156b15b65f6a66794a7cc)) +# [5.27.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.26.0...v5.27.0) (2022-05-30) +### Bug Fixes +- **eslint-plugin:** [no-type-alias] handle Template Literal Types ([#5092](https://github.com/typescript-eslint/typescript-eslint/issues/5092)) ([8febf11](https://github.com/typescript-eslint/typescript-eslint/commit/8febf11a9296d1c0d7ccdf91ef9ab92ec8dfc39c)) +- **types:** remove leftovers from removal of useJSXTextNode ([#5091](https://github.com/typescript-eslint/typescript-eslint/issues/5091)) ([f9c3647](https://github.com/typescript-eslint/typescript-eslint/commit/f9c3647cb637c8d1ee461b471da9d817ccbde77c)) +### Features -# [5.18.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.17.0...v5.18.0) (2022-04-04) +- [4.7] support new extensions ([#5027](https://github.com/typescript-eslint/typescript-eslint/issues/5027)) ([efc147b](https://github.com/typescript-eslint/typescript-eslint/commit/efc147b04dce52ab17415b6a4ae4076b944b9036)) +- [TS4.7] support type parameters for `typeof` ([#5067](https://github.com/typescript-eslint/typescript-eslint/issues/5067)) ([836de79](https://github.com/typescript-eslint/typescript-eslint/commit/836de79e8d1bff43149168cc913a4c2b60e79bf6)) +- bump dependency ranges to TypeScript 4.7 ([#5082](https://github.com/typescript-eslint/typescript-eslint/issues/5082)) ([c4310b1](https://github.com/typescript-eslint/typescript-eslint/commit/c4310b1aac35c7d31b826f0602eca6a5900a09ee)) +- **eslint-plugin:** [ban-ts-comment] add descriptionFormat option ([#5026](https://github.com/typescript-eslint/typescript-eslint/issues/5026)) ([1fb31a4](https://github.com/typescript-eslint/typescript-eslint/commit/1fb31a4b3e05734f801ade0450fea33494e4d5e6)) +- **eslint-plugin:** [no-misused-promises] warn when spreading promises ([#5053](https://github.com/typescript-eslint/typescript-eslint/issues/5053)) ([61ffa9e](https://github.com/typescript-eslint/typescript-eslint/commit/61ffa9ed70e3cac6eca50a6c3cc5a0f1e7dec11c)) +- **eslint-plugin:** [space-infix-ops] missing error report for conditional types ([#5041](https://github.com/typescript-eslint/typescript-eslint/issues/5041)) ([0bfab6c](https://github.com/typescript-eslint/typescript-eslint/commit/0bfab6c9f5c5e243268200cf9368acf39ea099f8)) +# [5.26.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.25.0...v5.26.0) (2022-05-23) ### Bug Fixes -* **eslint-plugin:** method-signature-style respect getter signature ([#4777](https://github.com/typescript-eslint/typescript-eslint/issues/4777)) ([12dd670](https://github.com/typescript-eslint/typescript-eslint/commit/12dd670bc8621867c5105d8892dba9f9550a2f35)) -* **visitor-keys:** add missing visitor keys ([#4731](https://github.com/typescript-eslint/typescript-eslint/issues/4731)) ([bb575a0](https://github.com/typescript-eslint/typescript-eslint/commit/bb575a0763f39b9b988a7c20afee7b5eeb64cba7)) - +- **ast-spec:** add `SpreadElement` to `ArrayExpression.elements` ([#5025](https://github.com/typescript-eslint/typescript-eslint/issues/5025)) ([9f3121b](https://github.com/typescript-eslint/typescript-eslint/commit/9f3121b228b9c066bff7a6011aecf269ac55f17c)) +- **eslint-plugin:** [member-delimiter-style] autofixer result is not as expected when comments after the delimiter with option `delimiter: 'none'` ([#5029](https://github.com/typescript-eslint/typescript-eslint/issues/5029)) ([ed7b5f6](https://github.com/typescript-eslint/typescript-eslint/commit/ed7b5f61d93799fec3e38a87935ab9caa3abe279)) +- **eslint-plugin:** [member-delimiter-style] autofixer result is not as expected with option `delimiter: 'none'` ([#5023](https://github.com/typescript-eslint/typescript-eslint/issues/5023)) ([9e97a11](https://github.com/typescript-eslint/typescript-eslint/commit/9e97a11ecd80be5c63c980bfe8d8e57400221cec)) +- **eslint-plugin:** [prefer-readonly] correct issue with anonymus functions ([#4974](https://github.com/typescript-eslint/typescript-eslint/issues/4974)) ([952e2f0](https://github.com/typescript-eslint/typescript-eslint/commit/952e2f068862dde089ec03d3eb5452d1ee3e9271)), closes [#2590](https://github.com/typescript-eslint/typescript-eslint/issues/2590) ### Features -* **eslint-plugin:** [no-shadow] ignoreOnInitialization option ([#4603](https://github.com/typescript-eslint/typescript-eslint/issues/4603)) ([068ea9b](https://github.com/typescript-eslint/typescript-eslint/commit/068ea9b8eb3072fb46a6035f29c68ce96a69008d)) -* **eslint-plugin:** [no-this-alias] report on assignment expressions ([#4718](https://github.com/typescript-eslint/typescript-eslint/issues/4718)) ([8329498](https://github.com/typescript-eslint/typescript-eslint/commit/83294989dad543351a26e95be8d11a91d348679a)) +- [4.7] support instantiation expressions ([#4938](https://github.com/typescript-eslint/typescript-eslint/issues/4938)) ([79fbc77](https://github.com/typescript-eslint/typescript-eslint/commit/79fbc7743ae5dce3190f8168776e0204755390ad)) +- [4.7] support optional variance annotation ([#4831](https://github.com/typescript-eslint/typescript-eslint/issues/4831)) ([7e7b24c](https://github.com/typescript-eslint/typescript-eslint/commit/7e7b24c196e6d968e48f97f46feae5e7027e22d2)) +- **typescript-estree:** `extends` constraints for `infer` ([#4830](https://github.com/typescript-eslint/typescript-eslint/issues/4830)) ([8cbbcc3](https://github.com/typescript-eslint/typescript-eslint/commit/8cbbcc3d317779e0dcba15d3835137f38383de34)) +# [5.25.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.24.0...v5.25.0) (2022-05-17) +### Bug Fixes +- **eslint-plugin:** [typedef] stop enforcing rule for assignment expressions ([#4958](https://github.com/typescript-eslint/typescript-eslint/issues/4958)) ([04a216c](https://github.com/typescript-eslint/typescript-eslint/commit/04a216c39c02085fe5d555ce81bdced0e563a7c4)) +- **eslint-plugin:** strict config should not extend recommended ([#5005](https://github.com/typescript-eslint/typescript-eslint/issues/5005)) ([05d71c2](https://github.com/typescript-eslint/typescript-eslint/commit/05d71c2ebd8e072aa4e8ee3ea8521de00e47d4ca)) +- **website:** correct Presets link to be Configs ([#5004](https://github.com/typescript-eslint/typescript-eslint/issues/5004)) ([e18e91c](https://github.com/typescript-eslint/typescript-eslint/commit/e18e91c6cfb1ee93bfff3770ea4d8f807d5ced0b)) +### Features -# [5.17.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.16.0...v5.17.0) (2022-03-28) +- **eslint-plugin:** [no-empty-function] new allow option overrideMethods ([#4923](https://github.com/typescript-eslint/typescript-eslint/issues/4923)) ([13c05ae](https://github.com/typescript-eslint/typescript-eslint/commit/13c05aefb0e6531d320629e04b7207a3baebacb0)) +- **eslint-plugin:** deprecate `no-duplicate-imports` in favour of `import/no-duplicates` ([#4973](https://github.com/typescript-eslint/typescript-eslint/issues/4973)) ([1d2e41a](https://github.com/typescript-eslint/typescript-eslint/commit/1d2e41ada1979c081130d19b229c82bf1a69b7b4)) +- update to TypeScript 4.7-rc ([#4829](https://github.com/typescript-eslint/typescript-eslint/issues/4829)) ([6fe783c](https://github.com/typescript-eslint/typescript-eslint/commit/6fe783c20aebe26ef42b526e4a59a9be84dd5643)) +# [5.24.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.23.0...v5.24.0) (2022-05-16) ### Bug Fixes -* code container hiding navigation menu ([#4707](https://github.com/typescript-eslint/typescript-eslint/issues/4707)) ([96bc69a](https://github.com/typescript-eslint/typescript-eslint/commit/96bc69a652c7f6f474a39f1e9783e7fbd446696a)) -* revert "chore: Bump cypress from 8.3.0 to 9.5.2", and ignore cypress for now ([#4740](https://github.com/typescript-eslint/typescript-eslint/issues/4740)) ([cf5f5c4](https://github.com/typescript-eslint/typescript-eslint/commit/cf5f5c441ab0c4fb056bd688795ffc55e026627a)), closes [#4710](https://github.com/typescript-eslint/typescript-eslint/issues/4710) - +- **eslint-plugin:** [array-type] in fixer add missing parens for constructor types [#4756](https://github.com/typescript-eslint/typescript-eslint/issues/4756) ([#4971](https://github.com/typescript-eslint/typescript-eslint/issues/4971)) ([0377070](https://github.com/typescript-eslint/typescript-eslint/commit/03770708900da663eb64c19465b3f937bab55b3d)) +- **website:** missing colon before tip notes in configs.md ([#4982](https://github.com/typescript-eslint/typescript-eslint/issues/4982)) ([f3a1aba](https://github.com/typescript-eslint/typescript-eslint/commit/f3a1aba6704c5978c9f6002d6b1fc076421103d1)) ### Features -* **eslint-plugin:** [no-unused-vars] add destructuredArrayIgnorePattern options ([#4748](https://github.com/typescript-eslint/typescript-eslint/issues/4748)) ([6f8db8b](https://github.com/typescript-eslint/typescript-eslint/commit/6f8db8b64821d280fff408c1704a9adde682ed69)) +- **eslint-plugin:** Add BigInt object type to default ban-types list ([#4970](https://github.com/typescript-eslint/typescript-eslint/issues/4970)) ([1867728](https://github.com/typescript-eslint/typescript-eslint/commit/1867728ba104a6a21941ed300828110964a43b96)) +- **eslint-plugin:** add new 'strict' config ([#4706](https://github.com/typescript-eslint/typescript-eslint/issues/4706)) ([4a500b2](https://github.com/typescript-eslint/typescript-eslint/commit/4a500b2d92a91873dbb729793d1ee1c36ef06ed8)) +# [5.23.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.22.0...v5.23.0) (2022-05-09) +### Bug Fixes +- **ast-spec:** correct `AwaitExpression.argument` type ([#4880](https://github.com/typescript-eslint/typescript-eslint/issues/4880)) ([3ec5f53](https://github.com/typescript-eslint/typescript-eslint/commit/3ec5f53bad79b133ef5dee71c402160b3acf13cf)) +- **eslint-plugin:** [no-restricted-imports] allow type import as long as there's one matching pattern ([#4898](https://github.com/typescript-eslint/typescript-eslint/issues/4898)) ([0419d28](https://github.com/typescript-eslint/typescript-eslint/commit/0419d287b637e805c33036a45760badc2498e19b)) +- **eslint-plugin:** [no-unnecessary-type-constraint] change to suggestion fix, fix multiple trailing comma failures ([#4901](https://github.com/typescript-eslint/typescript-eslint/issues/4901)) ([4507ac8](https://github.com/typescript-eslint/typescript-eslint/commit/4507ac84c76da0ced43b6679305afe1891e7afca)) +### Features -# [5.16.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.15.0...v5.16.0) (2022-03-21) +- **utils:** update eslint types ([#4896](https://github.com/typescript-eslint/typescript-eslint/issues/4896)) ([da48527](https://github.com/typescript-eslint/typescript-eslint/commit/da485279f13cb95db1ee131a4f9c5367d54020fe)) +# [5.22.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.21.0...v5.22.0) (2022-05-02) ### Bug Fixes -* **eslint-plugin:** [consistent-type-assertions] enforce assertionStyle for `const` assertions ([#4685](https://github.com/typescript-eslint/typescript-eslint/issues/4685)) ([8ec05be](https://github.com/typescript-eslint/typescript-eslint/commit/8ec05bed0fed0dcd48b087acd5ab5a6132bf3b09)) -* **scope-manager:** incorrect reference for this within a jsx identifier ([#4535](https://github.com/typescript-eslint/typescript-eslint/issues/4535)) ([dd49280](https://github.com/typescript-eslint/typescript-eslint/commit/dd49280e50cb2f5bd26dc07210551bc1fda120af)) -* **utils:** RuleTester: Only call afterAll if defined ([#4656](https://github.com/typescript-eslint/typescript-eslint/issues/4656)) ([0fe0683](https://github.com/typescript-eslint/typescript-eslint/commit/0fe0683effe4c7390806a72c6aa7795445a67929)) - +- add rule to vscode settings ([#4881](https://github.com/typescript-eslint/typescript-eslint/issues/4881)) ([3eab889](https://github.com/typescript-eslint/typescript-eslint/commit/3eab889022c9d1617f275017d6951f663ea57f24)) +- **eslint-plugin:** [comma-spacing] verify `nextToken` exists ([#4868](https://github.com/typescript-eslint/typescript-eslint/issues/4868)) ([23746f8](https://github.com/typescript-eslint/typescript-eslint/commit/23746f8babace7c2354368d6fb0881be26e19c41)) ### Features -* **eslint-plugin:** [prefer-optional-chain] support logical with empty object ([#4430](https://github.com/typescript-eslint/typescript-eslint/issues/4430)) ([d21cfe0](https://github.com/typescript-eslint/typescript-eslint/commit/d21cfe0f4b7d3041948b1b6e0cd56c5ec34b2b3f)) +- **ast-spec:** add fixture test framework and some initial fixtures ([#3258](https://github.com/typescript-eslint/typescript-eslint/issues/3258)) ([f3cf87b](https://github.com/typescript-eslint/typescript-eslint/commit/f3cf87bf20fd0542f92a96a318aa9ee5bf23c1f6)) +- **eslint-plugin:** [no-duplicate-enum-values] add rule ([#4833](https://github.com/typescript-eslint/typescript-eslint/issues/4833)) ([5899164](https://github.com/typescript-eslint/typescript-eslint/commit/5899164b35d91106512a2720b23ba92e1893132f)) +# [5.21.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.20.0...v5.21.0) (2022-04-25) +### Bug Fixes +- **eslint-plugin:** [no-misused-promises] prioritize false returns when checking whether a function returns only void ([#4841](https://github.com/typescript-eslint/typescript-eslint/issues/4841)) ([ccadb60](https://github.com/typescript-eslint/typescript-eslint/commit/ccadb6075d6977c4921ffc09fa40f515f4d497c5)) +- **eslint-plugin:** [no-namespace] fix false positive for exported namespaces when allowDeclarations=true ([#4844](https://github.com/typescript-eslint/typescript-eslint/issues/4844)) ([4e7c9be](https://github.com/typescript-eslint/typescript-eslint/commit/4e7c9be6ff7e2448f4151563d7921cd285c2e349)) +- **eslint-plugin:** [space-infix-ops] fix no error when right type is function ([#4848](https://github.com/typescript-eslint/typescript-eslint/issues/4848)) ([d74d559](https://github.com/typescript-eslint/typescript-eslint/commit/d74d559c25e336c3ebe917bf5c43e14ffa2de694)) +### Features -# [5.15.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.14.0...v5.15.0) (2022-03-14) +- **eslint-plugin:** [parameter-properties] add rule to replace `no-parameter-properties` ([#4622](https://github.com/typescript-eslint/typescript-eslint/issues/4622)) ([88ed9ec](https://github.com/typescript-eslint/typescript-eslint/commit/88ed9ec9d6b971a9533565920fdcd6890ea941e9)) +# [5.20.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.19.0...v5.20.0) (2022-04-18) ### Features -* **parser:** add `parserOptions.emitDecoratorMetadata` ([#4646](https://github.com/typescript-eslint/typescript-eslint/issues/4646)) ([e3dd343](https://github.com/typescript-eslint/typescript-eslint/commit/e3dd343e51e3b7772e825a609735a04c921c1ec5)) +- **eslint-plugin:** [no-magic-numbers] ignoreTypeIndexes option ([#4789](https://github.com/typescript-eslint/typescript-eslint/issues/4789)) ([5e79451](https://github.com/typescript-eslint/typescript-eslint/commit/5e794512bf124c39de76d4e2cf8a3d6cfb08f1a8)) +# [5.19.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.18.0...v5.19.0) (2022-04-11) +### Bug Fixes +- **eslint-plugin:** update code to use estree range instead of ts pos/end [#4723](https://github.com/typescript-eslint/typescript-eslint/issues/4723) ([#4790](https://github.com/typescript-eslint/typescript-eslint/issues/4790)) ([a1e9fc4](https://github.com/typescript-eslint/typescript-eslint/commit/a1e9fc4cb19e7655613ebe6f4dd911b5427b0367)) +### Features -# [5.14.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.13.0...v5.14.0) (2022-03-07) +- **eslint-plugin:** [unified-signatures] add `ignoreDifferentlyNamedParameters` option ([#4659](https://github.com/typescript-eslint/typescript-eslint/issues/4659)) ([fdf95e0](https://github.com/typescript-eslint/typescript-eslint/commit/fdf95e02c45e137325c9ddd9d30e7f6b404f4514)) +- **eslint-plugin:** add support for valid number and bigint intersections in restrict-plus-operands rule ([#4795](https://github.com/typescript-eslint/typescript-eslint/issues/4795)) ([19c600a](https://github.com/typescript-eslint/typescript-eslint/commit/19c600a3dd485669cb87ae8f81b010e65eee1df8)) +# [5.18.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.17.0...v5.18.0) (2022-04-04) ### Bug Fixes -* **eslint-plugin:** [naming-convention] cover case that requires quotes ([#4582](https://github.com/typescript-eslint/typescript-eslint/issues/4582)) ([3ea0947](https://github.com/typescript-eslint/typescript-eslint/commit/3ea09477debec9f1593e4d3857e153570b488f4d)) -* **eslint-plugin:** [no-misused-promises] factor thenable returning function overload signatures ([#4620](https://github.com/typescript-eslint/typescript-eslint/issues/4620)) ([56a09e9](https://github.com/typescript-eslint/typescript-eslint/commit/56a09e98f171662d25ae2692be703a8bbbd3a3a5)) -* **eslint-plugin:** [prefer-readonly-parameter-types] handle class sharp private field and member without throwing error ([#4343](https://github.com/typescript-eslint/typescript-eslint/issues/4343)) ([a65713a](https://github.com/typescript-eslint/typescript-eslint/commit/a65713ae138e56555d01a9e8e5179221a2f39e75)) -* **eslint-plugin:** [return-await] correct autofixer in binary expression ([#4401](https://github.com/typescript-eslint/typescript-eslint/issues/4401)) ([5fa2fad](https://github.com/typescript-eslint/typescript-eslint/commit/5fa2fade385cc526a962212b94410c58e4c31078)) - +- **eslint-plugin:** method-signature-style respect getter signature ([#4777](https://github.com/typescript-eslint/typescript-eslint/issues/4777)) ([12dd670](https://github.com/typescript-eslint/typescript-eslint/commit/12dd670bc8621867c5105d8892dba9f9550a2f35)) +- **visitor-keys:** add missing visitor keys ([#4731](https://github.com/typescript-eslint/typescript-eslint/issues/4731)) ([bb575a0](https://github.com/typescript-eslint/typescript-eslint/commit/bb575a0763f39b9b988a7c20afee7b5eeb64cba7)) ### Features -* **eslint-plugin:** [no-misused-promises] add granular options within `checksVoidReturns` ([#4623](https://github.com/typescript-eslint/typescript-eslint/issues/4623)) ([1085177](https://github.com/typescript-eslint/typescript-eslint/commit/10851772696f982b585e0dade728f7980fdc6cc0)) -* TypeScript 4.6 ([#4615](https://github.com/typescript-eslint/typescript-eslint/issues/4615)) ([a02c63a](https://github.com/typescript-eslint/typescript-eslint/commit/a02c63a264e5a6c3557468a8eff48d34ca2b718a)) +- **eslint-plugin:** [no-shadow] ignoreOnInitialization option ([#4603](https://github.com/typescript-eslint/typescript-eslint/issues/4603)) ([068ea9b](https://github.com/typescript-eslint/typescript-eslint/commit/068ea9b8eb3072fb46a6035f29c68ce96a69008d)) +- **eslint-plugin:** [no-this-alias] report on assignment expressions ([#4718](https://github.com/typescript-eslint/typescript-eslint/issues/4718)) ([8329498](https://github.com/typescript-eslint/typescript-eslint/commit/83294989dad543351a26e95be8d11a91d348679a)) +# [5.17.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.16.0...v5.17.0) (2022-03-28) +### Bug Fixes +- code container hiding navigation menu ([#4707](https://github.com/typescript-eslint/typescript-eslint/issues/4707)) ([96bc69a](https://github.com/typescript-eslint/typescript-eslint/commit/96bc69a652c7f6f474a39f1e9783e7fbd446696a)) +- revert "chore: Bump cypress from 8.3.0 to 9.5.2", and ignore cypress for now ([#4740](https://github.com/typescript-eslint/typescript-eslint/issues/4740)) ([cf5f5c4](https://github.com/typescript-eslint/typescript-eslint/commit/cf5f5c441ab0c4fb056bd688795ffc55e026627a)), closes [#4710](https://github.com/typescript-eslint/typescript-eslint/issues/4710) +### Features -# [5.13.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.12.1...v5.13.0) (2022-02-28) +- **eslint-plugin:** [no-unused-vars] add destructuredArrayIgnorePattern options ([#4748](https://github.com/typescript-eslint/typescript-eslint/issues/4748)) ([6f8db8b](https://github.com/typescript-eslint/typescript-eslint/commit/6f8db8b64821d280fff408c1704a9adde682ed69)) +# [5.16.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.15.0...v5.16.0) (2022-03-21) ### Bug Fixes -* **eslint-plugin:** [sort-type-union-intersection-members] Wrap the constructorType in parentheses ([#4590](https://github.com/typescript-eslint/typescript-eslint/issues/4590)) ([851bb90](https://github.com/typescript-eslint/typescript-eslint/commit/851bb90216e20b7679efc891dc445e6152d4837f)) - +- **eslint-plugin:** [consistent-type-assertions] enforce assertionStyle for `const` assertions ([#4685](https://github.com/typescript-eslint/typescript-eslint/issues/4685)) ([8ec05be](https://github.com/typescript-eslint/typescript-eslint/commit/8ec05bed0fed0dcd48b087acd5ab5a6132bf3b09)) +- **scope-manager:** incorrect reference for this within a jsx identifier ([#4535](https://github.com/typescript-eslint/typescript-eslint/issues/4535)) ([dd49280](https://github.com/typescript-eslint/typescript-eslint/commit/dd49280e50cb2f5bd26dc07210551bc1fda120af)) +- **utils:** RuleTester: Only call afterAll if defined ([#4656](https://github.com/typescript-eslint/typescript-eslint/issues/4656)) ([0fe0683](https://github.com/typescript-eslint/typescript-eslint/commit/0fe0683effe4c7390806a72c6aa7795445a67929)) ### Features -* **eslint-plugin:** [no-misused-promises] check more places for checksVoidReturn ([#4541](https://github.com/typescript-eslint/typescript-eslint/issues/4541)) ([052cf51](https://github.com/typescript-eslint/typescript-eslint/commit/052cf51fe663283afe89dc7bf97c947e750df095)) -* **eslint-plugin:** add `no-redundant-type-constituents` rule ([#4378](https://github.com/typescript-eslint/typescript-eslint/issues/4378)) ([63d051e](https://github.com/typescript-eslint/typescript-eslint/commit/63d051eed29dcf71015a23992feac0a8f92717a0)) -* **eslint-plugin:** add `no-useless-empty-export` rule ([#4380](https://github.com/typescript-eslint/typescript-eslint/issues/4380)) ([823b945](https://github.com/typescript-eslint/typescript-eslint/commit/823b945c8f9e83d0246a2a5d07519f01e1a64518)) -* **eslint-plugin:** add extension rule `space-before-blocks` ([#1606](https://github.com/typescript-eslint/typescript-eslint/issues/1606)) ([#4184](https://github.com/typescript-eslint/typescript-eslint/issues/4184)) ([208b6d0](https://github.com/typescript-eslint/typescript-eslint/commit/208b6d02252dff2bf272329d3e4a4a82e56c52c0)) -* **eslint-plugin:** added member group support to member-ordering rule ([#4538](https://github.com/typescript-eslint/typescript-eslint/issues/4538)) ([6afcaea](https://github.com/typescript-eslint/typescript-eslint/commit/6afcaea0160a1ccd1c6483ca677c544ca1b8cb4f)) -* **utils:** expose `ast-utils`' helpers ([#4503](https://github.com/typescript-eslint/typescript-eslint/issues/4503)) ([f106e4b](https://github.com/typescript-eslint/typescript-eslint/commit/f106e4b95e824ebb68141bce3d3207448d50c860)) -* **utils:** extract `isNotTokenOfTypeWithConditions` out of `ast-utils`' `predicates` ([#4502](https://github.com/typescript-eslint/typescript-eslint/issues/4502)) ([66501d6](https://github.com/typescript-eslint/typescript-eslint/commit/66501d6dd7e97c22c671efaa6d1ba8237907e417)) - - +- **eslint-plugin:** [prefer-optional-chain] support logical with empty object ([#4430](https://github.com/typescript-eslint/typescript-eslint/issues/4430)) ([d21cfe0](https://github.com/typescript-eslint/typescript-eslint/commit/d21cfe0f4b7d3041948b1b6e0cd56c5ec34b2b3f)) +# [5.15.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.14.0...v5.15.0) (2022-03-14) +### Features -## [5.12.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.12.0...v5.12.1) (2022-02-21) +- **parser:** add `parserOptions.emitDecoratorMetadata` ([#4646](https://github.com/typescript-eslint/typescript-eslint/issues/4646)) ([e3dd343](https://github.com/typescript-eslint/typescript-eslint/commit/e3dd343e51e3b7772e825a609735a04c921c1ec5)) +# [5.14.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.13.0...v5.14.0) (2022-03-07) ### Bug Fixes -* **eslint-plugin:** [no-unnecessary-type-arguments] fix comparison of types ([#4555](https://github.com/typescript-eslint/typescript-eslint/issues/4555)) ([fc3936e](https://github.com/typescript-eslint/typescript-eslint/commit/fc3936e99712374a707ce9e0101bc641807b9ea6)) +- **eslint-plugin:** [naming-convention] cover case that requires quotes ([#4582](https://github.com/typescript-eslint/typescript-eslint/issues/4582)) ([3ea0947](https://github.com/typescript-eslint/typescript-eslint/commit/3ea09477debec9f1593e4d3857e153570b488f4d)) +- **eslint-plugin:** [no-misused-promises] factor thenable returning function overload signatures ([#4620](https://github.com/typescript-eslint/typescript-eslint/issues/4620)) ([56a09e9](https://github.com/typescript-eslint/typescript-eslint/commit/56a09e98f171662d25ae2692be703a8bbbd3a3a5)) +- **eslint-plugin:** [prefer-readonly-parameter-types] handle class sharp private field and member without throwing error ([#4343](https://github.com/typescript-eslint/typescript-eslint/issues/4343)) ([a65713a](https://github.com/typescript-eslint/typescript-eslint/commit/a65713ae138e56555d01a9e8e5179221a2f39e75)) +- **eslint-plugin:** [return-await] correct autofixer in binary expression ([#4401](https://github.com/typescript-eslint/typescript-eslint/issues/4401)) ([5fa2fad](https://github.com/typescript-eslint/typescript-eslint/commit/5fa2fade385cc526a962212b94410c58e4c31078)) +### Features +- **eslint-plugin:** [no-misused-promises] add granular options within `checksVoidReturns` ([#4623](https://github.com/typescript-eslint/typescript-eslint/issues/4623)) ([1085177](https://github.com/typescript-eslint/typescript-eslint/commit/10851772696f982b585e0dade728f7980fdc6cc0)) +- TypeScript 4.6 ([#4615](https://github.com/typescript-eslint/typescript-eslint/issues/4615)) ([a02c63a](https://github.com/typescript-eslint/typescript-eslint/commit/a02c63a264e5a6c3557468a8eff48d34ca2b718a)) +# [5.13.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.12.1...v5.13.0) (2022-02-28) +### Bug Fixes -# [5.12.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.11.0...v5.12.0) (2022-02-14) +- **eslint-plugin:** [sort-type-union-intersection-members] Wrap the constructorType in parentheses ([#4590](https://github.com/typescript-eslint/typescript-eslint/issues/4590)) ([851bb90](https://github.com/typescript-eslint/typescript-eslint/commit/851bb90216e20b7679efc891dc445e6152d4837f)) +### Features -### Bug Fixes +- **eslint-plugin:** [no-misused-promises] check more places for checksVoidReturn ([#4541](https://github.com/typescript-eslint/typescript-eslint/issues/4541)) ([052cf51](https://github.com/typescript-eslint/typescript-eslint/commit/052cf51fe663283afe89dc7bf97c947e750df095)) +- **eslint-plugin:** add `no-redundant-type-constituents` rule ([#4378](https://github.com/typescript-eslint/typescript-eslint/issues/4378)) ([63d051e](https://github.com/typescript-eslint/typescript-eslint/commit/63d051eed29dcf71015a23992feac0a8f92717a0)) +- **eslint-plugin:** add `no-useless-empty-export` rule ([#4380](https://github.com/typescript-eslint/typescript-eslint/issues/4380)) ([823b945](https://github.com/typescript-eslint/typescript-eslint/commit/823b945c8f9e83d0246a2a5d07519f01e1a64518)) +- **eslint-plugin:** add extension rule `space-before-blocks` ([#1606](https://github.com/typescript-eslint/typescript-eslint/issues/1606)) ([#4184](https://github.com/typescript-eslint/typescript-eslint/issues/4184)) ([208b6d0](https://github.com/typescript-eslint/typescript-eslint/commit/208b6d02252dff2bf272329d3e4a4a82e56c52c0)) +- **eslint-plugin:** added member group support to member-ordering rule ([#4538](https://github.com/typescript-eslint/typescript-eslint/issues/4538)) ([6afcaea](https://github.com/typescript-eslint/typescript-eslint/commit/6afcaea0160a1ccd1c6483ca677c544ca1b8cb4f)) +- **utils:** expose `ast-utils`' helpers ([#4503](https://github.com/typescript-eslint/typescript-eslint/issues/4503)) ([f106e4b](https://github.com/typescript-eslint/typescript-eslint/commit/f106e4b95e824ebb68141bce3d3207448d50c860)) +- **utils:** extract `isNotTokenOfTypeWithConditions` out of `ast-utils`' `predicates` ([#4502](https://github.com/typescript-eslint/typescript-eslint/issues/4502)) ([66501d6](https://github.com/typescript-eslint/typescript-eslint/commit/66501d6dd7e97c22c671efaa6d1ba8237907e417)) -* **eslint-plugin:** [init-declarations] fix nested namespace ([#4544](https://github.com/typescript-eslint/typescript-eslint/issues/4544)) ([fe910e6](https://github.com/typescript-eslint/typescript-eslint/commit/fe910e61ca4bb42be3be9acb8ddcec73206754c2)) -* **eslint-plugin:** [no-unnecessary-type-arguments] Use Symbol to check if it's the same type ([#4543](https://github.com/typescript-eslint/typescript-eslint/issues/4543)) ([5b7d8df](https://github.com/typescript-eslint/typescript-eslint/commit/5b7d8df149be6554c863cdd5b73c0b0b0a7960db)) -* support nested object deconstructuring with type annotation ([#4548](https://github.com/typescript-eslint/typescript-eslint/issues/4548)) ([4da9278](https://github.com/typescript-eslint/typescript-eslint/commit/4da9278c80706f420d4c15a71c11c7b11d935643)) +## [5.12.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.12.0...v5.12.1) (2022-02-21) +### Bug Fixes -### Features +- **eslint-plugin:** [no-unnecessary-type-arguments] fix comparison of types ([#4555](https://github.com/typescript-eslint/typescript-eslint/issues/4555)) ([fc3936e](https://github.com/typescript-eslint/typescript-eslint/commit/fc3936e99712374a707ce9e0101bc641807b9ea6)) -* add checking property definition for allowNames option ([#4542](https://github.com/typescript-eslint/typescript-eslint/issues/4542)) ([e32bef6](https://github.com/typescript-eslint/typescript-eslint/commit/e32bef6f6b74228c95e54a5cba1cde53d5e40623)) +# [5.12.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.11.0...v5.12.0) (2022-02-14) +### Bug Fixes +- **eslint-plugin:** [init-declarations] fix nested namespace ([#4544](https://github.com/typescript-eslint/typescript-eslint/issues/4544)) ([fe910e6](https://github.com/typescript-eslint/typescript-eslint/commit/fe910e61ca4bb42be3be9acb8ddcec73206754c2)) +- **eslint-plugin:** [no-unnecessary-type-arguments] Use Symbol to check if it's the same type ([#4543](https://github.com/typescript-eslint/typescript-eslint/issues/4543)) ([5b7d8df](https://github.com/typescript-eslint/typescript-eslint/commit/5b7d8df149be6554c863cdd5b73c0b0b0a7960db)) +- support nested object deconstructuring with type annotation ([#4548](https://github.com/typescript-eslint/typescript-eslint/issues/4548)) ([4da9278](https://github.com/typescript-eslint/typescript-eslint/commit/4da9278c80706f420d4c15a71c11c7b11d935643)) +### Features +- add checking property definition for allowNames option ([#4542](https://github.com/typescript-eslint/typescript-eslint/issues/4542)) ([e32bef6](https://github.com/typescript-eslint/typescript-eslint/commit/e32bef6f6b74228c95e54a5cba1cde53d5e40623)) # [5.11.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.10.2...v5.11.0) (2022-02-07) - ### Bug Fixes -* **eslint-plugin:** [no-magic-numbers] fix invalid schema merging ([#4517](https://github.com/typescript-eslint/typescript-eslint/issues/4517)) ([b95f796](https://github.com/typescript-eslint/typescript-eslint/commit/b95f79697acdd16347dc102bcb8311fe83746779)) -* **eslint-plugin:** [non-nullable-type-assertion-style] fix false positive when asserting to a generic type that might be nullish ([#4509](https://github.com/typescript-eslint/typescript-eslint/issues/4509)) ([4209362](https://github.com/typescript-eslint/typescript-eslint/commit/420936274603d8fee0631cdb3b58874cb3cc59d7)) - +- **eslint-plugin:** [no-magic-numbers] fix invalid schema merging ([#4517](https://github.com/typescript-eslint/typescript-eslint/issues/4517)) ([b95f796](https://github.com/typescript-eslint/typescript-eslint/commit/b95f79697acdd16347dc102bcb8311fe83746779)) +- **eslint-plugin:** [non-nullable-type-assertion-style] fix false positive when asserting to a generic type that might be nullish ([#4509](https://github.com/typescript-eslint/typescript-eslint/issues/4509)) ([4209362](https://github.com/typescript-eslint/typescript-eslint/commit/420936274603d8fee0631cdb3b58874cb3cc59d7)) ### Features -* **eslint-plugin:** [explicit-function-return-type] add allowedNames ([#4440](https://github.com/typescript-eslint/typescript-eslint/issues/4440)) ([936e252](https://github.com/typescript-eslint/typescript-eslint/commit/936e252e30cfcebdaf971cf0f66a3031e236a41c)) +- **eslint-plugin:** [explicit-function-return-type] add allowedNames ([#4440](https://github.com/typescript-eslint/typescript-eslint/issues/4440)) ([936e252](https://github.com/typescript-eslint/typescript-eslint/commit/936e252e30cfcebdaf971cf0f66a3031e236a41c)) +## [5.10.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.10.1...v5.10.2) (2022-01-31) +### Bug Fixes +- **eslint-plugin:** [no-restricted-imports] allow relative type imports with patterns configured ([#4494](https://github.com/typescript-eslint/typescript-eslint/issues/4494)) ([4a6d217](https://github.com/typescript-eslint/typescript-eslint/commit/4a6d217ae8a8f5fa1dd4bd3e3e66ba7519b4a287)) +## [5.10.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.10.0...v5.10.1) (2022-01-24) -## [5.10.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.10.1...v5.10.2) (2022-01-31) +**Note:** Version bump only for package @typescript-eslint/typescript-eslint +# [5.10.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.9.1...v5.10.0) (2022-01-17) ### Bug Fixes -* **eslint-plugin:** [no-restricted-imports] allow relative type imports with patterns configured ([#4494](https://github.com/typescript-eslint/typescript-eslint/issues/4494)) ([4a6d217](https://github.com/typescript-eslint/typescript-eslint/commit/4a6d217ae8a8f5fa1dd4bd3e3e66ba7519b4a287)) - - +- **eslint-plugin:** [explicit-function-return-type] support AllowTypedFunctionExpression within AllowHigherOrderFunction ([#4250](https://github.com/typescript-eslint/typescript-eslint/issues/4250)) ([d053cde](https://github.com/typescript-eslint/typescript-eslint/commit/d053cde3e8b5bf9ba1c22fd64a7456d672ef77ca)) +- **eslint-plugin:** [no-extra-semi] false negatives when used with eslint 8.3.0 ([#4458](https://github.com/typescript-eslint/typescript-eslint/issues/4458)) ([f4016c2](https://github.com/typescript-eslint/typescript-eslint/commit/f4016c24f9023e8a42def9501b68c4a908cbfede)) +- **eslint-plugin:** [no-invalid-this] crash when used with eslint 8.7.0 ([#4448](https://github.com/typescript-eslint/typescript-eslint/issues/4448)) ([e56f1e5](https://github.com/typescript-eslint/typescript-eslint/commit/e56f1e5d52fcbf3caae43034872e0b3181871689)) +- **eslint-plugin:** [no-magic-numbers] handle bigint in class props ([#4411](https://github.com/typescript-eslint/typescript-eslint/issues/4411)) ([c8e650f](https://github.com/typescript-eslint/typescript-eslint/commit/c8e650f0c124d24b24beaeb376eaf61ee8d9e6fb)) +- **type-utils:** check IndexSignature internals when checking isTypeReadonly ([#4417](https://github.com/typescript-eslint/typescript-eslint/issues/4417)) ([ef3147c](https://github.com/typescript-eslint/typescript-eslint/commit/ef3147cf73767ddece91ce57f6028a83ce074b60)), closes [#4410](https://github.com/typescript-eslint/typescript-eslint/issues/4410) [#3714](https://github.com/typescript-eslint/typescript-eslint/issues/3714) +- **type-utils:** intersection types involving readonly arrays are now handled in most cases ([#4429](https://github.com/typescript-eslint/typescript-eslint/issues/4429)) ([5046882](https://github.com/typescript-eslint/typescript-eslint/commit/5046882025e3bc8cb122ecef703aebd0b5e79017)) +- **type-utils:** isTypeReadonly now handles conditional types ([#4421](https://github.com/typescript-eslint/typescript-eslint/issues/4421)) ([39a6806](https://github.com/typescript-eslint/typescript-eslint/commit/39a6806c61a48bbca93f9ffb965dd8b3fe0575b3)) +- **type-utils:** union types always being marked as readonly ([#4419](https://github.com/typescript-eslint/typescript-eslint/issues/4419)) ([99ab193](https://github.com/typescript-eslint/typescript-eslint/commit/99ab193bb02f181bed4ed917b1d121ed189d3fe4)) +### Features +- rename `experimental-utils` to `utils` and make `experimental-utils` an alias to the new package ([#4172](https://github.com/typescript-eslint/typescript-eslint/issues/4172)) ([1d55a75](https://github.com/typescript-eslint/typescript-eslint/commit/1d55a7511b38d8e2b2eabe59f639e0a865e6c93f)) +- **type-utils:** make isTypeReadonly's options param optional ([#4415](https://github.com/typescript-eslint/typescript-eslint/issues/4415)) ([3a07a56](https://github.com/typescript-eslint/typescript-eslint/commit/3a07a563c987ff25f6cd8925eeeb2ede47cc19e8)) -## [5.10.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.10.0...v5.10.1) (2022-01-24) +## [5.9.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.9.0...v5.9.1) (2022-01-10) **Note:** Version bump only for package @typescript-eslint/typescript-eslint +# [5.9.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.8.1...v5.9.0) (2022-01-03) +### Features +- **experimental-utils:** move isTypeReadonly from eslint-plugin to experimental-utils ([#3658](https://github.com/typescript-eslint/typescript-eslint/issues/3658)) ([a9eb0b9](https://github.com/typescript-eslint/typescript-eslint/commit/a9eb0b9eb2db291ea36065ec34f84bf5c5504b43)) +## [5.8.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.8.0...v5.8.1) (2021-12-27) -# [5.10.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.9.1...v5.10.0) (2022-01-17) +### Bug Fixes +- **eslint-plugin:** [consistent-indexed-object-style] do not report for circular references ([#4347](https://github.com/typescript-eslint/typescript-eslint/issues/4347)) ([6edebcd](https://github.com/typescript-eslint/typescript-eslint/commit/6edebcda00053eecf7b3e55eeb3fe5d7fb9e7db7)) +- **eslint-plugin:** [consistent-type-definitions] correct fixer with declare keyword ([#4334](https://github.com/typescript-eslint/typescript-eslint/issues/4334)) ([0cd911a](https://github.com/typescript-eslint/typescript-eslint/commit/0cd911a916805d3b1f8043584e4685f3edd5c427)) +- **eslint-plugin:** [padding-line-between-statements] make function overloading is also processed ([#4345](https://github.com/typescript-eslint/typescript-eslint/issues/4345)) ([d31ec26](https://github.com/typescript-eslint/typescript-eslint/commit/d31ec264fe5f5cd27e8f522a485e106889f2d380)) -### Bug Fixes +# [5.8.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.7.0...v5.8.0) (2021-12-20) -* **eslint-plugin:** [explicit-function-return-type] support AllowTypedFunctionExpression within AllowHigherOrderFunction ([#4250](https://github.com/typescript-eslint/typescript-eslint/issues/4250)) ([d053cde](https://github.com/typescript-eslint/typescript-eslint/commit/d053cde3e8b5bf9ba1c22fd64a7456d672ef77ca)) -* **eslint-plugin:** [no-extra-semi] false negatives when used with eslint 8.3.0 ([#4458](https://github.com/typescript-eslint/typescript-eslint/issues/4458)) ([f4016c2](https://github.com/typescript-eslint/typescript-eslint/commit/f4016c24f9023e8a42def9501b68c4a908cbfede)) -* **eslint-plugin:** [no-invalid-this] crash when used with eslint 8.7.0 ([#4448](https://github.com/typescript-eslint/typescript-eslint/issues/4448)) ([e56f1e5](https://github.com/typescript-eslint/typescript-eslint/commit/e56f1e5d52fcbf3caae43034872e0b3181871689)) -* **eslint-plugin:** [no-magic-numbers] handle bigint in class props ([#4411](https://github.com/typescript-eslint/typescript-eslint/issues/4411)) ([c8e650f](https://github.com/typescript-eslint/typescript-eslint/commit/c8e650f0c124d24b24beaeb376eaf61ee8d9e6fb)) -* **type-utils:** check IndexSignature internals when checking isTypeReadonly ([#4417](https://github.com/typescript-eslint/typescript-eslint/issues/4417)) ([ef3147c](https://github.com/typescript-eslint/typescript-eslint/commit/ef3147cf73767ddece91ce57f6028a83ce074b60)), closes [#4410](https://github.com/typescript-eslint/typescript-eslint/issues/4410) [#3714](https://github.com/typescript-eslint/typescript-eslint/issues/3714) -* **type-utils:** intersection types involving readonly arrays are now handled in most cases ([#4429](https://github.com/typescript-eslint/typescript-eslint/issues/4429)) ([5046882](https://github.com/typescript-eslint/typescript-eslint/commit/5046882025e3bc8cb122ecef703aebd0b5e79017)) -* **type-utils:** isTypeReadonly now handles conditional types ([#4421](https://github.com/typescript-eslint/typescript-eslint/issues/4421)) ([39a6806](https://github.com/typescript-eslint/typescript-eslint/commit/39a6806c61a48bbca93f9ffb965dd8b3fe0575b3)) -* **type-utils:** union types always being marked as readonly ([#4419](https://github.com/typescript-eslint/typescript-eslint/issues/4419)) ([99ab193](https://github.com/typescript-eslint/typescript-eslint/commit/99ab193bb02f181bed4ed917b1d121ed189d3fe4)) +### Bug Fixes +- **eslint-plugin:** [no-implied-eval] improve performance ([#4313](https://github.com/typescript-eslint/typescript-eslint/issues/4313)) ([e344596](https://github.com/typescript-eslint/typescript-eslint/commit/e3445967de6ed73e6b2334380236aed8a0ee6e4f)) +- **eslint-plugin:** [padding-line-between-statements] `type` StatementTypes can't differenciate from variable ([#4270](https://github.com/typescript-eslint/typescript-eslint/issues/4270)) ([bfc4324](https://github.com/typescript-eslint/typescript-eslint/commit/bfc4324f4cda24e30b2d39d5b70f7554f2b6bf81)) +- **eslint-plugin:** [strict-boolean-expression] false positive for truthy boolean ([#4275](https://github.com/typescript-eslint/typescript-eslint/issues/4275)) ([72c2e41](https://github.com/typescript-eslint/typescript-eslint/commit/72c2e418a4180f6db5795ebb42cbc095f5c53c37)) +- **eslint-plugin:** `array-type` mark `AST_NODE_TYPES.TSBigIntKeyword` as simple ([#4274](https://github.com/typescript-eslint/typescript-eslint/issues/4274)) ([74e544e](https://github.com/typescript-eslint/typescript-eslint/commit/74e544e487328e56fcb7aef048a78beaad593ea0)) +- **eslint-plugin:** handle method overloading in `semi` ([#4318](https://github.com/typescript-eslint/typescript-eslint/issues/4318)) ([3b87b49](https://github.com/typescript-eslint/typescript-eslint/commit/3b87b49ea8d62c2f4f3bee7494500b5ad44fcbc1)) +- **experimental-utils:** support immutable members ([#3844](https://github.com/typescript-eslint/typescript-eslint/issues/3844)) ([3d33a77](https://github.com/typescript-eslint/typescript-eslint/commit/3d33a77c57e5b752edf6f35ed152038bdb230b79)) ### Features -* rename `experimental-utils` to `utils` and make `experimental-utils` an alias to the new package ([#4172](https://github.com/typescript-eslint/typescript-eslint/issues/4172)) ([1d55a75](https://github.com/typescript-eslint/typescript-eslint/commit/1d55a7511b38d8e2b2eabe59f639e0a865e6c93f)) -* **type-utils:** make isTypeReadonly's options param optional ([#4415](https://github.com/typescript-eslint/typescript-eslint/issues/4415)) ([3a07a56](https://github.com/typescript-eslint/typescript-eslint/commit/3a07a563c987ff25f6cd8925eeeb2ede47cc19e8)) - +- **eslint-plugin:** [no-throw-literal] add options to to disallow `any`/`unknown` ([#4207](https://github.com/typescript-eslint/typescript-eslint/issues/4207)) ([ff0adf9](https://github.com/typescript-eslint/typescript-eslint/commit/ff0adf9e0bfbf71667c51de0a84038586e4cbfd1)) +- **eslint-plugin:** [restrict-plus-operand] add allowAny option ([#4260](https://github.com/typescript-eslint/typescript-eslint/issues/4260)) ([2788545](https://github.com/typescript-eslint/typescript-eslint/commit/27885456c577dfada52d298857f406f0f332c405)) +# [5.7.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.6.0...v5.7.0) (2021-12-13) +### Bug Fixes +- **typescript-estree:** type-only regression for consumers not yet on TS 4.5 ([#4272](https://github.com/typescript-eslint/typescript-eslint/issues/4272)) ([550b61e](https://github.com/typescript-eslint/typescript-eslint/commit/550b61ee1096113b234bf035dd267ba385809961)) -## [5.9.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.9.0...v5.9.1) (2022-01-10) +### Features -**Note:** Version bump only for package @typescript-eslint/typescript-eslint +- **eslint-plugin:** [consistent-type-exports] support TS4.5 inline export specifiers ([#4236](https://github.com/typescript-eslint/typescript-eslint/issues/4236)) ([be4d976](https://github.com/typescript-eslint/typescript-eslint/commit/be4d976215614cc032730ae596d2f6e47df67730)) +- **eslint-plugin:** [consistent-type-imports] support TS4.5 inline import specifiers ([#4237](https://github.com/typescript-eslint/typescript-eslint/issues/4237)) ([f61af7c](https://github.com/typescript-eslint/typescript-eslint/commit/f61af7c53cca52f81e77b4334c7d6ad100609af6)) +- **eslint-plugin:** [no-shadow] support TS4.5 inline import specifiers ([#4239](https://github.com/typescript-eslint/typescript-eslint/issues/4239)) ([96b7e8e](https://github.com/typescript-eslint/typescript-eslint/commit/96b7e8ee0f5280cab50a7205ae592e1d983a111a)) +# [5.6.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.5.0...v5.6.0) (2021-12-06) +### Features +- **scope-manager:** support TS4.5 import/export specifier kind ([#4234](https://github.com/typescript-eslint/typescript-eslint/issues/4234)) ([833f822](https://github.com/typescript-eslint/typescript-eslint/commit/833f8221ce00aecb7d08c519bab9568353850f48)) +- **scope-manager:** update lib types ([#4240](https://github.com/typescript-eslint/typescript-eslint/issues/4240)) ([8377e6e](https://github.com/typescript-eslint/typescript-eslint/commit/8377e6ea422ee2d52455da8955ff055e09c238d3)) +# [5.5.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.4.0...v5.5.0) (2021-11-29) -# [5.9.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.8.1...v5.9.0) (2022-01-03) +### Bug Fixes +- **eslint-plugin:** [member-ordering] order literal names correctly in ([#4054](https://github.com/typescript-eslint/typescript-eslint/issues/4054)) ([d57141a](https://github.com/typescript-eslint/typescript-eslint/commit/d57141a3d13fad30a93ed99a6a15f4b0b369246a)) +- **eslint-plugin:** [no-duplicate-imports] remove unnecessary type checking for `node.source` ([#4196](https://github.com/typescript-eslint/typescript-eslint/issues/4196)) ([637722a](https://github.com/typescript-eslint/typescript-eslint/commit/637722a77667f6ed1e0cf1f0e752d61622ae8546)) +- **eslint-plugin:** [no-var-requires] do not report require created from createRequire ([#4221](https://github.com/typescript-eslint/typescript-eslint/issues/4221)) ([0040186](https://github.com/typescript-eslint/typescript-eslint/commit/0040186aa23692724986df22a71926e8a7ff9e02)) +- **eslint-plugin:** [prefer-for-of] do nor error when iterating over this ([#4176](https://github.com/typescript-eslint/typescript-eslint/issues/4176)) ([258ddb0](https://github.com/typescript-eslint/typescript-eslint/commit/258ddb0708b7a44959bd3ac399cbde912c8021c8)) +- **eslint-plugin:** [require-await] treat yield\* asynciterable as an await ([#4125](https://github.com/typescript-eslint/typescript-eslint/issues/4125)) ([5a4ce6a](https://github.com/typescript-eslint/typescript-eslint/commit/5a4ce6a241b1d6c6caad87cad85c3741f0953e39)) +- **eslint-plugin:** remove all whitespaces in comparison [#4220](https://github.com/typescript-eslint/typescript-eslint/issues/4220) ([#4223](https://github.com/typescript-eslint/typescript-eslint/issues/4223)) ([853d799](https://github.com/typescript-eslint/typescript-eslint/commit/853d799428a061d9bf6a2e74b01dc49a1e4f3134)) +- **experimental-utils:** export RuleCreator interfaces ([#4199](https://github.com/typescript-eslint/typescript-eslint/issues/4199)) ([7821e4c](https://github.com/typescript-eslint/typescript-eslint/commit/7821e4c515ca2f11a14dcfa94dc77370da0287c5)) +- **experimental-utils:** fix types for eslint-utils ([#4173](https://github.com/typescript-eslint/typescript-eslint/issues/4173)) ([7079de2](https://github.com/typescript-eslint/typescript-eslint/commit/7079de26877a2313a7019845d4c33d0fc4d4b4a9)) +- **scope-manager:** support static class blocks ([#4211](https://github.com/typescript-eslint/typescript-eslint/issues/4211)) ([f8e9125](https://github.com/typescript-eslint/typescript-eslint/commit/f8e91256e0a721aaa906a5c40a92784da9433b53)) +- **visitor-keys:** add missing import assertion keys ([#4178](https://github.com/typescript-eslint/typescript-eslint/issues/4178)) ([9c38b7f](https://github.com/typescript-eslint/typescript-eslint/commit/9c38b7f7fc3ce471a8f720c4a2fbce01f3ee12a4)) ### Features -* **experimental-utils:** move isTypeReadonly from eslint-plugin to experimental-utils ([#3658](https://github.com/typescript-eslint/typescript-eslint/issues/3658)) ([a9eb0b9](https://github.com/typescript-eslint/typescript-eslint/commit/a9eb0b9eb2db291ea36065ec34f84bf5c5504b43)) - +- **eslint-plugin:** [member-ordering] add option to sort case insensitive ([#3896](https://github.com/typescript-eslint/typescript-eslint/issues/3896)) ([e3533d5](https://github.com/typescript-eslint/typescript-eslint/commit/e3533d5a6293a358b5eb0a6ed17da961a09b0ed3)) +- **eslint-plugin:** `array-type` distinguish whether readonly or not ([#4066](https://github.com/typescript-eslint/typescript-eslint/issues/4066)) ([314af44](https://github.com/typescript-eslint/typescript-eslint/commit/314af44bde3ccbebc620625b2931d77688525976)) +# [5.4.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.3.1...v5.4.0) (2021-11-15) +### Bug Fixes +- correct issues with circular imports ([#4140](https://github.com/typescript-eslint/typescript-eslint/issues/4140)) ([4c87b24](https://github.com/typescript-eslint/typescript-eslint/commit/4c87b2486a9c90794d972a4d093c1dc22ffb418b)) +- **eslint-plugin:** [explicit-member-accessibility] private fields cannot have accessibility modifiers ([#4117](https://github.com/typescript-eslint/typescript-eslint/issues/4117)) ([81b25c1](https://github.com/typescript-eslint/typescript-eslint/commit/81b25c12eceae89e181a7bdb3c8298d820cfe3e3)) +- **eslint-plugin:** [no-implied-eval] ignore locally declared functions ([#4049](https://github.com/typescript-eslint/typescript-eslint/issues/4049)) ([d97140e](https://github.com/typescript-eslint/typescript-eslint/commit/d97140ecf4aeb0a1f8b391f46a31881f21ad93c3)) +- **eslint-plugin:** check optional chaining for floating promises ([#4096](https://github.com/typescript-eslint/typescript-eslint/issues/4096)) ([d724777](https://github.com/typescript-eslint/typescript-eslint/commit/d7247770886c619263482c3e083bed9f97b22688)) +- landing page title duplication ([#4123](https://github.com/typescript-eslint/typescript-eslint/issues/4123)) ([844c25e](https://github.com/typescript-eslint/typescript-eslint/commit/844c25e7b6ef9d79aec99d538252e82557f012d3)) -## [5.8.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.8.0...v5.8.1) (2021-12-27) +### Features +- add RuleCreator.withoutDocs ([#4136](https://github.com/typescript-eslint/typescript-eslint/issues/4136)) ([87cfc6a](https://github.com/typescript-eslint/typescript-eslint/commit/87cfc6ad3e3312d7b6f98a592fb37e69d5d6880a)) +- **experimental-utils:** add default [] for RuleModule TOptions generic ([#4135](https://github.com/typescript-eslint/typescript-eslint/issues/4135)) ([62b8098](https://github.com/typescript-eslint/typescript-eslint/commit/62b8098fa7d361954c170ee6c190e47e95194b13)) +- **typescript-estree:** support Import Assertions ([#4074](https://github.com/typescript-eslint/typescript-eslint/issues/4074)) ([ae0fb5a](https://github.com/typescript-eslint/typescript-eslint/commit/ae0fb5a591958216b7df656e66b1dfe464898167)) +- **typescript-estree:** support private fields in-in syntax ([#4075](https://github.com/typescript-eslint/typescript-eslint/issues/4075)) ([939d8ea](https://github.com/typescript-eslint/typescript-eslint/commit/939d8eac547fb1734aa00f1ea01cc6eae0b4280a)) +- **typescript-estree:** support type-only module specifiers ([#4076](https://github.com/typescript-eslint/typescript-eslint/issues/4076)) ([77baa92](https://github.com/typescript-eslint/typescript-eslint/commit/77baa9203638e888a76e21003a278a8da386e133)) -### Bug Fixes +## [5.3.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.3.0...v5.3.1) (2021-11-08) -* **eslint-plugin:** [consistent-indexed-object-style] do not report for circular references ([#4347](https://github.com/typescript-eslint/typescript-eslint/issues/4347)) ([6edebcd](https://github.com/typescript-eslint/typescript-eslint/commit/6edebcda00053eecf7b3e55eeb3fe5d7fb9e7db7)) -* **eslint-plugin:** [consistent-type-definitions] correct fixer with declare keyword ([#4334](https://github.com/typescript-eslint/typescript-eslint/issues/4334)) ([0cd911a](https://github.com/typescript-eslint/typescript-eslint/commit/0cd911a916805d3b1f8043584e4685f3edd5c427)) -* **eslint-plugin:** [padding-line-between-statements] make function overloading is also processed ([#4345](https://github.com/typescript-eslint/typescript-eslint/issues/4345)) ([d31ec26](https://github.com/typescript-eslint/typescript-eslint/commit/d31ec264fe5f5cd27e8f522a485e106889f2d380)) +**Note:** Version bump only for package @typescript-eslint/typescript-eslint +# [5.3.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.2.0...v5.3.0) (2021-11-01) +### Bug Fixes +- **eslint-plugin:** ignore private identifiers in explicit-module-boundary-types ([#4046](https://github.com/typescript-eslint/typescript-eslint/issues/4046)) ([80b853d](https://github.com/typescript-eslint/typescript-eslint/commit/80b853db90ae3d4e32c4b7ec9d45a5c41dc459c9)) +- **eslint-plugin:** skip seenTypes for unions in isTypeReadonly ([#4043](https://github.com/typescript-eslint/typescript-eslint/issues/4043)) ([6af7ca7](https://github.com/typescript-eslint/typescript-eslint/commit/6af7ca7d9fde230342d27ad5a75a09a58c022974)) +- **experimental-utils:** add `name` property to test case interface ([#4067](https://github.com/typescript-eslint/typescript-eslint/issues/4067)) ([f3021c9](https://github.com/typescript-eslint/typescript-eslint/commit/f3021c94460e8d06e4169335bcc1a23854531f2a)) +### Features -# [5.8.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.7.0...v5.8.0) (2021-12-20) +- **eslint-plugin:** [no-shadow] exclude external type declaration merging ([#3959](https://github.com/typescript-eslint/typescript-eslint/issues/3959)) ([a93cebf](https://github.com/typescript-eslint/typescript-eslint/commit/a93cebfc0f2026c50972bcb110bcd3295ba9a44d)) +- **experimental-utils:** extract `isTokenOfTypeWithConditions` out of `ast-utils`' `predicates` ([#3977](https://github.com/typescript-eslint/typescript-eslint/issues/3977)) ([5229597](https://github.com/typescript-eslint/typescript-eslint/commit/5229597d9bfc998852c4b4fb421859e8f3d3d688)) +# [5.2.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.1.0...v5.2.0) (2021-10-25) ### Bug Fixes -* **eslint-plugin:** [no-implied-eval] improve performance ([#4313](https://github.com/typescript-eslint/typescript-eslint/issues/4313)) ([e344596](https://github.com/typescript-eslint/typescript-eslint/commit/e3445967de6ed73e6b2334380236aed8a0ee6e4f)) -* **eslint-plugin:** [padding-line-between-statements] `type` StatementTypes can't differenciate from variable ([#4270](https://github.com/typescript-eslint/typescript-eslint/issues/4270)) ([bfc4324](https://github.com/typescript-eslint/typescript-eslint/commit/bfc4324f4cda24e30b2d39d5b70f7554f2b6bf81)) -* **eslint-plugin:** [strict-boolean-expression] false positive for truthy boolean ([#4275](https://github.com/typescript-eslint/typescript-eslint/issues/4275)) ([72c2e41](https://github.com/typescript-eslint/typescript-eslint/commit/72c2e418a4180f6db5795ebb42cbc095f5c53c37)) -* **eslint-plugin:** `array-type` mark `AST_NODE_TYPES.TSBigIntKeyword` as simple ([#4274](https://github.com/typescript-eslint/typescript-eslint/issues/4274)) ([74e544e](https://github.com/typescript-eslint/typescript-eslint/commit/74e544e487328e56fcb7aef048a78beaad593ea0)) -* **eslint-plugin:** handle method overloading in `semi` ([#4318](https://github.com/typescript-eslint/typescript-eslint/issues/4318)) ([3b87b49](https://github.com/typescript-eslint/typescript-eslint/commit/3b87b49ea8d62c2f4f3bee7494500b5ad44fcbc1)) -* **experimental-utils:** support immutable members ([#3844](https://github.com/typescript-eslint/typescript-eslint/issues/3844)) ([3d33a77](https://github.com/typescript-eslint/typescript-eslint/commit/3d33a77c57e5b752edf6f35ed152038bdb230b79)) - +- **eslint-plugin:** [typedef] fix regression with class properties ([#4034](https://github.com/typescript-eslint/typescript-eslint/issues/4034)) ([fe53d22](https://github.com/typescript-eslint/typescript-eslint/commit/fe53d22f57ad418397fb31fa89c97db0ab4cd6c0)), closes [#4033](https://github.com/typescript-eslint/typescript-eslint/issues/4033) ### Features -* **eslint-plugin:** [no-throw-literal] add options to to disallow `any`/`unknown` ([#4207](https://github.com/typescript-eslint/typescript-eslint/issues/4207)) ([ff0adf9](https://github.com/typescript-eslint/typescript-eslint/commit/ff0adf9e0bfbf71667c51de0a84038586e4cbfd1)) -* **eslint-plugin:** [restrict-plus-operand] add allowAny option ([#4260](https://github.com/typescript-eslint/typescript-eslint/issues/4260)) ([2788545](https://github.com/typescript-eslint/typescript-eslint/commit/27885456c577dfada52d298857f406f0f332c405)) +- **eslint-plugin:** adding `consistent-type-exports` rule ([#3936](https://github.com/typescript-eslint/typescript-eslint/issues/3936)) ([1971a3f](https://github.com/typescript-eslint/typescript-eslint/commit/1971a3f8027416cd1fb33b1d50faa035599917de)) +# [5.1.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.0.0...v5.1.0) (2021-10-18) +### Bug Fixes +- **eslint-plugin:** [no-restricted-imports]: report type-only imports properly ([#3996](https://github.com/typescript-eslint/typescript-eslint/issues/3996)) ([283cdf2](https://github.com/typescript-eslint/typescript-eslint/commit/283cdf26e6b32985531ff6416cd13ef4cb0a3c8c)) +- **eslint-plugin:** [strict-bool-expr] treat unconstrained generic as any ([#3981](https://github.com/typescript-eslint/typescript-eslint/issues/3981)) ([9b29ca7](https://github.com/typescript-eslint/typescript-eslint/commit/9b29ca751f496c25240c0c14b8fa432bf4443d39)) +- **typescript-estree:** support private optional property definition ([#3997](https://github.com/typescript-eslint/typescript-eslint/issues/3997)) ([8605e08](https://github.com/typescript-eslint/typescript-eslint/commit/8605e080a4dac4a277e6108cd9ed1e5a707302fa)) +### Features -# [5.7.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.6.0...v5.7.0) (2021-12-13) +- **experimental-utils:** extract `ast-utils`' `predicates`' helpers ([#3976](https://github.com/typescript-eslint/typescript-eslint/issues/3976)) ([154ec9a](https://github.com/typescript-eslint/typescript-eslint/commit/154ec9aea8e81732cafe36af97c4822f1591b077)) +# [5.0.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.33.0...v5.0.0) (2021-10-11) ### Bug Fixes -* **typescript-estree:** type-only regression for consumers not yet on TS 4.5 ([#4272](https://github.com/typescript-eslint/typescript-eslint/issues/4272)) ([550b61e](https://github.com/typescript-eslint/typescript-eslint/commit/550b61ee1096113b234bf035dd267ba385809961)) - +- **eslint-plugin:** [explicit-member-accessibility] report `TSAbstractPropertyDefinition` and `TSAbstractMethodDefinition` properly ([#3901](https://github.com/typescript-eslint/typescript-eslint/issues/3901)) ([82016f9](https://github.com/typescript-eslint/typescript-eslint/commit/82016f99b14825c9c60e1f7eb3b4efcc492bba86)) +- **eslint-plugin:** update new rules from master ([#3840](https://github.com/typescript-eslint/typescript-eslint/issues/3840)) ([d88a6b4](https://github.com/typescript-eslint/typescript-eslint/commit/d88a6b44eedcf9dd59569160570aa118851aa86b)) +- update new rules from master ([b34fb7e](https://github.com/typescript-eslint/typescript-eslint/commit/b34fb7eb3102ea603bb4aef0dbbf9885b3d47557)) +- **eslint-plugin:** crash in no-dupe-class-members (v5) ([#3813](https://github.com/typescript-eslint/typescript-eslint/issues/3813)) ([4b09644](https://github.com/typescript-eslint/typescript-eslint/commit/4b096442f731c0a60926ac0391a4f2c4208aa8d4)) +- **experimental-utils:** fix `isSetter`'s return type ([#3975](https://github.com/typescript-eslint/typescript-eslint/issues/3975)) ([d256856](https://github.com/typescript-eslint/typescript-eslint/commit/d2568561d0417fdfbdfd964ad942f9d00434af73)) +- **typescript-estree:** change `source` of ExportNamedDeclaration to Literal from Expression ([#3763](https://github.com/typescript-eslint/typescript-eslint/issues/3763)) ([dc5a0f5](https://github.com/typescript-eslint/typescript-eslint/commit/dc5a0f5104b400f4422b8d67ecfc6cc7a32613a2)) ### Features -* **eslint-plugin:** [consistent-type-exports] support TS4.5 inline export specifiers ([#4236](https://github.com/typescript-eslint/typescript-eslint/issues/4236)) ([be4d976](https://github.com/typescript-eslint/typescript-eslint/commit/be4d976215614cc032730ae596d2f6e47df67730)) -* **eslint-plugin:** [consistent-type-imports] support TS4.5 inline import specifiers ([#4237](https://github.com/typescript-eslint/typescript-eslint/issues/4237)) ([f61af7c](https://github.com/typescript-eslint/typescript-eslint/commit/f61af7c53cca52f81e77b4334c7d6ad100609af6)) -* **eslint-plugin:** [no-shadow] support TS4.5 inline import specifiers ([#4239](https://github.com/typescript-eslint/typescript-eslint/issues/4239)) ([96b7e8e](https://github.com/typescript-eslint/typescript-eslint/commit/96b7e8ee0f5280cab50a7205ae592e1d983a111a)) - +- **ast-spec:** bring `Node` objects in line with ESTree ([#3771](https://github.com/typescript-eslint/typescript-eslint/issues/3771)) ([dd14064](https://github.com/typescript-eslint/typescript-eslint/commit/dd140643b457aa515cc21fcda2b3cd4acc2a1c5c)) +- **eslint-plugin:** remove `object` from `ban-types`' default types ([#3818](https://github.com/typescript-eslint/typescript-eslint/issues/3818)) ([ae3fa90](https://github.com/typescript-eslint/typescript-eslint/commit/ae3fa900d5b4e1f557a52ca58d35a7d098d9efaf)) +- **eslint-plugin:** removed value from abstract property nodes ([#3765](https://github.com/typescript-eslint/typescript-eslint/issues/3765)) ([5823524](https://github.com/typescript-eslint/typescript-eslint/commit/58235241714596b641a1e8b39c569e561e0039b4)), closes [#3748](https://github.com/typescript-eslint/typescript-eslint/issues/3748) +- **eslint-plugin:** update recommended configs ([#3809](https://github.com/typescript-eslint/typescript-eslint/issues/3809)) ([deeb7bb](https://github.com/typescript-eslint/typescript-eslint/commit/deeb7bb9334d301c6af56aefd37d318231af11ef)) +- align class property representation with ESTree ([#3806](https://github.com/typescript-eslint/typescript-eslint/issues/3806)) ([22fa5c0](https://github.com/typescript-eslint/typescript-eslint/commit/22fa5c0c4705ed2898f00b7cacc5dd642d859275)), closes [#3430](https://github.com/typescript-eslint/typescript-eslint/issues/3430) [#3077](https://github.com/typescript-eslint/typescript-eslint/issues/3077) +- remove `meta.docs.category` from rules ([#3800](https://github.com/typescript-eslint/typescript-eslint/issues/3800)) ([71c9370](https://github.com/typescript-eslint/typescript-eslint/commit/71c93706e55f5f92a1285102b93c6ab1950c6df4)) +- remove `TSParenthesizedType` ([#3340](https://github.com/typescript-eslint/typescript-eslint/issues/3340)) ([c8ee432](https://github.com/typescript-eslint/typescript-eslint/commit/c8ee43269faea4c04ec02eaa2b81a0aa6eec5d3e)), closes [#3136](https://github.com/typescript-eslint/typescript-eslint/issues/3136) +- support `PrivateIdentifier` ([#3808](https://github.com/typescript-eslint/typescript-eslint/issues/3808)) ([0eefe5e](https://github.com/typescript-eslint/typescript-eslint/commit/0eefe5e49d21af3f1e3e2d9a90c2e49929863ac2)), closes [#3430](https://github.com/typescript-eslint/typescript-eslint/issues/3430) [#2933](https://github.com/typescript-eslint/typescript-eslint/issues/2933) +- **eslint-plugin:** [comma-dangle] align schema with ESLint v8 ([#3768](https://github.com/typescript-eslint/typescript-eslint/issues/3768)) ([0acfafc](https://github.com/typescript-eslint/typescript-eslint/commit/0acfafcc655e28dcfc05a5caa567c0d0217ee7ad)) +- **eslint-plugin:** [member-ordering] add support for getters and setters ([#3611](https://github.com/typescript-eslint/typescript-eslint/issues/3611)) ([e264124](https://github.com/typescript-eslint/typescript-eslint/commit/e2641246571b69df36cde5cb7bce7c4fffc43f98)) +- **eslint-plugin:** remove `no-unused-vars-experimental` ([79ae03b](https://github.com/typescript-eslint/typescript-eslint/commit/79ae03b8adbae2b0a86276711a9c834af01bbb61)) +- **experimental-utils:** extract `isNodeOfTypes` out of `ast-utils`' `predicates` ([#3836](https://github.com/typescript-eslint/typescript-eslint/issues/3836)) ([0cc509b](https://github.com/typescript-eslint/typescript-eslint/commit/0cc509b61df248cfb4b42fe64ec800f3cac69c69)) +- **typescript-estree:** remove legacy `useJSXTextNode` option ([#3109](https://github.com/typescript-eslint/typescript-eslint/issues/3109)) ([5b84b98](https://github.com/typescript-eslint/typescript-eslint/commit/5b84b98fb3cf68d944b7d4e970f39f4e88f0b2d5)) +- support ESLint v8 ([#3737](https://github.com/typescript-eslint/typescript-eslint/issues/3737)) ([4ca62ae](https://github.com/typescript-eslint/typescript-eslint/commit/4ca62aee6681d706e762a8db727541ca204364f2)) +- **experimental-utils:** remove `getComments` from `ESLint` `SourceCode` types ([#3766](https://github.com/typescript-eslint/typescript-eslint/issues/3766)) ([165a507](https://github.com/typescript-eslint/typescript-eslint/commit/165a507970d8e4a0ed12abdd5f0d892f7de83ffe)) +### BREAKING CHANGES +- **eslint-plugin:** `ban-types` no longer reports `object` by default +# [4.33.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.32.0...v4.33.0) (2021-10-04) -# [5.6.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.5.0...v5.6.0) (2021-12-06) +### Bug Fixes +- **eslint-plugin:** [lines-between-class-members] fix `exceptAfterOverload` for abstract methods ([#3943](https://github.com/typescript-eslint/typescript-eslint/issues/3943)) ([240fc65](https://github.com/typescript-eslint/typescript-eslint/commit/240fc65c307769eae9b35e611fca74ba4c35a025)) +- **eslint-plugin:** [no-confusing-void-expression] support optional chaining ([#3937](https://github.com/typescript-eslint/typescript-eslint/issues/3937)) ([c40dd13](https://github.com/typescript-eslint/typescript-eslint/commit/c40dd13df76b77052c85254622df5533307dc07e)) +- **eslint-plugin:** [no-restricted-imports] fix crash when no options given ([#3947](https://github.com/typescript-eslint/typescript-eslint/issues/3947)) ([edaa3c1](https://github.com/typescript-eslint/typescript-eslint/commit/edaa3c10eb67bb89f9c6a78bd1ed593925c33f16)) +- **eslint-plugin:** [non-nullable-type-assertion-style] false-positive with non-nullish `as` assertions and types ([#3940](https://github.com/typescript-eslint/typescript-eslint/issues/3940)) ([40760f9](https://github.com/typescript-eslint/typescript-eslint/commit/40760f98da0d23c7bce3da04cf37a56c10447bde)) +- **eslint-plugin:** [padding-line-between-statements] TSModuleBlock should change scope ([#3944](https://github.com/typescript-eslint/typescript-eslint/issues/3944)) ([f8f534e](https://github.com/typescript-eslint/typescript-eslint/commit/f8f534e42b0ec517274442422c37ab019cf3c200)) +- **eslint-plugin:** [prefer-regexp-exec] check `RegExp` without flags ([#3946](https://github.com/typescript-eslint/typescript-eslint/issues/3946)) ([0868725](https://github.com/typescript-eslint/typescript-eslint/commit/0868725713e8102e8932303d4c680340688e1fa9)) +- **experimental-utils:** add `getPhysicalFilename()` to `RuleContext` ([#3934](https://github.com/typescript-eslint/typescript-eslint/issues/3934)) ([ee5dfd4](https://github.com/typescript-eslint/typescript-eslint/commit/ee5dfd4989ab465d65ba3424e36b7f0964558191)) +- **experimental-utils:** require fix in suggestions ([#3949](https://github.com/typescript-eslint/typescript-eslint/issues/3949)) ([f022fb1](https://github.com/typescript-eslint/typescript-eslint/commit/f022fb14c71dad25be2314252eb751964f34fcb8)) ### Features -* **scope-manager:** support TS4.5 import/export specifier kind ([#4234](https://github.com/typescript-eslint/typescript-eslint/issues/4234)) ([833f822](https://github.com/typescript-eslint/typescript-eslint/commit/833f8221ce00aecb7d08c519bab9568353850f48)) -* **scope-manager:** update lib types ([#4240](https://github.com/typescript-eslint/typescript-eslint/issues/4240)) ([8377e6e](https://github.com/typescript-eslint/typescript-eslint/commit/8377e6ea422ee2d52455da8955ff055e09c238d3)) - - +- **experimental-utils:** extract `isNodeOfTypeWithConditions` out of `ast-utils`' `predicates` ([#3837](https://github.com/typescript-eslint/typescript-eslint/issues/3837)) ([214f898](https://github.com/typescript-eslint/typescript-eslint/commit/214f898178ba593146d06a444487d32ec3363854)) +# [4.32.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.31.2...v4.32.0) (2021-09-27) +### Bug Fixes -# [5.5.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.4.0...v5.5.0) (2021-11-29) +- **eslint-plugin:** [consistent-type-definitions] correct fix for `export default` ([#3899](https://github.com/typescript-eslint/typescript-eslint/issues/3899)) ([ebb33ed](https://github.com/typescript-eslint/typescript-eslint/commit/ebb33ed8bc29f69ca2a657ec5b31857c0aeb4b56)) +- **eslint-plugin:** [no-require-imports] report only global `require` ([#3871](https://github.com/typescript-eslint/typescript-eslint/issues/3871)) ([8aa87a1](https://github.com/typescript-eslint/typescript-eslint/commit/8aa87a136e7cd7b40fbf09fcfa26bf04d1c6d5fe)) +- **eslint-plugin:** [no-shadow] ignore type-only imports properly ([#3868](https://github.com/typescript-eslint/typescript-eslint/issues/3868)) ([dda9cee](https://github.com/typescript-eslint/typescript-eslint/commit/dda9cee68a5cd78b358a854027999c739ac623e9)) +- **eslint-plugin:** [no-var-requires] report problems within `NewExpression` ([#3884](https://github.com/typescript-eslint/typescript-eslint/issues/3884)) ([ed5e459](https://github.com/typescript-eslint/typescript-eslint/commit/ed5e45983fa052accf3a7b5fcdbfcb15ed09490f)) +- **eslint-plugin:** [padding-line-between-statements] problems within namespaces not being reported ([#3869](https://github.com/typescript-eslint/typescript-eslint/issues/3869)) ([1861356](https://github.com/typescript-eslint/typescript-eslint/commit/186135698b40b510ffff6a2402aa34f2726596ea)) +- **eslint-plugin:** [prefer-regexp-exec] respect flags when using `RegExp` ([#3855](https://github.com/typescript-eslint/typescript-eslint/issues/3855)) ([ffdb5ff](https://github.com/typescript-eslint/typescript-eslint/commit/ffdb5ff9900e07374a2f3686447e3e2c78fbc38a)) +- **eslint-plugin:** [prefer-return-this-type] handle generics properly in fixer ([#3852](https://github.com/typescript-eslint/typescript-eslint/issues/3852)) ([9e98b8f](https://github.com/typescript-eslint/typescript-eslint/commit/9e98b8f43ca6aadc9758a4e9a0d1d3c250af6cca)) +- **eslint-plugin:** false-positive/negative with array index in no-unnecessary-condition ([#3805](https://github.com/typescript-eslint/typescript-eslint/issues/3805)) ([bdb8f0b](https://github.com/typescript-eslint/typescript-eslint/commit/bdb8f0be1466e4a4b713e91199be91030650ed01)) +- **experimental-utils:** add missing signature for `isParenthesized` ([#3887](https://github.com/typescript-eslint/typescript-eslint/issues/3887)) ([806eaac](https://github.com/typescript-eslint/typescript-eslint/commit/806eaac6af5325664634690e9ebd7ffaed276549)) +### Features -### Bug Fixes +- **eslint-plugin:** [no-type-alias]: add allowGenerics option ([#3865](https://github.com/typescript-eslint/typescript-eslint/issues/3865)) ([4195919](https://github.com/typescript-eslint/typescript-eslint/commit/41959199735a6d4fe3ae7825f3087e8fb249be9f)) +- **eslint-plugin:** add `no-non-null-asserted-nullish-coalescing` rule ([#3349](https://github.com/typescript-eslint/typescript-eslint/issues/3349)) ([4e99961](https://github.com/typescript-eslint/typescript-eslint/commit/4e999614e9761f6dc7e5aa0c5bad76ab164ab3fb)) +- **eslint-plugin:** add new extended rule `no-restricted-imports` ([#3775](https://github.com/typescript-eslint/typescript-eslint/issues/3775)) ([ec5d506](https://github.com/typescript-eslint/typescript-eslint/commit/ec5d50696b249a207d322e4a2fc66582122eb010)) +- **eslint-plugin-internal:** [prefer-ast-types-enum] add `DefinitionType` enum ([#3916](https://github.com/typescript-eslint/typescript-eslint/issues/3916)) ([13b7de5](https://github.com/typescript-eslint/typescript-eslint/commit/13b7de508e0f8eac492879ff9ab99acd8d3e977e)) +- Support `'latest'` as `ecmaVersion` ([#3873](https://github.com/typescript-eslint/typescript-eslint/issues/3873)) ([25a42c0](https://github.com/typescript-eslint/typescript-eslint/commit/25a42c0bbe92d1ecbc2e8ff9ef3a3ef413f728b0)) -* **eslint-plugin:** [member-ordering] order literal names correctly in ([#4054](https://github.com/typescript-eslint/typescript-eslint/issues/4054)) ([d57141a](https://github.com/typescript-eslint/typescript-eslint/commit/d57141a3d13fad30a93ed99a6a15f4b0b369246a)) -* **eslint-plugin:** [no-duplicate-imports] remove unnecessary type checking for `node.source` ([#4196](https://github.com/typescript-eslint/typescript-eslint/issues/4196)) ([637722a](https://github.com/typescript-eslint/typescript-eslint/commit/637722a77667f6ed1e0cf1f0e752d61622ae8546)) -* **eslint-plugin:** [no-var-requires] do not report require created from createRequire ([#4221](https://github.com/typescript-eslint/typescript-eslint/issues/4221)) ([0040186](https://github.com/typescript-eslint/typescript-eslint/commit/0040186aa23692724986df22a71926e8a7ff9e02)) -* **eslint-plugin:** [prefer-for-of] do nor error when iterating over this ([#4176](https://github.com/typescript-eslint/typescript-eslint/issues/4176)) ([258ddb0](https://github.com/typescript-eslint/typescript-eslint/commit/258ddb0708b7a44959bd3ac399cbde912c8021c8)) -* **eslint-plugin:** [require-await] treat yield* asynciterable as an await ([#4125](https://github.com/typescript-eslint/typescript-eslint/issues/4125)) ([5a4ce6a](https://github.com/typescript-eslint/typescript-eslint/commit/5a4ce6a241b1d6c6caad87cad85c3741f0953e39)) -* **eslint-plugin:** remove all whitespaces in comparison [#4220](https://github.com/typescript-eslint/typescript-eslint/issues/4220) ([#4223](https://github.com/typescript-eslint/typescript-eslint/issues/4223)) ([853d799](https://github.com/typescript-eslint/typescript-eslint/commit/853d799428a061d9bf6a2e74b01dc49a1e4f3134)) -* **experimental-utils:** export RuleCreator interfaces ([#4199](https://github.com/typescript-eslint/typescript-eslint/issues/4199)) ([7821e4c](https://github.com/typescript-eslint/typescript-eslint/commit/7821e4c515ca2f11a14dcfa94dc77370da0287c5)) -* **experimental-utils:** fix types for eslint-utils ([#4173](https://github.com/typescript-eslint/typescript-eslint/issues/4173)) ([7079de2](https://github.com/typescript-eslint/typescript-eslint/commit/7079de26877a2313a7019845d4c33d0fc4d4b4a9)) -* **scope-manager:** support static class blocks ([#4211](https://github.com/typescript-eslint/typescript-eslint/issues/4211)) ([f8e9125](https://github.com/typescript-eslint/typescript-eslint/commit/f8e91256e0a721aaa906a5c40a92784da9433b53)) -* **visitor-keys:** add missing import assertion keys ([#4178](https://github.com/typescript-eslint/typescript-eslint/issues/4178)) ([9c38b7f](https://github.com/typescript-eslint/typescript-eslint/commit/9c38b7f7fc3ce471a8f720c4a2fbce01f3ee12a4)) +## [4.31.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.31.1...v4.31.2) (2021-09-20) +**Note:** Version bump only for package @typescript-eslint/typescript-eslint -### Features +## [4.31.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.31.0...v4.31.1) (2021-09-13) -* **eslint-plugin:** [member-ordering] add option to sort case insensitive ([#3896](https://github.com/typescript-eslint/typescript-eslint/issues/3896)) ([e3533d5](https://github.com/typescript-eslint/typescript-eslint/commit/e3533d5a6293a358b5eb0a6ed17da961a09b0ed3)) -* **eslint-plugin:** `array-type` distinguish whether readonly or not ([#4066](https://github.com/typescript-eslint/typescript-eslint/issues/4066)) ([314af44](https://github.com/typescript-eslint/typescript-eslint/commit/314af44bde3ccbebc620625b2931d77688525976)) +**Note:** Version bump only for package @typescript-eslint/typescript-eslint +# [4.31.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.30.0...v4.31.0) (2021-09-06) +### Bug Fixes +- **ast-spec:** remove duplicate union types from `Expression` ([#3770](https://github.com/typescript-eslint/typescript-eslint/issues/3770)) ([463e768](https://github.com/typescript-eslint/typescript-eslint/commit/463e768978731d019345f6552d7fd7a073a80192)) +- **utils:** support immutable arrays in `ReportFixFunction` ([#3830](https://github.com/typescript-eslint/typescript-eslint/issues/3830)) ([8218055](https://github.com/typescript-eslint/typescript-eslint/commit/8218055d6dfd94c9e6c8645848f981d9d51ce08c)) +### Features -# [5.4.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.3.1...v5.4.0) (2021-11-15) +- **eslint-plugin:** [prefer-readonly-parameter-types] add option treatMethodsAsReadonly ([#3733](https://github.com/typescript-eslint/typescript-eslint/issues/3733)) ([a46e318](https://github.com/typescript-eslint/typescript-eslint/commit/a46e3182c8a0b07c914605d6d9fe28ef36a7c32a)) +- **eslint-plugin:** [restrict-template-expressions] add option to allow RegExp ([#3709](https://github.com/typescript-eslint/typescript-eslint/issues/3709)) ([363b3dc](https://github.com/typescript-eslint/typescript-eslint/commit/363b3dc4dd0dc343311c729d75935b10f9d2fd5e)) +- **eslint-plugin:** add `no-meaningless-void-operator` rule ([#3641](https://github.com/typescript-eslint/typescript-eslint/issues/3641)) ([ea40ab6](https://github.com/typescript-eslint/typescript-eslint/commit/ea40ab659351ae7cf7235ea063d42ac155b11e5f)) +- **eslint-plugin:** add extension rule `padding-line-between-statements` ([#3418](https://github.com/typescript-eslint/typescript-eslint/issues/3418)) ([f79ae9b](https://github.com/typescript-eslint/typescript-eslint/commit/f79ae9b58e82f4fddef640a34a1d7ff92b763e65)) +- **experimental-utils:** extract `isNodeOfType` out of `ast-utils`' `predicates` ([#3677](https://github.com/typescript-eslint/typescript-eslint/issues/3677)) ([4bfa437](https://github.com/typescript-eslint/typescript-eslint/commit/4bfa4375aff8f65057d4aa116e435803cbc6b464)) +# [4.30.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.29.3...v4.30.0) (2021-08-30) ### Bug Fixes -* correct issues with circular imports ([#4140](https://github.com/typescript-eslint/typescript-eslint/issues/4140)) ([4c87b24](https://github.com/typescript-eslint/typescript-eslint/commit/4c87b2486a9c90794d972a4d093c1dc22ffb418b)) -* **eslint-plugin:** [explicit-member-accessibility] private fields cannot have accessibility modifiers ([#4117](https://github.com/typescript-eslint/typescript-eslint/issues/4117)) ([81b25c1](https://github.com/typescript-eslint/typescript-eslint/commit/81b25c12eceae89e181a7bdb3c8298d820cfe3e3)) -* **eslint-plugin:** [no-implied-eval] ignore locally declared functions ([#4049](https://github.com/typescript-eslint/typescript-eslint/issues/4049)) ([d97140e](https://github.com/typescript-eslint/typescript-eslint/commit/d97140ecf4aeb0a1f8b391f46a31881f21ad93c3)) -* **eslint-plugin:** check optional chaining for floating promises ([#4096](https://github.com/typescript-eslint/typescript-eslint/issues/4096)) ([d724777](https://github.com/typescript-eslint/typescript-eslint/commit/d7247770886c619263482c3e083bed9f97b22688)) -* landing page title duplication ([#4123](https://github.com/typescript-eslint/typescript-eslint/issues/4123)) ([844c25e](https://github.com/typescript-eslint/typescript-eslint/commit/844c25e7b6ef9d79aec99d538252e82557f012d3)) - +- **eslint-plugin:** [dot-notation] false positive with optional chaining ([#3711](https://github.com/typescript-eslint/typescript-eslint/issues/3711)) ([c19fc6e](https://github.com/typescript-eslint/typescript-eslint/commit/c19fc6e03072ed549bc9b35ebe6961e10f8f9b43)), closes [#3510](https://github.com/typescript-eslint/typescript-eslint/issues/3510) +- **eslint-plugin:** [prefer-reduce-type-parameter] handle already existing type params ([#3706](https://github.com/typescript-eslint/typescript-eslint/issues/3706)) ([71dd273](https://github.com/typescript-eslint/typescript-eslint/commit/71dd27361a1bc93b5d5eb2279d805922b10002fd)) +- **eslint-plugin:** isTypeReadonly error with unknown ([#2371](https://github.com/typescript-eslint/typescript-eslint/issues/2371)) ([e7528e6](https://github.com/typescript-eslint/typescript-eslint/commit/e7528e686f5fe5cce8504fc15d3cd06b8733712e)) -* **typescript-estree:** support TSv4 labelled tuple members ([#2378](https://github.com/typescript-eslint/typescript-eslint/issues/2378)) ([00d84ff](https://github.com/typescript-eslint/typescript-eslint/commit/00d84ffbcbe9d0ec98bdb2f2ce59959a27ce4dbe)) - - - - - -# [3.8.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.7.1...v3.8.0) (2020-08-03) +- **eslint-plugin:** [space-infix-ops] support for class properties and type aliases ([#3231](https://github.com/typescript-eslint/typescript-eslint/issues/3231)) ([5414bf2](https://github.com/typescript-eslint/typescript-eslint/commit/5414bf27a81311099d001808475d9cf832ce3bfe)) +- **eslint-plugin:** [type-annotation-spacing] handle space between ? and : ([#3138](https://github.com/typescript-eslint/typescript-eslint/issues/3138)) ([40bdb0b](https://github.com/typescript-eslint/typescript-eslint/commit/40bdb0b27b21de511f0ecd151cb8282a625ca6e1)) +# [4.19.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.18.0...v4.19.0) (2021-03-22) ### Bug Fixes -* **eslint-plugin:** [no-implied-eval] don't report when `Function` is imported ([#2348](https://github.com/typescript-eslint/typescript-eslint/issues/2348)) ([fa169e7](https://github.com/typescript-eslint/typescript-eslint/commit/fa169e79661821f0e0e64a56d6db9da42c3c8654)) -* **eslint-plugin:** [no-unsafe-assignment] fix typo in message ([#2347](https://github.com/typescript-eslint/typescript-eslint/issues/2347)) ([2027bb1](https://github.com/typescript-eslint/typescript-eslint/commit/2027bb11689b76c297f93ba8a918b35fe68e5b9d)) - +- **eslint-plugin:** [member-delimiter-style] correct invalid fix for multiline with params on the same line ([#3177](https://github.com/typescript-eslint/typescript-eslint/issues/3177)) ([7ad343b](https://github.com/typescript-eslint/typescript-eslint/commit/7ad343b067040f6ea816b129323d110d4bc2e830)) +- **eslint-plugin:** [promise-function-async] bad fixer with computed and literal methods ([#3163](https://github.com/typescript-eslint/typescript-eslint/issues/3163)) ([e3a3ea0](https://github.com/typescript-eslint/typescript-eslint/commit/e3a3ea04757464aa2dded1ef46af8ad4e05246f2)) +- **typescript-estree:** [ts 4.2] add support for import type equal declaration ([#3189](https://github.com/typescript-eslint/typescript-eslint/issues/3189)) ([6a25faf](https://github.com/typescript-eslint/typescript-eslint/commit/6a25faf5cfa4d21a7546d9866819f4e017308fb2)) ### Features -* **eslint-plugin:** [naming-convention] allow specifying an array of selectors ([#2335](https://github.com/typescript-eslint/typescript-eslint/issues/2335)) ([3ef6bd5](https://github.com/typescript-eslint/typescript-eslint/commit/3ef6bd5cadc225e42ef1330d15919a39f53f2a2b)) -* **eslint-plugin:** add `prefer-enum-initializers` rule ([#2326](https://github.com/typescript-eslint/typescript-eslint/issues/2326)) ([4f38ea3](https://github.com/typescript-eslint/typescript-eslint/commit/4f38ea39c97289db11501d6368d01db8c5787257)) - - - - - -## [3.7.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.7.0...v3.7.1) (2020-07-27) +- **eslint-plugin:** [object-curly-spacing] support MappedType ([#3176](https://github.com/typescript-eslint/typescript-eslint/issues/3176)) ([0557a43](https://github.com/typescript-eslint/typescript-eslint/commit/0557a439327557f4c0369ae2dddc8282ba45bfe6)) +- **eslint-plugin:** [unbound-method] improve error message ([#3203](https://github.com/typescript-eslint/typescript-eslint/issues/3203)) ([5cc5d2e](https://github.com/typescript-eslint/typescript-eslint/commit/5cc5d2ef6d924d301e87f7bcf599352310e74b2c)), closes [#3201](https://github.com/typescript-eslint/typescript-eslint/issues/3201) +# [4.18.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.17.0...v4.18.0) (2021-03-15) ### Bug Fixes -* **eslint-plugin:** [adjacent-overload-signatures] fix false positive on call signatures and a method named `call` ([#2313](https://github.com/typescript-eslint/typescript-eslint/issues/2313)) ([30fafb0](https://github.com/typescript-eslint/typescript-eslint/commit/30fafb09422b3aca881f4785d89b0536092d4952)) -* **eslint-plugin:** [no-extra-parens] stop reporting on calling generic functions with one argument and type parameters containing parentheses ([#2319](https://github.com/typescript-eslint/typescript-eslint/issues/2319)) ([616a841](https://github.com/typescript-eslint/typescript-eslint/commit/616a841032bec310d9f31f1c987888273df27008)) -* **typescript-estree:** correct AST regression introduced by TS4.0 upgrade ([#2316](https://github.com/typescript-eslint/typescript-eslint/issues/2316)) ([d7fefba](https://github.com/typescript-eslint/typescript-eslint/commit/d7fefba3741a526ff2b58dd713995c3ee5603962)) - - - - - -# [3.7.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.6.1...v3.7.0) (2020-07-20) - +- **eslint-plugin:** [explicit-module-boundary-types] fixes [#2864](https://github.com/typescript-eslint/typescript-eslint/issues/2864) related to functions in nested object properties ([#3178](https://github.com/typescript-eslint/typescript-eslint/issues/3178)) ([55e1fba](https://github.com/typescript-eslint/typescript-eslint/commit/55e1fbaca985b500cad1cc9ec25717b18cf5a17b)) +- **eslint-plugin:** [no-extran-class] allowWithDecorator should ignore other errors ([#3160](https://github.com/typescript-eslint/typescript-eslint/issues/3160)) ([a148673](https://github.com/typescript-eslint/typescript-eslint/commit/a1486736d8ef3555832ddfb27fd0980368b363f5)) ### Features -* **eslint-plugin:** [naming-convention] allow selecting only `const` variables ([#2291](https://github.com/typescript-eslint/typescript-eslint/issues/2291)) ([156d058](https://github.com/typescript-eslint/typescript-eslint/commit/156d058fee835fdf1ed827a5ad4a80d57190cc54)) -* **eslint-plugin:** [no-empty-function] add `decoratedFunctions` option ([#2295](https://github.com/typescript-eslint/typescript-eslint/issues/2295)) ([88f08f4](https://github.com/typescript-eslint/typescript-eslint/commit/88f08f410760f58fdc2de58ecd9dab9610821642)) -* **typescript-estree:** support short-circuiting assignment operators ([#2307](https://github.com/typescript-eslint/typescript-eslint/issues/2307)) ([2c90d9f](https://github.com/typescript-eslint/typescript-eslint/commit/2c90d9fa3aa5ebd7db697dddb7762bca2dd0e06b)) -* **typescript-estree:** support type annotations on catch clauses ([#2306](https://github.com/typescript-eslint/typescript-eslint/issues/2306)) ([b5afe9c](https://github.com/typescript-eslint/typescript-eslint/commit/b5afe9c560b9f38c8dffc312a600db30944129c8)) - - - - - -## [3.6.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.6.0...v3.6.1) (2020-07-13) - - -### Bug Fixes - -* **eslint-plugin:** [no-unnecessary-condition] handle computed member access ([#2288](https://github.com/typescript-eslint/typescript-eslint/issues/2288)) ([3a187ca](https://github.com/typescript-eslint/typescript-eslint/commit/3a187cafb7302a3c05de0e6a236dd142a5e2d741)) -* **eslint-plugin:** [prefer-literal-enum-member] allow negative numbers ([#2277](https://github.com/typescript-eslint/typescript-eslint/issues/2277)) ([00ac9c3](https://github.com/typescript-eslint/typescript-eslint/commit/00ac9c3ccaad27bab08ec3c3a104f612bb593df5)) -* **eslint-plugin:** [space-before-function-paren] incorrect handling of abstract methods ([#2275](https://github.com/typescript-eslint/typescript-eslint/issues/2275)) ([ced6591](https://github.com/typescript-eslint/typescript-eslint/commit/ced65918b16f46c383496a9b4bd43eca8a76baf6)), closes [#2274](https://github.com/typescript-eslint/typescript-eslint/issues/2274) -* **eslint-plugin:** [switch-exhaustiveness-check] handle special characters in enum keys ([#2207](https://github.com/typescript-eslint/typescript-eslint/issues/2207)) ([98ab010](https://github.com/typescript-eslint/typescript-eslint/commit/98ab010fb7fca884984bb4200fd806ecee8071b6)) - - - - - -# [3.6.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.5.0...v3.6.0) (2020-07-06) +- **eslint-plugin:** add package type declaration ([#3164](https://github.com/typescript-eslint/typescript-eslint/issues/3164)) ([08b058a](https://github.com/typescript-eslint/typescript-eslint/commit/08b058a7a6db3b59c28753bb322717e1fee44d1f)) +# [4.17.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.16.1...v4.17.0) (2021-03-08) ### Bug Fixes -* **eslint-plugin:** [no-namespace] allow namespaces in nested declarations with `allowDeclarations` ([#2238](https://github.com/typescript-eslint/typescript-eslint/issues/2238)) ([c1df669](https://github.com/typescript-eslint/typescript-eslint/commit/c1df6694f7866d3ef7ede0b1c6c9dd6f3955e682)) -* **eslint-plugin:** [space-before-function-paren] handle abstract functions ([#2199](https://github.com/typescript-eslint/typescript-eslint/issues/2199)) ([88a3edf](https://github.com/typescript-eslint/typescript-eslint/commit/88a3edfce8349f871b7b660d2b76508b67c94eda)) - +- **eslint-plugin:** [no-unnecessary-type-assertion] handle assignment ([#3133](https://github.com/typescript-eslint/typescript-eslint/issues/3133)) ([cb22561](https://github.com/typescript-eslint/typescript-eslint/commit/cb2256168c67e0383083673a5afe77076de49da5)) ### Features -* **eslint-plugin:** add rule `prefer-literal-enum-member` ([#1898](https://github.com/typescript-eslint/typescript-eslint/issues/1898)) ([fe2b2ec](https://github.com/typescript-eslint/typescript-eslint/commit/fe2b2ec39ef04ac8b73eef9d29d12fd1b24fa183)) - - - - - -# [3.5.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.4.0...v3.5.0) (2020-06-29) +- **eslint-plugin:** [strict-bool-expr] add fixes and suggestions ([#2847](https://github.com/typescript-eslint/typescript-eslint/issues/2847)) ([3f9e9a1](https://github.com/typescript-eslint/typescript-eslint/commit/3f9e9a1e9fc3e507bd01d1913ef642cd129de402)) +## [4.16.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.16.0...v4.16.1) (2021-03-01) ### Bug Fixes -* **eslint-plugin:** [naming-convention] support unicode in regex ([#2241](https://github.com/typescript-eslint/typescript-eslint/issues/2241)) ([5fdd21a](https://github.com/typescript-eslint/typescript-eslint/commit/5fdd21a1726fb6928098c4152aec55a30df960d4)) -* **typescript-estree:** forward compatibility for new compound assignment operators ([#2253](https://github.com/typescript-eslint/typescript-eslint/issues/2253)) ([ba41680](https://github.com/typescript-eslint/typescript-eslint/commit/ba41680f2a25b1aa4d05c2d4b132ac73a6faefbd)) - - -### Features - -* add package scope-manager ([#1939](https://github.com/typescript-eslint/typescript-eslint/issues/1939)) ([682eb7e](https://github.com/typescript-eslint/typescript-eslint/commit/682eb7e009c3f22a542882dfd3602196a60d2a1e)) -* split types into their own package ([#2229](https://github.com/typescript-eslint/typescript-eslint/issues/2229)) ([5f45918](https://github.com/typescript-eslint/typescript-eslint/commit/5f4591886f3438329fbf2229b03ac66174334a24)) -* split visitor keys into their own package ([#2230](https://github.com/typescript-eslint/typescript-eslint/issues/2230)) ([689dae3](https://github.com/typescript-eslint/typescript-eslint/commit/689dae37392d527c64ae83db2a4c3e6b7fecece7)) - - - - - -# [3.4.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.3.0...v3.4.0) (2020-06-22) +- **typescript-estree:** update TS version range ([#3127](https://github.com/typescript-eslint/typescript-eslint/issues/3127)) ([0473674](https://github.com/typescript-eslint/typescript-eslint/commit/0473674c58df5039a2de3c63ad7494fc6be7487e)) +# [4.16.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.15.2...v4.16.0) (2021-03-01) ### Bug Fixes -* **eslint-plugin:** [no-base-to-string] handle intersection types ([#2170](https://github.com/typescript-eslint/typescript-eslint/issues/2170)) ([9cca3a9](https://github.com/typescript-eslint/typescript-eslint/commit/9cca3a9584d5d5ef0536219c5a734f4e87efb543)) -* **eslint-plugin:** [unbound-method] handling destructuring ([#2228](https://github.com/typescript-eslint/typescript-eslint/issues/2228)) ([c3753c2](https://github.com/typescript-eslint/typescript-eslint/commit/c3753c21768d355ecdb9e7ae8e0bfdfbbc1d3bbe)) -* **experimental-utils:** correct types for TS versions older than 3.8 ([#2217](https://github.com/typescript-eslint/typescript-eslint/issues/2217)) ([5e4dda2](https://github.com/typescript-eslint/typescript-eslint/commit/5e4dda264a7d6a6a1626848e7599faea1ac34922)) -* **experimental-utils:** getParserServices takes a readonly context ([#2235](https://github.com/typescript-eslint/typescript-eslint/issues/2235)) ([26da8de](https://github.com/typescript-eslint/typescript-eslint/commit/26da8de7fcde9eddec63212d79af781c4bb22991)) - +- **eslint-plugin:** [consistent-indexed-object-style] do not autofix if interface has extends ([#3009](https://github.com/typescript-eslint/typescript-eslint/issues/3009)) ([b0475af](https://github.com/typescript-eslint/typescript-eslint/commit/b0475aff3920d748fa74b5a6d8a7ad5dd731aec4)) +- **eslint-plugin:** [no-implied-eval] handle conditional expression ([#3125](https://github.com/typescript-eslint/typescript-eslint/issues/3125)) ([8c65d30](https://github.com/typescript-eslint/typescript-eslint/commit/8c65d30a225a3b99e80326961d0cb0c8189b039c)) +- **eslint-plugin:** [no-unused-vars] don't report nested module declaration ([#3119](https://github.com/typescript-eslint/typescript-eslint/issues/3119)) ([4ca5888](https://github.com/typescript-eslint/typescript-eslint/commit/4ca58886adf3fc0fe31c263559990c8a534205f9)) +- **eslint-plugin:** [prefer-function-type] apply existing comments to the fixed code ([#3094](https://github.com/typescript-eslint/typescript-eslint/issues/3094)) ([c32f803](https://github.com/typescript-eslint/typescript-eslint/commit/c32f803d4480acf5ffc88e308b4243e5185c4f48)) +- **eslint-plugin:** [unbound-method] allow `super` expressions in `this` assignments ([#3010](https://github.com/typescript-eslint/typescript-eslint/issues/3010)) ([c65a139](https://github.com/typescript-eslint/typescript-eslint/commit/c65a1391be15bbcf3ae293b1c53686703883d546)) +- **scope-manager:** update libs for typescript 4.2 ([#3118](https://github.com/typescript-eslint/typescript-eslint/issues/3118)) ([0336c79](https://github.com/typescript-eslint/typescript-eslint/commit/0336c798c9502fc250d2eaa045661950da55e52f)) ### Features -* **eslint-plugin:** [no-unnecessary-boolean-literal-compare] add option to check nullable booleans ([#1983](https://github.com/typescript-eslint/typescript-eslint/issues/1983)) ([c0b3057](https://github.com/typescript-eslint/typescript-eslint/commit/c0b3057b7f7d515891ad2efe32e4ef8c01e0478f)) -* **eslint-plugin:** add extension rule `no-loss-of-precision` ([#2196](https://github.com/typescript-eslint/typescript-eslint/issues/2196)) ([535b0f2](https://github.com/typescript-eslint/typescript-eslint/commit/535b0f2ddd82efa6a2c40307a61c480f4b3cdea3)) - - - - - -# [3.3.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.2.0...v3.3.0) (2020-06-15) +- TypeScript 4.2 syntax support ([#3112](https://github.com/typescript-eslint/typescript-eslint/issues/3112)) ([2ebfb21](https://github.com/typescript-eslint/typescript-eslint/commit/2ebfb21ba6c88c793cfbd0e231e5803b2381694c)) +- **eslint-plugin:** [member-delimiter-style] Add an option 'multilineDetection' to treat types and interfaces as single line if the last member ends on the same line as the closing bracket ([#2970](https://github.com/typescript-eslint/typescript-eslint/issues/2970)) ([cf86f42](https://github.com/typescript-eslint/typescript-eslint/commit/cf86f427186d58b0fce4bb3ff9571c4301babeb3)) +- **eslint-plugin:** [prom-func-async] report only function head ([#2872](https://github.com/typescript-eslint/typescript-eslint/issues/2872)) ([25f459c](https://github.com/typescript-eslint/typescript-eslint/commit/25f459cdc4f38d44b48554e04cfa1676538ccdfb)) +- **typescript-estree:** throw custom error instead of plain object ([#3011](https://github.com/typescript-eslint/typescript-eslint/issues/3011)) ([ae14bf5](https://github.com/typescript-eslint/typescript-eslint/commit/ae14bf55fe31b0eb982ba17333e4aac550d10342)) +## [4.15.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.15.1...v4.15.2) (2021-02-22) ### Bug Fixes -* **eslint-plugin:** [no-unused-expressions] handle ternary and short-circuit options ([#2194](https://github.com/typescript-eslint/typescript-eslint/issues/2194)) ([ee9f100](https://github.com/typescript-eslint/typescript-eslint/commit/ee9f100a2f9a874c2b361482742686eeaa9bdac7)) -* **typescript-estree:** handle TS4.0 breaking change in TupleType ([#2197](https://github.com/typescript-eslint/typescript-eslint/issues/2197)) ([5d68129](https://github.com/typescript-eslint/typescript-eslint/commit/5d6812914831a386997b453b4db1e3283e26005d)) - - -### Features - -* **eslint-plugin:** [naming-convention] better error message and docs for prefix/suffix ([#2195](https://github.com/typescript-eslint/typescript-eslint/issues/2195)) ([a2ffe55](https://github.com/typescript-eslint/typescript-eslint/commit/a2ffe5568df0f7224bfe9141d298e538383d5f09)) - - - - - -# [3.2.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.1.0...v3.2.0) (2020-06-08) +- **typescript-estree:** correct issues in AST definition ([#3083](https://github.com/typescript-eslint/typescript-eslint/issues/3083)) ([509a117](https://github.com/typescript-eslint/typescript-eslint/commit/509a11749f85400a01e9fecfecd12871ce562d3d)) +- add missing intrinsic keyword node to AST ([#3081](https://github.com/typescript-eslint/typescript-eslint/issues/3081)) ([409bf0b](https://github.com/typescript-eslint/typescript-eslint/commit/409bf0bb3e2ac4d8782408d436ebdefb42dba38b)) +- **eslint-plugin:** [no-var-requires] report when used in type assertion ([#3074](https://github.com/typescript-eslint/typescript-eslint/issues/3074)) ([763a252](https://github.com/typescript-eslint/typescript-eslint/commit/763a2520bfea09c3b6252ea36bc3ff10b05eca6c)) +- correct test names on windows for semantic-diagnostics-enabled ([#3060](https://github.com/typescript-eslint/typescript-eslint/issues/3060)) ([885780d](https://github.com/typescript-eslint/typescript-eslint/commit/885780d4a2b07e418256b7323d76b18453c14a50)) +## [4.15.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.15.0...v4.15.1) (2021-02-15) ### Bug Fixes -* **eslint-plugin:** [explicit-module-boundary-types] dont report return type errors on constructor overloads ([#2158](https://github.com/typescript-eslint/typescript-eslint/issues/2158)) ([53232d7](https://github.com/typescript-eslint/typescript-eslint/commit/53232d775ca0b808e2d75d9501f4411a868b2b48)) -* **eslint-plugin:** [explicit-module-boundary-types] handle bodyless arrow functions with explicit return types that return functions ([#2169](https://github.com/typescript-eslint/typescript-eslint/issues/2169)) ([58db655](https://github.com/typescript-eslint/typescript-eslint/commit/58db655133aaae006efe3e3ceee971cf88dc348f)) -* **eslint-plugin:** [explicit-module-boundary-types] handle nested functions and functions expressions in a typed variable declaration ([#2176](https://github.com/typescript-eslint/typescript-eslint/issues/2176)) ([6ff450d](https://github.com/typescript-eslint/typescript-eslint/commit/6ff450da3abec93223a33f6b52484c9ca99b7abe)) -* **eslint-plugin:** [no-extra-non-null-assertion] dont report for assertions not followed by the optional chain ([#2167](https://github.com/typescript-eslint/typescript-eslint/issues/2167)) ([e4c1834](https://github.com/typescript-eslint/typescript-eslint/commit/e4c1834c7c5934332dd1d58c09018453568c4889)) -* **eslint-plugin:** [no-unnecessary-conditionals] Handle comparison of generics and loose comparisons with undefined values ([#2152](https://github.com/typescript-eslint/typescript-eslint/issues/2152)) ([c86e2a2](https://github.com/typescript-eslint/typescript-eslint/commit/c86e2a235372149db9b1700d39c2145e0ce5221a)) -* **eslint-plugin:** [prefer-optional-chain] handling first member expression ([#2156](https://github.com/typescript-eslint/typescript-eslint/issues/2156)) ([de18660](https://github.com/typescript-eslint/typescript-eslint/commit/de18660a8cf8f7033798646d8c5b0938d1accb12)) -* **eslint-plugin:** [return-await] correct handling of ternaries ([#2168](https://github.com/typescript-eslint/typescript-eslint/issues/2168)) ([fe4c0bf](https://github.com/typescript-eslint/typescript-eslint/commit/fe4c0bf8c04f070d6642fbe86c5e5614bc88e8fd)) - - -### Features - -* **eslint-plugin:** [naming-convention] put identifiers in quotes in error messages ([#2182](https://github.com/typescript-eslint/typescript-eslint/issues/2182)) ([fc61932](https://github.com/typescript-eslint/typescript-eslint/commit/fc619326eedf7ef2efa51444ecdead81a36a204f)), closes [#2178](https://github.com/typescript-eslint/typescript-eslint/issues/2178) -* **eslint-plugin:** [require-array-sort-compare] add `ignoreStringArrays` option ([#1972](https://github.com/typescript-eslint/typescript-eslint/issues/1972)) ([6dee784](https://github.com/typescript-eslint/typescript-eslint/commit/6dee7840a3af1dfe4c38a128d1c4655bdac625df)) -* **eslint-plugin:** add rule `ban-tslint-comment` ([#2140](https://github.com/typescript-eslint/typescript-eslint/issues/2140)) ([43ee226](https://github.com/typescript-eslint/typescript-eslint/commit/43ee226ffbaaa3e7126081db9476c24b89ec16e9)) -* **eslint-plugin:** add rule `no-confusing-non-null-assertion` ([#1941](https://github.com/typescript-eslint/typescript-eslint/issues/1941)) ([9b51c44](https://github.com/typescript-eslint/typescript-eslint/commit/9b51c44f29d8b3e95a510985544e8ded8a14404d)) - - - - - -# [3.1.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.0.2...v3.1.0) (2020-06-01) +- **eslint-plugin:** [explicit-module-boundary-types] check allowNames on function declarations and property methods ([#3051](https://github.com/typescript-eslint/typescript-eslint/issues/3051)) ([0ade469](https://github.com/typescript-eslint/typescript-eslint/commit/0ade469dc1cf17d79c36a9c985630d60491ed847)) +# [4.15.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.14.2...v4.15.0) (2021-02-08) ### Bug Fixes -* **eslint-plugin:** [explicit-module-boundary-types] don't check returned functions if parent function has return type ([#2084](https://github.com/typescript-eslint/typescript-eslint/issues/2084)) ([d7d4eeb](https://github.com/typescript-eslint/typescript-eslint/commit/d7d4eeb03f2918d5d9e361fdb47c2d42e83bd593)) -* **eslint-plugin:** [no-unnecessary-condition] handle comparison of any, unknown and loose comparisons with nullish values ([#2123](https://github.com/typescript-eslint/typescript-eslint/issues/2123)) ([1ae1d01](https://github.com/typescript-eslint/typescript-eslint/commit/1ae1d01e5603ec7cef8051ed018c3c3c88b29867)) -* **eslint-plugin:** [no-unnecessary-condition] improve optional chain handling ([#2111](https://github.com/typescript-eslint/typescript-eslint/issues/2111)) ([9ee399b](https://github.com/typescript-eslint/typescript-eslint/commit/9ee399b5906e82f346ff89141207a6630786de54)) -* **eslint-plugin:** [no-unnecessary-condition] improve optional chain handling 2 - electric boogaloo ([#2138](https://github.com/typescript-eslint/typescript-eslint/issues/2138)) ([c87cfaf](https://github.com/typescript-eslint/typescript-eslint/commit/c87cfaf6746775bb8ad9eb45b0002f068a822dbe)) -* **eslint-plugin:** [no-unused-expressions] ignore import expressions ([#2130](https://github.com/typescript-eslint/typescript-eslint/issues/2130)) ([e383691](https://github.com/typescript-eslint/typescript-eslint/commit/e3836910efdafd9edf04daed149c9e839c08047e)) -* **eslint-plugin:** [no-var-requires] false negative for TSAsExpression and MemberExpression ([#2139](https://github.com/typescript-eslint/typescript-eslint/issues/2139)) ([df95338](https://github.com/typescript-eslint/typescript-eslint/commit/df953388913b22d45242e65ce231d92a8b8a0080)) -* **experimental-utils:** downlevel type declarations for versions older than 3.8 ([#2133](https://github.com/typescript-eslint/typescript-eslint/issues/2133)) ([7925823](https://github.com/typescript-eslint/typescript-eslint/commit/792582326a8065270b69a0ffcaad5a7b4b103ff3)) - +- **eslint-plugin:** [no-extra-parens] handle ESLint 7.19.0 ([#2993](https://github.com/typescript-eslint/typescript-eslint/issues/2993)) ([4615048](https://github.com/typescript-eslint/typescript-eslint/commit/4615048d24359e0fc57b90a96acf4d8ded1dc7bf)) +- **eslint-plugin:** [prefer-function-type] correct fixer when signature ends with a semi ([#3002](https://github.com/typescript-eslint/typescript-eslint/issues/3002)) ([898dd39](https://github.com/typescript-eslint/typescript-eslint/commit/898dd3961944a5da3a129e9eba02634286e7aee4)) +- **scope-manager:** fix visiting of TSImportType ([#3008](https://github.com/typescript-eslint/typescript-eslint/issues/3008)) ([ce4fcbf](https://github.com/typescript-eslint/typescript-eslint/commit/ce4fcbf4401098387a2cf19ae8457c89c509239a)), closes [#3006](https://github.com/typescript-eslint/typescript-eslint/issues/3006) ### Features -* **eslint-plugin:** [ban-ts-comments] add "allow-with-description" option ([#2099](https://github.com/typescript-eslint/typescript-eslint/issues/2099)) ([8a0fd18](https://github.com/typescript-eslint/typescript-eslint/commit/8a0fd1899f544470a35afb3117f4c71aad7e4e42)) -* **eslint-plugin:** [ban-types] allow selective disable of default options with `false` value ([#2137](https://github.com/typescript-eslint/typescript-eslint/issues/2137)) ([1cb8ca4](https://github.com/typescript-eslint/typescript-eslint/commit/1cb8ca483d029935310e6904580df8501837084d)) -* **eslint-plugin:** [explicit-module-boundary-types] improve accuracy and coverage ([#2135](https://github.com/typescript-eslint/typescript-eslint/issues/2135)) ([caaa859](https://github.com/typescript-eslint/typescript-eslint/commit/caaa8599284d02ab3341e282cad35a52d0fb86c7)) - - - - - -## [3.0.2](https://github.com/typescript-eslint/typescript-eslint/compare/v3.0.1...v3.0.2) (2020-05-27) - - -### Bug Fixes - -* regression for eslint v6 ([#2105](https://github.com/typescript-eslint/typescript-eslint/issues/2105)) ([31fc503](https://github.com/typescript-eslint/typescript-eslint/commit/31fc5039ed919e1515fda673c186d5c83eb5beb3)) - - - - - -## [3.0.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.0.0...v3.0.1) (2020-05-25) +- **typescript-estree:** improve logic used to escape string literals in jsx ([#2995](https://github.com/typescript-eslint/typescript-eslint/issues/2995)) ([3cb3aad](https://github.com/typescript-eslint/typescript-eslint/commit/3cb3aade2864bab15ed1ff8d7cd32766aa57152f)) +## [4.14.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.14.1...v4.14.2) (2021-02-01) ### Bug Fixes -* **eslint-plugin:** [naming-convention] handle no options correctly ([#2095](https://github.com/typescript-eslint/typescript-eslint/issues/2095)) ([fd7d02b](https://github.com/typescript-eslint/typescript-eslint/commit/fd7d02b31ebd995b7fdd857d7c054042aa4f2001)) -* **eslint-plugin:** [no-throw-literal] handle intersection and union types ([#2085](https://github.com/typescript-eslint/typescript-eslint/issues/2085)) ([cae037f](https://github.com/typescript-eslint/typescript-eslint/commit/cae037ff9b20363b970cc600a09505b98bf10a14)) -* **eslint-plugin:** [unbound-method] fix crash due to missing `Intl` ([#2090](https://github.com/typescript-eslint/typescript-eslint/issues/2090)) ([f2fa82c](https://github.com/typescript-eslint/typescript-eslint/commit/f2fa82c532ae858ccfb064268cfcc9df657a54be)) -* **experimental-utils:** export `CLIEngine` & `ESLint` ([#2083](https://github.com/typescript-eslint/typescript-eslint/issues/2083)) ([014341b](https://github.com/typescript-eslint/typescript-eslint/commit/014341bb23261f609fc2a6fe7fece191466a084a)) -* **typescript-estree:** handle `BigInt` with `_` numeric separator ([#2067](https://github.com/typescript-eslint/typescript-eslint/issues/2067)) ([66f1627](https://github.com/typescript-eslint/typescript-eslint/commit/66f1627b11a566d5b925a577e800f99d5c808be2)) -* **typescript-estree:** mark TS 3.8 and 3.9 as "supported" ([#2057](https://github.com/typescript-eslint/typescript-eslint/issues/2057)) ([5eedbff](https://github.com/typescript-eslint/typescript-eslint/commit/5eedbff01178ea33b98ab22e556df4c1a195f839)), closes [#1436](https://github.com/typescript-eslint/typescript-eslint/issues/1436) [#1436](https://github.com/typescript-eslint/typescript-eslint/issues/1436) - - - - +- **eslint-plugin:** [consistent-type-imports] incorrect handling of computed property type signatures ([#2990](https://github.com/typescript-eslint/typescript-eslint/issues/2990)) ([58f2655](https://github.com/typescript-eslint/typescript-eslint/commit/58f26555f62b5f59f13260306638d3148cde6079)), closes [#2989](https://github.com/typescript-eslint/typescript-eslint/issues/2989) +- **scope-manager:** correctly reference generic parameters when decorator metadata is enabled ([#2975](https://github.com/typescript-eslint/typescript-eslint/issues/2975)) ([7695ef3](https://github.com/typescript-eslint/typescript-eslint/commit/7695ef318f1cc8688acaabf4f2730769622f083f)), closes [#2972](https://github.com/typescript-eslint/typescript-eslint/issues/2972) -# [3.0.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.34.0...v3.0.0) (2020-05-21) - -## [Please see the release notes for v3.0.0](https://github.com/typescript-eslint/typescript-eslint/releases/tag/v3.0.0) +## [4.14.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.14.0...v4.14.1) (2021-01-25) ### Bug Fixes -* **eslint-plugin:** [dot-notation] fix typo in schema ([#2040](https://github.com/typescript-eslint/typescript-eslint/issues/2040)) ([242328f](https://github.com/typescript-eslint/typescript-eslint/commit/242328fa749ee4c72af93433a9bef95f329ac62f)) -* **eslint-plugin:** correct parser peerDep version ([fe59f69](https://github.com/typescript-eslint/typescript-eslint/commit/fe59f69381a0915a4f5135e2e88637a5eea246ba)) -* **experimental-utils:** add back SourceCode.isSpaceBetweenTokens ([ae82ea4](https://github.com/typescript-eslint/typescript-eslint/commit/ae82ea4a85a4ca332ebe6104e96c59dba30411be)) -* **typescript-estree:** remove now defunct `Import` node type ([f199cbd](https://github.com/typescript-eslint/typescript-eslint/commit/f199cbdbbd892b5ba03bfff66f463f3d9c92ee9b)) -* **typescript-estree:** use `TSEmptyBodyFunctionExpression` for body-less nodes ([#1289](https://github.com/typescript-eslint/typescript-eslint/issues/1289)) ([82e7163](https://github.com/typescript-eslint/typescript-eslint/commit/82e7163214b56ccde93ba97807b161669a50a60b)) +- **eslint-plugin:** [sort-type-union-intersection-members] consider `void` as a `nullish` ([#2944](https://github.com/typescript-eslint/typescript-eslint/issues/2944)) ([a241b25](https://github.com/typescript-eslint/typescript-eslint/commit/a241b25863eb063986fab76b511f478bbba91f47)), closes [#2940](https://github.com/typescript-eslint/typescript-eslint/issues/2940) +- **scope-manager:** fix incorrect handling of class decorators and class method default params ([#2943](https://github.com/typescript-eslint/typescript-eslint/issues/2943)) ([e1eac83](https://github.com/typescript-eslint/typescript-eslint/commit/e1eac8312268d1855a2ed7784b4d190ecb9c9fa4)), closes [#2941](https://github.com/typescript-eslint/typescript-eslint/issues/2941) [#2942](https://github.com/typescript-eslint/typescript-eslint/issues/2942) [#2751](https://github.com/typescript-eslint/typescript-eslint/issues/2751) +# [4.14.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.13.0...v4.14.0) (2021-01-18) ### Features -* add index files to parser and typescript-estree ([3dfc46d](https://github.com/typescript-eslint/typescript-eslint/commit/3dfc46dccbbd28eed2d74c7b6cacddf1a0848598)) -* **eslint-plugin:** [no-floating-promises] ignore void operator by default ([#2003](https://github.com/typescript-eslint/typescript-eslint/issues/2003)) ([3626a67](https://github.com/typescript-eslint/typescript-eslint/commit/3626a673cf8117cc995245cd86e466e2553e9b0e)) -* **eslint-plugin:** [no-unnecessary-condition] remove `checkArrayPredicates` and always check it ([#1579](https://github.com/typescript-eslint/typescript-eslint/issues/1579)) ([bfd9b60](https://github.com/typescript-eslint/typescript-eslint/commit/bfd9b606d17d30d5694967a1f01e0e1501ba1022)) -* **eslint-plugin:** [no-unnecessary-condition] report when non-nullish is compared to `null`/`undefined` ([#1659](https://github.com/typescript-eslint/typescript-eslint/issues/1659)) ([7fa9060](https://github.com/typescript-eslint/typescript-eslint/commit/7fa906073903c5eb70609c25f1a91ada14dcdc71)) -* **eslint-plugin:** [prefer-nullish-coalescing][prefer-optional-chain] remove unsafe fixers ([52b6085](https://github.com/typescript-eslint/typescript-eslint/commit/52b60852d0ba6bb6abe519c9d3ec1b231793e91d)) -* **eslint-plugin:** [restrict-template-expressions] `allowNumber: true` by default ([#2005](https://github.com/typescript-eslint/typescript-eslint/issues/2005)) ([643ec24](https://github.com/typescript-eslint/typescript-eslint/commit/643ec240bd901295d9e9ea5c43fc20109c33e982)) -* **eslint-plugin:** [restrict-template-expressions] rename `allowNullable` to `allowNullish` ([#2006](https://github.com/typescript-eslint/typescript-eslint/issues/2006)) ([264b017](https://github.com/typescript-eslint/typescript-eslint/commit/264b017c11c2ab132fcbad18b42a9a0fe639386e)) -* **experimental-utils:** upgrade eslint types for v7 ([#2023](https://github.com/typescript-eslint/typescript-eslint/issues/2023)) ([06869c9](https://github.com/typescript-eslint/typescript-eslint/commit/06869c9656fa37936126666845aee40aad546ebd)) -* bump minimum required TS version ([#2004](https://github.com/typescript-eslint/typescript-eslint/issues/2004)) ([7ad4d7c](https://github.com/typescript-eslint/typescript-eslint/commit/7ad4d7c2db088b6f779b9d883a4acad13eee3775)) -* upgrade to ESLint v7 ([#2022](https://github.com/typescript-eslint/typescript-eslint/issues/2022)) ([208de71](https://github.com/typescript-eslint/typescript-eslint/commit/208de71059746bf38e94bd460346ffb2698a3e12)) -* **eslint-plugin:** [ban-types] rework default options ([#848](https://github.com/typescript-eslint/typescript-eslint/issues/848)) ([8e31d5d](https://github.com/typescript-eslint/typescript-eslint/commit/8e31d5dbe9fe5227fdbefcecfd50ce5dd51360c3)) -* **eslint-plugin:** [no-unnecessary-condition] remove option `ignoreRHS` ([#1163](https://github.com/typescript-eslint/typescript-eslint/issues/1163)) ([ee8dd8f](https://github.com/typescript-eslint/typescript-eslint/commit/ee8dd8f8a9e6c25ac426ce9bb71c5f012c51f264)) -* **eslint-plugin:** [strict-boolean-expression] rework options ([#1631](https://github.com/typescript-eslint/typescript-eslint/issues/1631)) ([cd14482](https://github.com/typescript-eslint/typescript-eslint/commit/cd1448240dca11762fcb9c10e18bb6541a840485)) -* **eslint-plugin:** delete deprecated rules ([#2002](https://github.com/typescript-eslint/typescript-eslint/issues/2002)) ([da0aec2](https://github.com/typescript-eslint/typescript-eslint/commit/da0aec2cfa27902aae7c438a2fe91343c822e4ae)) -* **eslint-plugin:** eslint-recommended: disable no-func-assign ([#984](https://github.com/typescript-eslint/typescript-eslint/issues/984)) ([ae9b8a9](https://github.com/typescript-eslint/typescript-eslint/commit/ae9b8a9c73c0328287de956466257d8bbfbdb20f)) -* **eslint-plugin:** eslint-recommended: disable no-obj-calls ([#1000](https://github.com/typescript-eslint/typescript-eslint/issues/1000)) ([b9ca14c](https://github.com/typescript-eslint/typescript-eslint/commit/b9ca14c5f5ec28a3fde1a9b2d2f6a4dc74d903e4)) -* **eslint-plugin:** update `eslint-recommended` set ([#1996](https://github.com/typescript-eslint/typescript-eslint/issues/1996)) ([9a96e18](https://github.com/typescript-eslint/typescript-eslint/commit/9a96e18400e0a0d738d159d9d01faf41d3586249)) -* **eslint-plugin:** update recommended sets ([#2001](https://github.com/typescript-eslint/typescript-eslint/issues/2001)) ([0126b4f](https://github.com/typescript-eslint/typescript-eslint/commit/0126b4f56f9197d561e90b09962ccceb4f88bc41)) -* **typescript-estree:** align nodes with estree 2020 ([#1389](https://github.com/typescript-eslint/typescript-eslint/issues/1389)) ([aff5b62](https://github.com/typescript-eslint/typescript-eslint/commit/aff5b62044f9b93f2087a1d261e9be3f8d6fd54d)) -* **typescript-estree:** align optional fields ([#1429](https://github.com/typescript-eslint/typescript-eslint/issues/1429)) ([0e0010f](https://github.com/typescript-eslint/typescript-eslint/commit/0e0010f82952f9beeeb84136eea00cc5eecc9db6)) -* drop support for node v8 ([#1997](https://github.com/typescript-eslint/typescript-eslint/issues/1997)) ([b6c3b7b](https://github.com/typescript-eslint/typescript-eslint/commit/b6c3b7b84b8d199fa75a46432febd4a364a63217)) -* **typescript-estree:** always return parserServices ([#716](https://github.com/typescript-eslint/typescript-eslint/issues/716)) ([5b23443](https://github.com/typescript-eslint/typescript-eslint/commit/5b23443c48f3f62424db3e742243f3568080b946)) -* **typescript-estree:** handle 3.9's non-null assertion changes ([#2036](https://github.com/typescript-eslint/typescript-eslint/issues/2036)) ([06bec63](https://github.com/typescript-eslint/typescript-eslint/commit/06bec63c56536db070608ab136d2ad57083f0c6a)) - - - - - -# [2.34.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.33.0...v2.34.0) (2020-05-18) +- add support for decorator metadata in scope analysis and in consistent-type-imports ([#2751](https://github.com/typescript-eslint/typescript-eslint/issues/2751)) ([445e416](https://github.com/typescript-eslint/typescript-eslint/commit/445e416878b27a54bf07c2d3b84dabd7b06e51bc)), closes [#2559](https://github.com/typescript-eslint/typescript-eslint/issues/2559) +- **eslint-plugin:** add `object-curly-spacing` rule ([#2892](https://github.com/typescript-eslint/typescript-eslint/issues/2892)) ([32bd18d](https://github.com/typescript-eslint/typescript-eslint/commit/32bd18de80f4f8388717d0f0c16d493234362aa5)) +# [4.13.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.12.0...v4.13.0) (2021-01-11) ### Bug Fixes -* **typescript-estree:** fix handling of range/loc removal ([#2028](https://github.com/typescript-eslint/typescript-eslint/issues/2028)) ([ce344d9](https://github.com/typescript-eslint/typescript-eslint/commit/ce344d90e7c78b0c4b4b823494a3e78190f45c64)) - +- **eslint-plugin:** support eslint@5 ([#2917](https://github.com/typescript-eslint/typescript-eslint/issues/2917)) ([f606846](https://github.com/typescript-eslint/typescript-eslint/commit/f606846af2617a0d8ee3ad5ce7c10864161ebf53)) ### Features -* **eslint-plugin:** [no-invalid-void-type] allow union of void and `allowInGenericTypeArguments` ([#1960](https://github.com/typescript-eslint/typescript-eslint/issues/1960)) ([1bc105a](https://github.com/typescript-eslint/typescript-eslint/commit/1bc105a2c6ae3fde9596f0419fed0de699dc57c7)) -* **eslint-plugin:** [restrict-template-expressions] improve error message ([#1926](https://github.com/typescript-eslint/typescript-eslint/issues/1926)) ([1af59ba](https://github.com/typescript-eslint/typescript-eslint/commit/1af59ba8ac0ceabb008d9c61556acf7db0a1d352)) -* **experimental-utils:** add `suggestion` property for rule modules ([#2033](https://github.com/typescript-eslint/typescript-eslint/issues/2033)) ([f42a5b0](https://github.com/typescript-eslint/typescript-eslint/commit/f42a5b09ebfa173f418a99c552b0cbe221567194)) - - - - - -# [2.33.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.32.0...v2.33.0) (2020-05-12) +- **eslint-plugin:** [sort-type-union-intersection-members] add nullish group ([#2919](https://github.com/typescript-eslint/typescript-eslint/issues/2919)) ([5558f41](https://github.com/typescript-eslint/typescript-eslint/commit/5558f410007da58a3f4726bbf9501c924ef166a1)) +# [4.12.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.11.1...v4.12.0) (2021-01-04) ### Bug Fixes -* **experimental-utils:** remove accidental dep on json-schema ([#2010](https://github.com/typescript-eslint/typescript-eslint/issues/2010)) ([1875fba](https://github.com/typescript-eslint/typescript-eslint/commit/1875fbad41f2a3dda8f610f5dcd180c6205b73d3)) - +- **eslint-plugin:** [comma-spacing] handle empty type params ([#2915](https://github.com/typescript-eslint/typescript-eslint/issues/2915)) ([4d69fbb](https://github.com/typescript-eslint/typescript-eslint/commit/4d69fbba91ea3161213a0ab093e398fed091168c)) ### Features -* **eslint-plugin:** add extension rule `lines-between-class-members` ([#1684](https://github.com/typescript-eslint/typescript-eslint/issues/1684)) ([08f93e6](https://github.com/typescript-eslint/typescript-eslint/commit/08f93e69347a8e7f3a7e8a1455bb5d069c2faeef)) - - +- **eslint-plugin:** add rule `sort-type-union-intersection-members` ([#2913](https://github.com/typescript-eslint/typescript-eslint/issues/2913)) ([9092c04](https://github.com/typescript-eslint/typescript-eslint/commit/9092c0494ebd3486e38852198c1930f1432ef21f)) +## [4.11.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.11.0...v4.11.1) (2020-12-28) +### Bug Fixes -# [2.32.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.31.0...v2.32.0) (2020-05-11) +- **eslint-plugin:** [naming-convention] fix precedence of method and property meta selectors ([#2877](https://github.com/typescript-eslint/typescript-eslint/issues/2877)) ([2f10e1a](https://github.com/typescript-eslint/typescript-eslint/commit/2f10e1a5c795cac28a6e0a1a3a0adb5bd6be7f1c)) +# [4.11.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.10.0...v4.11.0) (2020-12-21) ### Bug Fixes -* **eslint-plugin:** [no-base-to-string] support boolean in unions ([#1979](https://github.com/typescript-eslint/typescript-eslint/issues/1979)) ([6987ecc](https://github.com/typescript-eslint/typescript-eslint/commit/6987ecc1dacfb45c0f8ed3e81d08aa708eb96ad1)) -* **eslint-plugin:** [no-type-alias] handle readonly types in aliases ([#1990](https://github.com/typescript-eslint/typescript-eslint/issues/1990)) ([56d9870](https://github.com/typescript-eslint/typescript-eslint/commit/56d987070f83d1b6410b04750b20a761fd793073)) -* **eslint-plugin:** [no-unused-expressions] inherit `messages` from base rule ([#1992](https://github.com/typescript-eslint/typescript-eslint/issues/1992)) ([51ca404](https://github.com/typescript-eslint/typescript-eslint/commit/51ca404af645eed194269ab7f8f67b97bd52e32d)) - +- **eslint-plugin:** [non-nullable-type-assertion-style] handle const assertion ([#2881](https://github.com/typescript-eslint/typescript-eslint/issues/2881)) ([53dc34d](https://github.com/typescript-eslint/typescript-eslint/commit/53dc34d3917b90c8ab0324fe8054619ddee98003)) ### Features -* bump dependencies and align AST ([#2007](https://github.com/typescript-eslint/typescript-eslint/issues/2007)) ([18668b7](https://github.com/typescript-eslint/typescript-eslint/commit/18668b78fd7d1e5281af7fc26c76e0ca53297f69)) - - - - - -# [2.31.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.30.0...v2.31.0) (2020-05-04) +- **eslint-plugin:** [prom-func-async] add automatic fix ([#2845](https://github.com/typescript-eslint/typescript-eslint/issues/2845)) ([717e718](https://github.com/typescript-eslint/typescript-eslint/commit/717e718e91df2165422228c02dfa248cf55f65a1)) +# [4.10.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.9.1...v4.10.0) (2020-12-14) ### Bug Fixes -* **eslint-plugin:** [dot-notation] handle missing declarations ([#1947](https://github.com/typescript-eslint/typescript-eslint/issues/1947)) ([383f931](https://github.com/typescript-eslint/typescript-eslint/commit/383f93182599c00e231a0f0d36575ca0e19369a6)) -* **eslint-plugin:** [method-signature-style] fix overloaded methods to an intersection type ([#1966](https://github.com/typescript-eslint/typescript-eslint/issues/1966)) ([7f3fba3](https://github.com/typescript-eslint/typescript-eslint/commit/7f3fba348d432d7637e1c737df943ee1f9105062)) -* **eslint-plugin:** [return-await] await in a normal function ([#1962](https://github.com/typescript-eslint/typescript-eslint/issues/1962)) ([f82fd7b](https://github.com/typescript-eslint/typescript-eslint/commit/f82fd7bb81f986c4861d0b4e2ecdb0c496d7a602)) -* **eslint-plugin:** [unbound-method] false positives for unary expressions ([#1964](https://github.com/typescript-eslint/typescript-eslint/issues/1964)) ([b35070e](https://github.com/typescript-eslint/typescript-eslint/commit/b35070ec6f84ad5ce606386cdb6eeb91488dfdd7)) -* **eslint-plugin:** no-base-to-string boolean expression detect ([#1969](https://github.com/typescript-eslint/typescript-eslint/issues/1969)) ([f78f13a](https://github.com/typescript-eslint/typescript-eslint/commit/f78f13aedd59d5b5880903d48c779a6c50fd937e)) - +- **eslint-plugin:** [naming-convention] fix wrong member of `method` and `property` meta selectors ([#2856](https://github.com/typescript-eslint/typescript-eslint/issues/2856)) ([9a6c362](https://github.com/typescript-eslint/typescript-eslint/commit/9a6c3628a2f3a7748b7a4b9b0c55400c8d7dfeae)) ### Features -* **eslint-plugin:** [member-ordering] add decorators support ([#1870](https://github.com/typescript-eslint/typescript-eslint/issues/1870)) ([f7ec192](https://github.com/typescript-eslint/typescript-eslint/commit/f7ec1920607cb8eec8020b08cd7247de0bf19ce1)) -* **eslint-plugin:** [prefer-optional-chain] added option to convert to suggestion fixer ([#1965](https://github.com/typescript-eslint/typescript-eslint/issues/1965)) ([2f0824b](https://github.com/typescript-eslint/typescript-eslint/commit/2f0824b0a41f3043b6242fc1d49faae540abaf22)) -* **eslint-plugin:** new extended rule 'no-invalid-this' ([#1823](https://github.com/typescript-eslint/typescript-eslint/issues/1823)) ([b18bc35](https://github.com/typescript-eslint/typescript-eslint/commit/b18bc357507337b9725f8d9c1b549513075a0da5)) -* **eslint-plugin-internal:** add rule no-poorly-typed-ts-props ([#1949](https://github.com/typescript-eslint/typescript-eslint/issues/1949)) ([56ea7c9](https://github.com/typescript-eslint/typescript-eslint/commit/56ea7c9581c0c99fe394bbcfc4128e8054c88ab2)) -* **experimental-utils:** expose our RuleTester extension ([#1948](https://github.com/typescript-eslint/typescript-eslint/issues/1948)) ([2dd1638](https://github.com/typescript-eslint/typescript-eslint/commit/2dd1638aaa2658ba99b2341861146b586f489121)) - - +- **eslint-plugin:** add rule `non-nullable-type-assertion-style` ([#2624](https://github.com/typescript-eslint/typescript-eslint/issues/2624)) ([7eee44f](https://github.com/typescript-eslint/typescript-eslint/commit/7eee44fff3041a9725d34bf2fcbfc6fd40a60c61)) +## [4.9.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.9.0...v4.9.1) (2020-12-07) +### Bug Fixes -# [2.30.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.29.0...v2.30.0) (2020-04-27) +- **eslint-plugin:** [method-signature-style] fix crash with methods without a return type ([#2836](https://github.com/typescript-eslint/typescript-eslint/issues/2836)) ([fed89f2](https://github.com/typescript-eslint/typescript-eslint/commit/fed89f24ebe42a6412f0eb19949d5d4771656189)), closes [#2834](https://github.com/typescript-eslint/typescript-eslint/issues/2834) +- **eslint-plugin:** [no-unused-vars] false-positive with class expressions ([#2833](https://github.com/typescript-eslint/typescript-eslint/issues/2833)) ([aadb39f](https://github.com/typescript-eslint/typescript-eslint/commit/aadb39f0ff500ee99ea80e9009ab61283ca9c8cd)), closes [#2831](https://github.com/typescript-eslint/typescript-eslint/issues/2831) +- **eslint-plugin:** [no-unused-vars] fix race condition between naming-convention and no-unused-vars ([#2848](https://github.com/typescript-eslint/typescript-eslint/issues/2848)) ([ccb6b94](https://github.com/typescript-eslint/typescript-eslint/commit/ccb6b9499a4a4077f2e3d81d0844860a25244a0f)), closes [#2844](https://github.com/typescript-eslint/typescript-eslint/issues/2844) +# [4.9.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.8.2...v4.9.0) (2020-11-30) ### Bug Fixes -* **eslint-plugin:** [prefer-string-starts-ends-with] check for negative start index in slice ([#1920](https://github.com/typescript-eslint/typescript-eslint/issues/1920)) ([ed2bd60](https://github.com/typescript-eslint/typescript-eslint/commit/ed2bd6067f74ae33e36a084719bb91efedfba599)) -* **eslint-plugin:** fix no-base-to-string boolean literal check ([#1850](https://github.com/typescript-eslint/typescript-eslint/issues/1850)) ([2f45e99](https://github.com/typescript-eslint/typescript-eslint/commit/2f45e9992a8f12b6233716e77a6159f9cea2c879)) - +- **eslint-plugin:** [consistent-indexed-object-style] convert readonly index signature to readonly record ([#2798](https://github.com/typescript-eslint/typescript-eslint/issues/2798)) ([29428a4](https://github.com/typescript-eslint/typescript-eslint/commit/29428a4dbef133563f2ee54b22908a01ab9a9472)) +- **eslint-plugin:** [consistent-type-imports] crash when using both default and namespace in one import ([#2778](https://github.com/typescript-eslint/typescript-eslint/issues/2778)) ([c816b84](https://github.com/typescript-eslint/typescript-eslint/commit/c816b84814214f7504a0d89a5cd3b08c595bfb50)) +- **eslint-plugin:** [explicit-module-boundary-types] ignore functions exported within typed object/array literals ([#2805](https://github.com/typescript-eslint/typescript-eslint/issues/2805)) ([73a63ee](https://github.com/typescript-eslint/typescript-eslint/commit/73a63ee9ea00b2db0a29f148d7863c3778e4a483)) +- **eslint-plugin:** [no-use-before-define] allow class references if they're within a class decorator ([#2827](https://github.com/typescript-eslint/typescript-eslint/issues/2827)) ([050023a](https://github.com/typescript-eslint/typescript-eslint/commit/050023aa7bd791d0be7b5788a9dcd8e61a00ce79)), closes [#2842](https://github.com/typescript-eslint/typescript-eslint/issues/2842) +- **eslint-plugin:** [triple-slash-reference] fix crash with external module reference ([#2788](https://github.com/typescript-eslint/typescript-eslint/issues/2788)) ([32b1b68](https://github.com/typescript-eslint/typescript-eslint/commit/32b1b6839fb32d93b7faa8fec74c9cb68ea587bb)) +- **scope-manager:** fix assertion assignments not being marked as write references ([#2809](https://github.com/typescript-eslint/typescript-eslint/issues/2809)) ([fa68492](https://github.com/typescript-eslint/typescript-eslint/commit/fa6849245ca55ca407dc031afbad456f2925a8e9)), closes [#2804](https://github.com/typescript-eslint/typescript-eslint/issues/2804) +- **typescript-estree:** add default value for `parserOptions.projectFolderIgnoreList` and deduplicate resolved projects ([#2819](https://github.com/typescript-eslint/typescript-eslint/issues/2819)) ([bf904ec](https://github.com/typescript-eslint/typescript-eslint/commit/bf904ec72db57174fec531f61e9427230662553e)), closes [#2418](https://github.com/typescript-eslint/typescript-eslint/issues/2418) [#2814](https://github.com/typescript-eslint/typescript-eslint/issues/2814) ### Features -* **eslint-plugin:** add extension rule `dot-notation` ([#1867](https://github.com/typescript-eslint/typescript-eslint/issues/1867)) ([a85c3e1](https://github.com/typescript-eslint/typescript-eslint/commit/a85c3e1515d735b6c245cc658cdaec6deb05d630)) -* **eslint-plugin:** create `no-invalid-void-type` rule ([#1847](https://github.com/typescript-eslint/typescript-eslint/issues/1847)) ([f667ff1](https://github.com/typescript-eslint/typescript-eslint/commit/f667ff1708d4ed28b7ea5beea742889da69a76d9)) -* **experimental-utils:** allow rule options to be a readonly tuple ([#1924](https://github.com/typescript-eslint/typescript-eslint/issues/1924)) ([4ef6788](https://github.com/typescript-eslint/typescript-eslint/commit/4ef67884962b6aac61cc895aaa3ba16aa892ecf4)) +- **eslint-plugin:** [naming-convention] add `requireDouble`, `allowDouble`, `allowSingleOrDouble` options for underscores ([#2812](https://github.com/typescript-eslint/typescript-eslint/issues/2812)) ([dd0576a](https://github.com/typescript-eslint/typescript-eslint/commit/dd0576a66c34810bc60e0958948c9a8104a3f1a3)) +- **eslint-plugin:** [naming-convention] add `requiresQuotes` modifier ([#2813](https://github.com/typescript-eslint/typescript-eslint/issues/2813)) ([6fc8409](https://github.com/typescript-eslint/typescript-eslint/commit/6fc84094928c3645a0e04c31bd4d759fdfbdcb74)), closes [#2761](https://github.com/typescript-eslint/typescript-eslint/issues/2761) [#1483](https://github.com/typescript-eslint/typescript-eslint/issues/1483) +- **eslint-plugin:** [naming-convention] add modifier `unused` ([#2810](https://github.com/typescript-eslint/typescript-eslint/issues/2810)) ([6a06944](https://github.com/typescript-eslint/typescript-eslint/commit/6a06944e60677a402e7ab432e6ac1209737a7027)) +- **eslint-plugin:** [naming-convention] add modifiers `exported`, `global`, and `destructured` ([#2808](https://github.com/typescript-eslint/typescript-eslint/issues/2808)) ([fb254a1](https://github.com/typescript-eslint/typescript-eslint/commit/fb254a1036b89f9b78f927d607358e65e81a2250)), closes [#2239](https://github.com/typescript-eslint/typescript-eslint/issues/2239) [#2512](https://github.com/typescript-eslint/typescript-eslint/issues/2512) [#2318](https://github.com/typescript-eslint/typescript-eslint/issues/2318) [#2802](https://github.com/typescript-eslint/typescript-eslint/issues/2802) +- **eslint-plugin:** [naming-convention] allow `destructured` modifier for `parameter` selector ([#2829](https://github.com/typescript-eslint/typescript-eslint/issues/2829)) ([525d2ff](https://github.com/typescript-eslint/typescript-eslint/commit/525d2ff9292d89e1445b273b5378159bca323a1e)), closes [#2828](https://github.com/typescript-eslint/typescript-eslint/issues/2828) +- **eslint-plugin:** [naming-convention] split `property` and `method` selectors into more granular `classXXX`, `objectLiteralXXX`, `typeXXX` ([#2807](https://github.com/typescript-eslint/typescript-eslint/issues/2807)) ([665b6d4](https://github.com/typescript-eslint/typescript-eslint/commit/665b6d4023fb9d821f348c39aefff0d7571a98bf)), closes [#1477](https://github.com/typescript-eslint/typescript-eslint/issues/1477) [#2802](https://github.com/typescript-eslint/typescript-eslint/issues/2802) +- **eslint-plugin:** [no-unused-vars] fork the base rule ([#2768](https://github.com/typescript-eslint/typescript-eslint/issues/2768)) ([a8227a6](https://github.com/typescript-eslint/typescript-eslint/commit/a8227a6185dd24de4bfc7d766931643871155021)), closes [#2782](https://github.com/typescript-eslint/typescript-eslint/issues/2782) [#2714](https://github.com/typescript-eslint/typescript-eslint/issues/2714) [#2648](https://github.com/typescript-eslint/typescript-eslint/issues/2648) +- **eslint-plugin:** [unbound-method] add support for methods with a `this: void` parameter ([#2796](https://github.com/typescript-eslint/typescript-eslint/issues/2796)) ([878dd4a](https://github.com/typescript-eslint/typescript-eslint/commit/878dd4ae8c408f1eb42790a8fac37f85040b7f3c)) +## [4.8.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.8.1...v4.8.2) (2020-11-23) +### Bug Fixes +- **eslint-plugin:** [prefer-literal-enum-member] allow pure template literal strings ([#2786](https://github.com/typescript-eslint/typescript-eslint/issues/2786)) ([f3bf6a1](https://github.com/typescript-eslint/typescript-eslint/commit/f3bf6a1791c9dc64bb18d45712f07767c9f96cbd)) +- **typescript-estree:** fix type-only regression for consumers not yet on TS 4.1 ([#2789](https://github.com/typescript-eslint/typescript-eslint/issues/2789)) ([50a46c6](https://github.com/typescript-eslint/typescript-eslint/commit/50a46c60fb81d8434aa4268a13d17d8fcf499e21)) +## [4.8.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.8.0...v4.8.1) (2020-11-17) -# [2.29.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.28.0...v2.29.0) (2020-04-20) +### Bug Fixes +- **eslint-plugin:** [no-unnecessary-condition] false positive when array predicate returns unknown ([#2772](https://github.com/typescript-eslint/typescript-eslint/issues/2772)) ([111c244](https://github.com/typescript-eslint/typescript-eslint/commit/111c244c3eb157efeb5c43ff39f12633b27f091e)) +- **typescript-estree:** parseWithNodeMaps returning empty maps ([#2773](https://github.com/typescript-eslint/typescript-eslint/issues/2773)) ([3e4a0ed](https://github.com/typescript-eslint/typescript-eslint/commit/3e4a0ed0d615fd22a2f28c7c8af6179673e195f8)) -### Bug Fixes +# [4.8.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.7.0...v4.8.0) (2020-11-16) -* **eslint-plugin:** [no-base-to-string] soft remove `ignoreTaggedTemplateExpressions` option ([#1916](https://github.com/typescript-eslint/typescript-eslint/issues/1916)) ([369978e](https://github.com/typescript-eslint/typescript-eslint/commit/369978e9685bacb3e3882b0510ff06eaf8df4ca1)) +### Bug Fixes +- **eslint-plugin:** [consistent-type-definitions] remove fixer when the interface is within a global module declaration ([#2739](https://github.com/typescript-eslint/typescript-eslint/issues/2739)) ([2326238](https://github.com/typescript-eslint/typescript-eslint/commit/2326238738c95acfc14c17f9b16798f1de6d267f)) +- **eslint-plugin:** [no-unsafe-member-access] ignore MemberExpression's whose parents are either TSClassImplements or TSInterfaceHeritage ([#2753](https://github.com/typescript-eslint/typescript-eslint/issues/2753)) ([535db3b](https://github.com/typescript-eslint/typescript-eslint/commit/535db3bf27ee1d7824ada9acd91d1b7833064628)) ### Features -* **eslint-plugin:** [no-floating-promise] add option to ignore IIFEs ([#1799](https://github.com/typescript-eslint/typescript-eslint/issues/1799)) ([cea51bf](https://github.com/typescript-eslint/typescript-eslint/commit/cea51bf130d6d3c2935f5e2dcc468196f2ad9d00)) -* **eslint-plugin:** [restrict-template-expressions] add support for intersection types ([#1803](https://github.com/typescript-eslint/typescript-eslint/issues/1803)) ([cc70e4f](https://github.com/typescript-eslint/typescript-eslint/commit/cc70e4fbadd0b15fd6af913a2e1e2ddd346fa558)) -* **eslint-plugin:** add extension rule `init-declarations` ([#1814](https://github.com/typescript-eslint/typescript-eslint/issues/1814)) ([b01f5e7](https://github.com/typescript-eslint/typescript-eslint/commit/b01f5e778ac28e0797a3734fc58d025bb224f418)) -* **eslint-plugin:** add extension rule `keyword-spacing` ([#1739](https://github.com/typescript-eslint/typescript-eslint/issues/1739)) ([c5106dd](https://github.com/typescript-eslint/typescript-eslint/commit/c5106dd4bf2bc8846cc39aa8bb50c33bec026d4d)) +- **typescript-estree:** add `parseWithNodeMaps` API ([#2760](https://github.com/typescript-eslint/typescript-eslint/issues/2760)) ([9441d50](https://github.com/typescript-eslint/typescript-eslint/commit/9441d5030211f1c32f5ae8e61d5565cab8bb6823)), closes [#1852](https://github.com/typescript-eslint/typescript-eslint/issues/1852) +# [4.7.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.6.1...v4.7.0) (2020-11-09) +### Bug Fixes +- **eslint-plugin:** [array-type] parenthesize ReadonlyArray fix ([#2747](https://github.com/typescript-eslint/typescript-eslint/issues/2747)) ([83385ac](https://github.com/typescript-eslint/typescript-eslint/commit/83385ac351f45d3bcbd19f72711838e9a8473827)) +- **eslint-plugin:** [no-extra-non-null-assertion] false positive with non-nullable computed key ([#2737](https://github.com/typescript-eslint/typescript-eslint/issues/2737)) ([e82698c](https://github.com/typescript-eslint/typescript-eslint/commit/e82698c0ec796e460e40c3dd90a30bd100db05c2)) +### Features -# [2.28.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.27.0...v2.28.0) (2020-04-13) +- **eslint-plugin:** add rule `no-confusing-void-expression` ([#2605](https://github.com/typescript-eslint/typescript-eslint/issues/2605)) ([c8a4dad](https://github.com/typescript-eslint/typescript-eslint/commit/c8a4dadeab8a64fb4768deda8f65475435dd2cad)) +- support TS4.1 features ([#2748](https://github.com/typescript-eslint/typescript-eslint/issues/2748)) ([2be354b](https://github.com/typescript-eslint/typescript-eslint/commit/2be354bb15f9013a2da1b13a0c0836e9ef057e16)), closes [#2583](https://github.com/typescript-eslint/typescript-eslint/issues/2583) +## [4.6.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.6.0...v4.6.1) (2020-11-02) ### Bug Fixes -* **eslint-plugin:** [method-signature-style] handle multiline params ([#1861](https://github.com/typescript-eslint/typescript-eslint/issues/1861)) ([5832a86](https://github.com/typescript-eslint/typescript-eslint/commit/5832a8643bbe174ec02df5966bb333e506e45f5d)) -* **eslint-plugin:** [no-empty-interface] use suggestion fixer for ambient contexts ([#1880](https://github.com/typescript-eslint/typescript-eslint/issues/1880)) ([62b2278](https://github.com/typescript-eslint/typescript-eslint/commit/62b2278aec0011c93eae17bed8b278114d3379a2)) -* **eslint-plugin:** [unbound-method] false positive on property function initializer ([#1890](https://github.com/typescript-eslint/typescript-eslint/issues/1890)) ([f1c3b18](https://github.com/typescript-eslint/typescript-eslint/commit/f1c3b18f7aadc81f7dca7aa32aa1a8fe424e04e7)) -* **eslint-plugin:** [unbound-method] ignore assignments _to_ methods ([#1736](https://github.com/typescript-eslint/typescript-eslint/issues/1736)) ([6b4680b](https://github.com/typescript-eslint/typescript-eslint/commit/6b4680b6e7343d9d98fa1de170f387a36d98b73e)) -* **eslint-plugin:** no-empty-interface autofix ([#1865](https://github.com/typescript-eslint/typescript-eslint/issues/1865)) ([829a2f7](https://github.com/typescript-eslint/typescript-eslint/commit/829a2f728f876d356908e2338c2d6620e58f9943)), closes [#1864](https://github.com/typescript-eslint/typescript-eslint/issues/1864) -* **eslint-plugin:** use `isTypeArrayTypeOrUnionOfArrayTypes` util for checking if type is array ([#1728](https://github.com/typescript-eslint/typescript-eslint/issues/1728)) ([05030f8](https://github.com/typescript-eslint/typescript-eslint/commit/05030f8d2bd5a50e95053bc61380891da71cc567)) +- **eslint-plugin:** [consistent-indexed-object-style] fix wrong autofix behaviour with generics ([#2722](https://github.com/typescript-eslint/typescript-eslint/issues/2722)) ([73d9713](https://github.com/typescript-eslint/typescript-eslint/commit/73d97130afe79b8a458c215581ce86c62009ad8b)) +- **eslint-plugin:** [no-shadow] ignore global module augmentation ([#2729](https://github.com/typescript-eslint/typescript-eslint/issues/2729)) ([d8c67a5](https://github.com/typescript-eslint/typescript-eslint/commit/d8c67a564a4cada5add8587f655aee2305cbc562)) +# [4.6.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.5.0...v4.6.0) (2020-10-26) + +### Bug Fixes + +- **eslint-plugin:** [method-signature-style] correct fixer for overloads in an object literal type ([#2708](https://github.com/typescript-eslint/typescript-eslint/issues/2708)) ([0763913](https://github.com/typescript-eslint/typescript-eslint/commit/0763913c4a0d1061465ae3329704f1a7de4b9326)) +- **eslint-plugin:** [method-signature-style] don't auto-fix interfaces within namespaces ([#2678](https://github.com/typescript-eslint/typescript-eslint/issues/2678)) ([e012049](https://github.com/typescript-eslint/typescript-eslint/commit/e01204931e460f5e6731abc443c88d666ca0b07a)) +- **eslint-plugin:** [prefer-string-starts-ends-with] Check negative indices in the second position for slice ([#2696](https://github.com/typescript-eslint/typescript-eslint/issues/2696)) ([66e9c6e](https://github.com/typescript-eslint/typescript-eslint/commit/66e9c6e29f9f56bbd178ba6405f47053be591258)) ### Features -* **eslint-plugin:** [ban-ts-comment] support `ts-expect-error` ([#1706](https://github.com/typescript-eslint/typescript-eslint/issues/1706)) ([469cff3](https://github.com/typescript-eslint/typescript-eslint/commit/469cff332c041f38f60de052769287342455cff1)) -* **eslint-plugin:** [consistent-type-assertions] always allow `const` assertions ([#1713](https://github.com/typescript-eslint/typescript-eslint/issues/1713)) ([af2c00d](https://github.com/typescript-eslint/typescript-eslint/commit/af2c00de62f7e31eaeb88996ebf3f330cc8473b9)) -* **eslint-plugin:** [explicit-function-return-type] add option to allow concise arrows that start with void ([#1732](https://github.com/typescript-eslint/typescript-eslint/issues/1732)) ([2e9c202](https://github.com/typescript-eslint/typescript-eslint/commit/2e9c2028a8a0b226e0f87d4bcc997fa259ca3ebd)) -* **eslint-plugin:** [explicit-module-boundary-types] add optio… ([#1778](https://github.com/typescript-eslint/typescript-eslint/issues/1778)) ([3eee804](https://github.com/typescript-eslint/typescript-eslint/commit/3eee804461d017ea6189cd7f64fcd473623684b4)) -* **eslint-plugin:** [no-base-to-string] add option to ignore tagged templates ([#1763](https://github.com/typescript-eslint/typescript-eslint/issues/1763)) ([f5edb99](https://github.com/typescript-eslint/typescript-eslint/commit/f5edb9938c33f8b68f026eba00db3abe9359ced3)) -* **eslint-plugin:** [restrict-template-expressions] add option `allowAny` ([#1762](https://github.com/typescript-eslint/typescript-eslint/issues/1762)) ([d44c0f9](https://github.com/typescript-eslint/typescript-eslint/commit/d44c0f9bed2404ca00b020b35fd825929e213398)) -* **eslint-plugin:** add rule `prefer-reduce-type-parameter` ([#1707](https://github.com/typescript-eslint/typescript-eslint/issues/1707)) ([c92d240](https://github.com/typescript-eslint/typescript-eslint/commit/c92d240e49113779053eac32038382b282812afc)) -* **eslint-plugin:** add rule `prefer-ts-expect-error` ([#1705](https://github.com/typescript-eslint/typescript-eslint/issues/1705)) ([7021f21](https://github.com/typescript-eslint/typescript-eslint/commit/7021f2151a25db2a8edf17e06cd6f21e90761ec8)) -* **eslint-plugin:** add rule no-unsafe-assignment ([#1694](https://github.com/typescript-eslint/typescript-eslint/issues/1694)) ([a49b860](https://github.com/typescript-eslint/typescript-eslint/commit/a49b860cbbb2c7d718b99f561e2fb6eaadf16f17)) +- **eslint-plugin:** [ban-types] support banning `[]` ([#2704](https://github.com/typescript-eslint/typescript-eslint/issues/2704)) ([ef8b5a7](https://github.com/typescript-eslint/typescript-eslint/commit/ef8b5a7e09cca4bdacf205da28f99f2b1a419d00)), closes [#2582](https://github.com/typescript-eslint/typescript-eslint/issues/2582) +- **eslint-plugin:** add `no-unnecessary-type-constraint` rule ([#2516](https://github.com/typescript-eslint/typescript-eslint/issues/2516)) ([880ac75](https://github.com/typescript-eslint/typescript-eslint/commit/880ac753b90d63034f0a33f8f512d9fabc17c8f9)) +- **eslint-plugin:** add extension rule `space-infix-ops` ([#2593](https://github.com/typescript-eslint/typescript-eslint/issues/2593)) ([343d20d](https://github.com/typescript-eslint/typescript-eslint/commit/343d20db23a1640e3bca8cf52b7db1fa46e092e6)) +# [4.5.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.4.1...v4.5.0) (2020-10-19) +### Bug Fixes +- **eslint-plugin:** [array-type] fix issues with readonly option ([#2667](https://github.com/typescript-eslint/typescript-eslint/issues/2667)) ([63d1d81](https://github.com/typescript-eslint/typescript-eslint/commit/63d1d8189c829c6543c7966a864b62c07fbd61a0)) +- **eslint-plugin:** [lines-between-class-members] fix typo in schema ([#2681](https://github.com/typescript-eslint/typescript-eslint/issues/2681)) ([a2a2514](https://github.com/typescript-eslint/typescript-eslint/commit/a2a2514f8a8eee478c8697c4ce42d3c586599b14)) +- **eslint-plugin:** [naming-convention] check bodyless function parameters ([#2675](https://github.com/typescript-eslint/typescript-eslint/issues/2675)) ([c505863](https://github.com/typescript-eslint/typescript-eslint/commit/c505863ac41755383e08893ba0bc4c0fd937eb1d)) +- **eslint-plugin:** [no-invalid-this] allow "this" in class property definitions ([#2685](https://github.com/typescript-eslint/typescript-eslint/issues/2685)) ([dccb6ee](https://github.com/typescript-eslint/typescript-eslint/commit/dccb6ee9f1cd9519c26808d10a5bed8291d0a8e4)) +- **eslint-plugin:** [no-misused-promises] False negative in LogicalExpression ([#2682](https://github.com/typescript-eslint/typescript-eslint/issues/2682)) ([30a6951](https://github.com/typescript-eslint/typescript-eslint/commit/30a695103e99d214fd40847aaa51c1631981c226)), closes [#2544](https://github.com/typescript-eslint/typescript-eslint/issues/2544) +- **eslint-plugin:** [no-unnecessary-type-assertion] correct fixer for vue files ([#2680](https://github.com/typescript-eslint/typescript-eslint/issues/2680)) ([55111af](https://github.com/typescript-eslint/typescript-eslint/commit/55111afd7819d29d65da4f41cc6a129f34aaeb3e)) +- **eslint-plugin:** [return-await] do not auto-fix when type is `any`/`unknown` ([#2671](https://github.com/typescript-eslint/typescript-eslint/issues/2671)) ([d690c8d](https://github.com/typescript-eslint/typescript-eslint/commit/d690c8dff3636d8c8a9a38bd422e0bedbd1d72cb)) +- **parser:** minor fix regexp, map-filter to reduce ([#2684](https://github.com/typescript-eslint/typescript-eslint/issues/2684)) ([f1329f6](https://github.com/typescript-eslint/typescript-eslint/commit/f1329f6c4e3d1de21b1dc59c30ce16503c346eee)) +### Features -# [2.27.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.26.0...v2.27.0) (2020-04-06) +- **eslint-plugin:** [dot-notation] add `allowProtectedClassPropertyAccess` option ([#2622](https://github.com/typescript-eslint/typescript-eslint/issues/2622)) ([bbc9e35](https://github.com/typescript-eslint/typescript-eslint/commit/bbc9e3540576891552dc2dc54b2acbc54104be9d)) +- **eslint-plugin:** [prefer-readonly-parameter-types] add `ignoreInferredTypes` option ([#2668](https://github.com/typescript-eslint/typescript-eslint/issues/2668)) ([91010e8](https://github.com/typescript-eslint/typescript-eslint/commit/91010e88258bf47a0438e842c8ddca19e0414b48)) +- **eslint-plugin:** [restrict-plus-operands] add intersection type determination logic ([#2628](https://github.com/typescript-eslint/typescript-eslint/issues/2628)) ([da71362](https://github.com/typescript-eslint/typescript-eslint/commit/da713627c88354229f245866ccf1018fb56b6e53)) +- **typescript-estree:** add flag EXPERIMENTAL_useSourceOfProjectReferenceRedirect ([#2669](https://github.com/typescript-eslint/typescript-eslint/issues/2669)) ([90a5878](https://github.com/typescript-eslint/typescript-eslint/commit/90a587845088da1b205e4d7d77dbc3f9447b1c5a)) +## [4.4.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.4.0...v4.4.1) (2020-10-12) ### Bug Fixes -* **eslint-plugin:** [no-throw-literal] fix crash caused by getBaseTypes ([#1830](https://github.com/typescript-eslint/typescript-eslint/issues/1830)) ([9d53c76](https://github.com/typescript-eslint/typescript-eslint/commit/9d53c761983dd964109b9f13eb9bfe20caf9defb)) -* **eslint-plugin:** [no-unsafe-call] fix incorrect selector ([#1826](https://github.com/typescript-eslint/typescript-eslint/issues/1826)) ([8ec53a3](https://github.com/typescript-eslint/typescript-eslint/commit/8ec53a3579fcb59cdffea0c60fbb755d056f4c8a)) -* **eslint-plugin:** [require-await] handle async generators ([#1782](https://github.com/typescript-eslint/typescript-eslint/issues/1782)) ([9642d9d](https://github.com/typescript-eslint/typescript-eslint/commit/9642d9dce693befac89a4e9d8bf8dd18f4361e2a)) -* **eslint-plugin:** no-explicit-any constructor functions (& mo… ([#1711](https://github.com/typescript-eslint/typescript-eslint/issues/1711)) ([ab8572e](https://github.com/typescript-eslint/typescript-eslint/commit/ab8572e30e14ebda91c8437be5ee35e7dc9add2e)) -* **typescript-estree:** add support for TS3.9 extra file extensions ([#1833](https://github.com/typescript-eslint/typescript-eslint/issues/1833)) ([1f0ff41](https://github.com/typescript-eslint/typescript-eslint/commit/1f0ff41aa1bc3b7c5330b2f5fe22e24bf578a6b2)) +- **eslint-plugin:** [ban-ts-comment] support block comments ([#2644](https://github.com/typescript-eslint/typescript-eslint/issues/2644)) ([9c3c686](https://github.com/typescript-eslint/typescript-eslint/commit/9c3c686b59b4b8fd02c479a534b5ca9b33c5ff40)) +- **eslint-plugin:** [ban-types] allow banning types with specific parameters ([#2662](https://github.com/typescript-eslint/typescript-eslint/issues/2662)) ([77732a2](https://github.com/typescript-eslint/typescript-eslint/commit/77732a2f3979f638e471b6de327b2ea0e976d568)) +- **eslint-plugin:** [consistent-type-assertions] check type assertion in jsx props ([#2653](https://github.com/typescript-eslint/typescript-eslint/issues/2653)) ([393e925](https://github.com/typescript-eslint/typescript-eslint/commit/393e92573fbde849369af1d10b9f25299ec92eaf)) +- **eslint-plugin:** [no-duplicate-imports] distinguish member, default ([#2637](https://github.com/typescript-eslint/typescript-eslint/issues/2637)) ([c71f423](https://github.com/typescript-eslint/typescript-eslint/commit/c71f423b89bf034caf2a4f1bb3ed0389b72f3aa9)) +- **eslint-plugin:** [no-throw-literal] false positive with logical expressions ([#2645](https://github.com/typescript-eslint/typescript-eslint/issues/2645)) ([57aa6c7](https://github.com/typescript-eslint/typescript-eslint/commit/57aa6c7642320074ed2b6a15e7f38e66a2fb13d1)) +- **eslint-plugin:** [no-unused-vars] fix false positives for duplicated names in namespaces ([#2659](https://github.com/typescript-eslint/typescript-eslint/issues/2659)) ([0d696c7](https://github.com/typescript-eslint/typescript-eslint/commit/0d696c72c5c9c3446902a63509d499ee95483e81)) +- **eslint-plugin:** [no-use-before-define] correctly handle typeof type references ([#2623](https://github.com/typescript-eslint/typescript-eslint/issues/2623)) ([8e44c78](https://github.com/typescript-eslint/typescript-eslint/commit/8e44c78a20410457851e5b7fe9a24777876c0aaf)) +- **scope-manager:** don't create a variable for global augmentation ([#2639](https://github.com/typescript-eslint/typescript-eslint/issues/2639)) ([6bc9325](https://github.com/typescript-eslint/typescript-eslint/commit/6bc93257ec876214743a165093b6666d713379f6)) +# [4.4.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.3.0...v4.4.0) (2020-10-05) ### Features -* **eslint-plugin:** new rule method-signature-style ([#1685](https://github.com/typescript-eslint/typescript-eslint/issues/1685)) ([c49d771](https://github.com/typescript-eslint/typescript-eslint/commit/c49d771ba62f1a21d3c1aec106341daddfcd3c9a)) -* **eslint-plugin:** sort members alphabetically ([#263](https://github.com/typescript-eslint/typescript-eslint/issues/263)) ([485e902](https://github.com/typescript-eslint/typescript-eslint/commit/485e90213a0f8baac0587f7d56925448883fc5bd)) -* **eslint-plugin-internal:** add plugin-test-formatting rule ([#1821](https://github.com/typescript-eslint/typescript-eslint/issues/1821)) ([9b0023a](https://github.com/typescript-eslint/typescript-eslint/commit/9b0023a4996ecdd7dfcb30abd1678091a78f3064)) -* **experimental-utils:** add types for suggestions from CLIEngine ([#1844](https://github.com/typescript-eslint/typescript-eslint/issues/1844)) ([7c11bd6](https://github.com/typescript-eslint/typescript-eslint/commit/7c11bd66f2d0e5ea9d3943e6b8c66e6ddff50862)) -* **experimental-utils:** update eslint types to match v6.8 ([#1846](https://github.com/typescript-eslint/typescript-eslint/issues/1846)) ([16ce74d](https://github.com/typescript-eslint/typescript-eslint/commit/16ce74d247781ac890dc0baa30c384f97e581b6b)) +- **eslint-plugin:** add `consistent-indexed-object-style` rule ([#2401](https://github.com/typescript-eslint/typescript-eslint/issues/2401)) ([d7dc108](https://github.com/typescript-eslint/typescript-eslint/commit/d7dc108580cdcb9890ac0539e7223aedbff4a0ed)) +- **eslint-plugin:** add extension rule `no-duplicate-imports` ([#2609](https://github.com/typescript-eslint/typescript-eslint/issues/2609)) ([498f397](https://github.com/typescript-eslint/typescript-eslint/commit/498f397ff3898dde631f37311615b555f38a414e)) +# [4.3.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.2.0...v4.3.0) (2020-09-28) +### Bug Fixes +- **eslint-plugin:** added safe getTypeOfPropertyOfType wrapper ([#2567](https://github.com/typescript-eslint/typescript-eslint/issues/2567)) ([7cba2de](https://github.com/typescript-eslint/typescript-eslint/commit/7cba2de138542563d678fbfc738cd1b3ebf01e07)) +- **experimental-utils:** treat RuleTester arrays as readonly ([#2601](https://github.com/typescript-eslint/typescript-eslint/issues/2601)) ([8025777](https://github.com/typescript-eslint/typescript-eslint/commit/80257776b78bd2b2b4389d6bd530b009a75fb520)) +### Features -# [2.26.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.25.0...v2.26.0) (2020-03-30) +- **eslint-plugin:** [no-invalid-void-type] add option to allow `this: void` ([#2481](https://github.com/typescript-eslint/typescript-eslint/issues/2481)) ([ddf5660](https://github.com/typescript-eslint/typescript-eslint/commit/ddf5660846784003cab4b10ae7a5e510b9dd562b)) +# [4.2.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.1.1...v4.2.0) (2020-09-21) ### Bug Fixes -* **eslint-plugin:** [no-explicit-any] error with ignoreRestArgs ([#1796](https://github.com/typescript-eslint/typescript-eslint/issues/1796)) ([638d84d](https://github.com/typescript-eslint/typescript-eslint/commit/638d84ddd77d07117b3ec7c5431f3b0e44b1995d)) -* **eslint-plugin:** [no-unsafe-call] allow import expressions ([#1800](https://github.com/typescript-eslint/typescript-eslint/issues/1800)) ([4fa7107](https://github.com/typescript-eslint/typescript-eslint/commit/4fa710754ecc412b65ac3864fe0c7857c254ac1b)) -* **eslint-plugin:** [no-unsafe-return] error with unknown ([#2371](https://github.com/typescript-eslint/typescript-eslint/issues/2371)) ([e7528e6](https://github.com/typescript-eslint/typescript-eslint/commit/e7528e686f5fe5cce8504fc15d3cd06b8733712e)) +- **typescript-estree:** support TSv4 labelled tuple members ([#2378](https://github.com/typescript-eslint/typescript-eslint/issues/2378)) ([00d84ff](https://github.com/typescript-eslint/typescript-eslint/commit/00d84ffbcbe9d0ec98bdb2f2ce59959a27ce4dbe)) +# [3.8.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.7.1...v3.8.0) (2020-08-03) +### Bug Fixes +- **eslint-plugin:** [no-implied-eval] don't report when `Function` is imported ([#2348](https://github.com/typescript-eslint/typescript-eslint/issues/2348)) ([fa169e7](https://github.com/typescript-eslint/typescript-eslint/commit/fa169e79661821f0e0e64a56d6db9da42c3c8654)) +- **eslint-plugin:** [no-unsafe-assignment] fix typo in message ([#2347](https://github.com/typescript-eslint/typescript-eslint/issues/2347)) ([2027bb1](https://github.com/typescript-eslint/typescript-eslint/commit/2027bb11689b76c297f93ba8a918b35fe68e5b9d)) +### Features -# [2.21.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.20.0...v2.21.0) (2020-02-24) +- **eslint-plugin:** [naming-convention] allow specifying an array of selectors ([#2335](https://github.com/typescript-eslint/typescript-eslint/issues/2335)) ([3ef6bd5](https://github.com/typescript-eslint/typescript-eslint/commit/3ef6bd5cadc225e42ef1330d15919a39f53f2a2b)) +- **eslint-plugin:** add `prefer-enum-initializers` rule ([#2326](https://github.com/typescript-eslint/typescript-eslint/issues/2326)) ([4f38ea3](https://github.com/typescript-eslint/typescript-eslint/commit/4f38ea39c97289db11501d6368d01db8c5787257)) +## [3.7.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.7.0...v3.7.1) (2020-07-27) ### Bug Fixes -* **eslint-plugin:** [embt] ignore JSX callbacks ([#1630](https://github.com/typescript-eslint/typescript-eslint/issues/1630)) ([4d45b33](https://github.com/typescript-eslint/typescript-eslint/commit/4d45b331b920113c97a90df7dc703f8dfbcc04f3)) -* **eslint-plugin:** [no-floating-promises] handle finally callback ([#1620](https://github.com/typescript-eslint/typescript-eslint/issues/1620)) ([1aa7135](https://github.com/typescript-eslint/typescript-eslint/commit/1aa7135bbfbf55cec52925fc0224188cd3c319e7)) -* **eslint-plugin:** [typedef] allow array/object destructuring in for/of ([#1570](https://github.com/typescript-eslint/typescript-eslint/issues/1570)) ([660bace](https://github.com/typescript-eslint/typescript-eslint/commit/660bace4c3da569d71cf1e296ac4f6ed35bdfc44)) -* **typescript-estree:** process.stdout can be undefined ([#1619](https://github.com/typescript-eslint/typescript-eslint/issues/1619)) ([0d8e87e](https://github.com/typescript-eslint/typescript-eslint/commit/0d8e87e09704588273bc94a740279b3e8af7474f)) +- **eslint-plugin:** [adjacent-overload-signatures] fix false positive on call signatures and a method named `call` ([#2313](https://github.com/typescript-eslint/typescript-eslint/issues/2313)) ([30fafb0](https://github.com/typescript-eslint/typescript-eslint/commit/30fafb09422b3aca881f4785d89b0536092d4952)) +- **eslint-plugin:** [no-extra-parens] stop reporting on calling generic functions with one argument and type parameters containing parentheses ([#2319](https://github.com/typescript-eslint/typescript-eslint/issues/2319)) ([616a841](https://github.com/typescript-eslint/typescript-eslint/commit/616a841032bec310d9f31f1c987888273df27008)) +- **typescript-estree:** correct AST regression introduced by TS4.0 upgrade ([#2316](https://github.com/typescript-eslint/typescript-eslint/issues/2316)) ([d7fefba](https://github.com/typescript-eslint/typescript-eslint/commit/d7fefba3741a526ff2b58dd713995c3ee5603962)) +# [3.7.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.6.1...v3.7.0) (2020-07-20) ### Features -* **eslint-plugin:** [require-await] add --fix support ([#1561](https://github.com/typescript-eslint/typescript-eslint/issues/1561)) ([9edd863](https://github.com/typescript-eslint/typescript-eslint/commit/9edd863b2a66ee44bd4a439903973e6c207480aa)) +- **eslint-plugin:** [naming-convention] allow selecting only `const` variables ([#2291](https://github.com/typescript-eslint/typescript-eslint/issues/2291)) ([156d058](https://github.com/typescript-eslint/typescript-eslint/commit/156d058fee835fdf1ed827a5ad4a80d57190cc54)) +- **eslint-plugin:** [no-empty-function] add `decoratedFunctions` option ([#2295](https://github.com/typescript-eslint/typescript-eslint/issues/2295)) ([88f08f4](https://github.com/typescript-eslint/typescript-eslint/commit/88f08f410760f58fdc2de58ecd9dab9610821642)) +- **typescript-estree:** support short-circuiting assignment operators ([#2307](https://github.com/typescript-eslint/typescript-eslint/issues/2307)) ([2c90d9f](https://github.com/typescript-eslint/typescript-eslint/commit/2c90d9fa3aa5ebd7db697dddb7762bca2dd0e06b)) +- **typescript-estree:** support type annotations on catch clauses ([#2306](https://github.com/typescript-eslint/typescript-eslint/issues/2306)) ([b5afe9c](https://github.com/typescript-eslint/typescript-eslint/commit/b5afe9c560b9f38c8dffc312a600db30944129c8)) +## [3.6.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.6.0...v3.6.1) (2020-07-13) +### Bug Fixes +- **eslint-plugin:** [no-unnecessary-condition] handle computed member access ([#2288](https://github.com/typescript-eslint/typescript-eslint/issues/2288)) ([3a187ca](https://github.com/typescript-eslint/typescript-eslint/commit/3a187cafb7302a3c05de0e6a236dd142a5e2d741)) +- **eslint-plugin:** [prefer-literal-enum-member] allow negative numbers ([#2277](https://github.com/typescript-eslint/typescript-eslint/issues/2277)) ([00ac9c3](https://github.com/typescript-eslint/typescript-eslint/commit/00ac9c3ccaad27bab08ec3c3a104f612bb593df5)) +- **eslint-plugin:** [space-before-function-paren] incorrect handling of abstract methods ([#2275](https://github.com/typescript-eslint/typescript-eslint/issues/2275)) ([ced6591](https://github.com/typescript-eslint/typescript-eslint/commit/ced65918b16f46c383496a9b4bd43eca8a76baf6)), closes [#2274](https://github.com/typescript-eslint/typescript-eslint/issues/2274) +- **eslint-plugin:** [switch-exhaustiveness-check] handle special characters in enum keys ([#2207](https://github.com/typescript-eslint/typescript-eslint/issues/2207)) ([98ab010](https://github.com/typescript-eslint/typescript-eslint/commit/98ab010fb7fca884984bb4200fd806ecee8071b6)) +# [3.6.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.5.0...v3.6.0) (2020-07-06) -# [2.20.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.19.2...v2.20.0) (2020-02-17) +### Bug Fixes +- **eslint-plugin:** [no-namespace] allow namespaces in nested declarations with `allowDeclarations` ([#2238](https://github.com/typescript-eslint/typescript-eslint/issues/2238)) ([c1df669](https://github.com/typescript-eslint/typescript-eslint/commit/c1df6694f7866d3ef7ede0b1c6c9dd6f3955e682)) +- **eslint-plugin:** [space-before-function-paren] handle abstract functions ([#2199](https://github.com/typescript-eslint/typescript-eslint/issues/2199)) ([88a3edf](https://github.com/typescript-eslint/typescript-eslint/commit/88a3edfce8349f871b7b660d2b76508b67c94eda)) ### Features -* **eslint-plugin:** [ban-types] allow banning null and undefined ([#821](https://github.com/typescript-eslint/typescript-eslint/issues/821)) ([0b2b887](https://github.com/typescript-eslint/typescript-eslint/commit/0b2b887c06f2582d812a45f7a8deb82f52d82a84)) -* **eslint-plugin:** [strict-boolean-expressions] refactor, add clearer error messages ([#1480](https://github.com/typescript-eslint/typescript-eslint/issues/1480)) ([db4b530](https://github.com/typescript-eslint/typescript-eslint/commit/db4b530f3f049267d679e89d9e75acfcb86faaf2)) - +- **eslint-plugin:** add rule `prefer-literal-enum-member` ([#1898](https://github.com/typescript-eslint/typescript-eslint/issues/1898)) ([fe2b2ec](https://github.com/typescript-eslint/typescript-eslint/commit/fe2b2ec39ef04ac8b73eef9d29d12fd1b24fa183)) +# [3.5.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.4.0...v3.5.0) (2020-06-29) +### Bug Fixes +- **eslint-plugin:** [naming-convention] support unicode in regex ([#2241](https://github.com/typescript-eslint/typescript-eslint/issues/2241)) ([5fdd21a](https://github.com/typescript-eslint/typescript-eslint/commit/5fdd21a1726fb6928098c4152aec55a30df960d4)) +- **typescript-estree:** forward compatibility for new compound assignment operators ([#2253](https://github.com/typescript-eslint/typescript-eslint/issues/2253)) ([ba41680](https://github.com/typescript-eslint/typescript-eslint/commit/ba41680f2a25b1aa4d05c2d4b132ac73a6faefbd)) -## [2.19.2](https://github.com/typescript-eslint/typescript-eslint/compare/v2.19.1...v2.19.2) (2020-02-10) +### Features -**Note:** Version bump only for package @typescript-eslint/typescript-eslint +- add package scope-manager ([#1939](https://github.com/typescript-eslint/typescript-eslint/issues/1939)) ([682eb7e](https://github.com/typescript-eslint/typescript-eslint/commit/682eb7e009c3f22a542882dfd3602196a60d2a1e)) +- split types into their own package ([#2229](https://github.com/typescript-eslint/typescript-eslint/issues/2229)) ([5f45918](https://github.com/typescript-eslint/typescript-eslint/commit/5f4591886f3438329fbf2229b03ac66174334a24)) +- split visitor keys into their own package ([#2230](https://github.com/typescript-eslint/typescript-eslint/issues/2230)) ([689dae3](https://github.com/typescript-eslint/typescript-eslint/commit/689dae37392d527c64ae83db2a4c3e6b7fecece7)) +# [3.4.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.3.0...v3.4.0) (2020-06-22) +### Bug Fixes +- **eslint-plugin:** [no-base-to-string] handle intersection types ([#2170](https://github.com/typescript-eslint/typescript-eslint/issues/2170)) ([9cca3a9](https://github.com/typescript-eslint/typescript-eslint/commit/9cca3a9584d5d5ef0536219c5a734f4e87efb543)) +- **eslint-plugin:** [unbound-method] handling destructuring ([#2228](https://github.com/typescript-eslint/typescript-eslint/issues/2228)) ([c3753c2](https://github.com/typescript-eslint/typescript-eslint/commit/c3753c21768d355ecdb9e7ae8e0bfdfbbc1d3bbe)) +- **experimental-utils:** correct types for TS versions older than 3.8 ([#2217](https://github.com/typescript-eslint/typescript-eslint/issues/2217)) ([5e4dda2](https://github.com/typescript-eslint/typescript-eslint/commit/5e4dda264a7d6a6a1626848e7599faea1ac34922)) +- **experimental-utils:** getParserServices takes a readonly context ([#2235](https://github.com/typescript-eslint/typescript-eslint/issues/2235)) ([26da8de](https://github.com/typescript-eslint/typescript-eslint/commit/26da8de7fcde9eddec63212d79af781c4bb22991)) +### Features -## [2.19.1](https://github.com/typescript-eslint/typescript-eslint/compare/v2.19.0...v2.19.1) (2020-02-10) +- **eslint-plugin:** [no-unnecessary-boolean-literal-compare] add option to check nullable booleans ([#1983](https://github.com/typescript-eslint/typescript-eslint/issues/1983)) ([c0b3057](https://github.com/typescript-eslint/typescript-eslint/commit/c0b3057b7f7d515891ad2efe32e4ef8c01e0478f)) +- **eslint-plugin:** add extension rule `no-loss-of-precision` ([#2196](https://github.com/typescript-eslint/typescript-eslint/issues/2196)) ([535b0f2](https://github.com/typescript-eslint/typescript-eslint/commit/535b0f2ddd82efa6a2c40307a61c480f4b3cdea3)) +# [3.3.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.2.0...v3.3.0) (2020-06-15) ### Bug Fixes -* **eslint-plugin:** [unbound-method] blacklist a few unbound natives ([#1562](https://github.com/typescript-eslint/typescript-eslint/issues/1562)) ([4670aab](https://github.com/typescript-eslint/typescript-eslint/commit/4670aabef31d9017ad302f206b9c2f18d53c8ee4)) -* **typescript-estree:** ts returning wrong file with project references ([#1575](https://github.com/typescript-eslint/typescript-eslint/issues/1575)) ([4c12dac](https://github.com/typescript-eslint/typescript-eslint/commit/4c12dac075f774801a145cd29c4c7eff64f98fdc)) - - - +- **eslint-plugin:** [no-unused-expressions] handle ternary and short-circuit options ([#2194](https://github.com/typescript-eslint/typescript-eslint/issues/2194)) ([ee9f100](https://github.com/typescript-eslint/typescript-eslint/commit/ee9f100a2f9a874c2b361482742686eeaa9bdac7)) +- **typescript-estree:** handle TS4.0 breaking change in TupleType ([#2197](https://github.com/typescript-eslint/typescript-eslint/issues/2197)) ([5d68129](https://github.com/typescript-eslint/typescript-eslint/commit/5d6812914831a386997b453b4db1e3283e26005d)) +### Features -# [2.19.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.18.0...v2.19.0) (2020-02-03) +- **eslint-plugin:** [naming-convention] better error message and docs for prefix/suffix ([#2195](https://github.com/typescript-eslint/typescript-eslint/issues/2195)) ([a2ffe55](https://github.com/typescript-eslint/typescript-eslint/commit/a2ffe5568df0f7224bfe9141d298e538383d5f09)) +# [3.2.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.1.0...v3.2.0) (2020-06-08) ### Bug Fixes -* **eslint-plugin:** [embt] fix allowTypedFunctionExpressions ([#1553](https://github.com/typescript-eslint/typescript-eslint/issues/1553)) ([9e7d161](https://github.com/typescript-eslint/typescript-eslint/commit/9e7d1616d78a0f94521f4e6d4b48344e5df2d9f7)) -* **eslint-plugin:** [require-await] improve performance ([#1536](https://github.com/typescript-eslint/typescript-eslint/issues/1536)) ([45ae0b9](https://github.com/typescript-eslint/typescript-eslint/commit/45ae0b9565ee6e9d01e82107d85ad7151a15af7b)) -* **typescript-estree:** fix regression introduced in [#1525](https://github.com/typescript-eslint/typescript-eslint/issues/1525) ([#1543](https://github.com/typescript-eslint/typescript-eslint/issues/1543)) ([bec4572](https://github.com/typescript-eslint/typescript-eslint/commit/bec45722dfed8aeb49189d151252b83d4a34239c)) -* **typescript-estree:** persisted parse and module none ([#1516](https://github.com/typescript-eslint/typescript-eslint/issues/1516)) ([7c70323](https://github.com/typescript-eslint/typescript-eslint/commit/7c7032322f55d9492e21d3bfa5da16da1f05cbce)) - +- **eslint-plugin:** [explicit-module-boundary-types] dont report return type errors on constructor overloads ([#2158](https://github.com/typescript-eslint/typescript-eslint/issues/2158)) ([53232d7](https://github.com/typescript-eslint/typescript-eslint/commit/53232d775ca0b808e2d75d9501f4411a868b2b48)) +- **eslint-plugin:** [explicit-module-boundary-types] handle bodyless arrow functions with explicit return types that return functions ([#2169](https://github.com/typescript-eslint/typescript-eslint/issues/2169)) ([58db655](https://github.com/typescript-eslint/typescript-eslint/commit/58db655133aaae006efe3e3ceee971cf88dc348f)) +- **eslint-plugin:** [explicit-module-boundary-types] handle nested functions and functions expressions in a typed variable declaration ([#2176](https://github.com/typescript-eslint/typescript-eslint/issues/2176)) ([6ff450d](https://github.com/typescript-eslint/typescript-eslint/commit/6ff450da3abec93223a33f6b52484c9ca99b7abe)) +- **eslint-plugin:** [no-extra-non-null-assertion] dont report for assertions not followed by the optional chain ([#2167](https://github.com/typescript-eslint/typescript-eslint/issues/2167)) ([e4c1834](https://github.com/typescript-eslint/typescript-eslint/commit/e4c1834c7c5934332dd1d58c09018453568c4889)) +- **eslint-plugin:** [no-unnecessary-conditionals] Handle comparison of generics and loose comparisons with undefined values ([#2152](https://github.com/typescript-eslint/typescript-eslint/issues/2152)) ([c86e2a2](https://github.com/typescript-eslint/typescript-eslint/commit/c86e2a235372149db9b1700d39c2145e0ce5221a)) +- **eslint-plugin:** [prefer-optional-chain] handling first member expression ([#2156](https://github.com/typescript-eslint/typescript-eslint/issues/2156)) ([de18660](https://github.com/typescript-eslint/typescript-eslint/commit/de18660a8cf8f7033798646d8c5b0938d1accb12)) +- **eslint-plugin:** [return-await] correct handling of ternaries ([#2168](https://github.com/typescript-eslint/typescript-eslint/issues/2168)) ([fe4c0bf](https://github.com/typescript-eslint/typescript-eslint/commit/fe4c0bf8c04f070d6642fbe86c5e5614bc88e8fd)) ### Features -* **eslint-plugin:** [no-extra-non-null-assert] add fixer ([#1468](https://github.com/typescript-eslint/typescript-eslint/issues/1468)) ([54201ab](https://github.com/typescript-eslint/typescript-eslint/commit/54201aba37b2865c0ba4981be79d1fd989806133)) -* **eslint-plugin:** [no-float-prom] fixer + msg for ignoreVoid ([#1473](https://github.com/typescript-eslint/typescript-eslint/issues/1473)) ([159b16e](https://github.com/typescript-eslint/typescript-eslint/commit/159b16ec3a66f05478080c397df5c3f6e29535e4)) -* **eslint-plugin:** [unbound-method] support bound builtins ([#1526](https://github.com/typescript-eslint/typescript-eslint/issues/1526)) ([0a110eb](https://github.com/typescript-eslint/typescript-eslint/commit/0a110eb680749c8c4a2a3dc1375c1a83056e4c14)) -* **eslint-plugin:** add extension [no-dupe-class-members] ([#1492](https://github.com/typescript-eslint/typescript-eslint/issues/1492)) ([b22424e](https://github.com/typescript-eslint/typescript-eslint/commit/b22424e7d4a16042a027557f44e9191e0722b38b)) -* **eslint-plugin:** add no-unnecessary-boolean-literal-compare ([#242](https://github.com/typescript-eslint/typescript-eslint/issues/242)) ([6bebb1d](https://github.com/typescript-eslint/typescript-eslint/commit/6bebb1dc47897ee0e1f075d7e5dd89d8b0590f31)) -* **eslint-plugin:** add switch-exhaustiveness-check rule ([#972](https://github.com/typescript-eslint/typescript-eslint/issues/972)) ([9e0f6dd](https://github.com/typescript-eslint/typescript-eslint/commit/9e0f6ddef7cd29f355f398c90f1986e51c4854f7)) -* **eslint-plugin:** support negative matches for `filter` ([#1517](https://github.com/typescript-eslint/typescript-eslint/issues/1517)) ([b24fbe8](https://github.com/typescript-eslint/typescript-eslint/commit/b24fbe8790b540998e4085174251fb4d61bf96b0)) +- **eslint-plugin:** [naming-convention] put identifiers in quotes in error messages ([#2182](https://github.com/typescript-eslint/typescript-eslint/issues/2182)) ([fc61932](https://github.com/typescript-eslint/typescript-eslint/commit/fc619326eedf7ef2efa51444ecdead81a36a204f)), closes [#2178](https://github.com/typescript-eslint/typescript-eslint/issues/2178) +- **eslint-plugin:** [require-array-sort-compare] add `ignoreStringArrays` option ([#1972](https://github.com/typescript-eslint/typescript-eslint/issues/1972)) ([6dee784](https://github.com/typescript-eslint/typescript-eslint/commit/6dee7840a3af1dfe4c38a128d1c4655bdac625df)) +- **eslint-plugin:** add rule `ban-tslint-comment` ([#2140](https://github.com/typescript-eslint/typescript-eslint/issues/2140)) ([43ee226](https://github.com/typescript-eslint/typescript-eslint/commit/43ee226ffbaaa3e7126081db9476c24b89ec16e9)) +- **eslint-plugin:** add rule `no-confusing-non-null-assertion` ([#1941](https://github.com/typescript-eslint/typescript-eslint/issues/1941)) ([9b51c44](https://github.com/typescript-eslint/typescript-eslint/commit/9b51c44f29d8b3e95a510985544e8ded8a14404d)) +# [3.1.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.0.2...v3.1.0) (2020-06-01) +### Bug Fixes +- **eslint-plugin:** [explicit-module-boundary-types] don't check returned functions if parent function has return type ([#2084](https://github.com/typescript-eslint/typescript-eslint/issues/2084)) ([d7d4eeb](https://github.com/typescript-eslint/typescript-eslint/commit/d7d4eeb03f2918d5d9e361fdb47c2d42e83bd593)) +- **eslint-plugin:** [no-unnecessary-condition] handle comparison of any, unknown and loose comparisons with nullish values ([#2123](https://github.com/typescript-eslint/typescript-eslint/issues/2123)) ([1ae1d01](https://github.com/typescript-eslint/typescript-eslint/commit/1ae1d01e5603ec7cef8051ed018c3c3c88b29867)) +- **eslint-plugin:** [no-unnecessary-condition] improve optional chain handling ([#2111](https://github.com/typescript-eslint/typescript-eslint/issues/2111)) ([9ee399b](https://github.com/typescript-eslint/typescript-eslint/commit/9ee399b5906e82f346ff89141207a6630786de54)) +- **eslint-plugin:** [no-unnecessary-condition] improve optional chain handling 2 - electric boogaloo ([#2138](https://github.com/typescript-eslint/typescript-eslint/issues/2138)) ([c87cfaf](https://github.com/typescript-eslint/typescript-eslint/commit/c87cfaf6746775bb8ad9eb45b0002f068a822dbe)) +- **eslint-plugin:** [no-unused-expressions] ignore import expressions ([#2130](https://github.com/typescript-eslint/typescript-eslint/issues/2130)) ([e383691](https://github.com/typescript-eslint/typescript-eslint/commit/e3836910efdafd9edf04daed149c9e839c08047e)) +- **eslint-plugin:** [no-var-requires] false negative for TSAsExpression and MemberExpression ([#2139](https://github.com/typescript-eslint/typescript-eslint/issues/2139)) ([df95338](https://github.com/typescript-eslint/typescript-eslint/commit/df953388913b22d45242e65ce231d92a8b8a0080)) +- **experimental-utils:** downlevel type declarations for versions older than 3.8 ([#2133](https://github.com/typescript-eslint/typescript-eslint/issues/2133)) ([7925823](https://github.com/typescript-eslint/typescript-eslint/commit/792582326a8065270b69a0ffcaad5a7b4b103ff3)) +### Features -# [2.18.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.17.0...v2.18.0) (2020-01-27) +- **eslint-plugin:** [ban-ts-comments] add "allow-with-description" option ([#2099](https://github.com/typescript-eslint/typescript-eslint/issues/2099)) ([8a0fd18](https://github.com/typescript-eslint/typescript-eslint/commit/8a0fd1899f544470a35afb3117f4c71aad7e4e42)) +- **eslint-plugin:** [ban-types] allow selective disable of default options with `false` value ([#2137](https://github.com/typescript-eslint/typescript-eslint/issues/2137)) ([1cb8ca4](https://github.com/typescript-eslint/typescript-eslint/commit/1cb8ca483d029935310e6904580df8501837084d)) +- **eslint-plugin:** [explicit-module-boundary-types] improve accuracy and coverage ([#2135](https://github.com/typescript-eslint/typescript-eslint/issues/2135)) ([caaa859](https://github.com/typescript-eslint/typescript-eslint/commit/caaa8599284d02ab3341e282cad35a52d0fb86c7)) +## [3.0.2](https://github.com/typescript-eslint/typescript-eslint/compare/v3.0.1...v3.0.2) (2020-05-27) ### Bug Fixes -* **eslint-plugin:** [explicit-module-boundary-types] false positive for returned fns ([#1490](https://github.com/typescript-eslint/typescript-eslint/issues/1490)) ([5562ad5](https://github.com/typescript-eslint/typescript-eslint/commit/5562ad5ed902102d7c09a7fd47ca4ea7e50d6654)) -* improve token types and add missing type guards ([#1497](https://github.com/typescript-eslint/typescript-eslint/issues/1497)) ([ce41d7d](https://github.com/typescript-eslint/typescript-eslint/commit/ce41d7de33bcb7ccf96c03ac1438304c5a49ff54)) -* **eslint-plugin:** [naming-convention] fix filter option ([#1482](https://github.com/typescript-eslint/typescript-eslint/issues/1482)) ([718cd88](https://github.com/typescript-eslint/typescript-eslint/commit/718cd889c155a75413c571ac006c33fbc271dcc5)) -* **eslint-plugin:** fix property access on undefined error ([#1507](https://github.com/typescript-eslint/typescript-eslint/issues/1507)) ([d89e8e8](https://github.com/typescript-eslint/typescript-eslint/commit/d89e8e8a1114989e2727351bee7aadb6579f312b)) -* **experimental-utils:** widen type of `settings` property ([#1527](https://github.com/typescript-eslint/typescript-eslint/issues/1527)) ([b515e47](https://github.com/typescript-eslint/typescript-eslint/commit/b515e47af2bc914c7ebcfa4be813409dcd86b1c3)) -* **typescript-estree:** error on unexpected jsdoc nodes ([#1525](https://github.com/typescript-eslint/typescript-eslint/issues/1525)) ([c8dfac3](https://github.com/typescript-eslint/typescript-eslint/commit/c8dfac3d2f066e50fa9d2b5a86beffdaafddb643)) -* **typescript-estree:** fix identifier tokens typed as `Keyword` ([#1487](https://github.com/typescript-eslint/typescript-eslint/issues/1487)) ([77a1caa](https://github.com/typescript-eslint/typescript-eslint/commit/77a1caa562638645b4717449800e410107d512c8)) - +- regression for eslint v6 ([#2105](https://github.com/typescript-eslint/typescript-eslint/issues/2105)) ([31fc503](https://github.com/typescript-eslint/typescript-eslint/commit/31fc5039ed919e1515fda673c186d5c83eb5beb3)) -### Features +## [3.0.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.0.0...v3.0.1) (2020-05-25) -* **eslint-plugin:** add comma-spacing ([#1495](https://github.com/typescript-eslint/typescript-eslint/issues/1495)) ([1fd86be](https://github.com/typescript-eslint/typescript-eslint/commit/1fd86befa6a940a0354c619dd2da08a5c5d69fb4)) -* **eslint-plugin:** add new rule prefer-as-const ([#1431](https://github.com/typescript-eslint/typescript-eslint/issues/1431)) ([420db96](https://github.com/typescript-eslint/typescript-eslint/commit/420db96921435e8bf7fb484ae74552a912a6adde)) -* **eslint-plugin:** create `ban-ts-comment` rule ([#1361](https://github.com/typescript-eslint/typescript-eslint/issues/1361)) ([2a83d13](https://github.com/typescript-eslint/typescript-eslint/commit/2a83d138a966cd5ce787d1eecf595b59b78232d4)) -* **eslint-plugin-internal:** add `prefer-ast-types-enum` ([#1508](https://github.com/typescript-eslint/typescript-eslint/issues/1508)) ([c3d0a3a](https://github.com/typescript-eslint/typescript-eslint/commit/c3d0a3a6bdff0cae226a279f0a0a9b00952ca925)) -* **experimental-utils:** make RuleMetaData.docs optional ([#1462](https://github.com/typescript-eslint/typescript-eslint/issues/1462)) ([cde97ac](https://github.com/typescript-eslint/typescript-eslint/commit/cde97aca24df5a0f28f37006ed130ebc217fb2ad)) -* **parser:** clean up scope-analysis types ([#1481](https://github.com/typescript-eslint/typescript-eslint/issues/1481)) ([4a727fa](https://github.com/typescript-eslint/typescript-eslint/commit/4a727fa083d749dba9eaf39322856f5f69c28cd8)) +### Bug Fixes +- **eslint-plugin:** [naming-convention] handle no options correctly ([#2095](https://github.com/typescript-eslint/typescript-eslint/issues/2095)) ([fd7d02b](https://github.com/typescript-eslint/typescript-eslint/commit/fd7d02b31ebd995b7fdd857d7c054042aa4f2001)) +- **eslint-plugin:** [no-throw-literal] handle intersection and union types ([#2085](https://github.com/typescript-eslint/typescript-eslint/issues/2085)) ([cae037f](https://github.com/typescript-eslint/typescript-eslint/commit/cae037ff9b20363b970cc600a09505b98bf10a14)) +- **eslint-plugin:** [unbound-method] fix crash due to missing `Intl` ([#2090](https://github.com/typescript-eslint/typescript-eslint/issues/2090)) ([f2fa82c](https://github.com/typescript-eslint/typescript-eslint/commit/f2fa82c532ae858ccfb064268cfcc9df657a54be)) +- **experimental-utils:** export `CLIEngine` & `ESLint` ([#2083](https://github.com/typescript-eslint/typescript-eslint/issues/2083)) ([014341b](https://github.com/typescript-eslint/typescript-eslint/commit/014341bb23261f609fc2a6fe7fece191466a084a)) +- **typescript-estree:** handle `BigInt` with `_` numeric separator ([#2067](https://github.com/typescript-eslint/typescript-eslint/issues/2067)) ([66f1627](https://github.com/typescript-eslint/typescript-eslint/commit/66f1627b11a566d5b925a577e800f99d5c808be2)) +- **typescript-estree:** mark TS 3.8 and 3.9 as "supported" ([#2057](https://github.com/typescript-eslint/typescript-eslint/issues/2057)) ([5eedbff](https://github.com/typescript-eslint/typescript-eslint/commit/5eedbff01178ea33b98ab22e556df4c1a195f839)), closes [#1436](https://github.com/typescript-eslint/typescript-eslint/issues/1436) [#1436](https://github.com/typescript-eslint/typescript-eslint/issues/1436) +# [3.0.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.34.0...v3.0.0) (2020-05-21) +## [Please see the release notes for v3.0.0](https://github.com/typescript-eslint/typescript-eslint/releases/tag/v3.0.0) +### Bug Fixes -# [2.17.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.16.0...v2.17.0) (2020-01-20) +- **eslint-plugin:** [dot-notation] fix typo in schema ([#2040](https://github.com/typescript-eslint/typescript-eslint/issues/2040)) ([242328f](https://github.com/typescript-eslint/typescript-eslint/commit/242328fa749ee4c72af93433a9bef95f329ac62f)) +- **eslint-plugin:** correct parser peerDep version ([fe59f69](https://github.com/typescript-eslint/typescript-eslint/commit/fe59f69381a0915a4f5135e2e88637a5eea246ba)) +- **experimental-utils:** add back SourceCode.isSpaceBetweenTokens ([ae82ea4](https://github.com/typescript-eslint/typescript-eslint/commit/ae82ea4a85a4ca332ebe6104e96c59dba30411be)) +- **typescript-estree:** remove now defunct `Import` node type ([f199cbd](https://github.com/typescript-eslint/typescript-eslint/commit/f199cbdbbd892b5ba03bfff66f463f3d9c92ee9b)) +- **typescript-estree:** use `TSEmptyBodyFunctionExpression` for body-less nodes ([#1289](https://github.com/typescript-eslint/typescript-eslint/issues/1289)) ([82e7163](https://github.com/typescript-eslint/typescript-eslint/commit/82e7163214b56ccde93ba97807b161669a50a60b)) + +### Features + +- add index files to parser and typescript-estree ([3dfc46d](https://github.com/typescript-eslint/typescript-eslint/commit/3dfc46dccbbd28eed2d74c7b6cacddf1a0848598)) +- **eslint-plugin:** [no-floating-promises] ignore void operator by default ([#2003](https://github.com/typescript-eslint/typescript-eslint/issues/2003)) ([3626a67](https://github.com/typescript-eslint/typescript-eslint/commit/3626a673cf8117cc995245cd86e466e2553e9b0e)) +- **eslint-plugin:** [no-unnecessary-condition] remove `checkArrayPredicates` and always check it ([#1579](https://github.com/typescript-eslint/typescript-eslint/issues/1579)) ([bfd9b60](https://github.com/typescript-eslint/typescript-eslint/commit/bfd9b606d17d30d5694967a1f01e0e1501ba1022)) +- **eslint-plugin:** [no-unnecessary-condition] report when non-nullish is compared to `null`/`undefined` ([#1659](https://github.com/typescript-eslint/typescript-eslint/issues/1659)) ([7fa9060](https://github.com/typescript-eslint/typescript-eslint/commit/7fa906073903c5eb70609c25f1a91ada14dcdc71)) +- **eslint-plugin:** [prefer-nullish-coalescing][prefer-optional-chain] remove unsafe fixers ([52b6085](https://github.com/typescript-eslint/typescript-eslint/commit/52b60852d0ba6bb6abe519c9d3ec1b231793e91d)) +- **eslint-plugin:** [restrict-template-expressions] `allowNumber: true` by default ([#2005](https://github.com/typescript-eslint/typescript-eslint/issues/2005)) ([643ec24](https://github.com/typescript-eslint/typescript-eslint/commit/643ec240bd901295d9e9ea5c43fc20109c33e982)) +- **eslint-plugin:** [restrict-template-expressions] rename `allowNullable` to `allowNullish` ([#2006](https://github.com/typescript-eslint/typescript-eslint/issues/2006)) ([264b017](https://github.com/typescript-eslint/typescript-eslint/commit/264b017c11c2ab132fcbad18b42a9a0fe639386e)) +- **experimental-utils:** upgrade eslint types for v7 ([#2023](https://github.com/typescript-eslint/typescript-eslint/issues/2023)) ([06869c9](https://github.com/typescript-eslint/typescript-eslint/commit/06869c9656fa37936126666845aee40aad546ebd)) +- bump minimum required TS version ([#2004](https://github.com/typescript-eslint/typescript-eslint/issues/2004)) ([7ad4d7c](https://github.com/typescript-eslint/typescript-eslint/commit/7ad4d7c2db088b6f779b9d883a4acad13eee3775)) +- upgrade to ESLint v7 ([#2022](https://github.com/typescript-eslint/typescript-eslint/issues/2022)) ([208de71](https://github.com/typescript-eslint/typescript-eslint/commit/208de71059746bf38e94bd460346ffb2698a3e12)) +- **eslint-plugin:** [ban-types] rework default options ([#848](https://github.com/typescript-eslint/typescript-eslint/issues/848)) ([8e31d5d](https://github.com/typescript-eslint/typescript-eslint/commit/8e31d5dbe9fe5227fdbefcecfd50ce5dd51360c3)) +- **eslint-plugin:** [no-unnecessary-condition] remove option `ignoreRHS` ([#1163](https://github.com/typescript-eslint/typescript-eslint/issues/1163)) ([ee8dd8f](https://github.com/typescript-eslint/typescript-eslint/commit/ee8dd8f8a9e6c25ac426ce9bb71c5f012c51f264)) +- **eslint-plugin:** [strict-boolean-expression] rework options ([#1631](https://github.com/typescript-eslint/typescript-eslint/issues/1631)) ([cd14482](https://github.com/typescript-eslint/typescript-eslint/commit/cd1448240dca11762fcb9c10e18bb6541a840485)) +- **eslint-plugin:** delete deprecated rules ([#2002](https://github.com/typescript-eslint/typescript-eslint/issues/2002)) ([da0aec2](https://github.com/typescript-eslint/typescript-eslint/commit/da0aec2cfa27902aae7c438a2fe91343c822e4ae)) +- **eslint-plugin:** eslint-recommended: disable no-func-assign ([#984](https://github.com/typescript-eslint/typescript-eslint/issues/984)) ([ae9b8a9](https://github.com/typescript-eslint/typescript-eslint/commit/ae9b8a9c73c0328287de956466257d8bbfbdb20f)) +- **eslint-plugin:** eslint-recommended: disable no-obj-calls ([#1000](https://github.com/typescript-eslint/typescript-eslint/issues/1000)) ([b9ca14c](https://github.com/typescript-eslint/typescript-eslint/commit/b9ca14c5f5ec28a3fde1a9b2d2f6a4dc74d903e4)) +- **eslint-plugin:** update `eslint-recommended` set ([#1996](https://github.com/typescript-eslint/typescript-eslint/issues/1996)) ([9a96e18](https://github.com/typescript-eslint/typescript-eslint/commit/9a96e18400e0a0d738d159d9d01faf41d3586249)) +- **eslint-plugin:** update recommended sets ([#2001](https://github.com/typescript-eslint/typescript-eslint/issues/2001)) ([0126b4f](https://github.com/typescript-eslint/typescript-eslint/commit/0126b4f56f9197d561e90b09962ccceb4f88bc41)) +- **typescript-estree:** align nodes with estree 2020 ([#1389](https://github.com/typescript-eslint/typescript-eslint/issues/1389)) ([aff5b62](https://github.com/typescript-eslint/typescript-eslint/commit/aff5b62044f9b93f2087a1d261e9be3f8d6fd54d)) +- **typescript-estree:** align optional fields ([#1429](https://github.com/typescript-eslint/typescript-eslint/issues/1429)) ([0e0010f](https://github.com/typescript-eslint/typescript-eslint/commit/0e0010f82952f9beeeb84136eea00cc5eecc9db6)) +- drop support for node v8 ([#1997](https://github.com/typescript-eslint/typescript-eslint/issues/1997)) ([b6c3b7b](https://github.com/typescript-eslint/typescript-eslint/commit/b6c3b7b84b8d199fa75a46432febd4a364a63217)) +- **typescript-estree:** always return parserServices ([#716](https://github.com/typescript-eslint/typescript-eslint/issues/716)) ([5b23443](https://github.com/typescript-eslint/typescript-eslint/commit/5b23443c48f3f62424db3e742243f3568080b946)) +- **typescript-estree:** handle 3.9's non-null assertion changes ([#2036](https://github.com/typescript-eslint/typescript-eslint/issues/2036)) ([06bec63](https://github.com/typescript-eslint/typescript-eslint/commit/06bec63c56536db070608ab136d2ad57083f0c6a)) +# [2.34.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.33.0...v2.34.0) (2020-05-18) ### Bug Fixes -* **eslint-plugin:** [naming-convention] handle empty array-pattern ([#1450](https://github.com/typescript-eslint/typescript-eslint/issues/1450)) ([4726605](https://github.com/typescript-eslint/typescript-eslint/commit/4726605)) -* **eslint-plugin:** [unbound-method] handling of logical expr ([#1440](https://github.com/typescript-eslint/typescript-eslint/issues/1440)) ([9c5b857](https://github.com/typescript-eslint/typescript-eslint/commit/9c5b857)) -* **eslint-plugin:** set default-param-last as an extension rule ([#1445](https://github.com/typescript-eslint/typescript-eslint/issues/1445)) ([b5ef704](https://github.com/typescript-eslint/typescript-eslint/commit/b5ef704)) -* **typescript-estree:** correct type of `ArrayPattern.elements` ([#1451](https://github.com/typescript-eslint/typescript-eslint/issues/1451)) ([62e4ca0](https://github.com/typescript-eslint/typescript-eslint/commit/62e4ca0)) - +- **typescript-estree:** fix handling of range/loc removal ([#2028](https://github.com/typescript-eslint/typescript-eslint/issues/2028)) ([ce344d9](https://github.com/typescript-eslint/typescript-eslint/commit/ce344d90e7c78b0c4b4b823494a3e78190f45c64)) ### Features -* **eslint-plugin:** [naming-convention] allow not check format ([#1455](https://github.com/typescript-eslint/typescript-eslint/issues/1455)) ([61eb434](https://github.com/typescript-eslint/typescript-eslint/commit/61eb434)) -* **eslint-plugin:** [naming-convention] correct example ([#1455](https://github.com/typescript-eslint/typescript-eslint/issues/1455)) ([60683d7](https://github.com/typescript-eslint/typescript-eslint/commit/60683d7)) -* **eslint-plugin:** [no-extra-!-assert] flag ?. after !-assert ([#1460](https://github.com/typescript-eslint/typescript-eslint/issues/1460)) ([58c7c25](https://github.com/typescript-eslint/typescript-eslint/commit/58c7c25)) -* **eslint-plugin:** add explicit-module-boundary-types rule ([#1020](https://github.com/typescript-eslint/typescript-eslint/issues/1020)) ([bb0a846](https://github.com/typescript-eslint/typescript-eslint/commit/bb0a846)) -* **eslint-plugin:** add no-non-null-asserted-optional-chain ([#1469](https://github.com/typescript-eslint/typescript-eslint/issues/1469)) ([498aa24](https://github.com/typescript-eslint/typescript-eslint/commit/498aa24)) -* **experimental-utils:** expose getParserServices from utils ([#1448](https://github.com/typescript-eslint/typescript-eslint/issues/1448)) ([982c8bc](https://github.com/typescript-eslint/typescript-eslint/commit/982c8bc)) +- **eslint-plugin:** [no-invalid-void-type] allow union of void and `allowInGenericTypeArguments` ([#1960](https://github.com/typescript-eslint/typescript-eslint/issues/1960)) ([1bc105a](https://github.com/typescript-eslint/typescript-eslint/commit/1bc105a2c6ae3fde9596f0419fed0de699dc57c7)) +- **eslint-plugin:** [restrict-template-expressions] improve error message ([#1926](https://github.com/typescript-eslint/typescript-eslint/issues/1926)) ([1af59ba](https://github.com/typescript-eslint/typescript-eslint/commit/1af59ba8ac0ceabb008d9c61556acf7db0a1d352)) +- **experimental-utils:** add `suggestion` property for rule modules ([#2033](https://github.com/typescript-eslint/typescript-eslint/issues/2033)) ([f42a5b0](https://github.com/typescript-eslint/typescript-eslint/commit/f42a5b09ebfa173f418a99c552b0cbe221567194)) +# [2.33.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.32.0...v2.33.0) (2020-05-12) +### Bug Fixes +- **experimental-utils:** remove accidental dep on json-schema ([#2010](https://github.com/typescript-eslint/typescript-eslint/issues/2010)) ([1875fba](https://github.com/typescript-eslint/typescript-eslint/commit/1875fbad41f2a3dda8f610f5dcd180c6205b73d3)) +### Features -# [2.16.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.15.0...v2.16.0) (2020-01-13) +- **eslint-plugin:** add extension rule `lines-between-class-members` ([#1684](https://github.com/typescript-eslint/typescript-eslint/issues/1684)) ([08f93e6](https://github.com/typescript-eslint/typescript-eslint/commit/08f93e69347a8e7f3a7e8a1455bb5d069c2faeef)) +# [2.32.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.31.0...v2.32.0) (2020-05-11) ### Bug Fixes -* **eslint-plugin:** [no-magic-numbers] handle UnaryExpression for enums ([#1415](https://github.com/typescript-eslint/typescript-eslint/issues/1415)) ([852fc31](https://github.com/typescript-eslint/typescript-eslint/commit/852fc31)) -* **eslint-plugin:** [no-unnec-type-assert] handle JSX attributes ([#1002](https://github.com/typescript-eslint/typescript-eslint/issues/1002)) ([3c5659b](https://github.com/typescript-eslint/typescript-eslint/commit/3c5659b)) -* **eslint-plugin:** handle error classes using generics ([#1428](https://github.com/typescript-eslint/typescript-eslint/issues/1428)) ([b139540](https://github.com/typescript-eslint/typescript-eslint/commit/b139540)) -* **typescript-estree:** fix persisted parse for relative paths ([#1424](https://github.com/typescript-eslint/typescript-eslint/issues/1424)) ([9720d2c](https://github.com/typescript-eslint/typescript-eslint/commit/9720d2c)) -* **typescript-estree:** parsing of deeply nested new files in new folder ([#1412](https://github.com/typescript-eslint/typescript-eslint/issues/1412)) ([206c94b](https://github.com/typescript-eslint/typescript-eslint/commit/206c94b)) -* **typescript-estree:** resolve path relative to tsconfigRootDir ([#1439](https://github.com/typescript-eslint/typescript-eslint/issues/1439)) ([c709056](https://github.com/typescript-eslint/typescript-eslint/commit/c709056)) - +- **eslint-plugin:** [no-base-to-string] support boolean in unions ([#1979](https://github.com/typescript-eslint/typescript-eslint/issues/1979)) ([6987ecc](https://github.com/typescript-eslint/typescript-eslint/commit/6987ecc1dacfb45c0f8ed3e81d08aa708eb96ad1)) +- **eslint-plugin:** [no-type-alias] handle readonly types in aliases ([#1990](https://github.com/typescript-eslint/typescript-eslint/issues/1990)) ([56d9870](https://github.com/typescript-eslint/typescript-eslint/commit/56d987070f83d1b6410b04750b20a761fd793073)) +- **eslint-plugin:** [no-unused-expressions] inherit `messages` from base rule ([#1992](https://github.com/typescript-eslint/typescript-eslint/issues/1992)) ([51ca404](https://github.com/typescript-eslint/typescript-eslint/commit/51ca404af645eed194269ab7f8f67b97bd52e32d)) ### Features -* **eslint-plugin:** [no-unnec-cond] array predicate callbacks ([#1206](https://github.com/typescript-eslint/typescript-eslint/issues/1206)) ([f7ad716](https://github.com/typescript-eslint/typescript-eslint/commit/f7ad716)) -* **eslint-plugin:** add default-param-last rule ([#1418](https://github.com/typescript-eslint/typescript-eslint/issues/1418)) ([a37ff9f](https://github.com/typescript-eslint/typescript-eslint/commit/a37ff9f)) -* **eslint-plugin:** add rule naming-conventions ([#1318](https://github.com/typescript-eslint/typescript-eslint/issues/1318)) ([9eab26f](https://github.com/typescript-eslint/typescript-eslint/commit/9eab26f)) -* **typescript-estree:** add parserOption to turn on debug logs ([#1413](https://github.com/typescript-eslint/typescript-eslint/issues/1413)) ([25092fd](https://github.com/typescript-eslint/typescript-eslint/commit/25092fd)) -* **typescript-estree:** add strict type mapping to esTreeNodeToTSNodeMap ([#1382](https://github.com/typescript-eslint/typescript-eslint/issues/1382)) ([d3d70a3](https://github.com/typescript-eslint/typescript-eslint/commit/d3d70a3)) +- bump dependencies and align AST ([#2007](https://github.com/typescript-eslint/typescript-eslint/issues/2007)) ([18668b7](https://github.com/typescript-eslint/typescript-eslint/commit/18668b78fd7d1e5281af7fc26c76e0ca53297f69)) +# [2.31.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.30.0...v2.31.0) (2020-05-04) +### Bug Fixes +- **eslint-plugin:** [dot-notation] handle missing declarations ([#1947](https://github.com/typescript-eslint/typescript-eslint/issues/1947)) ([383f931](https://github.com/typescript-eslint/typescript-eslint/commit/383f93182599c00e231a0f0d36575ca0e19369a6)) +- **eslint-plugin:** [method-signature-style] fix overloaded methods to an intersection type ([#1966](https://github.com/typescript-eslint/typescript-eslint/issues/1966)) ([7f3fba3](https://github.com/typescript-eslint/typescript-eslint/commit/7f3fba348d432d7637e1c737df943ee1f9105062)) +- **eslint-plugin:** [return-await] await in a normal function ([#1962](https://github.com/typescript-eslint/typescript-eslint/issues/1962)) ([f82fd7b](https://github.com/typescript-eslint/typescript-eslint/commit/f82fd7bb81f986c4861d0b4e2ecdb0c496d7a602)) +- **eslint-plugin:** [unbound-method] false positives for unary expressions ([#1964](https://github.com/typescript-eslint/typescript-eslint/issues/1964)) ([b35070e](https://github.com/typescript-eslint/typescript-eslint/commit/b35070ec6f84ad5ce606386cdb6eeb91488dfdd7)) +- **eslint-plugin:** no-base-to-string boolean expression detect ([#1969](https://github.com/typescript-eslint/typescript-eslint/issues/1969)) ([f78f13a](https://github.com/typescript-eslint/typescript-eslint/commit/f78f13aedd59d5b5880903d48c779a6c50fd937e)) +### Features -# [2.15.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.14.0...v2.15.0) (2020-01-06) +- **eslint-plugin:** [member-ordering] add decorators support ([#1870](https://github.com/typescript-eslint/typescript-eslint/issues/1870)) ([f7ec192](https://github.com/typescript-eslint/typescript-eslint/commit/f7ec1920607cb8eec8020b08cd7247de0bf19ce1)) +- **eslint-plugin:** [prefer-optional-chain] added option to convert to suggestion fixer ([#1965](https://github.com/typescript-eslint/typescript-eslint/issues/1965)) ([2f0824b](https://github.com/typescript-eslint/typescript-eslint/commit/2f0824b0a41f3043b6242fc1d49faae540abaf22)) +- **eslint-plugin:** new extended rule 'no-invalid-this' ([#1823](https://github.com/typescript-eslint/typescript-eslint/issues/1823)) ([b18bc35](https://github.com/typescript-eslint/typescript-eslint/commit/b18bc357507337b9725f8d9c1b549513075a0da5)) +- **eslint-plugin-internal:** add rule no-poorly-typed-ts-props ([#1949](https://github.com/typescript-eslint/typescript-eslint/issues/1949)) ([56ea7c9](https://github.com/typescript-eslint/typescript-eslint/commit/56ea7c9581c0c99fe394bbcfc4128e8054c88ab2)) +- **experimental-utils:** expose our RuleTester extension ([#1948](https://github.com/typescript-eslint/typescript-eslint/issues/1948)) ([2dd1638](https://github.com/typescript-eslint/typescript-eslint/commit/2dd1638aaa2658ba99b2341861146b586f489121)) +# [2.30.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.29.0...v2.30.0) (2020-04-27) ### Bug Fixes -* **eslint-plugin:** crash in no-unnecessary-type-arguments ([#1401](https://github.com/typescript-eslint/typescript-eslint/issues/1401)) ([01c939f](https://github.com/typescript-eslint/typescript-eslint/commit/01c939f)) -* **typescript-estree:** correct persisted parse for windows ([#1406](https://github.com/typescript-eslint/typescript-eslint/issues/1406)) ([1a42f3d](https://github.com/typescript-eslint/typescript-eslint/commit/1a42f3d)) - +- **eslint-plugin:** [prefer-string-starts-ends-with] check for negative start index in slice ([#1920](https://github.com/typescript-eslint/typescript-eslint/issues/1920)) ([ed2bd60](https://github.com/typescript-eslint/typescript-eslint/commit/ed2bd6067f74ae33e36a084719bb91efedfba599)) +- **eslint-plugin:** fix no-base-to-string boolean literal check ([#1850](https://github.com/typescript-eslint/typescript-eslint/issues/1850)) ([2f45e99](https://github.com/typescript-eslint/typescript-eslint/commit/2f45e9992a8f12b6233716e77a6159f9cea2c879)) ### Features -* **eslint-plugin:** [strict-bool-expr] add allowSafe option ([#1385](https://github.com/typescript-eslint/typescript-eslint/issues/1385)) ([9344233](https://github.com/typescript-eslint/typescript-eslint/commit/9344233)) -* **eslint-plugin:** add no-implied-eval ([#1375](https://github.com/typescript-eslint/typescript-eslint/issues/1375)) ([254d276](https://github.com/typescript-eslint/typescript-eslint/commit/254d276)) +- **eslint-plugin:** add extension rule `dot-notation` ([#1867](https://github.com/typescript-eslint/typescript-eslint/issues/1867)) ([a85c3e1](https://github.com/typescript-eslint/typescript-eslint/commit/a85c3e1515d735b6c245cc658cdaec6deb05d630)) +- **eslint-plugin:** create `no-invalid-void-type` rule ([#1847](https://github.com/typescript-eslint/typescript-eslint/issues/1847)) ([f667ff1](https://github.com/typescript-eslint/typescript-eslint/commit/f667ff1708d4ed28b7ea5beea742889da69a76d9)) +- **experimental-utils:** allow rule options to be a readonly tuple ([#1924](https://github.com/typescript-eslint/typescript-eslint/issues/1924)) ([4ef6788](https://github.com/typescript-eslint/typescript-eslint/commit/4ef67884962b6aac61cc895aaa3ba16aa892ecf4)) +# [2.29.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.28.0...v2.29.0) (2020-04-20) +### Bug Fixes +- **eslint-plugin:** [no-base-to-string] soft remove `ignoreTaggedTemplateExpressions` option ([#1916](https://github.com/typescript-eslint/typescript-eslint/issues/1916)) ([369978e](https://github.com/typescript-eslint/typescript-eslint/commit/369978e9685bacb3e3882b0510ff06eaf8df4ca1)) +### Features -# [2.14.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.13.0...v2.14.0) (2019-12-30) +- **eslint-plugin:** [no-floating-promise] add option to ignore IIFEs ([#1799](https://github.com/typescript-eslint/typescript-eslint/issues/1799)) ([cea51bf](https://github.com/typescript-eslint/typescript-eslint/commit/cea51bf130d6d3c2935f5e2dcc468196f2ad9d00)) +- **eslint-plugin:** [restrict-template-expressions] add support for intersection types ([#1803](https://github.com/typescript-eslint/typescript-eslint/issues/1803)) ([cc70e4f](https://github.com/typescript-eslint/typescript-eslint/commit/cc70e4fbadd0b15fd6af913a2e1e2ddd346fa558)) +- **eslint-plugin:** add extension rule `init-declarations` ([#1814](https://github.com/typescript-eslint/typescript-eslint/issues/1814)) ([b01f5e7](https://github.com/typescript-eslint/typescript-eslint/commit/b01f5e778ac28e0797a3734fc58d025bb224f418)) +- **eslint-plugin:** add extension rule `keyword-spacing` ([#1739](https://github.com/typescript-eslint/typescript-eslint/issues/1739)) ([c5106dd](https://github.com/typescript-eslint/typescript-eslint/commit/c5106dd4bf2bc8846cc39aa8bb50c33bec026d4d)) +# [2.28.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.27.0...v2.28.0) (2020-04-13) ### Bug Fixes -* **eslint-plugin:** type assertion in rule no-extra-parens ([#1376](https://github.com/typescript-eslint/typescript-eslint/issues/1376)) ([f40639e](https://github.com/typescript-eslint/typescript-eslint/commit/f40639e)) -* **typescript-estree:** visit typeParameters in OptionalCallExpr ([#1377](https://github.com/typescript-eslint/typescript-eslint/issues/1377)) ([cba6a2a](https://github.com/typescript-eslint/typescript-eslint/commit/cba6a2a)) - +- **eslint-plugin:** [method-signature-style] handle multiline params ([#1861](https://github.com/typescript-eslint/typescript-eslint/issues/1861)) ([5832a86](https://github.com/typescript-eslint/typescript-eslint/commit/5832a8643bbe174ec02df5966bb333e506e45f5d)) +- **eslint-plugin:** [no-empty-interface] use suggestion fixer for ambient contexts ([#1880](https://github.com/typescript-eslint/typescript-eslint/issues/1880)) ([62b2278](https://github.com/typescript-eslint/typescript-eslint/commit/62b2278aec0011c93eae17bed8b278114d3379a2)) +- **eslint-plugin:** [unbound-method] false positive on property function initializer ([#1890](https://github.com/typescript-eslint/typescript-eslint/issues/1890)) ([f1c3b18](https://github.com/typescript-eslint/typescript-eslint/commit/f1c3b18f7aadc81f7dca7aa32aa1a8fe424e04e7)) +- **eslint-plugin:** [unbound-method] ignore assignments _to_ methods ([#1736](https://github.com/typescript-eslint/typescript-eslint/issues/1736)) ([6b4680b](https://github.com/typescript-eslint/typescript-eslint/commit/6b4680b6e7343d9d98fa1de170f387a36d98b73e)) +- **eslint-plugin:** no-empty-interface autofix ([#1865](https://github.com/typescript-eslint/typescript-eslint/issues/1865)) ([829a2f7](https://github.com/typescript-eslint/typescript-eslint/commit/829a2f728f876d356908e2338c2d6620e58f9943)), closes [#1864](https://github.com/typescript-eslint/typescript-eslint/issues/1864) +- **eslint-plugin:** use `isTypeArrayTypeOrUnionOfArrayTypes` util for checking if type is array ([#1728](https://github.com/typescript-eslint/typescript-eslint/issues/1728)) ([05030f8](https://github.com/typescript-eslint/typescript-eslint/commit/05030f8d2bd5a50e95053bc61380891da71cc567)) ### Features -* add internal eslint plugin for repo-specific lint rules ([#1373](https://github.com/typescript-eslint/typescript-eslint/issues/1373)) ([3a15413](https://github.com/typescript-eslint/typescript-eslint/commit/3a15413)) +- **eslint-plugin:** [ban-ts-comment] support `ts-expect-error` ([#1706](https://github.com/typescript-eslint/typescript-eslint/issues/1706)) ([469cff3](https://github.com/typescript-eslint/typescript-eslint/commit/469cff332c041f38f60de052769287342455cff1)) +- **eslint-plugin:** [consistent-type-assertions] always allow `const` assertions ([#1713](https://github.com/typescript-eslint/typescript-eslint/issues/1713)) ([af2c00d](https://github.com/typescript-eslint/typescript-eslint/commit/af2c00de62f7e31eaeb88996ebf3f330cc8473b9)) +- **eslint-plugin:** [explicit-function-return-type] add option to allow concise arrows that start with void ([#1732](https://github.com/typescript-eslint/typescript-eslint/issues/1732)) ([2e9c202](https://github.com/typescript-eslint/typescript-eslint/commit/2e9c2028a8a0b226e0f87d4bcc997fa259ca3ebd)) +- **eslint-plugin:** [explicit-module-boundary-types] add optio… ([#1778](https://github.com/typescript-eslint/typescript-eslint/issues/1778)) ([3eee804](https://github.com/typescript-eslint/typescript-eslint/commit/3eee804461d017ea6189cd7f64fcd473623684b4)) +- **eslint-plugin:** [no-base-to-string] add option to ignore tagged templates ([#1763](https://github.com/typescript-eslint/typescript-eslint/issues/1763)) ([f5edb99](https://github.com/typescript-eslint/typescript-eslint/commit/f5edb9938c33f8b68f026eba00db3abe9359ced3)) +- **eslint-plugin:** [restrict-template-expressions] add option `allowAny` ([#1762](https://github.com/typescript-eslint/typescript-eslint/issues/1762)) ([d44c0f9](https://github.com/typescript-eslint/typescript-eslint/commit/d44c0f9bed2404ca00b020b35fd825929e213398)) +- **eslint-plugin:** add rule `prefer-reduce-type-parameter` ([#1707](https://github.com/typescript-eslint/typescript-eslint/issues/1707)) ([c92d240](https://github.com/typescript-eslint/typescript-eslint/commit/c92d240e49113779053eac32038382b282812afc)) +- **eslint-plugin:** add rule `prefer-ts-expect-error` ([#1705](https://github.com/typescript-eslint/typescript-eslint/issues/1705)) ([7021f21](https://github.com/typescript-eslint/typescript-eslint/commit/7021f2151a25db2a8edf17e06cd6f21e90761ec8)) +- **eslint-plugin:** add rule no-unsafe-assignment ([#1694](https://github.com/typescript-eslint/typescript-eslint/issues/1694)) ([a49b860](https://github.com/typescript-eslint/typescript-eslint/commit/a49b860cbbb2c7d718b99f561e2fb6eaadf16f17)) +# [2.27.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.26.0...v2.27.0) (2020-04-06) +### Bug Fixes +- **eslint-plugin:** [no-throw-literal] fix crash caused by getBaseTypes ([#1830](https://github.com/typescript-eslint/typescript-eslint/issues/1830)) ([9d53c76](https://github.com/typescript-eslint/typescript-eslint/commit/9d53c761983dd964109b9f13eb9bfe20caf9defb)) +- **eslint-plugin:** [no-unsafe-call] fix incorrect selector ([#1826](https://github.com/typescript-eslint/typescript-eslint/issues/1826)) ([8ec53a3](https://github.com/typescript-eslint/typescript-eslint/commit/8ec53a3579fcb59cdffea0c60fbb755d056f4c8a)) +- **eslint-plugin:** [require-await] handle async generators ([#1782](https://github.com/typescript-eslint/typescript-eslint/issues/1782)) ([9642d9d](https://github.com/typescript-eslint/typescript-eslint/commit/9642d9dce693befac89a4e9d8bf8dd18f4361e2a)) +- **eslint-plugin:** no-explicit-any constructor functions (& mo… ([#1711](https://github.com/typescript-eslint/typescript-eslint/issues/1711)) ([ab8572e](https://github.com/typescript-eslint/typescript-eslint/commit/ab8572e30e14ebda91c8437be5ee35e7dc9add2e)) +- **typescript-estree:** add support for TS3.9 extra file extensions ([#1833](https://github.com/typescript-eslint/typescript-eslint/issues/1833)) ([1f0ff41](https://github.com/typescript-eslint/typescript-eslint/commit/1f0ff41aa1bc3b7c5330b2f5fe22e24bf578a6b2)) +### Features -# [2.13.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.12.0...v2.13.0) (2019-12-23) +- **eslint-plugin:** new rule method-signature-style ([#1685](https://github.com/typescript-eslint/typescript-eslint/issues/1685)) ([c49d771](https://github.com/typescript-eslint/typescript-eslint/commit/c49d771ba62f1a21d3c1aec106341daddfcd3c9a)) +- **eslint-plugin:** sort members alphabetically ([#263](https://github.com/typescript-eslint/typescript-eslint/issues/263)) ([485e902](https://github.com/typescript-eslint/typescript-eslint/commit/485e90213a0f8baac0587f7d56925448883fc5bd)) +- **eslint-plugin-internal:** add plugin-test-formatting rule ([#1821](https://github.com/typescript-eslint/typescript-eslint/issues/1821)) ([9b0023a](https://github.com/typescript-eslint/typescript-eslint/commit/9b0023a4996ecdd7dfcb30abd1678091a78f3064)) +- **experimental-utils:** add types for suggestions from CLIEngine ([#1844](https://github.com/typescript-eslint/typescript-eslint/issues/1844)) ([7c11bd6](https://github.com/typescript-eslint/typescript-eslint/commit/7c11bd66f2d0e5ea9d3943e6b8c66e6ddff50862)) +- **experimental-utils:** update eslint types to match v6.8 ([#1846](https://github.com/typescript-eslint/typescript-eslint/issues/1846)) ([16ce74d](https://github.com/typescript-eslint/typescript-eslint/commit/16ce74d247781ac890dc0baa30c384f97e581b6b)) +# [2.26.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.25.0...v2.26.0) (2020-03-30) ### Bug Fixes -* **eslint-plugin:** [quotes] ignore backticks for Enum members ([#1355](https://github.com/typescript-eslint/typescript-eslint/issues/1355)) ([e51048c](https://github.com/typescript-eslint/typescript-eslint/commit/e51048c)) -* **eslint-plugin:** [type-annotation-spacing] typo in messages ([#1354](https://github.com/typescript-eslint/typescript-eslint/issues/1354)) ([82e0dbc](https://github.com/typescript-eslint/typescript-eslint/commit/82e0dbc)) -* **eslint-plugin:** add isTypeAssertion utility function ([#1369](https://github.com/typescript-eslint/typescript-eslint/issues/1369)) ([bb1671e](https://github.com/typescript-eslint/typescript-eslint/commit/bb1671e)) -* **eslint-plugin:** use AST_NODE_TYPES enum instead of strings ([#1366](https://github.com/typescript-eslint/typescript-eslint/issues/1366)) ([bd0276b](https://github.com/typescript-eslint/typescript-eslint/commit/bd0276b)) -* **typescript-estree:** correct type of key for base nodes ([#1367](https://github.com/typescript-eslint/typescript-eslint/issues/1367)) ([099225a](https://github.com/typescript-eslint/typescript-eslint/commit/099225a)) - +- **eslint-plugin:** [no-explicit-any] error with ignoreRestArgs ([#1796](https://github.com/typescript-eslint/typescript-eslint/issues/1796)) ([638d84d](https://github.com/typescript-eslint/typescript-eslint/commit/638d84ddd77d07117b3ec7c5431f3b0e44b1995d)) +- **eslint-plugin:** [no-unsafe-call] allow import expressions ([#1800](https://github.com/typescript-eslint/typescript-eslint/issues/1800)) ([4fa7107](https://github.com/typescript-eslint/typescript-eslint/commit/4fa710754ecc412b65ac3864fe0c7857c254ac1b)) +- **eslint-plugin:** [no-unsafe-return] error with With the exception of extremely minor documentation typos, **only send pull requests that resolve open issues**. - -Anyone is free to help us build and maintain this project. If you see an issue that needs working on because it's important to you, comment on the issue to help make sure that nobody else works on it at the same time, and then start working. - -Developing in this repo is easy: - -- First fork the repo, and then clone it locally. -- Create a new branch. -- In the root of the project, run `yarn install`. - - This will install the dependencies, link the packages and do a build. -- Make the required changes. - -### Validating Your Changes - -We have a sophisticated CI process setup which gets run on every PR. You must pass all of the checks for us to consider merging your PR. Here is a list of checks that are done automatically, that you can also perform locally before pushing. - -- Ensure your code is properly formatted. - - You can run `yarn format` in any package or in the root. - - Alternatively, you can run prettier on save. -- Ensure there are no typechecking errors. - - You can run `yarn typecheck` in any package or in the root. -- Ensure your changes are adequately tested. - - You can run `yarn test` in any package. - - [VS Code launch tasks](https://code.visualstudio.com/docs/editor/tasks) tasks are provided that allow [visual debugging](https://code.visualstudio.com/docs/editor/debugging) tests - - We aim for around `90%` branch coverage for every PR. - - Coverage reports should automatically be generated locally, and the `codecov` bot should also comment on your PR with the percentage, as well as links to the line-by-line coverage of each file touched by your PR. -- Ensure you have no lint errors. - - You can run `yarn lint` in any package or in the root. - - You can run `yarn lint-markdown` in the root. -- If you have made changes to any markdown documentation, ensure there are no spelling errors - - You can run `yarn check-spelling` in the root. - - Or if you are using vscode, you can use [`Code Spell Checker`](https://marketplace.visualstudio.com/items?itemName=streetsidesoftware.code-spell-checker) plugin. -- If you have made changes within the `eslint-plugin` package, ensure the configs and documentation are valid. - - You can run `yarn check-configs` and `yarn check-docs` in the root, or in the `eslint-plugin` folder. - -### Raising a PR - -Once your changes are ready, you can raise a PR. The title of your PR should match the following format: - -```text -(): -``` - -Where `` is one of: - -- `feat` - for any new functionality additions -- `fix` - for any bug fixes that don't add new functionality -- `test` - if you only change tests, and not shipped code -- `docs` - if you only change documentation, and not shipped code -- `chore` - anything else - -And `` is the name of the package you have made changes within (`eslint-plugin`, `parser`, `typescript-estree`, etc). If you make significant changes across multiple packages, you can omit this (i.e. `feat: foo bar`). - -And `` is a succinct title for the PR. - -Within the body of your PR, make sure you reference the issue that you have worked on, as well as pointing out anything of note you wish us to look at during our review. - -Make sure you use the "Fixes #xxx" format to reference issues, so that GitHub automatically closes the issues when we merge the PR. Also note that if you are fixing multiple issues at once, you can only reference one issue per line, and must put one "Fixes #xxx" per issue number. - -In terms of your commit history - we do not care about the number, or style of commits in your history, because we squash merge every PR into `main`. Feel free to commit in whatever style you feel comfortable with. - -**_One thing we ask is to please avoid force pushing after you have raised a PR_**. GitHub is not able to track changes across force pushes, which makes it impossible to efficiently do incremental reviews. This slows us down, and means it will take longer for us to get your PR merged. - -### Addressing Feedback and Beyond - -With your PR raised, and the CI showing green, your PR will [sit in the queue to be reviewed](https://github.com/typescript-eslint/typescript-eslint/pulls?q=is%3Apr+is%3Aopen+sort%3Acreated-asc+-label%3A%22breaking+change%22+-label%3A%22awaiting+response%22+-label%3A%221+approval%22+-label%3A%22DO+NOT+MERGE%22). We generally review PRs oldest to newest, unless we consider a newer PR higher priority (i.e. if it's a bug fix). - -Please note that as this project is maintained by volunteers, it may take a while for us to get around to your PR (sometimes a month or more). Be patient, we'll get to it. Please refrain from commenting asking for a review, or similar bump comments. **_These just create spam for maintainers, and does not push your PR higher in the queue_**. - -Once we have reviewed your PR, we will provide any feedback that needs addressing. If you feel a requested change is wrong, don't be afraid to discuss with us in the comments. Once the feedback is addressed, and the PR is reviewed, we'll ensure the branch is up to date with `main`, and merge it for you. +See **https://typescript-eslint.io/contributing** for our contributing guidelines. +Thanks! 💖 diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index e4c447067d3..53748bda265 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -10,83 +10,53 @@ Thanks goes to these wonderful people:
Brad Zacher

Armano

Josh Goldberg
-
Oleksandr T.
+
Michaël De Boey
-
Michaël De Boey

Reyad Attiyat
+
Sosuke Suzuki

Gareth Jones

Patricio Trevino
-
Sosuke Suzuki
+
Joshua Chen
+
YeonJuan

Nicholas C. Zakas

Jed Fox
-
Joshua Chen
-
YeonJuan
-
Rafael Santana
+
Ben Lichtman
+
Nikita
-
Ben Lichtman

Taeheon Kim
-
Nikita

Scott O'Hara

Retsam
- -
Kai Cataldo

Rasmus Eneman
-
Rebecca Stevens
-
Toru Nagashima
-
Yosuke Ota
+
Toru Nagashima
+
Yosuke Ota

JounQin

Lucas Azzola
-
Danny Fritz
-
Ika
-
mackie
+
Simen Bekkhus
-
Simen Bekkhus
-
Kanitkorn Sujautra
+
Danny Fritz
+
Omri Luzon

cherryblossom
-
Daniil Dubrava
-
Anix
+
Mackie Underdown
+
Bryan Mishkin
-
Pete Gonzalez
-
ldrick
-
Susisu
-
G r e y
+
Kanitkorn Sujautra
+
Sviatoslav Zaytsev

Zzzen
+
Anix
+
Pete Gonzalez
-
Gavin Barron
-
Kevin Partington
-
Lucas Duailibe
-
Validark
-
Pavel Birukov
- - -
Shahar Dawn Or
-
islandryu
-
koooge
-
thomas michael wallace
-
ulrichb
- - -
Daniel Cassidy
-
Daniel Nixon
-
Denys Kniazevych
-
Dimitri Mitropoulos
-
Ian MacLeod
- - -
James Garbutt
-
zz
-
Bence Dányi
-
Eric Wang
+
ldrick
+
SHIMA RYUHEI
diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md new file mode 100644 index 00000000000..40ba0362273 --- /dev/null +++ b/DEVELOPMENT.md @@ -0,0 +1,4 @@ +# Development + +See **https://typescript-eslint.io/contributing/local-development** for our development instructions. +Thanks! 💖 diff --git a/LICENSE b/LICENSE index 82e1ce3c460..61fed567687 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -TypeScript ESLint +typescript-eslint Originally extracted from: @@ -8,11 +8,11 @@ Copyright JS Foundation and other contributors, https://js.foundation Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. +- Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE diff --git a/README.md b/README.md index 3c9cbc2a68d..5241dbda4a2 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -

TypeScript ESLint

+

typescript-eslint

-

Monorepo for all the tooling which enables ESLint to support TypeScript

+

Monorepo for the tooling that enables ESLint and Prettier to support TypeScript

CI @@ -9,99 +9,26 @@ Codecov

+

👇

- - See typescript-eslint.io for documentation. + See typescript-eslint.io for documentation on the latest released version. +

+

+ + See main--typescript-eslint.netlify.app for documentation on the latest canary release. +

👆

- -## Packages included in this project - -See https://typescript-eslint.io/docs/development/architecture/packages for more details. - -- [`@typescript-eslint/eslint-plugin`](./packages/eslint-plugin) -- [`@typescript-eslint/parser`](./packages/parser) -- [`@typescript-eslint/eslint-plugin-tslint`](./packages/eslint-plugin-tslint) -- [`@typescript-eslint/utils`](./packages/utils) -- [`@typescript-eslint/typescript-estree`](./packages/typescript-estree) -- [`@typescript-eslint/scope-manager`](./packages/scope-manager) - -## Versioning - -All of the packages are published with the same version number to make it easier to coordinate both releases and installations. - -We publish a canary release on every successful merge to `main`, so **you never need to wait for a new stable version to make use of any updates**. - -Additionally, we promote to the `latest` tag on NPM once per week, **on Mondays at 1 pm Eastern**. - -The latest version under the `latest` tag is: - -NPM Version - -The latest version under the `canary` tag **(latest commit to `main`)** is: - -NPM Version - -(Note: The only exception to the automated publishes described above is when we are in the final phases of creating the next major version of the libraries - e.g. going from `1.x.x` to `2.x.x`. During these periods, we manually publish `canary` releases until we are happy with the release and promote it to `latest`.) - -### Supported TypeScript Version - -**The version range of TypeScript currently supported by this parser is `>=3.3.1 <4.8.0`.** - -These versions are what we test against. - -We will always endeavor to support the latest stable version of TypeScript. -Sometimes, but not always, changes in TypeScript will not require breaking changes in this project, and so we are able to support more than one version of TypeScript. -In some cases, we may even be able to support additional pre-releases (i.e. betas and release candidates) of TypeScript, but only if doing so does not require us to compromise on support for the latest stable version. - -Note that our packages have an open `peerDependency` requirement in order to allow for experimentation on newer/beta versions of TypeScript. - -If you use a non-supported version of TypeScript, the parser will log a warning to the console. -If you want to disable this warning, you can configure this in your `parserOptions`. See: [`@typescript-eslint/parser`](./packages/parser/) and [`@typescript-eslint/typescript-estree`](./packages/typescript-estree/). - -**Please ensure that you are using a supported version before submitting any issues/bug reports.** - -### Supported ESLint Version - -See the value of `eslint` declared in `@typescript-eslint/eslint-plugin`'s [package.json](./packages/eslint-plugin/package.json). - -### Supported Node Version - -This project makes an effort to support Active LTS and Maintenance LTS release statuses of Node according to [Node's release document](https://nodejs.org/en/about/releases). -Support for specific Current status releases are considered periodically. - -## License - -TypeScript ESLint inherits from the original TypeScript ESLint Parser license, as the majority of the work began there. It is licensed under a permissive BSD 2-clause license. - -## How can I help? - -I'm so glad you asked! - -Although typescript-eslint's packages are already downloaded millions of times per month and power high profile projects across our industry, this is a 100% community-driven project. -From the second you install one of the packages from this monorepo, you are a part of that community. - -**See an issue?** -Report it in as much detail as possible, ideally with a clear and minimal reproduction. - -If you have the time and the inclination, you can even take it a step further and submit a PR to improve the project. - -There are also financial ways to contribute, please see [Financial Contributors](#Financial-Contributors) for more details. - -All positive contributions are welcome here! - -> **[See the contributing guide here](./CONTRIBUTING.md)**. - -Please be respectful and mindful of how many hours of unpaid work go into typescript-eslint. + ## Code Contributors -This project exists thanks to every one of the awesome people who contribute code and documentation: +This project exists thanks to the awesome people who contribute code and documentation: Gallery of all contributors' profile photos @@ -111,25 +38,10 @@ This project exists thanks to every one of the awesome people who contribute cod In addition to submitting code and documentation updates, you can help us sustain our community by becoming a financial contributor [[Click here to contribute - every little bit helps!](https://opencollective.com/typescript-eslint/contribute)] -### Individuals - -Gallery of all individual financial contributors' profile photos - -### Organizations - -Support this project with your organization. Your logo will show up here with a link to your website. [[Click here to contribute - every little bit helps!](https://opencollective.com/typescript-eslint/contribute)] - - - - - - - - - - - - Deploys by Netlify + +## License + +typescript-eslint inherits from the original TypeScript ESLint Parser license, as the majority of the work began there. It is licensed under a permissive BSD 2-clause license. diff --git a/_redirects b/_redirects deleted file mode 100644 index 1b61a020ea0..00000000000 --- a/_redirects +++ /dev/null @@ -1,4 +0,0 @@ -/docs/linting /docs -/docs/linting/type-linting /docs/linting/typed-linting -/docs/linting/monorepo /docs/linting/typed-linting/monorepos -/docs/linting/tslint /docs/linting/troubleshooting/tslint diff --git a/docs/Architecture.mdx b/docs/Architecture.mdx new file mode 100644 index 00000000000..ee224c1e90a --- /dev/null +++ b/docs/Architecture.mdx @@ -0,0 +1,17 @@ +--- +id: architecture +title: Architecture +--- + +The `@typescript-eslint/*` packages are built from a monorepo located at https://github.com/typescript-eslint/typescript-eslint. +The monorepo is built with [Lerna](https://lerna.js.org) and [Nx](https://nx.dev). + +Each page in this section corresponds to a package we intentionally expose to users. +They are: + +- [`@typescript-eslint/eslint-plugin`](./architecture/ESLint_Plugin.mdx): An ESLint plugin which provides lint rules for TypeScript codebases. +- [`@typescript-eslint/eslint-plugin-tslint`](./architecture/ESLint_Plugin_TSLint.mdx): ESLint plugin that allows running TSLint rules within ESLint to help you migrate from TSLint to ESLint. +- [`@typescript-eslint/parser`](./architecture/Parser.mdx): An ESLint parser which allows for ESLint to lint TypeScript source code. +- [`@typescript-eslint/scope-manager`](./architecture/Scope_Manager.mdx): A fork of [`eslint-scope`](https://github.com/eslint/eslint-scope), enhanced to support TypeScript functionality. +- [`@typescript-eslint/typescript-estree`](./architecture/TypeScript-ESTree.mdx): The underlying code used by [`@typescript-eslint/parser`](./architecture/Parser.mdx) that converts TypeScript source code into an ESTree-compatible form. +- [`@typescript-eslint/utils`](./architecture/Utils.mdx): Utilities for working with TypeScript + ESLint together. diff --git a/docs/Contributing.mdx b/docs/Contributing.mdx new file mode 100644 index 00000000000..852e503c269 --- /dev/null +++ b/docs/Contributing.mdx @@ -0,0 +1,15 @@ +--- +id: contributing +title: Contributing +--- + +Thank you for your interest in contributing to typescript-eslint! 💜 + +Although typescript-eslint's packages are already downloaded millions of times per month and power high profile projects across our industry, this is a 100% community-driven project. +From the second you install one of the packages from this monorepo, you are a part of that community. +So, from the bottom of our hearts, _thank you_ 💕. + +## Getting Started + +Please read our [Code of Conduct](https://github.com/typescript-eslint/typescript-eslint/blob/main/CODE_OF_CONDUCT.md) first. +If you're new to open source, you may also find the [How to Contribute to Open Source](https://opensource.guide/how-to-contribute) guide from https://opensource.guide useful. diff --git a/docs/development/CUSTOM_RULES.md b/docs/Custom_Rules.mdx similarity index 95% rename from docs/development/CUSTOM_RULES.md rename to docs/Custom_Rules.mdx index 345e42c289e..0590398b818 100644 --- a/docs/development/CUSTOM_RULES.md +++ b/docs/Custom_Rules.mdx @@ -5,7 +5,8 @@ title: Custom Rules --- :::important -You should be familiar with [ESLint's developer guide](https://eslint.org/docs/developer-guide) and [Development > Architecture](./architecture/asts) before writing custom rules. +This page describes how to write your own custom ESLint rules using typescript-eslint. +You should be familiar with [ESLint's developer guide](https://eslint.org/docs/developer-guide) and [ASTs](https://typescript-eslint.io/blog/asts-and-typescript-eslint) before writing custom rules. ::: As long as you are using `@typescript-eslint/parser` as the `parser` in your ESLint configuration, custom ESLint rules generally work the same way for JavaScript and TypeScript code. @@ -17,7 +18,7 @@ The main three changes to custom rules writing are: ## Utils Package -The `@typescript-eslint/utils` package acts as a replacement package for `eslint` that exports all the same objects and types, but with typescript-eslint support. +The [`@typescript-eslint/utils`](./architecture/Utils.mdx) package acts as a replacement package for `eslint` that exports all the same objects and types, but with typescript-eslint support. It also exports common utility functions and constants most custom typescript-eslint rules tend to use. :::caution @@ -226,7 +227,7 @@ import { ESLintUtils } from '@typescript-eslint/utils'; import * as ts from 'typescript'; import * as tsutils from 'tsutils'; -export const rule: eslint.Rule.RuleModule = { +export const rule = createRule({ create(context) { return { ForOfStatement(node) { @@ -252,8 +253,8 @@ export const rule: eslint.Rule.RuleModule = { }, meta: { docs: { - category: 'Best Practices', description: 'Avoid looping over enums.', + recommended: 'error', }, messages: { loopOverEnum: 'Do not loop over enums.', @@ -261,7 +262,9 @@ export const rule: eslint.Rule.RuleModule = { type: 'suggestion', schema: [], }, -}; + name: 'no-loop-over-enum', + defaultOptions: [], +}); ``` ## Testing diff --git a/docs/README.md b/docs/Getting_Started.mdx similarity index 79% rename from docs/README.md rename to docs/Getting_Started.mdx index 23cbcd84ffa..cdaf39899a9 100644 --- a/docs/README.md +++ b/docs/Getting_Started.mdx @@ -1,7 +1,6 @@ --- id: getting-started title: Getting Started -slug: / --- ## Quickstart @@ -10,7 +9,7 @@ These steps will get you running ESLint with our recommended rules on your TypeS ### Step 1: Installation -First, install the required packages for [ESLint](https://eslint.io), [TypeScript](https://typescriptlang.org), and this plugin: +First, install the required packages for [ESLint](https://eslint.org), [TypeScript](https://typescriptlang.org), and this plugin: ```bash npm2yarn npm install --save-dev @typescript-eslint/parser @typescript-eslint/eslint-plugin eslint typescript @@ -64,16 +63,16 @@ ESLint will lint all TypeScript compatible files within the current folder, and ### Configuration Values -- `parser: '@typescript-eslint/parser'` tells ESLint to use the [`@typescript-eslint/parser`](https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/parser) package you installed to parse your source files. +- `parser: '@typescript-eslint/parser'` tells ESLint to use the [`@typescript-eslint/parser`](./architecture/Parser.mdx) package you installed to parse your source files. - This is required, or else ESLint will throw errors as it tries to parse TypeScript code as if it were regular JavaScript. -- `plugins: ['@typescript-eslint']` tells ESLint to load the [`@typescript-eslint/eslint-plugin`](https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/eslint-plugin) package as a plugin. +- `plugins: ['@typescript-eslint']` tells ESLint to load the [`@typescript-eslint/eslint-plugin`](./architecture/ESLint_Plugin.mdx) package as a plugin. - This allows you to use typescript-eslint's rules within your codebase. - `extends: [ ... ]` tells ESLint that your config extends the given configurations. - `eslint:recommended` is ESLint's inbuilt "recommended" config - it turns on a small, sensible set of rules which lint for well-known best-practices. - - `plugin:@typescript-eslint/recommended` is our "recommended" config - it's just like `eslint:recommended`, except it only turns on rules from our TypeScript-specific plugin. + - `plugin:@typescript-eslint/recommended` is our "recommended" config - it's similar to `eslint:recommended`, except it turns on TypeScript-specific rules from our plugin. ## Next Steps -We provide a plethora of powerful rules that utilize the power of TypeScript's type information. [Visit the next page for a setup guide](./linting/TYPED_LINTING.md 'Visit the next page for a typed rules setup guide'). +We provide a plethora of powerful rules that utilize the power of TypeScript's type information. [Visit the next page for a setup guide](./linting/Typed_Linting.mdx 'Visit the next page for a typed rules setup guide'). -If you're having problems getting this working, please have a look at our [Troubleshooting & FAQs](./linting/TROUBLESHOOTING.md). +If you're having problems getting this working, please have a look at our [Troubleshooting & FAQs](./linting/Troubleshooting.mdx). diff --git a/docs/Maintenance.mdx b/docs/Maintenance.mdx new file mode 100644 index 00000000000..75f1030c015 --- /dev/null +++ b/docs/Maintenance.mdx @@ -0,0 +1,12 @@ +--- +id: maintenance +sidebar_label: Maintenance Guide +title: Maintenance Guide +--- + +This is the maintainers guide to working on typescript-eslint. +It's intended for use by contributors who have been given access to at least triage issues and pull requests. +We keep it in the open for visibility into our processes. + +> If you're reading this as a new maintainer: welcome! +> We're happy to have you! ❤️‍🔥 diff --git a/docs/architecture/ESLint_Plugin.mdx b/docs/architecture/ESLint_Plugin.mdx new file mode 100644 index 00000000000..6db78ddfceb --- /dev/null +++ b/docs/architecture/ESLint_Plugin.mdx @@ -0,0 +1,22 @@ +--- +id: eslint-plugin +sidebar_label: eslint-plugin +--- + +# `@typescript-eslint/eslint-plugin` + +> The TypeScript plugin for ESLint. ✨ + +:::info +See [Getting Started](../Getting_Started.mdx) for documentation on how to lint your TypeScript code with ESLint. +::: + +`@typescript-eslint/eslint-plugin` is an ESLint plugin used to load in custom rules and rule configurations lists from typescript-eslint. +Those rules rely on [`@typescript-eslint/parser`](./Parser.mdx) to parse TypeScript code into ESLint-compatible nodes, as well as provide backing TypeScript programs. + +## Exports + +| Name | Description | +| --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `configs` | Object mapping string names of configs to extendable [ESLint config settings](https://eslint.org/docs/latest/user-guide/configuring/configuration-files#extending-configuration-files). | +| `rules` | Object mapping string names of rules to the [rule objects](https://eslint.org/docs/latest/developer-guide/working-with-rules). | diff --git a/docs/architecture/ESLint_Plugin_TSLint.mdx b/docs/architecture/ESLint_Plugin_TSLint.mdx new file mode 100644 index 00000000000..525b1c07247 --- /dev/null +++ b/docs/architecture/ESLint_Plugin_TSLint.mdx @@ -0,0 +1,51 @@ +--- +id: eslint-plugin-tslint +sidebar_label: eslint-plugin-tslint +--- + +# `@typescript-eslint/eslint-plugin-tslint` + +> ESLint plugin that allows running TSLint rules within ESLint to help you migrate from TSLint to ESLint. ✨ + +:::caution +Per [What About TSLint?](../linting/troubleshooting/TSLint.mdx), we highly recommend migrating off TSLint. +See [Getting Started](../Getting_Started.mdx) for documentation on how to lint your TypeScript code with ESLint. +::: + +## Installation + +```sh +yarn add -D @typescript-eslint/eslint-plugin-tslint +``` + +## Usage + +Configure in your ESLint config file: + +```js +{ + "plugins": [ + "@typescript-eslint/tslint" + ], + "parserOptions": { + "project": "tsconfig.json", + }, + "rules": { + "@typescript-eslint/tslint/config": ["warn", { + "lintFile": "", // path to tslint.json of your project + "rules": { + // tslint rules (will be used if `lintFile` is not specified) + }, + "rulesDirectory": [ + // array of paths to directories with rules, e.g. 'node_modules/tslint/lib/rules' (will be used if `lintFile` is not specified) + ] + }], + } +} +``` + +**Note:** The ability to automatically fix problems with `--fix` is unavailable for TSLint rules loaded with this plugin. + +## Rules + +This plugin contains only a single rule: `@typescript-eslint/tslint/config`. diff --git a/docs/architecture/Parser.mdx b/docs/architecture/Parser.mdx new file mode 100644 index 00000000000..5039dc1bec5 --- /dev/null +++ b/docs/architecture/Parser.mdx @@ -0,0 +1,272 @@ +--- +id: parser +sidebar_label: parser +--- + +# `@typescript-eslint/parser` + +> An [ESLint parser](https://eslint.org/docs/user-guide/configuring/plugins#specifying-parser) used to parse TypeScript code into ESLint-compatible nodes, as well as provide backing TypeScript programs. ✨ + +This is necessary because TypeScript produces a different, incompatible AST format to the one that ESLint requires to work. +For example, this is not valid JavaScript code because it contains the `: number` type annotation: + +```ts +let x: number = 1; +``` + +ESLint's native Espree parser would raise an error attempting to parse it. + +Additionally, because TypeScript is developed separately and with different goals from ESLint, ESTree, and Espree, its AST also represents nodes differently in many cases. +TS's AST is optimized for its use case of parsing incomplete code and typechecking. +ESTree is unoptimized and intended for "general purpose" use-cases of traversing the AST. + +:::tip +You can select `@typescript-eslint/parser` on the [typescript-eslint playground](https://typescript-eslint.io/play#showAST=es)'s left sidebar under _Options_ > _AST Explorer_ by selecting _ESTree_. +::: + +## Configuration + +The following additional configuration options are available by specifying them in [`parserOptions`](https://eslint.org/docs/user-guide/configuring/language-options#specifying-parser-options) in your ESLint configuration file. + +```ts +interface ParserOptions { + cacheLifetime?: { + glob?: number | 'Infinity'; + }; + ecmaFeatures?: { + jsx?: boolean; + globalReturn?: boolean; + }; + ecmaVersion?: number | 'latest'; + emitDecoratorMetadata?: boolean; + extraFileExtensions?: string[]; + jsxFragmentName?: string | null; + jsxPragma?: string | null; + lib?: string[]; + moduleResolver?: string; + program?: import('typescript').Program; + project?: string | string[]; + projectFolderIgnoreList?: string[]; + tsconfigRootDir?: string; + warnOnUnsupportedTypeScriptVersion?: boolean; +} +``` + +### `cacheLifetime` + +This option allows you to granularly control our internal cache expiry lengths. + +You can specify the number of seconds as an integer number, or the string 'Infinity' if you never want the cache to expire. + +By default cache entries will be evicted after 30 seconds, or will persist indefinitely if the parser infers that it is a single run. + +### `ecmaFeatures` + +Optional additional options to describe how to parse the raw syntax. + +#### `jsx` + +> Default `false`. + +Enable parsing JSX when `true`. +More details can be found in the [TypeScript handbook's JSX docs](https://www.typescriptlang.org/docs/handbook/jsx.html). + +**NOTE:** this setting does not affect known file types (`.js`, `.mjs`, `.cjs`, `.jsx`, `.ts`, `.mts`, `.cts`, `.tsx`, `.json`) because the TypeScript compiler has its own internal handling for known file extensions. + + + +The exact behavior is as follows: + +- `.js`, `.mjs`, `.cjs`, `.jsx`, `.tsx` files are always parsed as if this is `true`. +- `.ts`, `.mts`, `.cts` files are always parsed as if this is `false`. +- For "unknown" extensions (`.md`, `.vue`): + - If `parserOptions.project` is _not_ provided: + - The setting will be respected. + - If `parserOptions.project` is provided (i.e. you are using rules with type information): + - **always parsed as if this is `false`** + +#### `globalReturn` + +> Default `false`. + +This options allows you to tell the parser if you want to allow global `return` statements in your codebase. + +### `ecmaVersion` + +> Default `2018`. + +Accepts any valid ECMAScript version number or `'latest'`: + +- A version: es3, es5, es6, es7, es8, es9, es10, es11, es12, es13, ..., or +- A year: es2015, es2016, es2017, es2018, es2019, es2020, es2021, es2022, ..., or +- `'latest'` + +When it's a version or a year, the value **must** be a number - so do not include the `es` prefix. + +Specifies the version of ECMAScript syntax you want to use. This is used by the parser to determine how to perform scope analysis, and it affects the default + +### `emitDecoratorMetadata` + +> Default `undefined`. + +This option allow you to tell parser to act as if `emitDecoratorMetadata: true` is set in `tsconfig.json`, but without [type-aware linting](https://typescript-eslint.io/linting/typed-linting). In other words, you don't have to specify `parserOptions.project` in this case, making the linting process faster. + +### `extraFileExtensions` + +> Default `undefined`. + +This option allows you to provide one or more additional file extensions which should be considered in the TypeScript Program compilation. +The default extensions are `['.js', '.mjs', '.cjs', '.jsx', '.ts', '.mts', '.cts', '.tsx']`. +Add extensions starting with `.`, followed by the file extension. E.g. for a `.vue` file use `"extraFileExtensions": [".vue"]`. + +### `jsxFragmentName` + +> Default `null` + +The identifier that's used for JSX fragment elements (after transpilation). +If `null`, assumes transpilation will always use a member of the configured `jsxPragma`. +This should not be a member expression - just the root identifier (i.e. use `"h"` instead of `"h.Fragment"`). + +If you provide `parserOptions.project`, you do not need to set this, as it will automatically detected from the compiler. + +### `jsxPragma` + +> Default `'React'` + +The identifier that's used for JSX Elements creation (after transpilation). +If you're using a library other than React (like `preact`), then you should change this value. If you are using the [new JSX transform](https://reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html) you can set this to `null`. + +This should not be a member expression - just the root identifier (i.e. use `"React"` instead of `"React.createElement"`). + +If you provide `parserOptions.project`, you do not need to set this, as it will automatically detected from the compiler. + +### `lib` + +> Default `['es2018']` + +For valid options, see the [TypeScript compiler options](https://www.typescriptlang.org/tsconfig#lib). + +Specifies the TypeScript `lib`s that are available. This is used by the scope analyser to ensure there are global variables declared for the types exposed by TypeScript. + +If you provide `parserOptions.project`, you do not need to set this, as it will automatically detected from the compiler. + +### `moduleResolver` + +> Default `undefined`. + +This option allows you to provide a custom module resolution. The value should point to a JS file that default exports (`export default`, or `module.exports =`, or `export =`) a file with the following interface: + +```ts +interface ModuleResolver { + version: 1; + resolveModuleNames( + moduleNames: string[], + containingFile: string, + reusedNames: string[] | undefined, + redirectedReference: ts.ResolvedProjectReference | undefined, + options: ts.CompilerOptions, + ): (ts.ResolvedModule | undefined)[]; +} +``` + +### `program` + +> Default `undefined`. + +This option allows you to programmatically provide an instance of a TypeScript Program object that will provide type information to rules. +This will override any programs that would have been computed from `parserOptions.project` or `parserOptions.createDefaultProgram`. +All linted files must be part of the provided program(s). + +[Refer to the TypeScript Wiki for an example on how to write the `resolveModuleNames` function](https://github.com/Microsoft/TypeScript/wiki/Using-the-Compiler-API#customizing-module-resolution). + +### `project` + +> Default `undefined`. + +This option allows you to provide a path to your project's `tsconfig.json`. **This setting is required if you want to use rules which require type information**. Relative paths are interpreted relative to the current working directory if `tsconfigRootDir` is not set. If you intend on running ESLint from directories other than the project root, you should consider using `tsconfigRootDir`. + +- Accepted values: + + ```js + // path + project: './tsconfig.json'; + + // glob pattern + project: './packages/**/tsconfig.json'; + + // array of paths and/or glob patterns + project: ['./packages/**/tsconfig.json', './separate-package/tsconfig.json']; + ``` + +- If you use project references, TypeScript will not automatically use project references to resolve files. This means that you will have to add each referenced tsconfig to the `project` field either separately, or via a glob. + +- Note that using wide globs `**` in your `parserOptions.project` may cause performance implications. Instead of globs that use `**` to recursively check all folders, prefer paths that use a single `*` at a time. For more info see [#2611](https://github.com/typescript-eslint/typescript-eslint/issues/2611). + +- TypeScript will ignore files with duplicate filenames in the same folder (for example, `src/file.ts` and `src/file.js`). TypeScript purposely ignore all but one of the files, only keeping the one file with the highest priority extension (the extension priority order (from highest to lowest) is `.ts`, `.tsx`, `.d.ts`, `.js`, `.jsx`). For more info see #955. + +- Note that if this setting is specified and `createDefaultProgram` is not, you must only lint files that are included in the projects as defined by the provided `tsconfig.json` files. If your existing configuration does not include all of the files you would like to lint, you can create a separate `tsconfig.eslint.json` as follows: + + ```jsonc + { + // extend your base config so you don't have to redefine your compilerOptions + "extends": "./tsconfig.json", + "include": [ + "src/**/*.ts", + "test/**/*.ts", + "typings/**/*.ts", + // etc + + // if you have a mixed JS/TS codebase, don't forget to include your JS files + "src/**/*.js" + ] + } + ``` + +### `projectFolderIgnoreList` + +> Default `["**/node_modules/**"]`. + +This option allows you to ignore folders from being included in your provided list of `project`s. +This is useful if you have configured glob patterns, but want to make sure you ignore certain folders. + +It accepts an array of globs to exclude from the `project` globs. + +For example, by default it will ensure that a glob like `./**/tsconfig.json` will not match any `tsconfig`s within your `node_modules` folder (some npm packages do not exclude their source files from their published packages). + +### `tsconfigRootDir` + +> Default `undefined`. + +This option allows you to provide the root directory for relative TSConfig paths specified in the `project` option above. +Doing so ensures running ESLint from a directory other than the root will still be able to find your TSConfig. + +### `warnOnUnsupportedTypeScriptVersion` + +> Default `true`. + +This option allows you to toggle the warning that the parser will give you if you use a version of TypeScript which is not explicitly supported + +## Utilities + +### `createProgram(configFile, projectDirectory)` + +This serves as a utility method for users of the `parserOptions.programs` feature to create a TypeScript program instance from a config file. + +```ts +declare function createProgram( + configFile: string, + projectDirectory?: string, +): import('typescript').Program; +``` + +Example usage: + +```js title=".eslintrc.js" +const parser = require('@typescript-eslint/parser'); + +module.exports = { + parserOptions: { + programs: [parser.createProgram('tsconfig.json')], + }, +}; +``` diff --git a/docs/architecture/Scope_Manager.mdx b/docs/architecture/Scope_Manager.mdx new file mode 100644 index 00000000000..af7bd6e27c5 --- /dev/null +++ b/docs/architecture/Scope_Manager.mdx @@ -0,0 +1,104 @@ +--- +id: scope-manager +sidebar_label: scope-manager +--- + +# `@typescript-eslint/scope-manager` + +> A fork of [`eslint-scope`](https://github.com/eslint/eslint-scope), enhanced to support TypeScript functionality. ✨ + +A "scope analyser" traverses an AST and builds a model of how variables (and in our case, types) are defined and consumed by the source code. +This form of static analysis allows you to understand and trace variables throughout the program, allowing you to access powerful information about a program without needing to drop into the much, much heavier type information. + +## API + +### `analyze(tree, options)` + +Analyses a given AST and returns the resulting `ScopeManager`. + +```ts +interface AnalyzeOptions { + /** + * Known visitor keys. + */ + childVisitorKeys?: Record | null; + + /** + * Which ECMAScript version is considered. + * Defaults to `2018`. + * `'latest'` is converted to 1e8 at parser. + */ + ecmaVersion?: EcmaVersion | 1e8; + + /** + * Whether the whole script is executed under node.js environment. + * When enabled, the scope manager adds a function scope immediately following the global scope. + * Defaults to `false`. + */ + globalReturn?: boolean; + + /** + * Implied strict mode (if ecmaVersion >= 5). + * Defaults to `false`. + */ + impliedStrict?: boolean; + + /** + * The identifier that's used for JSX Element creation (after transpilation). + * This should not be a member expression - just the root identifier (i.e. use "React" instead of "React.createElement"). + * Defaults to `"React"`. + */ + jsxPragma?: string; + + /** + * The identifier that's used for JSX fragment elements (after transpilation). + * If `null`, assumes transpilation will always use a member on `jsxFactory` (i.e. React.Fragment). + * This should not be a member expression - just the root identifier (i.e. use "h" instead of "h.Fragment"). + * Defaults to `null`. + */ + jsxFragmentName?: string | null; + + /** + * The lib used by the project. + * This automatically defines a type variable for any types provided by the configured TS libs. + * For more information, see https://www.typescriptlang.org/tsconfig#lib + * + * Defaults to the lib for the provided `ecmaVersion`. + */ + lib?: Lib[]; + + /** + * The source type of the script. + */ + sourceType?: 'script' | 'module'; + + /** + * Emit design-type metadata for decorated declarations in source. + * Defaults to `false`. + */ + emitDecoratorMetadata?: boolean; +} +``` + +Example usage: + +```ts +import { analyze } from '@typescript-eslint/scope-manager'; +import { parse } from '@typescript-eslint/typescript-estree'; + +const code = `const hello: string = 'world';`; +const ast = parse(code, { + // note that scope-manager requires ranges on the AST + range: true, +}); +const scope = analyze(ast, { + ecmaVersion: 2020, + sourceType: 'module', +}); +``` + +## References + +- [You can view the original BSD 2 license for the code here](https://github.com/eslint/eslint-scope/blob/dbddf14d5771b21b5da704213e4508c660ca1c64/LICENSE) +- https://eslint.org/docs/developer-guide/scope-manager-interface +- https://github.com/eslint/eslint-scope diff --git a/docs/architecture/TypeScript-ESTree.mdx b/docs/architecture/TypeScript-ESTree.mdx new file mode 100644 index 00000000000..f74aa65e223 --- /dev/null +++ b/docs/architecture/TypeScript-ESTree.mdx @@ -0,0 +1,381 @@ +--- +id: typescript-estree +sidebar_label: typescript-estree +--- + +# `@typescript-eslint/typescript-estree` + +> The underlying code used by [`@typescript-eslint/parser`](./Parser.mdx) that converts TypeScript source code into an ESTree-compatible form. ✨ + +This parser is designed to be generic and robust. +It can be used to power any use-case which requires taking TypeScript source code and producing an ESTree-compatible AST. + +It is most known for use within these hyper-popular open-source projects to power their TypeScript support: + +- [ESLint](https://eslint.org), the pluggable linting utility for JavaScript and JSX +- [Prettier](https://prettier.io), an opinionated code formatter + +It works by: + +1. Invoking the TypeScript compiler on the given source code in order to + produce a TypeScript AST +2. Converting that TypeScript AST into an ESTree AST + +## API + +### Parsing + +#### `parse(code, options)` + +Parses the given string of code with the options provided and returns an ESTree-compatible AST. + +```ts +interface ParseOptions { + /** + * create a top-level comments array containing all comments + */ + comment?: boolean; + + /** + * An array of modules to turn explicit debugging on for. + * - 'typescript-eslint' is the same as setting the env var `DEBUG=typescript-eslint:*` + * - 'eslint' is the same as setting the env var `DEBUG=eslint:*` + * - 'typescript' is the same as setting `extendedDiagnostics: true` in your tsconfig compilerOptions + * + * For convenience, also supports a boolean: + * - true === ['typescript-eslint'] + * - false === [] + */ + debugLevel?: boolean | ('typescript-eslint' | 'eslint' | 'typescript')[]; + + /** + * Cause the parser to error if it encounters an unknown AST node type (useful for testing). + * This case only usually occurs when TypeScript releases new features. + */ + errorOnUnknownASTType?: boolean; + + /** + * Absolute (or relative to `cwd`) path to the file being parsed. + */ + filePath?: string; + + /** + * Enable parsing of JSX. + * For more details, see https://www.typescriptlang.org/docs/handbook/jsx.html + * + * NOTE: this setting does not effect known file types (.js, .cjs, .mjs, .jsx, .ts, .mts, .cts, .tsx, .json) because the + * TypeScript compiler has its own internal handling for known file extensions. + * + * For the exact behavior, see https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/parser#parseroptionsecmafeaturesjsx + */ + jsx?: boolean; + + /** + * Controls whether the `loc` information to each node. + * The `loc` property is an object which contains the exact line/column the node starts/ends on. + * This is similar to the `range` property, except it is line/column relative. + */ + loc?: boolean; + + /* + * Allows overriding of function used for logging. + * When value is `false`, no logging will occur. + * When value is not provided, `console.log()` will be used. + */ + loggerFn?: Function | false; + + /** + * Controls whether the `range` property is included on AST nodes. + * The `range` property is a [number, number] which indicates the start/end index of the node in the file contents. + * This is similar to the `loc` property, except this is the absolute index. + */ + range?: boolean; + + /** + * Set to true to create a top-level array containing all tokens from the file. + */ + tokens?: boolean; +} + +const PARSE_DEFAULT_OPTIONS: ParseOptions = { + comment: false, + errorOnUnknownASTType: false, + filePath: 'estree.ts', // or 'estree.tsx', if you pass jsx: true + jsx: false, + loc: false, + loggerFn: undefined, + range: false, + tokens: false, +}; + +declare function parse( + code: string, + options: ParseOptions = PARSE_DEFAULT_OPTIONS, +): TSESTree.Program; +``` + +Example usage: + +```js +import { parse } from '@typescript-eslint/typescript-estree'; + +const code = `const hello: string = 'world';`; +const ast = parse(code, { + loc: true, + range: true, +}); +``` + +#### `parseAndGenerateServices(code, options)` + +Parses the given string of code with the options provided and returns an ESTree-compatible AST. Accepts additional options which can be used to generate type information along with the AST. + +```ts +interface ParseAndGenerateServicesOptions extends ParseOptions { + /** + * Causes the parser to error if the TypeScript compiler returns any unexpected syntax/semantic errors. + */ + errorOnTypeScriptSyntacticAndSemanticIssues?: boolean; + + /** + * ***EXPERIMENTAL FLAG*** - Use this at your own risk. + * + * Causes TS to use the source files for referenced projects instead of the compiled .d.ts files. + * This feature is not yet optimized, and is likely to cause OOMs for medium to large projects. + * + * This flag REQUIRES at least TS v3.9, otherwise it does nothing. + * + * See: https://github.com/typescript-eslint/typescript-eslint/issues/2094 + */ + EXPERIMENTAL_useSourceOfProjectReferenceRedirect?: boolean; + + /** + * When `project` is provided, this controls the non-standard file extensions which will be parsed. + * It accepts an array of file extensions, each preceded by a `.`. + */ + extraFileExtensions?: string[]; + + /** + * Absolute (or relative to `tsconfigRootDir`) path to the file being parsed. + * When `project` is provided, this is required, as it is used to fetch the file from the TypeScript compiler's cache. + */ + filePath?: string; + + /** + * Allows the user to control whether or not two-way AST node maps are preserved + * during the AST conversion process. + * + * By default: the AST node maps are NOT preserved, unless `project` has been specified, + * in which case the maps are made available on the returned `parserServices`. + * + * NOTE: If `preserveNodeMaps` is explicitly set by the user, it will be respected, + * regardless of whether or not `project` is in use. + */ + preserveNodeMaps?: boolean; + + /** + * Absolute (or relative to `tsconfigRootDir`) paths to the tsconfig(s). + * If this is provided, type information will be returned. + */ + project?: string | string[]; + + /** + * If you provide a glob (or globs) to the project option, you can use this option to ignore certain folders from + * being matched by the globs. + * This accepts an array of globs to ignore. + * + * By default, this is set to ["/node_modules/"] + */ + projectFolderIgnoreList?: string[]; + + /** + * The absolute path to the root directory for all provided `project`s. + */ + tsconfigRootDir?: string; + + /** + * An array of one or more instances of TypeScript Program objects to be used for type information. + * This overrides any program or programs that would have been computed from the `project` option. + * All linted files must be part of the provided program(s). + */ + programs?: Program[]; + + /** + *************************************************************************************** + * IT IS RECOMMENDED THAT YOU DO NOT USE THIS OPTION, AS IT CAUSES PERFORMANCE ISSUES. * + *************************************************************************************** + * + * When passed with `project`, this allows the parser to create a catch-all, default program. + * This means that if the parser encounters a file not included in any of the provided `project`s, + * it will not error, but will instead parse the file and its dependencies in a new program. + */ + createDefaultProgram?: boolean; + + /** + * ESLint (and therefore typescript-eslint) is used in both "single run"/one-time contexts, + * such as an ESLint CLI invocation, and long-running sessions (such as continuous feedback + * on a file in an IDE). + * + * When typescript-eslint handles TypeScript Program management behind the scenes, this distinction + * is important because there is significant overhead to managing the so called Watch Programs + * needed for the long-running use-case. + * + * When allowAutomaticSingleRunInference is enabled, we will use common heuristics to infer + * whether or not ESLint is being used as part of a single run. + */ + allowAutomaticSingleRunInference?: boolean; + + /** + * Granular control of the expiry lifetime of our internal caches. + * You can specify the number of seconds as an integer number, or the string + * 'Infinity' if you never want the cache to expire. + * + * By default cache entries will be evicted after 30 seconds, or will persist + * indefinitely if `allowAutomaticSingleRunInference = true` AND the parser + * infers that it is a single run. + */ + cacheLifetime?: { + /** + * Glob resolution for `parserOptions.project` values. + */ + glob?: number | 'Infinity'; + }; + + /** + * Path to a file exporting a custom `ModuleResolver`. + */ + moduleResolver?: string; +} + +interface ParserServices { + program: ts.Program; + esTreeNodeToTSNodeMap: WeakMap; + tsNodeToESTreeNodeMap: WeakMap; + hasFullTypeInformation: boolean; +} + +interface ParseAndGenerateServicesResult { + ast: TSESTree.Program; + services: ParserServices; +} + +const PARSE_AND_GENERATE_SERVICES_DEFAULT_OPTIONS: ParseOptions = { + ...PARSE_DEFAULT_OPTIONS, + errorOnTypeScriptSyntacticAndSemanticIssues: false, + extraFileExtensions: [], + preserveNodeMaps: false, // or true, if you do not set this, but pass `project` + project: undefined, + projectFolderIgnoreList: ['/node_modules/'], + tsconfigRootDir: process.cwd(), +}; + +declare function parseAndGenerateServices( + code: string, + options: ParseOptions = PARSE_DEFAULT_OPTIONS, +): ParseAndGenerateServicesResult; +``` + +Example usage: + +```js +import { parseAndGenerateServices } from '@typescript-eslint/typescript-estree'; + +const code = `const hello: string = 'world';`; +const { ast, services } = parseAndGenerateServices(code, { + filePath: '/some/path/to/file/foo.ts', + loc: true, + project: './tsconfig.json', + range: true, +}); +``` + +##### `ModuleResolver` + +The `moduleResolver` option allows you to specify the path to a module with a custom module resolver implementation. The module is expected to adhere to the following interface: + +```ts +interface ModuleResolver { + version: 1; + resolveModuleNames( + moduleNames: string[], + containingFile: string, + reusedNames: string[] | undefined, + redirectedReference: ts.ResolvedProjectReference | undefined, + options: ts.CompilerOptions, + ): (ts.ResolvedModule | undefined)[]; +} +``` + +#### `parseWithNodeMaps(code, options)` + +Parses the given string of code with the options provided and returns both the ESTree-compatible AST as well as the node maps. +This allows you to work with both ASTs without the overhead of types that may come with `parseAndGenerateServices`. + +```ts +interface ParseWithNodeMapsResult { + ast: TSESTree.Program; + esTreeNodeToTSNodeMap: ParserServices['esTreeNodeToTSNodeMap']; + tsNodeToESTreeNodeMap: ParserServices['tsNodeToESTreeNodeMap']; +} + +declare function parseWithNodeMaps( + code: string, + options: ParseOptions = PARSE_DEFAULT_OPTIONS, +): ParseWithNodeMapsResult; +``` + +Example usage: + +```js +import { parseWithNodeMaps } from '@typescript-eslint/typescript-estree'; + +const code = `const hello: string = 'world';`; +const { ast, esTreeNodeToTSNodeMap, tsNodeToESTreeNodeMap } = parseWithNodeMaps( + code, + { + loc: true, + range: true, + }, +); +``` + +### `TSESTree`, `AST_NODE_TYPES` and `AST_TOKEN_TYPES` + +Types for the AST produced by the parse functions. + +- `TSESTree` is a namespace which contains object types representing all of the AST Nodes produced by the parser. +- `AST_NODE_TYPES` is an enum which provides the values for every single AST node's `type` property. +- `AST_TOKEN_TYPES` is an enum which provides the values for every single AST token's `type` property. + +### Utilities + +#### `createProgram(configFile, projectDirectory)` + +This serves as a utility method for users of the `ParseOptions.programs` feature to create a TypeScript program instance from a config file. + +```ts +declare function createProgram( + configFile: string, + projectDirectory: string = process.cwd(), +): import('typescript').Program; +``` + +Example usage: + +```js +const tsESTree = require('@typescript-eslint/typescript-estree'); + +const program = tsESTree.createProgram('tsconfig.json'); +const code = `const hello: string = 'world';`; +const { ast, services } = parseAndGenerateServices(code, { + filePath: '/some/path/to/file/foo.ts', + loc: true, + program, + range: true, +}); +``` + +## Debugging + +If you encounter a bug with the parser that you want to investigate, you can turn on the debug logging via setting the environment variable: `DEBUG=typescript-eslint:*`. +I.e. in this repo you can run: `DEBUG=typescript-eslint:* yarn lint`. diff --git a/docs/architecture/Utils.mdx b/docs/architecture/Utils.mdx new file mode 100644 index 00000000000..9270f2ed8e5 --- /dev/null +++ b/docs/architecture/Utils.mdx @@ -0,0 +1,28 @@ +--- +id: utils +sidebar_label: utils +--- + +# `@typescript-eslint/utils` + +> Utilities for working with TypeScript + ESLint together. ✨ + +This package contains public utilities for writing custom rules and plugins in TypeScript. +Rules declared in [`@typescript-eslint/eslint-plugin`](https://typescript-eslint.io/architecture/eslint-plugin) are created using these utility functions. +Any custom rules you write generally will be as well. + +> See [Custom Rules](https://typescript-eslint.io/custom-rules) for documentation on creating your own custom ESLint rules for TypeScript code. + +## Exports + +| Name | Description | +| ----------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `AST_NODE_TYPES` | An enum with the names of every single _node_ found in `TSESTree`. | +| `AST_TOKEN_TYPES` | An enum with the names of every single _token_ found in `TSESTree`. | +| `ASTUtils` | Tools for operating on the ESTree AST. Also includes the [`eslint-utils`](https://www.npmjs.com/package/eslint-utils) package, correctly typed to work with the types found in `TSESTree` | +| `ESLintUtils` | Tools for creating ESLint rules with TypeScript. | +| `JSONSchema` | Types from the [`@types/json-schema`](https://www.npmjs.com/package/@types/json-schema) package, re-exported to save you having to manually import them. Also ensures you're using the same version of the types as this package. | +| `ParserServices` | Typing for the parser services provided when parsing a file using `@typescript-eslint/typescript-estree`. | +| `TSESLint` | Types for ESLint, correctly typed to work with the types found in `TSESTree`. | +| `TSESLintScope` | The [`eslint-scope`](https://www.npmjs.com/package/eslint-scope) package, correctly typed to work with the types found in both `TSESTree` and `TSESLint` | +| `TSESTree` | Types for the TypeScript flavor of ESTree created by `@typescript-eslint/typescript-estree`. | diff --git a/docs/contributing/Discussions.md b/docs/contributing/Discussions.md new file mode 100644 index 00000000000..52de9991409 --- /dev/null +++ b/docs/contributing/Discussions.md @@ -0,0 +1,28 @@ +--- +id: discussions +title: Discussions +--- + +Most proposals in the typescript-eslint repository happen in [GitHub Issues](https://docs.github.com/issues). +We generally try to keep conversations inside issues for their discoverability and ability to be linked to [GitHub Pull Requests](https://docs.github.com/pull-requests). + +We have [GitHub Discussions](https://docs.github.com/discussions) enabled to enable three kinds of deeper, threaded conversations: + +- **Community Feedback**: Questions from the maintainer team that should be raised to the broader community +- **RFCs (Requests For Comments)**: Formalized proposals for larger changes that should be discussed before turned into issues +- **Technical Discussions**: Deeper questions about typescript-eslint's architecture and/or APIs + +Before filing a Discussion, search the issue tracker for any related conversations. +Link to them in the Discussion, along with a detailed description of what you'd like to discuss. + +:::tip +For change proposals that match an [existing issue format](https://github.com/typescript-eslint/typescript-eslint/issues/new/choose), keep to filing issues. +Most don't need to be moved to this separate format. +We can always move an issue to a discussion if it becomes unexpectedly deep. +::: + +:::caution +Please don't use Discussions as a support forum. +We don't have the maintainer-budget to handle that. +See [Issues > Questions and Support Requests](./Issues.mdx#questions-and-support-requests). +::: diff --git a/docs/contributing/Issues.mdx b/docs/contributing/Issues.mdx new file mode 100644 index 00000000000..d577248b2e6 --- /dev/null +++ b/docs/contributing/Issues.mdx @@ -0,0 +1,37 @@ +--- +id: issues +title: Issues +--- + +So you've got a bug report, documentation request, or feature suggestion? +Great! + +Please do: + +- Make sure you're using the [latest version of our packages](https://github.com/typescript-eslint/typescript-eslint/releases) +- Search [all opened and closed issues](https://github.com/typescript-eslint/typescript-eslint/issues?q=is%3Aissue+) to make sure your issue wouldn't be a duplicate +- Fill out the [appropriate issue template](https://github.com/typescript-eslint/typescript-eslint/issues/new/choose) completely +- Provide as much information as you can + +## Commenting + +Please do comment on any open issue if you have more information that would be useful. + +Please don't: + +- Leave useless comments such as _"+1"_ or _"when's this getting fixed?"_ that only act as spam + - If you have nothing to add but enthusiasm and joy, add a reaction such as 👍 + - One exception: if an issue has been blocked on a question to a maintainer for 3 or more months, please ping us - we probably lost track of it +- Bring up unrelated topics in existing issues: instead, file a new issue +- Comment on closed PRs: instead, [file a new issue](#raising-issues) +- Comment on commits directly, as those comments are not searchable: instead, file a new issue + +## Questions and Support Requests + +We do not have the bandwidth to handle questions or support requests in the issue tracker. +You can instead: + +- Ask a question on [StackOverflow](https://stackoverflow.com/questions/tagged/typescript-eslint 'StackOverflow questions tagged with typescript-eslint') using the `typescript-eslint` tag +- Publicly tweet [@tseslint on Twitter](https://twitter.com/tseslint) + +> Note that requests to add documentation _are_ allowed, even encouraged! 📝 diff --git a/docs/contributing/Local_Development.mdx b/docs/contributing/Local_Development.mdx new file mode 100644 index 00000000000..3f85bd9c90b --- /dev/null +++ b/docs/contributing/Local_Development.mdx @@ -0,0 +1,82 @@ +--- +id: local-development +title: Local Development +--- + +Thank you for your interest in developing on typescript-eslint! ❤️‍🔥 + +> See [Contributing](../Contributing.mdx) and [Issues](./Issues.mdx) for details on our general contribution flows. + +## Setup + +After [forking the repo from GitHub](https://help.github.com/articles/fork-a-repo) and [installing Yarn classic](https://classic.yarnpkg.com): + +```shell +git clone https://github.com//typescript-eslint +cd typescript-eslint +yarn +``` + +Postinstall scripts will then fully build your repository locally with (`yarn build`). +At this point, you're ready to develop! 🚀 + +## Builds + +You can run `yarn build` in the root to build all packages, or in any package to build just that package. + +Keep in mind that packages generally depend on each other's built outputs, and you'll need to `yarn build` dependents for their consumers to receive any new local changes. +For example, if you make a change within `scope-manager` and want to use it in `eslint-plugin`, you'll need to `yarn build` either from the root or within `packages/scope-manager`. + +## Validating Changes + +The following checks are all run on pull requests automatically. +You can also perform them locally. + +> See [Contributing > Pull Requests](../Contributing.mdx#raising-a-pr) for more information on pull requests. + +### Formatting + +We use [Prettier](https://prettier.io) to auto-format code. +A Git pre-commit hook should apply it to all committed changes. +ALternately, you can run `yarn format` in any package or in the root. + +### Linting + +All code changes must pass ESLint. +You can run `yarn lint` in any package or in the root. + +### Proofreading + +Changes must pass two linters for documentation and naming, the commands for which may be run from the root: + +- `yarn check-spelling`: [CSpell](https://cspell.org), for all code +- `yarn lint-markdown`: [Markdownlint](https://github.com/DavidAnson/markdownlint), for Markdown documentation + +### Tests + +All code changes should ideally be unit tested if possible. +You can run `yarn test` in any package to run its tests. + +> [VS Code launch tasks](https://code.visualstudio.com/docs/editor/tasks) tasks are provided that allow [visual debugging](https://code.visualstudio.com/docs/editor/debugging) tests. + +#### Code Coverage + +We aim for 100% code coverage in all PRs when possible, except in the `website/` package. +Coverage reports are be generated locally whenever `yarn test` is run. + +The `codecov` bot should also comment on your PR with the percentage, as well as links to the line-by-line coverage of each file touched by your PR. + +### Type Checking + +All code should pass TypeScript type checking. +You can run `yarn typecheck` in any package or in the root to run `tsc`. + +> Run `yarn typecheck -w` to start `tsc` in watch mode. + +## Website Development + +Our interactive documentation website is built with [Docusaurus](https://docusaurus.io). +Running `yarn start` from either the root or `packages/website` will start a local dev server on `localhost:3000`. + +> The `website` package relies on other packages being built. +> We recommend running `yarn build` from the root before `yarn start`. diff --git a/docs/contributing/Pull_Requests.mdx b/docs/contributing/Pull_Requests.mdx new file mode 100644 index 00000000000..c5af830718c --- /dev/null +++ b/docs/contributing/Pull_Requests.mdx @@ -0,0 +1,77 @@ +--- +id: pull-requests +title: Pull Requests +--- + +> See [Local Development](./Local_Development.mdx) for details on how to get started developing locally. + +So you've got changes locally that address an issue? +Fantastic! + +Please do: + +- Only send pull requests that resolve [open issues marked as `accepting prs`](https://github.com/typescript-eslint/typescript-eslint/issues?q=is%3Aissue+is%3Aopen+label%3A%22accepting+prs%22) + - One exception: extremely minor documentation typos +- Fill out the pull request template in full +- Validate your changes per [Development > Validating Changes](./Local_Development.mdx#validating-changes) before un-[drafting your PR](https://github.blog/2019-02-14-introducing-draft-pull-requests) + +Please don't: + +- Force push after opening a PR + - Reasoning: GitHub is not able to track changes across force pushes, which makes it take longer for us to perform incremental reviews +- Comment on an existing PR asking for updates + - Reasoning: Your PR hasn't been forgotten! The volunteer maintainers have limited time to work on the project, and they will get to it as soon as they are able. + - One exception: if a PR has been blocked on a question to a maintainer for 3 or more months, please ping us - we probably lost track of it. + +### Raising a PR + +Once your changes are ready, you can raise a PR! 🙌 +The title of your PR should match the following format: + +```text +(): +``` + +You can find more samples of good past PR titles in [recent commits to `main`](https://github.com/typescript-eslint/typescript-eslint/commits/main): + +- `fix(scope-manager): correct handling for class static blocks` +- `docs: Fix links to getting started in README.md` + +Within the body of your PR, make sure you reference the issue that you have worked on, as well as pointing out anything of note you wish us to look at during our review. + +> We do not care about the number, or style of commits in your history, because we squash merge every PR into `main`. +> Feel free to commit in whatever style you feel comfortable with. + +> Tip: Send the PR from a branch other than `main`. +> See GitHub's [Proposing Changes docs](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests) for more information. + +#### type + +Must be one of the following: + + + +- `docs` - if you only change documentation, and not shipped code +- `feat` - for any new functionality additions +- `fix` - for any bug fixes that don't add new functionality +- `test` - if you only change tests, and not shipped code +- `chore` - anything else + +#### package + +The name of the package you have made changes within, (e.g. `eslint-plugin`, `parser`, `typescript-estree`). +If you make significant changes across multiple packages, you can omit this (e.g. +`feat: foo bar`). + +#### short description + +A succinct title for the PR. + +### Addressing Feedback and Beyond + +With your PR raised and the CI passing, your PR will [wait in the queue to be reviewed](https://github.com/typescript-eslint/typescript-eslint/pulls?q=is%3Apr+is%3Aopen+sort%3Acreated-asc+-label%3A%22breaking+change%22+-label%3A%22awaiting+response%22+-label%3A%221+approval%22+-label%3A%22DO+NOT+MERGE%22+status%3Asuccess). +We generally review PRs oldest to newest, unless we consider a newer PR higher priority (e.g. if it's a bug fix). + +Once we have reviewed your PR, we will provide any feedback that needs addressing. +If you feel a requested change is wrong, don't be afraid to discuss with us in the comments. +Once the feedback is addressed, and the PR is reviewed, we'll ensure the branch is up to date with `main`, and merge it for you. diff --git a/docs/development/architecture/ASTS.md b/docs/development/architecture/ASTS.md deleted file mode 100644 index 26164c8174e..00000000000 --- a/docs/development/architecture/ASTS.md +++ /dev/null @@ -1,57 +0,0 @@ ---- -id: asts -sidebar_label: ASTs ---- - -# Abstract Syntax Trees (ASTs) - -Parsers such as those in ESLint and TypeScript read in the text of source code and parse it into a standard format they can reason about known as an **Abstract Syntax Tree** (AST). -ASTs are called such because although they might contain information on the location of constructs within source code, they are an abstract representation that cares more about the semantic structure. - -For example, given this line of code: - -```js -1 + 2; -``` - -ESLint would natively understand it as an object like: - -```json -{ - "type": "ExpressionStatement", - "expression": { - "type": "BinaryExpression", - "left": { - "type": "Literal", - "value": 1, - "raw": "1" - }, - "operator": "+", - "right": { - "type": "Literal", - "value": 2, - "raw": "2" - } - } -} -``` - -ESLint uses an AST format known as **[`estree`]**. - -ESTree is more broadly used than just for ESLint -- it is the de facto community standard. -ESLint's built-in parser that outputs an `estree`-shaped AST is also a separate package, called **[`espree`]**. - -## AST Playground - -The [TypeScript ESLint playground](https://typescript-eslint.io/play#showAST=es) contains an AST explorer that generates an interactive AST for any code entered into the playground. -You can activate it under _Options_ > _AST Explorer_ on its left sidebar by selecting _ESTree_. - -:::note - -You can play more with various other ASTs on [astexplorer.net] and read more details on their [Wikipedia article](https://en.wikipedia.org/wiki/Abstract_syntax_tree). - -::: - -[astexplorer.net]: https://astexplorer.net -[`espree`]: https://github.com/eslint/espree -[`estree`]: https://github.com/estree/estree diff --git a/docs/development/architecture/PACKAGES.md b/docs/development/architecture/PACKAGES.md deleted file mode 100644 index f798e35b2e4..00000000000 --- a/docs/development/architecture/PACKAGES.md +++ /dev/null @@ -1,78 +0,0 @@ ---- -id: packages -title: Packages -sidebar_label: Packages ---- - -This page describes the top-level packages exported by the [typescript-eslint monorepo](https://github.com/typescript-eslint/typescript-eslint). -Each of these are published as npm packages under the `@typescript-eslint` organization. - -## `@typescript-eslint/eslint-plugin` - -[`@typescript-eslint/eslint-plugin`] is the core [ESLint plugin](https://eslint.org/docs/user-guide/configuring/plugins) used by consumers to load in custom rules and rule configurations lists from typescript-eslint. -Those rules rely on ESLint using the `@typescript-eslint/parser` package described below, and are generally built using the other packages on this page. - -## `@typescript-eslint/parser` - -[`@typescript-eslint/parser`] takes in ESLint configuration settings, reads in TypeScript source text, and produces an ESTree AST. -This is necessary because TypeScript produces a different, incompatible AST format to the one that ESLint requires to work. - -For example, this is not valid JavaScript code because it contains the `: number` type annotation: - -```ts -let x: number = 1; -``` - -ESLint's native Espree parser would raise an error attempting to parse it. - -Additionally, because TypeScript is developed separately and with different goals from ESLint, ESTree, and Espree, its AST also represents nodes differently in many cases. -TS's AST is optimized for its use case of parsing incomplete code and typechecking. -ESTree is unoptimized and intended for "general purpose" use-cases of traversing the AST. - -See more on configuring custom parsers with ESLint on [ESLint's User Guide > Configuring > Plugins](https://eslint.org/docs/user-guide/configuring/plugins#specifying-parser). - -:::tip -You can select `@typescript-eslint/parser` on the [TypeScript ESLint playground](https://typescript-eslint.io/play#showAST=es)'s left sidebar under _Options_ > _AST Explorer_ by selecting _ESTree_. -::: - -## `@typescript-eslint/typescript-estree` - -[`@typescript-eslint/typescript-estree`] is used by `@typescript-eslint/parser` to take TypeScript source code and produce the equivalent ESTree AST. -It works by: - -1. Invoking the TypeScript compiler on the given source code in order to - produce a TypeScript AST -2. Converting that TypeScript AST into an ESTree AST - -> Because [`@typescript-eslint/typescript-estree`] has a very specific purpose, it is reusable for tools with similar -> requirements to ESLint. -> It is therefore also used to power the amazing opinionated code formatter [Prettier](https://prettier.io)'s TypeScript support. - -## `@typescript-eslint/scope-manager` - -[`@typescript-eslint/scope-manager`] is a fork of [`eslint-scope`](https://github.com/eslint/eslint-scope), enhanced to support TypeScript functionality. - -A "scope analyser" traverses an AST and builds a model of how variables (and in our case, types) are defined and consumed by the source code. -This form of static analysis allows you to understand and trace variables throughout the program, allowing you to access powerful information about a program without needing to drop into the much, much heavier type information. - -## `@typescript-eslint/utils` - -[`@typescript-eslint/utils`] contains public utilities for writing custom rules and plugins in TypeScript. -Rules declared in `@typescript-eslint/eslint-plugin` are created using its utility functions. -Any custom rules you write generally will be as well. - -## `@typescript-eslint/eslint-plugin-tslint` - -[`@typescript-eslint/eslint-plugin-tslint`] is a separate ESLint plugin that allows running TSLint rules within ESLint to help you migrate from TSLint to ESLint. - -:::caution -**TSLint is deprecated.** It is in your best interest to migrate off it. See [Linting > Troubleshooting & FAQs > What About TSLint?](../../linting/troubleshooting/TSLINT.md). -::: - -[`@typescript-eslint/eslint-plugin-tslint`]: https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/eslint-plugin-tslint -[`@typescript-eslint/eslint-plugin`]: https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/eslint-plugin -[`@typescript-eslint/utils`]: https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/utils -[`@typescript-eslint/parser`]: https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/parser -[`@typescript-eslint/scope-manager`]: https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/scope-manager -[`@typescript-eslint/typescript-estree`]: https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/typescript-estree -[`@typescript-eslint/typescript-estree`]: https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/typescript-estree diff --git a/docs/linting/CONFIGURATIONS.md b/docs/linting/CONFIGURATIONS.md deleted file mode 100644 index de05a216ff8..00000000000 --- a/docs/linting/CONFIGURATIONS.md +++ /dev/null @@ -1,122 +0,0 @@ ---- -id: configs -title: Configurations ---- - -[ESLint shareable configurations](https://eslint.org/docs/latest/developer-guide/shareable-configs) exist to provide a comprehensive base config for you, with the intention that you add the config and it gives you an opinionated setup. - -## Built-In Configurations - -`@typescript-eslint/eslint-plugin` includes built-in configurations you can extend from to pull in the recommended starting rules. - -With the exception of `strict`, all configurations are considered "stable". -Rule additions and removals are treated as breaking changes and will only be done in major version bumps. - -:::note -We recommend most packages extend from [`recommended-requiring-type-checking`](#recommended-requiring-type-checking) (which requires [typed linting](./TYPED_LINTING.md)). -::: - -### `eslint-recommended` - -This ruleset is meant to be used after extending `eslint:recommended`. -It disables core ESLint rules that are already checked by the TypeScript compiler. -Additionally, it enables rules that promote using the more modern constructs TypeScript allows for. - -```jsonc -{ - "extends": [ - "eslint:recommended", - "plugin:@typescript-eslint/eslint-recommended" - ] -} -``` - -This config is automatically included if you use any of the other configurations mentioned on this page. - -### `recommended` - -Recommended rules for code correctness that you can drop in without additional configuration. -These rules are those whose reports are almost always for a bad practice and/or likely bug. -`recommended` also disables rules known to conflict with this repository, or cause issues in TypeScript codebases. - -```json -{ - "extends": ["plugin:@typescript-eslint/recommended"] -} -``` - -:::tip -We strongly recommend all TypeScript projects extend from this configuration. -::: - -### `recommended-requiring-type-checking` - -Additional recommended rules that require type information. -Rules in this configuration are similarly useful to those in `recommended`. - -```json -{ - "extends": [ - "plugin:@typescript-eslint/recommended", - "plugin:@typescript-eslint/recommended-requiring-type-checking" - ] -} -``` - -:::tip -We recommend all TypeScript projects extend from this configuration, with the caveat that rules using type information take longer to run. -See [Linting with Type Information](/docs/linting/typed-linting) for more details. -::: - -### `strict` - -Additional strict rules that can also catch bugs but are more opinionated than recommended rules. - -```json -{ - "extends": [ - "plugin:@typescript-eslint/recommended", - "plugin:@typescript-eslint/recommended-requiring-type-checking", - "plugin:@typescript-eslint/strict" - ] -} -``` - -:::tip -We recommend a TypeScript project extend from this configuration only if a nontrivial percentage of its developers are highly proficient in TypeScript. -::: - -## Overriding Configurations - -These configurations are our recommended starting points, but **you don't need to use them as-is**. -ESLint allows you to configure your own rule settings on top of any extended configurations. -See [ESLint's Configuring Rules docs](https://eslint.org/docs/user-guide/configuring/rules#using-configuration-files). - -### Suggesting Configuration Changes - -If you feel strongly that a specific rule should (or should not) be one of these configurations, please [file an issue](https://github.com/typescript-eslint/typescript-eslint/issues/new?assignees=&labels=package%3A+eslint-plugin%2Cpreset+config+change%2Ctriage&template=09-config-change.yaml&title=Configs%3A+%3Ca+short+description+of+my+proposal%3E) along with a **detailed** argument explaining your reasoning. - -## Prettier - -If you use [`prettier`](https://www.npmjs.com/package/prettier), there is also a helpful config to help ensure ESLint doesn't report on formatting issues that prettier will fix: [`eslint-config-prettier`](https://www.npmjs.com/package/eslint-config-prettier). - -Using this config by adding it to the end of your `extends`: - -```js title=".eslintrc.js" -module.exports = { - root: true, - parser: '@typescript-eslint/parser', - plugins: ['@typescript-eslint'], - extends: [ - 'eslint:recommended', - 'plugin:@typescript-eslint/recommended', - // Add this line - 'prettier', - ], -}; -``` - -:::warning -**We strongly recommend you use Prettier or an equivalent**, not ESLint formatting rules. -See [this issue](https://github.com/typescript-eslint/typescript-eslint/issues/4907 'Issue: Docs: Add our opinion on delegating stylistic issues to a tool such as Prettier #4907') for more information. -::: diff --git a/docs/linting/CONFIGURATIONS.mdx b/docs/linting/CONFIGURATIONS.mdx new file mode 100644 index 00000000000..10d3f6293d5 --- /dev/null +++ b/docs/linting/CONFIGURATIONS.mdx @@ -0,0 +1,141 @@ +--- +id: configs +title: Configurations +--- + +[ESLint shareable configurations](https://eslint.org/docs/latest/developer-guide/shareable-configs) exist to provide a comprehensive base config for you. +`@typescript-eslint/eslint-plugin` includes built-in configurations you can extend from to pull in the recommended starting rules. + +> With the exception of `strict`, all configurations are considered "stable". +> Rule additions and removals are treated as breaking changes and will only be done in major version bumps. + +## Recommended Configurations + +Most projects should extend from at least one of: + +- [`recommended`](#recommended): Recommended rules for code correctness that you can drop in without additional configuration. +- [`recommended-requiring-type-checking`](#recommended-requiring-type-checking): Additional recommended rules that require type information. +- [`strict`](#strict): Additional strict rules that can also catch bugs but are more opinionated than recommended rules. + +:::tip +We recommend most projects use [`recommended-requiring-type-checking`](#recommended-requiring-type-checking) (which requires [typed linting](./Typed_Linting.mdx)). +::: + +:::note +These configurations are our recommended starting points, but **you don't need to use them as-is**. +ESLint allows configuring own rule settings on top of extended configurations. +See [ESLint's Configuring Rules docs](https://eslint.org/docs/user-guide/configuring/rules#using-configuration-files). +::: + +### `recommended` + +Recommended rules for code correctness that you can drop in without additional configuration. +These rules are those whose reports are almost always for a bad practice and/or likely bug. +`recommended` also disables rules known to conflict with this repository, or cause issues in TypeScript codebases. + +```json +{ + "extends": ["plugin:@typescript-eslint/recommended"] +} +``` + +See [`configs/recommended.ts`](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/recommended.ts) for the exact contents of this config. + +:::tip +We strongly recommend all TypeScript projects extend from `plugin:@typescript-eslint/recommended`. +::: + +### `recommended-requiring-type-checking` + +Additional recommended rules that require type information. +Rules in this configuration are similarly useful to those in `recommended`. + +```json +{ + "extends": [ + "plugin:@typescript-eslint/recommended", + "plugin:@typescript-eslint/recommended-requiring-type-checking" + ] +} +``` + +See [`configs/recommended-requiring-type-checking.ts`](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/recommended-requiring-type-checking.ts) for the exact contents of this config. + +:::tip +We recommend all TypeScript projects extend from `plugin:@typescript-eslint/recommended-requiring-type-checking`, with the caveat that rules using type information take longer to run. +See [Linting with Type Information](/linting/typed-linting) for more details. +::: + +### `strict` + +Additional strict rules that can also catch bugs but are more opinionated than recommended rules. + +```json +{ + "extends": [ + "plugin:@typescript-eslint/recommended", + "plugin:@typescript-eslint/recommended-requiring-type-checking", + "plugin:@typescript-eslint/strict" + ] +} +``` + +See [`configs/strict.ts`](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/strict.ts) for the exact contents of this config. + +:::caution +We recommend a TypeScript project extend from `plugin:@typescript-eslint/strict` only if a nontrivial percentage of its developers are highly proficient in TypeScript. +::: + +## Other Configurations + +typescript-eslint includes a scattering of utility configurations used by the recommended configurations. +We don't recommend using these directly; instead, extend from an earlier recommended rule. + +### `all` + +Enables each the rules provided as a part of typescript-eslint. +Note that many rules are not applicable in all codebases, or are meant to be configured. + +See [`configs/all.ts`](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/all.ts) for the exact contents of this config. + +:::warning +We do not recommend a TypeScript projects extend from `plugin:@typescript-eslint/all`. +Many rules conflict with each other and/or are intended to be configured per-project. +::: + +### `base` + +A minimal ruleset that sets only the required parser and plugin options needed to run typescript-eslint. + + + +This config is automatically included if you use any of the recommended configurations. + +### `eslint-recommended` + +This ruleset is meant to be used after extending `eslint:recommended`. +It disables core ESLint rules that are already checked by the TypeScript compiler. +Additionally, it enables rules that promote using the more modern constructs TypeScript allows for. + +```jsonc +{ + "extends": [ + "eslint:recommended", + "plugin:@typescript-eslint/eslint-recommended" + ] +} +``` + +This config is automatically included if you use any of the recommended configurations. + +See [`configs/eslint-recommended.ts`](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/eslint-recommended.ts) for the exact contents of this config. + +## Suggesting Configuration Changes + +If you feel strongly that a specific rule should (or should not) be one of these configurations, please [file an issue](https://github.com/typescript-eslint/typescript-eslint/issues/new?assignees=&labels=package%3A+eslint-plugin%2Cpreset+config+change%2Ctriage&template=09-config-change.yaml&title=Configs%3A+%3Ca+short+description+of+my+proposal%3E) along with a **detailed** argument explaining your reasoning. + +## Formatting + +None of the preset configs provided by typescript-eslint enable formatting rules (rules that only serve to enforce code whitespace and other trivia). +We strongly recommend you use Prettier or an equivalent for formatting your code, not ESLint formatting rules. +See [What About Formatting? > Suggested Usage](./troubleshooting/formatting#suggested-usage). diff --git a/docs/linting/TYPED_LINTING.md b/docs/linting/TYPED_LINTING.md deleted file mode 100644 index 7a037e9a178..00000000000 --- a/docs/linting/TYPED_LINTING.md +++ /dev/null @@ -1,75 +0,0 @@ ---- -id: typed-linting -title: Linting with Type Information ---- - -Some typescript-eslint rules tap utilize the awesome power of TypeScript's type checking APIs to provide much deeper insights into your code. -To tap into TypeScript's additional powers, there are two small changes you need to make to your config file: - -```js title=".eslintrc.js" -module.exports = { - root: true, - parser: '@typescript-eslint/parser', - // Added lines start - parserOptions: { - tsconfigRootDir: __dirname, - project: ['./tsconfig.json'], - }, - // Added lines end - plugins: ['@typescript-eslint'], - extends: [ - 'eslint:recommended', - 'plugin:@typescript-eslint/recommended', - // Add this line - 'plugin:@typescript-eslint/recommended-requiring-type-checking', - ], -}; -``` - -In more detail: - -- `parserOptions.tsconfigRootDir` tells our parser the absolute path of your project's root directory. -- `parserOptions.project` tells our parser the relative path where your project's `tsconfig.json` is. - - If your project is a multi-package monorepo, see [our docs on configuring a monorepo](./typed-linting/MONOREPOS.md). -- `plugin:@typescript-eslint/recommended-requiring-type-checking` is another recommended configuration we provide. This one contains rules that specifically require type information. - -With that done, run the same lint command you ran before. -You may see new rules reporting errors based on type information! - -## FAQs - -### How is performance? - -Typed rules come with a catch. -By including `parserOptions.project` in your config, you incur the performance penalty of asking TypeScript to do a build of your project before ESLint can do its linting. -For small projects this takes a negligible amount of time (a few seconds or less); for large projects, it can take longer. - -Most of our users do not mind this cost as the power and safety of type-aware static analysis rules is worth the tradeoff. -Additionally, most users primarily consume lint errors via IDE plugins which, through caching, do not suffer the same penalties. -This means that generally they usually only run a complete lint before a push, or via their CI, where the extra time often doesn't matter. - -**We strongly recommend you do use type-aware linting**, but the above information is included so that you can make your own, informed decision. - -### I get errors telling me "The file must be included in at least one of the projects provided" - -This error means that the file that's being linted is not included in any of the tsconfig files you provided us. -A lot of the time this happens when users have test files or similar that are not included in their normal tsconfigs. - -Depending on what you want to achieve: - -- If you **do not** want to lint the file: - - Use [one of the options ESLint offers](https://eslint.org/docs/user-guide/configuring#ignoring-files-and-directories) to ignore files, like a `.eslintignore` file, or `ignorePatterns` config. -- If you **do** want to lint the file: - - If you **do not** want to lint the file with [type-aware linting](./TYPED_LINTING.md): - - Use [ESLint's `overrides` configuration](https://eslint.org/docs/user-guide/configuring#configuration-based-on-glob-patterns) to configure the file to not be parsed with type information. - - A popular setup is to omit the above additions from top-level configuration and only apply them to TypeScript files via an override. - - Alternatively, you can add `parserOptions: { project: null }` to an override for the files you wish to exclude. Note that `{ project: undefined }` will not work. - - If you **do** want to lint the file with [type-aware linting](./TYPED_LINTING.md): - - Check the `include` option of each of the tsconfigs that you provide to `parserOptions.project` - you must ensure that all files match an `include` glob, or else our tooling will not be able to find it. - - If your file shouldn't be a part of one of your existing tsconfigs (for example, it is a script/tool local to the repo), then consider creating a new tsconfig (we advise calling it `tsconfig.eslint.json`) in your project root which lists this file in its `include`. For an example of this, you can check out the configuration we use in this repo: - - [`tsconfig.eslint.json`](https://github.com/typescript-eslint/typescript-eslint/blob/main/tsconfig.eslint.json) - - [`.eslintrc.js`](https://github.com/typescript-eslint/typescript-eslint/blob/main/.eslintrc.js) - -## Troubleshooting - -If you're having problems getting this working, please have a look at our [Troubleshooting FAQ](./TROUBLESHOOTING.md). diff --git a/docs/linting/TROUBLESHOOTING.md b/docs/linting/Troubleshooting.mdx similarity index 57% rename from docs/linting/TROUBLESHOOTING.md rename to docs/linting/Troubleshooting.mdx index f37f8780a33..cb59af28447 100644 --- a/docs/linting/TROUBLESHOOTING.md +++ b/docs/linting/Troubleshooting.mdx @@ -28,12 +28,48 @@ If you don't find an existing extension rule, or the extension rule doesn't work > We release a new version our tooling every week. > _Please_ ensure that you [check our the latest list of "extension" rules](https://typescript-eslint.io/rules/#extension-rules) **_before_** filing an issue. -## I get errors telling me "The file must be included in at least one of the projects provided" +## I get errors telling me "ESLint was configured to run ... However, that TSConfig does not / none of those TSConfigs include this file" + +### Fixing the Error + +- If you **do not** want to lint the file: + - Use [one of the options ESLint offers](https://eslint.org/docs/latest/user-guide/configuring/ignoring-code) to ignore files, namely a `.eslintignore` file, or `ignorePatterns` config. +- If you **do** want to lint the file: + - If you **do not** want to lint the file with [type-aware linting](./Typed_Linting.mdx): + - Use [ESLint's `overrides` configuration](https://eslint.org/docs/latest/user-guide/configuring/configuration-files#configuration-based-on-glob-patterns) to configure the file to not be parsed with type information. + - A popular setup is to omit the above additions from top-level configuration and only apply them to TypeScript files via an override. + - Alternatively, you can add `parserOptions: { project: null }` to an override for the files you wish to exclude. Note that `{ project: undefined }` will not work. + - If you **do** want to lint the file with [type-aware linting](./Typed_Linting.mdx): + - Check the `include` option of each of the tsconfigs that you provide to `parserOptions.project` - you must ensure that all files match an `include` glob, or else our tooling will not be able to find it. + - If your file shouldn't be a part of one of your existing tsconfigs (for example, it is a script/tool local to the repo), then consider creating a new tsconfig (we advise calling it `tsconfig.eslint.json`) in your project root which lists this file in its `include`. For an example of this, you can check out the configuration we use in this repo: + - [`tsconfig.eslint.json`](https://github.com/typescript-eslint/typescript-eslint/blob/main/tsconfig.eslint.json) + - [`.eslintrc.js`](https://github.com/typescript-eslint/typescript-eslint/blob/main/.eslintrc.js) + +### More Details + +This error may appear from the combination of two things: + +- The ESLint configuration for the source file specifies at least one TSConfig file in `parserOptions.project` +- None of those TSConfig files includes the source file being linted + - Note that files with the same name and different extension may not be recognized by TypeScript: see [`parserOptions.project` docs](https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/parser#parseroptionsproject) + +When TSConfig files are specified for parsing a source file, `@typescript-eslint/parser` will use the first TSConfig that is able to include that source file (per [aka.ms/tsconfig#include](https://www.typescriptlang.org/tsconfig#include)) to generate type information. +However, if no specified TSConfig includes the source file, the parser won't be able to generate type information. + +This error most commonly happens on config files or similar that are not included in their project TSConfig(s). +For example, many projects have files like: + +- An `.eslintrc.cjs` with `parserOptions.project: ["./tsconfig.json"]` +- A `tsconfig.json` with `include: ["src"]` + +In that case, viewing the `.eslintrc.cjs` in an IDE with the ESLint extension will show the error notice that the file couldn't be linted because it isn't included in `tsconfig.json`. + +See our docs on [type aware linting](./Typed_Linting.mdx) for more information. -This error means that the file that's being linted is not included in any of the TSConfig files you provided us. -This happens when users have test files, config files, or similar that are not included. +## I get errors telling me "The file must be included in at least one of the projects provided" -See our docs on [type aware linting](./TYPED_LINTING.md#i-get-errors-telling-me-the-file-must-be-included-in-at-least-one-of-the-projects-provided) for solutions. +You're using an outdated version of `@typescript-eslint/parser`. +Update to the latest version to see a more informative version of this error message, explained [above](#i-get-errors-telling-me-eslint-was-configured-to-run--however-that-tsconfig-does-not--none-of-those-tsconfigs-include-this-file 'backlink to I get errors telling me ESLint was configured to run ...'). ## I use a framework (like Vue) that requires custom file extensions, and I get errors like "You should add `parserOptions.extraFileExtensions` to your config" @@ -50,12 +86,34 @@ module.exports = { }; ``` +## I am running into errors when parsing TypeScript in my .vue files + +If you are running into issues parsing .vue files, it might be because parsers like [`vue-eslint-parser`](https://www.npmjs.com/package/vue-eslint-parser) are required to parse `.vue` files. In this case you can move `@typescript-eslint/parser` inside `parserOptions` and use `vue-eslint-parser` as the top level parser. + +```diff +- "parser": "@typescript-eslint/parser", ++ "parser": "vue-eslint-parser", + "parserOptions": { ++ "parser": "@typescript-eslint/parser", + "sourceType": "module" + } +``` + +The `parserOptions.parser` option can also specify an object to specify multiple parsers. See the [`vue-eslint-parser` usage guide](https://eslint.vuejs.org/user-guide/#usage) for more details. + ## One of my lint rules isn't working correctly on a pure JavaScript file This is to be expected - ESLint rules do not check file extensions on purpose, as it causes issues in environments that use non-standard extensions (for example, a `.vue` and a `.md` file can both contain TypeScript code to be linted). If you have some pure JavaScript code that you do not want to apply certain lint rules to, then you can use [ESLint's `overrides` configuration](https://eslint.org/docs/user-guide/configuring#configuration-based-on-glob-patterns) to turn off certain rules, or even change the parser based on glob patterns. +## Should I run ESLint on transpiled output JavaScript files? + +No. + +Source TypeScript files have all the content of output JavaScript files, plus type annotations. +There's no benefit to also linting output JavaScript files. + ## TypeScript should be installed locally Make sure that you have installed TypeScript locally i.e. by using `npm install typescript`, not `npm install -g typescript`, @@ -67,7 +125,7 @@ See [#2041](https://github.com/typescript-eslint/typescript-eslint/issues/2041) ESLint core contains the rule [`no-restricted-syntax`](https://eslint.org/docs/rules/no-restricted-syntax). This generic rule allows you to specify a [selector](https://eslint.org/docs/developer-guide/selectors) for the code you want to ban, along with a custom error message. -You can use an AST visualization tool such as [TypeScript ESLint playground](https://typescript-eslint.io/play#showAST=es) > _Options_ > _AST Explorer_ on its left sidebar by selecting _ESTree_ to help in figuring out the structure of the AST that you want to ban. +You can use an AST visualization tool such as [typescript-eslint playground](https://typescript-eslint.io/play#showAST=es) > _Options_ > _AST Explorer_ on its left sidebar by selecting _ESTree_ to help in figuring out the structure of the AST that you want to ban. For example, you can ban enums (or some variation of) using one of the following configs: @@ -169,75 +227,25 @@ For example: See [this issue comment](https://github.com/typescript-eslint/typescript-eslint/issues/4102#issuecomment-963265514) for more details. -## My linting feels really slow - -As mentioned in the [type-aware linting doc](./TYPED_LINTING.md), if you're using type-aware linting, your lint times should be roughly the same as your build times. - -If you're experiencing times much slower than that, then there are a few common culprits. - -### Wide includes in your `tsconfig` - -When using type-aware linting, you provide us with one or more tsconfigs. -We then will pre-parse all files so that full and complete type information is available. - -If you provide very wide globs in your `include` (such as `**/*`), it can cause many more files than you expect to be included in this pre-parse. -Additionally, if you provide no `include` in your tsconfig, then it is the same as providing the widest glob. - -Wide globs can cause TypeScript to parse things like build artifacts, which can heavily impact performance. -Always ensure you provide globs targeted at the folders you are specifically wanting to lint. - -### Wide includes in your ESLint options - -Specifying `tsconfig.json` paths in your ESLint commands is also likely to cause much more disk IO than expected. -Instead of globs that use `**` to recursively check all folders, prefer paths that use a single `*` at a time. - -```diff -- eslint --parser-options project:./**/tsconfig.json -+ eslint --parser-options project:./packages/*/tsconfig.json -``` - -See [Glob pattern in parser's option "project" slows down linting](https://github.com/typescript-eslint/typescript-eslint/issues/2611) for more details. - -### `eslint-plugin-prettier` +## Changes to one file are not reflected when linting other files in my IDE -This plugin surfaces prettier formatting problems at lint time, helping to ensure your code is always formatted. -However this comes at a quite a large cost - in order to figure out if there is a difference, it has to do a prettier format on every file being linted. -This means that each file will be parsed twice - once by ESLint, and once by Prettier. -This can add up for large codebases. +> tl;dr: Restart your ESLint server to force an update. -Instead of using this plugin, we recommend using prettier's `--list-different` flag to detect if a file has not been correctly formatted. -For example, our CI is setup to run the following command automatically, which blocks PRs that have not been formatted: - -```bash npm2yarn -npm run prettier --list-different \"./**/*.{ts,mts,cts,tsx,js,mjs,cjs,jsx,json,md,css}\" -``` +ESLint currently does not have any way of telling parsers such as ours when an arbitrary file is changed on disk. +That means if you change file A that is imported by file B, it won't update lint caches for file B -- even if file B's text contents have changed. +Sometimes the only solution is to restart your ESLint editor extension altogether. -### `eslint-plugin-import` +See [this issue comment](https://github.com/typescript-eslint/typescript-eslint/issues/5845#issuecomment-1283248238 'GitHub issue 5845, comment 1283248238: details on ESLint cross-file caching') for more information. -This is another great plugin that we use ourselves in this project. -However there are a few rules which can cause your lints to be really slow, because they cause the plugin to do its own parsing, and file tracking. -This double parsing adds up for large codebases. +:::tip +[VS Code's ESLint extension](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint) provides an `ESLint: Restart ESLint Server` action. +::: -There are many rules that do single file static analysis, but we provide the following recommendations. +### I get `no-unsafe-*` complaints for cross-file changes -We recommend you do not use the following rules, as TypeScript provides the same checks as part of standard type checking: +See [Changes to one file are not reflected in linting other files in my IDE](#changes-to-one-file-are-not-reflected-in-linting-other-files-in-my-ide). +Rules such as [`no-unsafe-argument`](https://typescript-eslint.io/rules/no-unsafe-argument), [`no-unsafe-assignment`](https://typescript-eslint.io/rules/no-unsafe-assignment), and [`no-unsafe-call`](https://typescript-eslint.io/rules/no-unsafe-call) are often impacted. -- `import/named` -- `import/namespace` -- `import/default` -- `import/no-named-as-default-member` - -The following rules do not have equivalent checks in TypeScript, so we recommend that you only run them at CI/push time, to lessen the local performance burden. - -- `import/no-named-as-default` -- `import/no-cycle` -- `import/no-unused-modules` -- `import/no-deprecated` - -### The `indent` / `@typescript-eslint/indent` rules - -This rule helps ensure your codebase follows a consistent indentation pattern. -However this involves a _lot_ of computations across every single token in a file. -Across a large codebase, these can add up, and severely impact performance. +## My linting feels really slow -We recommend not using this rule, and instead using a tool like [`prettier`](https://www.npmjs.com/package/prettier) to enforce a standardized formatting. +If you think you're having issues with performance, see our [Performance Troubleshooting documentation](./troubleshooting/Performance.md). diff --git a/docs/linting/Typed_Linting.mdx b/docs/linting/Typed_Linting.mdx new file mode 100644 index 00000000000..7d9de2f25bb --- /dev/null +++ b/docs/linting/Typed_Linting.mdx @@ -0,0 +1,60 @@ +--- +id: typed-linting +title: Linting with Type Information +--- + +Some typescript-eslint rules utilize the awesome power of TypeScript's type checking APIs to provide much deeper insights into your code. +To tap into TypeScript's additional powers, there are two small changes you need to make to your config file: + +```js title=".eslintrc.js" +module.exports = { + extends: [ + 'eslint:recommended', + 'plugin:@typescript-eslint/recommended', + // Add this line + 'plugin:@typescript-eslint/recommended-requiring-type-checking', + ], + plugins: ['@typescript-eslint'], + parser: '@typescript-eslint/parser', + // Added lines start + parserOptions: { + project: ['./tsconfig.json'], + tsconfigRootDir: __dirname, + }, + // Added lines end + root: true, +}; +``` + +In more detail: + +- `plugin:@typescript-eslint/recommended-requiring-type-checking` is another [recommended configuration](./CONFIGURATIONS.mdx) we provide. This one contains recommended rules that additionally require type information. +- `parserOptions.project` tells our parser the relative path where your project's `tsconfig.json` is. + - If your project is a multi-package monorepo, see [our docs on configuring a monorepo](./typed-linting/Monorepos.mdx). +- `parserOptions.tsconfigRootDir` tells our parser the absolute path of your project's root directory (see [Parser#tsconfigRootDir](../architecture/Parser.mdx#tsconfigRootDir)). + +With that done, run the same lint command you ran before. +You may see new rules reporting errors based on type information! + +## FAQs + +### How is performance? + +Typed rules come with a catch. +By including `parserOptions.project` in your config, you incur the performance penalty of asking TypeScript to do a build of your project before ESLint can do its linting. +For small projects this takes a negligible amount of time (a few seconds or less); for large projects, it can take longer. + +Most of our users do not mind this cost as the power and safety of type-aware static analysis rules is worth the tradeoff. +Additionally, most users primarily consume lint errors via IDE plugins which, through caching, do not suffer the same penalties. +This means that generally they usually only run a complete lint before a push, or via their CI, where the extra time often doesn't matter. + +**We strongly recommend you do use type-aware linting**, but the above information is included so that you can make your own, informed decision. + +### I get errors telling me "The file must be included in at least one of the projects provided" + +You're using an outdated version of `@typescript-eslint/parser`. +Update to the latest version to see a more informative version of this error message, explained in our [Troubleshooting and FAQs page](./Troubleshooting.mdx#i-get-errors-telling-me-eslint-was-configured-to-run--however-that-tsconfig-does-not--none-of-those-tsconfigs-include-this-file). + +## Troubleshooting + +If you're having problems getting this working, please have a look at our [Troubleshooting and FAQs page](./Troubleshooting.mdx). diff --git a/docs/linting/troubleshooting/FORMATTING.md b/docs/linting/troubleshooting/FORMATTING.md deleted file mode 100644 index d39fdd56824..00000000000 --- a/docs/linting/troubleshooting/FORMATTING.md +++ /dev/null @@ -1,34 +0,0 @@ ---- -id: formatting -title: What About Formatting? ---- - -We strongly recommend against using ESLint for formatting. -We strongly recommend using [Prettier](https://prettier.io), [dprint](https://dprint.dev), or an equivalent instead. - -## Formatters vs. Linters - -**Formatters** are tools that verify and correct whitespace issues in code, such as spacing and newlines. -Formatters typically run very quickly because they are only concerned with changing whitespace, not code logic or naming. - -**Linters** are tools that verify and correct logical and non-whitespace style issues in code, such as naming consistency and bug detection. -Linters often take seconds or more to run because they apply many logical rules to code. - -### Problems with Using Linters as Formatters - -Linters apply much more work than formatters -- often including potentially multiple rounds of rule fixers. -That generally makes them run orders of magnitude slower. - -Additionally, modern formatters such as Prettier are architected in a way that applies formatting to all code regardless of original formatting. -Linters typically run on a rule-by-rule basis, typically resulting in many edge cases and missed coverage in formatting. - -## ESLint Core and Formatting - -Per [ESLint's 2020 Changes to Rule Policies blog post](https://eslint.org/blog/2020/05/changes-to-rules-policies#what-are-the-changes): - -> Stylistic rules are frozen - we won't be adding any more options to stylistic rules. -> We've learned that there's no way to satisfy everyone's personal preferences, and most of the rules already have a lot of difficult-to-understand options. -> Stylistic rules are those related to spacing, conventions, and generally anything that does not highlight an error or a better way to do something. - -We support the ESLint team's decision and backing logic to move away from stylistic rules. -With the exception of bug fixes, no new formatting-related pull requests will be accepted into typescript-eslint. diff --git a/docs/linting/troubleshooting/Formatting.mdx b/docs/linting/troubleshooting/Formatting.mdx new file mode 100644 index 00000000000..14c9d102dd0 --- /dev/null +++ b/docs/linting/troubleshooting/Formatting.mdx @@ -0,0 +1,62 @@ +--- +id: formatting +title: What About Formatting? +--- + +We strongly recommend against using ESLint for formatting. +We strongly recommend using [Prettier](https://prettier.io), [dprint](https://dprint.dev), or an equivalent instead. + +## ESLint Core and Formatting + +Per [ESLint's 2020 Changes to Rule Policies blog post](https://eslint.org/blog/2020/05/changes-to-rules-policies#what-are-the-changes): + +> Stylistic rules are frozen - we won't be adding any more options to stylistic rules. +> We've learned that there's no way to satisfy everyone's personal preferences, and most of the rules already have a lot of difficult-to-understand options. +> Stylistic rules are those related to spacing, conventions, and generally anything that does not highlight an error or a better way to do something. + +We support the ESLint team's decision and backing logic to move away from stylistic rules. +With the exception of bug fixes, no new formatting-related pull requests will be accepted into typescript-eslint. + +## Formatters vs. Linters + +**Formatters** are tools that verify and correct whitespace issues in code, such as spacing and newlines. +Formatters typically run very quickly because they are only concerned with changing whitespace, not code logic or naming. + +**Linters** are tools that verify and correct logical and non-whitespace style issues in code, such as naming consistency and bug detection. +Linters often take seconds or more to run because they apply many logical rules to code. + +### Problems with Using Linters as Formatters + +Linters are designed to run in a parse, check, report, fix cycle. This means that there is a lot of intermediate work that needs to be done before a linter can fix a formatting issue with your code. + +Additionally linters typically run each rule isolated from one another. This has several problems with it such as: + +- any two lint rules can't share config meaning one lint rule's fixer might introduce a violation of another lint rule's fixer (eg one lint rule might use the incorrect indentation character). +- lint rule fixers can conflict (apply to the same code range), forcing the linter to perform an additional cycle to attempt to apply a fixer to a clean set of code. + +These problems cause a linter to be much slower and, more importantly, much less consistent and less able to handle edge-cases than a purpose-built formatter. + +Modern formatters such as Prettier are architected in a way that applies formatting to all code regardless of original formatting which helps them be more consistent. + +### Suggested Usage - Prettier + +We recommend using [`eslint-config-prettier`](https://github.com/prettier/eslint-config-prettier) to disable formatting rules in your ESLint configuration. +You can then configure your formatter separately from ESLint. + +Using this config by adding it to the end of your `extends`: + +```js title=".eslintrc.js" +module.exports = { + extends: [ + 'eslint:recommended', + 'plugin:@typescript-eslint/recommended', + // Add this line + 'prettier', + ], + parser: '@typescript-eslint/parser', + plugins: ['@typescript-eslint'], + root: true, +}; +``` + +Note that even if you don't use `prettier`, you can use `eslint-config-prettier` as it exclusively turns **off** all formatting rules. diff --git a/docs/linting/troubleshooting/Performance.md b/docs/linting/troubleshooting/Performance.md new file mode 100644 index 00000000000..f4d0f9e3d53 --- /dev/null +++ b/docs/linting/troubleshooting/Performance.md @@ -0,0 +1,150 @@ +--- +id: performance-troubleshooting +title: Performance Troubleshooting +--- + +As mentioned in the [type-aware linting doc](../Typed_Linting.mdx), if you're using type-aware linting, your lint times should be roughly the same as your build times. + +If you're experiencing times much slower than that, then there are a few common culprits. + +## Wide includes in your `tsconfig` + +When using type-aware linting, you provide us with one or more tsconfigs. +We then will pre-parse all files so that full and complete type information is available. + +If you provide very wide globs in your `include` (such as `**/*`), it can cause many more files than you expect to be included in this pre-parse. +Additionally, if you provide no `include` in your tsconfig, then it is the same as providing the widest glob. + +Wide globs can cause TypeScript to parse things like build artifacts, which can heavily impact performance. +Always ensure you provide globs targeted at the folders you are specifically wanting to lint. + +## Wide includes in your ESLint options + +Specifying `tsconfig.json` paths in your ESLint commands is also likely to cause much more disk IO than expected. +Instead of globs that use `**` to recursively check all folders, prefer paths that use a single `*` at a time. + +```js title=".eslintrc.js" +module.exports = { + extends: [ + 'eslint:recommended', + 'plugin:@typescript-eslint/recommended', + 'plugin:@typescript-eslint/recommended-requiring-type-checking', + ], + parser: '@typescript-eslint/parser', + parserOptions: { + tsconfigRootDir: __dirname, + // Remove this line + project: ['./**/tsconfig.json'], + // Add this line + project: ['./packages/*/tsconfig.json'], + }, + plugins: ['@typescript-eslint'], + root: true, +}; +``` + +See [Glob pattern in parser's option "project" slows down linting](https://github.com/typescript-eslint/typescript-eslint/issues/2611) for more details. + +## The `indent` / `@typescript-eslint/indent` rules + +This rule helps ensure your codebase follows a consistent indentation pattern. +However this involves a _lot_ of computations across every single token in a file. +Across a large codebase, these can add up, and severely impact performance. + +We recommend not using this rule, and instead using a tool like [`prettier`](https://www.npmjs.com/package/prettier) to enforce a standardized formatting. + +See our [documentation on formatting](./Formatting.mdx) for more information. + +## `eslint-plugin-prettier` + +This plugin surfaces prettier formatting problems at lint time, helping to ensure your code is always formatted. +However this comes at a quite a large cost - in order to figure out if there is a difference, it has to do a prettier format on every file being linted. +This means that each file will be parsed twice - once by ESLint, and once by Prettier. +This can add up for large codebases. + +Instead of using this plugin, we recommend using prettier's `--list-different` flag to detect if a file has not been correctly formatted. +For example, our CI is setup to run the following command automatically, which blocks PRs that have not been formatted: + +```bash npm2yarn +npm run prettier --list-different \"./**/*.{ts,mts,cts,tsx,js,mjs,cjs,jsx,json,md,css}\" +``` + +## `eslint-plugin-import` + +This is another great plugin that we use ourselves in this project. +However there are a few rules which can cause your lints to be really slow, because they cause the plugin to do its own parsing, and file tracking. +This double parsing adds up for large codebases. + +There are many rules that do single file static analysis, but we provide the following recommendations. + +We recommend you do not use the following rules, as TypeScript provides the same checks as part of standard type checking: + +- `import/named` +- `import/namespace` +- `import/default` +- `import/no-named-as-default-member` + +The following rules do not have equivalent checks in TypeScript, so we recommend that you only run them at CI/push time, to lessen the local performance burden. + +- `import/no-named-as-default` +- `import/no-cycle` +- `import/no-unused-modules` +- `import/no-deprecated` + +### `import/extensions` + +#### Enforcing extensions are used + +If you want to enforce file extensions are always used and you're **NOT** using `moduleResolution` `node16` or `nodenext`, then there's not really a good alternative for you, and you should continue using the `import/extensions` lint rule. + +If you want to enforce file extensions are always used and you **ARE** using `moduleResolution` `node16` or `nodenext`, then you don't need to use the lint rule at all because TypeScript will automatically enforce that you include extensions! + +#### Enforcing extensions are not used + +On the surface `import/extensions` seems like it should be fast for this use case, however the rule isn't just a pure AST-check - it has to resolve modules on disk so that it doesn't false positive on cases where you are importing modules with an extension as part of their name (eg `foo.js` resolves to `node_modules/foo.js/index.js`, so the `.js` is required). This disk lookup is costly and thus makes the rule slow. + +If your project doesn't use any `npm` packages with a file extension in their name, nor do you name your files with two extensions (like `bar.js.ts`), then this extra cost probably isn't worth it, and you can use a much simpler check using the [`no-restricted-syntax`](https://eslint.org/docs/latest/rules/no-restricted-syntax) lint rule. + +The below config is several orders of magnitude faster than `import/extensions` as it does not do disk lookups, however it will false-positive on cases like the aforementioned `foo.js` module. + +```js +function banImportExtension(extension) { + const message = `Unexpected use of file extension (.${extension}) in import`; + const literalAttributeMatcher = `Literal[value=/\\.${extension}$/]`; + return [ + { + // import foo from 'bar.js'; + selector: `ImportDeclaration > ${literalAttributeMatcher}.source`, + message, + }, + { + // const foo = import('bar.js'); + selector: `ImportExpression > ${literalAttributeMatcher}.source`, + message, + }, + { + // type Foo = typeof import('bar.js'); + selector: `TSImportType > TSLiteralType > ${literalAttributeMatcher}`, + message, + }, + { + // const foo = require('foo.js'); + selector: `CallExpression[callee.name = "require"] > ${literalAttributeMatcher}.arguments`, + message, + }, + ]; +} + +module.exports = { + // ... other config ... + rules: { + 'no-restricted-syntax': [ + 'error', + ...banImportExtension('js'), + ...banImportExtension('jsx'), + ...banImportExtension('ts'), + ...banImportExtension('tsx'), + ], + }, +}; +``` diff --git a/docs/linting/troubleshooting/TSLINT.md b/docs/linting/troubleshooting/TSLint.mdx similarity index 94% rename from docs/linting/troubleshooting/TSLINT.md rename to docs/linting/troubleshooting/TSLint.mdx index a145f9fca61..8eb61e85713 100644 --- a/docs/linting/troubleshooting/TSLINT.md +++ b/docs/linting/troubleshooting/TSLint.mdx @@ -17,7 +17,7 @@ You can look at [the alternatives list](https://github.com/typescript-eslint/typ There is also the ultimate fallback option of using both linters together for a while during your transition if you absolutely have to by using TSLint _within_ ESLint. -For this option, check out [`@typescript-eslint/eslint-plugin-tslint`](https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/eslint-plugin-tslint). +For this option, check out [`@typescript-eslint/eslint-plugin-tslint`](../../architecture/ESLint_Plugin_TSLint.mdx). ## Why Deprecate TSLint? diff --git a/docs/linting/typed-linting/MONOREPOS.md b/docs/linting/typed-linting/Monorepos.mdx similarity index 71% rename from docs/linting/typed-linting/MONOREPOS.md rename to docs/linting/typed-linting/Monorepos.mdx index a67d05a9c2c..7b01b81d662 100644 --- a/docs/linting/typed-linting/MONOREPOS.md +++ b/docs/linting/typed-linting/Monorepos.mdx @@ -38,8 +38,9 @@ Be sure to update your `.eslintrc.js` to point at this new config file. ## One `tsconfig.json` per package (and an optional one in the root) -The `parserOptions.project` option introduced in [Linting with Type Information](../TYPED_LINTING.md) accepts an array of relative paths. +The `parserOptions.project` option introduced in [Linting with Type Information](../Typed_Linting.mdx) accepts an array of relative paths. Paths may be provided as [Node globs](https://github.com/isaacs/node-glob/blob/f5a57d3d6e19b324522a3fa5bdd5075fd1aa79d1/README.md#glob-primer). +For each file being linted, the first matching project path will be used as its backing TSConfig. ```js title=".eslintrc.js" module.exports = { @@ -61,6 +62,33 @@ module.exports = { }; ``` +### Wide globs in `parserOptions.project` + +Using wide globs `**` in your `parserOptions.project` may degrade linting performance. +Instead of globs that use `**` to recursively check all folders, prefer paths that use a single `*` at a time. + +```js title=".eslintrc.js" +module.exports = { + extends: [ + 'eslint:recommended', + 'plugin:@typescript-eslint/recommended', + 'plugin:@typescript-eslint/recommended-requiring-type-checking', + ], + parser: '@typescript-eslint/parser', + parserOptions: { + tsconfigRootDir: __dirname, + // Remove this line + project: ['./tsconfig.eslint.json', './**/tsconfig.json'], + // Add this line + project: ['./tsconfig.eslint.json', './packages/*/tsconfig.json'], + }, + plugins: ['@typescript-eslint'], + root: true, +}; +``` + +See [Glob pattern in parser's option "project" slows down linting](https://github.com/typescript-eslint/typescript-eslint/issues/2611) for more details. + ### Important note regarding large (> 10) multi-package monorepos We've had reports that for sufficiently large and/or interdependent projects, you may run into OOMs using this approach. @@ -76,4 +104,4 @@ As an interim workaround, consider one of the following: ## Troubleshooting -If you're having problems getting this working, please have a look at our [Troubleshooting FAQ](../TROUBLESHOOTING.md). +If you're having problems getting this working, please have a look at our [Troubleshooting FAQ](../Troubleshooting.mdx). diff --git a/docs/maintenance/Branding.mdx b/docs/maintenance/Branding.mdx new file mode 100644 index 00000000000..d4e84d90dea --- /dev/null +++ b/docs/maintenance/Branding.mdx @@ -0,0 +1,42 @@ +--- +id: branding +title: Branding +--- + +This document serves as a guide for how we generally describe or represent typescript-eslint. +It's fine if you don't always adhere to it. + +## Terminology + +### Name + + + +Our project name is **_"typescript-eslint"_**. +We sometimes refer to it as _"ts-eslint"_ for short. + +_"typescript-eslint"_ is preferred over _"TypeScript ESLint"_ or _"TypeScript-ESLint"_ because ESLint and TypeScript are written in abbreviated Pascal Case. +Combining lowercase with a dash helps differentiate us. + + + +### Slogan + +> The tooling that enables ESLint and Prettier to support TypeScript. + +## Visuals + +Our primary brand color is `#2656c7`, the halfway point between ESLint's `#4b32c3` purple and TypeScript's `#007acc` blue. +You can call it _blurple_ if you want. + +Our logo is also a halfway between [ESLint's logo](https://en.wikipedia.org/wiki/ESLint#/media/File:ESLint_logo.svg) and [TypeScript's logo](https://en.wikipedia.org/wiki/TypeScript#/media/File:Typescript.svg): + +typescript-eslint logo + +- [Logo PNG download](/img/logo.png) +- [Logo SVG download](/img/logo.svg) diff --git a/docs/maintenance/Issues.mdx b/docs/maintenance/Issues.mdx new file mode 100644 index 00000000000..fc8a89711de --- /dev/null +++ b/docs/maintenance/Issues.mdx @@ -0,0 +1,140 @@ +--- +id: issues +title: Issues +--- + +This document serves as a guide for how you might manage our [GitHub Issues](https://docs.github.com/issues), also known as issue triaging. + +Use your best judgement when triaging issues, and most of all remember to be **kind, friendly, and encouraging** when responding to users. +Many users are new to open source and/or typed linting. +It's imperative we give them a positive, uplifting experience. + +:::tip +If you're ever unsure on any part of issue management, don't hesitate to loop in a maintainer that has more context to help! +::: + +## Issue Flow + +:::note +We include a set of common responses to issues in [`.github/replies.yml`](https://github.com/typescript-eslint/typescript-eslint/blob/main/.github/replies.yml), intended to be used with the [Refined Saved Replies](https://github.com/JoshuaKGoldberg/refined-saved-replies) extension. +Don't treat these as exact responses you must use: they're just a starting copy+paste helper. +Please do adopt your specific responses to your personal tone and to match the thread for non-straightforward issues. +::: + +[Issues pending triage](https://github.com/typescript-eslint/typescript-eslint/issues?q=is%3Aopen+is%3Aissue+label%3Atriage) are searchable the `triage` label. +That label is added automatically when a new issue is created. +Most issues go through the following review flow when created or updated: + +1. A maintainer ensures the issue is valid: + - If the poster didn't fill out an appropriate template with enough information: + - Add the `please fill out the template` and `awaiting response` labels + - Ask the poster for more information using a _Needs More Info_ response + - If it's a duplicate of an issue that already exists: + - Add the `duplicate` label and remove the `bug` label + - If it's an obvious duplicate, post a _Clearly Duplicate Issue_ response + - If it's not an obvious duplicate, link to the existing issue and explain why + - If the code is working as intended: + - Add the `working as intended` label and remove the `bug` and `triage` labels + - If the behavior is due to the user doing something wrong, such as an incorrect config: + - Add the `fix: user error` label + - [This issue search has some examples of closing comments](https://github.com/typescript-eslint/typescript-eslint/issues?q=is%3Aissue+sort%3Aupdated-desc+label%3A%22fix%3A+user+error%22+is%3Aclosed) + - If the behavior is otherwise expected, [this issue search has some examples of closing comments](https://github.com/typescript-eslint/typescript-eslint/issues?q=is%3Aissue+sort%3Aupdated-desc+label%3A%22working+as+intended%22+-label%3A%22fix%3A+user+error%22+is%3Aclosed+) + - You needn't go into too much detail in your comment - just enough to explain it +2. If the report is valid, add the `accepting prs` label and remove the `triage` label +3. If you know the rough steps for a fix, consider writing a comment with links to codebase to help someone put together a fix +4. If you think that the fix is relatively straightforward, consider also adding the `good first issue` label + +Whenever an issue is waiting for the reporter to provide more information, it should be given the `awaiting response` label. +When more information is provided: + +- If you have time to go through the triage flow again, do so +- If you don't have time, add the `triage` label and remove the `awaiting response` label + +:::tip +If your link is both a "permalink" (includes a commit hash instead of a branch name) and has a line number/line range then GitHub will embed the code in your comment. +When viewing a file in GitHub pressing `y` will update the URL to a "permalink" with the current commit hash, then you can select the relevant lines and paste that URL into the comment. +::: + +### Determining Whether Code is Working As Intended + +As you become more familiar with the codebase and how everything works, this will be easier to do intuitively, but to begin with, this will likely involve investigating the documentation, code, and tests to determine if it's a bug or working as intended. +In general, if there is a passing test or documented example that is the same as or similar to the repro code — that indicates it's working as intended. +If you can't find anything that matches, use your best judgement based on the spirit of the code. + +### Looking for Duplicates + +It's worth noting that, occasionally, a user will intentionally raise a duplicate issue because they feel the original issue was closed when it shouldn't have been. +If this is the case, you should read the original issue to gather context, understand the reason for it being closed, and determine if the new issue raises any new or relevant point that requires addressing. + +## Skipping Steps + +As you become more familiar with the codebase and how it's supposed to behave you'll be able to skip steps or do things out of order as you see fit. +For example, you may be able to identify if a bug report is "working as intended", or you might recognize an issue as a duplicate without having a completely filled-out issue. +In such cases you can forgo the back-and-forth and just skip to the closing steps. + +## Specific Issue Types + +### 🐛 Bug Reports + +#### 🐞 "Simple" Bugs + +A simple bug is a bug that can be reproduced in a single TS file plus an ESLint config (and possibly a TSConfig) - i.e. an issue reproducible on https://typescript-eslint.io/play. +The vast majority of bug reports fall into this category. + +If you cannot reproduce the issue as described using the issue's provided playground reproduction, it has not provided enough information. +Consider using a specific response like the _Needs Playground Reproduction_ response. + +#### 🦟 "Complex" Bugs + +A complex bug is a bug that requires multiple files to reproduce. +This is the rarer case, but does happen when people are using library types or if there are issues when types are imported. + +These bugs should be reported with a link to a GitHub repository that can be checked out to reproduce the issue. +If you cannot reproduce the issue as described using repository's README.md and issue description, it has not provided enough information. +Consider using a specific response like the _Needs Full Reproduction_ response. + +### 🏗 Feature Requests + +For any feature request, make sure the requested support is either: + +- Very useful for at least one commonly used way to run TypeScript (e.g. tsc-built CLI package; bundler-managed web app) +- Relevant for _most_ projects that would be using typescript-eslint + +We avoid features that: + +- Are only relevant for a minority of users, as they aren't likely worth the maintenance burden +- Aren't TypeScript-specific (e.g. should be in ESLint core instead) +- Are only relevant with specific userland frameworks or libraries, such as Jest or React +- Are for "formatting" functionality (we [strongly recommend users use a separate dedicated formatter](../linting/troubleshooting/Formatting.mdx)) + +#### ✨ Rule Enhancements + +We're generally accepting of rule enhancements that meet the above feature request criteria. +If a rule enhancement would substantially change the target area of the rule, consider whether it should instead be a new rule. +Common signs of this are the rule's original name now being inaccurate, or some options being relevant just for the old functionality. + +Enhancements that can cause new reports to be reported are considered breaking changes. +We have two common strategies for them: + +- Treat the enhancement as a breaking change, and block merging it until the next major version +- Add an option to disable the new logic: which is a breaking change if opt-in, and a non-breaking change if opt-out +- Add an option to enable the new logic: which is a breaking change if opt-out, and a non-breaking change if opt-in + +See [Can we standardize logical direction of rule options?](https://github.com/typescript-eslint/typescript-eslint/discussions/6101) for context on naming options. + +For enhancements meant to limit which kinds of nodes the rule targets, mark the issue as blocked on [RFC: Common format to specify a type or value as a rule option](https://github.com/typescript-eslint/typescript-eslint/discussions/6017). + +#### 🚀 New Rules + +We're generally accepting of new rules that meet the above feature request criteria. +The biggest exception is rules that can roughly be implemented with [`@typescript-eslint/ban-types`](https://typescript-eslint.io/rules/ban-types) and/or [`no-restricted-syntax`](https://eslint.org/docs/latest/rules/no-restricted-syntax). + +## Pruning Old Issues + +Every so often, we like to [search for open issues `awaiting response`](https://github.com/typescript-eslint/typescript-eslint/issues?q=is%3Aopen+is%3Aissue+label%3A%22awaiting+response%22) to find ones that might have been forgotten. +Our flow for issues that have been waiting for >=1 month is: + +1. Ping the author with a message like the _Checking In_ template +2. Add the `stale` label to the issue +3. Wait 2 weeks +4. If they still haven't responded, close the issue with a message like the _Pruning Stale Issue_ template diff --git a/docs/maintenance/Pull_Requests.mdx b/docs/maintenance/Pull_Requests.mdx new file mode 100644 index 00000000000..37c6b40256c --- /dev/null +++ b/docs/maintenance/Pull_Requests.mdx @@ -0,0 +1,34 @@ +--- +id: pull-requests +title: Pull Requests +--- + +This document serves as a guide for how you might review pull requests. + +Use your best judgement when reviewing PRs, and most of all remember to be **kind, friendly, and encouraging** when responding to users. +Many users are new to open source and/or typed linting. +It's imperative we give them a positive, uplifting experience. + +:::tip +If you're ever unsure on any part of PR reviews, don't hesitate to loop in a maintainer that has more context to help! +::: + +## PR Flow + +:::note +We include a set of common responses to PRs in [`.github/replies.yml`](https://github.com/typescript-eslint/typescript-eslint/blob/main/.github/replies.yml), intended to be used with the [Refined Saved Replies](https://github.com/JoshuaKGoldberg/refined-saved-replies) extension. +Don't treat these as exact responses you must use: they're just a starting copy+paste helper. +Please do adopt your specific responses to your personal tone and to match the thread for non-straightforward PRs. +::: + +TODO: This will be filled out... soon! + +## Pruning Old PRs + +Every so often, we like to [search for open PRs `awaiting response`](https://github.com/typescript-eslint/typescript-eslint/pulls?q=is%3Aopen+is%3Apr+label%3A%22awaiting+response%22) to find ones that might have been forgotten. +Our flow for PRs that have been waiting for >=1 month is: + +1. Ping the author with a message like the _Checking In_ template +2. Add the `stale` label to the PR +3. Wait 2 weeks +4. If they still haven't responded, close the PR with a message like the _Pruning Stale PR_ template diff --git a/docs/maintenance/Releases.mdx b/docs/maintenance/Releases.mdx new file mode 100644 index 00000000000..87fb87529df --- /dev/null +++ b/docs/maintenance/Releases.mdx @@ -0,0 +1,109 @@ +--- +id: releases +sidebar_label: Releases +title: Releases +--- + +## Canary + +We release a canary version for each commit to `main` that passes all required checks. This release is performed automatically by the [`publish_canary_version` step](https://github.com/typescript-eslint/typescript-eslint/blob/5feb2dba9da2bd5e233451b7b0f1c99414b5aef9/.github/workflows/ci.yml#L234-L263). + +This release is goes to the `canary` tag on npm and it is versioned as an incremental canary patch release on top of the current `latest` version. I.e. if the current version is `5.6.1`, then the first canary version will be `5.6.2-alpha.0`, the second `5.6.2-alpha.1`, and so on. + +### Installing Canary Versions + +To try out the latest canary versions of typescript-eslint, install `@typescript-eslint/eslint-plugin@canary` and `@typescript-eslint/parser@canary`. +Note that npm may need a `--force` to override version requirements. + + + +### npm + +```bash +npm i @typescript-eslint/eslint-plugin@canary @typescript-eslint/parser@canary --save-dev --force +``` + +### Yarn + +```bash +yarn add @typescript-eslint/eslint-plugin@canary @typescript-eslint/parser@canary --save-dev +``` + + + +## Latest + +We release a latest version every Monday at 1pm US Eastern time using the latest commit to `main` at that time. This release is performed automatically by a Github action located in a private repository. This release goes to the standard `latest` tag on npm. + +See the [versioning](#versioning) section below for how the version number is calculated. + +If there have been no commits that impact public-facing packages then a patch-level release shall be released. + +Latest releases shall only ever be "minor" or "patch" releases. + +## Major Releases + +We currently do not have a set schedule around when major releases shall be performed; instead they are done as the need arises. + +We keep a backlog of breaking issues as a milestone on GitHub that is named in the form `${major}.0.0`. +When we do do a major release, we release a release candidate version to the `rc-v${major}` tag on npm for each commit to the major branch. + +### Major Release Steps + +Our releases go through three groups of steps: + +1. [Pre-Release Preparation] +1. [Merging Breaking Changes] +1. [Releasing the Version] + +#### 1. Pre-Release Preparation + +1. Create a milestone by the name of the release [example: [Milestone 6.0.0](https://github.com/typescript-eslint/typescript-eslint/milestone/8)]. +1. If an issue for changes to recommended rule configs doesn't yet exist, create one [example: [Changes to the `recommended` sets for 5.0.0](https://github.com/typescript-eslint/typescript-eslint/issues/5900)]. +1. Add any breaking changes intended for the release to that milestone. +1. Create two new branches off `main` in the project repository (not a personal fork): + - `v${major}` + - `v${major}-canary-auto-release` +1. Raise a PR from `v${major}-canary-auto-release` to `main` modifying the [`ci.yml` workflow](https://github.com/typescript-eslint/typescript-eslint/blob/main/.github/workflows/ci.yml) [example: [chore: add auto-canary release for v6](https://github.com/typescript-eslint/typescript-eslint/pull/5883)]: + - Under `pushes:` at the beginning of the file, add an `- v${major}` list item. + - Add a `publish_canary_version_v${major}` step the same as `publish_canary_version` except: + - Add the condition: `if: github.ref == 'refs/heads/v${major}'`. + - Its publish command should be `npx lerna publish premajor --loglevel=verbose --canary --exact --force-publish --yes --dist-tag rc-v${major}`. + - Merge this into `main` once reviewed and rebase the `v${major}` branch. + +#### 2. Merging Breaking Changes + +1. Send a PR from `v${major}` to `main` [example: [v6.0.0](https://github.com/typescript-eslint/typescript-eslint/pull/5886)]. +1. Change all [breaking change PRs](https://github.com/typescript-eslint/typescript-eslint/issues?q=is%3Aissue+is%3Aopen+label%3A%22breaking+change%22) to target the `v${major}` branch. + - To signify these changes as breaking, the first line of the PR description must read as `BREAKING CHANGE:`, and second line should briefly summarize the changes. + - It is important to note that when merged the commit message must also include `BREAKING CHANGE:` as the first line in order for lerna to recognize it as a breaking change in the release notes. If you miss this it just means more manual work when writing the release documentation. +1. Wait until all required PRs have been merged +1. Let the release wait for **at least 1 week** to allow time for early adopters to help test it and discuss the changes. + - Promote it on the [`@tseslint`](https://twitter.com/tseslint) twitter to get some additional attention. +1. Once discussions have settled, rebase merge the PR on top of `main`. + +:::note +_Non_-breaking changes can be merged to `main` or the major branch. +They don't need any special treatment. +::: + +#### 3. Releasing the Version + +1. Discuss with the maintainers to be ready for an [out-of-band](#out-of-band) release. Doing this manually helps ensure someone is on-hand to action any issues that might arise from the major release. +1. Prepare the release notes. Lerna will automatically generate the release notes on GitHub, however this will be disorganized and unhelpful for users. We need to reorganize the release notes so that breaking changes are placed at the top to make them most visible. If any migrations are required, we must list the steps to make it easy for users. + +- Example release notes: [`v5.0.0`](https://github.com/typescript-eslint/typescript-eslint/releases/tag/v5.0.0), [`v4.0.0`](https://github.com/typescript-eslint/typescript-eslint/releases/tag/v4.0.0), [`v3.0.0`](https://github.com/typescript-eslint/typescript-eslint/releases/tag/v3.0.0) + +1. Finally, tweet the release on the `@tseslint` twitter with a link to the GitHub release. Make sure you include additional information about the highlights of the release! + +## Out-of-Band + +We will do releases "out-of-band" (outside the [latest](#latest) schedule) for rare emergencies. +We assess need on a case-by-case basis though generally an emergency is defined as a critical regression specifically introduced in the latest release. + +These releases are done manually by a maintainer with the required access privileges. + +## Back-Porting Releases + +We **_do not_** back port releases to previously released major/minor versions. +We only ever release forward. diff --git a/docs/maintenance/Versioning.mdx b/docs/maintenance/Versioning.mdx new file mode 100644 index 00000000000..68a007c89c1 --- /dev/null +++ b/docs/maintenance/Versioning.mdx @@ -0,0 +1,131 @@ +--- +id: versioning +title: Versioning +--- + +We follow [semantic versioning (semver)](https://semver.org). +This page exists to help set guidelines around when what we consider to fall within each of the semver categories. + +All of the packages in this project are published with the same version number to make it easier to coordinate both releases and installations. + +We publish a canary release on every successful merge to `main`, so **you never need to wait for a new stable version to make use of any updates**. + +Additionally, we promote to the `latest` tag on NPM once per week, **on Mondays at 1 pm Eastern**. + +The latest version under the `latest` tag is: + + + NPM Version + + +The latest version under the `canary` tag **(latest commit to `main`)** is: + + + NPM Version + + +:::note +The only exception to the automated publishes described above is when we are in the final phases of creating the next major version of the libraries - e.g. going from `1.x.x` to `2.x.x`. +During these periods, we manually publish `canary` releases until we are happy with the release and promote it to `latest`. +::: + +## Dependant Versions + +> See [Versioning > Dependant Version Upgrades](./versioning/dependant-version-upgrades.mdx) for maintenance steps to update these versions. + +### ESLint + +> The version range of ESLint currently supported is `^6.0.0 || ^7.0.0 || ^8.0.0`. + +We generally support at least the latest two major versions of ESLint. + +### Node + +This project makes an effort to support Active LTS and Maintenance LTS release statuses of Node according to [Node's release document](https://nodejs.org/en/about/releases). +Support for specific Current status releases are considered periodically. + +### TypeScript + +> The version range of TypeScript currently supported is `>=3.3.1 <5.0.0`. + +These versions are what we test against. + +We will always endeavor to support the latest stable version of TypeScript. +Sometimes, but not always, changes in TypeScript will not require breaking changes in this project, and so we are able to support more than one version of TypeScript. +In some cases, we may even be able to support additional pre-releases (i.e. betas and release candidates) of TypeScript, but only if doing so does not require us to compromise on support for the latest stable version. + +Note that our packages have an open `peerDependency` requirement in order to allow for experimentation on newer/beta versions of TypeScript. + +If you use a non-supported version of TypeScript, the parser will log a warning to the console. +If you want to disable this warning, you can configure this in your `parserOptions`. +See: [Parser > `warnOnUnsupportedTypeScriptVersion`](../architecture/Parser.mdx#warnonunsupportedtypescriptversion). + +## Breaking Changes + +When considering whether a change should be counted as "breaking" we first need to consider what package(s) it impacts. For example breaking changes for the parser packages have a different standard to those for the ESLint plugins. This is because not only do they have _very_ different API surfaces, they also are consumed in very different ways. + +Please note that the lists provided below are non-exhaustive and are intended to serve as examples to help guide maintainers when planning and reviewing changes. + +### `ast-spec` and `visitor-keys` + +A change to the AST **_shall_** be considered breaking if it: + +- Removes or renames an existing AST Node. +- Removes or renames an existing property on an AST Node. +- Changes a type in a non-refining way (i.e. `string` to `number`). + +A change to the AST **_shall not_** be considered breaking if it: + +- Adds a new property to the AST. +- Adds a new node type to the AST. +- Adds a new node type to an existing union type. +- Refines a type to be more specific (i.e. `string` to `'literal' | 'union'`). +- Removes a type from a union that was erroneously added and did not match the runtime AST. + +### `eslint-plugin` and `eslint-plugin-tslint` + +A change to the plugins **_shall_** be considered breaking if it will require the user to change their config. More specifically: + +- Removes or renames an option. +- Changes the default option of a rule. +- Changes a rule's schema to be stricter. +- Consumes type information to a rule that did not previously consume it. +- Removes or renames a rule. +- Changes any of the recommended configurations. +- Changes the default behavior of a rule in such a way that causes new reports in a large set of cases in an average codebase. + +A change to the plugins **_shall not_** be considered breaking if it: + +- Adds an option that by default does not remove existing functionality. +- Adds a rule. +- Deprecates a rule. +- Adds additional checks to an existing rule that causes new reports in a small-to-medium set of cases in an average codebase. +- Refactors a rule's code in a way that does not introduce additional reports. +- Changes to a rule's description or other metadata. +- Adds a fixer or suggestion fixer. +- Removes a fixer or suggestion fixer. +- Fixes incorrect behavior in a rule that may or may not introduce additional reports. + +#### `parser`, `typescript-estree`, `scope-manager`, `types`, `type-utils`, `utils` + +A change to these packages **_shall_** be considered breaking if it: + +- Changes the API surface in a backwards-incompatible way (remove or rename functions, types, etc). + +A change to these packages **_shall not_** be considered breaking if it: + +- Adds to the API surface (add functions, types, etc). +- Deprecates parts of the API surface. +- Adds **_optional_** arguments to functions or properties to input types. +- Adds additional properties to output types. +- Adds documentation in the form of JSDoc comments. + +### Internal packages + +Any packages in this project that are not part of our public API surface (such as `eslint-plugin-internal` or `website`) shall not be considered when calculating new package versions. diff --git a/docs/maintenance/issues/Rule_Deprecations.mdx b/docs/maintenance/issues/Rule_Deprecations.mdx new file mode 100644 index 00000000000..98486f2bb6c --- /dev/null +++ b/docs/maintenance/issues/Rule_Deprecations.mdx @@ -0,0 +1,34 @@ +--- +id: rule-deprecations +title: Rule Deprecations +--- + +Sometimes a rule that used to be 👍 does not age well and becomes 👎. +In the past, these cases have included: + +- Overly opinionated and/or stylistic rules that don't represent a universal best practice +- Renames +- Rules moved to an external plugin + +In these cases, we aim to remove the old rule with minimal user disruption. + +## Filing the Issue + +Rule deprecations can be filed as a [new issue bypassing templates](https://github.com/typescript-eslint/typescript-eslint/issues/new). + +Provide it an `## Overview` containing: + +- The rule name & link to its documentation page +- A clear explanation of why you believe it should be deprecated +- Whether it exists in popular configs such as `eslint-config-airbnb-typescript` and `eslint-config-standard-with-typescript` +- Sourcegraph queries showing how often it appears in user configs + +> See [#6036](https://github.com/typescript-eslint/typescript-eslint/issues/6036) for examples of those links and queries. + +## Timeline + +1. In any minor/patch version, add [rule `meta` properties](https://eslint.org/docs/latest/developer-guide/working-with-rules#rule-basics): + - `deprecated: true` + - `replacedBy`, if applicable +2. In the next major version, you may delete the rule + - If the rule is relatively popular with users, consider leaving a documentation page as a tombstone pointing to the new relevant rule or docs (see [`camelcase`](https://typescript-eslint.io/rules/camelcase/) as an example) diff --git a/docs/maintenance/versioning/dependant-version-upgrades.mdx b/docs/maintenance/versioning/dependant-version-upgrades.mdx new file mode 100644 index 00000000000..bf1a17f2829 --- /dev/null +++ b/docs/maintenance/versioning/dependant-version-upgrades.mdx @@ -0,0 +1,121 @@ +--- +id: dependant-version-upgrades +title: Dependant Version Upgrades +--- + +## ESLint + +The typescript-eslint repository contains four kinds of version ranges for the `eslint` package: + +- Integration tests: Pinned to our lowest supported ESLint version +- Packages with a `*` `peerDependency` version: These fall back to the explicit `peerDependency` versions +- Packages with explicit `peerDependency` versions: The full range of supported ESLint major versions +- [Root `package.json`](https://github.com/typescript-eslint/typescript-eslint/blob/main/package.json)'s' `devDependency`: A relatively recent release, used only for repository development + +:::tip +Whenever you discover any new areas of work that are blocked by dropping an old ESLint version, such as new ESLint API deprecations, add a _TODO_ comment that will be caught by the regular expressions under [Removing Support for an Old ESLint Version](#removing-support-for-an-old-eslint-version). +::: + +### Adding Support for a New ESLint Version + +1. Upgrade the root `package.json` `devDependency` to the latest ESLint +1. Add the new major version to the explicit `peerDependency` versions +1. Check [`eslint-visitor-keys`](https://www.npmjs.com/package/eslint-visitor-keys) for a new version to be upgraded to as well. +1. Update [Versioning > ESLint](../Versioning.mdx#eslint) + +### Removing Support for an Old ESLint Version + +1. Increase the integration tests to the next lowest supported major version (`*.0.0`) +1. Remove the old major versions from packages with explicit `peerDependency` versions +1. Search for source code comments (excluding `CHANGELOG.md` files) that mention a now-unsupported version of ESLint. + - For example, to remove support for v5, searches might include: + - `/eslint.*5/i` + - `/todo.*eslint.*5/i` + - `/todo.*eslint/i` +1. Update [Versioning > ESLint](../Versioning.mdx#eslint) + +See [chore: drop support for ESLint v6](https://github.com/typescript-eslint/typescript-eslint/pull/5972) for reference. + +## Node + +The typescript-eslint repository contains three kinds of version ranges for Node: + +- [`.github/workflows/ci.yml`](https://github.com/typescript-eslint/typescript-eslint/blob/main/.github/workflows/ci.yml)'s `PRIMARY_NODE_VERSION`: Set to the highest Node version we support +- `node-version`: Set to a tuple of our [lowest, highest] supported versions for our unit tests in CI +- `engines` field in all `package.json`s: explicitly lists all supported Node ranges + +Change those numbers accordingly when adding support for a new Node version or removing support for an old Node version. + +See [feat: drop support for node v12](https://github.com/typescript-eslint/typescript-eslint/pull/5918) + [chore: test node v14 on ci.yml](https://github.com/typescript-eslint/typescript-eslint/pull/5512) for reference. + +## TypeScript + +### Adding Support for a New TypeScript Version + +We generally start the process of supporting a new TypeScript version just after the first beta release for that version is made available. + +1. Create and pin an issue with a title like _TypeScript X.Y Support_, `accepting prs`, `AST`, `dependencies`, and `New TypeScript Version` labels, and the following contents: + + 1. A link to the _TypeScript X.Y Iteration Plan_ issue from the Microsoft issue tracker + 2. The following text: + + ```md + This issue is just to track all of the new features and their implementation state in this project. + As with all releases, we will not necessarily support all features until closer to the full release when everything the features are stabilised. + + _Please be patient._ ❤️ + ``` + + 3. A heading starting with `🔲 ` for each new TypeScript feature called out in the iteration plan that will impact us + 4. A heading titled _🔲 `lib.d.ts` Updates_ and the content _We will need to regenerate our types within `scope-manager`_ + 5. A heading titled _Other changes with no impact to us_ containing a list of other changes that we don't believe will impact us + +1. At this stage, it's fine to send and/or review PRs that implement necessary features, but wait to merge them until the new TypeScript version's RC is released + - Whenever a PR is created, add ` (#1234)` to its respective heading, and change the heading's emoji from 🔲 to 🏗 + - Search for `expectBabelToNotSupport` to see how to support syntaxes not yet supported by Babel +1. Once the TypeScript RC version is released, start merging PRs + - Whenever a PR is merged, change the respective heading's emoji from 🏗 to ✅ +1. Create a PR with a title like `feat: update TypeScript to X.Y-rc` and the following changes: + - In the root `package.json`, add `|| X.Y.2-rc2` to the `dependency` on `typescript` + - In the root `package.json`, change the `devDependency` on `typescript` to `~X.Y.2-rc2` + - Change the `SUPPORTED_TYPESCRIPT_VERSIONS` constant's `<` version to the next version of TypeScript + - Change the `SUPPORTED_PRERELEASE_RANGES` constant to equal `['X.Y.2-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.2-rc2` from the `dependency` on `typescript`, and bump its `<` version to the next version of TypeScript + - In the root `package.json`, change the `devDependency` 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 + - Update the supported version range in [Versioning](../Versioning.mdx) +1. Update [Versioning > TypeScript](../Versioning.mdx#typescript) +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 + +See for reference (caveat: these don't follow the exact process described here): + +- [TypeScript 4.7 Support](https://github.com/typescript-eslint/typescript-eslint/issues/4800) +- [TypeScript 4.8 Support](https://github.com/typescript-eslint/typescript-eslint/issues/5227) +- [feat: support TypeScript 4.8](https://github.com/typescript-eslint/typescript-eslint/pull/5551) +- [feat: support TypeScript 4.9](https://github.com/typescript-eslint/typescript-eslint/pull/5716) +- [chore: bump TS from 4.9RC to 4.9](https://github.com/typescript-eslint/typescript-eslint/commit/a40a311bb52a2b1cfac43851b201f8cfc96c8d5d) + +### Removing Support for an Old TypeScript Version + +A single PR can remove support for old TypeScript versions as a breaking change: + +1. Update the root `package.json` `devDependency` +1. Update the `SUPPORTED_TYPESCRIPT_VERSIONS` constant in `warnAboutTSVersion.ts` +1. Update the `versions` constant in `version-check.ts` +1. Update [Versioning > TypeScript](../Versioning.mdx#typescript) +1. Search for source code comments (excluding `CHANGELOG.md` files) that mention a now-unsupported version of TypeScript. + - For example, to remove support for v4.3, searches might include: + - `4.3` + - `/is.*4.*3/i` + - `/semver.*4.*3/i` + - `/semver.satisfies/` + - `/todo.*ts/i` + - `/todo.*typescript/i` + +See [feat: bump minimum supported TS version to 4.2.4](https://github.com/typescript-eslint/typescript-eslint/pull/5915). diff --git a/jest.config.base.js b/jest.config.base.js index b94573bf719..707c023f269 100644 --- a/jest.config.base.js +++ b/jest.config.base.js @@ -19,6 +19,7 @@ module.exports = { 'node', ], resolver: '/../../tests/jest-resolver.js', + setupFilesAfterEnv: ['console-fail-test/setup.js'], testRegex: ['./tests/.+\\.test\\.ts$', './tests/.+\\.spec\\.ts$'], transform: { '^.+\\.(t|j)sx?$': [ diff --git a/lerna.json b/lerna.json index c8dae9f617c..e150bc530f7 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "5.31.0", + "version": "5.50.0", "npmClient": "yarn", "useWorkspaces": true, "stream": true diff --git a/netlify.toml b/netlify.toml new file mode 100644 index 00000000000..06deeaaed01 --- /dev/null +++ b/netlify.toml @@ -0,0 +1,42 @@ +# https://docs.netlify.com/configure-builds/file-based-configuration/#build-settings +[build] + base = "" + publish = "packages/website/build" + command = "NX_VERBOSE_LOGGING=true yarn patch-package && yarn nx build website" +[build.environment] + NETLIFY_USE_YARN = "true" + YARN_FLAGS = "--ignore-scripts" + +# https://docs.netlify.com/configure-builds/file-based-configuration/#redirects + +[[redirects]] + from = "/docs" + to = "/getting-started" + +[[redirects]] + from = "/docs/development/architecture/asts" + to = "/blog/asts-and-typescript-eslint" + +[[redirects]] + from = "/docs/development/architecture/packages" + to = "/architecture" + +[[redirects]] + from = "/docs/development/custom-rules" + to = "/custom-rules" + +[[redirects]] + from = "/docs/linting/type-linting" + to = "/linting/typed-linting" + +[[redirects]] + from = "/docs/linting/monorepo" + to = "/linting/typed-linting/monorepos" + +[[redirects]] + from = "/docs/linting/tslint" + to = "/linting/troubleshooting/tslint" + +[[redirects]] + from = "/docs/*" + to = "/" diff --git a/nx.json b/nx.json index 7b001c0f790..731dc56a3c7 100644 --- a/nx.json +++ b/nx.json @@ -1,37 +1,48 @@ { + "$schema": "./node_modules/nx/schemas/nx-schema.json", "npmScope": "typescript-eslint", - "implicitDependencies": { - "package.json": { - "dependencies": "*", - "devDependencies": "*" - }, - ".github/workflows/ci.yml": "*" - }, - "affected": { - "defaultBase": "main" - }, - "workspaceLayout": { - "libsDir": "packages" - }, "tasksRunnerOptions": { "default": { "runner": "@nrwl/nx-cloud", "options": { - "cacheableOperations": ["build", "test", "package", "prebuild"], - "accessToken": "YjFjNTBhOWUtY2JmNy00ZDhiLWE5N2UtZjliNDAwNmIzOTdjfHJlYWQtd3JpdGU=", - "canTrackAnalytics": false, - "showUsageWarnings": true, - "runtimeCacheInputs": ["node -v", "echo $NETLIFY"], - "parallel": 1 + "cacheableOperations": ["build", "lint", "package", "prebuild", "test"], + "accessToken": "YjFjNTBhOWUtY2JmNy00ZDhiLWE5N2UtZjliNDAwNmIzOTdjfHJlYWQtd3JpdGU=" } } }, - "targetDependencies": { - "build": [ + "targetDefaults": { + "build": { + "dependsOn": ["^build"], + "inputs": ["production", "^production"] + }, + "test": { + "inputs": [ + "default", + "{workspaceRoot}/jest.config.js", + "{workspaceRoot}/jest.config.base.js" + ], + "outputs": ["{projectRoot}/coverage"] + }, + "lint": { + "inputs": [ + "default", + "{workspaceRoot}/.eslintrc.js", + "{workspaceRoot}/.eslintignore" + ] + } + }, + "namedInputs": { + "default": [ + "{projectRoot}/**/*", + "sharedGlobals", + { + "runtime": "node -v" + }, { - "target": "build", - "projects": "dependencies" + "runtime": "echo $NETLIFY" } - ] + ], + "sharedGlobals": ["{workspaceRoot}/.github/workflows/ci.yml"], + "production": ["default"] } } diff --git a/package.json b/package.json index a4601ad21bd..f8b24d34edf 100644 --- a/package.json +++ b/package.json @@ -22,101 +22,115 @@ "url": "https://github.com/typescript-eslint/typescript-eslint/issues" }, "scripts": { - "build": "nx run-many --target=build --all --parallel --exclude website", + "build": "nx run-many --target=build --parallel --exclude website", "check-clean-workspace-after-install": "git diff --quiet --exit-code", - "check-configs": "nx run-many --target=check-configs --all --parallel", - "check-docs": "nx run-many --target=check-docs --all --parallel", - "check-format": "prettier --list-different \"./**/*.{md,mdx,ts,mts,cts,js,cjs,mjs,tsx,jsx}\"", + "check-configs": "nx run-many --target=check-configs --parallel", + "check-docs": "nx run-many --target=check-docs --parallel", + "check-format": "prettier --list-different .", "check-spelling": "cspell --config=.cspell.json \"**/*.{md,mdx,ts,mts,cts,js,cjs,mjs,tsx,jsx}\"", - "clean": "lerna clean && lerna run clean", - "format": "prettier --write \"./**/*.{ts,mts,cts,tsx,js,mjs,cjs,jsx,json,md,css}\"", - "generate-contributors": "yarn ts-node --transpile-only ./tools/generate-contributors.ts", - "generate-sponsors": "yarn ts-node --transpile-only ./tools/generate-sponsors.ts", - "generate-website-dts": "yarn ts-node --transpile-only ./tools/generate-website-dts.ts", + "clean": "lerna clean -y && nx run-many --target=clean", + "format": "prettier --write .", + "generate-contributors": "yarn tsx ./tools/generate-contributors.ts", + "generate-sponsors": "yarn tsx ./tools/generate-sponsors.ts", + "generate-website-dts": "yarn tsx ./tools/generate-website-dts.ts", + "generate-lib": "nx generate-lib @typescript-eslint/scope-manager", "lint-fix": "eslint . --fix", "lint-markdown-fix": "yarn lint-markdown --fix", "lint-markdown": "markdownlint \"**/*.md\" --config=.markdownlint.json --ignore-path=.markdownlintignore", - "lint": "cross-env NODE_OPTIONS=\"--max-old-space-size=16384\" eslint .", - "postinstall": "yarn husky install && yarn build", + "lint": "nx run-many --target=lint --parallel", + "postinstall": "yarn tsx ./tools/postinstall.ts", "pre-commit": "yarn lint-staged", "start": "nx run website:start", - "test": "nx run-many --target=test --all --parallel", + "test": "nx run-many --target=test --parallel", "test-integration": "yarn jest -c ./tests/integration/jest.config.js", - "typecheck": "nx run-many --target=typecheck --all --parallel" + "typecheck": "nx run-many --target=typecheck --parallel" }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, "devDependencies": { - "@babel/code-frame": "^7.16.7", - "@babel/eslint-parser": "^7.18.2", - "@babel/parser": "^7.18.0", - "@babel/types": "^7.18.2", - "@nrwl/cli": "14.1.4", - "@nrwl/nx-cloud": "14.0.3", - "@nrwl/tao": "14.1.4", - "@nrwl/workspace": "14.1.4", - "@swc/core": "^1.2.181", + "@babel/code-frame": "^7.18.6", + "@babel/core": "^7.20.2", + "@babel/eslint-parser": "^7.19.1", + "@babel/parser": "^7.20.7", + "@babel/types": "^7.20.2", + "@nrwl/jest": "15.6.3", + "@nrwl/nx-cloud": "15.0.2", + "@nrwl/workspace": "15.6.3", + "@swc/core": "^1.3.1", "@swc/jest": "^0.2.21", "@types/babel__code-frame": "^7.0.3", "@types/debug": "^4.1.7", "@types/eslint-visitor-keys": "^1.0.0", - "@types/glob": "^7.2.0", + "@types/glob": "^8.0.0", "@types/is-glob": "^4.0.2", - "@types/jest": "^28.1.1", + "@types/jest": "^29.0.2", "@types/jest-specific-snapshot": "^0.5.5", "@types/lodash": "^4.14.182", "@types/marked": "^4.0.3", "@types/ncp": "^2.0.5", - "@types/node": "^17.0.31", + "@types/node": "^18.11.9", "@types/prettier": "^2.6.0", "@types/rimraf": "^3.0.2", "@types/semver": "^7.3.9", "@types/tmp": "^0.2.3", + "console-fail-test": "^0.1.7", "cross-env": "^7.0.3", "cross-fetch": "^3.1.5", - "cspell": "^5.20.0", - "downlevel-dts": "^0.9.0", + "cspell": "^6.0.0", + "downlevel-dts": ">=0.10.0", "enhanced-resolve": "^5.9.3", "eslint": "^8.15.0", + "eslint-plugin-deprecation": "^1.3.2", "eslint-plugin-eslint-comments": "^3.2.0", - "eslint-plugin-eslint-plugin": "^4.1.0", + "eslint-plugin-eslint-plugin": "^5.0.1", "eslint-plugin-import": "^2.26.0", - "eslint-plugin-jest": "^26.1.5", - "eslint-plugin-simple-import-sort": "^7.0.0", + "eslint-plugin-jest": "^27.0.0", + "eslint-plugin-simple-import-sort": "^10.0.0", + "execa": "5.1.1", "glob": "^8.0.1", "husky": "^8.0.1", - "jest": "^28.1.0", - "jest-diff": "^28.1.0", - "jest-snapshot": "^28.1.0", - "jest-specific-snapshot": "^5.0.0", - "lerna": "5.1.8", + "jest": "^29.0.3", + "jest-diff": "^29.0.3", + "jest-snapshot": "^29.0.3", + "jest-specific-snapshot": "^7.0.0", + "lerna": "6.4.1", "lint-staged": "^13.0.0", "make-dir": "^3.1.0", - "markdownlint-cli": "^0.31.1", + "markdownlint-cli": "^0.33.0", "ncp": "^2.0.0", - "prettier": "2.5.1", - "pretty-format": "^28.1.0", - "rimraf": "^3.0.2", + "nx": "15.6.3", + "patch-package": "^6.4.7", + "prettier": "2.8.1", + "pretty-format": "^29.0.3", + "rimraf": "^4.0.0", "tmp": "^0.2.1", - "ts-node": "^10.7.0", + "ts-node": "10.7.0", "tslint": "^6.1.3", - "typescript": ">=3.3.1 <4.8.0" + "tsx": "^3.12.1", + "typescript": ">=3.3.1 <5.0.0" }, "resolutions": { - "typescript": "4.7.2", - "@types/node": "^17.0.31", - "pretty-format": "^28.1.0", - "//": "Pin jest to v28 across the repo", - "@jest/create-cache-key-function": "^28", - "@jest/reporters": "^28", - "@jest/test-result": "^28", - "jest-config": "^28", - "jest-diff": "^28", - "jest-get-type": "^28", - "jest-matcher-utils": "^28", - "jest-resolve": "^28", - "jest-snapshot": "^28", - "jest-util": "^28" + "typescript": "~4.9.3", + "@types/node": "^18.11.9", + "@jest/create-cache-key-function": "^29", + "@jest/reporters": "^29", + "@jest/test-result": "^29", + "jest-config": "^29", + "jest-diff": "^29", + "jest-get-type": "^29", + "jest-matcher-utils": "^29", + "jest-resolve": "^29", + "jest-snapshot": "^29", + "jest-util": "^29", + "pretty-format": "^29", + "@swc/core-android-arm-eabi": "npm:dummypkg-a@1.0.0", + "@swc/core-android-arm64": "npm:dummypkg-a@1.0.0", + "@swc/core-freebsd-x64": "npm:dummypkg-a@1.0.0", + "@swc/core-linux-arm-gnueabihf": "npm:dummypkg-a@1.0.0", + "@swc/core-linux-arm64-gnu": "npm:dummypkg-a@1.0.0", + "@swc/core-linux-arm64-musl": "npm:dummypkg-a@1.0.0", + "@swc/core-win32-arm64-msvc": "npm:dummypkg-a@1.0.0", + "@swc/core-win32-ia32-msvc": "npm:dummypkg-a@1.0.0" } } diff --git a/packages/ast-spec/CHANGELOG.md b/packages/ast-spec/CHANGELOG.md index 35ac41e557f..3b4168eff86 100644 --- a/packages/ast-spec/CHANGELOG.md +++ b/packages/ast-spec/CHANGELOG.md @@ -3,23 +3,18 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. -# [5.31.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.7...v5.31.0) (2022-07-25) - -**Note:** Version bump only for package @typescript-eslint/ast-spec - - +# [5.50.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.49.0...v5.50.0) (2023-01-31) +### Bug Fixes -## [5.30.7](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.6...v5.30.7) (2022-07-18) +* **ast-spec:** a JSXEmptyExpression is not a possible JSXExpression ([#6321](https://github.com/typescript-eslint/typescript-eslint/issues/6321)) ([4b27777](https://github.com/typescript-eslint/typescript-eslint/commit/4b27777ed26cc83d6efc52a89b2d3fc6c01bc0d7)) -**Note:** Version bump only for package @typescript-eslint/ast-spec - -## [5.30.6](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.5...v5.30.6) (2022-07-11) +# [5.49.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.48.2...v5.49.0) (2023-01-23) **Note:** Version bump only for package @typescript-eslint/ast-spec @@ -27,7 +22,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline -## [5.30.5](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.4...v5.30.5) (2022-07-04) +## [5.48.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.48.1...v5.48.2) (2023-01-16) **Note:** Version bump only for package @typescript-eslint/ast-spec @@ -35,7 +30,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline -## [5.30.4](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.3...v5.30.4) (2022-07-03) +## [5.48.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.48.0...v5.48.1) (2023-01-09) **Note:** Version bump only for package @typescript-eslint/ast-spec @@ -43,581 +38,453 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline -## [5.30.3](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.2...v5.30.3) (2022-07-01) +# [5.48.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.47.1...v5.48.0) (2023-01-02) **Note:** Version bump only for package @typescript-eslint/ast-spec +## [5.47.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.47.0...v5.47.1) (2022-12-26) +### Bug Fixes +- **ast-spec:** correct some incorrect ast types ([#6257](https://github.com/typescript-eslint/typescript-eslint/issues/6257)) ([0f3f645](https://github.com/typescript-eslint/typescript-eslint/commit/0f3f64571ea5d938081b1a9f3fd1495765201700)) - -## [5.30.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.1...v5.30.2) (2022-07-01) +# [5.47.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.46.1...v5.47.0) (2022-12-19) **Note:** Version bump only for package @typescript-eslint/ast-spec +## [5.46.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.46.0...v5.46.1) (2022-12-12) +**Note:** Version bump only for package @typescript-eslint/ast-spec - - -## 5.30.1 (2022-07-01) +# [5.46.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.45.1...v5.46.0) (2022-12-08) **Note:** Version bump only for package @typescript-eslint/ast-spec +## [5.45.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.45.0...v5.45.1) (2022-12-05) +**Note:** Version bump only for package @typescript-eslint/ast-spec +# [5.45.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.44.0...v5.45.0) (2022-11-28) +### Features -# [5.30.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.29.0...v5.30.0) (2022-06-27) +- support Auto Accessor syntax ([#5926](https://github.com/typescript-eslint/typescript-eslint/issues/5926)) ([becd1f8](https://github.com/typescript-eslint/typescript-eslint/commit/becd1f8581c0013399dfe71be6c265e96cedb57a)) +# [5.44.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.43.0...v5.44.0) (2022-11-21) ### Features -* treat `this` in `typeof this` as a `ThisExpression` ([#4382](https://github.com/typescript-eslint/typescript-eslint/issues/4382)) ([b04b2ce](https://github.com/typescript-eslint/typescript-eslint/commit/b04b2ce1ba90d94718891f2562dd210a6d7b8609)) +- support parsing `satisfies` operators ([#5717](https://github.com/typescript-eslint/typescript-eslint/issues/5717)) ([20d7cae](https://github.com/typescript-eslint/typescript-eslint/commit/20d7caee35ab84ae6381fdf04338c9e2b9e2bc48)) +# [5.43.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.42.1...v5.43.0) (2022-11-14) +**Note:** Version bump only for package @typescript-eslint/ast-spec +## [5.42.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.42.0...v5.42.1) (2022-11-07) +### Bug Fixes -# [5.29.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.28.0...v5.29.0) (2022-06-20) +- **ast-spec:** correct misnamed ExportNamedDeclaration AST type ([#5913](https://github.com/typescript-eslint/typescript-eslint/issues/5913)) ([e88f4fa](https://github.com/typescript-eslint/typescript-eslint/commit/e88f4fa1d0127ba0ddeff578ec67f2e66a1de68b)) -**Note:** Version bump only for package @typescript-eslint/ast-spec +# [5.42.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.41.0...v5.42.0) (2022-10-31) +### Bug Fixes +- **ast-spec:** add TSQualifiedName to TypeNode union ([#5906](https://github.com/typescript-eslint/typescript-eslint/issues/5906)) ([5c316c1](https://github.com/typescript-eslint/typescript-eslint/commit/5c316c12f09d58aee6ee634a8055533f361f1589)) +# [5.41.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.40.1...v5.41.0) (2022-10-24) +**Note:** Version bump only for package @typescript-eslint/ast-spec -# [5.28.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.27.1...v5.28.0) (2022-06-13) +## [5.40.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.40.0...v5.40.1) (2022-10-17) +**Note:** Version bump only for package @typescript-eslint/ast-spec -### Features +# [5.40.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.39.0...v5.40.0) (2022-10-10) -* **ast-spec:** extract `AssignmentOperatorToText` ([#3570](https://github.com/typescript-eslint/typescript-eslint/issues/3570)) ([45f75e6](https://github.com/typescript-eslint/typescript-eslint/commit/45f75e6b869f4160a45a6890d794aba004356ad7)) +**Note:** Version bump only for package @typescript-eslint/ast-spec +# [5.39.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.38.1...v5.39.0) (2022-10-03) +**Note:** Version bump only for package @typescript-eslint/ast-spec +## [5.38.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.38.0...v5.38.1) (2022-09-26) +**Note:** Version bump only for package @typescript-eslint/ast-spec -## [5.27.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.27.0...v5.27.1) (2022-06-06) +# [5.38.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.37.0...v5.38.0) (2022-09-19) **Note:** Version bump only for package @typescript-eslint/ast-spec +# [5.37.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.36.2...v5.37.0) (2022-09-12) +**Note:** Version bump only for package @typescript-eslint/ast-spec +## [5.36.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.36.1...v5.36.2) (2022-09-05) +**Note:** Version bump only for package @typescript-eslint/ast-spec -# [5.27.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.26.0...v5.27.0) (2022-05-30) - +## [5.36.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.36.0...v5.36.1) (2022-08-30) -### Features +**Note:** Version bump only for package @typescript-eslint/ast-spec -* [4.7] support new extensions ([#5027](https://github.com/typescript-eslint/typescript-eslint/issues/5027)) ([efc147b](https://github.com/typescript-eslint/typescript-eslint/commit/efc147b04dce52ab17415b6a4ae4076b944b9036)) -* [TS4.7] support type parameters for `typeof` ([#5067](https://github.com/typescript-eslint/typescript-eslint/issues/5067)) ([836de79](https://github.com/typescript-eslint/typescript-eslint/commit/836de79e8d1bff43149168cc913a4c2b60e79bf6)) +# [5.36.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.35.1...v5.36.0) (2022-08-30) +**Note:** Version bump only for package @typescript-eslint/ast-spec +## [5.35.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.35.0...v5.35.1) (2022-08-24) +**Note:** Version bump only for package @typescript-eslint/ast-spec +# [5.35.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.34.0...v5.35.0) (2022-08-24) -# [5.26.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.25.0...v5.26.0) (2022-05-23) +**Note:** Version bump only for package @typescript-eslint/ast-spec +# [5.34.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.33.1...v5.34.0) (2022-08-22) ### Bug Fixes -* **ast-spec:** add `SpreadElement` to `ArrayExpression.elements` ([#5025](https://github.com/typescript-eslint/typescript-eslint/issues/5025)) ([9f3121b](https://github.com/typescript-eslint/typescript-eslint/commit/9f3121b228b9c066bff7a6011aecf269ac55f17c)) +- **ast-spec:** NewExpression argument can be SpreadElement now ([#5422](https://github.com/typescript-eslint/typescript-eslint/issues/5422)) ([3ced62f](https://github.com/typescript-eslint/typescript-eslint/commit/3ced62fb8474ed377c1336ac3e855f0270ce9beb)) +## [5.33.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.33.0...v5.33.1) (2022-08-15) -### Features - -* [4.7] support instantiation expressions ([#4938](https://github.com/typescript-eslint/typescript-eslint/issues/4938)) ([79fbc77](https://github.com/typescript-eslint/typescript-eslint/commit/79fbc7743ae5dce3190f8168776e0204755390ad)) -* [4.7] support optional variance annotation ([#4831](https://github.com/typescript-eslint/typescript-eslint/issues/4831)) ([7e7b24c](https://github.com/typescript-eslint/typescript-eslint/commit/7e7b24c196e6d968e48f97f46feae5e7027e22d2)) +**Note:** Version bump only for package @typescript-eslint/ast-spec +# [5.33.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.32.0...v5.33.0) (2022-08-08) +**Note:** Version bump only for package @typescript-eslint/ast-spec +# [5.32.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.31.0...v5.32.0) (2022-08-01) +**Note:** Version bump only for package @typescript-eslint/ast-spec -# [5.25.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.24.0...v5.25.0) (2022-05-17) +# [5.31.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.7...v5.31.0) (2022-07-25) **Note:** Version bump only for package @typescript-eslint/ast-spec +## [5.30.7](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.6...v5.30.7) (2022-07-18) +**Note:** Version bump only for package @typescript-eslint/ast-spec +## [5.30.6](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.5...v5.30.6) (2022-07-11) +**Note:** Version bump only for package @typescript-eslint/ast-spec -# [5.24.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.23.0...v5.24.0) (2022-05-16) +## [5.30.5](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.4...v5.30.5) (2022-07-04) **Note:** Version bump only for package @typescript-eslint/ast-spec +## [5.30.4](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.3...v5.30.4) (2022-07-03) +**Note:** Version bump only for package @typescript-eslint/ast-spec +## [5.30.3](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.2...v5.30.3) (2022-07-01) +**Note:** Version bump only for package @typescript-eslint/ast-spec -# [5.23.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.22.0...v5.23.0) (2022-05-09) +## [5.30.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.1...v5.30.2) (2022-07-01) +**Note:** Version bump only for package @typescript-eslint/ast-spec -### Bug Fixes +## 5.30.1 (2022-07-01) -* **ast-spec:** correct `AwaitExpression.argument` type ([#4880](https://github.com/typescript-eslint/typescript-eslint/issues/4880)) ([3ec5f53](https://github.com/typescript-eslint/typescript-eslint/commit/3ec5f53bad79b133ef5dee71c402160b3acf13cf)) +**Note:** Version bump only for package @typescript-eslint/ast-spec +# [5.30.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.29.0...v5.30.0) (2022-06-27) +### Features +- treat `this` in `typeof this` as a `ThisExpression` ([#4382](https://github.com/typescript-eslint/typescript-eslint/issues/4382)) ([b04b2ce](https://github.com/typescript-eslint/typescript-eslint/commit/b04b2ce1ba90d94718891f2562dd210a6d7b8609)) +# [5.29.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.28.0...v5.29.0) (2022-06-20) -# [5.22.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.21.0...v5.22.0) (2022-05-02) +**Note:** Version bump only for package @typescript-eslint/ast-spec +# [5.28.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.27.1...v5.28.0) (2022-06-13) ### Features -* **ast-spec:** add fixture test framework and some initial fixtures ([#3258](https://github.com/typescript-eslint/typescript-eslint/issues/3258)) ([f3cf87b](https://github.com/typescript-eslint/typescript-eslint/commit/f3cf87bf20fd0542f92a96a318aa9ee5bf23c1f6)) +- **ast-spec:** extract `AssignmentOperatorToText` ([#3570](https://github.com/typescript-eslint/typescript-eslint/issues/3570)) ([45f75e6](https://github.com/typescript-eslint/typescript-eslint/commit/45f75e6b869f4160a45a6890d794aba004356ad7)) +## [5.27.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.27.0...v5.27.1) (2022-06-06) +**Note:** Version bump only for package @typescript-eslint/ast-spec +# [5.27.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.26.0...v5.27.0) (2022-05-30) +### Features -# [5.21.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.20.0...v5.21.0) (2022-04-25) +- [4.7] support new extensions ([#5027](https://github.com/typescript-eslint/typescript-eslint/issues/5027)) ([efc147b](https://github.com/typescript-eslint/typescript-eslint/commit/efc147b04dce52ab17415b6a4ae4076b944b9036)) +- [TS4.7] support type parameters for `typeof` ([#5067](https://github.com/typescript-eslint/typescript-eslint/issues/5067)) ([836de79](https://github.com/typescript-eslint/typescript-eslint/commit/836de79e8d1bff43149168cc913a4c2b60e79bf6)) -**Note:** Version bump only for package @typescript-eslint/ast-spec +# [5.26.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.25.0...v5.26.0) (2022-05-23) +### Bug Fixes +- **ast-spec:** add `SpreadElement` to `ArrayExpression.elements` ([#5025](https://github.com/typescript-eslint/typescript-eslint/issues/5025)) ([9f3121b](https://github.com/typescript-eslint/typescript-eslint/commit/9f3121b228b9c066bff7a6011aecf269ac55f17c)) +### Features +- [4.7] support instantiation expressions ([#4938](https://github.com/typescript-eslint/typescript-eslint/issues/4938)) ([79fbc77](https://github.com/typescript-eslint/typescript-eslint/commit/79fbc7743ae5dce3190f8168776e0204755390ad)) +- [4.7] support optional variance annotation ([#4831](https://github.com/typescript-eslint/typescript-eslint/issues/4831)) ([7e7b24c](https://github.com/typescript-eslint/typescript-eslint/commit/7e7b24c196e6d968e48f97f46feae5e7027e22d2)) -# [5.20.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.19.0...v5.20.0) (2022-04-18) +# [5.25.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.24.0...v5.25.0) (2022-05-17) **Note:** Version bump only for package @typescript-eslint/ast-spec +# [5.24.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.23.0...v5.24.0) (2022-05-16) +**Note:** Version bump only for package @typescript-eslint/ast-spec +# [5.23.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.22.0...v5.23.0) (2022-05-09) +### Bug Fixes -# [5.19.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.18.0...v5.19.0) (2022-04-11) +- **ast-spec:** correct `AwaitExpression.argument` type ([#4880](https://github.com/typescript-eslint/typescript-eslint/issues/4880)) ([3ec5f53](https://github.com/typescript-eslint/typescript-eslint/commit/3ec5f53bad79b133ef5dee71c402160b3acf13cf)) -**Note:** Version bump only for package @typescript-eslint/ast-spec +# [5.22.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.21.0...v5.22.0) (2022-05-02) +### Features +- **ast-spec:** add fixture test framework and some initial fixtures ([#3258](https://github.com/typescript-eslint/typescript-eslint/issues/3258)) ([f3cf87b](https://github.com/typescript-eslint/typescript-eslint/commit/f3cf87bf20fd0542f92a96a318aa9ee5bf23c1f6)) +# [5.21.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.20.0...v5.21.0) (2022-04-25) +**Note:** Version bump only for package @typescript-eslint/ast-spec -# [5.18.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.17.0...v5.18.0) (2022-04-04) +# [5.20.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.19.0...v5.20.0) (2022-04-18) **Note:** Version bump only for package @typescript-eslint/ast-spec +# [5.19.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.18.0...v5.19.0) (2022-04-11) +**Note:** Version bump only for package @typescript-eslint/ast-spec +# [5.18.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.17.0...v5.18.0) (2022-04-04) +**Note:** Version bump only for package @typescript-eslint/ast-spec # [5.17.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.16.0...v5.17.0) (2022-03-28) **Note:** Version bump only for package @typescript-eslint/ast-spec - - - - # [5.16.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.15.0...v5.16.0) (2022-03-21) **Note:** Version bump only for package @typescript-eslint/ast-spec - - - - # [5.15.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.14.0...v5.15.0) (2022-03-14) **Note:** Version bump only for package @typescript-eslint/ast-spec - - - - # [5.14.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.13.0...v5.14.0) (2022-03-07) **Note:** Version bump only for package @typescript-eslint/ast-spec - - - - # [5.13.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.12.1...v5.13.0) (2022-02-28) **Note:** Version bump only for package @typescript-eslint/ast-spec - - - - ## [5.12.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.12.0...v5.12.1) (2022-02-21) **Note:** Version bump only for package @typescript-eslint/ast-spec - - - - # [5.12.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.11.0...v5.12.0) (2022-02-14) **Note:** Version bump only for package @typescript-eslint/ast-spec - - - - # [5.11.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.10.2...v5.11.0) (2022-02-07) **Note:** Version bump only for package @typescript-eslint/ast-spec - - - - ## [5.10.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.10.1...v5.10.2) (2022-01-31) **Note:** Version bump only for package @typescript-eslint/ast-spec - - - - ## [5.10.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.10.0...v5.10.1) (2022-01-24) **Note:** Version bump only for package @typescript-eslint/ast-spec - - - - # [5.10.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.9.1...v5.10.0) (2022-01-17) - ### Features -* rename `experimental-utils` to `utils` and make `experimental-utils` an alias to the new package ([#4172](https://github.com/typescript-eslint/typescript-eslint/issues/4172)) ([1d55a75](https://github.com/typescript-eslint/typescript-eslint/commit/1d55a7511b38d8e2b2eabe59f639e0a865e6c93f)) - - - - +- rename `experimental-utils` to `utils` and make `experimental-utils` an alias to the new package ([#4172](https://github.com/typescript-eslint/typescript-eslint/issues/4172)) ([1d55a75](https://github.com/typescript-eslint/typescript-eslint/commit/1d55a7511b38d8e2b2eabe59f639e0a865e6c93f)) ## [5.9.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.9.0...v5.9.1) (2022-01-10) **Note:** Version bump only for package @typescript-eslint/ast-spec - - - - # [5.9.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.8.1...v5.9.0) (2022-01-03) - ### Features -* **experimental-utils:** move isTypeReadonly from eslint-plugin to experimental-utils ([#3658](https://github.com/typescript-eslint/typescript-eslint/issues/3658)) ([a9eb0b9](https://github.com/typescript-eslint/typescript-eslint/commit/a9eb0b9eb2db291ea36065ec34f84bf5c5504b43)) - - - - +- **experimental-utils:** move isTypeReadonly from eslint-plugin to experimental-utils ([#3658](https://github.com/typescript-eslint/typescript-eslint/issues/3658)) ([a9eb0b9](https://github.com/typescript-eslint/typescript-eslint/commit/a9eb0b9eb2db291ea36065ec34f84bf5c5504b43)) ## [5.8.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.8.0...v5.8.1) (2021-12-27) **Note:** Version bump only for package @typescript-eslint/ast-spec - - - - # [5.8.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.7.0...v5.8.0) (2021-12-20) **Note:** Version bump only for package @typescript-eslint/ast-spec - - - - # [5.7.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.6.0...v5.7.0) (2021-12-13) **Note:** Version bump only for package @typescript-eslint/ast-spec - - - - # [5.6.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.5.0...v5.6.0) (2021-12-06) **Note:** Version bump only for package @typescript-eslint/ast-spec - - - - # [5.5.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.4.0...v5.5.0) (2021-11-29) **Note:** Version bump only for package @typescript-eslint/ast-spec - - - - # [5.4.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.3.1...v5.4.0) (2021-11-15) - ### Features -* **typescript-estree:** support Import Assertions ([#4074](https://github.com/typescript-eslint/typescript-eslint/issues/4074)) ([ae0fb5a](https://github.com/typescript-eslint/typescript-eslint/commit/ae0fb5a591958216b7df656e66b1dfe464898167)) -* **typescript-estree:** support private fields in-in syntax ([#4075](https://github.com/typescript-eslint/typescript-eslint/issues/4075)) ([939d8ea](https://github.com/typescript-eslint/typescript-eslint/commit/939d8eac547fb1734aa00f1ea01cc6eae0b4280a)) -* **typescript-estree:** support type-only module specifiers ([#4076](https://github.com/typescript-eslint/typescript-eslint/issues/4076)) ([77baa92](https://github.com/typescript-eslint/typescript-eslint/commit/77baa9203638e888a76e21003a278a8da386e133)) - - - - +- **typescript-estree:** support Import Assertions ([#4074](https://github.com/typescript-eslint/typescript-eslint/issues/4074)) ([ae0fb5a](https://github.com/typescript-eslint/typescript-eslint/commit/ae0fb5a591958216b7df656e66b1dfe464898167)) +- **typescript-estree:** support private fields in-in syntax ([#4075](https://github.com/typescript-eslint/typescript-eslint/issues/4075)) ([939d8ea](https://github.com/typescript-eslint/typescript-eslint/commit/939d8eac547fb1734aa00f1ea01cc6eae0b4280a)) +- **typescript-estree:** support type-only module specifiers ([#4076](https://github.com/typescript-eslint/typescript-eslint/issues/4076)) ([77baa92](https://github.com/typescript-eslint/typescript-eslint/commit/77baa9203638e888a76e21003a278a8da386e133)) ## [5.3.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.3.0...v5.3.1) (2021-11-08) **Note:** Version bump only for package @typescript-eslint/ast-spec - - - - # [5.3.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.2.0...v5.3.0) (2021-11-01) **Note:** Version bump only for package @typescript-eslint/ast-spec - - - - # [5.2.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.1.0...v5.2.0) (2021-10-25) **Note:** Version bump only for package @typescript-eslint/ast-spec - - - - # [5.1.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.0.0...v5.1.0) (2021-10-18) **Note:** Version bump only for package @typescript-eslint/ast-spec - - - - # [5.0.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.33.0...v5.0.0) (2021-10-11) - ### Bug Fixes -* **typescript-estree:** change `source` of ExportNamedDeclaration to Literal from Expression ([#3763](https://github.com/typescript-eslint/typescript-eslint/issues/3763)) ([dc5a0f5](https://github.com/typescript-eslint/typescript-eslint/commit/dc5a0f5104b400f4422b8d67ecfc6cc7a32613a2)) - +- **typescript-estree:** change `source` of ExportNamedDeclaration to Literal from Expression ([#3763](https://github.com/typescript-eslint/typescript-eslint/issues/3763)) ([dc5a0f5](https://github.com/typescript-eslint/typescript-eslint/commit/dc5a0f5104b400f4422b8d67ecfc6cc7a32613a2)) ### Features -* **ast-spec:** bring `Node` objects in line with ESTree ([#3771](https://github.com/typescript-eslint/typescript-eslint/issues/3771)) ([dd14064](https://github.com/typescript-eslint/typescript-eslint/commit/dd140643b457aa515cc21fcda2b3cd4acc2a1c5c)) -* align class property representation with ESTree ([#3806](https://github.com/typescript-eslint/typescript-eslint/issues/3806)) ([22fa5c0](https://github.com/typescript-eslint/typescript-eslint/commit/22fa5c0c4705ed2898f00b7cacc5dd642d859275)), closes [#3430](https://github.com/typescript-eslint/typescript-eslint/issues/3430) [#3077](https://github.com/typescript-eslint/typescript-eslint/issues/3077) -* remove `TSParenthesizedType` ([#3340](https://github.com/typescript-eslint/typescript-eslint/issues/3340)) ([c8ee432](https://github.com/typescript-eslint/typescript-eslint/commit/c8ee43269faea4c04ec02eaa2b81a0aa6eec5d3e)), closes [#3136](https://github.com/typescript-eslint/typescript-eslint/issues/3136) -* support `PrivateIdentifier` ([#3808](https://github.com/typescript-eslint/typescript-eslint/issues/3808)) ([0eefe5e](https://github.com/typescript-eslint/typescript-eslint/commit/0eefe5e49d21af3f1e3e2d9a90c2e49929863ac2)), closes [#3430](https://github.com/typescript-eslint/typescript-eslint/issues/3430) [#2933](https://github.com/typescript-eslint/typescript-eslint/issues/2933) -* **eslint-plugin:** removed value from abstract property nodes ([#3765](https://github.com/typescript-eslint/typescript-eslint/issues/3765)) ([5823524](https://github.com/typescript-eslint/typescript-eslint/commit/58235241714596b641a1e8b39c569e561e0039b4)), closes [#3748](https://github.com/typescript-eslint/typescript-eslint/issues/3748) - - - - +- **ast-spec:** bring `Node` objects in line with ESTree ([#3771](https://github.com/typescript-eslint/typescript-eslint/issues/3771)) ([dd14064](https://github.com/typescript-eslint/typescript-eslint/commit/dd140643b457aa515cc21fcda2b3cd4acc2a1c5c)) +- align class property representation with ESTree ([#3806](https://github.com/typescript-eslint/typescript-eslint/issues/3806)) ([22fa5c0](https://github.com/typescript-eslint/typescript-eslint/commit/22fa5c0c4705ed2898f00b7cacc5dd642d859275)), closes [#3430](https://github.com/typescript-eslint/typescript-eslint/issues/3430) [#3077](https://github.com/typescript-eslint/typescript-eslint/issues/3077) +- remove `TSParenthesizedType` ([#3340](https://github.com/typescript-eslint/typescript-eslint/issues/3340)) ([c8ee432](https://github.com/typescript-eslint/typescript-eslint/commit/c8ee43269faea4c04ec02eaa2b81a0aa6eec5d3e)), closes [#3136](https://github.com/typescript-eslint/typescript-eslint/issues/3136) +- support `PrivateIdentifier` ([#3808](https://github.com/typescript-eslint/typescript-eslint/issues/3808)) ([0eefe5e](https://github.com/typescript-eslint/typescript-eslint/commit/0eefe5e49d21af3f1e3e2d9a90c2e49929863ac2)), closes [#3430](https://github.com/typescript-eslint/typescript-eslint/issues/3430) [#2933](https://github.com/typescript-eslint/typescript-eslint/issues/2933) +- **eslint-plugin:** removed value from abstract property nodes ([#3765](https://github.com/typescript-eslint/typescript-eslint/issues/3765)) ([5823524](https://github.com/typescript-eslint/typescript-eslint/commit/58235241714596b641a1e8b39c569e561e0039b4)), closes [#3748](https://github.com/typescript-eslint/typescript-eslint/issues/3748) # [4.33.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.32.0...v4.33.0) (2021-10-04) **Note:** Version bump only for package @typescript-eslint/ast-spec - - - - # [4.32.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.31.2...v4.32.0) (2021-09-27) **Note:** Version bump only for package @typescript-eslint/ast-spec - - - - ## [4.31.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.31.1...v4.31.2) (2021-09-20) **Note:** Version bump only for package @typescript-eslint/ast-spec - - - - ## [4.31.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.31.0...v4.31.1) (2021-09-13) **Note:** Version bump only for package @typescript-eslint/ast-spec - - - - # [4.31.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.30.0...v4.31.0) (2021-09-06) - ### Bug Fixes -* **ast-spec:** remove duplicate union types from `Expression` ([#3770](https://github.com/typescript-eslint/typescript-eslint/issues/3770)) ([463e768](https://github.com/typescript-eslint/typescript-eslint/commit/463e768978731d019345f6552d7fd7a073a80192)) - +- **ast-spec:** remove duplicate union types from `Expression` ([#3770](https://github.com/typescript-eslint/typescript-eslint/issues/3770)) ([463e768](https://github.com/typescript-eslint/typescript-eslint/commit/463e768978731d019345f6552d7fd7a073a80192)) ### Features -* **eslint-plugin:** add extension rule `padding-line-between-statements` ([#3418](https://github.com/typescript-eslint/typescript-eslint/issues/3418)) ([f79ae9b](https://github.com/typescript-eslint/typescript-eslint/commit/f79ae9b58e82f4fddef640a34a1d7ff92b763e65)) - - - - +- **eslint-plugin:** add extension rule `padding-line-between-statements` ([#3418](https://github.com/typescript-eslint/typescript-eslint/issues/3418)) ([f79ae9b](https://github.com/typescript-eslint/typescript-eslint/commit/f79ae9b58e82f4fddef640a34a1d7ff92b763e65)) # [4.30.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.29.3...v4.30.0) (2021-08-30) - ### Features -* **typescript-estree:** add support for class static blocks ([#3730](https://github.com/typescript-eslint/typescript-eslint/issues/3730)) ([f81831b](https://github.com/typescript-eslint/typescript-eslint/commit/f81831bd279a32da6dbab0f1c061053ea43965f6)) - - - - +- **typescript-estree:** add support for class static blocks ([#3730](https://github.com/typescript-eslint/typescript-eslint/issues/3730)) ([f81831b](https://github.com/typescript-eslint/typescript-eslint/commit/f81831bd279a32da6dbab0f1c061053ea43965f6)) ## [4.29.3](https://github.com/typescript-eslint/typescript-eslint/compare/v4.29.2...v4.29.3) (2021-08-23) **Note:** Version bump only for package @typescript-eslint/ast-spec - - - - ## [4.29.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.29.1...v4.29.2) (2021-08-16) **Note:** Version bump only for package @typescript-eslint/ast-spec - - - - ## [4.29.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.29.0...v4.29.1) (2021-08-09) **Note:** Version bump only for package @typescript-eslint/ast-spec - - - - # [4.29.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.5...v4.29.0) (2021-08-02) - ### Features -* **ast-spec:** extract `ExportKind` & `ImportKind` ([#3564](https://github.com/typescript-eslint/typescript-eslint/issues/3564)) ([120d566](https://github.com/typescript-eslint/typescript-eslint/commit/120d566c980c61d3823fbe8b2db30d76b8c31140)) -* **ast-spec:** make `BaseNode` & `BaseToken` more type-safe ([#3560](https://github.com/typescript-eslint/typescript-eslint/issues/3560)) ([a6c5604](https://github.com/typescript-eslint/typescript-eslint/commit/a6c5604b65b6330d047aa016fc46b8a597a6ae58)) - - - - +- **ast-spec:** extract `ExportKind` & `ImportKind` ([#3564](https://github.com/typescript-eslint/typescript-eslint/issues/3564)) ([120d566](https://github.com/typescript-eslint/typescript-eslint/commit/120d566c980c61d3823fbe8b2db30d76b8c31140)) +- **ast-spec:** make `BaseNode` & `BaseToken` more type-safe ([#3560](https://github.com/typescript-eslint/typescript-eslint/issues/3560)) ([a6c5604](https://github.com/typescript-eslint/typescript-eslint/commit/a6c5604b65b6330d047aa016fc46b8a597a6ae58)) ## [4.28.5](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.4...v4.28.5) (2021-07-26) **Note:** Version bump only for package @typescript-eslint/ast-spec - - - - ## [4.28.4](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.3...v4.28.4) (2021-07-19) **Note:** Version bump only for package @typescript-eslint/ast-spec - - - - ## [4.28.3](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.2...v4.28.3) (2021-07-12) **Note:** Version bump only for package @typescript-eslint/ast-spec - - - - ## [4.28.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.1...v4.28.2) (2021-07-05) **Note:** Version bump only for package @typescript-eslint/ast-spec - - - - ## [4.28.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.0...v4.28.1) (2021-06-28) **Note:** Version bump only for package @typescript-eslint/ast-spec - - - - # [4.28.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.27.0...v4.28.0) (2021-06-21) **Note:** Version bump only for package @typescript-eslint/ast-spec - - - - # [4.27.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.26.1...v4.27.0) (2021-06-14) - ### Bug Fixes -* **typescript-estree:** support override modifier for parameter property ([#3485](https://github.com/typescript-eslint/typescript-eslint/issues/3485)) ([33b9f69](https://github.com/typescript-eslint/typescript-eslint/commit/33b9f69a681cd3219a2acca5b0b2fa67609f099e)) - +- **typescript-estree:** support override modifier for parameter property ([#3485](https://github.com/typescript-eslint/typescript-eslint/issues/3485)) ([33b9f69](https://github.com/typescript-eslint/typescript-eslint/commit/33b9f69a681cd3219a2acca5b0b2fa67609f099e)) ### Features -* **ast-spec:** specify `LogicalExpression`'s `operator` type ([#3497](https://github.com/typescript-eslint/typescript-eslint/issues/3497)) ([9e343fd](https://github.com/typescript-eslint/typescript-eslint/commit/9e343fdaa0b04ed007b873c781e8cc98fc1fb7f5)) -* **ast-spec:** specify `PunctuatorToken`'s `value` type ([#3496](https://github.com/typescript-eslint/typescript-eslint/issues/3496)) ([fdb1d81](https://github.com/typescript-eslint/typescript-eslint/commit/fdb1d81f0fcf75a9216e6a90469f18c24c91f718)) - - - - +- **ast-spec:** specify `LogicalExpression`'s `operator` type ([#3497](https://github.com/typescript-eslint/typescript-eslint/issues/3497)) ([9e343fd](https://github.com/typescript-eslint/typescript-eslint/commit/9e343fdaa0b04ed007b873c781e8cc98fc1fb7f5)) +- **ast-spec:** specify `PunctuatorToken`'s `value` type ([#3496](https://github.com/typescript-eslint/typescript-eslint/issues/3496)) ([fdb1d81](https://github.com/typescript-eslint/typescript-eslint/commit/fdb1d81f0fcf75a9216e6a90469f18c24c91f718)) ## [4.26.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.26.0...v4.26.1) (2021-06-07) **Note:** Version bump only for package @typescript-eslint/ast-spec - - - - # [4.26.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.25.0...v4.26.0) (2021-05-31) **Note:** Version bump only for package @typescript-eslint/ast-spec - - - - # [4.25.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.24.0...v4.25.0) (2021-05-24) - ### Features -* **typescript-estree:** [TS4.3] support overrides on class members ([#3429](https://github.com/typescript-eslint/typescript-eslint/issues/3429)) ([21d1b62](https://github.com/typescript-eslint/typescript-eslint/commit/21d1b62a0b84b502d2cf12674b3d141994a3ffd4)) -* **typescript-estree:** add support for getter/setter signatures on types ([#3427](https://github.com/typescript-eslint/typescript-eslint/issues/3427)) ([b830b7f](https://github.com/typescript-eslint/typescript-eslint/commit/b830b7f4e8a99affc8af8b53cb83371ef81d7032)), closes [#3272](https://github.com/typescript-eslint/typescript-eslint/issues/3272) [#3272](https://github.com/typescript-eslint/typescript-eslint/issues/3272) - - - - +- **typescript-estree:** [TS4.3] support overrides on class members ([#3429](https://github.com/typescript-eslint/typescript-eslint/issues/3429)) ([21d1b62](https://github.com/typescript-eslint/typescript-eslint/commit/21d1b62a0b84b502d2cf12674b3d141994a3ffd4)) +- **typescript-estree:** add support for getter/setter signatures on types ([#3427](https://github.com/typescript-eslint/typescript-eslint/issues/3427)) ([b830b7f](https://github.com/typescript-eslint/typescript-eslint/commit/b830b7f4e8a99affc8af8b53cb83371ef81d7032)), closes [#3272](https://github.com/typescript-eslint/typescript-eslint/issues/3272) [#3272](https://github.com/typescript-eslint/typescript-eslint/issues/3272) # [4.24.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.23.0...v4.24.0) (2021-05-17) **Note:** Version bump only for package @typescript-eslint/ast-spec - - - - # [4.23.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.22.1...v4.23.0) (2021-05-10) - ### Features -* refactor to split AST specification out as its own module ([#2911](https://github.com/typescript-eslint/typescript-eslint/issues/2911)) ([25ea953](https://github.com/typescript-eslint/typescript-eslint/commit/25ea953cc60b118bd385c71e0a9b61c286c26fcf)) +- refactor to split AST specification out as its own module ([#2911](https://github.com/typescript-eslint/typescript-eslint/issues/2911)) ([25ea953](https://github.com/typescript-eslint/typescript-eslint/commit/25ea953cc60b118bd385c71e0a9b61c286c26fcf)) diff --git a/packages/ast-spec/LICENSE b/packages/ast-spec/LICENSE index 7e7370143b2..a1164108d4d 100644 --- a/packages/ast-spec/LICENSE +++ b/packages/ast-spec/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2019 TypeScript ESLint and other contributors +Copyright (c) 2019 typescript-eslint and other contributors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/packages/ast-spec/README.md b/packages/ast-spec/README.md index 388241c0061..43536bb821b 100644 --- a/packages/ast-spec/README.md +++ b/packages/ast-spec/README.md @@ -1,24 +1,16 @@ -

TypeScript-ESTree AST Specification

+# `@typescript-eslint/ast-spec` -

- CI - NPM Version - NPM Downloads -

+> Complete specification for the TypeScript-ESTree AST -This is the complete specification for the TypeScript-ESTree AST. - -It includes: +This package includes: - Node definitions as TypeScript types (the specification) - Logic for converting from the TypeScript AST to the TypeScript-ESTree AST. - Tests/Fixtures/Examples for each Node -**You probably don't want to use it directly.** - -If you're building an ESLint plugin, consider using [`@typescript-eslint/utils`](../utils) and [`@typescript-eslint/type-utils`](../type-utils). -If you're parsing TypeScript code, consider using [`@typescript-eslint/typescript-estree`](../typescript-estree). +## ✋ Internal Package -## Contributing +This is an _internal package_ to the [typescript-eslint monorepo](https://github.com/typescript-eslint/typescript-eslint). +You likely don't want to use it directly. -[See the contributing guide here](../../CONTRIBUTING.md) +👉 See **https://typescript-eslint.io** for docs on typescript-eslint. diff --git a/packages/ast-spec/jest.config.js b/packages/ast-spec/jest.config.js index eeae64cb5dd..6b927c0166b 100644 --- a/packages/ast-spec/jest.config.js +++ b/packages/ast-spec/jest.config.js @@ -1,9 +1,15 @@ 'use strict'; // @ts-check + +const baseConfig = require('../../jest.config.base.js'); + /** @type {import('@jest/types').Config.InitialOptions} */ module.exports = { - ...require('../../jest.config.base.js'), + ...baseConfig, collectCoverage: false, - setupFilesAfterEnv: ['./tests/util/setupJest.ts'], + setupFilesAfterEnv: [ + ...baseConfig.setupFilesAfterEnv, + './tests/util/setupJest.ts', + ], }; diff --git a/packages/ast-spec/package.json b/packages/ast-spec/package.json index 96ef5ba21ea..c5e160a5c41 100644 --- a/packages/ast-spec/package.json +++ b/packages/ast-spec/package.json @@ -1,7 +1,7 @@ { "name": "@typescript-eslint/ast-spec", - "version": "5.31.0", - "description": "TypeScript-ESTree AST spec", + "version": "5.50.0", + "description": "Complete specification for the TypeScript-ESTree AST", "private": true, "keywords": [ "eslint", @@ -34,7 +34,7 @@ "postclean": "rimraf dist && rimraf _ts3.4 && rimraf .rollup.cache && rimraf coverage", "clean-fixtures": "rimraf -g \"./src/**/fixtures/**/snapshots\"", "format": "prettier --write \"./**/*.{ts,mts,cts,tsx,js,mjs,cjs,jsx,json,md,css}\" --ignore-path ../../.prettierignore", - "lint": "eslint . --ignore-path='../../.eslintignore'", + "lint": "nx lint", "test": "jest", "typecheck": "tsc -p tsconfig.json --noEmit" }, diff --git a/packages/ast-spec/project.json b/packages/ast-spec/project.json index 3cb2cf7be65..41721d18d71 100644 --- a/packages/ast-spec/project.json +++ b/packages/ast-spec/project.json @@ -1,5 +1,23 @@ { - "root": "packages/ast-spec", + "name": "ast-spec", + "$schema": "../../node_modules/nx/schemas/project-schema.json", "type": "library", - "implicitDependencies": [] + "implicitDependencies": [], + "targets": { + "build": { + "executor": "nx:run-commands", + "options": { + "cwd": "packages/ast-spec", + "commands": ["yarn build"] + }, + "outputs": ["{projectRoot}/dist/**/*.ts"] + }, + "lint": { + "executor": "@nrwl/linter:eslint", + "outputs": ["{options.outputFile}"], + "options": { + "lintFilePatterns": ["packages/ast-spec/**/*.ts"] + } + } + } } diff --git a/packages/ast-spec/src/ast-node-types.ts b/packages/ast-spec/src/ast-node-types.ts index ff90dd1ee18..7a637489eb0 100644 --- a/packages/ast-spec/src/ast-node-types.ts +++ b/packages/ast-spec/src/ast-node-types.ts @@ -1,4 +1,5 @@ export enum AST_NODE_TYPES { + AccessorProperty = 'AccessorProperty', ArrayExpression = 'ArrayExpression', ArrayPattern = 'ArrayPattern', ArrowFunctionExpression = 'ArrowFunctionExpression', @@ -90,6 +91,7 @@ export enum AST_NODE_TYPES { /** * TS-prefixed nodes */ + TSAbstractAccessorProperty = 'TSAbstractAccessorProperty', TSAbstractKeyword = 'TSAbstractKeyword', TSAbstractMethodDefinition = 'TSAbstractMethodDefinition', TSAbstractPropertyDefinition = 'TSAbstractPropertyDefinition', @@ -145,6 +147,7 @@ export enum AST_NODE_TYPES { TSQualifiedName = 'TSQualifiedName', TSReadonlyKeyword = 'TSReadonlyKeyword', TSRestType = 'TSRestType', + TSSatisfiesExpression = 'TSSatisfiesExpression', TSStaticKeyword = 'TSStaticKeyword', TSStringKeyword = 'TSStringKeyword', TSSymbolKeyword = 'TSSymbolKeyword', diff --git a/packages/ast-spec/src/base/BaseNode.ts b/packages/ast-spec/src/base/BaseNode.ts index 797b3d35132..6c753efd731 100644 --- a/packages/ast-spec/src/base/BaseNode.ts +++ b/packages/ast-spec/src/base/BaseNode.ts @@ -3,6 +3,8 @@ import type { AST_NODE_TYPES } from '../ast-node-types'; import type { NodeOrTokenData } from './NodeOrTokenData'; export interface BaseNode extends NodeOrTokenData { + type: AST_NODE_TYPES; + /** * The parent node of the current node * @@ -10,6 +12,4 @@ export interface BaseNode extends NodeOrTokenData { * while traversing. */ // parent?: Node; - - type: AST_NODE_TYPES; } diff --git a/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/kind-type/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/kind-type/snapshots/1-TSESTree-AST.shot deleted file mode 100644 index 4e1ab2405d4..00000000000 --- a/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/kind-type/snapshots/1-TSESTree-AST.shot +++ /dev/null @@ -1,48 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`AST Fixtures declaration ExportAllDeclaration kind-type TSESTree - AST 1`] = ` -Program { - type: "Program", - body: Array [ - ExportAllDeclaration { - type: "ExportAllDeclaration", - assertions: Array [], - exported: Identifier { - type: "Identifier", - name: "x", - - range: [17, 18], - loc: { - start: { column: 17, line: 1 }, - end: { column: 18, line: 1 }, - }, - }, - exportKind: "type", - source: Literal { - type: "Literal", - raw: "'a'", - value: "a", - - range: [24, 27], - loc: { - start: { column: 24, line: 1 }, - end: { column: 27, 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/ExportAllDeclaration/fixtures/_error_/kind-type/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/kind-type/snapshots/2-TSESTree-Tokens.shot deleted file mode 100644 index f5bfa8f5615..00000000000 --- a/packages/ast-spec/src/declaration/ExportAllDeclaration/fixtures/_error_/kind-type/snapshots/2-TSESTree-Tokens.shot +++ /dev/null @@ -1,86 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`AST Fixtures declaration ExportAllDeclaration kind-type TSESTree - Tokens 1`] = ` -Array [ - Keyword { - type: "Keyword", - value: "export", - - range: [0, 6], - loc: { - start: { column: 0, line: 1 }, - end: { column: 6, line: 1 }, - }, - }, - Identifier { - type: "Identifier", - value: "type", - - range: [7, 11], - loc: { - start: { column: 7, line: 1 }, - end: { column: 11, line: 1 }, - }, - }, - Punctuator { - type: "Punctuator", - value: "*", - - range: [12, 13], - loc: { - start: { column: 12, line: 1 }, - end: { column: 13, line: 1 }, - }, - }, - Identifier { - type: "Identifier", - value: "as", - - range: [14, 16], - loc: { - start: { column: 14, line: 1 }, - end: { column: 16, line: 1 }, - }, - }, - Identifier { - type: "Identifier", - value: "x", - - range: [17, 18], - loc: { - start: { column: 17, line: 1 }, - end: { column: 18, line: 1 }, - }, - }, - Identifier { - type: "Identifier", - value: "from", - - range: [19, 23], - loc: { - start: { column: 19, line: 1 }, - end: { column: 23, line: 1 }, - }, - }, - String { - type: "String", - value: "'a'", - - range: [24, 27], - loc: { - start: { column: 24, 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/assertion/fixture.ts b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/assertion/fixture.ts similarity index 100% rename from packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/assertion/fixture.ts rename to packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/assertion/fixture.ts diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/assertion/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/assertion/snapshots/1-TSESTree-Error.shot new file mode 100644 index 00000000000..eac30154d3d --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/assertion/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration _error_ assertion TSESTree - Error 1`] = `"NO ERROR"`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/assertion/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/assertion/snapshots/2-Babel-Error.shot new file mode 100644 index 00000000000..873ef0496aa --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/assertion/snapshots/2-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration _error_ assertion Babel - Error 1`] = `[SyntaxError: A JSON module can only be imported with \`default\`. (1:9)]`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/assertion/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/assertion/snapshots/3-Alignment-Error.shot new file mode 100644 index 00000000000..b75c9eb03cb --- /dev/null +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/_error_/assertion/snapshots/3-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures declaration ExportNamedDeclaration _error_ assertion Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/assertion/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/assertion/snapshots/1-TSESTree-AST.shot deleted file mode 100644 index 9136ca295cb..00000000000 --- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/assertion/snapshots/1-TSESTree-AST.shot +++ /dev/null @@ -1,102 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`AST Fixtures declaration ExportNamedDeclaration assertion TSESTree - AST 1`] = ` -Program { - type: "Program", - body: Array [ - ExportNamedDeclaration { - type: "ExportNamedDeclaration", - assertions: Array [ - ImportAttribute { - type: "ImportAttribute", - key: Identifier { - type: "Identifier", - name: "type", - - range: [35, 39], - loc: { - start: { column: 35, line: 1 }, - end: { column: 39, line: 1 }, - }, - }, - value: Literal { - type: "Literal", - raw: "'json'", - value: "json", - - range: [41, 47], - loc: { - start: { column: 41, line: 1 }, - end: { column: 47, line: 1 }, - }, - }, - - range: [35, 47], - loc: { - start: { column: 35, line: 1 }, - end: { column: 47, line: 1 }, - }, - }, - ], - declaration: null, - exportKind: "value", - source: Literal { - type: "Literal", - raw: "'mod'", - value: "mod", - - range: [20, 25], - loc: { - start: { column: 20, line: 1 }, - end: { column: 25, line: 1 }, - }, - }, - specifiers: Array [ - ExportSpecifier { - type: "ExportSpecifier", - exported: Identifier { - type: "Identifier", - name: "foo", - - range: [9, 12], - loc: { - start: { column: 9, line: 1 }, - end: { column: 12, line: 1 }, - }, - }, - exportKind: "value", - local: Identifier { - type: "Identifier", - name: "foo", - - range: [9, 12], - loc: { - start: { column: 9, line: 1 }, - end: { column: 12, line: 1 }, - }, - }, - - range: [9, 12], - loc: { - start: { column: 9, line: 1 }, - end: { column: 12, line: 1 }, - }, - }, - ], - - range: [0, 50], - loc: { - start: { column: 0, line: 1 }, - end: { column: 50, line: 1 }, - }, - }, - ], - sourceType: "module", - - range: [0, 51], - loc: { - start: { column: 0, line: 1 }, - end: { column: 0, line: 2 }, - }, -} -`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/assertion/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/assertion/snapshots/2-TSESTree-Tokens.shot deleted file mode 100644 index 9a30eb2745c..00000000000 --- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/assertion/snapshots/2-TSESTree-Tokens.shot +++ /dev/null @@ -1,136 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`AST Fixtures declaration ExportNamedDeclaration assertion TSESTree - Tokens 1`] = ` -Array [ - 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: "foo", - - range: [9, 12], - loc: { - start: { column: 9, line: 1 }, - end: { column: 12, line: 1 }, - }, - }, - Punctuator { - type: "Punctuator", - value: "}", - - range: [13, 14], - loc: { - start: { column: 13, line: 1 }, - end: { column: 14, line: 1 }, - }, - }, - Identifier { - type: "Identifier", - value: "from", - - range: [15, 19], - loc: { - start: { column: 15, line: 1 }, - end: { column: 19, line: 1 }, - }, - }, - String { - type: "String", - value: "'mod'", - - range: [20, 25], - loc: { - start: { column: 20, line: 1 }, - end: { column: 25, line: 1 }, - }, - }, - Identifier { - type: "Identifier", - value: "assert", - - range: [26, 32], - loc: { - start: { column: 26, line: 1 }, - end: { column: 32, line: 1 }, - }, - }, - Punctuator { - type: "Punctuator", - value: "{", - - range: [33, 34], - loc: { - start: { column: 33, line: 1 }, - end: { column: 34, line: 1 }, - }, - }, - Identifier { - type: "Identifier", - value: "type", - - range: [35, 39], - loc: { - start: { column: 35, line: 1 }, - end: { column: 39, line: 1 }, - }, - }, - Punctuator { - type: "Punctuator", - value: ":", - - range: [39, 40], - loc: { - start: { column: 39, line: 1 }, - end: { column: 40, line: 1 }, - }, - }, - String { - type: "String", - value: "'json'", - - range: [41, 47], - loc: { - start: { column: 41, line: 1 }, - end: { column: 47, line: 1 }, - }, - }, - Punctuator { - type: "Punctuator", - value: "}", - - range: [48, 49], - loc: { - start: { column: 48, line: 1 }, - end: { column: 49, line: 1 }, - }, - }, - Punctuator { - type: "Punctuator", - value: ";", - - range: [49, 50], - loc: { - start: { column: 49, line: 1 }, - end: { column: 50, line: 1 }, - }, - }, -] -`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/assertion/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/assertion/snapshots/3-Babel-AST.shot deleted file mode 100644 index b2ee980389e..00000000000 --- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/assertion/snapshots/3-Babel-AST.shot +++ /dev/null @@ -1,102 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`AST Fixtures declaration ExportNamedDeclaration assertion Babel - AST 1`] = ` -Program { - type: "Program", - body: Array [ - ExportNamedDeclaration { - type: "ExportNamedDeclaration", - assertions: Array [ - ImportAttribute { - type: "ImportAttribute", - key: Identifier { - type: "Identifier", - name: "type", - - range: [35, 39], - loc: { - start: { column: 35, line: 1 }, - end: { column: 39, line: 1 }, - }, - }, - value: Literal { - type: "Literal", - raw: "'json'", - value: "json", - - range: [41, 47], - loc: { - start: { column: 41, line: 1 }, - end: { column: 47, line: 1 }, - }, - }, - - range: [35, 47], - loc: { - start: { column: 35, line: 1 }, - end: { column: 47, line: 1 }, - }, - }, - ], - declaration: null, - exportKind: "value", - source: Literal { - type: "Literal", - raw: "'mod'", - value: "mod", - - range: [20, 25], - loc: { - start: { column: 20, line: 1 }, - end: { column: 25, line: 1 }, - }, - }, - specifiers: Array [ - ExportSpecifier { - type: "ExportSpecifier", - exported: Identifier { - type: "Identifier", - name: "foo", - - range: [9, 12], - loc: { - start: { column: 9, line: 1 }, - end: { column: 12, line: 1 }, - }, - }, - exportKind: "value", - local: Identifier { - type: "Identifier", - name: "foo", - - range: [9, 12], - loc: { - start: { column: 9, line: 1 }, - end: { column: 12, line: 1 }, - }, - }, - - range: [9, 12], - loc: { - start: { column: 9, line: 1 }, - end: { column: 12, line: 1 }, - }, - }, - ], - - range: [0, 50], - loc: { - start: { column: 0, line: 1 }, - end: { column: 50, line: 1 }, - }, - }, - ], - sourceType: "module", - - range: [0, 51], - loc: { - start: { column: 0, line: 1 }, - end: { column: 0, line: 2 }, - }, -} -`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/assertion/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/assertion/snapshots/4-Babel-Tokens.shot deleted file mode 100644 index 95aa314bf6b..00000000000 --- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/assertion/snapshots/4-Babel-Tokens.shot +++ /dev/null @@ -1,136 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`AST Fixtures declaration ExportNamedDeclaration assertion Babel - Tokens 1`] = ` -Array [ - 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: "foo", - - range: [9, 12], - loc: { - start: { column: 9, line: 1 }, - end: { column: 12, line: 1 }, - }, - }, - Punctuator { - type: "Punctuator", - value: "}", - - range: [13, 14], - loc: { - start: { column: 13, line: 1 }, - end: { column: 14, line: 1 }, - }, - }, - Identifier { - type: "Identifier", - value: "from", - - range: [15, 19], - loc: { - start: { column: 15, line: 1 }, - end: { column: 19, line: 1 }, - }, - }, - String { - type: "String", - value: "'mod'", - - range: [20, 25], - loc: { - start: { column: 20, line: 1 }, - end: { column: 25, line: 1 }, - }, - }, - Identifier { - type: "Identifier", - value: "assert", - - range: [26, 32], - loc: { - start: { column: 26, line: 1 }, - end: { column: 32, line: 1 }, - }, - }, - Punctuator { - type: "Punctuator", - value: "{", - - range: [33, 34], - loc: { - start: { column: 33, line: 1 }, - end: { column: 34, line: 1 }, - }, - }, - Identifier { - type: "Identifier", - value: "type", - - range: [35, 39], - loc: { - start: { column: 35, line: 1 }, - end: { column: 39, line: 1 }, - }, - }, - Punctuator { - type: "Punctuator", - value: ":", - - range: [39, 40], - loc: { - start: { column: 39, line: 1 }, - end: { column: 40, line: 1 }, - }, - }, - String { - type: "String", - value: "'json'", - - range: [41, 47], - loc: { - start: { column: 41, line: 1 }, - end: { column: 47, line: 1 }, - }, - }, - Punctuator { - type: "Punctuator", - value: "}", - - range: [48, 49], - loc: { - start: { column: 48, line: 1 }, - end: { column: 49, line: 1 }, - }, - }, - Punctuator { - type: "Punctuator", - value: ";", - - range: [49, 50], - loc: { - start: { column: 49, line: 1 }, - end: { column: 50, line: 1 }, - }, - }, -] -`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/spec.ts b/packages/ast-spec/src/declaration/ExportNamedDeclaration/spec.ts index 061c53f4b46..b9b158eddb4 100644 --- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/spec.ts +++ b/packages/ast-spec/src/declaration/ExportNamedDeclaration/spec.ts @@ -46,7 +46,7 @@ export interface ExportNamedDeclarationWithoutSourceWithMultiple extends ExportNamedDeclarationBase { // this will always be empty array assertions: ImportAttribute[]; - declaration: NamedExportDeclarations; + declaration: null; source: null; specifiers: ExportSpecifier[]; } @@ -55,7 +55,7 @@ export interface ExportNamedDeclarationWithoutSourceWithSingle extends ExportNamedDeclarationBase { // this will always be empty array assertions: ImportAttribute[]; - declaration: null; + declaration: NamedExportDeclarations; source: null; // this will always be empty array specifiers: ExportSpecifier[]; diff --git a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/async/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/async/snapshots/1-TSESTree-AST.shot deleted file mode 100644 index d01382249a1..00000000000 --- a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/async/snapshots/1-TSESTree-AST.shot +++ /dev/null @@ -1,40 +0,0 @@ -// Jest Snapshot v1, https://goo.gl/fbAQLP - -exports[`AST Fixtures declaration TSDeclareFunction async TSESTree - AST 1`] = ` -Program { - type: "Program", - body: Array [ - TSDeclareFunction { - type: "TSDeclareFunction", - async: true, - declare: true, - expression: false, - generator: false, - id: Identifier { - type: "Identifier", - name: "foo", - - range: [23, 26], - loc: { - start: { column: 23, line: 1 }, - end: { column: 26, line: 1 }, - }, - }, - params: Array [], - - range: [0, 29], - loc: { - start: { column: 0, line: 1 }, - end: { column: 29, line: 1 }, - }, - }, - ], - sourceType: "script", - - range: [0, 30], - loc: { - start: { column: 0, line: 1 }, - end: { column: 0, line: 2 }, - }, -} -`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/modifier-override-with-no-extends/fixture.ts b/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/modifier-override-with-no-extends/fixture.ts new file mode 100644 index 00000000000..3369657d82b --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/modifier-override-with-no-extends/fixture.ts @@ -0,0 +1,3 @@ +class Foo { + override accessor foo = 2; +} diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/modifier-override-with-no-extends/snapshots/1-TSESTree-Error.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/modifier-override-with-no-extends/snapshots/1-TSESTree-Error.shot new file mode 100644 index 00000000000..e1f58f42d42 --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/modifier-override-with-no-extends/snapshots/1-TSESTree-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty _error_ modifier-override-with-no-extends TSESTree - Error 1`] = `"NO ERROR"`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/modifier-override-with-no-extends/snapshots/2-Babel-Error.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/modifier-override-with-no-extends/snapshots/2-Babel-Error.shot new file mode 100644 index 00000000000..071d521919f --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/modifier-override-with-no-extends/snapshots/2-Babel-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty _error_ modifier-override-with-no-extends Babel - Error 1`] = `[SyntaxError: This member cannot have an 'override' modifier because its containing class does not extend another class. (2:2)]`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/modifier-override-with-no-extends/snapshots/3-Alignment-Error.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/modifier-override-with-no-extends/snapshots/3-Alignment-Error.shot new file mode 100644 index 00000000000..27d6eef74b0 --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/_error_/modifier-override-with-no-extends/snapshots/3-Alignment-Error.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty _error_ modifier-override-with-no-extends Error Alignment 1`] = `"Babel errored but TSESTree didn't"`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-complex/fixture.ts b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-complex/fixture.ts new file mode 100644 index 00000000000..5dc28758b4e --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-complex/fixture.ts @@ -0,0 +1,3 @@ +class Foo { + accessor 1 = 2; +} diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-complex/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-complex/snapshots/1-TSESTree-AST.shot new file mode 100644 index 00000000000..00745c8a8d3 --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-complex/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,82 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty key-computed-complex TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + AccessorProperty { + type: "AccessorProperty", + computed: false, + declare: false, + key: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [23, 24], + loc: { + start: { column: 11, line: 2 }, + end: { column: 12, line: 2 }, + }, + }, + override: false, + static: false, + value: Literal { + type: "Literal", + raw: "2", + value: 2, + + range: [27, 28], + loc: { + start: { column: 15, line: 2 }, + end: { column: 16, line: 2 }, + }, + }, + + range: [14, 29], + loc: { + start: { column: 2, line: 2 }, + end: { column: 17, line: 2 }, + }, + }, + ], + + range: [10, 31], + loc: { + start: { column: 10, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + superClass: null, + + range: [0, 31], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [0, 32], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-complex/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-complex/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 00000000000..97c056640e7 --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-complex/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,96 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty key-computed-complex TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [0, 5], + loc: { + start: { column: 0, line: 1 }, + end: { column: 5, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "accessor", + + range: [14, 22], + loc: { + start: { column: 2, line: 2 }, + end: { column: 10, line: 2 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [23, 24], + loc: { + start: { column: 11, line: 2 }, + end: { column: 12, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [25, 26], + loc: { + start: { column: 13, line: 2 }, + end: { column: 14, line: 2 }, + }, + }, + Numeric { + type: "Numeric", + value: "2", + + range: [27, 28], + loc: { + start: { column: 15, line: 2 }, + end: { column: 16, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [28, 29], + loc: { + start: { column: 16, line: 2 }, + end: { column: 17, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [30, 31], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-complex/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-complex/snapshots/3-Babel-AST.shot new file mode 100644 index 00000000000..e52653f4094 --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-complex/snapshots/3-Babel-AST.shot @@ -0,0 +1,80 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty key-computed-complex Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + ClassAccessorProperty { + type: "ClassAccessorProperty", + computed: false, + key: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [23, 24], + loc: { + start: { column: 11, line: 2 }, + end: { column: 12, line: 2 }, + }, + }, + static: false, + value: Literal { + type: "Literal", + raw: "2", + value: 2, + + range: [27, 28], + loc: { + start: { column: 15, line: 2 }, + end: { column: 16, line: 2 }, + }, + }, + + range: [14, 29], + loc: { + start: { column: 2, line: 2 }, + end: { column: 17, line: 2 }, + }, + }, + ], + + range: [10, 31], + loc: { + start: { column: 10, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + superClass: null, + + range: [0, 31], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [0, 32], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-complex/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-complex/snapshots/4-Babel-Tokens.shot new file mode 100644 index 00000000000..651eb331471 --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-complex/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,96 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty key-computed-complex Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [0, 5], + loc: { + start: { column: 0, line: 1 }, + end: { column: 5, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "accessor", + + range: [14, 22], + loc: { + start: { column: 2, line: 2 }, + end: { column: 10, line: 2 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [23, 24], + loc: { + start: { column: 11, line: 2 }, + end: { column: 12, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [25, 26], + loc: { + start: { column: 13, line: 2 }, + end: { column: 14, line: 2 }, + }, + }, + Numeric { + type: "Numeric", + value: "2", + + range: [27, 28], + loc: { + start: { column: 15, line: 2 }, + end: { column: 16, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [28, 29], + loc: { + start: { column: 16, line: 2 }, + end: { column: 17, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [30, 31], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-complex/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-complex/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 00000000000..b6b30dd18c6 --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-complex/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,88 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty key-computed-complex AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ClassDeclaration { + type: 'ClassDeclaration', + body: ClassBody { + type: 'ClassBody', + body: Array [ +- AccessorProperty { +- type: 'AccessorProperty', ++ ClassAccessorProperty { ++ type: 'ClassAccessorProperty', + computed: false, +- declare: false, + key: Literal { + type: 'Literal', + raw: '1', + value: 1, + + range: [23, 24], + loc: { + start: { column: 11, line: 2 }, + end: { column: 12, line: 2 }, + }, + }, +- override: false, + static: false, + value: Literal { + type: 'Literal', + raw: '2', + value: 2, + + range: [27, 28], + loc: { + start: { column: 15, line: 2 }, + end: { column: 16, line: 2 }, + }, + }, + + range: [14, 29], + loc: { + start: { column: 2, line: 2 }, + end: { column: 17, line: 2 }, + }, + }, + ], + + range: [10, 31], + loc: { + start: { column: 10, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'Foo', + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + superClass: null, + + range: [0, 31], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + ], + sourceType: 'script', + + range: [0, 32], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 4 }, + }, + }" +`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-complex/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-complex/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 00000000000..8375156efe1 --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-complex/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty key-computed-complex AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-number/fixture.ts b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-number/fixture.ts new file mode 100644 index 00000000000..e6eb4123594 --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-number/fixture.ts @@ -0,0 +1,3 @@ +class Foo { + accessor [1] = 2; +} diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-number/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-number/snapshots/1-TSESTree-AST.shot new file mode 100644 index 00000000000..abb1554d8a2 --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-number/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,82 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty key-computed-number TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + AccessorProperty { + type: "AccessorProperty", + computed: true, + declare: false, + key: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [24, 25], + loc: { + start: { column: 12, line: 2 }, + end: { column: 13, line: 2 }, + }, + }, + override: false, + static: false, + value: Literal { + type: "Literal", + raw: "2", + value: 2, + + range: [29, 30], + loc: { + start: { column: 17, line: 2 }, + end: { column: 18, line: 2 }, + }, + }, + + range: [14, 31], + loc: { + start: { column: 2, line: 2 }, + end: { column: 19, line: 2 }, + }, + }, + ], + + range: [10, 33], + loc: { + start: { column: 10, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + superClass: null, + + range: [0, 33], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [0, 34], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-number/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-number/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 00000000000..d12fe10489e --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-number/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,116 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty key-computed-number TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [0, 5], + loc: { + start: { column: 0, line: 1 }, + end: { column: 5, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "accessor", + + range: [14, 22], + loc: { + start: { column: 2, line: 2 }, + end: { column: 10, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [23, 24], + loc: { + start: { column: 11, line: 2 }, + end: { column: 12, line: 2 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [24, 25], + loc: { + start: { column: 12, line: 2 }, + end: { column: 13, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [25, 26], + loc: { + start: { column: 13, line: 2 }, + end: { column: 14, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [27, 28], + loc: { + start: { column: 15, line: 2 }, + end: { column: 16, line: 2 }, + }, + }, + Numeric { + type: "Numeric", + value: "2", + + range: [29, 30], + loc: { + start: { column: 17, line: 2 }, + end: { column: 18, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [30, 31], + loc: { + start: { column: 18, line: 2 }, + end: { column: 19, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [32, 33], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-number/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-number/snapshots/3-Babel-AST.shot new file mode 100644 index 00000000000..69de24d530d --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-number/snapshots/3-Babel-AST.shot @@ -0,0 +1,80 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty key-computed-number Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + ClassAccessorProperty { + type: "ClassAccessorProperty", + computed: true, + key: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [24, 25], + loc: { + start: { column: 12, line: 2 }, + end: { column: 13, line: 2 }, + }, + }, + static: false, + value: Literal { + type: "Literal", + raw: "2", + value: 2, + + range: [29, 30], + loc: { + start: { column: 17, line: 2 }, + end: { column: 18, line: 2 }, + }, + }, + + range: [14, 31], + loc: { + start: { column: 2, line: 2 }, + end: { column: 19, line: 2 }, + }, + }, + ], + + range: [10, 33], + loc: { + start: { column: 10, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + superClass: null, + + range: [0, 33], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [0, 34], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-number/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-number/snapshots/4-Babel-Tokens.shot new file mode 100644 index 00000000000..e2dd78f3f2f --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-number/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,116 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty key-computed-number Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [0, 5], + loc: { + start: { column: 0, line: 1 }, + end: { column: 5, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "accessor", + + range: [14, 22], + loc: { + start: { column: 2, line: 2 }, + end: { column: 10, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [23, 24], + loc: { + start: { column: 11, line: 2 }, + end: { column: 12, line: 2 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [24, 25], + loc: { + start: { column: 12, line: 2 }, + end: { column: 13, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [25, 26], + loc: { + start: { column: 13, line: 2 }, + end: { column: 14, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [27, 28], + loc: { + start: { column: 15, line: 2 }, + end: { column: 16, line: 2 }, + }, + }, + Numeric { + type: "Numeric", + value: "2", + + range: [29, 30], + loc: { + start: { column: 17, line: 2 }, + end: { column: 18, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [30, 31], + loc: { + start: { column: 18, line: 2 }, + end: { column: 19, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [32, 33], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-number/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-number/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 00000000000..bd3b115af80 --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-number/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,88 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty key-computed-number AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ClassDeclaration { + type: 'ClassDeclaration', + body: ClassBody { + type: 'ClassBody', + body: Array [ +- AccessorProperty { +- type: 'AccessorProperty', ++ ClassAccessorProperty { ++ type: 'ClassAccessorProperty', + computed: true, +- declare: false, + key: Literal { + type: 'Literal', + raw: '1', + value: 1, + + range: [24, 25], + loc: { + start: { column: 12, line: 2 }, + end: { column: 13, line: 2 }, + }, + }, +- override: false, + static: false, + value: Literal { + type: 'Literal', + raw: '2', + value: 2, + + range: [29, 30], + loc: { + start: { column: 17, line: 2 }, + end: { column: 18, line: 2 }, + }, + }, + + range: [14, 31], + loc: { + start: { column: 2, line: 2 }, + end: { column: 19, line: 2 }, + }, + }, + ], + + range: [10, 33], + loc: { + start: { column: 10, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'Foo', + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + superClass: null, + + range: [0, 33], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + ], + sourceType: 'script', + + range: [0, 34], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 4 }, + }, + }" +`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/assertion/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-number/snapshots/6-AST-Alignment-Tokens.shot similarity index 52% rename from packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/assertion/snapshots/6-AST-Alignment-Tokens.shot rename to packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-number/snapshots/6-AST-Alignment-Tokens.shot index dade8ee29e7..2243b91ca2e 100644 --- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/assertion/snapshots/6-AST-Alignment-Tokens.shot +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-number/snapshots/6-AST-Alignment-Tokens.shot @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration ExportNamedDeclaration assertion AST Alignment - Token 1`] = ` +exports[`AST Fixtures element AccessorProperty key-computed-number AST Alignment - Token 1`] = ` "Snapshot Diff: Compared values have no visual difference." `; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-string/fixture.ts b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-string/fixture.ts new file mode 100644 index 00000000000..feb7a8c14ce --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-string/fixture.ts @@ -0,0 +1,3 @@ +class Foo { + accessor ['prop'] = 'value'; +} diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-string/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-string/snapshots/1-TSESTree-AST.shot new file mode 100644 index 00000000000..24de40f9aae --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-string/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,82 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty key-computed-string TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + AccessorProperty { + type: "AccessorProperty", + computed: true, + declare: false, + key: Literal { + type: "Literal", + raw: "'prop'", + value: "prop", + + range: [24, 30], + loc: { + start: { column: 12, line: 2 }, + end: { column: 18, line: 2 }, + }, + }, + override: false, + static: false, + value: Literal { + type: "Literal", + raw: "'value'", + value: "value", + + range: [34, 41], + loc: { + start: { column: 22, line: 2 }, + end: { column: 29, line: 2 }, + }, + }, + + range: [14, 42], + loc: { + start: { column: 2, line: 2 }, + end: { column: 30, line: 2 }, + }, + }, + ], + + range: [10, 44], + loc: { + start: { column: 10, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + superClass: null, + + range: [0, 44], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [0, 45], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-string/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-string/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 00000000000..9b1fd979379 --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-string/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,116 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty key-computed-string TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [0, 5], + loc: { + start: { column: 0, line: 1 }, + end: { column: 5, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "accessor", + + range: [14, 22], + loc: { + start: { column: 2, line: 2 }, + end: { column: 10, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [23, 24], + loc: { + start: { column: 11, line: 2 }, + end: { column: 12, line: 2 }, + }, + }, + String { + type: "String", + value: "'prop'", + + range: [24, 30], + loc: { + start: { column: 12, line: 2 }, + end: { column: 18, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [30, 31], + loc: { + start: { column: 18, line: 2 }, + end: { column: 19, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [32, 33], + loc: { + start: { column: 20, line: 2 }, + end: { column: 21, line: 2 }, + }, + }, + String { + type: "String", + value: "'value'", + + range: [34, 41], + loc: { + start: { column: 22, line: 2 }, + end: { column: 29, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [41, 42], + loc: { + start: { column: 29, line: 2 }, + end: { column: 30, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [43, 44], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-string/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-string/snapshots/3-Babel-AST.shot new file mode 100644 index 00000000000..d8b18a55910 --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-string/snapshots/3-Babel-AST.shot @@ -0,0 +1,80 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty key-computed-string Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + ClassAccessorProperty { + type: "ClassAccessorProperty", + computed: true, + key: Literal { + type: "Literal", + raw: "'prop'", + value: "prop", + + range: [24, 30], + loc: { + start: { column: 12, line: 2 }, + end: { column: 18, line: 2 }, + }, + }, + static: false, + value: Literal { + type: "Literal", + raw: "'value'", + value: "value", + + range: [34, 41], + loc: { + start: { column: 22, line: 2 }, + end: { column: 29, line: 2 }, + }, + }, + + range: [14, 42], + loc: { + start: { column: 2, line: 2 }, + end: { column: 30, line: 2 }, + }, + }, + ], + + range: [10, 44], + loc: { + start: { column: 10, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + superClass: null, + + range: [0, 44], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [0, 45], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-string/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-string/snapshots/4-Babel-Tokens.shot new file mode 100644 index 00000000000..29da5db3884 --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-string/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,116 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty key-computed-string Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [0, 5], + loc: { + start: { column: 0, line: 1 }, + end: { column: 5, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "accessor", + + range: [14, 22], + loc: { + start: { column: 2, line: 2 }, + end: { column: 10, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "[", + + range: [23, 24], + loc: { + start: { column: 11, line: 2 }, + end: { column: 12, line: 2 }, + }, + }, + String { + type: "String", + value: "'prop'", + + range: [24, 30], + loc: { + start: { column: 12, line: 2 }, + end: { column: 18, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [30, 31], + loc: { + start: { column: 18, line: 2 }, + end: { column: 19, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [32, 33], + loc: { + start: { column: 20, line: 2 }, + end: { column: 21, line: 2 }, + }, + }, + String { + type: "String", + value: "'value'", + + range: [34, 41], + loc: { + start: { column: 22, line: 2 }, + end: { column: 29, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [41, 42], + loc: { + start: { column: 29, line: 2 }, + end: { column: 30, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [43, 44], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-string/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-string/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 00000000000..3ca8eaf26ea --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-string/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,88 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty key-computed-string AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ClassDeclaration { + type: 'ClassDeclaration', + body: ClassBody { + type: 'ClassBody', + body: Array [ +- AccessorProperty { +- type: 'AccessorProperty', ++ ClassAccessorProperty { ++ type: 'ClassAccessorProperty', + computed: true, +- declare: false, + key: Literal { + type: 'Literal', + raw: '\\\\'prop\\\\'', + value: 'prop', + + range: [24, 30], + loc: { + start: { column: 12, line: 2 }, + end: { column: 18, line: 2 }, + }, + }, +- override: false, + static: false, + value: Literal { + type: 'Literal', + raw: '\\\\'value\\\\'', + value: 'value', + + range: [34, 41], + loc: { + start: { column: 22, line: 2 }, + end: { column: 29, line: 2 }, + }, + }, + + range: [14, 42], + loc: { + start: { column: 2, line: 2 }, + end: { column: 30, line: 2 }, + }, + }, + ], + + range: [10, 44], + loc: { + start: { column: 10, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'Foo', + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + superClass: null, + + range: [0, 44], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + ], + sourceType: 'script', + + range: [0, 45], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 4 }, + }, + }" +`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-string/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-string/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 00000000000..628cbb97adb --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-computed-string/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty key-computed-string AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-number/fixture.ts b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-number/fixture.ts new file mode 100644 index 00000000000..e69de29bb2d diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-number/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-number/snapshots/1-TSESTree-AST.shot new file mode 100644 index 00000000000..40d09186f6d --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-number/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,15 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty key-number TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [], + sourceType: "script", + + range: [0, 0], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 1 }, + }, +} +`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-number/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-number/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 00000000000..ea5732d8dee --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-number/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty key-number TSESTree - Tokens 1`] = `Array []`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-number/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-number/snapshots/3-Babel-AST.shot new file mode 100644 index 00000000000..c3c65ccd7f8 --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-number/snapshots/3-Babel-AST.shot @@ -0,0 +1,15 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty key-number Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [], + sourceType: "script", + + range: [0, 0], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 1 }, + }, +} +`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-number/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-number/snapshots/4-Babel-Tokens.shot new file mode 100644 index 00000000000..75ca02a990c --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-number/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty key-number Babel - Tokens 1`] = `Array []`; diff --git a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/assertion/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-number/snapshots/5-AST-Alignment-AST.shot similarity index 52% rename from packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/assertion/snapshots/5-AST-Alignment-AST.shot rename to packages/ast-spec/src/element/AccessorProperty/fixtures/key-number/snapshots/5-AST-Alignment-AST.shot index 258519a7adf..55fd7a3d475 100644 --- a/packages/ast-spec/src/declaration/ExportNamedDeclaration/fixtures/assertion/snapshots/5-AST-Alignment-AST.shot +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-number/snapshots/5-AST-Alignment-AST.shot @@ -1,6 +1,6 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration ExportNamedDeclaration assertion AST Alignment - AST 1`] = ` +exports[`AST Fixtures element AccessorProperty key-number AST Alignment - AST 1`] = ` "Snapshot Diff: Compared values have no visual difference." `; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-number/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-number/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 00000000000..0ee5b89aab4 --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-number/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty key-number AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-private/fixture.ts b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-private/fixture.ts new file mode 100644 index 00000000000..255b0794a5e --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-private/fixture.ts @@ -0,0 +1,3 @@ +class Foo { + accessor #foo = 2; +} diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-private/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-private/snapshots/1-TSESTree-AST.shot new file mode 100644 index 00000000000..e30dd5e502f --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-private/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,81 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty key-private TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + AccessorProperty { + type: "AccessorProperty", + computed: false, + declare: false, + key: PrivateIdentifier { + type: "PrivateIdentifier", + name: "foo", + + range: [23, 27], + loc: { + start: { column: 11, line: 2 }, + end: { column: 15, line: 2 }, + }, + }, + override: false, + static: false, + value: Literal { + type: "Literal", + raw: "2", + value: 2, + + range: [30, 31], + loc: { + start: { column: 18, line: 2 }, + end: { column: 19, line: 2 }, + }, + }, + + range: [14, 32], + loc: { + start: { column: 2, line: 2 }, + end: { column: 20, line: 2 }, + }, + }, + ], + + range: [10, 34], + loc: { + start: { column: 10, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + superClass: null, + + range: [0, 34], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [0, 35], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-private/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-private/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 00000000000..1a3c3d84ed7 --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-private/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,96 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty key-private TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [0, 5], + loc: { + start: { column: 0, line: 1 }, + end: { column: 5, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "accessor", + + range: [14, 22], + loc: { + start: { column: 2, line: 2 }, + end: { column: 10, line: 2 }, + }, + }, + Identifier { + type: "Identifier", + value: "#foo", + + range: [23, 27], + loc: { + start: { column: 11, line: 2 }, + end: { column: 15, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [28, 29], + loc: { + start: { column: 16, line: 2 }, + end: { column: 17, line: 2 }, + }, + }, + Numeric { + type: "Numeric", + value: "2", + + range: [30, 31], + loc: { + start: { column: 18, line: 2 }, + end: { column: 19, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [31, 32], + loc: { + start: { column: 19, line: 2 }, + end: { column: 20, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [33, 34], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-private/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-private/snapshots/3-Babel-AST.shot new file mode 100644 index 00000000000..e687dfd0d9a --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-private/snapshots/3-Babel-AST.shot @@ -0,0 +1,79 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty key-private Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + ClassAccessorProperty { + type: "ClassAccessorProperty", + computed: false, + key: PrivateIdentifier { + type: "PrivateIdentifier", + name: "foo", + + range: [23, 27], + loc: { + start: { column: 11, line: 2 }, + end: { column: 15, line: 2 }, + }, + }, + static: false, + value: Literal { + type: "Literal", + raw: "2", + value: 2, + + range: [30, 31], + loc: { + start: { column: 18, line: 2 }, + end: { column: 19, line: 2 }, + }, + }, + + range: [14, 32], + loc: { + start: { column: 2, line: 2 }, + end: { column: 20, line: 2 }, + }, + }, + ], + + range: [10, 34], + loc: { + start: { column: 10, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + superClass: null, + + range: [0, 34], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [0, 35], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-private/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-private/snapshots/4-Babel-Tokens.shot new file mode 100644 index 00000000000..52963d76a15 --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-private/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,96 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty key-private Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [0, 5], + loc: { + start: { column: 0, line: 1 }, + end: { column: 5, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "accessor", + + range: [14, 22], + loc: { + start: { column: 2, line: 2 }, + end: { column: 10, line: 2 }, + }, + }, + PrivateIdentifier { + type: "PrivateIdentifier", + value: "foo", + + range: [23, 27], + loc: { + start: { column: 11, line: 2 }, + end: { column: 15, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [28, 29], + loc: { + start: { column: 16, line: 2 }, + end: { column: 17, line: 2 }, + }, + }, + Numeric { + type: "Numeric", + value: "2", + + range: [30, 31], + loc: { + start: { column: 18, line: 2 }, + end: { column: 19, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [31, 32], + loc: { + start: { column: 19, line: 2 }, + end: { column: 20, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [33, 34], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-private/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-private/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 00000000000..100c519c06c --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-private/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,87 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty key-private AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ClassDeclaration { + type: 'ClassDeclaration', + body: ClassBody { + type: 'ClassBody', + body: Array [ +- AccessorProperty { +- type: 'AccessorProperty', ++ ClassAccessorProperty { ++ type: 'ClassAccessorProperty', + computed: false, +- declare: false, + key: PrivateIdentifier { + type: 'PrivateIdentifier', + name: 'foo', + + range: [23, 27], + loc: { + start: { column: 11, line: 2 }, + end: { column: 15, line: 2 }, + }, + }, +- override: false, + static: false, + value: Literal { + type: 'Literal', + raw: '2', + value: 2, + + range: [30, 31], + loc: { + start: { column: 18, line: 2 }, + end: { column: 19, line: 2 }, + }, + }, + + range: [14, 32], + loc: { + start: { column: 2, line: 2 }, + end: { column: 20, line: 2 }, + }, + }, + ], + + range: [10, 34], + loc: { + start: { column: 10, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'Foo', + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + superClass: null, + + range: [0, 34], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + ], + sourceType: 'script', + + range: [0, 35], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 4 }, + }, + }" +`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-private/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-private/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 00000000000..11bd633e049 --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-private/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,103 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty key-private AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ + Keyword { + type: 'Keyword', + value: 'class', + + range: [0, 5], + loc: { + start: { column: 0, line: 1 }, + end: { column: 5, line: 1 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'Foo', + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'accessor', + + range: [14, 22], + loc: { + start: { column: 2, line: 2 }, + end: { column: 10, line: 2 }, + }, + }, +- Identifier { +- type: 'Identifier', +- value: '#foo', ++ PrivateIdentifier { ++ type: 'PrivateIdentifier', ++ value: 'foo', + + range: [23, 27], + loc: { + start: { column: 11, line: 2 }, + end: { column: 15, line: 2 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '=', + + range: [28, 29], + loc: { + start: { column: 16, line: 2 }, + end: { column: 17, line: 2 }, + }, + }, + Numeric { + type: 'Numeric', + value: '2', + + range: [30, 31], + loc: { + start: { column: 18, line: 2 }, + end: { column: 19, line: 2 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [31, 32], + loc: { + start: { column: 19, line: 2 }, + end: { column: 20, line: 2 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [33, 34], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-string/fixture.ts b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-string/fixture.ts new file mode 100644 index 00000000000..808470d5b6a --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-string/fixture.ts @@ -0,0 +1,3 @@ +class Foo { + accessor 'prop' = 'value'; +} diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-string/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-string/snapshots/1-TSESTree-AST.shot new file mode 100644 index 00000000000..06a3b3705ed --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-string/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,82 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty key-string TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + AccessorProperty { + type: "AccessorProperty", + computed: false, + declare: false, + key: Literal { + type: "Literal", + raw: "'prop'", + value: "prop", + + range: [23, 29], + loc: { + start: { column: 11, line: 2 }, + end: { column: 17, line: 2 }, + }, + }, + override: false, + static: false, + value: Literal { + type: "Literal", + raw: "'value'", + value: "value", + + range: [32, 39], + loc: { + start: { column: 20, line: 2 }, + end: { column: 27, line: 2 }, + }, + }, + + range: [14, 40], + loc: { + start: { column: 2, line: 2 }, + end: { column: 28, line: 2 }, + }, + }, + ], + + range: [10, 42], + loc: { + start: { column: 10, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + superClass: null, + + range: [0, 42], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [0, 43], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-string/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-string/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 00000000000..0fe6262dd93 --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-string/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,96 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty key-string TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [0, 5], + loc: { + start: { column: 0, line: 1 }, + end: { column: 5, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "accessor", + + range: [14, 22], + loc: { + start: { column: 2, line: 2 }, + end: { column: 10, line: 2 }, + }, + }, + String { + type: "String", + value: "'prop'", + + range: [23, 29], + loc: { + start: { column: 11, line: 2 }, + end: { column: 17, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [30, 31], + loc: { + start: { column: 18, line: 2 }, + end: { column: 19, line: 2 }, + }, + }, + String { + type: "String", + value: "'value'", + + range: [32, 39], + loc: { + start: { column: 20, line: 2 }, + end: { column: 27, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [39, 40], + loc: { + start: { column: 27, line: 2 }, + end: { column: 28, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [41, 42], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-string/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-string/snapshots/3-Babel-AST.shot new file mode 100644 index 00000000000..9af9236878c --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-string/snapshots/3-Babel-AST.shot @@ -0,0 +1,80 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty key-string Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + ClassAccessorProperty { + type: "ClassAccessorProperty", + computed: false, + key: Literal { + type: "Literal", + raw: "'prop'", + value: "prop", + + range: [23, 29], + loc: { + start: { column: 11, line: 2 }, + end: { column: 17, line: 2 }, + }, + }, + static: false, + value: Literal { + type: "Literal", + raw: "'value'", + value: "value", + + range: [32, 39], + loc: { + start: { column: 20, line: 2 }, + end: { column: 27, line: 2 }, + }, + }, + + range: [14, 40], + loc: { + start: { column: 2, line: 2 }, + end: { column: 28, line: 2 }, + }, + }, + ], + + range: [10, 42], + loc: { + start: { column: 10, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + superClass: null, + + range: [0, 42], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [0, 43], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-string/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-string/snapshots/4-Babel-Tokens.shot new file mode 100644 index 00000000000..110b7cb9949 --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-string/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,96 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty key-string Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [0, 5], + loc: { + start: { column: 0, line: 1 }, + end: { column: 5, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "accessor", + + range: [14, 22], + loc: { + start: { column: 2, line: 2 }, + end: { column: 10, line: 2 }, + }, + }, + String { + type: "String", + value: "'prop'", + + range: [23, 29], + loc: { + start: { column: 11, line: 2 }, + end: { column: 17, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [30, 31], + loc: { + start: { column: 18, line: 2 }, + end: { column: 19, line: 2 }, + }, + }, + String { + type: "String", + value: "'value'", + + range: [32, 39], + loc: { + start: { column: 20, line: 2 }, + end: { column: 27, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [39, 40], + loc: { + start: { column: 27, line: 2 }, + end: { column: 28, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [41, 42], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-string/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-string/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 00000000000..f831283bcb4 --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-string/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,88 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty key-string AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ClassDeclaration { + type: 'ClassDeclaration', + body: ClassBody { + type: 'ClassBody', + body: Array [ +- AccessorProperty { +- type: 'AccessorProperty', ++ ClassAccessorProperty { ++ type: 'ClassAccessorProperty', + computed: false, +- declare: false, + key: Literal { + type: 'Literal', + raw: '\\\\'prop\\\\'', + value: 'prop', + + range: [23, 29], + loc: { + start: { column: 11, line: 2 }, + end: { column: 17, line: 2 }, + }, + }, +- override: false, + static: false, + value: Literal { + type: 'Literal', + raw: '\\\\'value\\\\'', + value: 'value', + + range: [32, 39], + loc: { + start: { column: 20, line: 2 }, + end: { column: 27, line: 2 }, + }, + }, + + range: [14, 40], + loc: { + start: { column: 2, line: 2 }, + end: { column: 28, line: 2 }, + }, + }, + ], + + range: [10, 42], + loc: { + start: { column: 10, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'Foo', + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + superClass: null, + + range: [0, 42], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + ], + sourceType: 'script', + + range: [0, 43], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 4 }, + }, + }" +`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/key-string/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-string/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 00000000000..af1e8eed8c6 --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/key-string/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty key-string AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-abstract-with-value/fixture.ts b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-abstract-with-value/fixture.ts new file mode 100644 index 00000000000..26b6ab5a4e0 --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-abstract-with-value/fixture.ts @@ -0,0 +1,3 @@ +abstract class Foo { + abstract accessor foo: number = 1; +} diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-abstract-with-value/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-abstract-with-value/snapshots/1-TSESTree-AST.shot new file mode 100644 index 00000000000..1c8247fb96d --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-abstract-with-value/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,90 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty modifier-abstract-with-value TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + abstract: true, + body: ClassBody { + type: "ClassBody", + body: Array [ + TSAbstractAccessorProperty { + type: "TSAbstractAccessorProperty", + computed: false, + declare: false, + key: Identifier { + type: "Identifier", + name: "foo", + + range: [41, 44], + loc: { + start: { column: 20, line: 2 }, + end: { column: 23, line: 2 }, + }, + }, + override: false, + static: false, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [46, 52], + loc: { + start: { column: 25, line: 2 }, + end: { column: 31, line: 2 }, + }, + }, + + range: [44, 52], + loc: { + start: { column: 23, line: 2 }, + end: { column: 31, line: 2 }, + }, + }, + value: null, + + range: [23, 57], + loc: { + start: { column: 2, line: 2 }, + end: { column: 36, line: 2 }, + }, + }, + ], + + range: [19, 59], + loc: { + start: { column: 19, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [15, 18], + loc: { + start: { column: 15, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + superClass: null, + + range: [0, 59], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [0, 60], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-abstract-with-value/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-abstract-with-value/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 00000000000..b993bfecdea --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-abstract-with-value/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,136 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty modifier-abstract-with-value TSESTree - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "abstract", + + range: [0, 8], + loc: { + start: { column: 0, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "class", + + range: [9, 14], + loc: { + start: { column: 9, line: 1 }, + end: { column: 14, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [15, 18], + loc: { + start: { column: 15, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [19, 20], + loc: { + start: { column: 19, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "abstract", + + range: [23, 31], + loc: { + start: { column: 2, line: 2 }, + end: { column: 10, line: 2 }, + }, + }, + Identifier { + type: "Identifier", + value: "accessor", + + range: [32, 40], + loc: { + start: { column: 11, line: 2 }, + end: { column: 19, line: 2 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [41, 44], + loc: { + start: { column: 20, line: 2 }, + end: { column: 23, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [44, 45], + loc: { + start: { column: 23, line: 2 }, + end: { column: 24, line: 2 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [46, 52], + loc: { + start: { column: 25, line: 2 }, + end: { column: 31, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [53, 54], + loc: { + start: { column: 32, line: 2 }, + end: { column: 33, line: 2 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [55, 56], + loc: { + start: { column: 34, line: 2 }, + end: { column: 35, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [56, 57], + loc: { + start: { column: 35, line: 2 }, + end: { column: 36, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [58, 59], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-abstract-with-value/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-abstract-with-value/snapshots/3-Babel-AST.shot new file mode 100644 index 00000000000..147bdd6cb25 --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-abstract-with-value/snapshots/3-Babel-AST.shot @@ -0,0 +1,99 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty modifier-abstract-with-value Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + abstract: true, + body: ClassBody { + type: "ClassBody", + body: Array [ + ClassAccessorProperty { + type: "ClassAccessorProperty", + abstract: true, + computed: false, + key: Identifier { + type: "Identifier", + name: "foo", + + range: [41, 44], + loc: { + start: { column: 20, line: 2 }, + end: { column: 23, line: 2 }, + }, + }, + static: false, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [46, 52], + loc: { + start: { column: 25, line: 2 }, + end: { column: 31, line: 2 }, + }, + }, + + range: [44, 52], + loc: { + start: { column: 23, line: 2 }, + end: { column: 31, line: 2 }, + }, + }, + value: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [55, 56], + loc: { + start: { column: 34, line: 2 }, + end: { column: 35, line: 2 }, + }, + }, + + range: [23, 57], + loc: { + start: { column: 2, line: 2 }, + end: { column: 36, line: 2 }, + }, + }, + ], + + range: [19, 59], + loc: { + start: { column: 19, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [15, 18], + loc: { + start: { column: 15, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + superClass: null, + + range: [0, 59], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [0, 60], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-abstract-with-value/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-abstract-with-value/snapshots/4-Babel-Tokens.shot new file mode 100644 index 00000000000..1d49b0c7ad1 --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-abstract-with-value/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,136 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty modifier-abstract-with-value Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "abstract", + + range: [0, 8], + loc: { + start: { column: 0, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "class", + + range: [9, 14], + loc: { + start: { column: 9, line: 1 }, + end: { column: 14, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [15, 18], + loc: { + start: { column: 15, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [19, 20], + loc: { + start: { column: 19, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "abstract", + + range: [23, 31], + loc: { + start: { column: 2, line: 2 }, + end: { column: 10, line: 2 }, + }, + }, + Identifier { + type: "Identifier", + value: "accessor", + + range: [32, 40], + loc: { + start: { column: 11, line: 2 }, + end: { column: 19, line: 2 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [41, 44], + loc: { + start: { column: 20, line: 2 }, + end: { column: 23, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [44, 45], + loc: { + start: { column: 23, line: 2 }, + end: { column: 24, line: 2 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [46, 52], + loc: { + start: { column: 25, line: 2 }, + end: { column: 31, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [53, 54], + loc: { + start: { column: 32, line: 2 }, + end: { column: 33, line: 2 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [55, 56], + loc: { + start: { column: 34, line: 2 }, + end: { column: 35, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [56, 57], + loc: { + start: { column: 35, line: 2 }, + end: { column: 36, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [58, 59], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-abstract-with-value/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-abstract-with-value/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 00000000000..27b36ea8b18 --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-abstract-with-value/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,108 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty modifier-abstract-with-value AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ClassDeclaration { + type: 'ClassDeclaration', + abstract: true, + body: ClassBody { + type: 'ClassBody', + body: Array [ +- TSAbstractAccessorProperty { +- type: 'TSAbstractAccessorProperty', ++ ClassAccessorProperty { ++ type: 'ClassAccessorProperty', ++ abstract: true, + computed: false, +- declare: false, + key: Identifier { + type: 'Identifier', + name: 'foo', + + range: [41, 44], + loc: { + start: { column: 20, line: 2 }, + end: { column: 23, line: 2 }, + }, + }, +- override: false, + static: false, + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSNumberKeyword { + type: 'TSNumberKeyword', + + range: [46, 52], + loc: { + start: { column: 25, line: 2 }, + end: { column: 31, line: 2 }, + }, + }, + + range: [44, 52], + loc: { + start: { column: 23, line: 2 }, + end: { column: 31, line: 2 }, + }, + }, +- value: null, ++ value: Literal { ++ type: 'Literal', ++ raw: '1', ++ value: 1, ++ ++ range: [55, 56], ++ loc: { ++ start: { column: 34, line: 2 }, ++ end: { column: 35, line: 2 }, ++ }, ++ }, + + range: [23, 57], + loc: { + start: { column: 2, line: 2 }, + end: { column: 36, line: 2 }, + }, + }, + ], + + range: [19, 59], + loc: { + start: { column: 19, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'Foo', + + range: [15, 18], + loc: { + start: { column: 15, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + superClass: null, + + range: [0, 59], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + ], + sourceType: 'script', + + range: [0, 60], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 4 }, + }, + }" +`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-abstract-with-value/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-abstract-with-value/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 00000000000..fd832b249e4 --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-abstract-with-value/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty modifier-abstract-with-value AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-abstract/fixture.ts b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-abstract/fixture.ts new file mode 100644 index 00000000000..61608bfc72d --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-abstract/fixture.ts @@ -0,0 +1,3 @@ +abstract class Foo { + abstract accessor foo: number; +} diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-abstract/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-abstract/snapshots/1-TSESTree-AST.shot new file mode 100644 index 00000000000..420e13ca4bf --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-abstract/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,90 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty modifier-abstract TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + abstract: true, + body: ClassBody { + type: "ClassBody", + body: Array [ + TSAbstractAccessorProperty { + type: "TSAbstractAccessorProperty", + computed: false, + declare: false, + key: Identifier { + type: "Identifier", + name: "foo", + + range: [41, 44], + loc: { + start: { column: 20, line: 2 }, + end: { column: 23, line: 2 }, + }, + }, + override: false, + static: false, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [46, 52], + loc: { + start: { column: 25, line: 2 }, + end: { column: 31, line: 2 }, + }, + }, + + range: [44, 52], + loc: { + start: { column: 23, line: 2 }, + end: { column: 31, line: 2 }, + }, + }, + value: null, + + range: [23, 53], + loc: { + start: { column: 2, line: 2 }, + end: { column: 32, line: 2 }, + }, + }, + ], + + range: [19, 55], + loc: { + start: { column: 19, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [15, 18], + loc: { + start: { column: 15, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + superClass: null, + + range: [0, 55], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [0, 56], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-abstract/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-abstract/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 00000000000..732caf89fce --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-abstract/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,116 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty modifier-abstract TSESTree - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "abstract", + + range: [0, 8], + loc: { + start: { column: 0, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "class", + + range: [9, 14], + loc: { + start: { column: 9, line: 1 }, + end: { column: 14, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [15, 18], + loc: { + start: { column: 15, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [19, 20], + loc: { + start: { column: 19, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "abstract", + + range: [23, 31], + loc: { + start: { column: 2, line: 2 }, + end: { column: 10, line: 2 }, + }, + }, + Identifier { + type: "Identifier", + value: "accessor", + + range: [32, 40], + loc: { + start: { column: 11, line: 2 }, + end: { column: 19, line: 2 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [41, 44], + loc: { + start: { column: 20, line: 2 }, + end: { column: 23, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [44, 45], + loc: { + start: { column: 23, line: 2 }, + end: { column: 24, line: 2 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [46, 52], + loc: { + start: { column: 25, line: 2 }, + end: { column: 31, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [52, 53], + loc: { + start: { column: 31, line: 2 }, + end: { column: 32, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [54, 55], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-abstract/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-abstract/snapshots/3-Babel-AST.shot new file mode 100644 index 00000000000..6423ad41435 --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-abstract/snapshots/3-Babel-AST.shot @@ -0,0 +1,89 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty modifier-abstract Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + abstract: true, + body: ClassBody { + type: "ClassBody", + body: Array [ + ClassAccessorProperty { + type: "ClassAccessorProperty", + abstract: true, + computed: false, + key: Identifier { + type: "Identifier", + name: "foo", + + range: [41, 44], + loc: { + start: { column: 20, line: 2 }, + end: { column: 23, line: 2 }, + }, + }, + static: false, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [46, 52], + loc: { + start: { column: 25, line: 2 }, + end: { column: 31, line: 2 }, + }, + }, + + range: [44, 52], + loc: { + start: { column: 23, line: 2 }, + end: { column: 31, line: 2 }, + }, + }, + value: null, + + range: [23, 53], + loc: { + start: { column: 2, line: 2 }, + end: { column: 32, line: 2 }, + }, + }, + ], + + range: [19, 55], + loc: { + start: { column: 19, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [15, 18], + loc: { + start: { column: 15, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + superClass: null, + + range: [0, 55], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [0, 56], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-abstract/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-abstract/snapshots/4-Babel-Tokens.shot new file mode 100644 index 00000000000..41f02a22191 --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-abstract/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,116 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty modifier-abstract Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "abstract", + + range: [0, 8], + loc: { + start: { column: 0, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "class", + + range: [9, 14], + loc: { + start: { column: 9, line: 1 }, + end: { column: 14, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [15, 18], + loc: { + start: { column: 15, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [19, 20], + loc: { + start: { column: 19, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "abstract", + + range: [23, 31], + loc: { + start: { column: 2, line: 2 }, + end: { column: 10, line: 2 }, + }, + }, + Identifier { + type: "Identifier", + value: "accessor", + + range: [32, 40], + loc: { + start: { column: 11, line: 2 }, + end: { column: 19, line: 2 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [41, 44], + loc: { + start: { column: 20, line: 2 }, + end: { column: 23, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [44, 45], + loc: { + start: { column: 23, line: 2 }, + end: { column: 24, line: 2 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [46, 52], + loc: { + start: { column: 25, line: 2 }, + end: { column: 31, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [52, 53], + loc: { + start: { column: 31, line: 2 }, + end: { column: 32, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [54, 55], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-abstract/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-abstract/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 00000000000..cecb46eb91f --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-abstract/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,97 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty modifier-abstract AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ClassDeclaration { + type: 'ClassDeclaration', + abstract: true, + body: ClassBody { + type: 'ClassBody', + body: Array [ +- TSAbstractAccessorProperty { +- type: 'TSAbstractAccessorProperty', ++ ClassAccessorProperty { ++ type: 'ClassAccessorProperty', ++ abstract: true, + computed: false, +- declare: false, + key: Identifier { + type: 'Identifier', + name: 'foo', + + range: [41, 44], + loc: { + start: { column: 20, line: 2 }, + end: { column: 23, line: 2 }, + }, + }, +- override: false, + static: false, + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSNumberKeyword { + type: 'TSNumberKeyword', + + range: [46, 52], + loc: { + start: { column: 25, line: 2 }, + end: { column: 31, line: 2 }, + }, + }, + + range: [44, 52], + loc: { + start: { column: 23, line: 2 }, + end: { column: 31, line: 2 }, + }, + }, + value: null, + + range: [23, 53], + loc: { + start: { column: 2, line: 2 }, + end: { column: 32, line: 2 }, + }, + }, + ], + + range: [19, 55], + loc: { + start: { column: 19, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'Foo', + + range: [15, 18], + loc: { + start: { column: 15, line: 1 }, + end: { column: 18, line: 1 }, + }, + }, + superClass: null, + + range: [0, 55], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + ], + sourceType: 'script', + + range: [0, 56], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 4 }, + }, + }" +`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-abstract/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-abstract/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 00000000000..8d5295e9c35 --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-abstract/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty modifier-abstract AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-declare/fixture.ts b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-declare/fixture.ts new file mode 100644 index 00000000000..2a4248c0bf8 --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-declare/fixture.ts @@ -0,0 +1,3 @@ +class Foo { + declare accessor foo: number; +} diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-declare/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-declare/snapshots/1-TSESTree-AST.shot new file mode 100644 index 00000000000..0b61be5984a --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-declare/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,89 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty modifier-declare TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + AccessorProperty { + type: "AccessorProperty", + computed: false, + declare: true, + key: Identifier { + type: "Identifier", + name: "foo", + + range: [31, 34], + loc: { + start: { column: 19, line: 2 }, + end: { column: 22, line: 2 }, + }, + }, + override: false, + static: false, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [36, 42], + loc: { + start: { column: 24, line: 2 }, + end: { column: 30, line: 2 }, + }, + }, + + range: [34, 42], + loc: { + start: { column: 22, line: 2 }, + end: { column: 30, line: 2 }, + }, + }, + value: null, + + range: [14, 43], + loc: { + start: { column: 2, line: 2 }, + end: { column: 31, line: 2 }, + }, + }, + ], + + range: [10, 45], + loc: { + start: { column: 10, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + superClass: null, + + range: [0, 45], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [0, 46], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-declare/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-declare/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 00000000000..c9f1a1a1da8 --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-declare/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,106 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty modifier-declare TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [0, 5], + loc: { + start: { column: 0, line: 1 }, + end: { column: 5, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "declare", + + range: [14, 21], + loc: { + start: { column: 2, line: 2 }, + end: { column: 9, line: 2 }, + }, + }, + Identifier { + type: "Identifier", + value: "accessor", + + range: [22, 30], + loc: { + start: { column: 10, line: 2 }, + end: { column: 18, line: 2 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [31, 34], + loc: { + start: { column: 19, line: 2 }, + end: { column: 22, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [34, 35], + loc: { + start: { column: 22, line: 2 }, + end: { column: 23, line: 2 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [36, 42], + loc: { + start: { column: 24, line: 2 }, + end: { column: 30, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [42, 43], + loc: { + start: { column: 30, line: 2 }, + end: { column: 31, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [44, 45], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-declare/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-declare/snapshots/3-Babel-AST.shot new file mode 100644 index 00000000000..057e8de958a --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-declare/snapshots/3-Babel-AST.shot @@ -0,0 +1,88 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty modifier-declare Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + ClassAccessorProperty { + type: "ClassAccessorProperty", + computed: false, + declare: true, + key: Identifier { + type: "Identifier", + name: "foo", + + range: [31, 34], + loc: { + start: { column: 19, line: 2 }, + end: { column: 22, line: 2 }, + }, + }, + static: false, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [36, 42], + loc: { + start: { column: 24, line: 2 }, + end: { column: 30, line: 2 }, + }, + }, + + range: [34, 42], + loc: { + start: { column: 22, line: 2 }, + end: { column: 30, line: 2 }, + }, + }, + value: null, + + range: [14, 43], + loc: { + start: { column: 2, line: 2 }, + end: { column: 31, line: 2 }, + }, + }, + ], + + range: [10, 45], + loc: { + start: { column: 10, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + superClass: null, + + range: [0, 45], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [0, 46], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-declare/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-declare/snapshots/4-Babel-Tokens.shot new file mode 100644 index 00000000000..991730e68ff --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-declare/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,106 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty modifier-declare Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [0, 5], + loc: { + start: { column: 0, line: 1 }, + end: { column: 5, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "declare", + + range: [14, 21], + loc: { + start: { column: 2, line: 2 }, + end: { column: 9, line: 2 }, + }, + }, + Identifier { + type: "Identifier", + value: "accessor", + + range: [22, 30], + loc: { + start: { column: 10, line: 2 }, + end: { column: 18, line: 2 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [31, 34], + loc: { + start: { column: 19, line: 2 }, + end: { column: 22, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [34, 35], + loc: { + start: { column: 22, line: 2 }, + end: { column: 23, line: 2 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [36, 42], + loc: { + start: { column: 24, line: 2 }, + end: { column: 30, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [42, 43], + loc: { + start: { column: 30, line: 2 }, + end: { column: 31, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [44, 45], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-declare/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-declare/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 00000000000..76e4314a3c6 --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-declare/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,95 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty modifier-declare AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ClassDeclaration { + type: 'ClassDeclaration', + body: ClassBody { + type: 'ClassBody', + body: Array [ +- AccessorProperty { +- type: 'AccessorProperty', ++ ClassAccessorProperty { ++ type: 'ClassAccessorProperty', + computed: false, + declare: true, + key: Identifier { + type: 'Identifier', + name: 'foo', + + range: [31, 34], + loc: { + start: { column: 19, line: 2 }, + end: { column: 22, line: 2 }, + }, + }, +- override: false, + static: false, + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSNumberKeyword { + type: 'TSNumberKeyword', + + range: [36, 42], + loc: { + start: { column: 24, line: 2 }, + end: { column: 30, line: 2 }, + }, + }, + + range: [34, 42], + loc: { + start: { column: 22, line: 2 }, + end: { column: 30, line: 2 }, + }, + }, + value: null, + + range: [14, 43], + loc: { + start: { column: 2, line: 2 }, + end: { column: 31, line: 2 }, + }, + }, + ], + + range: [10, 45], + loc: { + start: { column: 10, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'Foo', + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + superClass: null, + + range: [0, 45], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + ], + sourceType: 'script', + + range: [0, 46], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 4 }, + }, + }" +`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-declare/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-declare/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 00000000000..491288c619b --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-declare/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty modifier-declare AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-override/fixture.ts b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-override/fixture.ts new file mode 100644 index 00000000000..70dd6b95f61 --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-override/fixture.ts @@ -0,0 +1,3 @@ +class Foo extends Bar { + override accessor foo = 2; +} diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-override/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-override/snapshots/1-TSESTree-AST.shot new file mode 100644 index 00000000000..b0e78060a09 --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-override/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,90 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty modifier-override TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + AccessorProperty { + type: "AccessorProperty", + computed: false, + declare: false, + key: Identifier { + type: "Identifier", + name: "foo", + + range: [44, 47], + loc: { + start: { column: 20, line: 2 }, + end: { column: 23, line: 2 }, + }, + }, + override: true, + static: false, + value: Literal { + type: "Literal", + raw: "2", + value: 2, + + range: [50, 51], + loc: { + start: { column: 26, line: 2 }, + end: { column: 27, line: 2 }, + }, + }, + + range: [26, 52], + loc: { + start: { column: 2, line: 2 }, + end: { column: 28, line: 2 }, + }, + }, + ], + + range: [22, 54], + loc: { + start: { column: 22, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + superClass: Identifier { + type: "Identifier", + name: "Bar", + + range: [18, 21], + loc: { + start: { column: 18, line: 1 }, + end: { column: 21, line: 1 }, + }, + }, + + range: [0, 54], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [0, 55], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-override/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-override/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 00000000000..24c22b85146 --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-override/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,126 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty modifier-override TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [0, 5], + loc: { + start: { column: 0, line: 1 }, + end: { column: 5, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [10, 17], + loc: { + start: { column: 10, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Bar", + + range: [18, 21], + loc: { + start: { column: 18, 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: "override", + + range: [26, 34], + loc: { + start: { column: 2, line: 2 }, + end: { column: 10, line: 2 }, + }, + }, + Identifier { + type: "Identifier", + value: "accessor", + + range: [35, 43], + loc: { + start: { column: 11, line: 2 }, + end: { column: 19, line: 2 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [44, 47], + loc: { + start: { column: 20, line: 2 }, + end: { column: 23, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [48, 49], + loc: { + start: { column: 24, line: 2 }, + end: { column: 25, line: 2 }, + }, + }, + Numeric { + type: "Numeric", + value: "2", + + range: [50, 51], + loc: { + start: { column: 26, line: 2 }, + end: { column: 27, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [51, 52], + loc: { + start: { column: 27, line: 2 }, + end: { column: 28, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [53, 54], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-override/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-override/snapshots/3-Babel-AST.shot new file mode 100644 index 00000000000..49d82178de5 --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-override/snapshots/3-Babel-AST.shot @@ -0,0 +1,89 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty modifier-override Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + ClassAccessorProperty { + type: "ClassAccessorProperty", + computed: false, + key: Identifier { + type: "Identifier", + name: "foo", + + range: [44, 47], + loc: { + start: { column: 20, line: 2 }, + end: { column: 23, line: 2 }, + }, + }, + override: true, + static: false, + value: Literal { + type: "Literal", + raw: "2", + value: 2, + + range: [50, 51], + loc: { + start: { column: 26, line: 2 }, + end: { column: 27, line: 2 }, + }, + }, + + range: [26, 52], + loc: { + start: { column: 2, line: 2 }, + end: { column: 28, line: 2 }, + }, + }, + ], + + range: [22, 54], + loc: { + start: { column: 22, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + superClass: Identifier { + type: "Identifier", + name: "Bar", + + range: [18, 21], + loc: { + start: { column: 18, line: 1 }, + end: { column: 21, line: 1 }, + }, + }, + + range: [0, 54], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [0, 55], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-override/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-override/snapshots/4-Babel-Tokens.shot new file mode 100644 index 00000000000..dd9763a4fcd --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-override/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,126 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty modifier-override Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [0, 5], + loc: { + start: { column: 0, line: 1 }, + end: { column: 5, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "extends", + + range: [10, 17], + loc: { + start: { column: 10, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Bar", + + range: [18, 21], + loc: { + start: { column: 18, 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: "override", + + range: [26, 34], + loc: { + start: { column: 2, line: 2 }, + end: { column: 10, line: 2 }, + }, + }, + Identifier { + type: "Identifier", + value: "accessor", + + range: [35, 43], + loc: { + start: { column: 11, line: 2 }, + end: { column: 19, line: 2 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [44, 47], + loc: { + start: { column: 20, line: 2 }, + end: { column: 23, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [48, 49], + loc: { + start: { column: 24, line: 2 }, + end: { column: 25, line: 2 }, + }, + }, + Numeric { + type: "Numeric", + value: "2", + + range: [50, 51], + loc: { + start: { column: 26, line: 2 }, + end: { column: 27, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [51, 52], + loc: { + start: { column: 27, line: 2 }, + end: { column: 28, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [53, 54], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-override/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-override/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 00000000000..7949a056f9a --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-override/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,96 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty modifier-override AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ClassDeclaration { + type: 'ClassDeclaration', + body: ClassBody { + type: 'ClassBody', + body: Array [ +- AccessorProperty { +- type: 'AccessorProperty', ++ ClassAccessorProperty { ++ type: 'ClassAccessorProperty', + computed: false, +- declare: false, + key: Identifier { + type: 'Identifier', + name: 'foo', + + range: [44, 47], + loc: { + start: { column: 20, line: 2 }, + end: { column: 23, line: 2 }, + }, + }, + override: true, + static: false, + value: Literal { + type: 'Literal', + raw: '2', + value: 2, + + range: [50, 51], + loc: { + start: { column: 26, line: 2 }, + end: { column: 27, line: 2 }, + }, + }, + + range: [26, 52], + loc: { + start: { column: 2, line: 2 }, + end: { column: 28, line: 2 }, + }, + }, + ], + + range: [22, 54], + loc: { + start: { column: 22, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'Foo', + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + superClass: Identifier { + type: 'Identifier', + name: 'Bar', + + range: [18, 21], + loc: { + start: { column: 18, line: 1 }, + end: { column: 21, line: 1 }, + }, + }, + + range: [0, 54], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + ], + sourceType: 'script', + + range: [0, 55], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 4 }, + }, + }" +`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-override/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-override/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 00000000000..4585c5481d0 --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-override/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty modifier-override AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-private/fixture.ts b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-private/fixture.ts new file mode 100644 index 00000000000..ceacabc649f --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-private/fixture.ts @@ -0,0 +1,3 @@ +class Foo { + private accessor foo = 2; +} diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-private/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-private/snapshots/1-TSESTree-AST.shot new file mode 100644 index 00000000000..0f0fa0f2a10 --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-private/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,82 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty modifier-private TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + AccessorProperty { + type: "AccessorProperty", + accessibility: "private", + computed: false, + declare: false, + key: Identifier { + type: "Identifier", + name: "foo", + + range: [31, 34], + loc: { + start: { column: 19, line: 2 }, + end: { column: 22, line: 2 }, + }, + }, + override: false, + static: false, + value: Literal { + type: "Literal", + raw: "2", + value: 2, + + range: [37, 38], + loc: { + start: { column: 25, line: 2 }, + end: { column: 26, line: 2 }, + }, + }, + + range: [14, 39], + loc: { + start: { column: 2, line: 2 }, + end: { column: 27, line: 2 }, + }, + }, + ], + + range: [10, 41], + loc: { + start: { column: 10, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + superClass: null, + + range: [0, 41], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [0, 42], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-private/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-private/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 00000000000..17510235b46 --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-private/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,106 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty modifier-private TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [0, 5], + loc: { + start: { column: 0, line: 1 }, + end: { column: 5, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "private", + + range: [14, 21], + loc: { + start: { column: 2, line: 2 }, + end: { column: 9, line: 2 }, + }, + }, + Identifier { + type: "Identifier", + value: "accessor", + + range: [22, 30], + loc: { + start: { column: 10, line: 2 }, + end: { column: 18, line: 2 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [31, 34], + loc: { + start: { column: 19, line: 2 }, + end: { column: 22, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [35, 36], + loc: { + start: { column: 23, line: 2 }, + end: { column: 24, line: 2 }, + }, + }, + Numeric { + type: "Numeric", + value: "2", + + range: [37, 38], + loc: { + start: { column: 25, line: 2 }, + end: { column: 26, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [38, 39], + loc: { + start: { column: 26, line: 2 }, + end: { column: 27, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [40, 41], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-private/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-private/snapshots/3-Babel-AST.shot new file mode 100644 index 00000000000..b11a056920d --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-private/snapshots/3-Babel-AST.shot @@ -0,0 +1,80 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty modifier-private Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + ClassAccessorProperty { + type: "ClassAccessorProperty", + accessibility: "private", + computed: false, + key: Identifier { + type: "Identifier", + name: "foo", + + range: [31, 34], + loc: { + start: { column: 19, line: 2 }, + end: { column: 22, line: 2 }, + }, + }, + static: false, + value: Literal { + type: "Literal", + raw: "2", + value: 2, + + range: [37, 38], + loc: { + start: { column: 25, line: 2 }, + end: { column: 26, line: 2 }, + }, + }, + + range: [14, 39], + loc: { + start: { column: 2, line: 2 }, + end: { column: 27, line: 2 }, + }, + }, + ], + + range: [10, 41], + loc: { + start: { column: 10, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + superClass: null, + + range: [0, 41], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [0, 42], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-private/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-private/snapshots/4-Babel-Tokens.shot new file mode 100644 index 00000000000..75520e7741d --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-private/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,106 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty modifier-private Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [0, 5], + loc: { + start: { column: 0, line: 1 }, + end: { column: 5, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "private", + + range: [14, 21], + loc: { + start: { column: 2, line: 2 }, + end: { column: 9, line: 2 }, + }, + }, + Identifier { + type: "Identifier", + value: "accessor", + + range: [22, 30], + loc: { + start: { column: 10, line: 2 }, + end: { column: 18, line: 2 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [31, 34], + loc: { + start: { column: 19, line: 2 }, + end: { column: 22, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [35, 36], + loc: { + start: { column: 23, line: 2 }, + end: { column: 24, line: 2 }, + }, + }, + Numeric { + type: "Numeric", + value: "2", + + range: [37, 38], + loc: { + start: { column: 25, line: 2 }, + end: { column: 26, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [38, 39], + loc: { + start: { column: 26, line: 2 }, + end: { column: 27, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [40, 41], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-private/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-private/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 00000000000..fd302779cf1 --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-private/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,88 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty modifier-private AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ClassDeclaration { + type: 'ClassDeclaration', + body: ClassBody { + type: 'ClassBody', + body: Array [ +- AccessorProperty { +- type: 'AccessorProperty', ++ ClassAccessorProperty { ++ type: 'ClassAccessorProperty', + accessibility: 'private', + computed: false, +- declare: false, + key: Identifier { + type: 'Identifier', + name: 'foo', + + range: [31, 34], + loc: { + start: { column: 19, line: 2 }, + end: { column: 22, line: 2 }, + }, + }, +- override: false, + static: false, + value: Literal { + type: 'Literal', + raw: '2', + value: 2, + + range: [37, 38], + loc: { + start: { column: 25, line: 2 }, + end: { column: 26, line: 2 }, + }, + }, + + range: [14, 39], + loc: { + start: { column: 2, line: 2 }, + end: { column: 27, line: 2 }, + }, + }, + ], + + range: [10, 41], + loc: { + start: { column: 10, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'Foo', + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + superClass: null, + + range: [0, 41], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + ], + sourceType: 'script', + + range: [0, 42], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 4 }, + }, + }" +`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-private/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-private/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 00000000000..35301570665 --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-private/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,112 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty modifier-private AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ + Keyword { + type: 'Keyword', + value: 'class', + + range: [0, 5], + loc: { + start: { column: 0, line: 1 }, + end: { column: 5, line: 1 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'Foo', + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'private', + + range: [14, 21], + loc: { + start: { column: 2, line: 2 }, + end: { column: 9, line: 2 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'accessor', + + range: [22, 30], + loc: { + start: { column: 10, line: 2 }, + end: { column: 18, line: 2 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'foo', + + range: [31, 34], + loc: { + start: { column: 19, line: 2 }, + end: { column: 22, line: 2 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '=', + + range: [35, 36], + loc: { + start: { column: 23, line: 2 }, + end: { column: 24, line: 2 }, + }, + }, + Numeric { + type: 'Numeric', + value: '2', + + range: [37, 38], + loc: { + start: { column: 25, line: 2 }, + end: { column: 26, line: 2 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [38, 39], + loc: { + start: { column: 26, line: 2 }, + end: { column: 27, line: 2 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [40, 41], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-protected/fixture.ts b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-protected/fixture.ts new file mode 100644 index 00000000000..dac8cd734c5 --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-protected/fixture.ts @@ -0,0 +1,3 @@ +class Foo { + protected accessor foo = 2; +} diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-protected/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-protected/snapshots/1-TSESTree-AST.shot new file mode 100644 index 00000000000..d862c8f8648 --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-protected/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,82 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty modifier-protected TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + AccessorProperty { + type: "AccessorProperty", + accessibility: "protected", + computed: false, + declare: false, + key: Identifier { + type: "Identifier", + name: "foo", + + range: [33, 36], + loc: { + start: { column: 21, line: 2 }, + end: { column: 24, line: 2 }, + }, + }, + override: false, + static: false, + value: Literal { + type: "Literal", + raw: "2", + value: 2, + + range: [39, 40], + loc: { + start: { column: 27, line: 2 }, + end: { column: 28, line: 2 }, + }, + }, + + range: [14, 41], + loc: { + start: { column: 2, line: 2 }, + end: { column: 29, line: 2 }, + }, + }, + ], + + range: [10, 43], + loc: { + start: { column: 10, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + superClass: null, + + range: [0, 43], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [0, 44], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-protected/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-protected/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 00000000000..88ab4ac1f40 --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-protected/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,106 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty modifier-protected TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [0, 5], + loc: { + start: { column: 0, line: 1 }, + end: { column: 5, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "protected", + + range: [14, 23], + loc: { + start: { column: 2, line: 2 }, + end: { column: 11, line: 2 }, + }, + }, + Identifier { + type: "Identifier", + value: "accessor", + + range: [24, 32], + loc: { + start: { column: 12, line: 2 }, + end: { column: 20, line: 2 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [33, 36], + loc: { + start: { column: 21, line: 2 }, + end: { column: 24, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [37, 38], + loc: { + start: { column: 25, line: 2 }, + end: { column: 26, line: 2 }, + }, + }, + Numeric { + type: "Numeric", + value: "2", + + range: [39, 40], + loc: { + start: { column: 27, line: 2 }, + end: { column: 28, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [40, 41], + loc: { + start: { column: 28, line: 2 }, + end: { column: 29, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [42, 43], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-protected/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-protected/snapshots/3-Babel-AST.shot new file mode 100644 index 00000000000..dbabfaa6a93 --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-protected/snapshots/3-Babel-AST.shot @@ -0,0 +1,80 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty modifier-protected Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + ClassAccessorProperty { + type: "ClassAccessorProperty", + accessibility: "protected", + computed: false, + key: Identifier { + type: "Identifier", + name: "foo", + + range: [33, 36], + loc: { + start: { column: 21, line: 2 }, + end: { column: 24, line: 2 }, + }, + }, + static: false, + value: Literal { + type: "Literal", + raw: "2", + value: 2, + + range: [39, 40], + loc: { + start: { column: 27, line: 2 }, + end: { column: 28, line: 2 }, + }, + }, + + range: [14, 41], + loc: { + start: { column: 2, line: 2 }, + end: { column: 29, line: 2 }, + }, + }, + ], + + range: [10, 43], + loc: { + start: { column: 10, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + superClass: null, + + range: [0, 43], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [0, 44], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-protected/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-protected/snapshots/4-Babel-Tokens.shot new file mode 100644 index 00000000000..c730984ef44 --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-protected/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,106 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty modifier-protected Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [0, 5], + loc: { + start: { column: 0, line: 1 }, + end: { column: 5, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "protected", + + range: [14, 23], + loc: { + start: { column: 2, line: 2 }, + end: { column: 11, line: 2 }, + }, + }, + Identifier { + type: "Identifier", + value: "accessor", + + range: [24, 32], + loc: { + start: { column: 12, line: 2 }, + end: { column: 20, line: 2 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [33, 36], + loc: { + start: { column: 21, line: 2 }, + end: { column: 24, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [37, 38], + loc: { + start: { column: 25, line: 2 }, + end: { column: 26, line: 2 }, + }, + }, + Numeric { + type: "Numeric", + value: "2", + + range: [39, 40], + loc: { + start: { column: 27, line: 2 }, + end: { column: 28, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [40, 41], + loc: { + start: { column: 28, line: 2 }, + end: { column: 29, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [42, 43], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-protected/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-protected/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 00000000000..c26ec2b5985 --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-protected/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,88 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty modifier-protected AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ClassDeclaration { + type: 'ClassDeclaration', + body: ClassBody { + type: 'ClassBody', + body: Array [ +- AccessorProperty { +- type: 'AccessorProperty', ++ ClassAccessorProperty { ++ type: 'ClassAccessorProperty', + accessibility: 'protected', + computed: false, +- declare: false, + key: Identifier { + type: 'Identifier', + name: 'foo', + + range: [33, 36], + loc: { + start: { column: 21, line: 2 }, + end: { column: 24, line: 2 }, + }, + }, +- override: false, + static: false, + value: Literal { + type: 'Literal', + raw: '2', + value: 2, + + range: [39, 40], + loc: { + start: { column: 27, line: 2 }, + end: { column: 28, line: 2 }, + }, + }, + + range: [14, 41], + loc: { + start: { column: 2, line: 2 }, + end: { column: 29, line: 2 }, + }, + }, + ], + + range: [10, 43], + loc: { + start: { column: 10, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'Foo', + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + superClass: null, + + range: [0, 43], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + ], + sourceType: 'script', + + range: [0, 44], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 4 }, + }, + }" +`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-protected/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-protected/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 00000000000..cbbcda53541 --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-protected/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,112 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty modifier-protected AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ + Keyword { + type: 'Keyword', + value: 'class', + + range: [0, 5], + loc: { + start: { column: 0, line: 1 }, + end: { column: 5, line: 1 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'Foo', + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'protected', + + range: [14, 23], + loc: { + start: { column: 2, line: 2 }, + end: { column: 11, line: 2 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'accessor', + + range: [24, 32], + loc: { + start: { column: 12, line: 2 }, + end: { column: 20, line: 2 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'foo', + + range: [33, 36], + loc: { + start: { column: 21, line: 2 }, + end: { column: 24, line: 2 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '=', + + range: [37, 38], + loc: { + start: { column: 25, line: 2 }, + end: { column: 26, line: 2 }, + }, + }, + Numeric { + type: 'Numeric', + value: '2', + + range: [39, 40], + loc: { + start: { column: 27, line: 2 }, + end: { column: 28, line: 2 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [40, 41], + loc: { + start: { column: 28, line: 2 }, + end: { column: 29, line: 2 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [42, 43], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-public/fixture.ts b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-public/fixture.ts new file mode 100644 index 00000000000..bbcbc59c710 --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-public/fixture.ts @@ -0,0 +1,3 @@ +class Foo { + public accessor foo = 2; +} diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-public/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-public/snapshots/1-TSESTree-AST.shot new file mode 100644 index 00000000000..6a1c4d1b7ec --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-public/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,82 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty modifier-public TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + AccessorProperty { + type: "AccessorProperty", + accessibility: "public", + computed: false, + declare: false, + key: Identifier { + type: "Identifier", + name: "foo", + + range: [30, 33], + loc: { + start: { column: 18, line: 2 }, + end: { column: 21, line: 2 }, + }, + }, + override: false, + static: false, + value: Literal { + type: "Literal", + raw: "2", + value: 2, + + range: [36, 37], + loc: { + start: { column: 24, line: 2 }, + end: { column: 25, line: 2 }, + }, + }, + + range: [14, 38], + loc: { + start: { column: 2, line: 2 }, + end: { column: 26, line: 2 }, + }, + }, + ], + + range: [10, 40], + loc: { + start: { column: 10, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + superClass: null, + + range: [0, 40], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [0, 41], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-public/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-public/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 00000000000..31de17a79dd --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-public/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,106 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty modifier-public TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [0, 5], + loc: { + start: { column: 0, line: 1 }, + end: { column: 5, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "public", + + range: [14, 20], + loc: { + start: { column: 2, line: 2 }, + end: { column: 8, line: 2 }, + }, + }, + Identifier { + type: "Identifier", + value: "accessor", + + range: [21, 29], + loc: { + start: { column: 9, line: 2 }, + end: { column: 17, line: 2 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [30, 33], + loc: { + start: { column: 18, line: 2 }, + end: { column: 21, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [34, 35], + loc: { + start: { column: 22, line: 2 }, + end: { column: 23, line: 2 }, + }, + }, + Numeric { + type: "Numeric", + value: "2", + + range: [36, 37], + loc: { + start: { column: 24, line: 2 }, + end: { column: 25, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [37, 38], + loc: { + start: { column: 25, line: 2 }, + end: { column: 26, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [39, 40], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-public/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-public/snapshots/3-Babel-AST.shot new file mode 100644 index 00000000000..ed50b70a5c7 --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-public/snapshots/3-Babel-AST.shot @@ -0,0 +1,80 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty modifier-public Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + ClassAccessorProperty { + type: "ClassAccessorProperty", + accessibility: "public", + computed: false, + key: Identifier { + type: "Identifier", + name: "foo", + + range: [30, 33], + loc: { + start: { column: 18, line: 2 }, + end: { column: 21, line: 2 }, + }, + }, + static: false, + value: Literal { + type: "Literal", + raw: "2", + value: 2, + + range: [36, 37], + loc: { + start: { column: 24, line: 2 }, + end: { column: 25, line: 2 }, + }, + }, + + range: [14, 38], + loc: { + start: { column: 2, line: 2 }, + end: { column: 26, line: 2 }, + }, + }, + ], + + range: [10, 40], + loc: { + start: { column: 10, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + superClass: null, + + range: [0, 40], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [0, 41], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-public/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-public/snapshots/4-Babel-Tokens.shot new file mode 100644 index 00000000000..e0257ccc735 --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-public/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,106 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty modifier-public Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [0, 5], + loc: { + start: { column: 0, line: 1 }, + end: { column: 5, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "public", + + range: [14, 20], + loc: { + start: { column: 2, line: 2 }, + end: { column: 8, line: 2 }, + }, + }, + Identifier { + type: "Identifier", + value: "accessor", + + range: [21, 29], + loc: { + start: { column: 9, line: 2 }, + end: { column: 17, line: 2 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [30, 33], + loc: { + start: { column: 18, line: 2 }, + end: { column: 21, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [34, 35], + loc: { + start: { column: 22, line: 2 }, + end: { column: 23, line: 2 }, + }, + }, + Numeric { + type: "Numeric", + value: "2", + + range: [36, 37], + loc: { + start: { column: 24, line: 2 }, + end: { column: 25, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [37, 38], + loc: { + start: { column: 25, line: 2 }, + end: { column: 26, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [39, 40], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-public/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-public/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 00000000000..9eb4ac8ef9b --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-public/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,88 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty modifier-public AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ClassDeclaration { + type: 'ClassDeclaration', + body: ClassBody { + type: 'ClassBody', + body: Array [ +- AccessorProperty { +- type: 'AccessorProperty', ++ ClassAccessorProperty { ++ type: 'ClassAccessorProperty', + accessibility: 'public', + computed: false, +- declare: false, + key: Identifier { + type: 'Identifier', + name: 'foo', + + range: [30, 33], + loc: { + start: { column: 18, line: 2 }, + end: { column: 21, line: 2 }, + }, + }, +- override: false, + static: false, + value: Literal { + type: 'Literal', + raw: '2', + value: 2, + + range: [36, 37], + loc: { + start: { column: 24, line: 2 }, + end: { column: 25, line: 2 }, + }, + }, + + range: [14, 38], + loc: { + start: { column: 2, line: 2 }, + end: { column: 26, line: 2 }, + }, + }, + ], + + range: [10, 40], + loc: { + start: { column: 10, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'Foo', + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + superClass: null, + + range: [0, 40], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + ], + sourceType: 'script', + + range: [0, 41], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 4 }, + }, + }" +`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-public/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-public/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 00000000000..7228be97ad2 --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-public/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,112 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty modifier-public AST Alignment - Token 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Array [ + Keyword { + type: 'Keyword', + value: 'class', + + range: [0, 5], + loc: { + start: { column: 0, line: 1 }, + end: { column: 5, line: 1 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'Foo', + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '{', + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, +- Keyword { +- type: 'Keyword', ++ Identifier { ++ type: 'Identifier', + value: 'public', + + range: [14, 20], + loc: { + start: { column: 2, line: 2 }, + end: { column: 8, line: 2 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'accessor', + + range: [21, 29], + loc: { + start: { column: 9, line: 2 }, + end: { column: 17, line: 2 }, + }, + }, + Identifier { + type: 'Identifier', + value: 'foo', + + range: [30, 33], + loc: { + start: { column: 18, line: 2 }, + end: { column: 21, line: 2 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '=', + + range: [34, 35], + loc: { + start: { column: 22, line: 2 }, + end: { column: 23, line: 2 }, + }, + }, + Numeric { + type: 'Numeric', + value: '2', + + range: [36, 37], + loc: { + start: { column: 24, line: 2 }, + end: { column: 25, line: 2 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: ';', + + range: [37, 38], + loc: { + start: { column: 25, line: 2 }, + end: { column: 26, line: 2 }, + }, + }, + Punctuator { + type: 'Punctuator', + value: '}', + + range: [39, 40], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, + ]" +`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-readonly/fixture.ts b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-readonly/fixture.ts new file mode 100644 index 00000000000..532df27a9ee --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-readonly/fixture.ts @@ -0,0 +1,3 @@ +class Foo { + readonly accessor foo = 2; +} diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-readonly/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-readonly/snapshots/1-TSESTree-AST.shot new file mode 100644 index 00000000000..41928f7e572 --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-readonly/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,82 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty modifier-readonly TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + AccessorProperty { + type: "AccessorProperty", + computed: false, + declare: false, + key: Identifier { + type: "Identifier", + name: "foo", + + range: [32, 35], + loc: { + start: { column: 20, line: 2 }, + end: { column: 23, line: 2 }, + }, + }, + override: false, + readonly: true, + static: false, + value: Literal { + type: "Literal", + raw: "2", + value: 2, + + range: [38, 39], + loc: { + start: { column: 26, line: 2 }, + end: { column: 27, line: 2 }, + }, + }, + + range: [14, 40], + loc: { + start: { column: 2, line: 2 }, + end: { column: 28, line: 2 }, + }, + }, + ], + + range: [10, 42], + loc: { + start: { column: 10, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + superClass: null, + + range: [0, 42], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [0, 43], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-readonly/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-readonly/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 00000000000..802229ba8ae --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-readonly/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,106 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty modifier-readonly TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [0, 5], + loc: { + start: { column: 0, line: 1 }, + end: { column: 5, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "readonly", + + range: [14, 22], + loc: { + start: { column: 2, line: 2 }, + end: { column: 10, line: 2 }, + }, + }, + Identifier { + type: "Identifier", + value: "accessor", + + range: [23, 31], + loc: { + start: { column: 11, line: 2 }, + end: { column: 19, line: 2 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [32, 35], + loc: { + start: { column: 20, line: 2 }, + end: { column: 23, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [36, 37], + loc: { + start: { column: 24, line: 2 }, + end: { column: 25, line: 2 }, + }, + }, + Numeric { + type: "Numeric", + value: "2", + + range: [38, 39], + loc: { + start: { column: 26, line: 2 }, + end: { column: 27, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [39, 40], + loc: { + start: { column: 27, line: 2 }, + end: { column: 28, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [41, 42], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-readonly/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-readonly/snapshots/3-Babel-AST.shot new file mode 100644 index 00000000000..369cfde552a --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-readonly/snapshots/3-Babel-AST.shot @@ -0,0 +1,80 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty modifier-readonly Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + ClassAccessorProperty { + type: "ClassAccessorProperty", + computed: false, + key: Identifier { + type: "Identifier", + name: "foo", + + range: [32, 35], + loc: { + start: { column: 20, line: 2 }, + end: { column: 23, line: 2 }, + }, + }, + readonly: true, + static: false, + value: Literal { + type: "Literal", + raw: "2", + value: 2, + + range: [38, 39], + loc: { + start: { column: 26, line: 2 }, + end: { column: 27, line: 2 }, + }, + }, + + range: [14, 40], + loc: { + start: { column: 2, line: 2 }, + end: { column: 28, line: 2 }, + }, + }, + ], + + range: [10, 42], + loc: { + start: { column: 10, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + superClass: null, + + range: [0, 42], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [0, 43], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-readonly/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-readonly/snapshots/4-Babel-Tokens.shot new file mode 100644 index 00000000000..673f38fe66c --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-readonly/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,106 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty modifier-readonly Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [0, 5], + loc: { + start: { column: 0, line: 1 }, + end: { column: 5, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "readonly", + + range: [14, 22], + loc: { + start: { column: 2, line: 2 }, + end: { column: 10, line: 2 }, + }, + }, + Identifier { + type: "Identifier", + value: "accessor", + + range: [23, 31], + loc: { + start: { column: 11, line: 2 }, + end: { column: 19, line: 2 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [32, 35], + loc: { + start: { column: 20, line: 2 }, + end: { column: 23, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [36, 37], + loc: { + start: { column: 24, line: 2 }, + end: { column: 25, line: 2 }, + }, + }, + Numeric { + type: "Numeric", + value: "2", + + range: [38, 39], + loc: { + start: { column: 26, line: 2 }, + end: { column: 27, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [39, 40], + loc: { + start: { column: 27, line: 2 }, + end: { column: 28, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [41, 42], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-readonly/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-readonly/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 00000000000..7f48bba2e58 --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-readonly/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,88 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty modifier-readonly AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ClassDeclaration { + type: 'ClassDeclaration', + body: ClassBody { + type: 'ClassBody', + body: Array [ +- AccessorProperty { +- type: 'AccessorProperty', ++ ClassAccessorProperty { ++ type: 'ClassAccessorProperty', + computed: false, +- declare: false, + key: Identifier { + type: 'Identifier', + name: 'foo', + + range: [32, 35], + loc: { + start: { column: 20, line: 2 }, + end: { column: 23, line: 2 }, + }, + }, +- override: false, + readonly: true, + static: false, + value: Literal { + type: 'Literal', + raw: '2', + value: 2, + + range: [38, 39], + loc: { + start: { column: 26, line: 2 }, + end: { column: 27, line: 2 }, + }, + }, + + range: [14, 40], + loc: { + start: { column: 2, line: 2 }, + end: { column: 28, line: 2 }, + }, + }, + ], + + range: [10, 42], + loc: { + start: { column: 10, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'Foo', + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + superClass: null, + + range: [0, 42], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + ], + sourceType: 'script', + + range: [0, 43], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 4 }, + }, + }" +`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-readonly/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-readonly/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 00000000000..ba78cbeda59 --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-readonly/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty modifier-readonly AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-static/fixture.ts b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-static/fixture.ts new file mode 100644 index 00000000000..0c8cd7ca6a4 --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-static/fixture.ts @@ -0,0 +1,3 @@ +class Foo { + static accessor foo = 2; +} diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-static/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-static/snapshots/1-TSESTree-AST.shot new file mode 100644 index 00000000000..6733de847c8 --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-static/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,81 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty modifier-static TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + AccessorProperty { + type: "AccessorProperty", + computed: false, + declare: false, + key: Identifier { + type: "Identifier", + name: "foo", + + range: [30, 33], + loc: { + start: { column: 18, line: 2 }, + end: { column: 21, line: 2 }, + }, + }, + override: false, + static: true, + value: Literal { + type: "Literal", + raw: "2", + value: 2, + + range: [36, 37], + loc: { + start: { column: 24, line: 2 }, + end: { column: 25, line: 2 }, + }, + }, + + range: [14, 38], + loc: { + start: { column: 2, line: 2 }, + end: { column: 26, line: 2 }, + }, + }, + ], + + range: [10, 40], + loc: { + start: { column: 10, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + superClass: null, + + range: [0, 40], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [0, 41], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-static/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-static/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 00000000000..245c071ee55 --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-static/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,106 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty modifier-static TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [0, 5], + loc: { + start: { column: 0, line: 1 }, + end: { column: 5, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "static", + + range: [14, 20], + loc: { + start: { column: 2, line: 2 }, + end: { column: 8, line: 2 }, + }, + }, + Identifier { + type: "Identifier", + value: "accessor", + + range: [21, 29], + loc: { + start: { column: 9, line: 2 }, + end: { column: 17, line: 2 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [30, 33], + loc: { + start: { column: 18, line: 2 }, + end: { column: 21, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [34, 35], + loc: { + start: { column: 22, line: 2 }, + end: { column: 23, line: 2 }, + }, + }, + Numeric { + type: "Numeric", + value: "2", + + range: [36, 37], + loc: { + start: { column: 24, line: 2 }, + end: { column: 25, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [37, 38], + loc: { + start: { column: 25, line: 2 }, + end: { column: 26, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [39, 40], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-static/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-static/snapshots/3-Babel-AST.shot new file mode 100644 index 00000000000..917914d80fb --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-static/snapshots/3-Babel-AST.shot @@ -0,0 +1,79 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty modifier-static Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + ClassAccessorProperty { + type: "ClassAccessorProperty", + computed: false, + key: Identifier { + type: "Identifier", + name: "foo", + + range: [30, 33], + loc: { + start: { column: 18, line: 2 }, + end: { column: 21, line: 2 }, + }, + }, + static: true, + value: Literal { + type: "Literal", + raw: "2", + value: 2, + + range: [36, 37], + loc: { + start: { column: 24, line: 2 }, + end: { column: 25, line: 2 }, + }, + }, + + range: [14, 38], + loc: { + start: { column: 2, line: 2 }, + end: { column: 26, line: 2 }, + }, + }, + ], + + range: [10, 40], + loc: { + start: { column: 10, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + superClass: null, + + range: [0, 40], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [0, 41], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-static/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-static/snapshots/4-Babel-Tokens.shot new file mode 100644 index 00000000000..64b2cf04408 --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-static/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,106 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty modifier-static Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [0, 5], + loc: { + start: { column: 0, line: 1 }, + end: { column: 5, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + Keyword { + type: "Keyword", + value: "static", + + range: [14, 20], + loc: { + start: { column: 2, line: 2 }, + end: { column: 8, line: 2 }, + }, + }, + Identifier { + type: "Identifier", + value: "accessor", + + range: [21, 29], + loc: { + start: { column: 9, line: 2 }, + end: { column: 17, line: 2 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [30, 33], + loc: { + start: { column: 18, line: 2 }, + end: { column: 21, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [34, 35], + loc: { + start: { column: 22, line: 2 }, + end: { column: 23, line: 2 }, + }, + }, + Numeric { + type: "Numeric", + value: "2", + + range: [36, 37], + loc: { + start: { column: 24, line: 2 }, + end: { column: 25, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [37, 38], + loc: { + start: { column: 25, line: 2 }, + end: { column: 26, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [39, 40], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-static/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-static/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 00000000000..c5c6c8589ee --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-static/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,87 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty modifier-static AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ClassDeclaration { + type: 'ClassDeclaration', + body: ClassBody { + type: 'ClassBody', + body: Array [ +- AccessorProperty { +- type: 'AccessorProperty', ++ ClassAccessorProperty { ++ type: 'ClassAccessorProperty', + computed: false, +- declare: false, + key: Identifier { + type: 'Identifier', + name: 'foo', + + range: [30, 33], + loc: { + start: { column: 18, line: 2 }, + end: { column: 21, line: 2 }, + }, + }, +- override: false, + static: true, + value: Literal { + type: 'Literal', + raw: '2', + value: 2, + + range: [36, 37], + loc: { + start: { column: 24, line: 2 }, + end: { column: 25, line: 2 }, + }, + }, + + range: [14, 38], + loc: { + start: { column: 2, line: 2 }, + end: { column: 26, line: 2 }, + }, + }, + ], + + range: [10, 40], + loc: { + start: { column: 10, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'Foo', + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + superClass: null, + + range: [0, 40], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + ], + sourceType: 'script', + + range: [0, 41], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 4 }, + }, + }" +`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-static/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-static/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 00000000000..72680d23ee5 --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/modifier-static/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty modifier-static AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/no-annotation-no-value/fixture.ts b/packages/ast-spec/src/element/AccessorProperty/fixtures/no-annotation-no-value/fixture.ts new file mode 100644 index 00000000000..18afaa86480 --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/no-annotation-no-value/fixture.ts @@ -0,0 +1,3 @@ +class Foo { + accessor prop; +} diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/no-annotation-no-value/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/no-annotation-no-value/snapshots/1-TSESTree-AST.shot new file mode 100644 index 00000000000..a5341fd2f70 --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/no-annotation-no-value/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,71 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty no-annotation-no-value TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + AccessorProperty { + type: "AccessorProperty", + computed: false, + declare: false, + key: Identifier { + type: "Identifier", + name: "prop", + + range: [23, 27], + loc: { + start: { column: 11, line: 2 }, + end: { column: 15, line: 2 }, + }, + }, + override: false, + static: false, + value: null, + + range: [14, 28], + loc: { + start: { column: 2, line: 2 }, + end: { column: 16, line: 2 }, + }, + }, + ], + + range: [10, 30], + loc: { + start: { column: 10, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + superClass: null, + + range: [0, 30], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [0, 31], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/no-annotation-no-value/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/no-annotation-no-value/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 00000000000..b28c76ee39c --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/no-annotation-no-value/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,76 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty no-annotation-no-value TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [0, 5], + loc: { + start: { column: 0, line: 1 }, + end: { column: 5, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "accessor", + + range: [14, 22], + loc: { + start: { column: 2, line: 2 }, + end: { column: 10, line: 2 }, + }, + }, + Identifier { + type: "Identifier", + value: "prop", + + range: [23, 27], + loc: { + start: { column: 11, line: 2 }, + end: { column: 15, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [27, 28], + loc: { + start: { column: 15, line: 2 }, + end: { column: 16, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [29, 30], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/no-annotation-no-value/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/no-annotation-no-value/snapshots/3-Babel-AST.shot new file mode 100644 index 00000000000..7cf14ad2c92 --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/no-annotation-no-value/snapshots/3-Babel-AST.shot @@ -0,0 +1,69 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty no-annotation-no-value Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + ClassAccessorProperty { + type: "ClassAccessorProperty", + computed: false, + key: Identifier { + type: "Identifier", + name: "prop", + + range: [23, 27], + loc: { + start: { column: 11, line: 2 }, + end: { column: 15, line: 2 }, + }, + }, + static: false, + value: null, + + range: [14, 28], + loc: { + start: { column: 2, line: 2 }, + end: { column: 16, line: 2 }, + }, + }, + ], + + range: [10, 30], + loc: { + start: { column: 10, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + superClass: null, + + range: [0, 30], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [0, 31], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/no-annotation-no-value/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/no-annotation-no-value/snapshots/4-Babel-Tokens.shot new file mode 100644 index 00000000000..46747c3659a --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/no-annotation-no-value/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,76 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty no-annotation-no-value Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [0, 5], + loc: { + start: { column: 0, line: 1 }, + end: { column: 5, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "accessor", + + range: [14, 22], + loc: { + start: { column: 2, line: 2 }, + end: { column: 10, line: 2 }, + }, + }, + Identifier { + type: "Identifier", + value: "prop", + + range: [23, 27], + loc: { + start: { column: 11, line: 2 }, + end: { column: 15, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [27, 28], + loc: { + start: { column: 15, line: 2 }, + end: { column: 16, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [29, 30], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/no-annotation-no-value/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/no-annotation-no-value/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 00000000000..b08e790e91d --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/no-annotation-no-value/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,77 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty no-annotation-no-value AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ClassDeclaration { + type: 'ClassDeclaration', + body: ClassBody { + type: 'ClassBody', + body: Array [ +- AccessorProperty { +- type: 'AccessorProperty', ++ ClassAccessorProperty { ++ type: 'ClassAccessorProperty', + computed: false, +- declare: false, + key: Identifier { + type: 'Identifier', + name: 'prop', + + range: [23, 27], + loc: { + start: { column: 11, line: 2 }, + end: { column: 15, line: 2 }, + }, + }, +- override: false, + static: false, + value: null, + + range: [14, 28], + loc: { + start: { column: 2, line: 2 }, + end: { column: 16, line: 2 }, + }, + }, + ], + + range: [10, 30], + loc: { + start: { column: 10, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'Foo', + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + superClass: null, + + range: [0, 30], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + ], + sourceType: 'script', + + range: [0, 31], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 4 }, + }, + }" +`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/no-annotation-no-value/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/no-annotation-no-value/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 00000000000..3a66da8c8d9 --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/no-annotation-no-value/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty no-annotation-no-value AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/no-annotation-with-value/fixture.ts b/packages/ast-spec/src/element/AccessorProperty/fixtures/no-annotation-with-value/fixture.ts new file mode 100644 index 00000000000..4ac51cccf92 --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/no-annotation-with-value/fixture.ts @@ -0,0 +1,3 @@ +class Foo { + accessor prop = 'str'; +} diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/no-annotation-with-value/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/no-annotation-with-value/snapshots/1-TSESTree-AST.shot new file mode 100644 index 00000000000..0cc63f22486 --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/no-annotation-with-value/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,81 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty no-annotation-with-value TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + AccessorProperty { + type: "AccessorProperty", + computed: false, + declare: false, + key: Identifier { + type: "Identifier", + name: "prop", + + range: [23, 27], + loc: { + start: { column: 11, line: 2 }, + end: { column: 15, line: 2 }, + }, + }, + override: false, + static: false, + value: Literal { + type: "Literal", + raw: "'str'", + value: "str", + + range: [30, 35], + loc: { + start: { column: 18, line: 2 }, + end: { column: 23, line: 2 }, + }, + }, + + range: [14, 36], + loc: { + start: { column: 2, line: 2 }, + end: { column: 24, line: 2 }, + }, + }, + ], + + range: [10, 38], + loc: { + start: { column: 10, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + superClass: null, + + range: [0, 38], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [0, 39], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/no-annotation-with-value/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/no-annotation-with-value/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 00000000000..e98ce8a1ccf --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/no-annotation-with-value/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,96 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty no-annotation-with-value TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [0, 5], + loc: { + start: { column: 0, line: 1 }, + end: { column: 5, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "accessor", + + range: [14, 22], + loc: { + start: { column: 2, line: 2 }, + end: { column: 10, line: 2 }, + }, + }, + Identifier { + type: "Identifier", + value: "prop", + + range: [23, 27], + loc: { + start: { column: 11, line: 2 }, + end: { column: 15, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [28, 29], + loc: { + start: { column: 16, line: 2 }, + end: { column: 17, line: 2 }, + }, + }, + String { + type: "String", + value: "'str'", + + range: [30, 35], + loc: { + start: { column: 18, line: 2 }, + end: { column: 23, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [35, 36], + loc: { + start: { column: 23, line: 2 }, + end: { column: 24, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [37, 38], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/no-annotation-with-value/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/no-annotation-with-value/snapshots/3-Babel-AST.shot new file mode 100644 index 00000000000..7c1c8d024f9 --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/no-annotation-with-value/snapshots/3-Babel-AST.shot @@ -0,0 +1,79 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty no-annotation-with-value Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + ClassAccessorProperty { + type: "ClassAccessorProperty", + computed: false, + key: Identifier { + type: "Identifier", + name: "prop", + + range: [23, 27], + loc: { + start: { column: 11, line: 2 }, + end: { column: 15, line: 2 }, + }, + }, + static: false, + value: Literal { + type: "Literal", + raw: "'str'", + value: "str", + + range: [30, 35], + loc: { + start: { column: 18, line: 2 }, + end: { column: 23, line: 2 }, + }, + }, + + range: [14, 36], + loc: { + start: { column: 2, line: 2 }, + end: { column: 24, line: 2 }, + }, + }, + ], + + range: [10, 38], + loc: { + start: { column: 10, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + superClass: null, + + range: [0, 38], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [0, 39], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/no-annotation-with-value/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/no-annotation-with-value/snapshots/4-Babel-Tokens.shot new file mode 100644 index 00000000000..fbe3b7015a8 --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/no-annotation-with-value/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,96 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty no-annotation-with-value Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [0, 5], + loc: { + start: { column: 0, line: 1 }, + end: { column: 5, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "accessor", + + range: [14, 22], + loc: { + start: { column: 2, line: 2 }, + end: { column: 10, line: 2 }, + }, + }, + Identifier { + type: "Identifier", + value: "prop", + + range: [23, 27], + loc: { + start: { column: 11, line: 2 }, + end: { column: 15, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [28, 29], + loc: { + start: { column: 16, line: 2 }, + end: { column: 17, line: 2 }, + }, + }, + String { + type: "String", + value: "'str'", + + range: [30, 35], + loc: { + start: { column: 18, line: 2 }, + end: { column: 23, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [35, 36], + loc: { + start: { column: 23, line: 2 }, + end: { column: 24, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [37, 38], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/no-annotation-with-value/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/no-annotation-with-value/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 00000000000..2d4b943581c --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/no-annotation-with-value/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,87 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty no-annotation-with-value AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ClassDeclaration { + type: 'ClassDeclaration', + body: ClassBody { + type: 'ClassBody', + body: Array [ +- AccessorProperty { +- type: 'AccessorProperty', ++ ClassAccessorProperty { ++ type: 'ClassAccessorProperty', + computed: false, +- declare: false, + key: Identifier { + type: 'Identifier', + name: 'prop', + + range: [23, 27], + loc: { + start: { column: 11, line: 2 }, + end: { column: 15, line: 2 }, + }, + }, +- override: false, + static: false, + value: Literal { + type: 'Literal', + raw: '\\\\'str\\\\'', + value: 'str', + + range: [30, 35], + loc: { + start: { column: 18, line: 2 }, + end: { column: 23, line: 2 }, + }, + }, + + range: [14, 36], + loc: { + start: { column: 2, line: 2 }, + end: { column: 24, line: 2 }, + }, + }, + ], + + range: [10, 38], + loc: { + start: { column: 10, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'Foo', + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + superClass: null, + + range: [0, 38], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + ], + sourceType: 'script', + + range: [0, 39], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 4 }, + }, + }" +`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/no-annotation-with-value/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/no-annotation-with-value/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 00000000000..01d2c94e685 --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/no-annotation-with-value/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty no-annotation-with-value AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/with-annotation-no-value/fixture.ts b/packages/ast-spec/src/element/AccessorProperty/fixtures/with-annotation-no-value/fixture.ts new file mode 100644 index 00000000000..1ec3f55869e --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/with-annotation-no-value/fixture.ts @@ -0,0 +1,3 @@ +class Foo { + accessor prop: string; +} diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/with-annotation-no-value/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/with-annotation-no-value/snapshots/1-TSESTree-AST.shot new file mode 100644 index 00000000000..be65f1b2fcd --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/with-annotation-no-value/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,89 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty with-annotation-no-value TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + AccessorProperty { + type: "AccessorProperty", + computed: false, + declare: false, + key: Identifier { + type: "Identifier", + name: "prop", + + range: [23, 27], + loc: { + start: { column: 11, line: 2 }, + end: { column: 15, line: 2 }, + }, + }, + override: false, + static: false, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [29, 35], + loc: { + start: { column: 17, line: 2 }, + end: { column: 23, line: 2 }, + }, + }, + + range: [27, 35], + loc: { + start: { column: 15, line: 2 }, + end: { column: 23, line: 2 }, + }, + }, + value: null, + + range: [14, 36], + loc: { + start: { column: 2, line: 2 }, + end: { column: 24, line: 2 }, + }, + }, + ], + + range: [10, 38], + loc: { + start: { column: 10, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + superClass: null, + + range: [0, 38], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [0, 39], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/with-annotation-no-value/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/with-annotation-no-value/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 00000000000..3787e2a78f8 --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/with-annotation-no-value/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,96 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty with-annotation-no-value TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [0, 5], + loc: { + start: { column: 0, line: 1 }, + end: { column: 5, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "accessor", + + range: [14, 22], + loc: { + start: { column: 2, line: 2 }, + end: { column: 10, line: 2 }, + }, + }, + Identifier { + type: "Identifier", + value: "prop", + + range: [23, 27], + loc: { + start: { column: 11, line: 2 }, + end: { column: 15, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [27, 28], + loc: { + start: { column: 15, line: 2 }, + end: { column: 16, line: 2 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [29, 35], + loc: { + start: { column: 17, line: 2 }, + end: { column: 23, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [35, 36], + loc: { + start: { column: 23, line: 2 }, + end: { column: 24, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [37, 38], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/with-annotation-no-value/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/with-annotation-no-value/snapshots/3-Babel-AST.shot new file mode 100644 index 00000000000..b1451f6ef4d --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/with-annotation-no-value/snapshots/3-Babel-AST.shot @@ -0,0 +1,87 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty with-annotation-no-value Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + ClassAccessorProperty { + type: "ClassAccessorProperty", + computed: false, + key: Identifier { + type: "Identifier", + name: "prop", + + range: [23, 27], + loc: { + start: { column: 11, line: 2 }, + end: { column: 15, line: 2 }, + }, + }, + static: false, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [29, 35], + loc: { + start: { column: 17, line: 2 }, + end: { column: 23, line: 2 }, + }, + }, + + range: [27, 35], + loc: { + start: { column: 15, line: 2 }, + end: { column: 23, line: 2 }, + }, + }, + value: null, + + range: [14, 36], + loc: { + start: { column: 2, line: 2 }, + end: { column: 24, line: 2 }, + }, + }, + ], + + range: [10, 38], + loc: { + start: { column: 10, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + superClass: null, + + range: [0, 38], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [0, 39], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/with-annotation-no-value/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/with-annotation-no-value/snapshots/4-Babel-Tokens.shot new file mode 100644 index 00000000000..3c588981ba1 --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/with-annotation-no-value/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,96 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty with-annotation-no-value Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [0, 5], + loc: { + start: { column: 0, line: 1 }, + end: { column: 5, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "accessor", + + range: [14, 22], + loc: { + start: { column: 2, line: 2 }, + end: { column: 10, line: 2 }, + }, + }, + Identifier { + type: "Identifier", + value: "prop", + + range: [23, 27], + loc: { + start: { column: 11, line: 2 }, + end: { column: 15, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [27, 28], + loc: { + start: { column: 15, line: 2 }, + end: { column: 16, line: 2 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [29, 35], + loc: { + start: { column: 17, line: 2 }, + end: { column: 23, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [35, 36], + loc: { + start: { column: 23, line: 2 }, + end: { column: 24, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [37, 38], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/with-annotation-no-value/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/with-annotation-no-value/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 00000000000..d5ff97f0998 --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/with-annotation-no-value/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,95 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty with-annotation-no-value AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ClassDeclaration { + type: 'ClassDeclaration', + body: ClassBody { + type: 'ClassBody', + body: Array [ +- AccessorProperty { +- type: 'AccessorProperty', ++ ClassAccessorProperty { ++ type: 'ClassAccessorProperty', + computed: false, +- declare: false, + key: Identifier { + type: 'Identifier', + name: 'prop', + + range: [23, 27], + loc: { + start: { column: 11, line: 2 }, + end: { column: 15, line: 2 }, + }, + }, +- override: false, + static: false, + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSStringKeyword { + type: 'TSStringKeyword', + + range: [29, 35], + loc: { + start: { column: 17, line: 2 }, + end: { column: 23, line: 2 }, + }, + }, + + range: [27, 35], + loc: { + start: { column: 15, line: 2 }, + end: { column: 23, line: 2 }, + }, + }, + value: null, + + range: [14, 36], + loc: { + start: { column: 2, line: 2 }, + end: { column: 24, line: 2 }, + }, + }, + ], + + range: [10, 38], + loc: { + start: { column: 10, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'Foo', + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + superClass: null, + + range: [0, 38], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + ], + sourceType: 'script', + + range: [0, 39], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 4 }, + }, + }" +`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/with-annotation-no-value/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/with-annotation-no-value/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 00000000000..285c4824154 --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/with-annotation-no-value/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty with-annotation-no-value AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/with-annotation-with-value/fixture.ts b/packages/ast-spec/src/element/AccessorProperty/fixtures/with-annotation-with-value/fixture.ts new file mode 100644 index 00000000000..0fde6c3138c --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/with-annotation-with-value/fixture.ts @@ -0,0 +1,3 @@ +class Foo { + accessor prop: string = 'str'; +} diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/with-annotation-with-value/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/with-annotation-with-value/snapshots/1-TSESTree-AST.shot new file mode 100644 index 00000000000..9e9448b46f1 --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/with-annotation-with-value/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,99 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty with-annotation-with-value TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + AccessorProperty { + type: "AccessorProperty", + computed: false, + declare: false, + key: Identifier { + type: "Identifier", + name: "prop", + + range: [23, 27], + loc: { + start: { column: 11, line: 2 }, + end: { column: 15, line: 2 }, + }, + }, + override: false, + static: false, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [29, 35], + loc: { + start: { column: 17, line: 2 }, + end: { column: 23, line: 2 }, + }, + }, + + range: [27, 35], + loc: { + start: { column: 15, line: 2 }, + end: { column: 23, line: 2 }, + }, + }, + value: Literal { + type: "Literal", + raw: "'str'", + value: "str", + + range: [38, 43], + loc: { + start: { column: 26, line: 2 }, + end: { column: 31, line: 2 }, + }, + }, + + range: [14, 44], + loc: { + start: { column: 2, line: 2 }, + end: { column: 32, line: 2 }, + }, + }, + ], + + range: [10, 46], + loc: { + start: { column: 10, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + superClass: null, + + range: [0, 46], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [0, 47], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/with-annotation-with-value/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/with-annotation-with-value/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 00000000000..2ee9140971c --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/with-annotation-with-value/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,116 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty with-annotation-with-value TSESTree - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [0, 5], + loc: { + start: { column: 0, line: 1 }, + end: { column: 5, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "accessor", + + range: [14, 22], + loc: { + start: { column: 2, line: 2 }, + end: { column: 10, line: 2 }, + }, + }, + Identifier { + type: "Identifier", + value: "prop", + + range: [23, 27], + loc: { + start: { column: 11, line: 2 }, + end: { column: 15, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [27, 28], + loc: { + start: { column: 15, line: 2 }, + end: { column: 16, line: 2 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [29, 35], + loc: { + start: { column: 17, line: 2 }, + end: { column: 23, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [36, 37], + loc: { + start: { column: 24, line: 2 }, + end: { column: 25, line: 2 }, + }, + }, + String { + type: "String", + value: "'str'", + + range: [38, 43], + loc: { + start: { column: 26, line: 2 }, + end: { column: 31, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [43, 44], + loc: { + start: { column: 31, line: 2 }, + end: { column: 32, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [45, 46], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/with-annotation-with-value/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/with-annotation-with-value/snapshots/3-Babel-AST.shot new file mode 100644 index 00000000000..dbe2364b124 --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/with-annotation-with-value/snapshots/3-Babel-AST.shot @@ -0,0 +1,97 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty with-annotation-with-value Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ClassDeclaration { + type: "ClassDeclaration", + body: ClassBody { + type: "ClassBody", + body: Array [ + ClassAccessorProperty { + type: "ClassAccessorProperty", + computed: false, + key: Identifier { + type: "Identifier", + name: "prop", + + range: [23, 27], + loc: { + start: { column: 11, line: 2 }, + end: { column: 15, line: 2 }, + }, + }, + static: false, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [29, 35], + loc: { + start: { column: 17, line: 2 }, + end: { column: 23, line: 2 }, + }, + }, + + range: [27, 35], + loc: { + start: { column: 15, line: 2 }, + end: { column: 23, line: 2 }, + }, + }, + value: Literal { + type: "Literal", + raw: "'str'", + value: "str", + + range: [38, 43], + loc: { + start: { column: 26, line: 2 }, + end: { column: 31, line: 2 }, + }, + }, + + range: [14, 44], + loc: { + start: { column: 2, line: 2 }, + end: { column: 32, line: 2 }, + }, + }, + ], + + range: [10, 46], + loc: { + start: { column: 10, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + id: Identifier { + type: "Identifier", + name: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + superClass: null, + + range: [0, 46], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + ], + sourceType: "script", + + range: [0, 47], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 4 }, + }, +} +`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/with-annotation-with-value/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/with-annotation-with-value/snapshots/4-Babel-Tokens.shot new file mode 100644 index 00000000000..d8a82e4c1bb --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/with-annotation-with-value/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,116 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty with-annotation-with-value Babel - Tokens 1`] = ` +Array [ + Keyword { + type: "Keyword", + value: "class", + + range: [0, 5], + loc: { + start: { column: 0, line: 1 }, + end: { column: 5, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "Foo", + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "accessor", + + range: [14, 22], + loc: { + start: { column: 2, line: 2 }, + end: { column: 10, line: 2 }, + }, + }, + Identifier { + type: "Identifier", + value: "prop", + + range: [23, 27], + loc: { + start: { column: 11, line: 2 }, + end: { column: 15, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [27, 28], + loc: { + start: { column: 15, line: 2 }, + end: { column: 16, line: 2 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [29, 35], + loc: { + start: { column: 17, line: 2 }, + end: { column: 23, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=", + + range: [36, 37], + loc: { + start: { column: 24, line: 2 }, + end: { column: 25, line: 2 }, + }, + }, + String { + type: "String", + value: "'str'", + + range: [38, 43], + loc: { + start: { column: 26, line: 2 }, + end: { column: 31, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [43, 44], + loc: { + start: { column: 31, line: 2 }, + end: { column: 32, line: 2 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [45, 46], + loc: { + start: { column: 0, line: 3 }, + end: { column: 1, line: 3 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/with-annotation-with-value/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/with-annotation-with-value/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 00000000000..0e95b7b4620 --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/with-annotation-with-value/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,105 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty with-annotation-with-value AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ClassDeclaration { + type: 'ClassDeclaration', + body: ClassBody { + type: 'ClassBody', + body: Array [ +- AccessorProperty { +- type: 'AccessorProperty', ++ ClassAccessorProperty { ++ type: 'ClassAccessorProperty', + computed: false, +- declare: false, + key: Identifier { + type: 'Identifier', + name: 'prop', + + range: [23, 27], + loc: { + start: { column: 11, line: 2 }, + end: { column: 15, line: 2 }, + }, + }, +- override: false, + static: false, + typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSStringKeyword { + type: 'TSStringKeyword', + + range: [29, 35], + loc: { + start: { column: 17, line: 2 }, + end: { column: 23, line: 2 }, + }, + }, + + range: [27, 35], + loc: { + start: { column: 15, line: 2 }, + end: { column: 23, line: 2 }, + }, + }, + value: Literal { + type: 'Literal', + raw: '\\\\'str\\\\'', + value: 'str', + + range: [38, 43], + loc: { + start: { column: 26, line: 2 }, + end: { column: 31, line: 2 }, + }, + }, + + range: [14, 44], + loc: { + start: { column: 2, line: 2 }, + end: { column: 32, line: 2 }, + }, + }, + ], + + range: [10, 46], + loc: { + start: { column: 10, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + id: Identifier { + type: 'Identifier', + name: 'Foo', + + range: [6, 9], + loc: { + start: { column: 6, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + superClass: null, + + range: [0, 46], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 3 }, + }, + }, + ], + sourceType: 'script', + + range: [0, 47], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 4 }, + }, + }" +`; diff --git a/packages/ast-spec/src/element/AccessorProperty/fixtures/with-annotation-with-value/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/element/AccessorProperty/fixtures/with-annotation-with-value/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 00000000000..2d68aa8d59a --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/fixtures/with-annotation-with-value/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures element AccessorProperty with-annotation-with-value AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/element/AccessorProperty/spec.ts b/packages/ast-spec/src/element/AccessorProperty/spec.ts new file mode 100644 index 00000000000..739481e9c23 --- /dev/null +++ b/packages/ast-spec/src/element/AccessorProperty/spec.ts @@ -0,0 +1,19 @@ +import type { AST_NODE_TYPES } from '../../ast-node-types'; +import type { + PropertyDefinitionComputedNameBase, + PropertyDefinitionNonComputedNameBase, +} from '../../base/PropertyDefinitionBase'; + +export interface AccessorPropertyComputedName + extends PropertyDefinitionComputedNameBase { + type: AST_NODE_TYPES.AccessorProperty; +} + +export interface AccessorPropertyNonComputedName + extends PropertyDefinitionNonComputedNameBase { + type: AST_NODE_TYPES.AccessorProperty; +} + +export type AccessorProperty = + | AccessorPropertyComputedName + | AccessorPropertyNonComputedName; diff --git a/packages/ast-spec/src/element/TSAbstractAccessorProperty/spec.ts b/packages/ast-spec/src/element/TSAbstractAccessorProperty/spec.ts new file mode 100644 index 00000000000..6ca44e44183 --- /dev/null +++ b/packages/ast-spec/src/element/TSAbstractAccessorProperty/spec.ts @@ -0,0 +1,22 @@ +import type { AST_NODE_TYPES } from '../../ast-node-types'; +import type { + PropertyDefinitionComputedNameBase, + PropertyDefinitionNonComputedNameBase, +} from '../../base/PropertyDefinitionBase'; + +export interface TSAbstractAccessorPropertyComputedName + extends PropertyDefinitionComputedNameBase { + type: AST_NODE_TYPES.TSAbstractAccessorProperty; + value: null; +} + +export interface TSAbstractAccessorPropertyNonComputedName + // this does not extend ClassPropertyDefinitionNonComputedNameBase because abstract private names are not allowed + extends PropertyDefinitionNonComputedNameBase { + type: AST_NODE_TYPES.TSAbstractAccessorProperty; + value: null; +} + +export type TSAbstractAccessorProperty = + | TSAbstractAccessorPropertyComputedName + | TSAbstractAccessorPropertyNonComputedName; diff --git a/packages/ast-spec/src/element/spec.ts b/packages/ast-spec/src/element/spec.ts index 77ed3f2f283..eeecc41028c 100644 --- a/packages/ast-spec/src/element/spec.ts +++ b/packages/ast-spec/src/element/spec.ts @@ -1,8 +1,10 @@ +export * from './AccessorProperty/spec'; export * from './PropertyDefinition/spec'; export * from './MethodDefinition/spec'; export * from './Property/spec'; export * from './SpreadElement/spec'; export * from './StaticBlock/spec'; +export * from './TSAbstractAccessorProperty/spec'; export * from './TSAbstractPropertyDefinition/spec'; export * from './TSAbstractMethodDefinition/spec'; export * from './TSCallSignatureDeclaration/spec'; diff --git a/packages/ast-spec/src/expression/ArrayExpression/spec.ts b/packages/ast-spec/src/expression/ArrayExpression/spec.ts index 7dc07e30952..3dccf5c6ab8 100644 --- a/packages/ast-spec/src/expression/ArrayExpression/spec.ts +++ b/packages/ast-spec/src/expression/ArrayExpression/spec.ts @@ -5,5 +5,8 @@ import type { Expression } from '../../unions/Expression'; export interface ArrayExpression extends BaseNode { type: AST_NODE_TYPES.ArrayExpression; - elements: (Expression | SpreadElement)[]; + /** + * an element will be `null` in the case of a sparse array: `[1, ,3]` + */ + elements: (Expression | SpreadElement | null)[]; } diff --git a/packages/ast-spec/src/expression/MemberExpression/spec.ts b/packages/ast-spec/src/expression/MemberExpression/spec.ts index 260574cc59f..a0a7cc65a33 100644 --- a/packages/ast-spec/src/expression/MemberExpression/spec.ts +++ b/packages/ast-spec/src/expression/MemberExpression/spec.ts @@ -2,11 +2,10 @@ import type { AST_NODE_TYPES } from '../../ast-node-types'; import type { BaseNode } from '../../base/BaseNode'; import type { PrivateIdentifier } from '../../special/PrivateIdentifier/spec'; import type { Expression } from '../../unions/Expression'; -import type { LeftHandSideExpression } from '../../unions/LeftHandSideExpression'; import type { Identifier } from '../Identifier/spec'; interface MemberExpressionBase extends BaseNode { - object: LeftHandSideExpression; + object: Expression; property: Expression | Identifier | PrivateIdentifier; computed: boolean; optional: boolean; diff --git a/packages/ast-spec/src/expression/NewExpression/spec.ts b/packages/ast-spec/src/expression/NewExpression/spec.ts index 42c93108c75..fbb31d5dff3 100644 --- a/packages/ast-spec/src/expression/NewExpression/spec.ts +++ b/packages/ast-spec/src/expression/NewExpression/spec.ts @@ -1,12 +1,12 @@ import type { AST_NODE_TYPES } from '../../ast-node-types'; import type { BaseNode } from '../../base/BaseNode'; import type { TSTypeParameterInstantiation } from '../../special/TSTypeParameterInstantiation/spec'; -import type { Expression } from '../../unions/Expression'; +import type { CallExpressionArgument } from '../../unions/CallExpressionArgument'; import type { LeftHandSideExpression } from '../../unions/LeftHandSideExpression'; export interface NewExpression extends BaseNode { type: AST_NODE_TYPES.NewExpression; callee: LeftHandSideExpression; - arguments: Expression[]; + arguments: CallExpressionArgument[]; typeArguments?: TSTypeParameterInstantiation; } diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/array-array/fixture.ts b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/array-array/fixture.ts new file mode 100644 index 00000000000..36e81ab9edb --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/array-array/fixture.ts @@ -0,0 +1 @@ +[1, 2, 3] satisfies [1, 2, 3]; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/array-array/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/array-array/snapshots/1-TSESTree-AST.shot new file mode 100644 index 00000000000..cfbfed088ce --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/array-array/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,149 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression array-array TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: TSSatisfiesExpression { + type: "TSSatisfiesExpression", + expression: ArrayExpression { + type: "ArrayExpression", + elements: Array [ + Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [1, 2], + loc: { + start: { column: 1, line: 1 }, + end: { column: 2, line: 1 }, + }, + }, + Literal { + type: "Literal", + raw: "2", + value: 2, + + range: [4, 5], + loc: { + start: { column: 4, line: 1 }, + end: { column: 5, line: 1 }, + }, + }, + Literal { + type: "Literal", + raw: "3", + value: 3, + + range: [7, 8], + loc: { + start: { column: 7, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + ], + + range: [0, 9], + loc: { + start: { column: 0, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + typeAnnotation: TSTupleType { + type: "TSTupleType", + elementTypes: Array [ + TSLiteralType { + type: "TSLiteralType", + literal: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [21, 22], + loc: { + start: { column: 21, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + + range: [21, 22], + loc: { + start: { column: 21, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + TSLiteralType { + type: "TSLiteralType", + literal: Literal { + type: "Literal", + raw: "2", + value: 2, + + range: [24, 25], + loc: { + start: { column: 24, line: 1 }, + end: { column: 25, line: 1 }, + }, + }, + + range: [24, 25], + loc: { + start: { column: 24, line: 1 }, + end: { column: 25, line: 1 }, + }, + }, + TSLiteralType { + type: "TSLiteralType", + literal: Literal { + type: "Literal", + raw: "3", + value: 3, + + range: [27, 28], + loc: { + start: { column: 27, line: 1 }, + end: { column: 28, line: 1 }, + }, + }, + + range: [27, 28], + loc: { + start: { column: 27, line: 1 }, + end: { column: 28, line: 1 }, + }, + }, + ], + + range: [20, 29], + loc: { + start: { column: 20, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + + range: [0, 29], + loc: { + start: { column: 0, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + + range: [0, 30], + loc: { + start: { column: 0, line: 1 }, + end: { column: 30, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 31], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/array-array/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/array-array/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 00000000000..b4adbaf21bb --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/array-array/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,166 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression array-array TSESTree - Tokens 1`] = ` +Array [ + Punctuator { + type: "Punctuator", + value: "[", + + range: [0, 1], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 1 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [1, 2], + loc: { + start: { column: 1, line: 1 }, + end: { column: 2, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [2, 3], + loc: { + start: { column: 2, line: 1 }, + end: { column: 3, line: 1 }, + }, + }, + Numeric { + type: "Numeric", + value: "2", + + range: [4, 5], + loc: { + start: { column: 4, line: 1 }, + end: { column: 5, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [5, 6], + loc: { + start: { column: 5, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, + Numeric { + type: "Numeric", + value: "3", + + range: [7, 8], + loc: { + start: { column: 7, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [8, 9], + loc: { + start: { column: 8, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "satisfies", + + range: [10, 19], + loc: { + start: { column: 10, 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 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [21, 22], + loc: { + start: { column: 21, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [22, 23], + loc: { + start: { column: 22, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, + Numeric { + type: "Numeric", + value: "2", + + range: [24, 25], + loc: { + start: { column: 24, line: 1 }, + end: { column: 25, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [25, 26], + loc: { + start: { column: 25, line: 1 }, + end: { column: 26, line: 1 }, + }, + }, + Numeric { + type: "Numeric", + value: "3", + + range: [27, 28], + loc: { + start: { column: 27, 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 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [29, 30], + loc: { + start: { column: 29, line: 1 }, + end: { column: 30, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/array-array/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/array-array/snapshots/3-Babel-AST.shot new file mode 100644 index 00000000000..635240ef2dd --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/array-array/snapshots/3-Babel-AST.shot @@ -0,0 +1,149 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression array-array Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: TSSatisfiesExpression { + type: "TSSatisfiesExpression", + expression: ArrayExpression { + type: "ArrayExpression", + elements: Array [ + Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [1, 2], + loc: { + start: { column: 1, line: 1 }, + end: { column: 2, line: 1 }, + }, + }, + Literal { + type: "Literal", + raw: "2", + value: 2, + + range: [4, 5], + loc: { + start: { column: 4, line: 1 }, + end: { column: 5, line: 1 }, + }, + }, + Literal { + type: "Literal", + raw: "3", + value: 3, + + range: [7, 8], + loc: { + start: { column: 7, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + ], + + range: [0, 9], + loc: { + start: { column: 0, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + typeAnnotation: TSTupleType { + type: "TSTupleType", + elementTypes: Array [ + TSLiteralType { + type: "TSLiteralType", + literal: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [21, 22], + loc: { + start: { column: 21, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + + range: [21, 22], + loc: { + start: { column: 21, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + TSLiteralType { + type: "TSLiteralType", + literal: Literal { + type: "Literal", + raw: "2", + value: 2, + + range: [24, 25], + loc: { + start: { column: 24, line: 1 }, + end: { column: 25, line: 1 }, + }, + }, + + range: [24, 25], + loc: { + start: { column: 24, line: 1 }, + end: { column: 25, line: 1 }, + }, + }, + TSLiteralType { + type: "TSLiteralType", + literal: Literal { + type: "Literal", + raw: "3", + value: 3, + + range: [27, 28], + loc: { + start: { column: 27, line: 1 }, + end: { column: 28, line: 1 }, + }, + }, + + range: [27, 28], + loc: { + start: { column: 27, line: 1 }, + end: { column: 28, line: 1 }, + }, + }, + ], + + range: [20, 29], + loc: { + start: { column: 20, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + + range: [0, 29], + loc: { + start: { column: 0, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + + range: [0, 30], + loc: { + start: { column: 0, line: 1 }, + end: { column: 30, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 31], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/array-array/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/array-array/snapshots/4-Babel-Tokens.shot new file mode 100644 index 00000000000..814b7c0915b --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/array-array/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,166 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression array-array Babel - Tokens 1`] = ` +Array [ + Punctuator { + type: "Punctuator", + value: "[", + + range: [0, 1], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 1 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [1, 2], + loc: { + start: { column: 1, line: 1 }, + end: { column: 2, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [2, 3], + loc: { + start: { column: 2, line: 1 }, + end: { column: 3, line: 1 }, + }, + }, + Numeric { + type: "Numeric", + value: "2", + + range: [4, 5], + loc: { + start: { column: 4, line: 1 }, + end: { column: 5, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [5, 6], + loc: { + start: { column: 5, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, + Numeric { + type: "Numeric", + value: "3", + + range: [7, 8], + loc: { + start: { column: 7, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [8, 9], + loc: { + start: { column: 8, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "satisfies", + + range: [10, 19], + loc: { + start: { column: 10, 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 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [21, 22], + loc: { + start: { column: 21, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [22, 23], + loc: { + start: { column: 22, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, + Numeric { + type: "Numeric", + value: "2", + + range: [24, 25], + loc: { + start: { column: 24, line: 1 }, + end: { column: 25, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [25, 26], + loc: { + start: { column: 25, line: 1 }, + end: { column: 26, line: 1 }, + }, + }, + Numeric { + type: "Numeric", + value: "3", + + range: [27, 28], + loc: { + start: { column: 27, 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 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [29, 30], + loc: { + start: { column: 29, line: 1 }, + end: { column: 30, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/array-array/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/array-array/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 00000000000..3cf7cab2487 --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/array-array/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression array-array AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/array-array/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/array-array/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 00000000000..263f9da8e6c --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/array-array/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression array-array AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/arrow-func-no-parentheses/fixture.ts b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/arrow-func-no-parentheses/fixture.ts new file mode 100644 index 00000000000..23c6cdf5a50 --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/arrow-func-no-parentheses/fixture.ts @@ -0,0 +1 @@ +() => 1 satisfies number; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/arrow-func-no-parentheses/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/arrow-func-no-parentheses/snapshots/1-TSESTree-AST.shot new file mode 100644 index 00000000000..d678e2b5ace --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/arrow-func-no-parentheses/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,68 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression arrow-func-no-parentheses TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: ArrowFunctionExpression { + type: "ArrowFunctionExpression", + async: false, + body: TSSatisfiesExpression { + type: "TSSatisfiesExpression", + expression: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [6, 7], + loc: { + start: { column: 6, line: 1 }, + end: { column: 7, line: 1 }, + }, + }, + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [18, 24], + loc: { + start: { column: 18, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, + + range: [6, 24], + loc: { + start: { column: 6, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, + expression: true, + generator: false, + id: null, + params: Array [], + + range: [0, 24], + loc: { + start: { column: 0, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, + + range: [0, 25], + loc: { + start: { column: 0, line: 1 }, + end: { column: 25, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 26], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/arrow-func-no-parentheses/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/arrow-func-no-parentheses/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 00000000000..0d642d94824 --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/arrow-func-no-parentheses/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,76 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression arrow-func-no-parentheses TSESTree - Tokens 1`] = ` +Array [ + Punctuator { + type: "Punctuator", + value: "(", + + range: [0, 1], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [1, 2], + loc: { + start: { column: 1, line: 1 }, + end: { column: 2, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=>", + + range: [3, 5], + loc: { + start: { column: 3, line: 1 }, + end: { column: 5, line: 1 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [6, 7], + loc: { + start: { column: 6, line: 1 }, + end: { column: 7, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "satisfies", + + range: [8, 17], + loc: { + start: { column: 8, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [18, 24], + loc: { + start: { column: 18, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [24, 25], + loc: { + start: { column: 24, line: 1 }, + end: { column: 25, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/arrow-func-no-parentheses/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/arrow-func-no-parentheses/snapshots/3-Babel-AST.shot new file mode 100644 index 00000000000..55e90ce71c0 --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/arrow-func-no-parentheses/snapshots/3-Babel-AST.shot @@ -0,0 +1,68 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression arrow-func-no-parentheses Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: ArrowFunctionExpression { + type: "ArrowFunctionExpression", + async: false, + body: TSSatisfiesExpression { + type: "TSSatisfiesExpression", + expression: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [6, 7], + loc: { + start: { column: 6, line: 1 }, + end: { column: 7, line: 1 }, + }, + }, + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [18, 24], + loc: { + start: { column: 18, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, + + range: [6, 24], + loc: { + start: { column: 6, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, + expression: true, + generator: false, + id: null, + params: Array [], + + range: [0, 24], + loc: { + start: { column: 0, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, + + range: [0, 25], + loc: { + start: { column: 0, line: 1 }, + end: { column: 25, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 26], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/arrow-func-no-parentheses/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/arrow-func-no-parentheses/snapshots/4-Babel-Tokens.shot new file mode 100644 index 00000000000..c921c840faa --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/arrow-func-no-parentheses/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,76 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression arrow-func-no-parentheses Babel - Tokens 1`] = ` +Array [ + Punctuator { + type: "Punctuator", + value: "(", + + range: [0, 1], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [1, 2], + loc: { + start: { column: 1, line: 1 }, + end: { column: 2, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=>", + + range: [3, 5], + loc: { + start: { column: 3, line: 1 }, + end: { column: 5, line: 1 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [6, 7], + loc: { + start: { column: 6, line: 1 }, + end: { column: 7, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "satisfies", + + range: [8, 17], + loc: { + start: { column: 8, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [18, 24], + loc: { + start: { column: 18, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [24, 25], + loc: { + start: { column: 24, line: 1 }, + end: { column: 25, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/arrow-func-no-parentheses/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/arrow-func-no-parentheses/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 00000000000..4697cea82c6 --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/arrow-func-no-parentheses/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression arrow-func-no-parentheses AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/arrow-func-no-parentheses/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/arrow-func-no-parentheses/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 00000000000..7fd90338cb4 --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/arrow-func-no-parentheses/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression arrow-func-no-parentheses AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/arrow-func-with-parentheses/fixture.ts b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/arrow-func-with-parentheses/fixture.ts new file mode 100644 index 00000000000..d0e16762720 --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/arrow-func-with-parentheses/fixture.ts @@ -0,0 +1 @@ +(() => 1) satisfies () => number; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/arrow-func-with-parentheses/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/arrow-func-with-parentheses/snapshots/1-TSESTree-AST.shot new file mode 100644 index 00000000000..193cbbd12e3 --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/arrow-func-with-parentheses/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,87 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression arrow-func-with-parentheses TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: TSSatisfiesExpression { + type: "TSSatisfiesExpression", + expression: ArrowFunctionExpression { + type: "ArrowFunctionExpression", + async: false, + body: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [7, 8], + loc: { + start: { column: 7, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + expression: true, + generator: false, + id: null, + params: Array [], + + range: [1, 8], + loc: { + start: { column: 1, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + typeAnnotation: TSFunctionType { + type: "TSFunctionType", + params: Array [], + returnType: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [26, 32], + loc: { + start: { column: 26, line: 1 }, + end: { column: 32, line: 1 }, + }, + }, + + range: [23, 32], + loc: { + start: { column: 23, line: 1 }, + end: { column: 32, line: 1 }, + }, + }, + + range: [20, 32], + loc: { + start: { column: 20, line: 1 }, + end: { column: 32, line: 1 }, + }, + }, + + range: [0, 32], + loc: { + start: { column: 0, line: 1 }, + end: { column: 32, line: 1 }, + }, + }, + + range: [0, 33], + loc: { + start: { column: 0, line: 1 }, + end: { column: 33, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 34], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/arrow-func-with-parentheses/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/arrow-func-with-parentheses/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 00000000000..7e75dcaa2c0 --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/arrow-func-with-parentheses/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,126 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression arrow-func-with-parentheses TSESTree - Tokens 1`] = ` +Array [ + Punctuator { + type: "Punctuator", + value: "(", + + range: [0, 1], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [1, 2], + loc: { + start: { column: 1, line: 1 }, + end: { column: 2, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [2, 3], + loc: { + start: { column: 2, line: 1 }, + end: { column: 3, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=>", + + range: [4, 6], + loc: { + start: { column: 4, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [7, 8], + loc: { + start: { column: 7, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [8, 9], + loc: { + start: { column: 8, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "satisfies", + + range: [10, 19], + loc: { + start: { column: 10, 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 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [21, 22], + loc: { + start: { column: 21, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=>", + + range: [23, 25], + loc: { + start: { column: 23, line: 1 }, + end: { column: 25, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [26, 32], + loc: { + start: { column: 26, 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/expression/TSSatisfiesExpression/fixtures/arrow-func-with-parentheses/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/arrow-func-with-parentheses/snapshots/3-Babel-AST.shot new file mode 100644 index 00000000000..7bddc387f4c --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/arrow-func-with-parentheses/snapshots/3-Babel-AST.shot @@ -0,0 +1,87 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression arrow-func-with-parentheses Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: TSSatisfiesExpression { + type: "TSSatisfiesExpression", + expression: ArrowFunctionExpression { + type: "ArrowFunctionExpression", + async: false, + body: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [7, 8], + loc: { + start: { column: 7, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + expression: true, + generator: false, + id: null, + params: Array [], + + range: [1, 8], + loc: { + start: { column: 1, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + typeAnnotation: TSFunctionType { + type: "TSFunctionType", + parameters: Array [], + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [26, 32], + loc: { + start: { column: 26, line: 1 }, + end: { column: 32, line: 1 }, + }, + }, + + range: [23, 32], + loc: { + start: { column: 23, line: 1 }, + end: { column: 32, line: 1 }, + }, + }, + + range: [20, 32], + loc: { + start: { column: 20, line: 1 }, + end: { column: 32, line: 1 }, + }, + }, + + range: [0, 32], + loc: { + start: { column: 0, line: 1 }, + end: { column: 32, line: 1 }, + }, + }, + + range: [0, 33], + loc: { + start: { column: 0, line: 1 }, + end: { column: 33, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 34], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/arrow-func-with-parentheses/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/arrow-func-with-parentheses/snapshots/4-Babel-Tokens.shot new file mode 100644 index 00000000000..5edb3e0a841 --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/arrow-func-with-parentheses/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,126 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression arrow-func-with-parentheses Babel - Tokens 1`] = ` +Array [ + Punctuator { + type: "Punctuator", + value: "(", + + range: [0, 1], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [1, 2], + loc: { + start: { column: 1, line: 1 }, + end: { column: 2, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [2, 3], + loc: { + start: { column: 2, line: 1 }, + end: { column: 3, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=>", + + range: [4, 6], + loc: { + start: { column: 4, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [7, 8], + loc: { + start: { column: 7, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [8, 9], + loc: { + start: { column: 8, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "satisfies", + + range: [10, 19], + loc: { + start: { column: 10, 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 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [21, 22], + loc: { + start: { column: 21, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "=>", + + range: [23, 25], + loc: { + start: { column: 23, line: 1 }, + end: { column: 25, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [26, 32], + loc: { + start: { column: 26, 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/expression/TSSatisfiesExpression/fixtures/arrow-func-with-parentheses/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/arrow-func-with-parentheses/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 00000000000..1999cc34c68 --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/arrow-func-with-parentheses/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,93 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression arrow-func-with-parentheses AST Alignment - AST 1`] = ` +"Snapshot Diff: +- TSESTree ++ Babel + + Program { + type: 'Program', + body: Array [ + ExpressionStatement { + type: 'ExpressionStatement', + expression: TSSatisfiesExpression { + type: 'TSSatisfiesExpression', + expression: ArrowFunctionExpression { + type: 'ArrowFunctionExpression', + async: false, + body: Literal { + type: 'Literal', + raw: '1', + value: 1, + + range: [7, 8], + loc: { + start: { column: 7, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + expression: true, + generator: false, + id: null, + params: Array [], + + range: [1, 8], + loc: { + start: { column: 1, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + typeAnnotation: TSFunctionType { + type: 'TSFunctionType', +- params: Array [], +- returnType: TSTypeAnnotation { ++ parameters: Array [], ++ typeAnnotation: TSTypeAnnotation { + type: 'TSTypeAnnotation', + typeAnnotation: TSNumberKeyword { + type: 'TSNumberKeyword', + + range: [26, 32], + loc: { + start: { column: 26, line: 1 }, + end: { column: 32, line: 1 }, + }, + }, + + range: [23, 32], + loc: { + start: { column: 23, line: 1 }, + end: { column: 32, line: 1 }, + }, + }, + + range: [20, 32], + loc: { + start: { column: 20, line: 1 }, + end: { column: 32, line: 1 }, + }, + }, + + range: [0, 32], + loc: { + start: { column: 0, line: 1 }, + end: { column: 32, line: 1 }, + }, + }, + + range: [0, 33], + loc: { + start: { column: 0, line: 1 }, + end: { column: 33, line: 1 }, + }, + }, + ], + sourceType: 'script', + + range: [0, 34], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, + }" +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/arrow-func-with-parentheses/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/arrow-func-with-parentheses/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 00000000000..f3d317fb4b7 --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/arrow-func-with-parentheses/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression arrow-func-with-parentheses AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/chained-satisfies/fixture.ts b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/chained-satisfies/fixture.ts new file mode 100644 index 00000000000..65dcd3629bd --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/chained-satisfies/fixture.ts @@ -0,0 +1 @@ +foo satisfies bar satisfies baz; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/chained-satisfies/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/chained-satisfies/snapshots/1-TSESTree-AST.shot new file mode 100644 index 00000000000..508caf4b944 --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/chained-satisfies/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,91 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression chained-satisfies TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: TSSatisfiesExpression { + type: "TSSatisfiesExpression", + expression: TSSatisfiesExpression { + type: "TSSatisfiesExpression", + expression: Identifier { + type: "Identifier", + name: "foo", + + range: [0, 3], + loc: { + start: { column: 0, line: 1 }, + end: { column: 3, line: 1 }, + }, + }, + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "bar", + + range: [14, 17], + loc: { + start: { column: 14, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + + range: [14, 17], + loc: { + start: { column: 14, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + + range: [0, 17], + loc: { + start: { column: 0, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "baz", + + range: [28, 31], + loc: { + start: { column: 28, line: 1 }, + end: { column: 31, line: 1 }, + }, + }, + + range: [28, 31], + loc: { + start: { column: 28, line: 1 }, + end: { column: 31, line: 1 }, + }, + }, + + range: [0, 31], + loc: { + start: { column: 0, line: 1 }, + end: { column: 31, line: 1 }, + }, + }, + + range: [0, 32], + loc: { + start: { column: 0, line: 1 }, + end: { column: 32, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 33], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/chained-satisfies/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/chained-satisfies/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 00000000000..dd0ebe5a72f --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/chained-satisfies/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,66 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression chained-satisfies TSESTree - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "foo", + + range: [0, 3], + loc: { + start: { column: 0, line: 1 }, + end: { column: 3, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "satisfies", + + range: [4, 13], + loc: { + start: { column: 4, line: 1 }, + end: { column: 13, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar", + + range: [14, 17], + loc: { + start: { column: 14, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "satisfies", + + range: [18, 27], + loc: { + start: { column: 18, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "baz", + + range: [28, 31], + loc: { + start: { column: 28, line: 1 }, + end: { column: 31, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [31, 32], + loc: { + start: { column: 31, line: 1 }, + end: { column: 32, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/chained-satisfies/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/chained-satisfies/snapshots/3-Babel-AST.shot new file mode 100644 index 00000000000..190d8d14fd0 --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/chained-satisfies/snapshots/3-Babel-AST.shot @@ -0,0 +1,91 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression chained-satisfies Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: TSSatisfiesExpression { + type: "TSSatisfiesExpression", + expression: TSSatisfiesExpression { + type: "TSSatisfiesExpression", + expression: Identifier { + type: "Identifier", + name: "foo", + + range: [0, 3], + loc: { + start: { column: 0, line: 1 }, + end: { column: 3, line: 1 }, + }, + }, + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "bar", + + range: [14, 17], + loc: { + start: { column: 14, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + + range: [14, 17], + loc: { + start: { column: 14, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + + range: [0, 17], + loc: { + start: { column: 0, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + typeAnnotation: TSTypeReference { + type: "TSTypeReference", + typeName: Identifier { + type: "Identifier", + name: "baz", + + range: [28, 31], + loc: { + start: { column: 28, line: 1 }, + end: { column: 31, line: 1 }, + }, + }, + + range: [28, 31], + loc: { + start: { column: 28, line: 1 }, + end: { column: 31, line: 1 }, + }, + }, + + range: [0, 31], + loc: { + start: { column: 0, line: 1 }, + end: { column: 31, line: 1 }, + }, + }, + + range: [0, 32], + loc: { + start: { column: 0, line: 1 }, + end: { column: 32, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 33], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/chained-satisfies/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/chained-satisfies/snapshots/4-Babel-Tokens.shot new file mode 100644 index 00000000000..5afc144ecef --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/chained-satisfies/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,66 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression chained-satisfies Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "foo", + + range: [0, 3], + loc: { + start: { column: 0, line: 1 }, + end: { column: 3, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "satisfies", + + range: [4, 13], + loc: { + start: { column: 4, line: 1 }, + end: { column: 13, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "bar", + + range: [14, 17], + loc: { + start: { column: 14, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "satisfies", + + range: [18, 27], + loc: { + start: { column: 18, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "baz", + + range: [28, 31], + loc: { + start: { column: 28, line: 1 }, + end: { column: 31, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [31, 32], + loc: { + start: { column: 31, line: 1 }, + end: { column: 32, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/chained-satisfies/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/chained-satisfies/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 00000000000..0d7d689095e --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/chained-satisfies/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression chained-satisfies AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/chained-satisfies/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/chained-satisfies/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 00000000000..b7cbaaf6bb8 --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/chained-satisfies/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression chained-satisfies AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/conditional-no-parentheses/fixture.ts b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/conditional-no-parentheses/fixture.ts new file mode 100644 index 00000000000..dc8407dc0d6 --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/conditional-no-parentheses/fixture.ts @@ -0,0 +1 @@ +foo ? 1 : (0 satisfies number); diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/conditional-no-parentheses/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/conditional-no-parentheses/snapshots/1-TSESTree-AST.shot new file mode 100644 index 00000000000..bb649ea977d --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/conditional-no-parentheses/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,84 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression conditional-no-parentheses TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: ConditionalExpression { + type: "ConditionalExpression", + alternate: TSSatisfiesExpression { + type: "TSSatisfiesExpression", + expression: Literal { + type: "Literal", + raw: "0", + value: 0, + + range: [11, 12], + loc: { + start: { column: 11, line: 1 }, + end: { column: 12, line: 1 }, + }, + }, + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [23, 29], + loc: { + start: { column: 23, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + + range: [11, 29], + loc: { + start: { column: 11, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + consequent: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [6, 7], + loc: { + start: { column: 6, line: 1 }, + end: { column: 7, line: 1 }, + }, + }, + test: Identifier { + type: "Identifier", + name: "foo", + + range: [0, 3], + loc: { + start: { column: 0, line: 1 }, + end: { column: 3, line: 1 }, + }, + }, + + range: [0, 30], + loc: { + start: { column: 0, line: 1 }, + end: { column: 30, line: 1 }, + }, + }, + + range: [0, 31], + loc: { + start: { column: 0, line: 1 }, + end: { column: 31, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 32], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/conditional-no-parentheses/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/conditional-no-parentheses/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 00000000000..43f6da6a680 --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/conditional-no-parentheses/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,106 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression conditional-no-parentheses TSESTree - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "foo", + + range: [0, 3], + loc: { + start: { column: 0, line: 1 }, + end: { column: 3, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [4, 5], + loc: { + start: { column: 4, line: 1 }, + end: { column: 5, line: 1 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [6, 7], + loc: { + start: { column: 6, line: 1 }, + end: { column: 7, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [8, 9], + loc: { + start: { column: 8, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + Numeric { + type: "Numeric", + value: "0", + + range: [11, 12], + loc: { + start: { column: 11, line: 1 }, + end: { column: 12, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "satisfies", + + range: [13, 22], + loc: { + start: { column: 13, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [23, 29], + loc: { + start: { column: 23, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [29, 30], + loc: { + start: { column: 29, 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/expression/TSSatisfiesExpression/fixtures/conditional-no-parentheses/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/conditional-no-parentheses/snapshots/3-Babel-AST.shot new file mode 100644 index 00000000000..4cba5b2f4f1 --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/conditional-no-parentheses/snapshots/3-Babel-AST.shot @@ -0,0 +1,84 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression conditional-no-parentheses Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: ConditionalExpression { + type: "ConditionalExpression", + alternate: TSSatisfiesExpression { + type: "TSSatisfiesExpression", + expression: Literal { + type: "Literal", + raw: "0", + value: 0, + + range: [11, 12], + loc: { + start: { column: 11, line: 1 }, + end: { column: 12, line: 1 }, + }, + }, + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [23, 29], + loc: { + start: { column: 23, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + + range: [11, 29], + loc: { + start: { column: 11, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + consequent: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [6, 7], + loc: { + start: { column: 6, line: 1 }, + end: { column: 7, line: 1 }, + }, + }, + test: Identifier { + type: "Identifier", + name: "foo", + + range: [0, 3], + loc: { + start: { column: 0, line: 1 }, + end: { column: 3, line: 1 }, + }, + }, + + range: [0, 30], + loc: { + start: { column: 0, line: 1 }, + end: { column: 30, line: 1 }, + }, + }, + + range: [0, 31], + loc: { + start: { column: 0, line: 1 }, + end: { column: 31, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 32], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/conditional-no-parentheses/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/conditional-no-parentheses/snapshots/4-Babel-Tokens.shot new file mode 100644 index 00000000000..80d8c6ce89e --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/conditional-no-parentheses/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,106 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression conditional-no-parentheses Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "foo", + + range: [0, 3], + loc: { + start: { column: 0, line: 1 }, + end: { column: 3, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [4, 5], + loc: { + start: { column: 4, line: 1 }, + end: { column: 5, line: 1 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [6, 7], + loc: { + start: { column: 6, line: 1 }, + end: { column: 7, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [8, 9], + loc: { + start: { column: 8, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [10, 11], + loc: { + start: { column: 10, line: 1 }, + end: { column: 11, line: 1 }, + }, + }, + Numeric { + type: "Numeric", + value: "0", + + range: [11, 12], + loc: { + start: { column: 11, line: 1 }, + end: { column: 12, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "satisfies", + + range: [13, 22], + loc: { + start: { column: 13, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [23, 29], + loc: { + start: { column: 23, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [29, 30], + loc: { + start: { column: 29, 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/expression/TSSatisfiesExpression/fixtures/conditional-no-parentheses/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/conditional-no-parentheses/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 00000000000..a35b55978ba --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/conditional-no-parentheses/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression conditional-no-parentheses AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/conditional-no-parentheses/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/conditional-no-parentheses/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 00000000000..220450772c1 --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/conditional-no-parentheses/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression conditional-no-parentheses AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/conditional-with-parentheses/fixture.ts b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/conditional-with-parentheses/fixture.ts new file mode 100644 index 00000000000..5c71ca2d0e6 --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/conditional-with-parentheses/fixture.ts @@ -0,0 +1 @@ +(foo ? 1 : 0) satisfies number; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/conditional-with-parentheses/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/conditional-with-parentheses/snapshots/1-TSESTree-AST.shot new file mode 100644 index 00000000000..2194d921890 --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/conditional-with-parentheses/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,84 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression conditional-with-parentheses TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: TSSatisfiesExpression { + type: "TSSatisfiesExpression", + expression: ConditionalExpression { + type: "ConditionalExpression", + alternate: Literal { + type: "Literal", + raw: "0", + value: 0, + + range: [11, 12], + loc: { + start: { column: 11, line: 1 }, + end: { column: 12, line: 1 }, + }, + }, + consequent: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [7, 8], + loc: { + start: { column: 7, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + test: Identifier { + type: "Identifier", + name: "foo", + + range: [1, 4], + loc: { + start: { column: 1, line: 1 }, + end: { column: 4, line: 1 }, + }, + }, + + range: [1, 12], + loc: { + start: { column: 1, line: 1 }, + end: { column: 12, line: 1 }, + }, + }, + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [24, 30], + loc: { + start: { column: 24, line: 1 }, + end: { column: 30, line: 1 }, + }, + }, + + range: [0, 30], + loc: { + start: { column: 0, line: 1 }, + end: { column: 30, line: 1 }, + }, + }, + + range: [0, 31], + loc: { + start: { column: 0, line: 1 }, + end: { column: 31, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 32], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/conditional-with-parentheses/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/conditional-with-parentheses/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 00000000000..09ed0254895 --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/conditional-with-parentheses/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,106 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression conditional-with-parentheses TSESTree - Tokens 1`] = ` +Array [ + Punctuator { + type: "Punctuator", + value: "(", + + range: [0, 1], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [1, 4], + loc: { + start: { column: 1, line: 1 }, + end: { column: 4, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [5, 6], + loc: { + start: { column: 5, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [7, 8], + loc: { + start: { column: 7, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + Numeric { + type: "Numeric", + value: "0", + + range: [11, 12], + loc: { + start: { column: 11, line: 1 }, + end: { column: 12, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [12, 13], + loc: { + start: { column: 12, line: 1 }, + end: { column: 13, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "satisfies", + + range: [14, 23], + loc: { + start: { column: 14, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [24, 30], + loc: { + start: { column: 24, 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/expression/TSSatisfiesExpression/fixtures/conditional-with-parentheses/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/conditional-with-parentheses/snapshots/3-Babel-AST.shot new file mode 100644 index 00000000000..39a9e9951ad --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/conditional-with-parentheses/snapshots/3-Babel-AST.shot @@ -0,0 +1,84 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression conditional-with-parentheses Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: TSSatisfiesExpression { + type: "TSSatisfiesExpression", + expression: ConditionalExpression { + type: "ConditionalExpression", + alternate: Literal { + type: "Literal", + raw: "0", + value: 0, + + range: [11, 12], + loc: { + start: { column: 11, line: 1 }, + end: { column: 12, line: 1 }, + }, + }, + consequent: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [7, 8], + loc: { + start: { column: 7, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + test: Identifier { + type: "Identifier", + name: "foo", + + range: [1, 4], + loc: { + start: { column: 1, line: 1 }, + end: { column: 4, line: 1 }, + }, + }, + + range: [1, 12], + loc: { + start: { column: 1, line: 1 }, + end: { column: 12, line: 1 }, + }, + }, + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [24, 30], + loc: { + start: { column: 24, line: 1 }, + end: { column: 30, line: 1 }, + }, + }, + + range: [0, 30], + loc: { + start: { column: 0, line: 1 }, + end: { column: 30, line: 1 }, + }, + }, + + range: [0, 31], + loc: { + start: { column: 0, line: 1 }, + end: { column: 31, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 32], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/conditional-with-parentheses/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/conditional-with-parentheses/snapshots/4-Babel-Tokens.shot new file mode 100644 index 00000000000..7ca2b46ad24 --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/conditional-with-parentheses/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,106 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression conditional-with-parentheses Babel - Tokens 1`] = ` +Array [ + Punctuator { + type: "Punctuator", + value: "(", + + range: [0, 1], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [1, 4], + loc: { + start: { column: 1, line: 1 }, + end: { column: 4, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "?", + + range: [5, 6], + loc: { + start: { column: 5, line: 1 }, + end: { column: 6, line: 1 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [7, 8], + loc: { + start: { column: 7, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + Numeric { + type: "Numeric", + value: "0", + + range: [11, 12], + loc: { + start: { column: 11, line: 1 }, + end: { column: 12, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [12, 13], + loc: { + start: { column: 12, line: 1 }, + end: { column: 13, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "satisfies", + + range: [14, 23], + loc: { + start: { column: 14, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [24, 30], + loc: { + start: { column: 24, 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/expression/TSSatisfiesExpression/fixtures/conditional-with-parentheses/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/conditional-with-parentheses/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 00000000000..45e35dfc272 --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/conditional-with-parentheses/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression conditional-with-parentheses AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/conditional-with-parentheses/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/conditional-with-parentheses/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 00000000000..36442e7ebdc --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/conditional-with-parentheses/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression conditional-with-parentheses AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-keyword/fixture.ts b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-keyword/fixture.ts new file mode 100644 index 00000000000..2ce6678d398 --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-keyword/fixture.ts @@ -0,0 +1 @@ +foo satisfies boolean; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-keyword/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-keyword/snapshots/1-TSESTree-AST.shot new file mode 100644 index 00000000000..7b7bb15a5af --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-keyword/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,53 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression identifier-keyword TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: TSSatisfiesExpression { + type: "TSSatisfiesExpression", + expression: Identifier { + type: "Identifier", + name: "foo", + + range: [0, 3], + loc: { + start: { column: 0, line: 1 }, + end: { column: 3, line: 1 }, + }, + }, + typeAnnotation: TSBooleanKeyword { + type: "TSBooleanKeyword", + + range: [14, 21], + loc: { + start: { column: 14, line: 1 }, + end: { column: 21, line: 1 }, + }, + }, + + range: [0, 21], + loc: { + start: { column: 0, line: 1 }, + end: { column: 21, line: 1 }, + }, + }, + + range: [0, 22], + loc: { + start: { column: 0, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 23], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-keyword/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-keyword/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 00000000000..3563bcb2809 --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-keyword/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,46 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression identifier-keyword TSESTree - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "foo", + + range: [0, 3], + loc: { + start: { column: 0, line: 1 }, + end: { column: 3, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "satisfies", + + range: [4, 13], + loc: { + start: { column: 4, line: 1 }, + end: { column: 13, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "boolean", + + range: [14, 21], + loc: { + start: { column: 14, line: 1 }, + end: { column: 21, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [21, 22], + loc: { + start: { column: 21, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-keyword/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-keyword/snapshots/3-Babel-AST.shot new file mode 100644 index 00000000000..8be9fb16653 --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-keyword/snapshots/3-Babel-AST.shot @@ -0,0 +1,53 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression identifier-keyword Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: TSSatisfiesExpression { + type: "TSSatisfiesExpression", + expression: Identifier { + type: "Identifier", + name: "foo", + + range: [0, 3], + loc: { + start: { column: 0, line: 1 }, + end: { column: 3, line: 1 }, + }, + }, + typeAnnotation: TSBooleanKeyword { + type: "TSBooleanKeyword", + + range: [14, 21], + loc: { + start: { column: 14, line: 1 }, + end: { column: 21, line: 1 }, + }, + }, + + range: [0, 21], + loc: { + start: { column: 0, line: 1 }, + end: { column: 21, line: 1 }, + }, + }, + + range: [0, 22], + loc: { + start: { column: 0, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 23], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-keyword/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-keyword/snapshots/4-Babel-Tokens.shot new file mode 100644 index 00000000000..2559a7666c6 --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-keyword/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,46 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression identifier-keyword Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "foo", + + range: [0, 3], + loc: { + start: { column: 0, line: 1 }, + end: { column: 3, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "satisfies", + + range: [4, 13], + loc: { + start: { column: 4, line: 1 }, + end: { column: 13, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "boolean", + + range: [14, 21], + loc: { + start: { column: 14, line: 1 }, + end: { column: 21, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [21, 22], + loc: { + start: { column: 21, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-keyword/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-keyword/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 00000000000..c167cbcb46b --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-keyword/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression identifier-keyword AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-keyword/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-keyword/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 00000000000..7dad93b1da3 --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-keyword/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression identifier-keyword AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-object-type/fixture.ts b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-object-type/fixture.ts new file mode 100644 index 00000000000..cdcca67f637 --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-object-type/fixture.ts @@ -0,0 +1 @@ +foo satisfies { prop: 'value' }; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-object-type/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-object-type/snapshots/1-TSESTree-AST.shot new file mode 100644 index 00000000000..6197262c7a0 --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-object-type/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,104 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression identifier-object-type TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: TSSatisfiesExpression { + type: "TSSatisfiesExpression", + expression: Identifier { + type: "Identifier", + name: "foo", + + range: [0, 3], + loc: { + start: { column: 0, line: 1 }, + end: { column: 3, line: 1 }, + }, + }, + typeAnnotation: TSTypeLiteral { + type: "TSTypeLiteral", + members: Array [ + TSPropertySignature { + type: "TSPropertySignature", + computed: false, + key: Identifier { + type: "Identifier", + name: "prop", + + range: [16, 20], + loc: { + start: { column: 16, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSLiteralType { + type: "TSLiteralType", + literal: Literal { + type: "Literal", + raw: "'value'", + value: "value", + + range: [22, 29], + loc: { + start: { column: 22, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + + range: [22, 29], + loc: { + start: { column: 22, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + + range: [20, 29], + loc: { + start: { column: 20, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + + range: [16, 29], + loc: { + start: { column: 16, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + ], + + range: [14, 31], + loc: { + start: { column: 14, line: 1 }, + end: { column: 31, line: 1 }, + }, + }, + + range: [0, 31], + loc: { + start: { column: 0, line: 1 }, + end: { column: 31, line: 1 }, + }, + }, + + range: [0, 32], + loc: { + start: { column: 0, line: 1 }, + end: { column: 32, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 33], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-object-type/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-object-type/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 00000000000..99673ea1ecf --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-object-type/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,86 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression identifier-object-type TSESTree - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "foo", + + range: [0, 3], + loc: { + start: { column: 0, line: 1 }, + end: { column: 3, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "satisfies", + + range: [4, 13], + loc: { + start: { column: 4, 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: "prop", + + range: [16, 20], + loc: { + start: { column: 16, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [20, 21], + loc: { + start: { column: 20, line: 1 }, + end: { column: 21, line: 1 }, + }, + }, + String { + type: "String", + value: "'value'", + + range: [22, 29], + loc: { + start: { column: 22, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [30, 31], + loc: { + start: { column: 30, line: 1 }, + end: { column: 31, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [31, 32], + loc: { + start: { column: 31, line: 1 }, + end: { column: 32, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-object-type/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-object-type/snapshots/3-Babel-AST.shot new file mode 100644 index 00000000000..a2861a34b1f --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-object-type/snapshots/3-Babel-AST.shot @@ -0,0 +1,104 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression identifier-object-type Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: TSSatisfiesExpression { + type: "TSSatisfiesExpression", + expression: Identifier { + type: "Identifier", + name: "foo", + + range: [0, 3], + loc: { + start: { column: 0, line: 1 }, + end: { column: 3, line: 1 }, + }, + }, + typeAnnotation: TSTypeLiteral { + type: "TSTypeLiteral", + members: Array [ + TSPropertySignature { + type: "TSPropertySignature", + computed: false, + key: Identifier { + type: "Identifier", + name: "prop", + + range: [16, 20], + loc: { + start: { column: 16, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSLiteralType { + type: "TSLiteralType", + literal: Literal { + type: "Literal", + raw: "'value'", + value: "value", + + range: [22, 29], + loc: { + start: { column: 22, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + + range: [22, 29], + loc: { + start: { column: 22, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + + range: [20, 29], + loc: { + start: { column: 20, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + + range: [16, 29], + loc: { + start: { column: 16, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + ], + + range: [14, 31], + loc: { + start: { column: 14, line: 1 }, + end: { column: 31, line: 1 }, + }, + }, + + range: [0, 31], + loc: { + start: { column: 0, line: 1 }, + end: { column: 31, line: 1 }, + }, + }, + + range: [0, 32], + loc: { + start: { column: 0, line: 1 }, + end: { column: 32, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 33], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-object-type/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-object-type/snapshots/4-Babel-Tokens.shot new file mode 100644 index 00000000000..34926c2bea7 --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-object-type/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,86 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression identifier-object-type Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "foo", + + range: [0, 3], + loc: { + start: { column: 0, line: 1 }, + end: { column: 3, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "satisfies", + + range: [4, 13], + loc: { + start: { column: 4, 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: "prop", + + range: [16, 20], + loc: { + start: { column: 16, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [20, 21], + loc: { + start: { column: 20, line: 1 }, + end: { column: 21, line: 1 }, + }, + }, + String { + type: "String", + value: "'value'", + + range: [22, 29], + loc: { + start: { column: 22, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [30, 31], + loc: { + start: { column: 30, line: 1 }, + end: { column: 31, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [31, 32], + loc: { + start: { column: 31, line: 1 }, + end: { column: 32, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-object-type/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-object-type/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 00000000000..8e025552275 --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-object-type/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression identifier-object-type AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-object-type/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-object-type/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 00000000000..bfb99b63e1c --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-object-type/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression identifier-object-type AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-tuple-type/fixture.ts b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-tuple-type/fixture.ts new file mode 100644 index 00000000000..266a2ad0836 --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-tuple-type/fixture.ts @@ -0,0 +1 @@ +foo satisfies [1, 2, 3]; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-tuple-type/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-tuple-type/snapshots/1-TSESTree-AST.shot new file mode 100644 index 00000000000..57c80c5a805 --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-tuple-type/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,115 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression identifier-tuple-type TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: TSSatisfiesExpression { + type: "TSSatisfiesExpression", + expression: Identifier { + type: "Identifier", + name: "foo", + + range: [0, 3], + loc: { + start: { column: 0, line: 1 }, + end: { column: 3, line: 1 }, + }, + }, + typeAnnotation: TSTupleType { + type: "TSTupleType", + elementTypes: Array [ + TSLiteralType { + type: "TSLiteralType", + literal: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [15, 16], + loc: { + start: { column: 15, line: 1 }, + end: { column: 16, line: 1 }, + }, + }, + + range: [15, 16], + loc: { + start: { column: 15, line: 1 }, + end: { column: 16, line: 1 }, + }, + }, + TSLiteralType { + type: "TSLiteralType", + literal: Literal { + type: "Literal", + raw: "2", + value: 2, + + range: [18, 19], + loc: { + start: { column: 18, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + + range: [18, 19], + loc: { + start: { column: 18, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + TSLiteralType { + type: "TSLiteralType", + literal: Literal { + type: "Literal", + raw: "3", + value: 3, + + range: [21, 22], + loc: { + start: { column: 21, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + + range: [21, 22], + loc: { + start: { column: 21, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + ], + + range: [14, 23], + loc: { + start: { column: 14, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, + + range: [0, 23], + loc: { + start: { column: 0, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, + + range: [0, 24], + loc: { + start: { column: 0, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 25], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-tuple-type/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-tuple-type/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 00000000000..07ece3eadee --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-tuple-type/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,106 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression identifier-tuple-type TSESTree - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "foo", + + range: [0, 3], + loc: { + start: { column: 0, line: 1 }, + end: { column: 3, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "satisfies", + + range: [4, 13], + loc: { + start: { column: 4, 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 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [15, 16], + loc: { + start: { column: 15, line: 1 }, + end: { column: 16, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [16, 17], + loc: { + start: { column: 16, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + Numeric { + type: "Numeric", + value: "2", + + 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 }, + }, + }, + Numeric { + type: "Numeric", + value: "3", + + range: [21, 22], + loc: { + start: { column: 21, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [22, 23], + loc: { + start: { column: 22, 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/expression/TSSatisfiesExpression/fixtures/identifier-tuple-type/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-tuple-type/snapshots/3-Babel-AST.shot new file mode 100644 index 00000000000..7201de5d38f --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-tuple-type/snapshots/3-Babel-AST.shot @@ -0,0 +1,115 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression identifier-tuple-type Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: TSSatisfiesExpression { + type: "TSSatisfiesExpression", + expression: Identifier { + type: "Identifier", + name: "foo", + + range: [0, 3], + loc: { + start: { column: 0, line: 1 }, + end: { column: 3, line: 1 }, + }, + }, + typeAnnotation: TSTupleType { + type: "TSTupleType", + elementTypes: Array [ + TSLiteralType { + type: "TSLiteralType", + literal: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [15, 16], + loc: { + start: { column: 15, line: 1 }, + end: { column: 16, line: 1 }, + }, + }, + + range: [15, 16], + loc: { + start: { column: 15, line: 1 }, + end: { column: 16, line: 1 }, + }, + }, + TSLiteralType { + type: "TSLiteralType", + literal: Literal { + type: "Literal", + raw: "2", + value: 2, + + range: [18, 19], + loc: { + start: { column: 18, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + + range: [18, 19], + loc: { + start: { column: 18, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + TSLiteralType { + type: "TSLiteralType", + literal: Literal { + type: "Literal", + raw: "3", + value: 3, + + range: [21, 22], + loc: { + start: { column: 21, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + + range: [21, 22], + loc: { + start: { column: 21, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + ], + + range: [14, 23], + loc: { + start: { column: 14, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, + + range: [0, 23], + loc: { + start: { column: 0, line: 1 }, + end: { column: 23, line: 1 }, + }, + }, + + range: [0, 24], + loc: { + start: { column: 0, line: 1 }, + end: { column: 24, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 25], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-tuple-type/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-tuple-type/snapshots/4-Babel-Tokens.shot new file mode 100644 index 00000000000..8a62c8d0380 --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-tuple-type/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,106 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression identifier-tuple-type Babel - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "foo", + + range: [0, 3], + loc: { + start: { column: 0, line: 1 }, + end: { column: 3, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "satisfies", + + range: [4, 13], + loc: { + start: { column: 4, 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 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [15, 16], + loc: { + start: { column: 15, line: 1 }, + end: { column: 16, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ",", + + range: [16, 17], + loc: { + start: { column: 16, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + Numeric { + type: "Numeric", + value: "2", + + 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 }, + }, + }, + Numeric { + type: "Numeric", + value: "3", + + range: [21, 22], + loc: { + start: { column: 21, line: 1 }, + end: { column: 22, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "]", + + range: [22, 23], + loc: { + start: { column: 22, 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/expression/TSSatisfiesExpression/fixtures/identifier-tuple-type/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-tuple-type/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 00000000000..eb993d611eb --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-tuple-type/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression identifier-tuple-type AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-tuple-type/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-tuple-type/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 00000000000..3f0aa9841e8 --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/identifier-tuple-type/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression identifier-tuple-type AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/logical-no-parentheses/fixture.ts b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/logical-no-parentheses/fixture.ts new file mode 100644 index 00000000000..953653b0e23 --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/logical-no-parentheses/fixture.ts @@ -0,0 +1 @@ +foo === (1 satisfies number); diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/logical-no-parentheses/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/logical-no-parentheses/snapshots/1-TSESTree-AST.shot new file mode 100644 index 00000000000..1ad1131264a --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/logical-no-parentheses/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,74 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression logical-no-parentheses TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: BinaryExpression { + type: "BinaryExpression", + left: Identifier { + type: "Identifier", + name: "foo", + + range: [0, 3], + loc: { + start: { column: 0, line: 1 }, + end: { column: 3, line: 1 }, + }, + }, + operator: "===", + right: TSSatisfiesExpression { + type: "TSSatisfiesExpression", + expression: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [21, 27], + loc: { + start: { column: 21, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, + + range: [9, 27], + loc: { + start: { column: 9, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, + + range: [0, 28], + loc: { + start: { column: 0, line: 1 }, + end: { column: 28, line: 1 }, + }, + }, + + range: [0, 29], + loc: { + start: { column: 0, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 30], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/logical-no-parentheses/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/logical-no-parentheses/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 00000000000..f5e333ee1db --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/logical-no-parentheses/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,86 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression logical-no-parentheses TSESTree - Tokens 1`] = ` +Array [ + Identifier { + type: "Identifier", + value: "foo", + + range: [0, 3], + loc: { + start: { column: 0, line: 1 }, + end: { column: 3, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "===", + + range: [4, 7], + loc: { + start: { column: 4, line: 1 }, + end: { column: 7, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "(", + + range: [8, 9], + loc: { + start: { column: 8, line: 1 }, + end: { column: 9, line: 1 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "satisfies", + + range: [11, 20], + loc: { + start: { column: 11, line: 1 }, + end: { column: 20, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "number", + + range: [21, 27], + loc: { + start: { column: 21, 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 }, + }, + }, + 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/expression/TSSatisfiesExpression/fixtures/logical-no-parentheses/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/logical-no-parentheses/snapshots/3-Babel-AST.shot new file mode 100644 index 00000000000..a2add050375 --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/logical-no-parentheses/snapshots/3-Babel-AST.shot @@ -0,0 +1,74 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression logical-no-parentheses Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: BinaryExpression { + type: "BinaryExpression", + left: Identifier { + type: "Identifier", + name: "foo", + + range: [0, 3], + loc: { + start: { column: 0, line: 1 }, + end: { column: 3, line: 1 }, + }, + }, + operator: "===", + right: TSSatisfiesExpression { + type: "TSSatisfiesExpression", + expression: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + typeAnnotation: TSNumberKeyword { + type: "TSNumberKeyword", + + range: [21, 27], + loc: { + start: { column: 21, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, + + range: [9, 27], + loc: { + start: { column: 9, line: 1 }, + end: { column: 27, line: 1 }, + }, + }, + + range: [0, 28], + loc: { + start: { column: 0, line: 1 }, + end: { column: 28, line: 1 }, + }, + }, + + range: [0, 29], + loc: { + start: { column: 0, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 30], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/async/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/logical-no-parentheses/snapshots/4-Babel-Tokens.shot similarity index 56% rename from packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/async/snapshots/2-TSESTree-Tokens.shot rename to packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/logical-no-parentheses/snapshots/4-Babel-Tokens.shot index 57b56f38b08..e4fa1f6cea5 100644 --- a/packages/ast-spec/src/declaration/TSDeclareFunction/fixtures/_error_/async/snapshots/2-TSESTree-Tokens.shot +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/logical-no-parentheses/snapshots/4-Babel-Tokens.shot @@ -1,54 +1,64 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`AST Fixtures declaration TSDeclareFunction async TSESTree - Tokens 1`] = ` +exports[`AST Fixtures expression TSSatisfiesExpression logical-no-parentheses Babel - Tokens 1`] = ` Array [ Identifier { type: "Identifier", - value: "declare", + value: "foo", - range: [0, 7], + range: [0, 3], loc: { start: { column: 0, line: 1 }, + end: { column: 3, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "===", + + range: [4, 7], + loc: { + start: { column: 4, line: 1 }, end: { column: 7, line: 1 }, }, }, - Identifier { - type: "Identifier", - value: "async", + Punctuator { + type: "Punctuator", + value: "(", - range: [8, 13], + range: [8, 9], loc: { start: { column: 8, line: 1 }, - end: { column: 13, line: 1 }, + end: { column: 9, line: 1 }, }, }, - Keyword { - type: "Keyword", - value: "function", + Numeric { + type: "Numeric", + value: "1", - range: [14, 22], + range: [9, 10], loc: { - start: { column: 14, line: 1 }, - end: { column: 22, line: 1 }, + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, }, }, Identifier { type: "Identifier", - value: "foo", + value: "satisfies", - range: [23, 26], + range: [11, 20], loc: { - start: { column: 23, line: 1 }, - end: { column: 26, line: 1 }, + start: { column: 11, line: 1 }, + end: { column: 20, line: 1 }, }, }, - Punctuator { - type: "Punctuator", - value: "(", + Identifier { + type: "Identifier", + value: "number", - range: [26, 27], + range: [21, 27], loc: { - start: { column: 26, line: 1 }, + start: { column: 21, line: 1 }, end: { column: 27, line: 1 }, }, }, diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/logical-no-parentheses/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/logical-no-parentheses/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 00000000000..a21b35204c9 --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/logical-no-parentheses/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression logical-no-parentheses AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/logical-no-parentheses/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/logical-no-parentheses/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 00000000000..6a3c807848a --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/logical-no-parentheses/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression logical-no-parentheses AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/logical-with-parentheses/fixture.ts b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/logical-with-parentheses/fixture.ts new file mode 100644 index 00000000000..a93f5746e7c --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/logical-with-parentheses/fixture.ts @@ -0,0 +1 @@ +(foo === 1) satisfies boolean; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/logical-with-parentheses/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/logical-with-parentheses/snapshots/1-TSESTree-AST.shot new file mode 100644 index 00000000000..4401893b67e --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/logical-with-parentheses/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,74 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression logical-with-parentheses TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: TSSatisfiesExpression { + type: "TSSatisfiesExpression", + expression: BinaryExpression { + type: "BinaryExpression", + left: Identifier { + type: "Identifier", + name: "foo", + + range: [1, 4], + loc: { + start: { column: 1, line: 1 }, + end: { column: 4, line: 1 }, + }, + }, + operator: "===", + right: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + + range: [1, 10], + loc: { + start: { column: 1, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + typeAnnotation: TSBooleanKeyword { + type: "TSBooleanKeyword", + + range: [22, 29], + loc: { + start: { column: 22, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + + range: [0, 29], + loc: { + start: { column: 0, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + + range: [0, 30], + loc: { + start: { column: 0, line: 1 }, + end: { column: 30, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 31], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/logical-with-parentheses/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/logical-with-parentheses/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 00000000000..7034fce1187 --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/logical-with-parentheses/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,86 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression logical-with-parentheses TSESTree - Tokens 1`] = ` +Array [ + Punctuator { + type: "Punctuator", + value: "(", + + range: [0, 1], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [1, 4], + loc: { + start: { column: 1, line: 1 }, + end: { column: 4, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "===", + + range: [5, 8], + loc: { + start: { column: 5, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + 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: "satisfies", + + range: [12, 21], + loc: { + start: { column: 12, line: 1 }, + end: { column: 21, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "boolean", + + range: [22, 29], + loc: { + start: { column: 22, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [29, 30], + loc: { + start: { column: 29, line: 1 }, + end: { column: 30, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/logical-with-parentheses/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/logical-with-parentheses/snapshots/3-Babel-AST.shot new file mode 100644 index 00000000000..fb10fc5442e --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/logical-with-parentheses/snapshots/3-Babel-AST.shot @@ -0,0 +1,74 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression logical-with-parentheses Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: TSSatisfiesExpression { + type: "TSSatisfiesExpression", + expression: BinaryExpression { + type: "BinaryExpression", + left: Identifier { + type: "Identifier", + name: "foo", + + range: [1, 4], + loc: { + start: { column: 1, line: 1 }, + end: { column: 4, line: 1 }, + }, + }, + operator: "===", + right: Literal { + type: "Literal", + raw: "1", + value: 1, + + range: [9, 10], + loc: { + start: { column: 9, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + + range: [1, 10], + loc: { + start: { column: 1, line: 1 }, + end: { column: 10, line: 1 }, + }, + }, + typeAnnotation: TSBooleanKeyword { + type: "TSBooleanKeyword", + + range: [22, 29], + loc: { + start: { column: 22, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + + range: [0, 29], + loc: { + start: { column: 0, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + + range: [0, 30], + loc: { + start: { column: 0, line: 1 }, + end: { column: 30, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 31], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/logical-with-parentheses/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/logical-with-parentheses/snapshots/4-Babel-Tokens.shot new file mode 100644 index 00000000000..4c73b5cc818 --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/logical-with-parentheses/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,86 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression logical-with-parentheses Babel - Tokens 1`] = ` +Array [ + Punctuator { + type: "Punctuator", + value: "(", + + range: [0, 1], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "foo", + + range: [1, 4], + loc: { + start: { column: 1, line: 1 }, + end: { column: 4, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "===", + + range: [5, 8], + loc: { + start: { column: 5, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + Numeric { + type: "Numeric", + value: "1", + + 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: "satisfies", + + range: [12, 21], + loc: { + start: { column: 12, line: 1 }, + end: { column: 21, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "boolean", + + range: [22, 29], + loc: { + start: { column: 22, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [29, 30], + loc: { + start: { column: 29, line: 1 }, + end: { column: 30, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/logical-with-parentheses/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/logical-with-parentheses/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 00000000000..28594822212 --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/logical-with-parentheses/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression logical-with-parentheses AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/logical-with-parentheses/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/logical-with-parentheses/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 00000000000..b6881fd10cf --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/logical-with-parentheses/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression logical-with-parentheses AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-inner-parentheses/fixture.ts b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-inner-parentheses/fixture.ts new file mode 100644 index 00000000000..b7726f7f140 --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-inner-parentheses/fixture.ts @@ -0,0 +1 @@ +({ prop: 'string' } satisfies { prop: string }); diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-inner-parentheses/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-inner-parentheses/snapshots/1-TSESTree-AST.shot new file mode 100644 index 00000000000..c39ffc049d1 --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-inner-parentheses/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,128 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression object-object-inner-parentheses TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: TSSatisfiesExpression { + type: "TSSatisfiesExpression", + expression: ObjectExpression { + type: "ObjectExpression", + properties: Array [ + Property { + type: "Property", + computed: false, + key: Identifier { + type: "Identifier", + name: "prop", + + range: [3, 7], + loc: { + start: { column: 3, line: 1 }, + end: { column: 7, line: 1 }, + }, + }, + kind: "init", + method: false, + shorthand: false, + value: Literal { + type: "Literal", + raw: "'string'", + value: "string", + + range: [9, 17], + loc: { + start: { column: 9, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + + range: [3, 17], + loc: { + start: { column: 3, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + ], + + range: [1, 19], + loc: { + start: { column: 1, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + typeAnnotation: TSTypeLiteral { + type: "TSTypeLiteral", + members: Array [ + TSPropertySignature { + type: "TSPropertySignature", + computed: false, + key: Identifier { + type: "Identifier", + name: "prop", + + range: [32, 36], + loc: { + start: { column: 32, line: 1 }, + end: { column: 36, line: 1 }, + }, + }, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [38, 44], + loc: { + start: { column: 38, line: 1 }, + end: { column: 44, line: 1 }, + }, + }, + + range: [36, 44], + loc: { + start: { column: 36, line: 1 }, + end: { column: 44, line: 1 }, + }, + }, + + range: [32, 44], + loc: { + start: { column: 32, line: 1 }, + end: { column: 44, line: 1 }, + }, + }, + ], + + range: [30, 46], + loc: { + start: { column: 30, line: 1 }, + end: { column: 46, line: 1 }, + }, + }, + + range: [1, 46], + loc: { + start: { column: 1, line: 1 }, + end: { column: 46, line: 1 }, + }, + }, + + range: [0, 48], + loc: { + start: { column: 0, line: 1 }, + end: { column: 48, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 49], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-inner-parentheses/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-inner-parentheses/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 00000000000..be50e77f271 --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-inner-parentheses/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,146 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression object-object-inner-parentheses TSESTree - Tokens 1`] = ` +Array [ + Punctuator { + type: "Punctuator", + value: "(", + + range: [0, 1], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [1, 2], + loc: { + start: { column: 1, line: 1 }, + end: { column: 2, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "prop", + + range: [3, 7], + loc: { + start: { column: 3, line: 1 }, + end: { column: 7, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [7, 8], + loc: { + start: { column: 7, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + String { + type: "String", + value: "'string'", + + range: [9, 17], + loc: { + start: { column: 9, 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: "satisfies", + + range: [20, 29], + loc: { + start: { column: 20, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [30, 31], + loc: { + start: { column: 30, line: 1 }, + end: { column: 31, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "prop", + + range: [32, 36], + loc: { + start: { column: 32, 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 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [38, 44], + loc: { + start: { column: 38, line: 1 }, + end: { column: 44, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [45, 46], + loc: { + start: { column: 45, line: 1 }, + end: { column: 46, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [46, 47], + loc: { + start: { column: 46, line: 1 }, + end: { column: 47, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [47, 48], + loc: { + start: { column: 47, line: 1 }, + end: { column: 48, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-inner-parentheses/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-inner-parentheses/snapshots/3-Babel-AST.shot new file mode 100644 index 00000000000..90c569abf82 --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-inner-parentheses/snapshots/3-Babel-AST.shot @@ -0,0 +1,128 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression object-object-inner-parentheses Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: TSSatisfiesExpression { + type: "TSSatisfiesExpression", + expression: ObjectExpression { + type: "ObjectExpression", + properties: Array [ + Property { + type: "Property", + computed: false, + key: Identifier { + type: "Identifier", + name: "prop", + + range: [3, 7], + loc: { + start: { column: 3, line: 1 }, + end: { column: 7, line: 1 }, + }, + }, + kind: "init", + method: false, + shorthand: false, + value: Literal { + type: "Literal", + raw: "'string'", + value: "string", + + range: [9, 17], + loc: { + start: { column: 9, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + + range: [3, 17], + loc: { + start: { column: 3, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + ], + + range: [1, 19], + loc: { + start: { column: 1, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + typeAnnotation: TSTypeLiteral { + type: "TSTypeLiteral", + members: Array [ + TSPropertySignature { + type: "TSPropertySignature", + computed: false, + key: Identifier { + type: "Identifier", + name: "prop", + + range: [32, 36], + loc: { + start: { column: 32, line: 1 }, + end: { column: 36, line: 1 }, + }, + }, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [38, 44], + loc: { + start: { column: 38, line: 1 }, + end: { column: 44, line: 1 }, + }, + }, + + range: [36, 44], + loc: { + start: { column: 36, line: 1 }, + end: { column: 44, line: 1 }, + }, + }, + + range: [32, 44], + loc: { + start: { column: 32, line: 1 }, + end: { column: 44, line: 1 }, + }, + }, + ], + + range: [30, 46], + loc: { + start: { column: 30, line: 1 }, + end: { column: 46, line: 1 }, + }, + }, + + range: [1, 46], + loc: { + start: { column: 1, line: 1 }, + end: { column: 46, line: 1 }, + }, + }, + + range: [0, 48], + loc: { + start: { column: 0, line: 1 }, + end: { column: 48, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 49], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-inner-parentheses/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-inner-parentheses/snapshots/4-Babel-Tokens.shot new file mode 100644 index 00000000000..45fc90349da --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-inner-parentheses/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,146 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression object-object-inner-parentheses Babel - Tokens 1`] = ` +Array [ + Punctuator { + type: "Punctuator", + value: "(", + + range: [0, 1], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [1, 2], + loc: { + start: { column: 1, line: 1 }, + end: { column: 2, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "prop", + + range: [3, 7], + loc: { + start: { column: 3, line: 1 }, + end: { column: 7, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [7, 8], + loc: { + start: { column: 7, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + String { + type: "String", + value: "'string'", + + range: [9, 17], + loc: { + start: { column: 9, 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: "satisfies", + + range: [20, 29], + loc: { + start: { column: 20, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [30, 31], + loc: { + start: { column: 30, line: 1 }, + end: { column: 31, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "prop", + + range: [32, 36], + loc: { + start: { column: 32, 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 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [38, 44], + loc: { + start: { column: 38, line: 1 }, + end: { column: 44, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [45, 46], + loc: { + start: { column: 45, line: 1 }, + end: { column: 46, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [46, 47], + loc: { + start: { column: 46, line: 1 }, + end: { column: 47, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [47, 48], + loc: { + start: { column: 47, line: 1 }, + end: { column: 48, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-inner-parentheses/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-inner-parentheses/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 00000000000..bad308efe92 --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-inner-parentheses/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression object-object-inner-parentheses AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-inner-parentheses/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-inner-parentheses/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 00000000000..92a052f3254 --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-inner-parentheses/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression object-object-inner-parentheses AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-outer-parentheses/fixture.ts b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-outer-parentheses/fixture.ts new file mode 100644 index 00000000000..b7726f7f140 --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-outer-parentheses/fixture.ts @@ -0,0 +1 @@ +({ prop: 'string' } satisfies { prop: string }); diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-outer-parentheses/snapshots/1-TSESTree-AST.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-outer-parentheses/snapshots/1-TSESTree-AST.shot new file mode 100644 index 00000000000..9100755681a --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-outer-parentheses/snapshots/1-TSESTree-AST.shot @@ -0,0 +1,128 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression object-object-outer-parentheses TSESTree - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: TSSatisfiesExpression { + type: "TSSatisfiesExpression", + expression: ObjectExpression { + type: "ObjectExpression", + properties: Array [ + Property { + type: "Property", + computed: false, + key: Identifier { + type: "Identifier", + name: "prop", + + range: [3, 7], + loc: { + start: { column: 3, line: 1 }, + end: { column: 7, line: 1 }, + }, + }, + kind: "init", + method: false, + shorthand: false, + value: Literal { + type: "Literal", + raw: "'string'", + value: "string", + + range: [9, 17], + loc: { + start: { column: 9, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + + range: [3, 17], + loc: { + start: { column: 3, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + ], + + range: [1, 19], + loc: { + start: { column: 1, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + typeAnnotation: TSTypeLiteral { + type: "TSTypeLiteral", + members: Array [ + TSPropertySignature { + type: "TSPropertySignature", + computed: false, + key: Identifier { + type: "Identifier", + name: "prop", + + range: [32, 36], + loc: { + start: { column: 32, line: 1 }, + end: { column: 36, line: 1 }, + }, + }, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [38, 44], + loc: { + start: { column: 38, line: 1 }, + end: { column: 44, line: 1 }, + }, + }, + + range: [36, 44], + loc: { + start: { column: 36, line: 1 }, + end: { column: 44, line: 1 }, + }, + }, + + range: [32, 44], + loc: { + start: { column: 32, line: 1 }, + end: { column: 44, line: 1 }, + }, + }, + ], + + range: [30, 46], + loc: { + start: { column: 30, line: 1 }, + end: { column: 46, line: 1 }, + }, + }, + + range: [1, 46], + loc: { + start: { column: 1, line: 1 }, + end: { column: 46, line: 1 }, + }, + }, + + range: [0, 48], + loc: { + start: { column: 0, line: 1 }, + end: { column: 48, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 49], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-outer-parentheses/snapshots/2-TSESTree-Tokens.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-outer-parentheses/snapshots/2-TSESTree-Tokens.shot new file mode 100644 index 00000000000..388f2790bb0 --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-outer-parentheses/snapshots/2-TSESTree-Tokens.shot @@ -0,0 +1,146 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression object-object-outer-parentheses TSESTree - Tokens 1`] = ` +Array [ + Punctuator { + type: "Punctuator", + value: "(", + + range: [0, 1], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [1, 2], + loc: { + start: { column: 1, line: 1 }, + end: { column: 2, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "prop", + + range: [3, 7], + loc: { + start: { column: 3, line: 1 }, + end: { column: 7, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [7, 8], + loc: { + start: { column: 7, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + String { + type: "String", + value: "'string'", + + range: [9, 17], + loc: { + start: { column: 9, 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: "satisfies", + + range: [20, 29], + loc: { + start: { column: 20, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [30, 31], + loc: { + start: { column: 30, line: 1 }, + end: { column: 31, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "prop", + + range: [32, 36], + loc: { + start: { column: 32, 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 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [38, 44], + loc: { + start: { column: 38, line: 1 }, + end: { column: 44, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [45, 46], + loc: { + start: { column: 45, line: 1 }, + end: { column: 46, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [46, 47], + loc: { + start: { column: 46, line: 1 }, + end: { column: 47, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [47, 48], + loc: { + start: { column: 47, line: 1 }, + end: { column: 48, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-outer-parentheses/snapshots/3-Babel-AST.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-outer-parentheses/snapshots/3-Babel-AST.shot new file mode 100644 index 00000000000..16adf4fa64a --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-outer-parentheses/snapshots/3-Babel-AST.shot @@ -0,0 +1,128 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression object-object-outer-parentheses Babel - AST 1`] = ` +Program { + type: "Program", + body: Array [ + ExpressionStatement { + type: "ExpressionStatement", + expression: TSSatisfiesExpression { + type: "TSSatisfiesExpression", + expression: ObjectExpression { + type: "ObjectExpression", + properties: Array [ + Property { + type: "Property", + computed: false, + key: Identifier { + type: "Identifier", + name: "prop", + + range: [3, 7], + loc: { + start: { column: 3, line: 1 }, + end: { column: 7, line: 1 }, + }, + }, + kind: "init", + method: false, + shorthand: false, + value: Literal { + type: "Literal", + raw: "'string'", + value: "string", + + range: [9, 17], + loc: { + start: { column: 9, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + + range: [3, 17], + loc: { + start: { column: 3, line: 1 }, + end: { column: 17, line: 1 }, + }, + }, + ], + + range: [1, 19], + loc: { + start: { column: 1, line: 1 }, + end: { column: 19, line: 1 }, + }, + }, + typeAnnotation: TSTypeLiteral { + type: "TSTypeLiteral", + members: Array [ + TSPropertySignature { + type: "TSPropertySignature", + computed: false, + key: Identifier { + type: "Identifier", + name: "prop", + + range: [32, 36], + loc: { + start: { column: 32, line: 1 }, + end: { column: 36, line: 1 }, + }, + }, + typeAnnotation: TSTypeAnnotation { + type: "TSTypeAnnotation", + typeAnnotation: TSStringKeyword { + type: "TSStringKeyword", + + range: [38, 44], + loc: { + start: { column: 38, line: 1 }, + end: { column: 44, line: 1 }, + }, + }, + + range: [36, 44], + loc: { + start: { column: 36, line: 1 }, + end: { column: 44, line: 1 }, + }, + }, + + range: [32, 44], + loc: { + start: { column: 32, line: 1 }, + end: { column: 44, line: 1 }, + }, + }, + ], + + range: [30, 46], + loc: { + start: { column: 30, line: 1 }, + end: { column: 46, line: 1 }, + }, + }, + + range: [1, 46], + loc: { + start: { column: 1, line: 1 }, + end: { column: 46, line: 1 }, + }, + }, + + range: [0, 48], + loc: { + start: { column: 0, line: 1 }, + end: { column: 48, line: 1 }, + }, + }, + ], + sourceType: "script", + + range: [0, 49], + loc: { + start: { column: 0, line: 1 }, + end: { column: 0, line: 2 }, + }, +} +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-outer-parentheses/snapshots/4-Babel-Tokens.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-outer-parentheses/snapshots/4-Babel-Tokens.shot new file mode 100644 index 00000000000..bdca107f453 --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-outer-parentheses/snapshots/4-Babel-Tokens.shot @@ -0,0 +1,146 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression object-object-outer-parentheses Babel - Tokens 1`] = ` +Array [ + Punctuator { + type: "Punctuator", + value: "(", + + range: [0, 1], + loc: { + start: { column: 0, line: 1 }, + end: { column: 1, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [1, 2], + loc: { + start: { column: 1, line: 1 }, + end: { column: 2, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "prop", + + range: [3, 7], + loc: { + start: { column: 3, line: 1 }, + end: { column: 7, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ":", + + range: [7, 8], + loc: { + start: { column: 7, line: 1 }, + end: { column: 8, line: 1 }, + }, + }, + String { + type: "String", + value: "'string'", + + range: [9, 17], + loc: { + start: { column: 9, 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: "satisfies", + + range: [20, 29], + loc: { + start: { column: 20, line: 1 }, + end: { column: 29, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "{", + + range: [30, 31], + loc: { + start: { column: 30, line: 1 }, + end: { column: 31, line: 1 }, + }, + }, + Identifier { + type: "Identifier", + value: "prop", + + range: [32, 36], + loc: { + start: { column: 32, 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 }, + }, + }, + Identifier { + type: "Identifier", + value: "string", + + range: [38, 44], + loc: { + start: { column: 38, line: 1 }, + end: { column: 44, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: "}", + + range: [45, 46], + loc: { + start: { column: 45, line: 1 }, + end: { column: 46, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ")", + + range: [46, 47], + loc: { + start: { column: 46, line: 1 }, + end: { column: 47, line: 1 }, + }, + }, + Punctuator { + type: "Punctuator", + value: ";", + + range: [47, 48], + loc: { + start: { column: 47, line: 1 }, + end: { column: 48, line: 1 }, + }, + }, +] +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-outer-parentheses/snapshots/5-AST-Alignment-AST.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-outer-parentheses/snapshots/5-AST-Alignment-AST.shot new file mode 100644 index 00000000000..982ccda73a2 --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-outer-parentheses/snapshots/5-AST-Alignment-AST.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression object-object-outer-parentheses AST Alignment - AST 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-outer-parentheses/snapshots/6-AST-Alignment-Tokens.shot b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-outer-parentheses/snapshots/6-AST-Alignment-Tokens.shot new file mode 100644 index 00000000000..c113b8be7e9 --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/fixtures/object-object-outer-parentheses/snapshots/6-AST-Alignment-Tokens.shot @@ -0,0 +1,6 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures expression TSSatisfiesExpression object-object-outer-parentheses AST Alignment - Token 1`] = ` +"Snapshot Diff: +Compared values have no visual difference." +`; diff --git a/packages/ast-spec/src/expression/TSSatisfiesExpression/spec.ts b/packages/ast-spec/src/expression/TSSatisfiesExpression/spec.ts new file mode 100644 index 00000000000..1297ade3eba --- /dev/null +++ b/packages/ast-spec/src/expression/TSSatisfiesExpression/spec.ts @@ -0,0 +1,10 @@ +import type { AST_NODE_TYPES } from '../../ast-node-types'; +import type { BaseNode } from '../../base/BaseNode'; +import type { Expression } from '../../unions/Expression'; +import type { TypeNode } from '../../unions/TypeNode'; + +export interface TSSatisfiesExpression extends BaseNode { + type: AST_NODE_TYPES.TSSatisfiesExpression; + expression: Expression; + typeAnnotation: TypeNode; +} diff --git a/packages/ast-spec/src/expression/spec.ts b/packages/ast-spec/src/expression/spec.ts index 9ed4a0cc756..f753672d472 100644 --- a/packages/ast-spec/src/expression/spec.ts +++ b/packages/ast-spec/src/expression/spec.ts @@ -23,6 +23,7 @@ export * from './TSAsExpression/spec'; export * from './TSEmptyBodyFunctionExpression/spec'; export * from './TSInstantiationExpression/spec'; export * from './TSNonNullExpression/spec'; +export * from './TSSatisfiesExpression/spec'; export * from './TSTypeAssertion/spec'; export * from './TaggedTemplateExpression/spec'; export * from './TemplateLiteral/spec'; diff --git a/packages/ast-spec/src/token/spec.ts b/packages/ast-spec/src/token/spec.ts index 45df05189eb..3cffaf49e83 100644 --- a/packages/ast-spec/src/token/spec.ts +++ b/packages/ast-spec/src/token/spec.ts @@ -10,13 +10,4 @@ export * from './NumericToken/spec'; export * from './PunctuatorToken/spec'; export * from './RegularExpressionToken/spec'; export * from './StringToken/spec'; -export * from './TSAbstractKeyword/spec'; -export * from './TSAsyncKeyword/spec'; -export * from './TSDeclareKeyword/spec'; -export * from './TSExportKeyword/spec'; -export * from './TSPrivateKeyword/spec'; -export * from './TSProtectedKeyword/spec'; -export * from './TSPublicKeyword/spec'; -export * from './TSReadonlyKeyword/spec'; -export * from './TSStaticKeyword/spec'; export * from './TemplateToken/spec'; diff --git a/packages/ast-spec/src/token/TSAbstractKeyword/spec.ts b/packages/ast-spec/src/type/TSAbstractKeyword/spec.ts similarity index 100% rename from packages/ast-spec/src/token/TSAbstractKeyword/spec.ts rename to packages/ast-spec/src/type/TSAbstractKeyword/spec.ts diff --git a/packages/ast-spec/src/token/TSAsyncKeyword/spec.ts b/packages/ast-spec/src/type/TSAsyncKeyword/spec.ts similarity index 100% rename from packages/ast-spec/src/token/TSAsyncKeyword/spec.ts rename to packages/ast-spec/src/type/TSAsyncKeyword/spec.ts diff --git a/packages/ast-spec/src/token/TSDeclareKeyword/spec.ts b/packages/ast-spec/src/type/TSDeclareKeyword/spec.ts similarity index 100% rename from packages/ast-spec/src/token/TSDeclareKeyword/spec.ts rename to packages/ast-spec/src/type/TSDeclareKeyword/spec.ts diff --git a/packages/ast-spec/src/token/TSExportKeyword/spec.ts b/packages/ast-spec/src/type/TSExportKeyword/spec.ts similarity index 100% rename from packages/ast-spec/src/token/TSExportKeyword/spec.ts rename to packages/ast-spec/src/type/TSExportKeyword/spec.ts diff --git a/packages/ast-spec/src/type/TSIntrinsicType/spec.ts b/packages/ast-spec/src/type/TSIntrinsicKeyword/spec.ts similarity index 100% rename from packages/ast-spec/src/type/TSIntrinsicType/spec.ts rename to packages/ast-spec/src/type/TSIntrinsicKeyword/spec.ts diff --git a/packages/ast-spec/src/token/TSPrivateKeyword/spec.ts b/packages/ast-spec/src/type/TSPrivateKeyword/spec.ts similarity index 100% rename from packages/ast-spec/src/token/TSPrivateKeyword/spec.ts rename to packages/ast-spec/src/type/TSPrivateKeyword/spec.ts diff --git a/packages/ast-spec/src/token/TSProtectedKeyword/spec.ts b/packages/ast-spec/src/type/TSProtectedKeyword/spec.ts similarity index 100% rename from packages/ast-spec/src/token/TSProtectedKeyword/spec.ts rename to packages/ast-spec/src/type/TSProtectedKeyword/spec.ts diff --git a/packages/ast-spec/src/token/TSPublicKeyword/spec.ts b/packages/ast-spec/src/type/TSPublicKeyword/spec.ts similarity index 100% rename from packages/ast-spec/src/token/TSPublicKeyword/spec.ts rename to packages/ast-spec/src/type/TSPublicKeyword/spec.ts diff --git a/packages/ast-spec/src/token/TSReadonlyKeyword/spec.ts b/packages/ast-spec/src/type/TSReadonlyKeyword/spec.ts similarity index 100% rename from packages/ast-spec/src/token/TSReadonlyKeyword/spec.ts rename to packages/ast-spec/src/type/TSReadonlyKeyword/spec.ts diff --git a/packages/ast-spec/src/token/TSStaticKeyword/spec.ts b/packages/ast-spec/src/type/TSStaticKeyword/spec.ts similarity index 100% rename from packages/ast-spec/src/token/TSStaticKeyword/spec.ts rename to packages/ast-spec/src/type/TSStaticKeyword/spec.ts diff --git a/packages/ast-spec/src/type/spec.ts b/packages/ast-spec/src/type/spec.ts index d6209d26067..ae98ead2dc8 100644 --- a/packages/ast-spec/src/type/spec.ts +++ b/packages/ast-spec/src/type/spec.ts @@ -1,14 +1,19 @@ +export * from './TSAbstractKeyword/spec'; export * from './TSAnyKeyword/spec'; export * from './TSArrayType/spec'; +export * from './TSAsyncKeyword/spec'; export * from './TSBigIntKeyword/spec'; export * from './TSBooleanKeyword/spec'; export * from './TSConditionalType/spec'; export * from './TSConstructorType/spec'; +export * from './TSDeclareKeyword/spec'; +export * from './TSExportKeyword/spec'; export * from './TSFunctionType/spec'; export * from './TSImportType/spec'; export * from './TSIndexedAccessType/spec'; export * from './TSInferType/spec'; export * from './TSIntersectionType/spec'; +export * from './TSIntrinsicKeyword/spec'; export * from './TSLiteralType/spec'; export * from './TSMappedType/spec'; export * from './TSNamedTupleMember/spec'; @@ -17,8 +22,13 @@ export * from './TSNullKeyword/spec'; export * from './TSNumberKeyword/spec'; export * from './TSObjectKeyword/spec'; export * from './TSOptionalType/spec'; +export * from './TSPrivateKeyword/spec'; +export * from './TSProtectedKeyword/spec'; +export * from './TSPublicKeyword/spec'; export * from './TSQualifiedName/spec'; +export * from './TSReadonlyKeyword/spec'; export * from './TSRestType/spec'; +export * from './TSStaticKeyword/spec'; export * from './TSStringKeyword/spec'; export * from './TSSymbolKeyword/spec'; export * from './TSTemplateLiteralType/spec'; diff --git a/packages/ast-spec/src/unions/ClassElement.ts b/packages/ast-spec/src/unions/ClassElement.ts index 27d4ec4d752..21fba7babcf 100644 --- a/packages/ast-spec/src/unions/ClassElement.ts +++ b/packages/ast-spec/src/unions/ClassElement.ts @@ -1,14 +1,18 @@ +import type { AccessorProperty } from '../element/AccessorProperty/spec'; import type { MethodDefinition } from '../element/MethodDefinition/spec'; import type { PropertyDefinition } from '../element/PropertyDefinition/spec'; import type { StaticBlock } from '../element/StaticBlock/spec'; +import type { TSAbstractAccessorProperty } from '../element/TSAbstractAccessorProperty/spec'; import type { TSAbstractMethodDefinition } from '../element/TSAbstractMethodDefinition/spec'; import type { TSAbstractPropertyDefinition } from '../element/TSAbstractPropertyDefinition/spec'; import type { TSIndexSignature } from '../element/TSIndexSignature/spec'; export type ClassElement = + | AccessorProperty | MethodDefinition | PropertyDefinition | StaticBlock + | TSAbstractAccessorProperty | TSAbstractMethodDefinition | TSAbstractPropertyDefinition | TSIndexSignature; diff --git a/packages/ast-spec/src/unions/Expression.ts b/packages/ast-spec/src/unions/Expression.ts index 36220bc0391..1c0ee899ec3 100644 --- a/packages/ast-spec/src/unions/Expression.ts +++ b/packages/ast-spec/src/unions/Expression.ts @@ -25,6 +25,7 @@ import type { ThisExpression } from '../expression/ThisExpression/spec'; import type { TSAsExpression } from '../expression/TSAsExpression/spec'; import type { TSInstantiationExpression } from '../expression/TSInstantiationExpression/spec'; import type { TSNonNullExpression } from '../expression/TSNonNullExpression/spec'; +import type { TSSatisfiesExpression } from '../expression/TSSatisfiesExpression/spec'; import type { TSTypeAssertion } from '../expression/TSTypeAssertion/spec'; import type { UnaryExpression } from '../expression/UnaryExpression/spec'; import type { UpdateExpression } from '../expression/UpdateExpression/spec'; @@ -72,6 +73,7 @@ export type Expression = | TSAsExpression | TSInstantiationExpression | TSNonNullExpression + | TSSatisfiesExpression | TSTypeAssertion | UnaryExpression | UpdateExpression diff --git a/packages/ast-spec/src/unions/JSXExpression.ts b/packages/ast-spec/src/unions/JSXExpression.ts index 78dfad53525..d30c150cc6f 100644 --- a/packages/ast-spec/src/unions/JSXExpression.ts +++ b/packages/ast-spec/src/unions/JSXExpression.ts @@ -1,8 +1,4 @@ -import type { JSXEmptyExpression } from '../jsx/JSXEmptyExpression/spec'; import type { JSXExpressionContainer } from '../jsx/JSXExpressionContainer/spec'; import type { JSXSpreadChild } from '../jsx/JSXSpreadChild/spec'; -export type JSXExpression = - | JSXEmptyExpression - | JSXExpressionContainer - | JSXSpreadChild; +export type JSXExpression = JSXExpressionContainer | JSXSpreadChild; diff --git a/packages/ast-spec/src/unions/Modifier.ts b/packages/ast-spec/src/unions/Modifier.ts index 0922a52eca2..f2501e6585c 100644 --- a/packages/ast-spec/src/unions/Modifier.ts +++ b/packages/ast-spec/src/unions/Modifier.ts @@ -1,10 +1,10 @@ -import type { TSAbstractKeyword } from '../token/TSAbstractKeyword/spec'; -import type { TSAsyncKeyword } from '../token/TSAsyncKeyword/spec'; -import type { TSPrivateKeyword } from '../token/TSPrivateKeyword/spec'; -import type { TSProtectedKeyword } from '../token/TSProtectedKeyword/spec'; -import type { TSPublicKeyword } from '../token/TSPublicKeyword/spec'; -import type { TSReadonlyKeyword } from '../token/TSReadonlyKeyword/spec'; -import type { TSStaticKeyword } from '../token/TSStaticKeyword/spec'; +import type { TSAbstractKeyword } from '../type/TSAbstractKeyword/spec'; +import type { TSAsyncKeyword } from '../type/TSAsyncKeyword/spec'; +import type { TSPrivateKeyword } from '../type/TSPrivateKeyword/spec'; +import type { TSProtectedKeyword } from '../type/TSProtectedKeyword/spec'; +import type { TSPublicKeyword } from '../type/TSPublicKeyword/spec'; +import type { TSReadonlyKeyword } from '../type/TSReadonlyKeyword/spec'; +import type { TSStaticKeyword } from '../type/TSStaticKeyword/spec'; export type Modifier = | TSAbstractKeyword diff --git a/packages/ast-spec/src/unions/Node.ts b/packages/ast-spec/src/unions/Node.ts index f6d4cbafffd..b0952e0e186 100644 --- a/packages/ast-spec/src/unions/Node.ts +++ b/packages/ast-spec/src/unions/Node.ts @@ -12,11 +12,13 @@ import type { TSModuleDeclaration } from '../declaration/TSModuleDeclaration/spe import type { TSNamespaceExportDeclaration } from '../declaration/TSNamespaceExportDeclaration/spec'; import type { TSTypeAliasDeclaration } from '../declaration/TSTypeAliasDeclaration/spec'; import type { VariableDeclaration } from '../declaration/VariableDeclaration/spec'; +import type { AccessorProperty } from '../element/AccessorProperty/spec'; import type { MethodDefinition } from '../element/MethodDefinition/spec'; import type { Property } from '../element/Property/spec'; import type { PropertyDefinition } from '../element/PropertyDefinition/spec'; import type { SpreadElement } from '../element/SpreadElement/spec'; import type { StaticBlock } from '../element/StaticBlock/spec'; +import type { TSAbstractAccessorProperty } from '../element/TSAbstractAccessorProperty/spec'; import type { TSAbstractMethodDefinition } from '../element/TSAbstractMethodDefinition/spec'; import type { TSAbstractPropertyDefinition } from '../element/TSAbstractPropertyDefinition/spec'; import type { TSCallSignatureDeclaration } from '../element/TSCallSignatureDeclaration/spec'; @@ -53,6 +55,7 @@ import type { TSAsExpression } from '../expression/TSAsExpression/spec'; import type { TSEmptyBodyFunctionExpression } from '../expression/TSEmptyBodyFunctionExpression/spec'; import type { TSInstantiationExpression } from '../expression/TSInstantiationExpression/spec'; import type { TSNonNullExpression } from '../expression/TSNonNullExpression/spec'; +import type { TSSatisfiesExpression } from '../expression/TSSatisfiesExpression/spec'; import type { TSTypeAssertion } from '../expression/TSTypeAssertion/spec'; import type { UnaryExpression } from '../expression/UnaryExpression/spec'; import type { UpdateExpression } from '../expression/UpdateExpression/spec'; @@ -116,27 +119,22 @@ import type { TryStatement } from '../statement/TryStatement/spec'; import type { TSExportAssignment } from '../statement/TSExportAssignment/spec'; import type { WhileStatement } from '../statement/WhileStatement/spec'; import type { WithStatement } from '../statement/WithStatement/spec'; -import type { TSAbstractKeyword } from '../token/TSAbstractKeyword/spec'; -import type { TSAsyncKeyword } from '../token/TSAsyncKeyword/spec'; -import type { TSDeclareKeyword } from '../token/TSDeclareKeyword/spec'; -import type { TSExportKeyword } from '../token/TSExportKeyword/spec'; -import type { TSPrivateKeyword } from '../token/TSPrivateKeyword/spec'; -import type { TSProtectedKeyword } from '../token/TSProtectedKeyword/spec'; -import type { TSPublicKeyword } from '../token/TSPublicKeyword/spec'; -import type { TSReadonlyKeyword } from '../token/TSReadonlyKeyword/spec'; -import type { TSStaticKeyword } from '../token/TSStaticKeyword/spec'; +import type { TSAbstractKeyword } from '../type/TSAbstractKeyword/spec'; import type { TSAnyKeyword } from '../type/TSAnyKeyword/spec'; import type { TSArrayType } from '../type/TSArrayType/spec'; +import type { TSAsyncKeyword } from '../type/TSAsyncKeyword/spec'; import type { TSBigIntKeyword } from '../type/TSBigIntKeyword/spec'; import type { TSBooleanKeyword } from '../type/TSBooleanKeyword/spec'; import type { TSConditionalType } from '../type/TSConditionalType/spec'; import type { TSConstructorType } from '../type/TSConstructorType/spec'; +import type { TSDeclareKeyword } from '../type/TSDeclareKeyword/spec'; +import type { TSExportKeyword } from '../type/TSExportKeyword/spec'; import type { TSFunctionType } from '../type/TSFunctionType/spec'; import type { TSImportType } from '../type/TSImportType/spec'; import type { TSIndexedAccessType } from '../type/TSIndexedAccessType/spec'; import type { TSInferType } from '../type/TSInferType/spec'; import type { TSIntersectionType } from '../type/TSIntersectionType/spec'; -import type { TSIntrinsicKeyword } from '../type/TSIntrinsicType/spec'; +import type { TSIntrinsicKeyword } from '../type/TSIntrinsicKeyword/spec'; import type { TSLiteralType } from '../type/TSLiteralType/spec'; import type { TSMappedType } from '../type/TSMappedType/spec'; import type { TSNamedTupleMember } from '../type/TSNamedTupleMember/spec'; @@ -145,8 +143,13 @@ import type { TSNullKeyword } from '../type/TSNullKeyword/spec'; import type { TSNumberKeyword } from '../type/TSNumberKeyword/spec'; import type { TSObjectKeyword } from '../type/TSObjectKeyword/spec'; import type { TSOptionalType } from '../type/TSOptionalType/spec'; +import type { TSPrivateKeyword } from '../type/TSPrivateKeyword/spec'; +import type { TSProtectedKeyword } from '../type/TSProtectedKeyword/spec'; +import type { TSPublicKeyword } from '../type/TSPublicKeyword/spec'; import type { TSQualifiedName } from '../type/TSQualifiedName/spec'; +import type { TSReadonlyKeyword } from '../type/TSReadonlyKeyword/spec'; import type { TSRestType } from '../type/TSRestType/spec'; +import type { TSStaticKeyword } from '../type/TSStaticKeyword/spec'; import type { TSStringKeyword } from '../type/TSStringKeyword/spec'; import type { TSSymbolKeyword } from '../type/TSSymbolKeyword/spec'; import type { TSTemplateLiteralType } from '../type/TSTemplateLiteralType/spec'; @@ -169,6 +172,7 @@ import type { Literal } from './Literal'; */ export type Node = + | AccessorProperty | ArrayExpression | ArrayPattern | ArrowFunctionExpression @@ -250,6 +254,7 @@ export type Node = | ThisExpression | ThrowStatement | TryStatement + | TSAbstractAccessorProperty | TSAbstractKeyword | TSAbstractMethodDefinition | TSAbstractPropertyDefinition @@ -305,6 +310,7 @@ export type Node = | TSQualifiedName | TSReadonlyKeyword | TSRestType + | TSSatisfiesExpression | TSStaticKeyword | TSStringKeyword | TSSymbolKeyword diff --git a/packages/ast-spec/src/unions/ObjectLiteralElement.ts b/packages/ast-spec/src/unions/ObjectLiteralElement.ts index d7575c80c1b..e6ac567c63e 100644 --- a/packages/ast-spec/src/unions/ObjectLiteralElement.ts +++ b/packages/ast-spec/src/unions/ObjectLiteralElement.ts @@ -1,8 +1,7 @@ -import type { MethodDefinition } from '../element/MethodDefinition/spec'; import type { Property } from '../element/Property/spec'; import type { SpreadElement } from '../element/SpreadElement/spec'; -export type ObjectLiteralElement = MethodDefinition | Property | SpreadElement; +export type ObjectLiteralElement = Property | SpreadElement; // TODO - breaking change remove this export type ObjectLiteralElementLike = ObjectLiteralElement; diff --git a/packages/ast-spec/src/unions/TypeNode.ts b/packages/ast-spec/src/unions/TypeNode.ts index 55436b7a44d..f1859d7d347 100644 --- a/packages/ast-spec/src/unions/TypeNode.ts +++ b/packages/ast-spec/src/unions/TypeNode.ts @@ -1,15 +1,19 @@ +import type { TSAbstractKeyword } from '../type/TSAbstractKeyword/spec'; import type { TSAnyKeyword } from '../type/TSAnyKeyword/spec'; import type { TSArrayType } from '../type/TSArrayType/spec'; +import type { TSAsyncKeyword } from '../type/TSAsyncKeyword/spec'; import type { TSBigIntKeyword } from '../type/TSBigIntKeyword/spec'; import type { TSBooleanKeyword } from '../type/TSBooleanKeyword/spec'; import type { TSConditionalType } from '../type/TSConditionalType/spec'; import type { TSConstructorType } from '../type/TSConstructorType/spec'; +import type { TSDeclareKeyword } from '../type/TSDeclareKeyword/spec'; +import type { TSExportKeyword } from '../type/TSExportKeyword/spec'; import type { TSFunctionType } from '../type/TSFunctionType/spec'; import type { TSImportType } from '../type/TSImportType/spec'; import type { TSIndexedAccessType } from '../type/TSIndexedAccessType/spec'; import type { TSInferType } from '../type/TSInferType/spec'; import type { TSIntersectionType } from '../type/TSIntersectionType/spec'; -import type { TSIntrinsicKeyword } from '../type/TSIntrinsicType/spec'; +import type { TSIntrinsicKeyword } from '../type/TSIntrinsicKeyword/spec'; import type { TSLiteralType } from '../type/TSLiteralType/spec'; import type { TSMappedType } from '../type/TSMappedType/spec'; import type { TSNamedTupleMember } from '../type/TSNamedTupleMember/spec'; @@ -18,7 +22,13 @@ import type { TSNullKeyword } from '../type/TSNullKeyword/spec'; import type { TSNumberKeyword } from '../type/TSNumberKeyword/spec'; import type { TSObjectKeyword } from '../type/TSObjectKeyword/spec'; import type { TSOptionalType } from '../type/TSOptionalType/spec'; +import type { TSPrivateKeyword } from '../type/TSPrivateKeyword/spec'; +import type { TSProtectedKeyword } from '../type/TSProtectedKeyword/spec'; +import type { TSPublicKeyword } from '../type/TSPublicKeyword/spec'; +import type { TSQualifiedName } from '../type/TSQualifiedName/spec'; +import type { TSReadonlyKeyword } from '../type/TSReadonlyKeyword/spec'; import type { TSRestType } from '../type/TSRestType/spec'; +import type { TSStaticKeyword } from '../type/TSStaticKeyword/spec'; import type { TSStringKeyword } from '../type/TSStringKeyword/spec'; import type { TSSymbolKeyword } from '../type/TSSymbolKeyword/spec'; import type { TSTemplateLiteralType } from '../type/TSTemplateLiteralType/spec'; @@ -35,12 +45,16 @@ import type { TSUnknownKeyword } from '../type/TSUnknownKeyword/spec'; import type { TSVoidKeyword } from '../type/TSVoidKeyword/spec'; export type TypeNode = + | TSAbstractKeyword | TSAnyKeyword | TSArrayType + | TSAsyncKeyword | TSBigIntKeyword | TSBooleanKeyword | TSConditionalType | TSConstructorType + | TSDeclareKeyword + | TSExportKeyword | TSFunctionType | TSImportType | TSIndexedAccessType @@ -55,7 +69,13 @@ export type TypeNode = | TSNumberKeyword | TSObjectKeyword | TSOptionalType + | TSPrivateKeyword + | TSProtectedKeyword + | TSPublicKeyword + | TSQualifiedName + | TSReadonlyKeyword | TSRestType + | TSStaticKeyword | TSStringKeyword | TSSymbolKeyword | TSTemplateLiteralType diff --git a/packages/ast-spec/tests/AssignmentOperatorToText.type-test.ts b/packages/ast-spec/tests/AssignmentOperatorToText.type-test.ts index 53035facabe..18b6abbb663 100644 --- a/packages/ast-spec/tests/AssignmentOperatorToText.type-test.ts +++ b/packages/ast-spec/tests/AssignmentOperatorToText.type-test.ts @@ -1,6 +1,6 @@ import type { AssignmentOperator } from 'typescript'; -import { AssignmentOperatorToText } from '../src'; +import type { AssignmentOperatorToText } from '../src'; type _Test = { readonly [T in AssignmentOperator]: AssignmentOperatorToText[T]; diff --git a/packages/ast-spec/tests/fixtures-with-differences-ast.shot b/packages/ast-spec/tests/fixtures-with-differences-ast.shot index 9d3e5d88ccc..233fc7f4f95 100644 --- a/packages/ast-spec/tests/fixtures-with-differences-ast.shot +++ b/packages/ast-spec/tests/fixtures-with-differences-ast.shot @@ -24,5 +24,24 @@ Set { "declaration/TSInterfaceDeclaration/fixtures/type-param-one/fixture.ts", "declaration/TSTypeAliasDeclaration/fixtures/type-param-many/fixture.ts", "declaration/TSTypeAliasDeclaration/fixtures/type-param-one/fixture.ts", + "element/AccessorProperty/fixtures/key-computed-complex/fixture.ts", + "element/AccessorProperty/fixtures/key-computed-number/fixture.ts", + "element/AccessorProperty/fixtures/key-computed-string/fixture.ts", + "element/AccessorProperty/fixtures/key-private/fixture.ts", + "element/AccessorProperty/fixtures/key-string/fixture.ts", + "element/AccessorProperty/fixtures/modifier-abstract-with-value/fixture.ts", + "element/AccessorProperty/fixtures/modifier-abstract/fixture.ts", + "element/AccessorProperty/fixtures/modifier-declare/fixture.ts", + "element/AccessorProperty/fixtures/modifier-override/fixture.ts", + "element/AccessorProperty/fixtures/modifier-private/fixture.ts", + "element/AccessorProperty/fixtures/modifier-protected/fixture.ts", + "element/AccessorProperty/fixtures/modifier-public/fixture.ts", + "element/AccessorProperty/fixtures/modifier-readonly/fixture.ts", + "element/AccessorProperty/fixtures/modifier-static/fixture.ts", + "element/AccessorProperty/fixtures/no-annotation-no-value/fixture.ts", + "element/AccessorProperty/fixtures/no-annotation-with-value/fixture.ts", + "element/AccessorProperty/fixtures/with-annotation-no-value/fixture.ts", + "element/AccessorProperty/fixtures/with-annotation-with-value/fixture.ts", + "expression/TSSatisfiesExpression/fixtures/arrow-func-with-parentheses/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 f9c7ef6147d..ad9289156df 100644 --- a/packages/ast-spec/tests/fixtures-with-differences-errors.shot +++ b/packages/ast-spec/tests/fixtures-with-differences-errors.shot @@ -9,6 +9,7 @@ Object { "declaration/ExportAllDeclaration/fixtures/_error_/kind-type/fixture.ts", "declaration/ExportAllDeclaration/fixtures/_error_/type-kind/fixture.ts", "declaration/ExportNamedDeclaration/fixtures/_error_/anonymous-class/fixture.ts", + "declaration/ExportNamedDeclaration/fixtures/_error_/assertion/fixture.ts", "declaration/FunctionDeclaration/fixtures/_error_/missing-type-param/fixture.ts", "declaration/TSDeclareFunction/fixtures/_error_/async/fixture.ts", "declaration/TSDeclareFunction/fixtures/_error_/declare-with-body/fixture.ts", @@ -20,6 +21,7 @@ Object { "declaration/TSInterfaceDeclaration/fixtures/_error_/non-identifier-extends/fixture.ts", "declaration/TSTypeAliasDeclaration/fixtures/_error_/missing-type-parameter/fixture.ts", "declaration/VariableDeclaration/fixtures/_error_/missing-id-without-value/fixture.ts", + "element/AccessorProperty/fixtures/_error_/modifier-override-with-no-extends/fixture.ts", }, "TSESTree errored but Babel didn't": Set { "declaration/ExportAllDeclaration/fixtures/_error_/named-non-identifier/fixture.ts", diff --git a/packages/ast-spec/tests/fixtures-with-differences-tokens.shot b/packages/ast-spec/tests/fixtures-with-differences-tokens.shot index ee92fc9b050..c9796a38459 100644 --- a/packages/ast-spec/tests/fixtures-with-differences-tokens.shot +++ b/packages/ast-spec/tests/fixtures-with-differences-tokens.shot @@ -22,5 +22,9 @@ Set { "declaration/VariableDeclaration/fixtures/let-with-value/fixture.ts", "declaration/VariableDeclaration/fixtures/let-without-value/fixture.ts", "declaration/VariableDeclaration/fixtures/multiple-declarations/fixture.ts", + "element/AccessorProperty/fixtures/key-private/fixture.ts", + "element/AccessorProperty/fixtures/modifier-private/fixture.ts", + "element/AccessorProperty/fixtures/modifier-protected/fixture.ts", + "element/AccessorProperty/fixtures/modifier-public/fixture.ts", } `; diff --git a/packages/ast-spec/tests/fixtures-without-babel-support.shot b/packages/ast-spec/tests/fixtures-without-babel-support.shot new file mode 100644 index 00000000000..0ecfffa63d0 --- /dev/null +++ b/packages/ast-spec/tests/fixtures-without-babel-support.shot @@ -0,0 +1,3 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`AST Fixtures List fixtures we expect babel to not support 1`] = `Map {}`; diff --git a/packages/ast-spec/tests/fixtures.test.ts b/packages/ast-spec/tests/fixtures.test.ts index e9685f2a425..df70fe613eb 100644 --- a/packages/ast-spec/tests/fixtures.test.ts +++ b/packages/ast-spec/tests/fixtures.test.ts @@ -2,16 +2,17 @@ import fs from 'fs'; import glob from 'glob'; import makeDir from 'make-dir'; import path from 'path'; + import { parseBabel } from './util/parsers/babel'; -import { +import type { Fixture, ParserResponse, ParserResponseError, ParserResponseSuccess, - ParserResponseType, } from './util/parsers/parser-types'; +import { ParserResponseType } from './util/parsers/parser-types'; import { parseTSESTree } from './util/parsers/typescript-estree'; -import { snapshotDiff, diffHasChanges } from './util/snapshot-diff'; +import { diffHasChanges, snapshotDiff } from './util/snapshot-diff'; const PACKAGE_ROOT = path.resolve(__dirname, '..'); const SRC_DIR = path.resolve(PACKAGE_ROOT, 'src'); @@ -24,6 +25,7 @@ const ONLY = [].join(path.sep); const fixturesWithASTDifferences = new Set(); const fixturesWithTokenDifferences = new Set(); +const fixturesConfiguredToExpectBabelToNotSupport = new Map(); enum ErrorLabel { TSESTree = "TSESTree errored but Babel didn't", Babel = "Babel errored but TSESTree didn't", @@ -35,46 +37,67 @@ const fixturesWithErrorDifferences = { [ErrorLabel.Babel]: new Set(), } as const; -const validFixtures = glob.sync(`${SRC_DIR}/**/fixtures/*/*.{ts,tsx}`); -const errorFixtures = glob.sync(`${SRC_DIR}/**/fixtures/_error_/*/*.{ts,tsx}`); +const VALID_FIXTURES: readonly string[] = glob.sync( + `${SRC_DIR}/**/fixtures/*/fixture.{ts,tsx}`, +); +const ERROR_FIXTURES: readonly string[] = glob.sync( + `${SRC_DIR}/**/fixtures/_error_/*/fixture.{ts,tsx}`, +); -const fixtures: readonly Fixture[] = [...validFixtures, ...errorFixtures].map( +const FIXTURES: readonly Fixture[] = [...VALID_FIXTURES, ...ERROR_FIXTURES].map( absolute => { const relativeToSrc = path.relative(SRC_DIR, absolute); const { dir, ext } = path.parse(relativeToSrc); const segments = dir.split(path.sep).filter(s => s !== 'fixtures'); const name = segments.pop()!; - const snapshotPath = path.join(SRC_DIR, dir, 'snapshots'); + const fixtureDir = path.join(SRC_DIR, dir); + const configPath = path.join(fixtureDir, 'config' /* .ts */); + const snapshotPath = path.join(fixtureDir, 'snapshots'); return { absolute, - name, + config: ((): ASTFixtureConfig => { + try { + return require(configPath).default; + } catch { + return {}; + } + })(), ext, isError: absolute.includes('/_error_/'), isJSX: ext.endsWith('x'), + name, relative: path.relative(SRC_DIR, absolute), segments, - snapshotPath, snapshotFiles: { success: { tsestree: { - ast: path.join(snapshotPath, '1-TSESTree-AST.shot'), - tokens: path.join(snapshotPath, '2-TSESTree-Tokens.shot'), + ast: (i: number) => + path.join(snapshotPath, `${i}-TSESTree-AST.shot`), + tokens: (i: number) => + path.join(snapshotPath, `${i}-TSESTree-Tokens.shot`), }, babel: { - ast: path.join(snapshotPath, '3-Babel-AST.shot'), - tokens: path.join(snapshotPath, '4-Babel-Tokens.shot'), + ast: (i: number) => path.join(snapshotPath, `${i}-Babel-AST.shot`), + tokens: (i: number) => + path.join(snapshotPath, `${i}-Babel-Tokens.shot`), }, alignment: { - ast: path.join(snapshotPath, '5-AST-Alignment-AST.shot'), - tokens: path.join(snapshotPath, '6-AST-Alignment-Tokens.shot'), + ast: (i: number) => + path.join(snapshotPath, `${i}-AST-Alignment-AST.shot`), + tokens: (i: number) => + path.join(snapshotPath, `${i}-AST-Alignment-Tokens.shot`), }, }, error: { - tsestree: path.join(snapshotPath, '1-TSESTree-Error.shot'), - babel: path.join(snapshotPath, '2-Babel-Error.shot'), - alignment: path.join(snapshotPath, '3-Alignment-Error.shot'), + tsestree: (i: number) => + path.join(snapshotPath, `${i}-TSESTree-Error.shot`), + babel: (i: number) => + path.join(snapshotPath, `${i}-Babel-Error.shot`), + alignment: (i: number) => + path.join(snapshotPath, `${i}-Alignment-Error.shot`), }, }, + snapshotPath, }; }, ); @@ -129,6 +152,8 @@ function nestDescribe(fixture: Fixture, segments = fixture.segments): void { errorLabel = ErrorLabel.None; } + let snapshotCounter = 1; + if (fixture.isError) { if ( errorLabel === ErrorLabel.TSESTree || @@ -139,17 +164,17 @@ function nestDescribe(fixture: Fixture, segments = fixture.segments): void { it('TSESTree - Error', () => { expect(tsestreeParsed.error).toMatchSpecificSnapshot( - fixture.snapshotFiles.error.tsestree, + fixture.snapshotFiles.error.tsestree(snapshotCounter++), ); }); it('Babel - Error', () => { expect(babelParsed.error).toMatchSpecificSnapshot( - fixture.snapshotFiles.error.babel, + fixture.snapshotFiles.error.babel(snapshotCounter++), ); }); it('Error Alignment', () => { expect(errorLabel).toMatchSpecificSnapshot( - fixture.snapshotFiles.error.alignment, + fixture.snapshotFiles.error.alignment(snapshotCounter++), ); }); it('Should parse with errors', () => { @@ -161,63 +186,80 @@ function nestDescribe(fixture: Fixture, segments = fixture.segments): void { it('TSESTree - AST', () => { expectSuccessResponse(tsestreeParsed); expect(tsestreeParsed.ast).toMatchSpecificSnapshot( - fixture.snapshotFiles.success.tsestree.ast, + fixture.snapshotFiles.success.tsestree.ast(snapshotCounter++), ); }); it('TSESTree - Tokens', () => { expectSuccessResponse(tsestreeParsed); expect(tsestreeParsed.tokens).toMatchSpecificSnapshot( - fixture.snapshotFiles.success.tsestree.tokens, + fixture.snapshotFiles.success.tsestree.tokens(snapshotCounter++), ); }); - it('Babel - AST', () => { - expectSuccessResponse(babelParsed); - expect(babelParsed.ast).toMatchSpecificSnapshot( - fixture.snapshotFiles.success.babel.ast, + if (fixture.config.expectBabelToNotSupport != null) { + fixturesConfiguredToExpectBabelToNotSupport.set( + fixture.relative, + fixture.config.expectBabelToNotSupport, ); - }); - it('Babel - Tokens', () => { - expectSuccessResponse(babelParsed); - expect(babelParsed.tokens).toMatchSpecificSnapshot( - fixture.snapshotFiles.success.babel.tokens, - ); - }); - it('AST Alignment - AST', () => { - expectSuccessResponse(tsestreeParsed); - expectSuccessResponse(babelParsed); - const diffResult = snapshotDiff( - 'TSESTree', - tsestreeParsed.ast, - 'Babel', - babelParsed.ast, - ); - expect(diffResult).toMatchSpecificSnapshot( - fixture.snapshotFiles.success.alignment.ast, - ); + // eslint-disable-next-line jest/no-identical-title -- intentional duplication that won't ever happen due to exclusionary conditions + it('Babel - Error', () => { + expect(babelParsed.error).toMatchSpecificSnapshot( + fixture.snapshotFiles.error.babel(snapshotCounter++), + ); + }); + // eslint-disable-next-line jest/no-disabled-tests -- intentional skip for CLI documentation purposes + it.skip('Babel - Skipped as this fixture is configured to expect babel to error', () => {}); + // eslint-disable-next-line jest/no-disabled-tests -- intentional skip for CLI documentation purposes + it.skip('AST Alignment - Skipped as this fixture is configured to expect babel to error', () => {}); + } else { + it('Babel - AST', () => { + expectSuccessResponse(babelParsed); + expect(babelParsed.ast).toMatchSpecificSnapshot( + fixture.snapshotFiles.success.babel.ast(snapshotCounter++), + ); + }); + it('Babel - Tokens', () => { + expectSuccessResponse(babelParsed); + expect(babelParsed.tokens).toMatchSpecificSnapshot( + fixture.snapshotFiles.success.babel.tokens(snapshotCounter++), + ); + }); + it('AST Alignment - AST', () => { + expectSuccessResponse(tsestreeParsed); + expectSuccessResponse(babelParsed); + const diffResult = snapshotDiff( + 'TSESTree', + tsestreeParsed.ast, + 'Babel', + babelParsed.ast, + ); + expect(diffResult).toMatchSpecificSnapshot( + fixture.snapshotFiles.success.alignment.ast(snapshotCounter++), + ); - if (diffHasChanges(diffResult)) { - fixturesWithASTDifferences.add(fixture.relative); - } - }); - it('AST Alignment - Token', () => { - expectSuccessResponse(tsestreeParsed); - expectSuccessResponse(babelParsed); - const diffResult = snapshotDiff( - 'TSESTree', - tsestreeParsed.tokens, - 'Babel', - babelParsed.tokens, - ); - expect(diffResult).toMatchSpecificSnapshot( - fixture.snapshotFiles.success.alignment.tokens, - ); + if (diffHasChanges(diffResult)) { + fixturesWithASTDifferences.add(fixture.relative); + } + }); + it('AST Alignment - Token', () => { + expectSuccessResponse(tsestreeParsed); + expectSuccessResponse(babelParsed); + const diffResult = snapshotDiff( + 'TSESTree', + tsestreeParsed.tokens, + 'Babel', + babelParsed.tokens, + ); + expect(diffResult).toMatchSpecificSnapshot( + fixture.snapshotFiles.success.alignment.tokens(snapshotCounter++), + ); - if (diffHasChanges(diffResult)) { - fixturesWithTokenDifferences.add(fixture.relative); - } - }); + if (diffHasChanges(diffResult)) { + fixturesWithTokenDifferences.add(fixture.relative); + } + }); + } it('Should parse with no errors', () => { // log the error for debug purposes in case there wasn't supposed to be an error @@ -227,7 +269,9 @@ function nestDescribe(fixture: Fixture, segments = fixture.segments): void { case ErrorLabel.Babel: expectErrorResponse(babelParsed); - console.error('Babel:\n', babelParsed.error); + if (fixture.config.expectBabelToNotSupport == null) { + console.error('Babel:\n', babelParsed.error); + } break; case ErrorLabel.TSESTree: @@ -243,15 +287,33 @@ function nestDescribe(fixture: Fixture, segments = fixture.segments): void { break; } + // NOTE - the comments below exist so that they show up in the stack trace jest shows + // when the test fails. Yes, sadly, they're duplicated, but it's necessary to + // provide the best and most understandable DevX that we can here. + // Jest will print a code frame with the fail line as well as 2 lines before and after + + // if this fails and you WERE expecting a parser error, then your fixture should be in the `_error_` subfolder + // if this fails and you WEREN'T expecting a parser error - then something is broken. + expect(errorLabel).not.toBe(ErrorLabel.TSESTree); + // if this fails and you WERE expecting a parser error, then your fixture should be in the `_error_` subfolder // if this fails and you WEREN'T expecting a parser error - then something is broken. - expect(errorLabel).toBe(ErrorLabel.None); + expect(errorLabel).not.toBe(ErrorLabel.Both); + + if (fixture.config.expectBabelToNotSupport != null) { + // if this fails and you WERE expecting a parser error, then Babel parsed without error and you should remove the `expectBabelToNotSupport` config. + expect(errorLabel).toBe(ErrorLabel.Babel); + } else { + // if this fails and you WERE expecting a parser error, then your fixture should be in the `_error_` subfolder + // if this fails and you WEREN'T expecting a parser error - then something is broken. + expect(errorLabel).not.toBe(ErrorLabel.Babel); + } }); } }; if ([...fixture.segments, fixture.name].join(path.sep) === ONLY) { - // eslint-disable-next-line jest/no-focused-tests + // eslint-disable-next-line jest/no-focused-tests -- intentional focused test that only happens during development describe.only(fixture.name, test); } else { describe(fixture.name, test); @@ -260,7 +322,7 @@ function nestDescribe(fixture: Fixture, segments = fixture.segments): void { } describe('AST Fixtures', () => { - fixtures.forEach(f => nestDescribe(f)); + FIXTURES.forEach(f => nestDescribe(f)); // once we've run all the tests, snapshot the list of fixtures that have differences for easy reference it('List fixtures with AST differences', () => { @@ -278,4 +340,9 @@ describe('AST Fixtures', () => { path.resolve(__dirname, 'fixtures-with-differences-errors.shot'), ); }); + it('List fixtures we expect babel to not support', () => { + expect(fixturesConfiguredToExpectBabelToNotSupport).toMatchSpecificSnapshot( + path.resolve(__dirname, 'fixtures-without-babel-support.shot'), + ); + }); }); diff --git a/packages/ast-spec/tests/util/parsers/babel.ts b/packages/ast-spec/tests/util/parsers/babel.ts index d5995880a80..5e874be85af 100644 --- a/packages/ast-spec/tests/util/parsers/babel.ts +++ b/packages/ast-spec/tests/util/parsers/babel.ts @@ -1,7 +1,11 @@ -import { parse, ParserPlugin } from '@babel/eslint-parser'; -import { ParserResponseType, Fixture, ParserResponse } from './parser-types'; +import type { ParserPlugin } from '@babel/eslint-parser'; +import { parse } from '@babel/eslint-parser'; + +import type { Fixture, ParserResponse } from './parser-types'; +import { ParserResponseType } from './parser-types'; const PLUGINS: ParserPlugin[] = [ + 'decoratorAutoAccessors', // TODO - enable classFeatures instead of classProperties when we support it // 'classFeatures', 'classProperties', diff --git a/packages/ast-spec/tests/util/parsers/parser-types.ts b/packages/ast-spec/tests/util/parsers/parser-types.ts index 1278d43a99e..4538d8ed4a9 100644 --- a/packages/ast-spec/tests/util/parsers/parser-types.ts +++ b/packages/ast-spec/tests/util/parsers/parser-types.ts @@ -1,17 +1,19 @@ +type SnapshotPathFn = (i: number) => string; + interface SuccessSnapshotPaths { - readonly ast: string; - readonly tokens: string; + readonly ast: SnapshotPathFn; + readonly tokens: SnapshotPathFn; } export interface Fixture { readonly absolute: string; - readonly name: string; + readonly config: ASTFixtureConfig; readonly ext: string; readonly isError: boolean; readonly isJSX: boolean; + readonly name: string; readonly relative: string; readonly segments: string[]; - readonly snapshotPath: string; readonly snapshotFiles: { readonly success: { readonly tsestree: SuccessSnapshotPaths; @@ -19,11 +21,12 @@ export interface Fixture { readonly alignment: SuccessSnapshotPaths; }; readonly error: { - readonly tsestree: string; - readonly babel: string; - readonly alignment: string; + readonly tsestree: SnapshotPathFn; + readonly babel: SnapshotPathFn; + readonly alignment: SnapshotPathFn; }; }; + readonly snapshotPath: string; } export enum ParserResponseType { diff --git a/packages/ast-spec/tests/util/parsers/typescript-estree.ts b/packages/ast-spec/tests/util/parsers/typescript-estree.ts index b4c3ca88638..6cfe656f4bf 100644 --- a/packages/ast-spec/tests/util/parsers/typescript-estree.ts +++ b/packages/ast-spec/tests/util/parsers/typescript-estree.ts @@ -1,5 +1,6 @@ +import type { Fixture, ParserResponse } from './parser-types'; +import { ParserResponseType } from './parser-types'; import { parse } from './typescript-estree-import'; -import { ParserResponseType, Fixture, ParserResponse } from './parser-types'; export function parseTSESTree( fixture: Fixture, diff --git a/packages/ast-spec/tests/util/serializers/Node.ts b/packages/ast-spec/tests/util/serializers/Node.ts index a9e6b4ddf06..bd6a9536ba7 100644 --- a/packages/ast-spec/tests/util/serializers/Node.ts +++ b/packages/ast-spec/tests/util/serializers/Node.ts @@ -1,5 +1,6 @@ +import type { NewPlugin } from 'pretty-format'; + import type * as TSESTree from '../../../src'; -import { NewPlugin } from 'pretty-format'; import { AST_NODE_TYPES } from '../../../src'; function sortKeys(node: TSESTree.Node): (keyof typeof node)[] { diff --git a/packages/ast-spec/tests/util/serializers/string.ts b/packages/ast-spec/tests/util/serializers/string.ts index 81750c26009..399124eaa13 100644 --- a/packages/ast-spec/tests/util/serializers/string.ts +++ b/packages/ast-spec/tests/util/serializers/string.ts @@ -1,4 +1,4 @@ -import { NewPlugin } from 'pretty-format'; +import type { NewPlugin } from 'pretty-format'; // custom string serializer so that we can use single-quoted strings instead of double quoted strings // this plays nicer with the way that the snapshot diff result, which is a pure string diff --git a/packages/ast-spec/tests/util/setupJest.ts b/packages/ast-spec/tests/util/setupJest.ts index 6b9e99943bf..d40664171ce 100644 --- a/packages/ast-spec/tests/util/setupJest.ts +++ b/packages/ast-spec/tests/util/setupJest.ts @@ -1,4 +1,5 @@ import { addSerializer } from 'jest-specific-snapshot'; + import { serializers } from './serializers'; for (const serializer of serializers) { diff --git a/packages/ast-spec/tests/util/snapshot-diff.ts b/packages/ast-spec/tests/util/snapshot-diff.ts index 4bf6546eeec..87a3ec72aa0 100644 --- a/packages/ast-spec/tests/util/snapshot-diff.ts +++ b/packages/ast-spec/tests/util/snapshot-diff.ts @@ -1,5 +1,6 @@ import { diff } from 'jest-diff'; import defaultPrinter from 'pretty-format'; + import * as NodeSerializer from './serializers/Node'; import * as StringSerializer from './serializers/string'; diff --git a/packages/ast-spec/tsconfig.json b/packages/ast-spec/tsconfig.json index fd3827cd5ba..35ae2aa3a17 100644 --- a/packages/ast-spec/tsconfig.json +++ b/packages/ast-spec/tsconfig.json @@ -4,7 +4,14 @@ "composite": false, "rootDir": "." }, - "include": ["src", "typings", "tests", "tools", "./rollup.config.ts"], - "exclude": ["**/fixtures/**"], + "include": [ + "src", + "typings", + "tests", + "tools", + "./rollup.config.ts", + "**/fixtures/**/config.ts" + ], + "exclude": ["**/fixtures/**/fixture.ts"], "references": [{ "path": "../typescript-estree/tsconfig.build.json" }] } diff --git a/packages/ast-spec/typings/global.d.ts b/packages/ast-spec/typings/global.d.ts new file mode 100644 index 00000000000..4464c06fbcf --- /dev/null +++ b/packages/ast-spec/typings/global.d.ts @@ -0,0 +1,14 @@ +/** + * We define this as a global type to make it easier to consume from fixtures. + * It saves us having to import the type into `src` files from a test utils folder. + * This is a convenient property because it saves us from a lot of `../`! + */ +interface ASTFixtureConfig { + /** + * Specifies that we expect that babel doesn't yet support the code in this fixture, so we expect that it will error. + * This should not be used if we expect babel to throw for this feature due to a valid parser error! + * + * The value should be a description of why there isn't support - for example a github issue URL. + */ + readonly expectBabelToNotSupport?: string; +} diff --git a/packages/eslint-plugin-internal/CHANGELOG.md b/packages/eslint-plugin-internal/CHANGELOG.md index c498f667cb8..0cd6ad00030 100644 --- a/packages/eslint-plugin-internal/CHANGELOG.md +++ b/packages/eslint-plugin-internal/CHANGELOG.md @@ -3,7 +3,7 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. -# [5.31.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.7...v5.31.0) (2022-07-25) +# [5.50.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.49.0...v5.50.0) (2023-01-31) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal @@ -11,7 +11,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline -## [5.30.7](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.6...v5.30.7) (2022-07-18) +# [5.49.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.48.2...v5.49.0) (2023-01-23) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal @@ -19,7 +19,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline -## [5.30.6](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.5...v5.30.6) (2022-07-11) +## [5.48.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.48.1...v5.48.2) (2023-01-16) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal @@ -27,7 +27,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline -## [5.30.5](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.4...v5.30.5) (2022-07-04) +## [5.48.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.48.0...v5.48.1) (2023-01-09) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal @@ -35,1176 +35,735 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline -## [5.30.4](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.3...v5.30.4) (2022-07-03) +# [5.48.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.47.1...v5.48.0) (2023-01-02) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal +## [5.47.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.47.0...v5.47.1) (2022-12-26) +### Bug Fixes +- **ast-spec:** correct some incorrect ast types ([#6257](https://github.com/typescript-eslint/typescript-eslint/issues/6257)) ([0f3f645](https://github.com/typescript-eslint/typescript-eslint/commit/0f3f64571ea5d938081b1a9f3fd1495765201700)) - -## [5.30.3](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.2...v5.30.3) (2022-07-01) +# [5.47.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.46.1...v5.47.0) (2022-12-19) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal - - - - -## [5.30.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.1...v5.30.2) (2022-07-01) +## [5.46.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.46.0...v5.46.1) (2022-12-12) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal +# [5.46.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.45.1...v5.46.0) (2022-12-08) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal +## [5.45.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.45.0...v5.45.1) (2022-12-05) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal -## 5.30.1 (2022-07-01) +# [5.45.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.44.0...v5.45.0) (2022-11-28) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal +# [5.44.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.43.0...v5.44.0) (2022-11-21) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal +# [5.43.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.42.1...v5.43.0) (2022-11-14) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal -# [5.30.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.29.0...v5.30.0) (2022-06-27) +## [5.42.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.42.0...v5.42.1) (2022-11-07) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal +# [5.42.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.41.0...v5.42.0) (2022-10-31) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal +# [5.41.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.40.1...v5.41.0) (2022-10-24) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal -# [5.29.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.28.0...v5.29.0) (2022-06-20) +## [5.40.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.40.0...v5.40.1) (2022-10-17) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal +# [5.40.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.39.0...v5.40.0) (2022-10-10) +### Features +- **utils:** add dependency constraint filtering for `RuleTester` ([#5750](https://github.com/typescript-eslint/typescript-eslint/issues/5750)) ([121f4c0](https://github.com/typescript-eslint/typescript-eslint/commit/121f4c0e7252def95d917e4734e933e53e29d501)) - -# [5.28.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.27.1...v5.28.0) (2022-06-13) +# [5.39.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.38.1...v5.39.0) (2022-10-03) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal +## [5.38.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.38.0...v5.38.1) (2022-09-26) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal +# [5.38.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.37.0...v5.38.0) (2022-09-19) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal -## [5.27.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.27.0...v5.27.1) (2022-06-06) +# [5.37.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.36.2...v5.37.0) (2022-09-12) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal +## [5.36.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.36.1...v5.36.2) (2022-09-05) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal +## [5.36.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.36.0...v5.36.1) (2022-08-30) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal -# [5.27.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.26.0...v5.27.0) (2022-05-30) - +# [5.36.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.35.1...v5.36.0) (2022-08-30) ### Features -* [4.7] support new extensions ([#5027](https://github.com/typescript-eslint/typescript-eslint/issues/5027)) ([efc147b](https://github.com/typescript-eslint/typescript-eslint/commit/efc147b04dce52ab17415b6a4ae4076b944b9036)) +- support TypeScript 4.8 ([#5551](https://github.com/typescript-eslint/typescript-eslint/issues/5551)) ([81450ed](https://github.com/typescript-eslint/typescript-eslint/commit/81450ed7eaede74b384e9a91a84e9b4d34513866)) +## [5.35.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.35.0...v5.35.1) (2022-08-24) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal +# [5.35.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.34.0...v5.35.0) (2022-08-24) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal -# [5.26.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.25.0...v5.26.0) (2022-05-23) +# [5.34.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.33.1...v5.34.0) (2022-08-22) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal +## [5.33.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.33.0...v5.33.1) (2022-08-15) +### Bug Fixes +- missing placeholders in violation messages for `no-unnecessary-type-constraint` and `no-unsafe-argument` (and enable `eslint-plugin/recommended` rules internally) ([#5453](https://github.com/typescript-eslint/typescript-eslint/issues/5453)) ([d023910](https://github.com/typescript-eslint/typescript-eslint/commit/d0239104f4dbffd2b5ecdb19e520c7d4b71962e0)) - -# [5.25.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.24.0...v5.25.0) (2022-05-17) +# [5.33.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.32.0...v5.33.0) (2022-08-08) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal +# [5.32.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.31.0...v5.32.0) (2022-08-01) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal +# [5.31.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.7...v5.31.0) (2022-07-25) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal -# [5.24.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.23.0...v5.24.0) (2022-05-16) +## [5.30.7](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.6...v5.30.7) (2022-07-18) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal +## [5.30.6](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.5...v5.30.6) (2022-07-11) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal +## [5.30.5](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.4...v5.30.5) (2022-07-04) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal -# [5.23.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.22.0...v5.23.0) (2022-05-09) +## [5.30.4](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.3...v5.30.4) (2022-07-03) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal +## [5.30.3](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.2...v5.30.3) (2022-07-01) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal +## [5.30.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.1...v5.30.2) (2022-07-01) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal -# [5.22.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.21.0...v5.22.0) (2022-05-02) +## 5.30.1 (2022-07-01) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal +# [5.30.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.29.0...v5.30.0) (2022-06-27) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal +# [5.29.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.28.0...v5.29.0) (2022-06-20) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal -# [5.21.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.20.0...v5.21.0) (2022-04-25) +# [5.28.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.27.1...v5.28.0) (2022-06-13) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal +## [5.27.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.27.0...v5.27.1) (2022-06-06) + +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal +# [5.27.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.26.0...v5.27.0) (2022-05-30) +### Features +- [4.7] support new extensions ([#5027](https://github.com/typescript-eslint/typescript-eslint/issues/5027)) ([efc147b](https://github.com/typescript-eslint/typescript-eslint/commit/efc147b04dce52ab17415b6a4ae4076b944b9036)) -# [5.20.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.19.0...v5.20.0) (2022-04-18) +# [5.26.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.25.0...v5.26.0) (2022-05-23) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal +# [5.25.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.24.0...v5.25.0) (2022-05-17) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal +# [5.24.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.23.0...v5.24.0) (2022-05-16) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal -# [5.19.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.18.0...v5.19.0) (2022-04-11) +# [5.23.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.22.0...v5.23.0) (2022-05-09) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal +# [5.22.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.21.0...v5.22.0) (2022-05-02) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal +# [5.21.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.20.0...v5.21.0) (2022-04-25) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal -# [5.18.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.17.0...v5.18.0) (2022-04-04) +# [5.20.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.19.0...v5.20.0) (2022-04-18) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal +# [5.19.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.18.0...v5.19.0) (2022-04-11) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal +# [5.18.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.17.0...v5.18.0) (2022-04-04) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal # [5.17.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.16.0...v5.17.0) (2022-03-28) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal - - - - # [5.16.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.15.0...v5.16.0) (2022-03-21) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal - - - - # [5.15.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.14.0...v5.15.0) (2022-03-14) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal - - - - # [5.14.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.13.0...v5.14.0) (2022-03-07) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal +# [5.13.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.12.1...v5.13.0) (2022-02-28) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal +## [5.12.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.12.0...v5.12.1) (2022-02-21) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal -# [5.13.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.12.1...v5.13.0) (2022-02-28) +# [5.12.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.11.0...v5.12.0) (2022-02-14) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal +# [5.11.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.10.2...v5.11.0) (2022-02-07) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal +## [5.10.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.10.1...v5.10.2) (2022-01-31) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal -## [5.12.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.12.0...v5.12.1) (2022-02-21) +## [5.10.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.10.0...v5.10.1) (2022-01-24) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal +# [5.10.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.9.1...v5.10.0) (2022-01-17) +### Features +- rename `experimental-utils` to `utils` and make `experimental-utils` an alias to the new package ([#4172](https://github.com/typescript-eslint/typescript-eslint/issues/4172)) ([1d55a75](https://github.com/typescript-eslint/typescript-eslint/commit/1d55a7511b38d8e2b2eabe59f639e0a865e6c93f)) - -# [5.12.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.11.0...v5.12.0) (2022-02-14) +## [5.9.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.9.0...v5.9.1) (2022-01-10) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal +# [5.9.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.8.1...v5.9.0) (2022-01-03) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal +## [5.8.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.8.0...v5.8.1) (2021-12-27) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal -# [5.11.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.10.2...v5.11.0) (2022-02-07) +# [5.8.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.7.0...v5.8.0) (2021-12-20) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal +# [5.7.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.6.0...v5.7.0) (2021-12-13) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal +# [5.6.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.5.0...v5.6.0) (2021-12-06) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal -## [5.10.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.10.1...v5.10.2) (2022-01-31) +# [5.5.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.4.0...v5.5.0) (2021-11-29) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal +# [5.4.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.3.1...v5.4.0) (2021-11-15) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal +## [5.3.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.3.0...v5.3.1) (2021-11-08) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal -## [5.10.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.10.0...v5.10.1) (2022-01-24) +# [5.3.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.2.0...v5.3.0) (2021-11-01) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal +# [5.2.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.1.0...v5.2.0) (2021-10-25) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal +# [5.1.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.0.0...v5.1.0) (2021-10-18) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal -# [5.10.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.9.1...v5.10.0) (2022-01-17) - +# [5.0.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.33.0...v5.0.0) (2021-10-11) ### Features -* rename `experimental-utils` to `utils` and make `experimental-utils` an alias to the new package ([#4172](https://github.com/typescript-eslint/typescript-eslint/issues/4172)) ([1d55a75](https://github.com/typescript-eslint/typescript-eslint/commit/1d55a7511b38d8e2b2eabe59f639e0a865e6c93f)) +- remove `meta.docs.category` from rules ([#3800](https://github.com/typescript-eslint/typescript-eslint/issues/3800)) ([71c9370](https://github.com/typescript-eslint/typescript-eslint/commit/71c93706e55f5f92a1285102b93c6ab1950c6df4)) +- support ESLint v8 ([#3737](https://github.com/typescript-eslint/typescript-eslint/issues/3737)) ([4ca62ae](https://github.com/typescript-eslint/typescript-eslint/commit/4ca62aee6681d706e762a8db727541ca204364f2)) + +# [4.33.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.32.0...v4.33.0) (2021-10-04) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal +# [4.32.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.31.2...v4.32.0) (2021-09-27) +### Features +- **eslint-plugin-internal:** [prefer-ast-types-enum] add `DefinitionType` enum ([#3916](https://github.com/typescript-eslint/typescript-eslint/issues/3916)) ([13b7de5](https://github.com/typescript-eslint/typescript-eslint/commit/13b7de508e0f8eac492879ff9ab99acd8d3e977e)) -## [5.9.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.9.0...v5.9.1) (2022-01-10) +## [4.31.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.31.1...v4.31.2) (2021-09-20) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal +## [4.31.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.31.0...v4.31.1) (2021-09-13) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal +# [4.31.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.30.0...v4.31.0) (2021-09-06) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal -# [5.9.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.8.1...v5.9.0) (2022-01-03) +# [4.30.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.29.3...v4.30.0) (2021-08-30) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal +## [4.29.3](https://github.com/typescript-eslint/typescript-eslint/compare/v4.29.2...v4.29.3) (2021-08-23) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal +## [4.29.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.29.1...v4.29.2) (2021-08-16) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal -## [5.8.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.8.0...v5.8.1) (2021-12-27) +## [4.29.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.29.0...v4.29.1) (2021-08-09) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal +# [4.29.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.5...v4.29.0) (2021-08-02) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal +## [4.28.5](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.4...v4.28.5) (2021-07-26) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal -# [5.8.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.7.0...v5.8.0) (2021-12-20) +## [4.28.4](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.3...v4.28.4) (2021-07-19) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal +## [4.28.3](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.2...v4.28.3) (2021-07-12) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal +## [4.28.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.1...v4.28.2) (2021-07-05) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal -# [5.7.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.6.0...v5.7.0) (2021-12-13) +## [4.28.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.0...v4.28.1) (2021-06-28) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal +# [4.28.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.27.0...v4.28.0) (2021-06-21) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal +# [4.27.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.26.1...v4.27.0) (2021-06-14) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal -# [5.6.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.5.0...v5.6.0) (2021-12-06) +## [4.26.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.26.0...v4.26.1) (2021-06-07) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal +# [4.26.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.25.0...v4.26.0) (2021-05-31) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal +# [4.25.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.24.0...v4.25.0) (2021-05-24) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal -# [5.5.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.4.0...v5.5.0) (2021-11-29) +# [4.24.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.23.0...v4.24.0) (2021-05-17) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal +# [4.23.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.22.1...v4.23.0) (2021-05-10) +### Features +- refactor to split AST specification out as its own module ([#2911](https://github.com/typescript-eslint/typescript-eslint/issues/2911)) ([25ea953](https://github.com/typescript-eslint/typescript-eslint/commit/25ea953cc60b118bd385c71e0a9b61c286c26fcf)) - -# [5.4.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.3.1...v5.4.0) (2021-11-15) +## [4.22.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.22.0...v4.22.1) (2021-05-04) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal +# [4.22.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.21.0...v4.22.0) (2021-04-12) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal +# [4.21.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.20.0...v4.21.0) (2021-04-05) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal -## [5.3.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.3.0...v5.3.1) (2021-11-08) +# [4.20.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.19.0...v4.20.0) (2021-03-29) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal +# [4.19.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.18.0...v4.19.0) (2021-03-22) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal +# [4.18.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.17.0...v4.18.0) (2021-03-15) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal -# [5.3.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.2.0...v5.3.0) (2021-11-01) +# [4.17.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.16.1...v4.17.0) (2021-03-08) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal +## [4.16.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.16.0...v4.16.1) (2021-03-01) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal +# [4.16.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.15.2...v4.16.0) (2021-03-01) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal -# [5.2.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.1.0...v5.2.0) (2021-10-25) +## [4.15.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.15.1...v4.15.2) (2021-02-22) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal +## [4.15.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.15.0...v4.15.1) (2021-02-15) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal +# [4.15.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.14.2...v4.15.0) (2021-02-08) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal -# [5.1.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.0.0...v5.1.0) (2021-10-18) +## [4.14.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.14.1...v4.14.2) (2021-02-01) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal +## [4.14.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.14.0...v4.14.1) (2021-01-25) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal +# [4.14.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.13.0...v4.14.0) (2021-01-18) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal -# [5.0.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.33.0...v5.0.0) (2021-10-11) +# [4.13.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.12.0...v4.13.0) (2021-01-11) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal -### Features +# [4.12.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.11.1...v4.12.0) (2021-01-04) -* remove `meta.docs.category` from rules ([#3800](https://github.com/typescript-eslint/typescript-eslint/issues/3800)) ([71c9370](https://github.com/typescript-eslint/typescript-eslint/commit/71c93706e55f5f92a1285102b93c6ab1950c6df4)) -* support ESLint v8 ([#3737](https://github.com/typescript-eslint/typescript-eslint/issues/3737)) ([4ca62ae](https://github.com/typescript-eslint/typescript-eslint/commit/4ca62aee6681d706e762a8db727541ca204364f2)) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal +## [4.11.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.11.0...v4.11.1) (2020-12-28) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal +# [4.11.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.10.0...v4.11.0) (2020-12-21) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal -# [4.33.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.32.0...v4.33.0) (2021-10-04) +# [4.10.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.9.1...v4.10.0) (2020-12-14) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal +## [4.9.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.9.0...v4.9.1) (2020-12-07) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal +# [4.9.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.8.2...v4.9.0) (2020-11-30) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal -# [4.32.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.31.2...v4.32.0) (2021-09-27) +## [4.8.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.8.1...v4.8.2) (2020-11-23) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal -### Features +## [4.8.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.8.0...v4.8.1) (2020-11-17) -* **eslint-plugin-internal:** [prefer-ast-types-enum] add `DefinitionType` enum ([#3916](https://github.com/typescript-eslint/typescript-eslint/issues/3916)) ([13b7de5](https://github.com/typescript-eslint/typescript-eslint/commit/13b7de508e0f8eac492879ff9ab99acd8d3e977e)) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal +# [4.8.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.7.0...v4.8.0) (2020-11-16) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal +# [4.7.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.6.1...v4.7.0) (2020-11-09) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal -## [4.31.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.31.1...v4.31.2) (2021-09-20) +## [4.6.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.6.0...v4.6.1) (2020-11-02) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal +# [4.6.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.5.0...v4.6.0) (2020-10-26) + +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal +# [4.5.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.4.1...v4.5.0) (2020-10-19) +### Features +- **typescript-estree:** add flag EXPERIMENTAL_useSourceOfProjectReferenceRedirect ([#2669](https://github.com/typescript-eslint/typescript-eslint/issues/2669)) ([90a5878](https://github.com/typescript-eslint/typescript-eslint/commit/90a587845088da1b205e4d7d77dbc3f9447b1c5a)) -## [4.31.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.31.0...v4.31.1) (2021-09-13) +## [4.4.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.4.0...v4.4.1) (2020-10-12) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal +# [4.4.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.3.0...v4.4.0) (2020-10-05) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal +# [4.3.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.2.0...v4.3.0) (2020-09-28) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal -# [4.31.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.30.0...v4.31.0) (2021-09-06) +# [4.2.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.1.1...v4.2.0) (2020-09-21) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal - - - - -# [4.30.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.29.3...v4.30.0) (2021-08-30) - -**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal - - - - - -## [4.29.3](https://github.com/typescript-eslint/typescript-eslint/compare/v4.29.2...v4.29.3) (2021-08-23) - -**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal - - - - - -## [4.29.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.29.1...v4.29.2) (2021-08-16) - -**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal - - - - - -## [4.29.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.29.0...v4.29.1) (2021-08-09) - -**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal - - - - - -# [4.29.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.5...v4.29.0) (2021-08-02) - -**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal - - - - - -## [4.28.5](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.4...v4.28.5) (2021-07-26) - -**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal - - - - - -## [4.28.4](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.3...v4.28.4) (2021-07-19) - -**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal - - - - - -## [4.28.3](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.2...v4.28.3) (2021-07-12) - -**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal - - - - - -## [4.28.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.1...v4.28.2) (2021-07-05) - -**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal - - - - - -## [4.28.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.0...v4.28.1) (2021-06-28) - -**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal - - - - - -# [4.28.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.27.0...v4.28.0) (2021-06-21) - -**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal - - - - - -# [4.27.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.26.1...v4.27.0) (2021-06-14) - -**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal - - - - - -## [4.26.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.26.0...v4.26.1) (2021-06-07) - -**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal - - - - - -# [4.26.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.25.0...v4.26.0) (2021-05-31) - -**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal - - - - - -# [4.25.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.24.0...v4.25.0) (2021-05-24) - -**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal - - - - - -# [4.24.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.23.0...v4.24.0) (2021-05-17) - -**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal - - - - - -# [4.23.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.22.1...v4.23.0) (2021-05-10) - - -### Features - -* refactor to split AST specification out as its own module ([#2911](https://github.com/typescript-eslint/typescript-eslint/issues/2911)) ([25ea953](https://github.com/typescript-eslint/typescript-eslint/commit/25ea953cc60b118bd385c71e0a9b61c286c26fcf)) - - - - - -## [4.22.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.22.0...v4.22.1) (2021-05-04) - -**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal - - - - - -# [4.22.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.21.0...v4.22.0) (2021-04-12) - -**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal - - - - - -# [4.21.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.20.0...v4.21.0) (2021-04-05) - -**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal - - - - - -# [4.20.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.19.0...v4.20.0) (2021-03-29) - -**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal - - - - - -# [4.19.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.18.0...v4.19.0) (2021-03-22) - -**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal - - - - - -# [4.18.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.17.0...v4.18.0) (2021-03-15) - -**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal - - - - - -# [4.17.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.16.1...v4.17.0) (2021-03-08) - -**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal - - - - - -## [4.16.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.16.0...v4.16.1) (2021-03-01) - -**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal - - - - - -# [4.16.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.15.2...v4.16.0) (2021-03-01) - -**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal - - - - - -## [4.15.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.15.1...v4.15.2) (2021-02-22) - -**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal - - - - - -## [4.15.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.15.0...v4.15.1) (2021-02-15) - -**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal - - - - - -# [4.15.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.14.2...v4.15.0) (2021-02-08) - -**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal - - - - - -## [4.14.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.14.1...v4.14.2) (2021-02-01) - -**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal - - - - - -## [4.14.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.14.0...v4.14.1) (2021-01-25) - -**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal - - - - - -# [4.14.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.13.0...v4.14.0) (2021-01-18) - -**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal - - - - - -# [4.13.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.12.0...v4.13.0) (2021-01-11) - -**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal - - - - - -# [4.12.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.11.1...v4.12.0) (2021-01-04) - -**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal - - - - - -## [4.11.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.11.0...v4.11.1) (2020-12-28) - -**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal - - - - - -# [4.11.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.10.0...v4.11.0) (2020-12-21) - -**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal - - - - - -# [4.10.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.9.1...v4.10.0) (2020-12-14) - -**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal - - - - - -## [4.9.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.9.0...v4.9.1) (2020-12-07) - -**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal - - - - - -# [4.9.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.8.2...v4.9.0) (2020-11-30) - -**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal - - - - - -## [4.8.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.8.1...v4.8.2) (2020-11-23) - -**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal - - - - - -## [4.8.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.8.0...v4.8.1) (2020-11-17) - -**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal - - - - - -# [4.8.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.7.0...v4.8.0) (2020-11-16) - -**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal - - - - - -# [4.7.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.6.1...v4.7.0) (2020-11-09) - -**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal - - - - - -## [4.6.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.6.0...v4.6.1) (2020-11-02) - -**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal - - - - - -# [4.6.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.5.0...v4.6.0) (2020-10-26) - -**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal - - - - - -# [4.5.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.4.1...v4.5.0) (2020-10-19) - - -### Features - -* **typescript-estree:** add flag EXPERIMENTAL_useSourceOfProjectReferenceRedirect ([#2669](https://github.com/typescript-eslint/typescript-eslint/issues/2669)) ([90a5878](https://github.com/typescript-eslint/typescript-eslint/commit/90a587845088da1b205e4d7d77dbc3f9447b1c5a)) - - - - - -## [4.4.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.4.0...v4.4.1) (2020-10-12) - -**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal - - - - - -# [4.4.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.3.0...v4.4.0) (2020-10-05) - -**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal - - - - - -# [4.3.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.2.0...v4.3.0) (2020-09-28) - -**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal - - - - - -# [4.2.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.1.1...v4.2.0) (2020-09-21) - -**Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal - - - - - -## [4.1.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.1.0...v4.1.1) (2020-09-14) +## [4.1.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.1.0...v4.1.1) (2020-09-14) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal - - - - # [4.1.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.0.1...v4.1.0) (2020-09-07) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal - - - - ## [4.0.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.0.0...v4.0.1) (2020-08-31) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal - - - - # [4.0.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.10.1...v4.0.0) (2020-08-31) ## [Please see the release notes for v4.0.0](https://github.com/typescript-eslint/typescript-eslint/releases/tag/v4.0.0) ### Features -* support ESTree optional chaining representation ([#2308](https://github.com/typescript-eslint/typescript-eslint/issues/2308)) ([e9d2ab6](https://github.com/typescript-eslint/typescript-eslint/commit/e9d2ab638b6767700b52797e74b814ea059beaae)) - - - - +- support ESTree optional chaining representation ([#2308](https://github.com/typescript-eslint/typescript-eslint/issues/2308)) ([e9d2ab6](https://github.com/typescript-eslint/typescript-eslint/commit/e9d2ab638b6767700b52797e74b814ea059beaae)) ## [3.10.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.10.0...v3.10.1) (2020-08-25) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal - - - - # [3.10.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.9.1...v3.10.0) (2020-08-24) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal - - - - ## [3.9.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.9.0...v3.9.1) (2020-08-17) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal - - - - # [3.9.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.8.0...v3.9.0) (2020-08-10) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal - - - - # [3.8.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.7.1...v3.8.0) (2020-08-03) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal - - - - ## [3.7.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.7.0...v3.7.1) (2020-07-27) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal - - - - # [3.7.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.6.1...v3.7.0) (2020-07-20) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal - - - - ## [3.6.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.6.0...v3.6.1) (2020-07-13) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal - - - - # [3.6.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.5.0...v3.6.0) (2020-07-06) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal - - - - # [3.5.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.4.0...v3.5.0) (2020-06-29) - ### Features -* add package scope-manager ([#1939](https://github.com/typescript-eslint/typescript-eslint/issues/1939)) ([682eb7e](https://github.com/typescript-eslint/typescript-eslint/commit/682eb7e009c3f22a542882dfd3602196a60d2a1e)) -* split types into their own package ([#2229](https://github.com/typescript-eslint/typescript-eslint/issues/2229)) ([5f45918](https://github.com/typescript-eslint/typescript-eslint/commit/5f4591886f3438329fbf2229b03ac66174334a24)) - - - - +- add package scope-manager ([#1939](https://github.com/typescript-eslint/typescript-eslint/issues/1939)) ([682eb7e](https://github.com/typescript-eslint/typescript-eslint/commit/682eb7e009c3f22a542882dfd3602196a60d2a1e)) +- split types into their own package ([#2229](https://github.com/typescript-eslint/typescript-eslint/issues/2229)) ([5f45918](https://github.com/typescript-eslint/typescript-eslint/commit/5f4591886f3438329fbf2229b03ac66174334a24)) # [3.4.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.3.0...v3.4.0) (2020-06-22) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal - - - - # [3.3.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.2.0...v3.3.0) (2020-06-15) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal - - - - # [3.2.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.1.0...v3.2.0) (2020-06-08) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal - - - - # [3.1.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.0.2...v3.1.0) (2020-06-01) - ### Bug Fixes -* **experimental-utils:** downlevel type declarations for versions older than 3.8 ([#2133](https://github.com/typescript-eslint/typescript-eslint/issues/2133)) ([7925823](https://github.com/typescript-eslint/typescript-eslint/commit/792582326a8065270b69a0ffcaad5a7b4b103ff3)) - - - - +- **experimental-utils:** downlevel type declarations for versions older than 3.8 ([#2133](https://github.com/typescript-eslint/typescript-eslint/issues/2133)) ([7925823](https://github.com/typescript-eslint/typescript-eslint/commit/792582326a8065270b69a0ffcaad5a7b4b103ff3)) ## [3.0.2](https://github.com/typescript-eslint/typescript-eslint/compare/v3.0.1...v3.0.2) (2020-05-27) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal - - - - ## [3.0.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.0.0...v3.0.1) (2020-05-25) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal - - - - # [3.0.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.34.0...v3.0.0) (2020-05-21) ## [Please see the release notes for v3.0.0](https://github.com/typescript-eslint/typescript-eslint/releases/tag/v3.0.0) ### Features -* upgrade to ESLint v7 ([#2022](https://github.com/typescript-eslint/typescript-eslint/issues/2022)) ([208de71](https://github.com/typescript-eslint/typescript-eslint/commit/208de71059746bf38e94bd460346ffb2698a3e12)) - - - - +- upgrade to ESLint v7 ([#2022](https://github.com/typescript-eslint/typescript-eslint/issues/2022)) ([208de71](https://github.com/typescript-eslint/typescript-eslint/commit/208de71059746bf38e94bd460346ffb2698a3e12)) # [2.34.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.33.0...v2.34.0) (2020-05-18) - ### Features -* **experimental-utils:** add `suggestion` property for rule modules ([#2033](https://github.com/typescript-eslint/typescript-eslint/issues/2033)) ([f42a5b0](https://github.com/typescript-eslint/typescript-eslint/commit/f42a5b09ebfa173f418a99c552b0cbe221567194)) - - - - +- **experimental-utils:** add `suggestion` property for rule modules ([#2033](https://github.com/typescript-eslint/typescript-eslint/issues/2033)) ([f42a5b0](https://github.com/typescript-eslint/typescript-eslint/commit/f42a5b09ebfa173f418a99c552b0cbe221567194)) # [2.33.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.32.0...v2.33.0) (2020-05-12) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal - - - - # [2.32.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.31.0...v2.32.0) (2020-05-11) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal - - - - # [2.31.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.30.0...v2.31.0) (2020-05-04) - ### Features -* **eslint-plugin-internal:** add rule no-poorly-typed-ts-props ([#1949](https://github.com/typescript-eslint/typescript-eslint/issues/1949)) ([56ea7c9](https://github.com/typescript-eslint/typescript-eslint/commit/56ea7c9581c0c99fe394bbcfc4128e8054c88ab2)) -* **experimental-utils:** expose our RuleTester extension ([#1948](https://github.com/typescript-eslint/typescript-eslint/issues/1948)) ([2dd1638](https://github.com/typescript-eslint/typescript-eslint/commit/2dd1638aaa2658ba99b2341861146b586f489121)) - - - - +- **eslint-plugin-internal:** add rule no-poorly-typed-ts-props ([#1949](https://github.com/typescript-eslint/typescript-eslint/issues/1949)) ([56ea7c9](https://github.com/typescript-eslint/typescript-eslint/commit/56ea7c9581c0c99fe394bbcfc4128e8054c88ab2)) +- **experimental-utils:** expose our RuleTester extension ([#1948](https://github.com/typescript-eslint/typescript-eslint/issues/1948)) ([2dd1638](https://github.com/typescript-eslint/typescript-eslint/commit/2dd1638aaa2658ba99b2341861146b586f489121)) # [2.30.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.29.0...v2.30.0) (2020-04-27) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal - - - - # [2.29.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.28.0...v2.29.0) (2020-04-20) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal - - - - # [2.28.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.27.0...v2.28.0) (2020-04-13) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal - - - - # [2.27.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.26.0...v2.27.0) (2020-04-06) - ### Features -* **eslint-plugin-internal:** add plugin-test-formatting rule ([#1821](https://github.com/typescript-eslint/typescript-eslint/issues/1821)) ([9b0023a](https://github.com/typescript-eslint/typescript-eslint/commit/9b0023a4996ecdd7dfcb30abd1678091a78f3064)) - - - - +- **eslint-plugin-internal:** add plugin-test-formatting rule ([#1821](https://github.com/typescript-eslint/typescript-eslint/issues/1821)) ([9b0023a](https://github.com/typescript-eslint/typescript-eslint/commit/9b0023a4996ecdd7dfcb30abd1678091a78f3064)) # [2.26.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.25.0...v2.26.0) (2020-03-30) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal - - - - # [2.25.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.24.0...v2.25.0) (2020-03-23) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal - - - - # [2.24.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.23.0...v2.24.0) (2020-03-16) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal - - - - # [2.23.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.22.0...v2.23.0) (2020-03-09) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal - - - - # [2.22.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.21.0...v2.22.0) (2020-03-02) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal - - - - # [2.21.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.20.0...v2.21.0) (2020-02-24) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal - - - - # [2.20.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.19.2...v2.20.0) (2020-02-17) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal - - - - ## [2.19.2](https://github.com/typescript-eslint/typescript-eslint/compare/v2.19.1...v2.19.2) (2020-02-10) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal - - - - ## [2.19.1](https://github.com/typescript-eslint/typescript-eslint/compare/v2.19.0...v2.19.1) (2020-02-10) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal - - - - # [2.19.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.18.0...v2.19.0) (2020-02-03) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal - - - - # [2.18.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.17.0...v2.18.0) (2020-01-27) - ### Features -* **eslint-plugin-internal:** add `prefer-ast-types-enum` ([#1508](https://github.com/typescript-eslint/typescript-eslint/issues/1508)) ([c3d0a3a](https://github.com/typescript-eslint/typescript-eslint/commit/c3d0a3a6bdff0cae226a279f0a0a9b00952ca925)) - - - - +- **eslint-plugin-internal:** add `prefer-ast-types-enum` ([#1508](https://github.com/typescript-eslint/typescript-eslint/issues/1508)) ([c3d0a3a](https://github.com/typescript-eslint/typescript-eslint/commit/c3d0a3a6bdff0cae226a279f0a0a9b00952ca925)) # [2.17.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.16.0...v2.17.0) (2020-01-20) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal - - - - # [2.16.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.15.0...v2.16.0) (2020-01-13) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal - - - - # [2.15.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.14.0...v2.15.0) (2020-01-06) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-internal - - - - # [2.14.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.13.0...v2.14.0) (2019-12-30) - ### Features -* add internal eslint plugin for repo-specific lint rules ([#1373](https://github.com/typescript-eslint/typescript-eslint/issues/1373)) ([3a15413](https://github.com/typescript-eslint/typescript-eslint/commit/3a15413)) +- add internal eslint plugin for repo-specific lint rules ([#1373](https://github.com/typescript-eslint/typescript-eslint/issues/1373)) ([3a15413](https://github.com/typescript-eslint/typescript-eslint/commit/3a15413)) diff --git a/packages/eslint-plugin-internal/README.md b/packages/eslint-plugin-internal/README.md index adf36999928..7d081266c54 100644 --- a/packages/eslint-plugin-internal/README.md +++ b/packages/eslint-plugin-internal/README.md @@ -1,9 +1,10 @@ -

Internal ESLint Plugin

+# `@typescript-eslint/eslint-plugin-internal` -

An ESLint plugin used internally in this project to ensure consistency.

+> An ESLint plugin used internally in this project to ensure consistency. -

- CI -

+## ✋ Internal Package -This plugin is not intended to be used externally. +This is an _internal package_ to the [typescript-eslint monorepo](https://github.com/typescript-eslint/typescript-eslint). +You likely don't want to use it directly. + +👉 See **https://typescript-eslint.io** for docs on typescript-eslint. diff --git a/packages/eslint-plugin-internal/jest.config.js b/packages/eslint-plugin-internal/jest.config.js index 910991b20cf..72e29aa600b 100644 --- a/packages/eslint-plugin-internal/jest.config.js +++ b/packages/eslint-plugin-internal/jest.config.js @@ -4,4 +4,5 @@ /** @type {import('@jest/types').Config.InitialOptions} */ module.exports = { ...require('../../jest.config.base.js'), + coveragePathIgnorePatterns: ['src/index.ts$', 'src/configs/.*.ts$'], }; diff --git a/packages/eslint-plugin-internal/package.json b/packages/eslint-plugin-internal/package.json index d86f638ef34..7b81526e7ed 100644 --- a/packages/eslint-plugin-internal/package.json +++ b/packages/eslint-plugin-internal/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/eslint-plugin-internal", - "version": "5.31.0", + "version": "5.50.0", "private": true, "main": "dist/index.js", "scripts": { @@ -8,14 +8,15 @@ "clean": "tsc -b tsconfig.build.json --clean", "postclean": "rimraf dist && rimraf coverage", "format": "prettier --write \"./**/*.{ts,mts,cts,tsx,js,mjs,cjs,jsx,json,md,css}\" --ignore-path ../../.prettierignore", - "lint": "eslint . --ignore-path='../../.eslintignore'", + "lint": "nx lint", "test": "jest --coverage", "typecheck": "tsc -p tsconfig.json --noEmit" }, "dependencies": { "@types/prettier": "*", - "@typescript-eslint/scope-manager": "5.31.0", - "@typescript-eslint/utils": "5.31.0", + "@typescript-eslint/scope-manager": "5.50.0", + "@typescript-eslint/type-utils": "5.50.0", + "@typescript-eslint/utils": "5.50.0", "prettier": "*" } } diff --git a/packages/eslint-plugin-internal/project.json b/packages/eslint-plugin-internal/project.json index 948fce1f60c..e7ac6302d69 100644 --- a/packages/eslint-plugin-internal/project.json +++ b/packages/eslint-plugin-internal/project.json @@ -1,5 +1,15 @@ { - "root": "packages/eslint-plugin-internal", + "name": "eslint-plugin-internal", + "$schema": "../../node_modules/nx/schemas/project-schema.json", "type": "library", - "implicitDependencies": [] + "implicitDependencies": [], + "targets": { + "lint": { + "executor": "@nrwl/linter:eslint", + "outputs": ["{options.outputFile}"], + "options": { + "lintFilePatterns": ["packages/eslint-plugin-internal/**/*.ts"] + } + } + } } diff --git a/packages/eslint-plugin-internal/src/rules/no-poorly-typed-ts-props.ts b/packages/eslint-plugin-internal/src/rules/no-poorly-typed-ts-props.ts index 456a17f7da1..0c671d8432f 100644 --- a/packages/eslint-plugin-internal/src/rules/no-poorly-typed-ts-props.ts +++ b/packages/eslint-plugin-internal/src/rules/no-poorly-typed-ts-props.ts @@ -1,4 +1,6 @@ -import { ESLintUtils, TSESLint, TSESTree } from '@typescript-eslint/utils'; +import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; +import { ESLintUtils } from '@typescript-eslint/utils'; + import { createRule } from '../util'; /* @@ -33,9 +35,8 @@ export default createRule({ type: 'problem', docs: { description: - "Enforces rules don't use TS API properties with known bad type definitions", + "Enforce that rules don't use TS API properties with known bad type definitions", recommended: 'error', - suggestion: true, requiresTypeChecking: true, }, fixable: 'code', diff --git a/packages/eslint-plugin-internal/src/rules/no-typescript-default-import.ts b/packages/eslint-plugin-internal/src/rules/no-typescript-default-import.ts index 437e244b9db..fd7279c3823 100644 --- a/packages/eslint-plugin-internal/src/rules/no-typescript-default-import.ts +++ b/packages/eslint-plugin-internal/src/rules/no-typescript-default-import.ts @@ -1,4 +1,6 @@ -import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; + import { createRule } from '../util'; /* @@ -18,7 +20,7 @@ export default createRule({ type: 'problem', docs: { description: - "Enforces that packages rules don't do `import ts from 'typescript';`", + "Enforce that packages rules don't do `import ts from 'typescript';`", recommended: 'error', }, fixable: 'code', diff --git a/packages/eslint-plugin-internal/src/rules/no-typescript-estree-import.ts b/packages/eslint-plugin-internal/src/rules/no-typescript-estree-import.ts index 022fd98b7ca..28f7439472b 100644 --- a/packages/eslint-plugin-internal/src/rules/no-typescript-estree-import.ts +++ b/packages/eslint-plugin-internal/src/rules/no-typescript-estree-import.ts @@ -15,7 +15,7 @@ export default createRule({ meta: { type: 'problem', docs: { - description: `Enforces that eslint-plugin rules don't require anything from ${TSESTREE_NAME} or ${TYPES_NAME}`, + description: `Enforce that eslint-plugin rules don't require anything from ${TSESTREE_NAME} or ${TYPES_NAME}`, recommended: 'error', }, fixable: 'code', diff --git a/packages/eslint-plugin-internal/src/rules/plugin-test-formatting.ts b/packages/eslint-plugin-internal/src/rules/plugin-test-formatting.ts index 8b3ec8ffdb8..313a32eea5b 100644 --- a/packages/eslint-plugin-internal/src/rules/plugin-test-formatting.ts +++ b/packages/eslint-plugin-internal/src/rules/plugin-test-formatting.ts @@ -1,5 +1,8 @@ -import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils'; +import { getContextualType } from '@typescript-eslint/type-utils'; +import type { TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES, ESLintUtils } from '@typescript-eslint/utils'; import { format, resolveConfig } from 'prettier'; + import { createRule } from '../util'; /* @@ -104,8 +107,9 @@ export default createRule({ meta: { type: 'problem', docs: { - description: `Enforces that eslint-plugin test snippets are correctly formatted`, + description: `Enforce that eslint-plugin test snippets are correctly formatted`, recommended: 'error', + requiresTypeChecking: true, }, fixable: 'code', schema: [ @@ -144,6 +148,11 @@ export default createRule({ ], create(context, [{ formatWithPrettier }]) { const sourceCode = context.getSourceCode(); + const { program, esTreeNodeToTSNodeMap } = + ESLintUtils.getParserServices(context); + const checker = program.getTypeChecker(); + + const checkedObjects = new Set(); function prettierFormat( code: string, @@ -157,7 +166,7 @@ export default createRule({ return format(code, { ...prettierConfig, parser: 'typescript', - }).trimRight(); // prettier will insert a new line at the end of the code + }).trimEnd(); // prettier will insert a new line at the end of the code } catch (ex) { // adapted from https://github.com/prettier/eslint-plugin-prettier/blob/185b1064d3dd674538456fb2fad97fbfcde49e0d/eslint-plugin-prettier.js#L242-L257 if (!(ex instanceof SyntaxError)) { @@ -188,8 +197,11 @@ export default createRule({ } } - function checkExpression(node: TSESTree.Node, isErrorTest: boolean): void { - switch (node.type) { + function checkExpression( + node: TSESTree.Node | null, + isErrorTest: boolean, + ): void { + switch (node?.type) { case AST_NODE_TYPES.Literal: checkLiteral(node, isErrorTest); break; @@ -282,9 +294,9 @@ export default createRule({ const lines = text.split('\n'); const lastLine = lines[lines.length - 1]; // prettier will trim out the end of line on save, but eslint will check before then - const isStartEmpty = lines[0].trimRight() === ''; + const isStartEmpty = lines[0].trimEnd() === ''; // last line can be indented - const isEndEmpty = lastLine.trimLeft() === ''; + const isEndEmpty = lastLine.trimStart() === ''; if (!isStartEmpty || !isEndEmpty) { // multiline template strings must have an empty first/last line return context.report({ @@ -446,6 +458,12 @@ export default createRule({ test: TSESTree.ObjectExpression, isErrorTest = true, ): void { + if (checkedObjects.has(test)) { + return; + } + + checkedObjects.add(test); + for (const prop of test.properties) { if ( prop.type !== AST_NODE_TYPES.Property || @@ -455,7 +473,7 @@ export default createRule({ continue; } - if (prop.key.name === 'code' || prop.key.name === 'output') { + if (prop.key.name === 'code') { checkExpression(prop.value, isErrorTest); } } @@ -463,7 +481,7 @@ export default createRule({ function checkValidTest(tests: TSESTree.ArrayExpression): void { for (const test of tests.elements) { - switch (test.type) { + switch (test?.type) { case AST_NODE_TYPES.ObjectExpression: // delegate object-style tests to the invalid checker checkInvalidTest(test, false); @@ -476,33 +494,99 @@ export default createRule({ } } - const invalidTestsSelectorPath = [ - AST_NODE_TYPES.CallExpression, - AST_NODE_TYPES.ObjectExpression, - 'Property[key.name = "invalid"]', - AST_NODE_TYPES.ArrayExpression, - AST_NODE_TYPES.ObjectExpression, - ]; - return { // valid 'CallExpression > ObjectExpression > Property[key.name = "valid"] > ArrayExpression': checkValidTest, // invalid - errors - [invalidTestsSelectorPath.join(' > ')]: checkInvalidTest, - // invalid - suggestions [[ - ...invalidTestsSelectorPath, - 'Property[key.name = "errors"]', - AST_NODE_TYPES.ArrayExpression, + AST_NODE_TYPES.CallExpression, AST_NODE_TYPES.ObjectExpression, - 'Property[key.name = "suggestions"]', + 'Property[key.name = "invalid"]', AST_NODE_TYPES.ArrayExpression, AST_NODE_TYPES.ObjectExpression, ].join(' > ')]: checkInvalidTest, // special case for our batchedSingleLineTests utility 'CallExpression[callee.name = "batchedSingleLineTests"] > ObjectExpression': checkInvalidTest, + + /** + * generic, type-aware handling for any old object + * this is a fallback to handle random variables people declare or object + * literals that are passed via array maps, etc + */ + ObjectExpression(node): void { + if (checkedObjects.has(node)) { + return; + } + + const type = getContextualType( + checker, + esTreeNodeToTSNodeMap.get(node), + ); + if (!type) { + return; + } + + const typeString = checker.typeToString(type); + if (/^RunTests\b/.test(typeString)) { + checkedObjects.add(node); + + for (const prop of node.properties) { + if ( + prop.type === AST_NODE_TYPES.SpreadElement || + prop.computed || + prop.key.type !== AST_NODE_TYPES.Identifier || + prop.value.type !== AST_NODE_TYPES.ArrayExpression + ) { + continue; + } + + switch (prop.key.name) { + case 'valid': + checkValidTest(prop.value); + break; + + case 'invalid': + for (const element of prop.value.elements) { + if (element?.type === AST_NODE_TYPES.ObjectExpression) { + checkInvalidTest(element); + } + } + break; + } + } + return; + } + + if (/^ValidTestCase\b/.test(typeString)) { + checkInvalidTest(node); + return; + } + + if (/^InvalidTestCase\b/.test(typeString)) { + checkInvalidTest(node); + for (const testProp of node.properties) { + if ( + testProp.type === AST_NODE_TYPES.SpreadElement || + testProp.computed || + testProp.key.type !== AST_NODE_TYPES.Identifier || + testProp.key.name !== 'errors' || + testProp.value.type !== AST_NODE_TYPES.ArrayExpression + ) { + continue; + } + + for (const errorElement of testProp.value.elements) { + if (errorElement?.type !== AST_NODE_TYPES.ObjectExpression) { + continue; + } + + checkInvalidTest(errorElement); + } + } + } + }, }; }, }); diff --git a/packages/eslint-plugin-internal/src/rules/prefer-ast-types-enum.ts b/packages/eslint-plugin-internal/src/rules/prefer-ast-types-enum.ts index d74104e5fcf..4099e2f02be 100755 --- a/packages/eslint-plugin-internal/src/rules/prefer-ast-types-enum.ts +++ b/packages/eslint-plugin-internal/src/rules/prefer-ast-types-enum.ts @@ -1,9 +1,7 @@ -import { - AST_NODE_TYPES, - AST_TOKEN_TYPES, - TSESTree, -} from '@typescript-eslint/utils'; import { DefinitionType } from '@typescript-eslint/scope-manager'; +import type { TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES, AST_TOKEN_TYPES } from '@typescript-eslint/utils'; + import { createRule } from '../util'; const isStringLiteral = ( @@ -17,7 +15,7 @@ export default createRule({ docs: { recommended: 'error', description: - 'Ensures consistent usage of `AST_NODE_TYPES`, `AST_TOKEN_TYPES` and `DefinitionType` enums.', + 'Enforce consistent usage of `AST_NODE_TYPES`, `AST_TOKEN_TYPES` and `DefinitionType` enums', }, messages: { preferEnum: 'Prefer {{ enumName }}.{{ literal }} over raw literal', diff --git a/packages/eslint-plugin-internal/tests/rules/no-poorly-typed-ts-props.test.ts b/packages/eslint-plugin-internal/tests/rules/no-poorly-typed-ts-props.test.ts index 4c9751489bd..b0b80f56cc3 100644 --- a/packages/eslint-plugin-internal/tests/rules/no-poorly-typed-ts-props.test.ts +++ b/packages/eslint-plugin-internal/tests/rules/no-poorly-typed-ts-props.test.ts @@ -32,7 +32,7 @@ baz.symbol.name; import ts from 'typescript'; declare const thing: ts.Symbol; thing.declarations.map(decl => {}); - `.trimRight(), + `, errors: [ { messageId: 'doNotUseWithFixer', @@ -53,7 +53,7 @@ thing.declarations.map(decl => {}); import ts from 'typescript'; declare const thing: ts.Symbol; thing.getDeclarations().map(decl => {}); - `.trimRight(), + `, }, ], }, @@ -64,7 +64,7 @@ thing.getDeclarations().map(decl => {}); import ts from 'typescript'; declare const thing: ts.Type; thing.symbol; - `.trimRight(), + `, errors: [ { messageId: 'doNotUseWithFixer', @@ -85,7 +85,7 @@ thing.symbol; import ts from 'typescript'; declare const thing: ts.Type; thing.getSymbol(); - `.trimRight(), + `, }, ], }, @@ -96,7 +96,7 @@ thing.getSymbol(); import ts from 'typescript'; declare const thing: ts.Type; thing?.symbol; - `.trimRight(), + `, errors: [ { messageId: 'doNotUseWithFixer', @@ -117,7 +117,7 @@ thing?.symbol; import ts from 'typescript'; declare const thing: ts.Type; thing?.getSymbol(); - `.trimRight(), + `, }, ], }, diff --git a/packages/eslint-plugin-internal/tests/rules/no-typescript-default-import.test.ts b/packages/eslint-plugin-internal/tests/rules/no-typescript-default-import.test.ts index 3c8db9e6651..35d2f13d329 100644 --- a/packages/eslint-plugin-internal/tests/rules/no-typescript-default-import.test.ts +++ b/packages/eslint-plugin-internal/tests/rules/no-typescript-default-import.test.ts @@ -1,5 +1,5 @@ import rule from '../../src/rules/no-typescript-default-import'; -import { RuleTester, batchedSingleLineTests } from '../RuleTester'; +import { batchedSingleLineTests, RuleTester } from '../RuleTester'; const ruleTester = new RuleTester({ parser: '@typescript-eslint/parser', diff --git a/packages/eslint-plugin-internal/tests/rules/no-typescript-estree.test.ts b/packages/eslint-plugin-internal/tests/rules/no-typescript-estree.test.ts index 120c72def8c..1cde420e337 100644 --- a/packages/eslint-plugin-internal/tests/rules/no-typescript-estree.test.ts +++ b/packages/eslint-plugin-internal/tests/rules/no-typescript-estree.test.ts @@ -1,5 +1,5 @@ import rule from '../../src/rules/no-typescript-estree-import'; -import { RuleTester, batchedSingleLineTests } from '../RuleTester'; +import { batchedSingleLineTests, RuleTester } from '../RuleTester'; const ruleTester = new RuleTester({ parser: '@typescript-eslint/parser', diff --git a/packages/eslint-plugin-internal/tests/rules/plugin-test-formatting.test.ts b/packages/eslint-plugin-internal/tests/rules/plugin-test-formatting.test.ts index 3b8bb47dafd..f5745996d38 100644 --- a/packages/eslint-plugin-internal/tests/rules/plugin-test-formatting.test.ts +++ b/packages/eslint-plugin-internal/tests/rules/plugin-test-formatting.test.ts @@ -1,9 +1,11 @@ import rule from '../../src/rules/plugin-test-formatting'; -import { RuleTester } from '../RuleTester'; +import { getFixturesRootDir, RuleTester } from '../RuleTester'; const ruleTester = new RuleTester({ parser: '@typescript-eslint/parser', parserOptions: { + project: './tsconfig.json', + tsconfigRootDir: getFixturesRootDir(), sourceType: 'module', }, }); @@ -25,26 +27,6 @@ ruleTester.run({ }); `; } -function wrapWithOutput( - strings: TemplateStringsArray, - ...keys: string[] -): string { - const lastIndex = strings.length - 1; - const code = - strings.slice(0, lastIndex).reduce((p, s, i) => p + s + keys[i], '') + - strings[lastIndex]; - return ` -ruleTester.run({ - invalid: [ - { - code: ${code}, - output: ${code}, - }, - ], -}); - `; -} - ruleTester.run('plugin-test-formatting', rule, { valid: [ // sanity check for valid tests non-object style @@ -152,6 +134,44 @@ ${CODE_INDENT}const a = 1; ${CODE_INDENT}const b = 1; ${PARENT_INDENT}\``, + + // random, unannotated variables aren't checked + ` +const test1 = { + code: 'const badlyFormatted = "code"', +}; +const test2 = { + valid: [ + 'const badlyFormatted = "code"', + { + code: 'const badlyFormatted = "code"', + }, + ], + invalid: [ + { + code: 'const badlyFormatted = "code"', + errors: [], + }, + ], +}; + `, + + // TODO - figure out how to handle this pattern + ` +import { TSESLint } from '@typescript-eslint/utils'; + +const test = [ + { + code: 'const badlyFormatted = "code1"', + }, + { + code: 'const badlyFormatted = "code2"', + }, +].map>(test => ({ + code: test.code, + errors: [], +})); + `, ], invalid: [ // Literal @@ -365,7 +385,6 @@ ${PARENT_INDENT}\``, code: wrap`\` ${CODE_INDENT}const a=\\\`\\\${a}\\\`; ${PARENT_INDENT}\``, - // make sure it escapes backticks output: wrap`\` ${CODE_INDENT}const a = \\\`\\\${a}\\\`; ${PARENT_INDENT}\``, @@ -376,26 +395,6 @@ ${PARENT_INDENT}\``, ], }, - // sanity check that it runs on both output and code properties - { - code: wrapWithOutput`\` -${CODE_INDENT}const a="1"; -${CODE_INDENT} const b = "2"; -${PARENT_INDENT}\``, - output: wrapWithOutput`\` -${CODE_INDENT}const a = '1'; -${CODE_INDENT}const b = '2'; -${PARENT_INDENT}\``, - errors: [ - { - messageId: 'invalidFormattingErrorTest', - }, - { - messageId: 'invalidFormattingErrorTest', - }, - ], - }, - // sanity check that it handles suggestion output { code: ` @@ -431,7 +430,7 @@ ruleTester.run({ suggestions: [ { messageId: 'bar', - output: 'const x = 1;', + output: 'const x=1;', }, ], }, @@ -444,9 +443,6 @@ ruleTester.run({ { messageId: 'invalidFormattingErrorTest', }, - { - messageId: 'invalidFormattingErrorTest', - }, ], }, @@ -551,25 +547,171 @@ foo ], }, - // checks tests with .trimRight calls + // annotated variables are checked + { + code: ` +const test: RunTests = { + valid: [ + 'const badlyFormatted = "code"', + { + code: 'const badlyFormatted = "code"', + }, + ], + invalid: [ + { + code: 'const badlyFormatted = "code"', + errors: [], + }, + ], +}; + `, + output: ` +const test: RunTests = { + valid: [ + "const badlyFormatted = 'code';", { - code: wrap`'const a=1;'.trimRight()`, - output: wrap`'const a = 1;'.trimRight()`, + code: "const badlyFormatted = 'code';", + }, + ], + invalid: [ + { + code: "const badlyFormatted = 'code';", + errors: [], + }, + ], +}; + `, errors: [ { messageId: 'invalidFormatting', }, + { + messageId: 'invalidFormatting', + }, + { + messageId: 'invalidFormattingErrorTest', + }, ], }, { - code: wrap`\`const a = "1"; -${CODE_INDENT}\`.trimRight()`, - output: wrap`\` -const a = "1"; -${CODE_INDENT}\`.trimRight()`, + code: ` +import { TSESLint } from '@typescript-eslint/utils'; + +const test: TSESLint.RunTests<'', []> = { + valid: [ + 'const badlyFormatted = "code"', + { + code: 'const badlyFormatted = "code"', + }, + ], + invalid: [ + { + code: 'const badlyFormatted = "code"', + errors: [], + }, + ], +}; + `, + output: ` +import { TSESLint } from '@typescript-eslint/utils'; + +const test: TSESLint.RunTests<'', []> = { + valid: [ + "const badlyFormatted = 'code';", + { + code: "const badlyFormatted = 'code';", + }, + ], + invalid: [ + { + code: "const badlyFormatted = 'code';", + errors: [], + }, + ], +}; + `, errors: [ { - messageId: 'templateLiteralEmptyEnds', + messageId: 'invalidFormatting', + }, + { + messageId: 'invalidFormatting', + }, + { + messageId: 'invalidFormattingErrorTest', + }, + ], + }, + { + code: ` +import { TSESLint } from '@typescript-eslint/utils'; + +const test: TSESLint.ValidTestCase<[]> = { + code: 'const badlyFormatted = "code"', +}; + `, + output: ` +import { TSESLint } from '@typescript-eslint/utils'; + +const test: TSESLint.ValidTestCase<[]> = { + code: "const badlyFormatted = 'code';", +}; + `, + errors: [ + { + messageId: 'invalidFormattingErrorTest', + }, + ], + }, + { + code: ` +import { TSESLint } from '@typescript-eslint/utils'; + +const test: TSESLint.InvalidTestCase<'', []> = { + code: 'const badlyFormatted = "code1"', + errors: [ + { + code: 'const badlyFormatted = "code2"', + // shouldn't get fixed as per rule ignoring output + output: 'const badlyFormatted = "code3"', + suggestions: [ + { + messageId: '', + // shouldn't get fixed as per rule ignoring output + output: 'const badlyFormatted = "code4"', + }, + ], + }, + ], +}; + `, + output: ` +import { TSESLint } from '@typescript-eslint/utils'; + +const test: TSESLint.InvalidTestCase<'', []> = { + code: "const badlyFormatted = 'code1';", + errors: [ + { + code: "const badlyFormatted = 'code2';", + // shouldn't get fixed as per rule ignoring output + output: 'const badlyFormatted = "code3"', + suggestions: [ + { + messageId: '', + // shouldn't get fixed as per rule ignoring output + output: 'const badlyFormatted = "code4"', + }, + ], + }, + ], +}; + `, + errors: [ + { + messageId: 'invalidFormattingErrorTest', + }, + { + messageId: 'invalidFormattingErrorTest', }, ], }, diff --git a/packages/eslint-plugin-internal/tests/rules/prefer-ast-types-enum.test.ts b/packages/eslint-plugin-internal/tests/rules/prefer-ast-types-enum.test.ts index d418526db5f..ea162462ca6 100644 --- a/packages/eslint-plugin-internal/tests/rules/prefer-ast-types-enum.test.ts +++ b/packages/eslint-plugin-internal/tests/rules/prefer-ast-types-enum.test.ts @@ -1,5 +1,6 @@ -import { AST_NODE_TYPES, AST_TOKEN_TYPES } from '@typescript-eslint/utils'; import { DefinitionType } from '@typescript-eslint/scope-manager'; +import { AST_NODE_TYPES, AST_TOKEN_TYPES } from '@typescript-eslint/utils'; + import rule from '../../src/rules/prefer-ast-types-enum'; import { batchedSingleLineTests, RuleTester } from '../RuleTester'; diff --git a/packages/eslint-plugin-tslint/CHANGELOG.md b/packages/eslint-plugin-tslint/CHANGELOG.md index ad23e4fb63d..b2551812889 100644 --- a/packages/eslint-plugin-tslint/CHANGELOG.md +++ b/packages/eslint-plugin-tslint/CHANGELOG.md @@ -3,7 +3,7 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. -# [5.31.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.7...v5.31.0) (2022-07-25) +# [5.50.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.49.0...v5.50.0) (2023-01-31) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint @@ -11,7 +11,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline -## [5.30.7](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.6...v5.30.7) (2022-07-18) +# [5.49.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.48.2...v5.49.0) (2023-01-23) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint @@ -19,7 +19,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline -## [5.30.6](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.5...v5.30.6) (2022-07-11) +## [5.48.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.48.1...v5.48.2) (2023-01-16) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint @@ -27,7 +27,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline -## [5.30.5](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.4...v5.30.5) (2022-07-04) +## [5.48.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.48.0...v5.48.1) (2023-01-09) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint @@ -35,1374 +35,831 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline -## [5.30.4](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.3...v5.30.4) (2022-07-03) +# [5.48.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.47.1...v5.48.0) (2023-01-02) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint +## [5.47.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.47.0...v5.47.1) (2022-12-26) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint +# [5.47.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.46.1...v5.47.0) (2022-12-19) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint -## [5.30.3](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.2...v5.30.3) (2022-07-01) +## [5.46.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.46.0...v5.46.1) (2022-12-12) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint +# [5.46.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.45.1...v5.46.0) (2022-12-08) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint +## [5.45.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.45.0...v5.45.1) (2022-12-05) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint -## [5.30.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.1...v5.30.2) (2022-07-01) +# [5.45.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.44.0...v5.45.0) (2022-11-28) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint +# [5.44.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.43.0...v5.44.0) (2022-11-21) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint +# [5.43.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.42.1...v5.43.0) (2022-11-14) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint -## 5.30.1 (2022-07-01) +## [5.42.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.42.0...v5.42.1) (2022-11-07) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint +# [5.42.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.41.0...v5.42.0) (2022-10-31) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint +# [5.41.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.40.1...v5.41.0) (2022-10-24) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint -# [5.30.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.29.0...v5.30.0) (2022-06-27) +## [5.40.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.40.0...v5.40.1) (2022-10-17) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint +# [5.40.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.39.0...v5.40.0) (2022-10-10) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint +# [5.39.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.38.1...v5.39.0) (2022-10-03) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint -# [5.29.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.28.0...v5.29.0) (2022-06-20) +## [5.38.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.38.0...v5.38.1) (2022-09-26) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint +# [5.38.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.37.0...v5.38.0) (2022-09-19) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint +# [5.37.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.36.2...v5.37.0) (2022-09-12) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint -# [5.28.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.27.1...v5.28.0) (2022-06-13) +## [5.36.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.36.1...v5.36.2) (2022-09-05) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint +## [5.36.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.36.0...v5.36.1) (2022-08-30) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint +# [5.36.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.35.1...v5.36.0) (2022-08-30) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint -## [5.27.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.27.0...v5.27.1) (2022-06-06) +## [5.35.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.35.0...v5.35.1) (2022-08-24) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint +# [5.35.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.34.0...v5.35.0) (2022-08-24) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint +# [5.34.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.33.1...v5.34.0) (2022-08-22) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint -# [5.27.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.26.0...v5.27.0) (2022-05-30) +## [5.33.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.33.0...v5.33.1) (2022-08-15) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint -### Features +# [5.33.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.32.0...v5.33.0) (2022-08-08) -* [4.7] support new extensions ([#5027](https://github.com/typescript-eslint/typescript-eslint/issues/5027)) ([efc147b](https://github.com/typescript-eslint/typescript-eslint/commit/efc147b04dce52ab17415b6a4ae4076b944b9036)) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint +# [5.32.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.31.0...v5.32.0) (2022-08-01) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint +# [5.31.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.7...v5.31.0) (2022-07-25) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint -# [5.26.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.25.0...v5.26.0) (2022-05-23) +## [5.30.7](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.6...v5.30.7) (2022-07-18) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint +## [5.30.6](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.5...v5.30.6) (2022-07-11) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint +## [5.30.5](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.4...v5.30.5) (2022-07-04) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint -# [5.25.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.24.0...v5.25.0) (2022-05-17) +## [5.30.4](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.3...v5.30.4) (2022-07-03) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint +## [5.30.3](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.2...v5.30.3) (2022-07-01) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint +## [5.30.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.1...v5.30.2) (2022-07-01) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint -# [5.24.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.23.0...v5.24.0) (2022-05-16) +## 5.30.1 (2022-07-01) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint +# [5.30.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.29.0...v5.30.0) (2022-06-27) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint +# [5.29.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.28.0...v5.29.0) (2022-06-20) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint -# [5.23.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.22.0...v5.23.0) (2022-05-09) +# [5.28.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.27.1...v5.28.0) (2022-06-13) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint +## [5.27.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.27.0...v5.27.1) (2022-06-06) + +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint +# [5.27.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.26.0...v5.27.0) (2022-05-30) +### Features +- [4.7] support new extensions ([#5027](https://github.com/typescript-eslint/typescript-eslint/issues/5027)) ([efc147b](https://github.com/typescript-eslint/typescript-eslint/commit/efc147b04dce52ab17415b6a4ae4076b944b9036)) -# [5.22.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.21.0...v5.22.0) (2022-05-02) +# [5.26.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.25.0...v5.26.0) (2022-05-23) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint +# [5.25.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.24.0...v5.25.0) (2022-05-17) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint +# [5.24.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.23.0...v5.24.0) (2022-05-16) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint -# [5.21.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.20.0...v5.21.0) (2022-04-25) +# [5.23.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.22.0...v5.23.0) (2022-05-09) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint +# [5.22.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.21.0...v5.22.0) (2022-05-02) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint +# [5.21.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.20.0...v5.21.0) (2022-04-25) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint # [5.20.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.19.0...v5.20.0) (2022-04-18) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint - - - - # [5.19.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.18.0...v5.19.0) (2022-04-11) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint - - - - # [5.18.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.17.0...v5.18.0) (2022-04-04) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint - - - - # [5.17.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.16.0...v5.17.0) (2022-03-28) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint - - - - # [5.16.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.15.0...v5.16.0) (2022-03-21) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint - - - - # [5.15.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.14.0...v5.15.0) (2022-03-14) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint - - - - # [5.14.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.13.0...v5.14.0) (2022-03-07) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint +# [5.13.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.12.1...v5.13.0) (2022-02-28) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint +## [5.12.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.12.0...v5.12.1) (2022-02-21) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint -# [5.13.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.12.1...v5.13.0) (2022-02-28) +# [5.12.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.11.0...v5.12.0) (2022-02-14) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint +# [5.11.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.10.2...v5.11.0) (2022-02-07) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint +## [5.10.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.10.1...v5.10.2) (2022-01-31) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint -## [5.12.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.12.0...v5.12.1) (2022-02-21) +## [5.10.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.10.0...v5.10.1) (2022-01-24) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint +# [5.10.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.9.1...v5.10.0) (2022-01-17) +### Features +- rename `experimental-utils` to `utils` and make `experimental-utils` an alias to the new package ([#4172](https://github.com/typescript-eslint/typescript-eslint/issues/4172)) ([1d55a75](https://github.com/typescript-eslint/typescript-eslint/commit/1d55a7511b38d8e2b2eabe59f639e0a865e6c93f)) - -# [5.12.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.11.0...v5.12.0) (2022-02-14) +## [5.9.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.9.0...v5.9.1) (2022-01-10) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint +# [5.9.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.8.1...v5.9.0) (2022-01-03) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint +## [5.8.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.8.0...v5.8.1) (2021-12-27) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint -# [5.11.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.10.2...v5.11.0) (2022-02-07) +# [5.8.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.7.0...v5.8.0) (2021-12-20) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint +# [5.7.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.6.0...v5.7.0) (2021-12-13) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint +# [5.6.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.5.0...v5.6.0) (2021-12-06) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint -## [5.10.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.10.1...v5.10.2) (2022-01-31) +# [5.5.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.4.0...v5.5.0) (2021-11-29) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint +# [5.4.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.3.1...v5.4.0) (2021-11-15) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint +## [5.3.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.3.0...v5.3.1) (2021-11-08) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint -## [5.10.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.10.0...v5.10.1) (2022-01-24) +# [5.3.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.2.0...v5.3.0) (2021-11-01) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint +# [5.2.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.1.0...v5.2.0) (2021-10-25) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint +# [5.1.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.0.0...v5.1.0) (2021-10-18) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint -# [5.10.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.9.1...v5.10.0) (2022-01-17) - +# [5.0.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.33.0...v5.0.0) (2021-10-11) ### Features -* rename `experimental-utils` to `utils` and make `experimental-utils` an alias to the new package ([#4172](https://github.com/typescript-eslint/typescript-eslint/issues/4172)) ([1d55a75](https://github.com/typescript-eslint/typescript-eslint/commit/1d55a7511b38d8e2b2eabe59f639e0a865e6c93f)) +- remove `meta.docs.category` from rules ([#3800](https://github.com/typescript-eslint/typescript-eslint/issues/3800)) ([71c9370](https://github.com/typescript-eslint/typescript-eslint/commit/71c93706e55f5f92a1285102b93c6ab1950c6df4)) +- support ESLint v8 ([#3737](https://github.com/typescript-eslint/typescript-eslint/issues/3737)) ([4ca62ae](https://github.com/typescript-eslint/typescript-eslint/commit/4ca62aee6681d706e762a8db727541ca204364f2)) +# [4.33.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.32.0...v4.33.0) (2021-10-04) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint +# [4.32.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.31.2...v4.32.0) (2021-09-27) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint -## [5.9.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.9.0...v5.9.1) (2022-01-10) +## [4.31.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.31.1...v4.31.2) (2021-09-20) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint +## [4.31.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.31.0...v4.31.1) (2021-09-13) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint +# [4.31.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.30.0...v4.31.0) (2021-09-06) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint -# [5.9.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.8.1...v5.9.0) (2022-01-03) +# [4.30.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.29.3...v4.30.0) (2021-08-30) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint +## [4.29.3](https://github.com/typescript-eslint/typescript-eslint/compare/v4.29.2...v4.29.3) (2021-08-23) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint +## [4.29.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.29.1...v4.29.2) (2021-08-16) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint -## [5.8.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.8.0...v5.8.1) (2021-12-27) +## [4.29.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.29.0...v4.29.1) (2021-08-09) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint +# [4.29.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.5...v4.29.0) (2021-08-02) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint +## [4.28.5](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.4...v4.28.5) (2021-07-26) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint -# [5.8.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.7.0...v5.8.0) (2021-12-20) +## [4.28.4](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.3...v4.28.4) (2021-07-19) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint +## [4.28.3](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.2...v4.28.3) (2021-07-12) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint +## [4.28.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.1...v4.28.2) (2021-07-05) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint -# [5.7.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.6.0...v5.7.0) (2021-12-13) +## [4.28.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.0...v4.28.1) (2021-06-28) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint +# [4.28.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.27.0...v4.28.0) (2021-06-21) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint +# [4.27.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.26.1...v4.27.0) (2021-06-14) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint -# [5.6.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.5.0...v5.6.0) (2021-12-06) +## [4.26.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.26.0...v4.26.1) (2021-06-07) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint +# [4.26.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.25.0...v4.26.0) (2021-05-31) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint +# [4.25.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.24.0...v4.25.0) (2021-05-24) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint -# [5.5.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.4.0...v5.5.0) (2021-11-29) +# [4.24.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.23.0...v4.24.0) (2021-05-17) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint +# [4.23.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.22.1...v4.23.0) (2021-05-10) +### Features +- refactor to split AST specification out as its own module ([#2911](https://github.com/typescript-eslint/typescript-eslint/issues/2911)) ([25ea953](https://github.com/typescript-eslint/typescript-eslint/commit/25ea953cc60b118bd385c71e0a9b61c286c26fcf)) - -# [5.4.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.3.1...v5.4.0) (2021-11-15) +## [4.22.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.22.0...v4.22.1) (2021-05-04) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint +# [4.22.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.21.0...v4.22.0) (2021-04-12) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint - - -## [5.3.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.3.0...v5.3.1) (2021-11-08) +# [4.21.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.20.0...v4.21.0) (2021-04-05) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint +# [4.20.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.19.0...v4.20.0) (2021-03-29) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint +# [4.19.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.18.0...v4.19.0) (2021-03-22) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint -# [5.3.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.2.0...v5.3.0) (2021-11-01) +# [4.18.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.17.0...v4.18.0) (2021-03-15) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint +# [4.17.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.16.1...v4.17.0) (2021-03-08) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint +## [4.16.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.16.0...v4.16.1) (2021-03-01) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint -# [5.2.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.1.0...v5.2.0) (2021-10-25) +# [4.16.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.15.2...v4.16.0) (2021-03-01) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint +## [4.15.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.15.1...v4.15.2) (2021-02-22) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint +## [4.15.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.15.0...v4.15.1) (2021-02-15) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint -# [5.1.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.0.0...v5.1.0) (2021-10-18) +# [4.15.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.14.2...v4.15.0) (2021-02-08) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint +## [4.14.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.14.1...v4.14.2) (2021-02-01) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint +## [4.14.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.14.0...v4.14.1) (2021-01-25) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint -# [5.0.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.33.0...v5.0.0) (2021-10-11) +# [4.14.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.13.0...v4.14.0) (2021-01-18) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint -### Features +# [4.13.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.12.0...v4.13.0) (2021-01-11) -* remove `meta.docs.category` from rules ([#3800](https://github.com/typescript-eslint/typescript-eslint/issues/3800)) ([71c9370](https://github.com/typescript-eslint/typescript-eslint/commit/71c93706e55f5f92a1285102b93c6ab1950c6df4)) -* support ESLint v8 ([#3737](https://github.com/typescript-eslint/typescript-eslint/issues/3737)) ([4ca62ae](https://github.com/typescript-eslint/typescript-eslint/commit/4ca62aee6681d706e762a8db727541ca204364f2)) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint +# [4.12.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.11.1...v4.12.0) (2021-01-04) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint +## [4.11.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.11.0...v4.11.1) (2020-12-28) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint -# [4.33.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.32.0...v4.33.0) (2021-10-04) +# [4.11.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.10.0...v4.11.0) (2020-12-21) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint +# [4.10.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.9.1...v4.10.0) (2020-12-14) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint +## [4.9.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.9.0...v4.9.1) (2020-12-07) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint -# [4.32.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.31.2...v4.32.0) (2021-09-27) +# [4.9.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.8.2...v4.9.0) (2020-11-30) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint +## [4.8.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.8.1...v4.8.2) (2020-11-23) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint +## [4.8.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.8.0...v4.8.1) (2020-11-17) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint -## [4.31.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.31.1...v4.31.2) (2021-09-20) +# [4.8.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.7.0...v4.8.0) (2020-11-16) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint +# [4.7.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.6.1...v4.7.0) (2020-11-09) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint +## [4.6.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.6.0...v4.6.1) (2020-11-02) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint -## [4.31.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.31.0...v4.31.1) (2021-09-13) +# [4.6.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.5.0...v4.6.0) (2020-10-26) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint +# [4.5.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.4.1...v4.5.0) (2020-10-19) +### Features +- **typescript-estree:** add flag EXPERIMENTAL_useSourceOfProjectReferenceRedirect ([#2669](https://github.com/typescript-eslint/typescript-eslint/issues/2669)) ([90a5878](https://github.com/typescript-eslint/typescript-eslint/commit/90a587845088da1b205e4d7d77dbc3f9447b1c5a)) - -# [4.31.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.30.0...v4.31.0) (2021-09-06) +## [4.4.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.4.0...v4.4.1) (2020-10-12) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint +# [4.4.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.3.0...v4.4.0) (2020-10-05) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint +# [4.3.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.2.0...v4.3.0) (2020-09-28) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint -# [4.30.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.29.3...v4.30.0) (2021-08-30) +# [4.2.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.1.1...v4.2.0) (2020-09-21) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint +## [4.1.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.1.0...v4.1.1) (2020-09-14) - - - -## [4.29.3](https://github.com/typescript-eslint/typescript-eslint/compare/v4.29.2...v4.29.3) (2021-08-23) - -**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint - - - - - -## [4.29.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.29.1...v4.29.2) (2021-08-16) - -**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint - - - - - -## [4.29.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.29.0...v4.29.1) (2021-08-09) - -**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint - - - - - -# [4.29.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.5...v4.29.0) (2021-08-02) - -**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint - - - - - -## [4.28.5](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.4...v4.28.5) (2021-07-26) - -**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint - - - - - -## [4.28.4](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.3...v4.28.4) (2021-07-19) - -**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint - - - - - -## [4.28.3](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.2...v4.28.3) (2021-07-12) - -**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint - - - - - -## [4.28.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.1...v4.28.2) (2021-07-05) - -**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint - - - - - -## [4.28.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.0...v4.28.1) (2021-06-28) - -**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint - - - - - -# [4.28.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.27.0...v4.28.0) (2021-06-21) - -**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint - - - - - -# [4.27.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.26.1...v4.27.0) (2021-06-14) - -**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint - - - - - -## [4.26.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.26.0...v4.26.1) (2021-06-07) - -**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint - - - - - -# [4.26.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.25.0...v4.26.0) (2021-05-31) - -**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint - - - - - -# [4.25.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.24.0...v4.25.0) (2021-05-24) - -**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint - - - - - -# [4.24.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.23.0...v4.24.0) (2021-05-17) - -**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint - - - - - -# [4.23.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.22.1...v4.23.0) (2021-05-10) - - -### Features - -* refactor to split AST specification out as its own module ([#2911](https://github.com/typescript-eslint/typescript-eslint/issues/2911)) ([25ea953](https://github.com/typescript-eslint/typescript-eslint/commit/25ea953cc60b118bd385c71e0a9b61c286c26fcf)) - - - - - -## [4.22.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.22.0...v4.22.1) (2021-05-04) - -**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint - - - - - -# [4.22.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.21.0...v4.22.0) (2021-04-12) - -**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint - - - - - -# [4.21.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.20.0...v4.21.0) (2021-04-05) - -**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint - - - - - -# [4.20.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.19.0...v4.20.0) (2021-03-29) - -**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint - - - - - -# [4.19.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.18.0...v4.19.0) (2021-03-22) - -**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint - - - - - -# [4.18.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.17.0...v4.18.0) (2021-03-15) - -**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint - - - - - -# [4.17.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.16.1...v4.17.0) (2021-03-08) - -**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint - - - - - -## [4.16.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.16.0...v4.16.1) (2021-03-01) - -**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint - - - - - -# [4.16.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.15.2...v4.16.0) (2021-03-01) - -**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint - - - - - -## [4.15.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.15.1...v4.15.2) (2021-02-22) - -**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint - - - - - -## [4.15.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.15.0...v4.15.1) (2021-02-15) - -**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint - - - - - -# [4.15.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.14.2...v4.15.0) (2021-02-08) - -**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint - - - - - -## [4.14.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.14.1...v4.14.2) (2021-02-01) - -**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint - - - - - -## [4.14.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.14.0...v4.14.1) (2021-01-25) - -**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint - - - - - -# [4.14.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.13.0...v4.14.0) (2021-01-18) - -**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint - - - - - -# [4.13.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.12.0...v4.13.0) (2021-01-11) - -**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint - - - - - -# [4.12.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.11.1...v4.12.0) (2021-01-04) - -**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint - - - - - -## [4.11.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.11.0...v4.11.1) (2020-12-28) - -**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint - - - - - -# [4.11.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.10.0...v4.11.0) (2020-12-21) - -**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint - - - - - -# [4.10.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.9.1...v4.10.0) (2020-12-14) - -**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint - - - - - -## [4.9.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.9.0...v4.9.1) (2020-12-07) - -**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint - - - - - -# [4.9.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.8.2...v4.9.0) (2020-11-30) - -**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint - - - - - -## [4.8.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.8.1...v4.8.2) (2020-11-23) - -**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint - - - - - -## [4.8.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.8.0...v4.8.1) (2020-11-17) - -**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint - - - - - -# [4.8.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.7.0...v4.8.0) (2020-11-16) - -**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint - - - - - -# [4.7.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.6.1...v4.7.0) (2020-11-09) - -**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint - - - - - -## [4.6.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.6.0...v4.6.1) (2020-11-02) - -**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint - - - - - -# [4.6.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.5.0...v4.6.0) (2020-10-26) - -**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint - - - - - -# [4.5.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.4.1...v4.5.0) (2020-10-19) - - -### Features - -* **typescript-estree:** add flag EXPERIMENTAL_useSourceOfProjectReferenceRedirect ([#2669](https://github.com/typescript-eslint/typescript-eslint/issues/2669)) ([90a5878](https://github.com/typescript-eslint/typescript-eslint/commit/90a587845088da1b205e4d7d77dbc3f9447b1c5a)) - - - - - -## [4.4.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.4.0...v4.4.1) (2020-10-12) - -**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint - - - - - -# [4.4.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.3.0...v4.4.0) (2020-10-05) - -**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint - - - - - -# [4.3.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.2.0...v4.3.0) (2020-09-28) - -**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint - - - - - -# [4.2.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.1.1...v4.2.0) (2020-09-21) - -**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint - - - - - -## [4.1.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.1.0...v4.1.1) (2020-09-14) - -**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint - - - - +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint # [4.1.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.0.1...v4.1.0) (2020-09-07) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint - - - - ## [4.0.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.0.0...v4.0.1) (2020-08-31) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint +# [4.0.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.10.1...v4.0.0) (2020-08-31) +## [Please see the release notes for v4.0.0](https://github.com/typescript-eslint/typescript-eslint/releases/tag/v4.0.0) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint - -# [4.0.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.10.1...v4.0.0) (2020-08-31) - -## [Please see the release notes for v4.0.0](https://github.com/typescript-eslint/typescript-eslint/releases/tag/v4.0.0) - -**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint - - - - - -## [3.10.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.10.0...v3.10.1) (2020-08-25) - -**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint - - - - - -# [3.10.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.9.1...v3.10.0) (2020-08-24) - -**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint - - - - - -## [3.9.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.9.0...v3.9.1) (2020-08-17) +## [3.10.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.10.0...v3.10.1) (2020-08-25) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint +# [3.10.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.9.1...v3.10.0) (2020-08-24) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint +## [3.9.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.9.0...v3.9.1) (2020-08-17) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint # [3.9.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.8.0...v3.9.0) (2020-08-10) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint - - - - # [3.8.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.7.1...v3.8.0) (2020-08-03) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint - - - - ## [3.7.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.7.0...v3.7.1) (2020-07-27) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint - - - - # [3.7.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.6.1...v3.7.0) (2020-07-20) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint - - - - ## [3.6.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.6.0...v3.6.1) (2020-07-13) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint - - - - # [3.6.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.5.0...v3.6.0) (2020-07-06) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint - - - - # [3.5.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.4.0...v3.5.0) (2020-06-29) - ### Features -* add package scope-manager ([#1939](https://github.com/typescript-eslint/typescript-eslint/issues/1939)) ([682eb7e](https://github.com/typescript-eslint/typescript-eslint/commit/682eb7e009c3f22a542882dfd3602196a60d2a1e)) - - - - +- add package scope-manager ([#1939](https://github.com/typescript-eslint/typescript-eslint/issues/1939)) ([682eb7e](https://github.com/typescript-eslint/typescript-eslint/commit/682eb7e009c3f22a542882dfd3602196a60d2a1e)) # [3.4.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.3.0...v3.4.0) (2020-06-22) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint - - - - # [3.3.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.2.0...v3.3.0) (2020-06-15) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint - - - - # [3.2.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.1.0...v3.2.0) (2020-06-08) - ### Bug Fixes -* **eslint-plugin:** [prefer-optional-chain] handling first member expression ([#2156](https://github.com/typescript-eslint/typescript-eslint/issues/2156)) ([de18660](https://github.com/typescript-eslint/typescript-eslint/commit/de18660a8cf8f7033798646d8c5b0938d1accb12)) - - - - +- **eslint-plugin:** [prefer-optional-chain] handling first member expression ([#2156](https://github.com/typescript-eslint/typescript-eslint/issues/2156)) ([de18660](https://github.com/typescript-eslint/typescript-eslint/commit/de18660a8cf8f7033798646d8c5b0938d1accb12)) # [3.1.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.0.2...v3.1.0) (2020-06-01) - ### Bug Fixes -* **experimental-utils:** downlevel type declarations for versions older than 3.8 ([#2133](https://github.com/typescript-eslint/typescript-eslint/issues/2133)) ([7925823](https://github.com/typescript-eslint/typescript-eslint/commit/792582326a8065270b69a0ffcaad5a7b4b103ff3)) - - - - +- **experimental-utils:** downlevel type declarations for versions older than 3.8 ([#2133](https://github.com/typescript-eslint/typescript-eslint/issues/2133)) ([7925823](https://github.com/typescript-eslint/typescript-eslint/commit/792582326a8065270b69a0ffcaad5a7b4b103ff3)) ## [3.0.2](https://github.com/typescript-eslint/typescript-eslint/compare/v3.0.1...v3.0.2) (2020-05-27) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint - - - - ## [3.0.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.0.0...v3.0.1) (2020-05-25) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint - - - - # [3.0.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.34.0...v3.0.0) (2020-05-21) ## [Please see the release notes for v3.0.0](https://github.com/typescript-eslint/typescript-eslint/releases/tag/v3.0.0) ### Features -* drop support for node v8 ([#1997](https://github.com/typescript-eslint/typescript-eslint/issues/1997)) ([b6c3b7b](https://github.com/typescript-eslint/typescript-eslint/commit/b6c3b7b84b8d199fa75a46432febd4a364a63217)) -* upgrade to ESLint v7 ([#2022](https://github.com/typescript-eslint/typescript-eslint/issues/2022)) ([208de71](https://github.com/typescript-eslint/typescript-eslint/commit/208de71059746bf38e94bd460346ffb2698a3e12)) - - - - +- drop support for node v8 ([#1997](https://github.com/typescript-eslint/typescript-eslint/issues/1997)) ([b6c3b7b](https://github.com/typescript-eslint/typescript-eslint/commit/b6c3b7b84b8d199fa75a46432febd4a364a63217)) +- upgrade to ESLint v7 ([#2022](https://github.com/typescript-eslint/typescript-eslint/issues/2022)) ([208de71](https://github.com/typescript-eslint/typescript-eslint/commit/208de71059746bf38e94bd460346ffb2698a3e12)) # [2.34.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.33.0...v2.34.0) (2020-05-18) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint - - - - # [2.33.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.32.0...v2.33.0) (2020-05-12) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint - - - - # [2.32.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.31.0...v2.32.0) (2020-05-11) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint - - - - # [2.31.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.30.0...v2.31.0) (2020-05-04) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint - - - - # [2.30.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.29.0...v2.30.0) (2020-04-27) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint - - - - # [2.29.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.28.0...v2.29.0) (2020-04-20) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint - - - - # [2.28.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.27.0...v2.28.0) (2020-04-13) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint - - - - # [2.27.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.26.0...v2.27.0) (2020-04-06) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint - - - - # [2.26.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.25.0...v2.26.0) (2020-03-30) - ### Features -* **eslint-plugin-tslint:** support tslint 6 ([#1809](https://github.com/typescript-eslint/typescript-eslint/issues/1809)) ([7d963fd](https://github.com/typescript-eslint/typescript-eslint/commit/7d963fd846935acd91b7b0cd31c56a70a2b994d1)) - - - - +- **eslint-plugin-tslint:** support tslint 6 ([#1809](https://github.com/typescript-eslint/typescript-eslint/issues/1809)) ([7d963fd](https://github.com/typescript-eslint/typescript-eslint/commit/7d963fd846935acd91b7b0cd31c56a70a2b994d1)) # [2.25.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.24.0...v2.25.0) (2020-03-23) - ### Bug Fixes -* **eslint-plugin-tslint:** fix tslintConfig memoization key ([#1719](https://github.com/typescript-eslint/typescript-eslint/issues/1719)) ([abf1a2f](https://github.com/typescript-eslint/typescript-eslint/commit/abf1a2fa5574e41af8070be3d79a886ea2f989cc)), closes [typescript-eslint#1692](https://github.com/typescript-eslint/issues/1692) - - - - +- **eslint-plugin-tslint:** fix tslintConfig memoization key ([#1719](https://github.com/typescript-eslint/typescript-eslint/issues/1719)) ([abf1a2f](https://github.com/typescript-eslint/typescript-eslint/commit/abf1a2fa5574e41af8070be3d79a886ea2f989cc)), closes [typescript-eslint#1692](https://github.com/typescript-eslint/issues/1692) # [2.24.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.23.0...v2.24.0) (2020-03-16) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint - - - - # [2.23.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.22.0...v2.23.0) (2020-03-09) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint - - - - # [2.22.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.21.0...v2.22.0) (2020-03-02) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint - - - - # [2.21.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.20.0...v2.21.0) (2020-02-24) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint - - - - # [2.20.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.19.2...v2.20.0) (2020-02-17) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint - - - - ## [2.19.2](https://github.com/typescript-eslint/typescript-eslint/compare/v2.19.1...v2.19.2) (2020-02-10) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint - - - - ## [2.19.1](https://github.com/typescript-eslint/typescript-eslint/compare/v2.19.0...v2.19.1) (2020-02-10) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint - - - - # [2.19.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.18.0...v2.19.0) (2020-02-03) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint - - - - # [2.18.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.17.0...v2.18.0) (2020-01-27) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint - - - - # [2.17.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.16.0...v2.17.0) (2020-01-20) - ### Features -* **experimental-utils:** expose getParserServices from utils ([#1448](https://github.com/typescript-eslint/typescript-eslint/issues/1448)) ([982c8bc](https://github.com/typescript-eslint/typescript-eslint/commit/982c8bc)) - - - - +- **experimental-utils:** expose getParserServices from utils ([#1448](https://github.com/typescript-eslint/typescript-eslint/issues/1448)) ([982c8bc](https://github.com/typescript-eslint/typescript-eslint/commit/982c8bc)) # [2.16.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.15.0...v2.16.0) (2020-01-13) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint - - - - # [2.15.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.14.0...v2.15.0) (2020-01-06) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint - - - - # [2.14.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.13.0...v2.14.0) (2019-12-30) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint - - - - # [2.13.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.12.0...v2.13.0) (2019-12-23) - ### Features -* **eslint-plugin-tslint:** add fixer for config rule ([#1342](https://github.com/typescript-eslint/typescript-eslint/issues/1342)) ([c52c5c9](https://github.com/typescript-eslint/typescript-eslint/commit/c52c5c9)) - - - - +- **eslint-plugin-tslint:** add fixer for config rule ([#1342](https://github.com/typescript-eslint/typescript-eslint/issues/1342)) ([c52c5c9](https://github.com/typescript-eslint/typescript-eslint/commit/c52c5c9)) # [2.12.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.11.0...v2.12.0) (2019-12-16) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint - - - - # [2.11.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.10.0...v2.11.0) (2019-12-09) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint - - - - # [2.10.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.9.0...v2.10.0) (2019-12-02) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint - - - - # [2.9.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.8.0...v2.9.0) (2019-11-25) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint - - - - # [2.8.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.7.0...v2.8.0) (2019-11-18) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint - - - - # [2.7.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.6.1...v2.7.0) (2019-11-11) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint - - - - ## [2.6.1](https://github.com/typescript-eslint/typescript-eslint/compare/v2.6.0...v2.6.1) (2019-11-04) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint - - - - # [2.6.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.5.0...v2.6.0) (2019-10-28) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint - - - - # [2.5.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.4.0...v2.5.0) (2019-10-21) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint - - - - # [2.4.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.3.3...v2.4.0) (2019-10-14) - ### Bug Fixes -* support long running "watch" lint sessions ([#973](https://github.com/typescript-eslint/typescript-eslint/issues/973)) ([854620e](https://github.com/typescript-eslint/typescript-eslint/commit/854620e)) - +- support long running "watch" lint sessions ([#973](https://github.com/typescript-eslint/typescript-eslint/issues/973)) ([854620e](https://github.com/typescript-eslint/typescript-eslint/commit/854620e)) ### Features -* **typescript-estree:** support for parsing 3.7 features ([#1045](https://github.com/typescript-eslint/typescript-eslint/issues/1045)) ([623febf](https://github.com/typescript-eslint/typescript-eslint/commit/623febf)) - - - - +- **typescript-estree:** support for parsing 3.7 features ([#1045](https://github.com/typescript-eslint/typescript-eslint/issues/1045)) ([623febf](https://github.com/typescript-eslint/typescript-eslint/commit/623febf)) ## [2.3.3](https://github.com/typescript-eslint/typescript-eslint/compare/v2.3.2...v2.3.3) (2019-10-07) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint - - - - ## [2.3.2](https://github.com/typescript-eslint/typescript-eslint/compare/v2.3.1...v2.3.2) (2019-09-30) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint - - - - ## [2.3.1](https://github.com/typescript-eslint/typescript-eslint/compare/v2.3.0...v2.3.1) (2019-09-23) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint - - - - # [2.3.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.2.0...v2.3.0) (2019-09-16) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint - - - - # [2.2.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.1.0...v2.2.0) (2019-09-09) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint - - - - # [2.1.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.0.0...v2.1.0) (2019-09-02) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint - - - - # [2.0.0](https://github.com/typescript-eslint/typescript-eslint/compare/v1.13.0...v2.0.0) (2019-08-13) - ### Features -* explicitly support eslint v6 ([#645](https://github.com/typescript-eslint/typescript-eslint/issues/645)) ([34a7cf6](https://github.com/typescript-eslint/typescript-eslint/commit/34a7cf6)) - - -* feat(eslint-plugin)!: change recommended config (#729) ([428567d](https://github.com/typescript-eslint/typescript-eslint/commit/428567d)), closes [#729](https://github.com/typescript-eslint/typescript-eslint/issues/729) -* feat(typescript-estree)!: throw error on file not in project when `project` set (#760) ([3777b77](https://github.com/typescript-eslint/typescript-eslint/commit/3777b77)), closes [#760](https://github.com/typescript-eslint/typescript-eslint/issues/760) +- explicitly support eslint v6 ([#645](https://github.com/typescript-eslint/typescript-eslint/issues/645)) ([34a7cf6](https://github.com/typescript-eslint/typescript-eslint/commit/34a7cf6)) +- feat(eslint-plugin)!: change recommended config (#729) ([428567d](https://github.com/typescript-eslint/typescript-eslint/commit/428567d)), closes [#729](https://github.com/typescript-eslint/typescript-eslint/issues/729) +- feat(typescript-estree)!: throw error on file not in project when `project` set (#760) ([3777b77](https://github.com/typescript-eslint/typescript-eslint/commit/3777b77)), closes [#760](https://github.com/typescript-eslint/typescript-eslint/issues/760) ### BREAKING CHANGES -* recommended config changes are considered breaking -* by default we will now throw when a file is not in the `project` provided -* Node 6 is no longer supported - - - - +- recommended config changes are considered breaking +- by default we will now throw when a file is not in the `project` provided +- Node 6 is no longer supported # [1.13.0](https://github.com/typescript-eslint/typescript-eslint/compare/v1.12.0...v1.13.0) (2019-07-21) - ### Bug Fixes -* Correct `@types/json-schema` dependency ([#675](https://github.com/typescript-eslint/typescript-eslint/issues/675)) ([a5398ce](https://github.com/typescript-eslint/typescript-eslint/commit/a5398ce)) - - - - +- Correct `@types/json-schema` dependency ([#675](https://github.com/typescript-eslint/typescript-eslint/issues/675)) ([a5398ce](https://github.com/typescript-eslint/typescript-eslint/commit/a5398ce)) # [1.12.0](https://github.com/typescript-eslint/typescript-eslint/compare/v1.11.0...v1.12.0) (2019-07-12) - ### Features -* **eslint-plugin:** added new rule prefer-readonly ([#555](https://github.com/typescript-eslint/typescript-eslint/issues/555)) ([76b89a5](https://github.com/typescript-eslint/typescript-eslint/commit/76b89a5)) - - - - +- **eslint-plugin:** added new rule prefer-readonly ([#555](https://github.com/typescript-eslint/typescript-eslint/issues/555)) ([76b89a5](https://github.com/typescript-eslint/typescript-eslint/commit/76b89a5)) # [1.11.0](https://github.com/typescript-eslint/typescript-eslint/compare/v1.10.2...v1.11.0) (2019-06-23) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint - - - - ## [1.10.2](https://github.com/typescript-eslint/typescript-eslint/compare/v1.10.1...v1.10.2) (2019-06-10) **Note:** Version bump only for package @typescript-eslint/eslint-plugin-tslint diff --git a/packages/eslint-plugin-tslint/LICENSE b/packages/eslint-plugin-tslint/LICENSE index 7e7370143b2..a1164108d4d 100644 --- a/packages/eslint-plugin-tslint/LICENSE +++ b/packages/eslint-plugin-tslint/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2019 TypeScript ESLint and other contributors +Copyright (c) 2019 typescript-eslint and other contributors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/packages/eslint-plugin-tslint/README.md b/packages/eslint-plugin-tslint/README.md index 021b8780bfb..57c414230ec 100644 --- a/packages/eslint-plugin-tslint/README.md +++ b/packages/eslint-plugin-tslint/README.md @@ -1,62 +1,10 @@ -

ESLint Plugin TSLint

+# `@typescript-eslint/eslint-plugin-tslint` -

ESLint plugin wraps a TSLint configuration and lints the whole source using TSLint.

+> ESLint plugin that wraps a TSLint configuration and lints the whole source using TSLint. -

- CI - NPM Version - NPM Downloads -

+[![NPM Version](https://img.shields.io/npm/v/@typescript-eslint/eslint-plugin-tslint.svg?style=flat-square)](https://www.npmjs.com/package/@typescript-eslint/eslint-plugin-tslint) +[![NPM Downloads](https://img.shields.io/npm/dm/@typescript-eslint/eslint-plugin-tslint.svg?style=flat-square)](https://www.npmjs.com/package/@typescript-eslint/eslint-plugin-tslint) -## Installation +👉 See **https://typescript-eslint.io/architecture/eslint-plugin-tslint** for documentation on this package. -```sh -yarn add -D @typescript-eslint/eslint-plugin-tslint -``` - -## Usage - -Configure in your ESLint config file: - -```js -{ - "plugins": [ - "@typescript-eslint/tslint" - ], - "parserOptions": { - "project": "tsconfig.json", - }, - "rules": { - "@typescript-eslint/tslint/config": ["warn", { - "lintFile": "", // path to tslint.json of your project - "rules": { - // tslint rules (will be used if `lintFile` is not specified) - }, - "rulesDirectory": [ - // array of paths to directories with rules, e.g. 'node_modules/tslint/lib/rules' (will be used if `lintFile` is not specified) - ] - }], - } -} -``` - -**Note:** The ability to automatically fix problems with `--fix` is unavailable for TSLint rules loaded with this plugin. - -## Rules - -Plugin contains only single rule `@typescript-eslint/tslint/config`. - -## Examples - -- [`unlight/node-package-starter/.eslintrc.js`](https://github.com/unlight/node-package-starter/blob/master/.eslintrc.js) - -### TSLint Plugins - -- https://github.com/Glavin001/tslint-clean-code -- https://github.com/Microsoft/tslint-microsoft-contrib -- https://github.com/SonarSource/SonarTS -- https://github.com/ajafff/tslint-consistent-codestyle - -## Contributing - -[See the contributing guide here](../../CONTRIBUTING.md) +> See https://typescript-eslint.io for general documentation on typescript-eslint, the tooling that allows you to run ESLint and Prettier on TypeScript code. diff --git a/packages/eslint-plugin-tslint/package.json b/packages/eslint-plugin-tslint/package.json index 8ee49281a2b..23bf62f3fc5 100644 --- a/packages/eslint-plugin-tslint/package.json +++ b/packages/eslint-plugin-tslint/package.json @@ -1,9 +1,9 @@ { "name": "@typescript-eslint/eslint-plugin-tslint", - "version": "5.31.0", + "version": "5.50.0", "main": "dist/index.js", "typings": "src/index.ts", - "description": "TSLint wrapper plugin for ESLint", + "description": "ESLint plugin that wraps a TSLint configuration and lints the whole source using TSLint", "keywords": [ "eslint", "eslintplugin", @@ -33,12 +33,12 @@ "clean": "tsc -b tsconfig.build.json --clean", "postclean": "rimraf dist && rimraf coverage", "format": "prettier --write \"./**/*.{ts,mts,cts,tsx,js,mjs,cjs,jsx,json,md,css}\" --ignore-path ../../.prettierignore", - "lint": "eslint . --ignore-path='../../.eslintignore'", + "lint": "nx lint", "test": "jest --coverage", "typecheck": "tsc -p tsconfig.json --noEmit" }, "dependencies": { - "@typescript-eslint/utils": "5.31.0", + "@typescript-eslint/utils": "5.50.0", "lodash": "^4.17.21" }, "peerDependencies": { @@ -48,6 +48,6 @@ }, "devDependencies": { "@types/lodash": "*", - "@typescript-eslint/parser": "5.31.0" + "@typescript-eslint/parser": "5.50.0" } } diff --git a/packages/eslint-plugin-tslint/project.json b/packages/eslint-plugin-tslint/project.json index 8ca785bd7d1..29bcb865041 100644 --- a/packages/eslint-plugin-tslint/project.json +++ b/packages/eslint-plugin-tslint/project.json @@ -1,5 +1,15 @@ { - "root": "packages/eslint-plugin-tslint", + "name": "eslint-plugin-tslint", + "$schema": "../../node_modules/nx/schemas/project-schema.json", "type": "library", - "implicitDependencies": [] + "implicitDependencies": [], + "targets": { + "lint": { + "executor": "@nrwl/linter:eslint", + "outputs": ["{options.outputFile}"], + "options": { + "lintFilePatterns": ["packages/eslint-plugin-tslint/**/*.ts"] + } + } + } } diff --git a/packages/eslint-plugin-tslint/src/custom-linter.ts b/packages/eslint-plugin-tslint/src/custom-linter.ts index 9fcaf9c2b3e..bd8ce6a5be1 100644 --- a/packages/eslint-plugin-tslint/src/custom-linter.ts +++ b/packages/eslint-plugin-tslint/src/custom-linter.ts @@ -1,5 +1,6 @@ -import { ILinterOptions, Linter, LintResult } from 'tslint'; -import { Program, SourceFile } from 'typescript'; +import type { ILinterOptions, LintResult } from 'tslint'; +import { Linter } from 'tslint'; +import type { Program, SourceFile } from 'typescript'; // @ts-expect-error - We need to access the program, but Linter has private program already export class CustomLinter extends Linter { diff --git a/packages/eslint-plugin-tslint/src/rules/config.ts b/packages/eslint-plugin-tslint/src/rules/config.ts index 0e4b29b50cc..97b77e7d080 100644 --- a/packages/eslint-plugin-tslint/src/rules/config.ts +++ b/packages/eslint-plugin-tslint/src/rules/config.ts @@ -1,6 +1,8 @@ import { ESLintUtils } from '@typescript-eslint/utils'; import memoize from 'lodash/memoize'; -import { Configuration, RuleSeverity } from 'tslint'; +import type { RuleSeverity } from 'tslint'; +import { Configuration } from 'tslint'; + import { CustomLinter } from '../custom-linter'; // note - cannot migrate this to an import statement because it will make TSC copy the package.json to the dist folder @@ -62,7 +64,7 @@ export default createRule({ meta: { docs: { description: - 'Wraps a TSLint configuration and lints the whole source using TSLint', + 'Wraps a TSLint configuration and lints the whole source using TSLint', // eslint-disable-line eslint-plugin/require-meta-docs-description recommended: false, }, fixable: 'code', @@ -96,18 +98,13 @@ export default createRule({ ], }, defaultOptions: [{}], - create(context) { + create( + context, + [{ rules: tslintRules, rulesDirectory: tslintRulesDirectory, lintFile }], + ) { const fileName = context.getFilename(); const sourceCode = context.getSourceCode().text; const parserServices = ESLintUtils.getParserServices(context); - - /** - * The TSLint rules configuration passed in by the user - */ - const [ - { rules: tslintRules, rulesDirectory: tslintRulesDirectory, lintFile }, - ] = context.options; - const program = parserServices.program; /** diff --git a/packages/eslint-plugin/CHANGELOG.md b/packages/eslint-plugin/CHANGELOG.md index fa2d7bb86be..25cce92ccc4 100644 --- a/packages/eslint-plugin/CHANGELOG.md +++ b/packages/eslint-plugin/CHANGELOG.md @@ -3,37 +3,36 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. -# [5.31.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.7...v5.31.0) (2022-07-25) +# [5.50.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.49.0...v5.50.0) (2023-01-31) ### Bug Fixes -* **eslint-plugin:** [typedef] Support nested array destructuring with type annotation ([#5311](https://github.com/typescript-eslint/typescript-eslint/issues/5311)) ([6d19efe](https://github.com/typescript-eslint/typescript-eslint/commit/6d19efed16d1cf0357ad363b6373d2021c49a8c8)) -* **scope-manager:** handle typeParameters of TSInstantiationExpression ([#5355](https://github.com/typescript-eslint/typescript-eslint/issues/5355)) ([2595ccf](https://github.com/typescript-eslint/typescript-eslint/commit/2595ccf67cd5158edbd6bebd9ac2dbd8bbd8b99c)) +* **eslint-plugin:** [ban-ts-comment] counts graphemes instead of `String.prototype.length` ([#5704](https://github.com/typescript-eslint/typescript-eslint/issues/5704)) ([09d57ce](https://github.com/typescript-eslint/typescript-eslint/commit/09d57cec8901880c6b24ea80dfa7d9fcdc463930)) +* **eslint-plugin:** [prefer-optional-chain] fix `ThisExpression` and `PrivateIdentifier` errors ([#6028](https://github.com/typescript-eslint/typescript-eslint/issues/6028)) ([85e783c](https://github.com/typescript-eslint/typescript-eslint/commit/85e783c1fabe96d390729a5796d6d346e401692b)) +* **eslint-plugin:** [prefer-optional-chain] fixer produces wrong logic ([#5919](https://github.com/typescript-eslint/typescript-eslint/issues/5919)) ([b0f6c8e](https://github.com/typescript-eslint/typescript-eslint/commit/b0f6c8ec0b372696ef26ca3a2b4f82dafd9dc417)), closes [#1438](https://github.com/typescript-eslint/typescript-eslint/issues/1438) ### Features -* **eslint-plugin:** [consistent-generic-ctors] check class field declaration ([#5288](https://github.com/typescript-eslint/typescript-eslint/issues/5288)) ([48f996e](https://github.com/typescript-eslint/typescript-eslint/commit/48f996e8dda79c9c865e8ca6552069902836648b)) -* **eslint-plugin:** [prefer-nullish-coalescing] add ignoreTernaryTests option ([#4965](https://github.com/typescript-eslint/typescript-eslint/issues/4965)) ([f82727f](https://github.com/typescript-eslint/typescript-eslint/commit/f82727ffeb97475c07773ca1d1e5b9609fcc5e68)) +* **eslint-plugin:** add `key-spacing` rule extension for interface & type declarations ([#6211](https://github.com/typescript-eslint/typescript-eslint/issues/6211)) ([67706e7](https://github.com/typescript-eslint/typescript-eslint/commit/67706e72e332bf11c82fdf51f3d417d3c93a86cf)) -## [5.30.7](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.6...v5.30.7) (2022-07-18) +# [5.49.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.48.2...v5.49.0) (2023-01-23) -### Bug Fixes +### Features -* **eslint-plugin:** [no-inferrable] fix optional param to valid code ([#5342](https://github.com/typescript-eslint/typescript-eslint/issues/5342)) ([98f6d5e](https://github.com/typescript-eslint/typescript-eslint/commit/98f6d5e6d08d1eb9789da52a15f337f5f53438bd)) -* **eslint-plugin:** [no-unused-vars] highlight last write reference ([#5267](https://github.com/typescript-eslint/typescript-eslint/issues/5267)) ([c3f199a](https://github.com/typescript-eslint/typescript-eslint/commit/c3f199a65a16aa72f5bb83e81a1ce0ffb5f69772)) +* **eslint-plugin:** [naming-convention] add support for `#private` modifier on class members ([#6259](https://github.com/typescript-eslint/typescript-eslint/issues/6259)) ([c8a6d80](https://github.com/typescript-eslint/typescript-eslint/commit/c8a6d8096080228b6d122c861fe140ac97f17cbe)) -## [5.30.6](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.5...v5.30.6) (2022-07-11) +## [5.48.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.48.1...v5.48.2) (2023-01-16) **Note:** Version bump only for package @typescript-eslint/eslint-plugin @@ -41,2641 +40,2010 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline -## [5.30.5](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.4...v5.30.5) (2022-07-04) +## [5.48.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.48.0...v5.48.1) (2023-01-09) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin -### Bug Fixes -* **eslint-plugin:** [consistent-indexed-object-style] fix record mode fixer for generics with a default value ([#5280](https://github.com/typescript-eslint/typescript-eslint/issues/5280)) ([57f032c](https://github.com/typescript-eslint/typescript-eslint/commit/57f032c2e6a822c049177713778d0077ee138d9a)) +# [5.48.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.47.1...v5.48.0) (2023-01-02) +### Features -## [5.30.4](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.3...v5.30.4) (2022-07-03) +- **eslint-plugin:** specify which method is unbound and added test case ([#6281](https://github.com/typescript-eslint/typescript-eslint/issues/6281)) ([cf3ffdd](https://github.com/typescript-eslint/typescript-eslint/commit/cf3ffdd49aceb734ce18dc44ed6a11f7701f178e)) -**Note:** Version bump only for package @typescript-eslint/eslint-plugin +## [5.47.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.47.0...v5.47.1) (2022-12-26) + +### Bug Fixes +- **ast-spec:** correct some incorrect ast types ([#6257](https://github.com/typescript-eslint/typescript-eslint/issues/6257)) ([0f3f645](https://github.com/typescript-eslint/typescript-eslint/commit/0f3f64571ea5d938081b1a9f3fd1495765201700)) +- **eslint-plugin:** [member-ordering] correctly invert optionalityOrder ([#6256](https://github.com/typescript-eslint/typescript-eslint/issues/6256)) ([ccd45d4](https://github.com/typescript-eslint/typescript-eslint/commit/ccd45d4a998946b7be1161f8c8216bc458e50b4e)) +# [5.47.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.46.1...v5.47.0) (2022-12-19) +### Features +- **eslint-plugin:** [no-floating-promises] add suggestion fixer to add an 'await' ([#5943](https://github.com/typescript-eslint/typescript-eslint/issues/5943)) ([9e35ef9](https://github.com/typescript-eslint/typescript-eslint/commit/9e35ef9af3ec51ab2dd49336699f3a94528bb4b1)) -## [5.30.3](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.2...v5.30.3) (2022-07-01) +## [5.46.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.46.0...v5.46.1) (2022-12-12) **Note:** Version bump only for package @typescript-eslint/eslint-plugin +# [5.46.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.45.1...v5.46.0) (2022-12-08) + +### Bug Fixes +- **eslint-plugin:** [ban-types] update message to suggest `object` instead of `Record` ([#6079](https://github.com/typescript-eslint/typescript-eslint/issues/6079)) ([d91a5fc](https://github.com/typescript-eslint/typescript-eslint/commit/d91a5fc41be5bc2a0625574e9c9496f61fb7471d)) +### Features +- **eslint-plugin:** [prefer-nullish-coalescing] logic and test for strict null checks ([#6174](https://github.com/typescript-eslint/typescript-eslint/issues/6174)) ([8a91cbd](https://github.com/typescript-eslint/typescript-eslint/commit/8a91cbd9fbe5bc4cf750cd949d2b8d48ff4c311d)) -## [5.30.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.1...v5.30.2) (2022-07-01) +## [5.45.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.45.0...v5.45.1) (2022-12-05) -**Note:** Version bump only for package @typescript-eslint/eslint-plugin +### Bug Fixes +- **eslint-plugin:** [keyword-spacing] unexpected space before/after in `import type` ([#6095](https://github.com/typescript-eslint/typescript-eslint/issues/6095)) ([98caa92](https://github.com/typescript-eslint/typescript-eslint/commit/98caa92ca89bdf0ca6ba6e4ff1f13c60221579e8)) +- **eslint-plugin:** [no-shadow] add call and method signatures to `ignoreFunctionTypeParameterNameValueShadow` ([#6129](https://github.com/typescript-eslint/typescript-eslint/issues/6129)) ([9d58b6b](https://github.com/typescript-eslint/typescript-eslint/commit/9d58b6be246507d20af67c84a5e9bb592d97cff5)) +- **eslint-plugin:** [prefer-optional-chain] collect MetaProperty type ([#6083](https://github.com/typescript-eslint/typescript-eslint/issues/6083)) ([d7114d3](https://github.com/typescript-eslint/typescript-eslint/commit/d7114d3ab09d1b93627d3b3dbb9862e37ee29c97)) +- **eslint-plugin:** [sort-type-constituents, sort-type-union-intersection-members] handle some required parentheses cases in the fixer ([#6118](https://github.com/typescript-eslint/typescript-eslint/issues/6118)) ([5d49d5d](https://github.com/typescript-eslint/typescript-eslint/commit/5d49d5dbee4425fc8bc01c5e748d161f3619477b)) +# [5.45.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.44.0...v5.45.0) (2022-11-28) +### Bug Fixes +- **eslint-plugin:** [array-type] --fix flag removes parentheses from type ([#5997](https://github.com/typescript-eslint/typescript-eslint/issues/5997)) ([42b33af](https://github.com/typescript-eslint/typescript-eslint/commit/42b33af256e5269feb214c7bb161079f770964fa)) +- **eslint-plugin:** [keyword-spacing] prevent crash on no options ([#6073](https://github.com/typescript-eslint/typescript-eslint/issues/6073)) ([1f19998](https://github.com/typescript-eslint/typescript-eslint/commit/1f19998e3ec6d592fc679a7490708e2e96816f4c)) +- **eslint-plugin:** [member-ordering] support private fields ([#5859](https://github.com/typescript-eslint/typescript-eslint/issues/5859)) ([f02761a](https://github.com/typescript-eslint/typescript-eslint/commit/f02761af19848a84b8d1832bd00fd6c95d38fa0c)) +- **eslint-plugin:** [prefer-readonly] report if a member's property is reassigned ([#6043](https://github.com/typescript-eslint/typescript-eslint/issues/6043)) ([6e079eb](https://github.com/typescript-eslint/typescript-eslint/commit/6e079eb35cfec79ba9965627477117f026d161ac)) -## [5.30.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.0...v5.30.1) (2022-07-01) +### Features +- **eslint-plugin:** [member-ordering] add a required option for required vs. optional member ordering ([#5965](https://github.com/typescript-eslint/typescript-eslint/issues/5965)) ([2abadc6](https://github.com/typescript-eslint/typescript-eslint/commit/2abadc6c26cd6300764157d405a2462b754d050b)) -### Bug Fixes +# [5.44.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.43.0...v5.44.0) (2022-11-21) -* **eslint-plugin:** [no-base-to-string] add missing apostrophe to message ([#5270](https://github.com/typescript-eslint/typescript-eslint/issues/5270)) ([d320174](https://github.com/typescript-eslint/typescript-eslint/commit/58034e343a167ca7751b54d2b2a0e7d3852aabec)) +### Bug Fixes +- **eslint-plugin:** [no-empty-interface] disable autofix for declaration merging with class ([#5920](https://github.com/typescript-eslint/typescript-eslint/issues/5920)) ([a4f85b8](https://github.com/typescript-eslint/typescript-eslint/commit/a4f85b8cfe38ba8ea2a2ac4a56d9b11a81a8a15a)) +- **eslint-plugin:** [no-unnecessary-condition] handle index signature type ([#5912](https://github.com/typescript-eslint/typescript-eslint/issues/5912)) ([5baad08](https://github.com/typescript-eslint/typescript-eslint/commit/5baad0893f9a90633d57fffac69af7523bd1501e)) +- **eslint-plugin:** [prefer-optional-chain] handle binary expressions in negated or ([#5992](https://github.com/typescript-eslint/typescript-eslint/issues/5992)) ([2778ff0](https://github.com/typescript-eslint/typescript-eslint/commit/2778ff0c3db011148be93ed3bea5ce07af3c81ef)) +- **typescript-estree:** don't consider a cached program unless it's specified in the current `parserOptions.project` config ([#5999](https://github.com/typescript-eslint/typescript-eslint/issues/5999)) ([530e0e6](https://github.com/typescript-eslint/typescript-eslint/commit/530e0e618cdf4bb956149bf8a8484848e1b9a1f5)) +### Features +- **eslint-plugin:** [adjacent-overload-signatures] check BlockStatement nodes ([#5998](https://github.com/typescript-eslint/typescript-eslint/issues/5998)) ([97d3e56](https://github.com/typescript-eslint/typescript-eslint/commit/97d3e56709ee19fdec39fd8b99d080db90b306e9)) +- **eslint-plugin:** [keyword-spacing] Support spacing in import-type syntax ([#5977](https://github.com/typescript-eslint/typescript-eslint/issues/5977)) ([6a735e1](https://github.com/typescript-eslint/typescript-eslint/commit/6a735e142ef67f3af6497f922cf83706867eb6b7)) +# [5.43.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.42.1...v5.43.0) (2022-11-14) -# [5.30.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.29.0...v5.30.0) (2022-06-27) +### Bug Fixes +- **eslint-plugin:** [no-shadow] handle false positives on generics and parameters ([#5902](https://github.com/typescript-eslint/typescript-eslint/issues/5902)) ([769e8c8](https://github.com/typescript-eslint/typescript-eslint/commit/769e8c8b9a51cd3448e47d13c7b0dab0468ee23c)) +- **eslint-plugin:** [promise-function-async] handle keyword token ([#5907](https://github.com/typescript-eslint/typescript-eslint/issues/5907)) ([f25a94f](https://github.com/typescript-eslint/typescript-eslint/commit/f25a94fa75e497a6b9ec29a008bcc89818eed60d)) ### Features -* **eslint-plugin:** [no-shadow] add shadowed variable location to the error message ([#5183](https://github.com/typescript-eslint/typescript-eslint/issues/5183)) ([8ca08e9](https://github.com/typescript-eslint/typescript-eslint/commit/8ca08e9f18d59b29715c667fbb7d237f6e9a96ba)) -* treat `this` in `typeof this` as a `ThisExpression` ([#4382](https://github.com/typescript-eslint/typescript-eslint/issues/4382)) ([b04b2ce](https://github.com/typescript-eslint/typescript-eslint/commit/b04b2ce1ba90d94718891f2562dd210a6d7b8609)) +- **eslint-plugin:** [consistent-type-imports] support fixing to inline types ([#5050](https://github.com/typescript-eslint/typescript-eslint/issues/5050)) ([75dcdf1](https://github.com/typescript-eslint/typescript-eslint/commit/75dcdf164d206c5530ba7cc095c4599ec90abe35)) +- **eslint-plugin:** [naming-convention] add support for "override" and "async" modifiers ([#5310](https://github.com/typescript-eslint/typescript-eslint/issues/5310)) ([#5610](https://github.com/typescript-eslint/typescript-eslint/issues/5610)) ([c759da1](https://github.com/typescript-eslint/typescript-eslint/commit/c759da169390ba490eee9ef773cc9edc88a32817)) +- **eslint-plugin:** [prefer-optional-chain] support suggesting `!foo || !foo.bar` as a valid match for the rule ([#5594](https://github.com/typescript-eslint/typescript-eslint/issues/5594)) ([923d486](https://github.com/typescript-eslint/typescript-eslint/commit/923d486c8c9c9096deac425e7a6cb0b6457eacbd)) +## [5.42.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.42.0...v5.42.1) (2022-11-07) +### Bug Fixes +- **eslint-plugin:** isTypeReadonly stack overflow ([#5875](https://github.com/typescript-eslint/typescript-eslint/issues/5875)) ([#5876](https://github.com/typescript-eslint/typescript-eslint/issues/5876)) ([2d9a33c](https://github.com/typescript-eslint/typescript-eslint/commit/2d9a33cfb2db53d76246a59253daaf2abb19ee57)) +# [5.42.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.41.0...v5.42.0) (2022-10-31) -# [5.29.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.28.0...v5.29.0) (2022-06-20) +### Bug Fixes -**Note:** Version bump only for package @typescript-eslint/eslint-plugin +- **ast-spec:** add TSQualifiedName to TypeNode union ([#5906](https://github.com/typescript-eslint/typescript-eslint/issues/5906)) ([5c316c1](https://github.com/typescript-eslint/typescript-eslint/commit/5c316c12f09d58aee6ee634a8055533f361f1589)) +- **eslint-plugin:** [no-extra-parens] handle type assertion in extends clause ([#5901](https://github.com/typescript-eslint/typescript-eslint/issues/5901)) ([8ed7219](https://github.com/typescript-eslint/typescript-eslint/commit/8ed72192c274249d26628fb125796e71318b857a)) +### Features +- **eslint-plugin:** [member-ordering] add natural sort order ([#5662](https://github.com/typescript-eslint/typescript-eslint/issues/5662)) ([1eaae09](https://github.com/typescript-eslint/typescript-eslint/commit/1eaae09ecca359f366b94f6a04665403f48b05c7)) +- **eslint-plugin:** [no-invalid-void-type] better report message for void used as a constituent inside a function return type ([#5274](https://github.com/typescript-eslint/typescript-eslint/issues/5274)) ([d806bda](https://github.com/typescript-eslint/typescript-eslint/commit/d806bda82343712a24e3c78b9b34d4345dd1de3b)) +# [5.41.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.40.1...v5.41.0) (2022-10-24) +### Bug Fixes -# [5.28.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.27.1...v5.28.0) (2022-06-13) +- **eslint-plugin:** [no-base-to-string] ignore Error, URL, and URLSearchParams by default ([#5839](https://github.com/typescript-eslint/typescript-eslint/issues/5839)) ([96e1c6c](https://github.com/typescript-eslint/typescript-eslint/commit/96e1c6c171a34b0793c50c3dba853c3999a6bd49)) +- **type-utils:** prevent stack overflow in `isTypeReadonly` ([#5860](https://github.com/typescript-eslint/typescript-eslint/issues/5860)) ([a6d8f7e](https://github.com/typescript-eslint/typescript-eslint/commit/a6d8f7edb84f9f6dd59a76faf53bf686756e2aed)), closes [#4476](https://github.com/typescript-eslint/typescript-eslint/issues/4476) +### Features + +- **eslint-plugin:** [no-unsafe-declaration-merging] switch to use scope analysis instead of type information ([#5865](https://github.com/typescript-eslint/typescript-eslint/issues/5865)) ([e70a10a](https://github.com/typescript-eslint/typescript-eslint/commit/e70a10aea684bc6bca05b69bfce3bae769a5f5ab)) +- **eslint-plugin:** add no-unsafe-declaration-merging ([#5840](https://github.com/typescript-eslint/typescript-eslint/issues/5840)) ([3728031](https://github.com/typescript-eslint/typescript-eslint/commit/3728031c659dabde7658cd54184951d4be9aabcb)) + +## [5.40.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.40.0...v5.40.1) (2022-10-17) ### Bug Fixes -* [TS4.7] allow visiting of typeParameters in TSTypeQuery ([#5166](https://github.com/typescript-eslint/typescript-eslint/issues/5166)) ([dc1f930](https://github.com/typescript-eslint/typescript-eslint/commit/dc1f9309cf04aa7314e758980ac687558482f47f)) -* **eslint-plugin:** [space-infix-ops] support for optional property without type ([#5155](https://github.com/typescript-eslint/typescript-eslint/issues/5155)) ([1f25daf](https://github.com/typescript-eslint/typescript-eslint/commit/1f25daf74e5d45077199f9ee9fa9bf31107f4089)) +- **eslint-plugin:** Skip missing 'rest' tuple type arguments in no-misused-promises ([#5809](https://github.com/typescript-eslint/typescript-eslint/issues/5809)) ([c5beaa2](https://github.com/typescript-eslint/typescript-eslint/commit/c5beaa2ea340985211ca5c12821842c54f5170f0)), closes [#5807](https://github.com/typescript-eslint/typescript-eslint/issues/5807) + +# [5.40.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.39.0...v5.40.0) (2022-10-10) +### Bug Fixes + +- **eslint-plugin:** [consistent-indexed-object-style] handle interface generic ([#5746](https://github.com/typescript-eslint/typescript-eslint/issues/5746)) ([7a8a0a3](https://github.com/typescript-eslint/typescript-eslint/commit/7a8a0a3c500ca726d2ab3bee0ae9f3fb9d8d39b8)) +- **eslint-plugin:** [no-unnecessary-condition] handle void ([#5766](https://github.com/typescript-eslint/typescript-eslint/issues/5766)) ([ac8f06b](https://github.com/typescript-eslint/typescript-eslint/commit/ac8f06b68dca7666bfb78fb38d6ccc07f676e435)) ### Features -* **eslint-plugin:** [consistent-generic-constructors] add rule ([#4924](https://github.com/typescript-eslint/typescript-eslint/issues/4924)) ([921cdf1](https://github.com/typescript-eslint/typescript-eslint/commit/921cdf17e548845311d0591249616ec844503926)) +- **eslint-plugin:** Check 'rest' parameters in no-misused-promises ([#5731](https://github.com/typescript-eslint/typescript-eslint/issues/5731)) ([6477f38](https://github.com/typescript-eslint/typescript-eslint/commit/6477f3855627cc257edc021b859711d4a5847a12)), closes [#4015](https://github.com/typescript-eslint/typescript-eslint/issues/4015) +- **utils:** add dependency constraint filtering for `RuleTester` ([#5750](https://github.com/typescript-eslint/typescript-eslint/issues/5750)) ([121f4c0](https://github.com/typescript-eslint/typescript-eslint/commit/121f4c0e7252def95d917e4734e933e53e29d501)) +# [5.39.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.38.1...v5.39.0) (2022-10-03) +### Features +- **eslint-plugin:** allow using void as a default type for a generic argument if allowInGenericTypeArguments is specified ([#5671](https://github.com/typescript-eslint/typescript-eslint/issues/5671)) ([bb46ef0](https://github.com/typescript-eslint/typescript-eslint/commit/bb46ef0817fe03ef71f8e0f3df0cf96bc355e068)) +## [5.38.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.38.0...v5.38.1) (2022-09-26) -## [5.27.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.27.0...v5.27.1) (2022-06-06) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin + +# [5.38.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.37.0...v5.38.0) (2022-09-19) + +**Note:** Version bump only for package @typescript-eslint/eslint-plugin +# [5.37.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.36.2...v5.37.0) (2022-09-12) ### Bug Fixes -* **eslint-plugin:** [space-infix-ops] correct PropertyDefinition with typeAnnotation ([#5113](https://github.com/typescript-eslint/typescript-eslint/issues/5113)) ([d320174](https://github.com/typescript-eslint/typescript-eslint/commit/d320174f40a74b34e6b6e4c88128ef6e736311d8)) -* **eslint-plugin:** [space-infix-ops] regression fix for conditional types ([#5135](https://github.com/typescript-eslint/typescript-eslint/issues/5135)) ([e5238c8](https://github.com/typescript-eslint/typescript-eslint/commit/e5238c84e56e7c34174b2c6f1e3ea59456797c2f)) -* **eslint-plugin:** [space-infix-ops] regression fix for type aliases ([#5138](https://github.com/typescript-eslint/typescript-eslint/issues/5138)) ([4e13deb](https://github.com/typescript-eslint/typescript-eslint/commit/4e13deb05fbd8724996156b15b65f6a66794a7cc)) +- **eslint-plugin:** [strict-boolean-expressions] check all conditions in a logical operator chain ([#5539](https://github.com/typescript-eslint/typescript-eslint/issues/5539)) ([77d76e2](https://github.com/typescript-eslint/typescript-eslint/commit/77d76e21cdc2e100c729c839c292e82ab7c554c5)) +## [5.36.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.36.1...v5.36.2) (2022-09-05) +### Bug Fixes +- **eslint-plugin:** [no-extra-parens] handle generic ts array type. ([#5550](https://github.com/typescript-eslint/typescript-eslint/issues/5550)) ([0d6a190](https://github.com/typescript-eslint/typescript-eslint/commit/0d6a190c56fb3489f9f554b9035a008e29cc08ec)) +- **scope-manager:** correct handling for class static blocks ([#5580](https://github.com/typescript-eslint/typescript-eslint/issues/5580)) ([35bb8dd](https://github.com/typescript-eslint/typescript-eslint/commit/35bb8ddac1b46397f6447c1a6e1e4e1774dd7957)) +## [5.36.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.36.0...v5.36.1) (2022-08-30) -# [5.27.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.26.0...v5.27.0) (2022-05-30) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin +# [5.36.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.35.1...v5.36.0) (2022-08-30) ### Bug Fixes -* **eslint-plugin:** [no-type-alias] handle Template Literal Types ([#5092](https://github.com/typescript-eslint/typescript-eslint/issues/5092)) ([8febf11](https://github.com/typescript-eslint/typescript-eslint/commit/8febf11a9296d1c0d7ccdf91ef9ab92ec8dfc39c)) - +- **eslint-plugin:** revert [#5266](https://github.com/typescript-eslint/typescript-eslint/issues/5266) ([#5564](https://github.com/typescript-eslint/typescript-eslint/issues/5564)) ([7a8afe2](https://github.com/typescript-eslint/typescript-eslint/commit/7a8afe29039c6c80fe584acaf5d933424a4452a9)) ### Features -* [4.7] support new extensions ([#5027](https://github.com/typescript-eslint/typescript-eslint/issues/5027)) ([efc147b](https://github.com/typescript-eslint/typescript-eslint/commit/efc147b04dce52ab17415b6a4ae4076b944b9036)) -* **eslint-plugin:** [ban-ts-comment] add descriptionFormat option ([#5026](https://github.com/typescript-eslint/typescript-eslint/issues/5026)) ([1fb31a4](https://github.com/typescript-eslint/typescript-eslint/commit/1fb31a4b3e05734f801ade0450fea33494e4d5e6)) -* **eslint-plugin:** [no-misused-promises] warn when spreading promises ([#5053](https://github.com/typescript-eslint/typescript-eslint/issues/5053)) ([61ffa9e](https://github.com/typescript-eslint/typescript-eslint/commit/61ffa9ed70e3cac6eca50a6c3cc5a0f1e7dec11c)) -* **eslint-plugin:** [space-infix-ops] missing error report for conditional types ([#5041](https://github.com/typescript-eslint/typescript-eslint/issues/5041)) ([0bfab6c](https://github.com/typescript-eslint/typescript-eslint/commit/0bfab6c9f5c5e243268200cf9368acf39ea099f8)) +- support TypeScript 4.8 ([#5551](https://github.com/typescript-eslint/typescript-eslint/issues/5551)) ([81450ed](https://github.com/typescript-eslint/typescript-eslint/commit/81450ed7eaede74b384e9a91a84e9b4d34513866)) +## [5.35.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.35.0...v5.35.1) (2022-08-24) +### Bug Fixes +- **eslint-plugin:** correct rule schemas to pass ajv validation ([#5531](https://github.com/typescript-eslint/typescript-eslint/issues/5531)) ([dbf8b56](https://github.com/typescript-eslint/typescript-eslint/commit/dbf8b569dbada29e4a295d6c265976e55de1b2aa)) +# [5.35.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.34.0...v5.35.0) (2022-08-24) -# [5.26.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.25.0...v5.26.0) (2022-05-23) +### Features + +- **eslint-plugin:** [explicit-member-accessibility] suggest adding explicit accessibility specifiers ([#5492](https://github.com/typescript-eslint/typescript-eslint/issues/5492)) ([0edb94a](https://github.com/typescript-eslint/typescript-eslint/commit/0edb94aee55e1ec6afa7f46f99a9b308bbb66301)) +# [5.34.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.33.1...v5.34.0) (2022-08-22) ### Bug Fixes -* **eslint-plugin:** [member-delimiter-style] autofixer result is not as expected when comments after the delimiter with option `delimiter: 'none'` ([#5029](https://github.com/typescript-eslint/typescript-eslint/issues/5029)) ([ed7b5f6](https://github.com/typescript-eslint/typescript-eslint/commit/ed7b5f61d93799fec3e38a87935ab9caa3abe279)) -* **eslint-plugin:** [member-delimiter-style] autofixer result is not as expected with option `delimiter: 'none'` ([#5023](https://github.com/typescript-eslint/typescript-eslint/issues/5023)) ([9e97a11](https://github.com/typescript-eslint/typescript-eslint/commit/9e97a11ecd80be5c63c980bfe8d8e57400221cec)) -* **eslint-plugin:** [prefer-readonly] correct issue with anonymus functions ([#4974](https://github.com/typescript-eslint/typescript-eslint/issues/4974)) ([952e2f0](https://github.com/typescript-eslint/typescript-eslint/commit/952e2f068862dde089ec03d3eb5452d1ee3e9271)), closes [#2590](https://github.com/typescript-eslint/typescript-eslint/issues/2590) +- **eslint-plugin:** [no-useless-constructor] handle parameter decorator ([#5450](https://github.com/typescript-eslint/typescript-eslint/issues/5450)) ([864dbcf](https://github.com/typescript-eslint/typescript-eslint/commit/864dbcfccba274fe1b26eac8aeeaf2a2355b5969)) +### Features +- **eslint-plugin:** [prefer-optional-chain] support suggesting `!foo || !foo.bar` as a valid match for the rule ([#5266](https://github.com/typescript-eslint/typescript-eslint/issues/5266)) ([aca935c](https://github.com/typescript-eslint/typescript-eslint/commit/aca935c9696712d4aff18144c4690db4d6ba9bf9)) +## [5.33.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.33.0...v5.33.1) (2022-08-15) +### Bug Fixes -# [5.25.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.24.0...v5.25.0) (2022-05-17) +- missing placeholders in violation messages for `no-unnecessary-type-constraint` and `no-unsafe-argument` (and enable `eslint-plugin/recommended` rules internally) ([#5453](https://github.com/typescript-eslint/typescript-eslint/issues/5453)) ([d023910](https://github.com/typescript-eslint/typescript-eslint/commit/d0239104f4dbffd2b5ecdb19e520c7d4b71962e0)) +# [5.33.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.32.0...v5.33.0) (2022-08-08) ### Bug Fixes -* **eslint-plugin:** [typedef] stop enforcing rule for assignment expressions ([#4958](https://github.com/typescript-eslint/typescript-eslint/issues/4958)) ([04a216c](https://github.com/typescript-eslint/typescript-eslint/commit/04a216c39c02085fe5d555ce81bdced0e563a7c4)) -* **eslint-plugin:** strict config should not extend recommended ([#5005](https://github.com/typescript-eslint/typescript-eslint/issues/5005)) ([05d71c2](https://github.com/typescript-eslint/typescript-eslint/commit/05d71c2ebd8e072aa4e8ee3ea8521de00e47d4ca)) -* **website:** correct Presets link to be Configs ([#5004](https://github.com/typescript-eslint/typescript-eslint/issues/5004)) ([e18e91c](https://github.com/typescript-eslint/typescript-eslint/commit/e18e91c6cfb1ee93bfff3770ea4d8f807d5ced0b)) - +- **eslint-plugin:** [no-extra-parens] handle await with type assertion ([#5428](https://github.com/typescript-eslint/typescript-eslint/issues/5428)) ([e03826f](https://github.com/typescript-eslint/typescript-eslint/commit/e03826f08ce8bfdd6d6702025d975cfb7d867097)) +- **website:** add explicit frontmatter description to rule docs ([#5429](https://github.com/typescript-eslint/typescript-eslint/issues/5429)) ([63cba5f](https://github.com/typescript-eslint/typescript-eslint/commit/63cba5f4c1884e102927b3b14b18a00e96ac63a1)) ### Features -* **eslint-plugin:** [no-empty-function] new allow option overrideMethods ([#4923](https://github.com/typescript-eslint/typescript-eslint/issues/4923)) ([13c05ae](https://github.com/typescript-eslint/typescript-eslint/commit/13c05aefb0e6531d320629e04b7207a3baebacb0)) -* **eslint-plugin:** deprecate `no-duplicate-imports` in favour of `import/no-duplicates` ([#4973](https://github.com/typescript-eslint/typescript-eslint/issues/4973)) ([1d2e41a](https://github.com/typescript-eslint/typescript-eslint/commit/1d2e41ada1979c081130d19b229c82bf1a69b7b4)) -* update to TypeScript 4.7-rc ([#4829](https://github.com/typescript-eslint/typescript-eslint/issues/4829)) ([6fe783c](https://github.com/typescript-eslint/typescript-eslint/commit/6fe783c20aebe26ef42b526e4a59a9be84dd5643)) - - +- **eslint-plugin:** [member-ordering] support static blocks ([#5417](https://github.com/typescript-eslint/typescript-eslint/issues/5417)) ([5983e5a](https://github.com/typescript-eslint/typescript-eslint/commit/5983e5ab3bfb94fec782bea54a37457fe31db545)) +- **eslint-plugin:** [prefer-as-const] adds support for class properties ([#5413](https://github.com/typescript-eslint/typescript-eslint/issues/5413)) ([d2394f8](https://github.com/typescript-eslint/typescript-eslint/commit/d2394f810960fda07b9c8affd47b769d16f4b8cb)) +# [5.32.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.31.0...v5.32.0) (2022-08-01) +### Features -# [5.24.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.23.0...v5.24.0) (2022-05-16) +- **eslint-plugin:** [no-use-before-define] add "allowNamedExports" option ([#5397](https://github.com/typescript-eslint/typescript-eslint/issues/5397)) ([ad412cd](https://github.com/typescript-eslint/typescript-eslint/commit/ad412cdd74dc5619fbe4bf27c0a5eb5c5a4b65ca)) +# [5.31.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.7...v5.31.0) (2022-07-25) ### Bug Fixes -* **eslint-plugin:** [array-type] in fixer add missing parens for constructor types [#4756](https://github.com/typescript-eslint/typescript-eslint/issues/4756) ([#4971](https://github.com/typescript-eslint/typescript-eslint/issues/4971)) ([0377070](https://github.com/typescript-eslint/typescript-eslint/commit/03770708900da663eb64c19465b3f937bab55b3d)) - +- **eslint-plugin:** [typedef] Support nested array destructuring with type annotation ([#5311](https://github.com/typescript-eslint/typescript-eslint/issues/5311)) ([6d19efe](https://github.com/typescript-eslint/typescript-eslint/commit/6d19efed16d1cf0357ad363b6373d2021c49a8c8)) +- **scope-manager:** handle typeParameters of TSInstantiationExpression ([#5355](https://github.com/typescript-eslint/typescript-eslint/issues/5355)) ([2595ccf](https://github.com/typescript-eslint/typescript-eslint/commit/2595ccf67cd5158edbd6bebd9ac2dbd8bbd8b99c)) ### Features -* **eslint-plugin:** Add BigInt object type to default ban-types list ([#4970](https://github.com/typescript-eslint/typescript-eslint/issues/4970)) ([1867728](https://github.com/typescript-eslint/typescript-eslint/commit/1867728ba104a6a21941ed300828110964a43b96)) -* **eslint-plugin:** add new 'strict' config ([#4706](https://github.com/typescript-eslint/typescript-eslint/issues/4706)) ([4a500b2](https://github.com/typescript-eslint/typescript-eslint/commit/4a500b2d92a91873dbb729793d1ee1c36ef06ed8)) +- **eslint-plugin:** [consistent-generic-ctors] check class field declaration ([#5288](https://github.com/typescript-eslint/typescript-eslint/issues/5288)) ([48f996e](https://github.com/typescript-eslint/typescript-eslint/commit/48f996e8dda79c9c865e8ca6552069902836648b)) +- **eslint-plugin:** [prefer-nullish-coalescing] add ignoreTernaryTests option ([#4965](https://github.com/typescript-eslint/typescript-eslint/issues/4965)) ([f82727f](https://github.com/typescript-eslint/typescript-eslint/commit/f82727ffeb97475c07773ca1d1e5b9609fcc5e68)) +## [5.30.7](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.6...v5.30.7) (2022-07-18) +### Bug Fixes +- **eslint-plugin:** [no-inferrable] fix optional param to valid code ([#5342](https://github.com/typescript-eslint/typescript-eslint/issues/5342)) ([98f6d5e](https://github.com/typescript-eslint/typescript-eslint/commit/98f6d5e6d08d1eb9789da52a15f337f5f53438bd)) +- **eslint-plugin:** [no-unused-vars] highlight last write reference ([#5267](https://github.com/typescript-eslint/typescript-eslint/issues/5267)) ([c3f199a](https://github.com/typescript-eslint/typescript-eslint/commit/c3f199a65a16aa72f5bb83e81a1ce0ffb5f69772)) +## [5.30.6](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.5...v5.30.6) (2022-07-11) -# [5.23.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.22.0...v5.23.0) (2022-05-09) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin +## [5.30.5](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.4...v5.30.5) (2022-07-04) ### Bug Fixes -* **eslint-plugin:** [no-restricted-imports] allow type import as long as there's one matching pattern ([#4898](https://github.com/typescript-eslint/typescript-eslint/issues/4898)) ([0419d28](https://github.com/typescript-eslint/typescript-eslint/commit/0419d287b637e805c33036a45760badc2498e19b)) -* **eslint-plugin:** [no-unnecessary-type-constraint] change to suggestion fix, fix multiple trailing comma failures ([#4901](https://github.com/typescript-eslint/typescript-eslint/issues/4901)) ([4507ac8](https://github.com/typescript-eslint/typescript-eslint/commit/4507ac84c76da0ced43b6679305afe1891e7afca)) +- **eslint-plugin:** [consistent-indexed-object-style] fix record mode fixer for generics with a default value ([#5280](https://github.com/typescript-eslint/typescript-eslint/issues/5280)) ([57f032c](https://github.com/typescript-eslint/typescript-eslint/commit/57f032c2e6a822c049177713778d0077ee138d9a)) +## [5.30.4](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.3...v5.30.4) (2022-07-03) + +**Note:** Version bump only for package @typescript-eslint/eslint-plugin +## [5.30.3](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.2...v5.30.3) (2022-07-01) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin +## [5.30.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.1...v5.30.2) (2022-07-01) -# [5.22.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.21.0...v5.22.0) (2022-05-02) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin +## [5.30.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.0...v5.30.1) (2022-07-01) ### Bug Fixes -* **eslint-plugin:** [comma-spacing] verify `nextToken` exists ([#4868](https://github.com/typescript-eslint/typescript-eslint/issues/4868)) ([23746f8](https://github.com/typescript-eslint/typescript-eslint/commit/23746f8babace7c2354368d6fb0881be26e19c41)) +- **eslint-plugin:** [no-base-to-string] add missing apostrophe to message ([#5270](https://github.com/typescript-eslint/typescript-eslint/issues/5270)) ([d320174](https://github.com/typescript-eslint/typescript-eslint/commit/58034e343a167ca7751b54d2b2a0e7d3852aabec)) +# [5.30.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.29.0...v5.30.0) (2022-06-27) ### Features -* **eslint-plugin:** [no-duplicate-enum-values] add rule ([#4833](https://github.com/typescript-eslint/typescript-eslint/issues/4833)) ([5899164](https://github.com/typescript-eslint/typescript-eslint/commit/5899164b35d91106512a2720b23ba92e1893132f)) - - - +- **eslint-plugin:** [no-shadow] add shadowed variable location to the error message ([#5183](https://github.com/typescript-eslint/typescript-eslint/issues/5183)) ([8ca08e9](https://github.com/typescript-eslint/typescript-eslint/commit/8ca08e9f18d59b29715c667fbb7d237f6e9a96ba)) +- treat `this` in `typeof this` as a `ThisExpression` ([#4382](https://github.com/typescript-eslint/typescript-eslint/issues/4382)) ([b04b2ce](https://github.com/typescript-eslint/typescript-eslint/commit/b04b2ce1ba90d94718891f2562dd210a6d7b8609)) +# [5.29.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.28.0...v5.29.0) (2022-06-20) -# [5.21.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.20.0...v5.21.0) (2022-04-25) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin +# [5.28.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.27.1...v5.28.0) (2022-06-13) ### Bug Fixes -* **eslint-plugin:** [no-misused-promises] prioritize false returns when checking whether a function returns only void ([#4841](https://github.com/typescript-eslint/typescript-eslint/issues/4841)) ([ccadb60](https://github.com/typescript-eslint/typescript-eslint/commit/ccadb6075d6977c4921ffc09fa40f515f4d497c5)) -* **eslint-plugin:** [no-namespace] fix false positive for exported namespaces when allowDeclarations=true ([#4844](https://github.com/typescript-eslint/typescript-eslint/issues/4844)) ([4e7c9be](https://github.com/typescript-eslint/typescript-eslint/commit/4e7c9be6ff7e2448f4151563d7921cd285c2e349)) -* **eslint-plugin:** [space-infix-ops] fix no error when right type is function ([#4848](https://github.com/typescript-eslint/typescript-eslint/issues/4848)) ([d74d559](https://github.com/typescript-eslint/typescript-eslint/commit/d74d559c25e336c3ebe917bf5c43e14ffa2de694)) - +- [TS4.7] allow visiting of typeParameters in TSTypeQuery ([#5166](https://github.com/typescript-eslint/typescript-eslint/issues/5166)) ([dc1f930](https://github.com/typescript-eslint/typescript-eslint/commit/dc1f9309cf04aa7314e758980ac687558482f47f)) +- **eslint-plugin:** [space-infix-ops] support for optional property without type ([#5155](https://github.com/typescript-eslint/typescript-eslint/issues/5155)) ([1f25daf](https://github.com/typescript-eslint/typescript-eslint/commit/1f25daf74e5d45077199f9ee9fa9bf31107f4089)) ### Features -* **eslint-plugin:** [parameter-properties] add rule to replace `no-parameter-properties` ([#4622](https://github.com/typescript-eslint/typescript-eslint/issues/4622)) ([88ed9ec](https://github.com/typescript-eslint/typescript-eslint/commit/88ed9ec9d6b971a9533565920fdcd6890ea941e9)) +- **eslint-plugin:** [consistent-generic-constructors] add rule ([#4924](https://github.com/typescript-eslint/typescript-eslint/issues/4924)) ([921cdf1](https://github.com/typescript-eslint/typescript-eslint/commit/921cdf17e548845311d0591249616ec844503926)) +## [5.27.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.27.0...v5.27.1) (2022-06-06) +### Bug Fixes +- **eslint-plugin:** [space-infix-ops] correct PropertyDefinition with typeAnnotation ([#5113](https://github.com/typescript-eslint/typescript-eslint/issues/5113)) ([d320174](https://github.com/typescript-eslint/typescript-eslint/commit/d320174f40a74b34e6b6e4c88128ef6e736311d8)) +- **eslint-plugin:** [space-infix-ops] regression fix for conditional types ([#5135](https://github.com/typescript-eslint/typescript-eslint/issues/5135)) ([e5238c8](https://github.com/typescript-eslint/typescript-eslint/commit/e5238c84e56e7c34174b2c6f1e3ea59456797c2f)) +- **eslint-plugin:** [space-infix-ops] regression fix for type aliases ([#5138](https://github.com/typescript-eslint/typescript-eslint/issues/5138)) ([4e13deb](https://github.com/typescript-eslint/typescript-eslint/commit/4e13deb05fbd8724996156b15b65f6a66794a7cc)) +# [5.27.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.26.0...v5.27.0) (2022-05-30) -# [5.20.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.19.0...v5.20.0) (2022-04-18) +### Bug Fixes +- **eslint-plugin:** [no-type-alias] handle Template Literal Types ([#5092](https://github.com/typescript-eslint/typescript-eslint/issues/5092)) ([8febf11](https://github.com/typescript-eslint/typescript-eslint/commit/8febf11a9296d1c0d7ccdf91ef9ab92ec8dfc39c)) ### Features -* **eslint-plugin:** [no-magic-numbers] ignoreTypeIndexes option ([#4789](https://github.com/typescript-eslint/typescript-eslint/issues/4789)) ([5e79451](https://github.com/typescript-eslint/typescript-eslint/commit/5e794512bf124c39de76d4e2cf8a3d6cfb08f1a8)) - - +- [4.7] support new extensions ([#5027](https://github.com/typescript-eslint/typescript-eslint/issues/5027)) ([efc147b](https://github.com/typescript-eslint/typescript-eslint/commit/efc147b04dce52ab17415b6a4ae4076b944b9036)) +- **eslint-plugin:** [ban-ts-comment] add descriptionFormat option ([#5026](https://github.com/typescript-eslint/typescript-eslint/issues/5026)) ([1fb31a4](https://github.com/typescript-eslint/typescript-eslint/commit/1fb31a4b3e05734f801ade0450fea33494e4d5e6)) +- **eslint-plugin:** [no-misused-promises] warn when spreading promises ([#5053](https://github.com/typescript-eslint/typescript-eslint/issues/5053)) ([61ffa9e](https://github.com/typescript-eslint/typescript-eslint/commit/61ffa9ed70e3cac6eca50a6c3cc5a0f1e7dec11c)) +- **eslint-plugin:** [space-infix-ops] missing error report for conditional types ([#5041](https://github.com/typescript-eslint/typescript-eslint/issues/5041)) ([0bfab6c](https://github.com/typescript-eslint/typescript-eslint/commit/0bfab6c9f5c5e243268200cf9368acf39ea099f8)) +# [5.26.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.25.0...v5.26.0) (2022-05-23) +### Bug Fixes -# [5.19.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.18.0...v5.19.0) (2022-04-11) +- **eslint-plugin:** [member-delimiter-style] autofixer result is not as expected when comments after the delimiter with option `delimiter: 'none'` ([#5029](https://github.com/typescript-eslint/typescript-eslint/issues/5029)) ([ed7b5f6](https://github.com/typescript-eslint/typescript-eslint/commit/ed7b5f61d93799fec3e38a87935ab9caa3abe279)) +- **eslint-plugin:** [member-delimiter-style] autofixer result is not as expected with option `delimiter: 'none'` ([#5023](https://github.com/typescript-eslint/typescript-eslint/issues/5023)) ([9e97a11](https://github.com/typescript-eslint/typescript-eslint/commit/9e97a11ecd80be5c63c980bfe8d8e57400221cec)) +- **eslint-plugin:** [prefer-readonly] correct issue with anonymus functions ([#4974](https://github.com/typescript-eslint/typescript-eslint/issues/4974)) ([952e2f0](https://github.com/typescript-eslint/typescript-eslint/commit/952e2f068862dde089ec03d3eb5452d1ee3e9271)), closes [#2590](https://github.com/typescript-eslint/typescript-eslint/issues/2590) +# [5.25.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.24.0...v5.25.0) (2022-05-17) ### Bug Fixes -* **eslint-plugin:** update code to use estree range instead of ts pos/end [#4723](https://github.com/typescript-eslint/typescript-eslint/issues/4723) ([#4790](https://github.com/typescript-eslint/typescript-eslint/issues/4790)) ([a1e9fc4](https://github.com/typescript-eslint/typescript-eslint/commit/a1e9fc4cb19e7655613ebe6f4dd911b5427b0367)) - +- **eslint-plugin:** [typedef] stop enforcing rule for assignment expressions ([#4958](https://github.com/typescript-eslint/typescript-eslint/issues/4958)) ([04a216c](https://github.com/typescript-eslint/typescript-eslint/commit/04a216c39c02085fe5d555ce81bdced0e563a7c4)) +- **eslint-plugin:** strict config should not extend recommended ([#5005](https://github.com/typescript-eslint/typescript-eslint/issues/5005)) ([05d71c2](https://github.com/typescript-eslint/typescript-eslint/commit/05d71c2ebd8e072aa4e8ee3ea8521de00e47d4ca)) +- **website:** correct Presets link to be Configs ([#5004](https://github.com/typescript-eslint/typescript-eslint/issues/5004)) ([e18e91c](https://github.com/typescript-eslint/typescript-eslint/commit/e18e91c6cfb1ee93bfff3770ea4d8f807d5ced0b)) ### Features -* **eslint-plugin:** [unified-signatures] add `ignoreDifferentlyNamedParameters` option ([#4659](https://github.com/typescript-eslint/typescript-eslint/issues/4659)) ([fdf95e0](https://github.com/typescript-eslint/typescript-eslint/commit/fdf95e02c45e137325c9ddd9d30e7f6b404f4514)) -* **eslint-plugin:** add support for valid number and bigint intersections in restrict-plus-operands rule ([#4795](https://github.com/typescript-eslint/typescript-eslint/issues/4795)) ([19c600a](https://github.com/typescript-eslint/typescript-eslint/commit/19c600a3dd485669cb87ae8f81b010e65eee1df8)) +- **eslint-plugin:** [no-empty-function] new allow option overrideMethods ([#4923](https://github.com/typescript-eslint/typescript-eslint/issues/4923)) ([13c05ae](https://github.com/typescript-eslint/typescript-eslint/commit/13c05aefb0e6531d320629e04b7207a3baebacb0)) +- **eslint-plugin:** deprecate `no-duplicate-imports` in favour of `import/no-duplicates` ([#4973](https://github.com/typescript-eslint/typescript-eslint/issues/4973)) ([1d2e41a](https://github.com/typescript-eslint/typescript-eslint/commit/1d2e41ada1979c081130d19b229c82bf1a69b7b4)) +- update to TypeScript 4.7-rc ([#4829](https://github.com/typescript-eslint/typescript-eslint/issues/4829)) ([6fe783c](https://github.com/typescript-eslint/typescript-eslint/commit/6fe783c20aebe26ef42b526e4a59a9be84dd5643)) +# [5.24.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.23.0...v5.24.0) (2022-05-16) +### Bug Fixes +- **eslint-plugin:** [array-type] in fixer add missing parens for constructor types [#4756](https://github.com/typescript-eslint/typescript-eslint/issues/4756) ([#4971](https://github.com/typescript-eslint/typescript-eslint/issues/4971)) ([0377070](https://github.com/typescript-eslint/typescript-eslint/commit/03770708900da663eb64c19465b3f937bab55b3d)) +### Features -# [5.18.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.17.0...v5.18.0) (2022-04-04) +- **eslint-plugin:** Add BigInt object type to default ban-types list ([#4970](https://github.com/typescript-eslint/typescript-eslint/issues/4970)) ([1867728](https://github.com/typescript-eslint/typescript-eslint/commit/1867728ba104a6a21941ed300828110964a43b96)) +- **eslint-plugin:** add new 'strict' config ([#4706](https://github.com/typescript-eslint/typescript-eslint/issues/4706)) ([4a500b2](https://github.com/typescript-eslint/typescript-eslint/commit/4a500b2d92a91873dbb729793d1ee1c36ef06ed8)) +# [5.23.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.22.0...v5.23.0) (2022-05-09) ### Bug Fixes -* **eslint-plugin:** method-signature-style respect getter signature ([#4777](https://github.com/typescript-eslint/typescript-eslint/issues/4777)) ([12dd670](https://github.com/typescript-eslint/typescript-eslint/commit/12dd670bc8621867c5105d8892dba9f9550a2f35)) +- **eslint-plugin:** [no-restricted-imports] allow type import as long as there's one matching pattern ([#4898](https://github.com/typescript-eslint/typescript-eslint/issues/4898)) ([0419d28](https://github.com/typescript-eslint/typescript-eslint/commit/0419d287b637e805c33036a45760badc2498e19b)) +- **eslint-plugin:** [no-unnecessary-type-constraint] change to suggestion fix, fix multiple trailing comma failures ([#4901](https://github.com/typescript-eslint/typescript-eslint/issues/4901)) ([4507ac8](https://github.com/typescript-eslint/typescript-eslint/commit/4507ac84c76da0ced43b6679305afe1891e7afca)) + +# [5.22.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.21.0...v5.22.0) (2022-05-02) + +### Bug Fixes +- **eslint-plugin:** [comma-spacing] verify `nextToken` exists ([#4868](https://github.com/typescript-eslint/typescript-eslint/issues/4868)) ([23746f8](https://github.com/typescript-eslint/typescript-eslint/commit/23746f8babace7c2354368d6fb0881be26e19c41)) ### Features -* **eslint-plugin:** [no-shadow] ignoreOnInitialization option ([#4603](https://github.com/typescript-eslint/typescript-eslint/issues/4603)) ([068ea9b](https://github.com/typescript-eslint/typescript-eslint/commit/068ea9b8eb3072fb46a6035f29c68ce96a69008d)) -* **eslint-plugin:** [no-this-alias] report on assignment expressions ([#4718](https://github.com/typescript-eslint/typescript-eslint/issues/4718)) ([8329498](https://github.com/typescript-eslint/typescript-eslint/commit/83294989dad543351a26e95be8d11a91d348679a)) +- **eslint-plugin:** [no-duplicate-enum-values] add rule ([#4833](https://github.com/typescript-eslint/typescript-eslint/issues/4833)) ([5899164](https://github.com/typescript-eslint/typescript-eslint/commit/5899164b35d91106512a2720b23ba92e1893132f)) +# [5.21.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.20.0...v5.21.0) (2022-04-25) +### Bug Fixes +- **eslint-plugin:** [no-misused-promises] prioritize false returns when checking whether a function returns only void ([#4841](https://github.com/typescript-eslint/typescript-eslint/issues/4841)) ([ccadb60](https://github.com/typescript-eslint/typescript-eslint/commit/ccadb6075d6977c4921ffc09fa40f515f4d497c5)) +- **eslint-plugin:** [no-namespace] fix false positive for exported namespaces when allowDeclarations=true ([#4844](https://github.com/typescript-eslint/typescript-eslint/issues/4844)) ([4e7c9be](https://github.com/typescript-eslint/typescript-eslint/commit/4e7c9be6ff7e2448f4151563d7921cd285c2e349)) +- **eslint-plugin:** [space-infix-ops] fix no error when right type is function ([#4848](https://github.com/typescript-eslint/typescript-eslint/issues/4848)) ([d74d559](https://github.com/typescript-eslint/typescript-eslint/commit/d74d559c25e336c3ebe917bf5c43e14ffa2de694)) +### Features -# [5.17.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.16.0...v5.17.0) (2022-03-28) +- **eslint-plugin:** [parameter-properties] add rule to replace `no-parameter-properties` ([#4622](https://github.com/typescript-eslint/typescript-eslint/issues/4622)) ([88ed9ec](https://github.com/typescript-eslint/typescript-eslint/commit/88ed9ec9d6b971a9533565920fdcd6890ea941e9)) +# [5.20.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.19.0...v5.20.0) (2022-04-18) ### Features -* **eslint-plugin:** [no-unused-vars] add destructuredArrayIgnorePattern options ([#4748](https://github.com/typescript-eslint/typescript-eslint/issues/4748)) ([6f8db8b](https://github.com/typescript-eslint/typescript-eslint/commit/6f8db8b64821d280fff408c1704a9adde682ed69)) +- **eslint-plugin:** [no-magic-numbers] ignoreTypeIndexes option ([#4789](https://github.com/typescript-eslint/typescript-eslint/issues/4789)) ([5e79451](https://github.com/typescript-eslint/typescript-eslint/commit/5e794512bf124c39de76d4e2cf8a3d6cfb08f1a8)) +# [5.19.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.18.0...v5.19.0) (2022-04-11) +### Bug Fixes +- **eslint-plugin:** update code to use estree range instead of ts pos/end [#4723](https://github.com/typescript-eslint/typescript-eslint/issues/4723) ([#4790](https://github.com/typescript-eslint/typescript-eslint/issues/4790)) ([a1e9fc4](https://github.com/typescript-eslint/typescript-eslint/commit/a1e9fc4cb19e7655613ebe6f4dd911b5427b0367)) +### Features -# [5.16.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.15.0...v5.16.0) (2022-03-21) +- **eslint-plugin:** [unified-signatures] add `ignoreDifferentlyNamedParameters` option ([#4659](https://github.com/typescript-eslint/typescript-eslint/issues/4659)) ([fdf95e0](https://github.com/typescript-eslint/typescript-eslint/commit/fdf95e02c45e137325c9ddd9d30e7f6b404f4514)) +- **eslint-plugin:** add support for valid number and bigint intersections in restrict-plus-operands rule ([#4795](https://github.com/typescript-eslint/typescript-eslint/issues/4795)) ([19c600a](https://github.com/typescript-eslint/typescript-eslint/commit/19c600a3dd485669cb87ae8f81b010e65eee1df8)) +# [5.18.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.17.0...v5.18.0) (2022-04-04) ### Bug Fixes -* **eslint-plugin:** [consistent-type-assertions] enforce assertionStyle for `const` assertions ([#4685](https://github.com/typescript-eslint/typescript-eslint/issues/4685)) ([8ec05be](https://github.com/typescript-eslint/typescript-eslint/commit/8ec05bed0fed0dcd48b087acd5ab5a6132bf3b09)) - +- **eslint-plugin:** method-signature-style respect getter signature ([#4777](https://github.com/typescript-eslint/typescript-eslint/issues/4777)) ([12dd670](https://github.com/typescript-eslint/typescript-eslint/commit/12dd670bc8621867c5105d8892dba9f9550a2f35)) ### Features -* **eslint-plugin:** [prefer-optional-chain] support logical with empty object ([#4430](https://github.com/typescript-eslint/typescript-eslint/issues/4430)) ([d21cfe0](https://github.com/typescript-eslint/typescript-eslint/commit/d21cfe0f4b7d3041948b1b6e0cd56c5ec34b2b3f)) +- **eslint-plugin:** [no-shadow] ignoreOnInitialization option ([#4603](https://github.com/typescript-eslint/typescript-eslint/issues/4603)) ([068ea9b](https://github.com/typescript-eslint/typescript-eslint/commit/068ea9b8eb3072fb46a6035f29c68ce96a69008d)) +- **eslint-plugin:** [no-this-alias] report on assignment expressions ([#4718](https://github.com/typescript-eslint/typescript-eslint/issues/4718)) ([8329498](https://github.com/typescript-eslint/typescript-eslint/commit/83294989dad543351a26e95be8d11a91d348679a)) +# [5.17.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.16.0...v5.17.0) (2022-03-28) +### Features +- **eslint-plugin:** [no-unused-vars] add destructuredArrayIgnorePattern options ([#4748](https://github.com/typescript-eslint/typescript-eslint/issues/4748)) ([6f8db8b](https://github.com/typescript-eslint/typescript-eslint/commit/6f8db8b64821d280fff408c1704a9adde682ed69)) +# [5.16.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.15.0...v5.16.0) (2022-03-21) -# [5.15.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.14.0...v5.15.0) (2022-03-14) +### Bug Fixes +- **eslint-plugin:** [consistent-type-assertions] enforce assertionStyle for `const` assertions ([#4685](https://github.com/typescript-eslint/typescript-eslint/issues/4685)) ([8ec05be](https://github.com/typescript-eslint/typescript-eslint/commit/8ec05bed0fed0dcd48b087acd5ab5a6132bf3b09)) ### Features -* **parser:** add `parserOptions.emitDecoratorMetadata` ([#4646](https://github.com/typescript-eslint/typescript-eslint/issues/4646)) ([e3dd343](https://github.com/typescript-eslint/typescript-eslint/commit/e3dd343e51e3b7772e825a609735a04c921c1ec5)) - +- **eslint-plugin:** [prefer-optional-chain] support logical with empty object ([#4430](https://github.com/typescript-eslint/typescript-eslint/issues/4430)) ([d21cfe0](https://github.com/typescript-eslint/typescript-eslint/commit/d21cfe0f4b7d3041948b1b6e0cd56c5ec34b2b3f)) +# [5.15.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.14.0...v5.15.0) (2022-03-14) +### Features +- **parser:** add `parserOptions.emitDecoratorMetadata` ([#4646](https://github.com/typescript-eslint/typescript-eslint/issues/4646)) ([e3dd343](https://github.com/typescript-eslint/typescript-eslint/commit/e3dd343e51e3b7772e825a609735a04c921c1ec5)) # [5.14.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.13.0...v5.14.0) (2022-03-07) - ### Bug Fixes -* **eslint-plugin:** [naming-convention] cover case that requires quotes ([#4582](https://github.com/typescript-eslint/typescript-eslint/issues/4582)) ([3ea0947](https://github.com/typescript-eslint/typescript-eslint/commit/3ea09477debec9f1593e4d3857e153570b488f4d)) -* **eslint-plugin:** [no-misused-promises] factor thenable returning function overload signatures ([#4620](https://github.com/typescript-eslint/typescript-eslint/issues/4620)) ([56a09e9](https://github.com/typescript-eslint/typescript-eslint/commit/56a09e98f171662d25ae2692be703a8bbbd3a3a5)) -* **eslint-plugin:** [prefer-readonly-parameter-types] handle class sharp private field and member without throwing error ([#4343](https://github.com/typescript-eslint/typescript-eslint/issues/4343)) ([a65713a](https://github.com/typescript-eslint/typescript-eslint/commit/a65713ae138e56555d01a9e8e5179221a2f39e75)) -* **eslint-plugin:** [return-await] correct autofixer in binary expression ([#4401](https://github.com/typescript-eslint/typescript-eslint/issues/4401)) ([5fa2fad](https://github.com/typescript-eslint/typescript-eslint/commit/5fa2fade385cc526a962212b94410c58e4c31078)) - +- **eslint-plugin:** [naming-convention] cover case that requires quotes ([#4582](https://github.com/typescript-eslint/typescript-eslint/issues/4582)) ([3ea0947](https://github.com/typescript-eslint/typescript-eslint/commit/3ea09477debec9f1593e4d3857e153570b488f4d)) +- **eslint-plugin:** [no-misused-promises] factor thenable returning function overload signatures ([#4620](https://github.com/typescript-eslint/typescript-eslint/issues/4620)) ([56a09e9](https://github.com/typescript-eslint/typescript-eslint/commit/56a09e98f171662d25ae2692be703a8bbbd3a3a5)) +- **eslint-plugin:** [prefer-readonly-parameter-types] handle class sharp private field and member without throwing error ([#4343](https://github.com/typescript-eslint/typescript-eslint/issues/4343)) ([a65713a](https://github.com/typescript-eslint/typescript-eslint/commit/a65713ae138e56555d01a9e8e5179221a2f39e75)) +- **eslint-plugin:** [return-await] correct autofixer in binary expression ([#4401](https://github.com/typescript-eslint/typescript-eslint/issues/4401)) ([5fa2fad](https://github.com/typescript-eslint/typescript-eslint/commit/5fa2fade385cc526a962212b94410c58e4c31078)) ### Features -* **eslint-plugin:** [no-misused-promises] add granular options within `checksVoidReturns` ([#4623](https://github.com/typescript-eslint/typescript-eslint/issues/4623)) ([1085177](https://github.com/typescript-eslint/typescript-eslint/commit/10851772696f982b585e0dade728f7980fdc6cc0)) - - - - +- **eslint-plugin:** [no-misused-promises] add granular options within `checksVoidReturns` ([#4623](https://github.com/typescript-eslint/typescript-eslint/issues/4623)) ([1085177](https://github.com/typescript-eslint/typescript-eslint/commit/10851772696f982b585e0dade728f7980fdc6cc0)) # [5.13.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.12.1...v5.13.0) (2022-02-28) - ### Bug Fixes -* **eslint-plugin:** [sort-type-union-intersection-members] Wrap the constructorType in parentheses ([#4590](https://github.com/typescript-eslint/typescript-eslint/issues/4590)) ([851bb90](https://github.com/typescript-eslint/typescript-eslint/commit/851bb90216e20b7679efc891dc445e6152d4837f)) - +- **eslint-plugin:** [sort-type-union-intersection-members] Wrap the constructorType in parentheses ([#4590](https://github.com/typescript-eslint/typescript-eslint/issues/4590)) ([851bb90](https://github.com/typescript-eslint/typescript-eslint/commit/851bb90216e20b7679efc891dc445e6152d4837f)) ### Features -* **eslint-plugin:** [no-misused-promises] check more places for checksVoidReturn ([#4541](https://github.com/typescript-eslint/typescript-eslint/issues/4541)) ([052cf51](https://github.com/typescript-eslint/typescript-eslint/commit/052cf51fe663283afe89dc7bf97c947e750df095)) -* **eslint-plugin:** add `no-redundant-type-constituents` rule ([#4378](https://github.com/typescript-eslint/typescript-eslint/issues/4378)) ([63d051e](https://github.com/typescript-eslint/typescript-eslint/commit/63d051eed29dcf71015a23992feac0a8f92717a0)) -* **eslint-plugin:** add `no-useless-empty-export` rule ([#4380](https://github.com/typescript-eslint/typescript-eslint/issues/4380)) ([823b945](https://github.com/typescript-eslint/typescript-eslint/commit/823b945c8f9e83d0246a2a5d07519f01e1a64518)) -* **eslint-plugin:** add extension rule `space-before-blocks` ([#1606](https://github.com/typescript-eslint/typescript-eslint/issues/1606)) ([#4184](https://github.com/typescript-eslint/typescript-eslint/issues/4184)) ([208b6d0](https://github.com/typescript-eslint/typescript-eslint/commit/208b6d02252dff2bf272329d3e4a4a82e56c52c0)) -* **eslint-plugin:** added member group support to member-ordering rule ([#4538](https://github.com/typescript-eslint/typescript-eslint/issues/4538)) ([6afcaea](https://github.com/typescript-eslint/typescript-eslint/commit/6afcaea0160a1ccd1c6483ca677c544ca1b8cb4f)) - - - - +- **eslint-plugin:** [no-misused-promises] check more places for checksVoidReturn ([#4541](https://github.com/typescript-eslint/typescript-eslint/issues/4541)) ([052cf51](https://github.com/typescript-eslint/typescript-eslint/commit/052cf51fe663283afe89dc7bf97c947e750df095)) +- **eslint-plugin:** add `no-redundant-type-constituents` rule ([#4378](https://github.com/typescript-eslint/typescript-eslint/issues/4378)) ([63d051e](https://github.com/typescript-eslint/typescript-eslint/commit/63d051eed29dcf71015a23992feac0a8f92717a0)) +- **eslint-plugin:** add `no-useless-empty-export` rule ([#4380](https://github.com/typescript-eslint/typescript-eslint/issues/4380)) ([823b945](https://github.com/typescript-eslint/typescript-eslint/commit/823b945c8f9e83d0246a2a5d07519f01e1a64518)) +- **eslint-plugin:** add extension rule `space-before-blocks` ([#1606](https://github.com/typescript-eslint/typescript-eslint/issues/1606)) ([#4184](https://github.com/typescript-eslint/typescript-eslint/issues/4184)) ([208b6d0](https://github.com/typescript-eslint/typescript-eslint/commit/208b6d02252dff2bf272329d3e4a4a82e56c52c0)) +- **eslint-plugin:** added member group support to member-ordering rule ([#4538](https://github.com/typescript-eslint/typescript-eslint/issues/4538)) ([6afcaea](https://github.com/typescript-eslint/typescript-eslint/commit/6afcaea0160a1ccd1c6483ca677c544ca1b8cb4f)) ## [5.12.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.12.0...v5.12.1) (2022-02-21) - ### Bug Fixes -* **eslint-plugin:** [no-unnecessary-type-arguments] fix comparison of types ([#4555](https://github.com/typescript-eslint/typescript-eslint/issues/4555)) ([fc3936e](https://github.com/typescript-eslint/typescript-eslint/commit/fc3936e99712374a707ce9e0101bc641807b9ea6)) +- **eslint-plugin:** [no-unnecessary-type-arguments] fix comparison of types ([#4555](https://github.com/typescript-eslint/typescript-eslint/issues/4555)) ([fc3936e](https://github.com/typescript-eslint/typescript-eslint/commit/fc3936e99712374a707ce9e0101bc641807b9ea6)) +# [5.12.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.11.0...v5.12.0) (2022-02-14) +### Bug Fixes +- **eslint-plugin:** [init-declarations] fix nested namespace ([#4544](https://github.com/typescript-eslint/typescript-eslint/issues/4544)) ([fe910e6](https://github.com/typescript-eslint/typescript-eslint/commit/fe910e61ca4bb42be3be9acb8ddcec73206754c2)) +- **eslint-plugin:** [no-unnecessary-type-arguments] Use Symbol to check if it's the same type ([#4543](https://github.com/typescript-eslint/typescript-eslint/issues/4543)) ([5b7d8df](https://github.com/typescript-eslint/typescript-eslint/commit/5b7d8df149be6554c863cdd5b73c0b0b0a7960db)) +- support nested object deconstructuring with type annotation ([#4548](https://github.com/typescript-eslint/typescript-eslint/issues/4548)) ([4da9278](https://github.com/typescript-eslint/typescript-eslint/commit/4da9278c80706f420d4c15a71c11c7b11d935643)) +### Features -# [5.12.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.11.0...v5.12.0) (2022-02-14) +- add checking property definition for allowNames option ([#4542](https://github.com/typescript-eslint/typescript-eslint/issues/4542)) ([e32bef6](https://github.com/typescript-eslint/typescript-eslint/commit/e32bef6f6b74228c95e54a5cba1cde53d5e40623)) +# [5.11.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.10.2...v5.11.0) (2022-02-07) ### Bug Fixes -* **eslint-plugin:** [init-declarations] fix nested namespace ([#4544](https://github.com/typescript-eslint/typescript-eslint/issues/4544)) ([fe910e6](https://github.com/typescript-eslint/typescript-eslint/commit/fe910e61ca4bb42be3be9acb8ddcec73206754c2)) -* **eslint-plugin:** [no-unnecessary-type-arguments] Use Symbol to check if it's the same type ([#4543](https://github.com/typescript-eslint/typescript-eslint/issues/4543)) ([5b7d8df](https://github.com/typescript-eslint/typescript-eslint/commit/5b7d8df149be6554c863cdd5b73c0b0b0a7960db)) -* support nested object deconstructuring with type annotation ([#4548](https://github.com/typescript-eslint/typescript-eslint/issues/4548)) ([4da9278](https://github.com/typescript-eslint/typescript-eslint/commit/4da9278c80706f420d4c15a71c11c7b11d935643)) - +- **eslint-plugin:** [no-magic-numbers] fix invalid schema merging ([#4517](https://github.com/typescript-eslint/typescript-eslint/issues/4517)) ([b95f796](https://github.com/typescript-eslint/typescript-eslint/commit/b95f79697acdd16347dc102bcb8311fe83746779)) +- **eslint-plugin:** [non-nullable-type-assertion-style] fix false positive when asserting to a generic type that might be nullish ([#4509](https://github.com/typescript-eslint/typescript-eslint/issues/4509)) ([4209362](https://github.com/typescript-eslint/typescript-eslint/commit/420936274603d8fee0631cdb3b58874cb3cc59d7)) ### Features -* add checking property definition for allowNames option ([#4542](https://github.com/typescript-eslint/typescript-eslint/issues/4542)) ([e32bef6](https://github.com/typescript-eslint/typescript-eslint/commit/e32bef6f6b74228c95e54a5cba1cde53d5e40623)) +- **eslint-plugin:** [explicit-function-return-type] add allowedNames ([#4440](https://github.com/typescript-eslint/typescript-eslint/issues/4440)) ([936e252](https://github.com/typescript-eslint/typescript-eslint/commit/936e252e30cfcebdaf971cf0f66a3031e236a41c)) +## [5.10.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.10.1...v5.10.2) (2022-01-31) +### Bug Fixes +- **eslint-plugin:** [no-restricted-imports] allow relative type imports with patterns configured ([#4494](https://github.com/typescript-eslint/typescript-eslint/issues/4494)) ([4a6d217](https://github.com/typescript-eslint/typescript-eslint/commit/4a6d217ae8a8f5fa1dd4bd3e3e66ba7519b4a287)) +## [5.10.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.10.0...v5.10.1) (2022-01-24) -# [5.11.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.10.2...v5.11.0) (2022-02-07) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin +# [5.10.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.9.1...v5.10.0) (2022-01-17) ### Bug Fixes -* **eslint-plugin:** [no-magic-numbers] fix invalid schema merging ([#4517](https://github.com/typescript-eslint/typescript-eslint/issues/4517)) ([b95f796](https://github.com/typescript-eslint/typescript-eslint/commit/b95f79697acdd16347dc102bcb8311fe83746779)) -* **eslint-plugin:** [non-nullable-type-assertion-style] fix false positive when asserting to a generic type that might be nullish ([#4509](https://github.com/typescript-eslint/typescript-eslint/issues/4509)) ([4209362](https://github.com/typescript-eslint/typescript-eslint/commit/420936274603d8fee0631cdb3b58874cb3cc59d7)) - +- **eslint-plugin:** [explicit-function-return-type] support AllowTypedFunctionExpression within AllowHigherOrderFunction ([#4250](https://github.com/typescript-eslint/typescript-eslint/issues/4250)) ([d053cde](https://github.com/typescript-eslint/typescript-eslint/commit/d053cde3e8b5bf9ba1c22fd64a7456d672ef77ca)) +- **eslint-plugin:** [no-extra-semi] false negatives when used with eslint 8.3.0 ([#4458](https://github.com/typescript-eslint/typescript-eslint/issues/4458)) ([f4016c2](https://github.com/typescript-eslint/typescript-eslint/commit/f4016c24f9023e8a42def9501b68c4a908cbfede)) +- **eslint-plugin:** [no-invalid-this] crash when used with eslint 8.7.0 ([#4448](https://github.com/typescript-eslint/typescript-eslint/issues/4448)) ([e56f1e5](https://github.com/typescript-eslint/typescript-eslint/commit/e56f1e5d52fcbf3caae43034872e0b3181871689)) +- **eslint-plugin:** [no-magic-numbers] handle bigint in class props ([#4411](https://github.com/typescript-eslint/typescript-eslint/issues/4411)) ([c8e650f](https://github.com/typescript-eslint/typescript-eslint/commit/c8e650f0c124d24b24beaeb376eaf61ee8d9e6fb)) ### Features -* **eslint-plugin:** [explicit-function-return-type] add allowedNames ([#4440](https://github.com/typescript-eslint/typescript-eslint/issues/4440)) ([936e252](https://github.com/typescript-eslint/typescript-eslint/commit/936e252e30cfcebdaf971cf0f66a3031e236a41c)) +- rename `experimental-utils` to `utils` and make `experimental-utils` an alias to the new package ([#4172](https://github.com/typescript-eslint/typescript-eslint/issues/4172)) ([1d55a75](https://github.com/typescript-eslint/typescript-eslint/commit/1d55a7511b38d8e2b2eabe59f639e0a865e6c93f)) +## [5.9.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.9.0...v5.9.1) (2022-01-10) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin +# [5.9.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.8.1...v5.9.0) (2022-01-03) +### Features -## [5.10.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.10.1...v5.10.2) (2022-01-31) +- **experimental-utils:** move isTypeReadonly from eslint-plugin to experimental-utils ([#3658](https://github.com/typescript-eslint/typescript-eslint/issues/3658)) ([a9eb0b9](https://github.com/typescript-eslint/typescript-eslint/commit/a9eb0b9eb2db291ea36065ec34f84bf5c5504b43)) +## [5.8.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.8.0...v5.8.1) (2021-12-27) ### Bug Fixes -* **eslint-plugin:** [no-restricted-imports] allow relative type imports with patterns configured ([#4494](https://github.com/typescript-eslint/typescript-eslint/issues/4494)) ([4a6d217](https://github.com/typescript-eslint/typescript-eslint/commit/4a6d217ae8a8f5fa1dd4bd3e3e66ba7519b4a287)) +- **eslint-plugin:** [consistent-indexed-object-style] do not report for circular references ([#4347](https://github.com/typescript-eslint/typescript-eslint/issues/4347)) ([6edebcd](https://github.com/typescript-eslint/typescript-eslint/commit/6edebcda00053eecf7b3e55eeb3fe5d7fb9e7db7)) +- **eslint-plugin:** [consistent-type-definitions] correct fixer with declare keyword ([#4334](https://github.com/typescript-eslint/typescript-eslint/issues/4334)) ([0cd911a](https://github.com/typescript-eslint/typescript-eslint/commit/0cd911a916805d3b1f8043584e4685f3edd5c427)) +- **eslint-plugin:** [padding-line-between-statements] make function overloading is also processed ([#4345](https://github.com/typescript-eslint/typescript-eslint/issues/4345)) ([d31ec26](https://github.com/typescript-eslint/typescript-eslint/commit/d31ec264fe5f5cd27e8f522a485e106889f2d380)) +# [5.8.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.7.0...v5.8.0) (2021-12-20) +### Bug Fixes +- **eslint-plugin:** [no-implied-eval] improve performance ([#4313](https://github.com/typescript-eslint/typescript-eslint/issues/4313)) ([e344596](https://github.com/typescript-eslint/typescript-eslint/commit/e3445967de6ed73e6b2334380236aed8a0ee6e4f)) +- **eslint-plugin:** [padding-line-between-statements] `type` StatementTypes can't differenciate from variable ([#4270](https://github.com/typescript-eslint/typescript-eslint/issues/4270)) ([bfc4324](https://github.com/typescript-eslint/typescript-eslint/commit/bfc4324f4cda24e30b2d39d5b70f7554f2b6bf81)) +- **eslint-plugin:** [strict-boolean-expression] false positive for truthy boolean ([#4275](https://github.com/typescript-eslint/typescript-eslint/issues/4275)) ([72c2e41](https://github.com/typescript-eslint/typescript-eslint/commit/72c2e418a4180f6db5795ebb42cbc095f5c53c37)) +- **eslint-plugin:** `array-type` mark `AST_NODE_TYPES.TSBigIntKeyword` as simple ([#4274](https://github.com/typescript-eslint/typescript-eslint/issues/4274)) ([74e544e](https://github.com/typescript-eslint/typescript-eslint/commit/74e544e487328e56fcb7aef048a78beaad593ea0)) +- **eslint-plugin:** handle method overloading in `semi` ([#4318](https://github.com/typescript-eslint/typescript-eslint/issues/4318)) ([3b87b49](https://github.com/typescript-eslint/typescript-eslint/commit/3b87b49ea8d62c2f4f3bee7494500b5ad44fcbc1)) +- **experimental-utils:** support immutable members ([#3844](https://github.com/typescript-eslint/typescript-eslint/issues/3844)) ([3d33a77](https://github.com/typescript-eslint/typescript-eslint/commit/3d33a77c57e5b752edf6f35ed152038bdb230b79)) +### Features -## [5.10.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.10.0...v5.10.1) (2022-01-24) +- **eslint-plugin:** [no-throw-literal] add options to to disallow `any`/`unknown` ([#4207](https://github.com/typescript-eslint/typescript-eslint/issues/4207)) ([ff0adf9](https://github.com/typescript-eslint/typescript-eslint/commit/ff0adf9e0bfbf71667c51de0a84038586e4cbfd1)) +- **eslint-plugin:** [restrict-plus-operand] add allowAny option ([#4260](https://github.com/typescript-eslint/typescript-eslint/issues/4260)) ([2788545](https://github.com/typescript-eslint/typescript-eslint/commit/27885456c577dfada52d298857f406f0f332c405)) -**Note:** Version bump only for package @typescript-eslint/eslint-plugin +# [5.7.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.6.0...v5.7.0) (2021-12-13) +### Features +- **eslint-plugin:** [consistent-type-exports] support TS4.5 inline export specifiers ([#4236](https://github.com/typescript-eslint/typescript-eslint/issues/4236)) ([be4d976](https://github.com/typescript-eslint/typescript-eslint/commit/be4d976215614cc032730ae596d2f6e47df67730)) +- **eslint-plugin:** [consistent-type-imports] support TS4.5 inline import specifiers ([#4237](https://github.com/typescript-eslint/typescript-eslint/issues/4237)) ([f61af7c](https://github.com/typescript-eslint/typescript-eslint/commit/f61af7c53cca52f81e77b4334c7d6ad100609af6)) +- **eslint-plugin:** [no-shadow] support TS4.5 inline import specifiers ([#4239](https://github.com/typescript-eslint/typescript-eslint/issues/4239)) ([96b7e8e](https://github.com/typescript-eslint/typescript-eslint/commit/96b7e8ee0f5280cab50a7205ae592e1d983a111a)) +# [5.6.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.5.0...v5.6.0) (2021-12-06) +### Features -# [5.10.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.9.1...v5.10.0) (2022-01-17) +- **scope-manager:** support TS4.5 import/export specifier kind ([#4234](https://github.com/typescript-eslint/typescript-eslint/issues/4234)) ([833f822](https://github.com/typescript-eslint/typescript-eslint/commit/833f8221ce00aecb7d08c519bab9568353850f48)) +# [5.5.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.4.0...v5.5.0) (2021-11-29) ### Bug Fixes -* **eslint-plugin:** [explicit-function-return-type] support AllowTypedFunctionExpression within AllowHigherOrderFunction ([#4250](https://github.com/typescript-eslint/typescript-eslint/issues/4250)) ([d053cde](https://github.com/typescript-eslint/typescript-eslint/commit/d053cde3e8b5bf9ba1c22fd64a7456d672ef77ca)) -* **eslint-plugin:** [no-extra-semi] false negatives when used with eslint 8.3.0 ([#4458](https://github.com/typescript-eslint/typescript-eslint/issues/4458)) ([f4016c2](https://github.com/typescript-eslint/typescript-eslint/commit/f4016c24f9023e8a42def9501b68c4a908cbfede)) -* **eslint-plugin:** [no-invalid-this] crash when used with eslint 8.7.0 ([#4448](https://github.com/typescript-eslint/typescript-eslint/issues/4448)) ([e56f1e5](https://github.com/typescript-eslint/typescript-eslint/commit/e56f1e5d52fcbf3caae43034872e0b3181871689)) -* **eslint-plugin:** [no-magic-numbers] handle bigint in class props ([#4411](https://github.com/typescript-eslint/typescript-eslint/issues/4411)) ([c8e650f](https://github.com/typescript-eslint/typescript-eslint/commit/c8e650f0c124d24b24beaeb376eaf61ee8d9e6fb)) - +- **eslint-plugin:** [member-ordering] order literal names correctly in ([#4054](https://github.com/typescript-eslint/typescript-eslint/issues/4054)) ([d57141a](https://github.com/typescript-eslint/typescript-eslint/commit/d57141a3d13fad30a93ed99a6a15f4b0b369246a)) +- **eslint-plugin:** [no-duplicate-imports] remove unnecessary type checking for `node.source` ([#4196](https://github.com/typescript-eslint/typescript-eslint/issues/4196)) ([637722a](https://github.com/typescript-eslint/typescript-eslint/commit/637722a77667f6ed1e0cf1f0e752d61622ae8546)) +- **eslint-plugin:** [no-var-requires] do not report require created from createRequire ([#4221](https://github.com/typescript-eslint/typescript-eslint/issues/4221)) ([0040186](https://github.com/typescript-eslint/typescript-eslint/commit/0040186aa23692724986df22a71926e8a7ff9e02)) +- **eslint-plugin:** [prefer-for-of] do nor error when iterating over this ([#4176](https://github.com/typescript-eslint/typescript-eslint/issues/4176)) ([258ddb0](https://github.com/typescript-eslint/typescript-eslint/commit/258ddb0708b7a44959bd3ac399cbde912c8021c8)) +- **eslint-plugin:** [require-await] treat yield\* asynciterable as an await ([#4125](https://github.com/typescript-eslint/typescript-eslint/issues/4125)) ([5a4ce6a](https://github.com/typescript-eslint/typescript-eslint/commit/5a4ce6a241b1d6c6caad87cad85c3741f0953e39)) +- **eslint-plugin:** remove all whitespaces in comparison [#4220](https://github.com/typescript-eslint/typescript-eslint/issues/4220) ([#4223](https://github.com/typescript-eslint/typescript-eslint/issues/4223)) ([853d799](https://github.com/typescript-eslint/typescript-eslint/commit/853d799428a061d9bf6a2e74b01dc49a1e4f3134)) ### Features -* rename `experimental-utils` to `utils` and make `experimental-utils` an alias to the new package ([#4172](https://github.com/typescript-eslint/typescript-eslint/issues/4172)) ([1d55a75](https://github.com/typescript-eslint/typescript-eslint/commit/1d55a7511b38d8e2b2eabe59f639e0a865e6c93f)) +- **eslint-plugin:** [member-ordering] add option to sort case insensitive ([#3896](https://github.com/typescript-eslint/typescript-eslint/issues/3896)) ([e3533d5](https://github.com/typescript-eslint/typescript-eslint/commit/e3533d5a6293a358b5eb0a6ed17da961a09b0ed3)) +- **eslint-plugin:** `array-type` distinguish whether readonly or not ([#4066](https://github.com/typescript-eslint/typescript-eslint/issues/4066)) ([314af44](https://github.com/typescript-eslint/typescript-eslint/commit/314af44bde3ccbebc620625b2931d77688525976)) + +# [5.4.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.3.1...v5.4.0) (2021-11-15) +### Bug Fixes +- correct issues with circular imports ([#4140](https://github.com/typescript-eslint/typescript-eslint/issues/4140)) ([4c87b24](https://github.com/typescript-eslint/typescript-eslint/commit/4c87b2486a9c90794d972a4d093c1dc22ffb418b)) +- **eslint-plugin:** [explicit-member-accessibility] private fields cannot have accessibility modifiers ([#4117](https://github.com/typescript-eslint/typescript-eslint/issues/4117)) ([81b25c1](https://github.com/typescript-eslint/typescript-eslint/commit/81b25c12eceae89e181a7bdb3c8298d820cfe3e3)) +- **eslint-plugin:** [no-implied-eval] ignore locally declared functions ([#4049](https://github.com/typescript-eslint/typescript-eslint/issues/4049)) ([d97140e](https://github.com/typescript-eslint/typescript-eslint/commit/d97140ecf4aeb0a1f8b391f46a31881f21ad93c3)) +- **eslint-plugin:** check optional chaining for floating promises ([#4096](https://github.com/typescript-eslint/typescript-eslint/issues/4096)) ([d724777](https://github.com/typescript-eslint/typescript-eslint/commit/d7247770886c619263482c3e083bed9f97b22688)) +### Features +- add RuleCreator.withoutDocs ([#4136](https://github.com/typescript-eslint/typescript-eslint/issues/4136)) ([87cfc6a](https://github.com/typescript-eslint/typescript-eslint/commit/87cfc6ad3e3312d7b6f98a592fb37e69d5d6880a)) +- **typescript-estree:** support private fields in-in syntax ([#4075](https://github.com/typescript-eslint/typescript-eslint/issues/4075)) ([939d8ea](https://github.com/typescript-eslint/typescript-eslint/commit/939d8eac547fb1734aa00f1ea01cc6eae0b4280a)) -## [5.9.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.9.0...v5.9.1) (2022-01-10) +## [5.3.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.3.0...v5.3.1) (2021-11-08) **Note:** Version bump only for package @typescript-eslint/eslint-plugin +# [5.3.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.2.0...v5.3.0) (2021-11-01) +### Bug Fixes +- **eslint-plugin:** ignore private identifiers in explicit-module-boundary-types ([#4046](https://github.com/typescript-eslint/typescript-eslint/issues/4046)) ([80b853d](https://github.com/typescript-eslint/typescript-eslint/commit/80b853db90ae3d4e32c4b7ec9d45a5c41dc459c9)) +- **eslint-plugin:** skip seenTypes for unions in isTypeReadonly ([#4043](https://github.com/typescript-eslint/typescript-eslint/issues/4043)) ([6af7ca7](https://github.com/typescript-eslint/typescript-eslint/commit/6af7ca7d9fde230342d27ad5a75a09a58c022974)) +### Features -# [5.9.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.8.1...v5.9.0) (2022-01-03) +- **eslint-plugin:** [no-shadow] exclude external type declaration merging ([#3959](https://github.com/typescript-eslint/typescript-eslint/issues/3959)) ([a93cebf](https://github.com/typescript-eslint/typescript-eslint/commit/a93cebfc0f2026c50972bcb110bcd3295ba9a44d)) +# [5.2.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.1.0...v5.2.0) (2021-10-25) -### Features +### Bug Fixes -* **experimental-utils:** move isTypeReadonly from eslint-plugin to experimental-utils ([#3658](https://github.com/typescript-eslint/typescript-eslint/issues/3658)) ([a9eb0b9](https://github.com/typescript-eslint/typescript-eslint/commit/a9eb0b9eb2db291ea36065ec34f84bf5c5504b43)) +- **eslint-plugin:** [typedef] fix regression with class properties ([#4034](https://github.com/typescript-eslint/typescript-eslint/issues/4034)) ([fe53d22](https://github.com/typescript-eslint/typescript-eslint/commit/fe53d22f57ad418397fb31fa89c97db0ab4cd6c0)), closes [#4033](https://github.com/typescript-eslint/typescript-eslint/issues/4033) +### Features +- **eslint-plugin:** adding `consistent-type-exports` rule ([#3936](https://github.com/typescript-eslint/typescript-eslint/issues/3936)) ([1971a3f](https://github.com/typescript-eslint/typescript-eslint/commit/1971a3f8027416cd1fb33b1d50faa035599917de)) +# [5.1.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.0.0...v5.1.0) (2021-10-18) +### Bug Fixes -## [5.8.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.8.0...v5.8.1) (2021-12-27) +- **eslint-plugin:** [no-restricted-imports]: report type-only imports properly ([#3996](https://github.com/typescript-eslint/typescript-eslint/issues/3996)) ([283cdf2](https://github.com/typescript-eslint/typescript-eslint/commit/283cdf26e6b32985531ff6416cd13ef4cb0a3c8c)) +- **eslint-plugin:** [strict-bool-expr] treat unconstrained generic as any ([#3981](https://github.com/typescript-eslint/typescript-eslint/issues/3981)) ([9b29ca7](https://github.com/typescript-eslint/typescript-eslint/commit/9b29ca751f496c25240c0c14b8fa432bf4443d39)) +# [5.0.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.33.0...v5.0.0) (2021-10-11) ### Bug Fixes -* **eslint-plugin:** [consistent-indexed-object-style] do not report for circular references ([#4347](https://github.com/typescript-eslint/typescript-eslint/issues/4347)) ([6edebcd](https://github.com/typescript-eslint/typescript-eslint/commit/6edebcda00053eecf7b3e55eeb3fe5d7fb9e7db7)) -* **eslint-plugin:** [consistent-type-definitions] correct fixer with declare keyword ([#4334](https://github.com/typescript-eslint/typescript-eslint/issues/4334)) ([0cd911a](https://github.com/typescript-eslint/typescript-eslint/commit/0cd911a916805d3b1f8043584e4685f3edd5c427)) -* **eslint-plugin:** [padding-line-between-statements] make function overloading is also processed ([#4345](https://github.com/typescript-eslint/typescript-eslint/issues/4345)) ([d31ec26](https://github.com/typescript-eslint/typescript-eslint/commit/d31ec264fe5f5cd27e8f522a485e106889f2d380)) - +- **eslint-plugin:** [explicit-member-accessibility] report `TSAbstractPropertyDefinition` and `TSAbstractMethodDefinition` properly ([#3901](https://github.com/typescript-eslint/typescript-eslint/issues/3901)) ([82016f9](https://github.com/typescript-eslint/typescript-eslint/commit/82016f99b14825c9c60e1f7eb3b4efcc492bba86)) +- **eslint-plugin:** update new rules from master ([#3840](https://github.com/typescript-eslint/typescript-eslint/issues/3840)) ([d88a6b4](https://github.com/typescript-eslint/typescript-eslint/commit/d88a6b44eedcf9dd59569160570aa118851aa86b)) +- update new rules from master ([b34fb7e](https://github.com/typescript-eslint/typescript-eslint/commit/b34fb7eb3102ea603bb4aef0dbbf9885b3d47557)) +- **eslint-plugin:** crash in no-dupe-class-members (v5) ([#3813](https://github.com/typescript-eslint/typescript-eslint/issues/3813)) ([4b09644](https://github.com/typescript-eslint/typescript-eslint/commit/4b096442f731c0a60926ac0391a4f2c4208aa8d4)) +### Features +- **ast-spec:** bring `Node` objects in line with ESTree ([#3771](https://github.com/typescript-eslint/typescript-eslint/issues/3771)) ([dd14064](https://github.com/typescript-eslint/typescript-eslint/commit/dd140643b457aa515cc21fcda2b3cd4acc2a1c5c)) +- **eslint-plugin:** remove `object` from `ban-types`' default types ([#3818](https://github.com/typescript-eslint/typescript-eslint/issues/3818)) ([ae3fa90](https://github.com/typescript-eslint/typescript-eslint/commit/ae3fa900d5b4e1f557a52ca58d35a7d098d9efaf)) +- **eslint-plugin:** removed value from abstract property nodes ([#3765](https://github.com/typescript-eslint/typescript-eslint/issues/3765)) ([5823524](https://github.com/typescript-eslint/typescript-eslint/commit/58235241714596b641a1e8b39c569e561e0039b4)), closes [#3748](https://github.com/typescript-eslint/typescript-eslint/issues/3748) +- **eslint-plugin:** update recommended configs ([#3809](https://github.com/typescript-eslint/typescript-eslint/issues/3809)) ([deeb7bb](https://github.com/typescript-eslint/typescript-eslint/commit/deeb7bb9334d301c6af56aefd37d318231af11ef)) +- align class property representation with ESTree ([#3806](https://github.com/typescript-eslint/typescript-eslint/issues/3806)) ([22fa5c0](https://github.com/typescript-eslint/typescript-eslint/commit/22fa5c0c4705ed2898f00b7cacc5dd642d859275)), closes [#3430](https://github.com/typescript-eslint/typescript-eslint/issues/3430) [#3077](https://github.com/typescript-eslint/typescript-eslint/issues/3077) +- remove `meta.docs.category` from rules ([#3800](https://github.com/typescript-eslint/typescript-eslint/issues/3800)) ([71c9370](https://github.com/typescript-eslint/typescript-eslint/commit/71c93706e55f5f92a1285102b93c6ab1950c6df4)) +- remove `TSParenthesizedType` ([#3340](https://github.com/typescript-eslint/typescript-eslint/issues/3340)) ([c8ee432](https://github.com/typescript-eslint/typescript-eslint/commit/c8ee43269faea4c04ec02eaa2b81a0aa6eec5d3e)), closes [#3136](https://github.com/typescript-eslint/typescript-eslint/issues/3136) +- support `PrivateIdentifier` ([#3808](https://github.com/typescript-eslint/typescript-eslint/issues/3808)) ([0eefe5e](https://github.com/typescript-eslint/typescript-eslint/commit/0eefe5e49d21af3f1e3e2d9a90c2e49929863ac2)), closes [#3430](https://github.com/typescript-eslint/typescript-eslint/issues/3430) [#2933](https://github.com/typescript-eslint/typescript-eslint/issues/2933) +- **eslint-plugin:** [comma-dangle] align schema with ESLint v8 ([#3768](https://github.com/typescript-eslint/typescript-eslint/issues/3768)) ([0acfafc](https://github.com/typescript-eslint/typescript-eslint/commit/0acfafcc655e28dcfc05a5caa567c0d0217ee7ad)) +- **eslint-plugin:** [member-ordering] add support for getters and setters ([#3611](https://github.com/typescript-eslint/typescript-eslint/issues/3611)) ([e264124](https://github.com/typescript-eslint/typescript-eslint/commit/e2641246571b69df36cde5cb7bce7c4fffc43f98)) +- **eslint-plugin:** remove `no-unused-vars-experimental` ([79ae03b](https://github.com/typescript-eslint/typescript-eslint/commit/79ae03b8adbae2b0a86276711a9c834af01bbb61)) +- support ESLint v8 ([#3737](https://github.com/typescript-eslint/typescript-eslint/issues/3737)) ([4ca62ae](https://github.com/typescript-eslint/typescript-eslint/commit/4ca62aee6681d706e762a8db727541ca204364f2)) +### BREAKING CHANGES -# [5.8.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.7.0...v5.8.0) (2021-12-20) +- **eslint-plugin:** `ban-types` no longer reports `object` by default +# [4.33.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.32.0...v4.33.0) (2021-10-04) ### Bug Fixes -* **eslint-plugin:** [no-implied-eval] improve performance ([#4313](https://github.com/typescript-eslint/typescript-eslint/issues/4313)) ([e344596](https://github.com/typescript-eslint/typescript-eslint/commit/e3445967de6ed73e6b2334380236aed8a0ee6e4f)) -* **eslint-plugin:** [padding-line-between-statements] `type` StatementTypes can't differenciate from variable ([#4270](https://github.com/typescript-eslint/typescript-eslint/issues/4270)) ([bfc4324](https://github.com/typescript-eslint/typescript-eslint/commit/bfc4324f4cda24e30b2d39d5b70f7554f2b6bf81)) -* **eslint-plugin:** [strict-boolean-expression] false positive for truthy boolean ([#4275](https://github.com/typescript-eslint/typescript-eslint/issues/4275)) ([72c2e41](https://github.com/typescript-eslint/typescript-eslint/commit/72c2e418a4180f6db5795ebb42cbc095f5c53c37)) -* **eslint-plugin:** `array-type` mark `AST_NODE_TYPES.TSBigIntKeyword` as simple ([#4274](https://github.com/typescript-eslint/typescript-eslint/issues/4274)) ([74e544e](https://github.com/typescript-eslint/typescript-eslint/commit/74e544e487328e56fcb7aef048a78beaad593ea0)) -* **eslint-plugin:** handle method overloading in `semi` ([#4318](https://github.com/typescript-eslint/typescript-eslint/issues/4318)) ([3b87b49](https://github.com/typescript-eslint/typescript-eslint/commit/3b87b49ea8d62c2f4f3bee7494500b5ad44fcbc1)) -* **experimental-utils:** support immutable members ([#3844](https://github.com/typescript-eslint/typescript-eslint/issues/3844)) ([3d33a77](https://github.com/typescript-eslint/typescript-eslint/commit/3d33a77c57e5b752edf6f35ed152038bdb230b79)) +- **eslint-plugin:** [lines-between-class-members] fix `exceptAfterOverload` for abstract methods ([#3943](https://github.com/typescript-eslint/typescript-eslint/issues/3943)) ([240fc65](https://github.com/typescript-eslint/typescript-eslint/commit/240fc65c307769eae9b35e611fca74ba4c35a025)) +- **eslint-plugin:** [no-confusing-void-expression] support optional chaining ([#3937](https://github.com/typescript-eslint/typescript-eslint/issues/3937)) ([c40dd13](https://github.com/typescript-eslint/typescript-eslint/commit/c40dd13df76b77052c85254622df5533307dc07e)) +- **eslint-plugin:** [no-restricted-imports] fix crash when no options given ([#3947](https://github.com/typescript-eslint/typescript-eslint/issues/3947)) ([edaa3c1](https://github.com/typescript-eslint/typescript-eslint/commit/edaa3c10eb67bb89f9c6a78bd1ed593925c33f16)) +- **eslint-plugin:** [non-nullable-type-assertion-style] false-positive with non-nullish `as` assertions and types ([#3940](https://github.com/typescript-eslint/typescript-eslint/issues/3940)) ([40760f9](https://github.com/typescript-eslint/typescript-eslint/commit/40760f98da0d23c7bce3da04cf37a56c10447bde)) +- **eslint-plugin:** [padding-line-between-statements] TSModuleBlock should change scope ([#3944](https://github.com/typescript-eslint/typescript-eslint/issues/3944)) ([f8f534e](https://github.com/typescript-eslint/typescript-eslint/commit/f8f534e42b0ec517274442422c37ab019cf3c200)) +- **eslint-plugin:** [prefer-regexp-exec] check `RegExp` without flags ([#3946](https://github.com/typescript-eslint/typescript-eslint/issues/3946)) ([0868725](https://github.com/typescript-eslint/typescript-eslint/commit/0868725713e8102e8932303d4c680340688e1fa9)) +# [4.32.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.31.2...v4.32.0) (2021-09-27) -### Features +### Bug Fixes -* **eslint-plugin:** [no-throw-literal] add options to to disallow `any`/`unknown` ([#4207](https://github.com/typescript-eslint/typescript-eslint/issues/4207)) ([ff0adf9](https://github.com/typescript-eslint/typescript-eslint/commit/ff0adf9e0bfbf71667c51de0a84038586e4cbfd1)) -* **eslint-plugin:** [restrict-plus-operand] add allowAny option ([#4260](https://github.com/typescript-eslint/typescript-eslint/issues/4260)) ([2788545](https://github.com/typescript-eslint/typescript-eslint/commit/27885456c577dfada52d298857f406f0f332c405)) +- **eslint-plugin:** [consistent-type-definitions] correct fix for `export default` ([#3899](https://github.com/typescript-eslint/typescript-eslint/issues/3899)) ([ebb33ed](https://github.com/typescript-eslint/typescript-eslint/commit/ebb33ed8bc29f69ca2a657ec5b31857c0aeb4b56)) +- **eslint-plugin:** [no-require-imports] report only global `require` ([#3871](https://github.com/typescript-eslint/typescript-eslint/issues/3871)) ([8aa87a1](https://github.com/typescript-eslint/typescript-eslint/commit/8aa87a136e7cd7b40fbf09fcfa26bf04d1c6d5fe)) +- **eslint-plugin:** [no-shadow] ignore type-only imports properly ([#3868](https://github.com/typescript-eslint/typescript-eslint/issues/3868)) ([dda9cee](https://github.com/typescript-eslint/typescript-eslint/commit/dda9cee68a5cd78b358a854027999c739ac623e9)) +- **eslint-plugin:** [no-var-requires] report problems within `NewExpression` ([#3884](https://github.com/typescript-eslint/typescript-eslint/issues/3884)) ([ed5e459](https://github.com/typescript-eslint/typescript-eslint/commit/ed5e45983fa052accf3a7b5fcdbfcb15ed09490f)) +- **eslint-plugin:** [padding-line-between-statements] problems within namespaces not being reported ([#3869](https://github.com/typescript-eslint/typescript-eslint/issues/3869)) ([1861356](https://github.com/typescript-eslint/typescript-eslint/commit/186135698b40b510ffff6a2402aa34f2726596ea)) +- **eslint-plugin:** [prefer-regexp-exec] respect flags when using `RegExp` ([#3855](https://github.com/typescript-eslint/typescript-eslint/issues/3855)) ([ffdb5ff](https://github.com/typescript-eslint/typescript-eslint/commit/ffdb5ff9900e07374a2f3686447e3e2c78fbc38a)) +- **eslint-plugin:** [prefer-return-this-type] handle generics properly in fixer ([#3852](https://github.com/typescript-eslint/typescript-eslint/issues/3852)) ([9e98b8f](https://github.com/typescript-eslint/typescript-eslint/commit/9e98b8f43ca6aadc9758a4e9a0d1d3c250af6cca)) +- **eslint-plugin:** false-positive/negative with array index in no-unnecessary-condition ([#3805](https://github.com/typescript-eslint/typescript-eslint/issues/3805)) ([bdb8f0b](https://github.com/typescript-eslint/typescript-eslint/commit/bdb8f0be1466e4a4b713e91199be91030650ed01)) +### Features +- **eslint-plugin:** [no-type-alias]: add allowGenerics option ([#3865](https://github.com/typescript-eslint/typescript-eslint/issues/3865)) ([4195919](https://github.com/typescript-eslint/typescript-eslint/commit/41959199735a6d4fe3ae7825f3087e8fb249be9f)) +- **eslint-plugin:** add `no-non-null-asserted-nullish-coalescing` rule ([#3349](https://github.com/typescript-eslint/typescript-eslint/issues/3349)) ([4e99961](https://github.com/typescript-eslint/typescript-eslint/commit/4e999614e9761f6dc7e5aa0c5bad76ab164ab3fb)) +- **eslint-plugin:** add new extended rule `no-restricted-imports` ([#3775](https://github.com/typescript-eslint/typescript-eslint/issues/3775)) ([ec5d506](https://github.com/typescript-eslint/typescript-eslint/commit/ec5d50696b249a207d322e4a2fc66582122eb010)) +- **eslint-plugin-internal:** [prefer-ast-types-enum] add `DefinitionType` enum ([#3916](https://github.com/typescript-eslint/typescript-eslint/issues/3916)) ([13b7de5](https://github.com/typescript-eslint/typescript-eslint/commit/13b7de508e0f8eac492879ff9ab99acd8d3e977e)) +## [4.31.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.31.1...v4.31.2) (2021-09-20) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin -# [5.7.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.6.0...v5.7.0) (2021-12-13) +## [4.31.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.31.0...v4.31.1) (2021-09-13) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin -### Features +# [4.31.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.30.0...v4.31.0) (2021-09-06) -* **eslint-plugin:** [consistent-type-exports] support TS4.5 inline export specifiers ([#4236](https://github.com/typescript-eslint/typescript-eslint/issues/4236)) ([be4d976](https://github.com/typescript-eslint/typescript-eslint/commit/be4d976215614cc032730ae596d2f6e47df67730)) -* **eslint-plugin:** [consistent-type-imports] support TS4.5 inline import specifiers ([#4237](https://github.com/typescript-eslint/typescript-eslint/issues/4237)) ([f61af7c](https://github.com/typescript-eslint/typescript-eslint/commit/f61af7c53cca52f81e77b4334c7d6ad100609af6)) -* **eslint-plugin:** [no-shadow] support TS4.5 inline import specifiers ([#4239](https://github.com/typescript-eslint/typescript-eslint/issues/4239)) ([96b7e8e](https://github.com/typescript-eslint/typescript-eslint/commit/96b7e8ee0f5280cab50a7205ae592e1d983a111a)) +### Bug Fixes +- **utils:** support immutable arrays in `ReportFixFunction` ([#3830](https://github.com/typescript-eslint/typescript-eslint/issues/3830)) ([8218055](https://github.com/typescript-eslint/typescript-eslint/commit/8218055d6dfd94c9e6c8645848f981d9d51ce08c)) +### Features +- **eslint-plugin:** [prefer-readonly-parameter-types] add option treatMethodsAsReadonly ([#3733](https://github.com/typescript-eslint/typescript-eslint/issues/3733)) ([a46e318](https://github.com/typescript-eslint/typescript-eslint/commit/a46e3182c8a0b07c914605d6d9fe28ef36a7c32a)) +- **eslint-plugin:** [restrict-template-expressions] add option to allow RegExp ([#3709](https://github.com/typescript-eslint/typescript-eslint/issues/3709)) ([363b3dc](https://github.com/typescript-eslint/typescript-eslint/commit/363b3dc4dd0dc343311c729d75935b10f9d2fd5e)) +- **eslint-plugin:** add `no-meaningless-void-operator` rule ([#3641](https://github.com/typescript-eslint/typescript-eslint/issues/3641)) ([ea40ab6](https://github.com/typescript-eslint/typescript-eslint/commit/ea40ab659351ae7cf7235ea063d42ac155b11e5f)) +- **eslint-plugin:** add extension rule `padding-line-between-statements` ([#3418](https://github.com/typescript-eslint/typescript-eslint/issues/3418)) ([f79ae9b](https://github.com/typescript-eslint/typescript-eslint/commit/f79ae9b58e82f4fddef640a34a1d7ff92b763e65)) +# [4.30.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.29.3...v4.30.0) (2021-08-30) -# [5.6.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.5.0...v5.6.0) (2021-12-06) +### Bug Fixes +- **eslint-plugin:** [dot-notation] false positive with optional chaining ([#3711](https://github.com/typescript-eslint/typescript-eslint/issues/3711)) ([c19fc6e](https://github.com/typescript-eslint/typescript-eslint/commit/c19fc6e03072ed549bc9b35ebe6961e10f8f9b43)), closes [#3510](https://github.com/typescript-eslint/typescript-eslint/issues/3510) +- **eslint-plugin:** [prefer-reduce-type-parameter] handle already existing type params ([#3706](https://github.com/typescript-eslint/typescript-eslint/issues/3706)) ([71dd273](https://github.com/typescript-eslint/typescript-eslint/commit/71dd27361a1bc93b5d5eb2279d805922b10002fd)) +- **eslint-plugin:** isTypeReadonly error with unknown ([#2371](https://github.com/typescript-eslint/typescript-eslint/issues/2371)) ([e7528e6](https://github.com/typescript-eslint/typescript-eslint/commit/e7528e686f5fe5cce8504fc15d3cd06b8733712e)) -* **typescript-estree:** support TSv4 labelled tuple members ([#2378](https://github.com/typescript-eslint/typescript-eslint/issues/2378)) ([00d84ff](https://github.com/typescript-eslint/typescript-eslint/commit/00d84ffbcbe9d0ec98bdb2f2ce59959a27ce4dbe)) - - - - - -# [3.8.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.7.1...v3.8.0) (2020-08-03) +- **eslint-plugin:** [object-curly-spacing] support MappedType ([#3176](https://github.com/typescript-eslint/typescript-eslint/issues/3176)) ([0557a43](https://github.com/typescript-eslint/typescript-eslint/commit/0557a439327557f4c0369ae2dddc8282ba45bfe6)) +- **eslint-plugin:** [unbound-method] improve error message ([#3203](https://github.com/typescript-eslint/typescript-eslint/issues/3203)) ([5cc5d2e](https://github.com/typescript-eslint/typescript-eslint/commit/5cc5d2ef6d924d301e87f7bcf599352310e74b2c)), closes [#3201](https://github.com/typescript-eslint/typescript-eslint/issues/3201) +# [4.18.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.17.0...v4.18.0) (2021-03-15) ### Bug Fixes -* **eslint-plugin:** [no-implied-eval] don't report when `Function` is imported ([#2348](https://github.com/typescript-eslint/typescript-eslint/issues/2348)) ([fa169e7](https://github.com/typescript-eslint/typescript-eslint/commit/fa169e79661821f0e0e64a56d6db9da42c3c8654)) -* **eslint-plugin:** [no-unsafe-assignment] fix typo in message ([#2347](https://github.com/typescript-eslint/typescript-eslint/issues/2347)) ([2027bb1](https://github.com/typescript-eslint/typescript-eslint/commit/2027bb11689b76c297f93ba8a918b35fe68e5b9d)) - +- **eslint-plugin:** [explicit-module-boundary-types] fixes [#2864](https://github.com/typescript-eslint/typescript-eslint/issues/2864) related to functions in nested object properties ([#3178](https://github.com/typescript-eslint/typescript-eslint/issues/3178)) ([55e1fba](https://github.com/typescript-eslint/typescript-eslint/commit/55e1fbaca985b500cad1cc9ec25717b18cf5a17b)) +- **eslint-plugin:** [no-extran-class] allowWithDecorator should ignore other errors ([#3160](https://github.com/typescript-eslint/typescript-eslint/issues/3160)) ([a148673](https://github.com/typescript-eslint/typescript-eslint/commit/a1486736d8ef3555832ddfb27fd0980368b363f5)) ### Features -* **eslint-plugin:** [naming-convention] allow specifying an array of selectors ([#2335](https://github.com/typescript-eslint/typescript-eslint/issues/2335)) ([3ef6bd5](https://github.com/typescript-eslint/typescript-eslint/commit/3ef6bd5cadc225e42ef1330d15919a39f53f2a2b)) -* **eslint-plugin:** add `prefer-enum-initializers` rule ([#2326](https://github.com/typescript-eslint/typescript-eslint/issues/2326)) ([4f38ea3](https://github.com/typescript-eslint/typescript-eslint/commit/4f38ea39c97289db11501d6368d01db8c5787257)) - - - - - -## [3.7.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.7.0...v3.7.1) (2020-07-27) +- **eslint-plugin:** add package type declaration ([#3164](https://github.com/typescript-eslint/typescript-eslint/issues/3164)) ([08b058a](https://github.com/typescript-eslint/typescript-eslint/commit/08b058a7a6db3b59c28753bb322717e1fee44d1f)) +# [4.17.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.16.1...v4.17.0) (2021-03-08) ### Bug Fixes -* **eslint-plugin:** [adjacent-overload-signatures] fix false positive on call signatures and a method named `call` ([#2313](https://github.com/typescript-eslint/typescript-eslint/issues/2313)) ([30fafb0](https://github.com/typescript-eslint/typescript-eslint/commit/30fafb09422b3aca881f4785d89b0536092d4952)) -* **eslint-plugin:** [no-extra-parens] stop reporting on calling generic functions with one argument and type parameters containing parentheses ([#2319](https://github.com/typescript-eslint/typescript-eslint/issues/2319)) ([616a841](https://github.com/typescript-eslint/typescript-eslint/commit/616a841032bec310d9f31f1c987888273df27008)) - - - - - -# [3.7.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.6.1...v3.7.0) (2020-07-20) - +- **eslint-plugin:** [no-unnecessary-type-assertion] handle assignment ([#3133](https://github.com/typescript-eslint/typescript-eslint/issues/3133)) ([cb22561](https://github.com/typescript-eslint/typescript-eslint/commit/cb2256168c67e0383083673a5afe77076de49da5)) ### Features -* **eslint-plugin:** [naming-convention] allow selecting only `const` variables ([#2291](https://github.com/typescript-eslint/typescript-eslint/issues/2291)) ([156d058](https://github.com/typescript-eslint/typescript-eslint/commit/156d058fee835fdf1ed827a5ad4a80d57190cc54)) -* **eslint-plugin:** [no-empty-function] add `decoratedFunctions` option ([#2295](https://github.com/typescript-eslint/typescript-eslint/issues/2295)) ([88f08f4](https://github.com/typescript-eslint/typescript-eslint/commit/88f08f410760f58fdc2de58ecd9dab9610821642)) - - - - - -## [3.6.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.6.0...v3.6.1) (2020-07-13) - - -### Bug Fixes - -* **eslint-plugin:** [no-unnecessary-condition] handle computed member access ([#2288](https://github.com/typescript-eslint/typescript-eslint/issues/2288)) ([3a187ca](https://github.com/typescript-eslint/typescript-eslint/commit/3a187cafb7302a3c05de0e6a236dd142a5e2d741)) -* **eslint-plugin:** [prefer-literal-enum-member] allow negative numbers ([#2277](https://github.com/typescript-eslint/typescript-eslint/issues/2277)) ([00ac9c3](https://github.com/typescript-eslint/typescript-eslint/commit/00ac9c3ccaad27bab08ec3c3a104f612bb593df5)) -* **eslint-plugin:** [space-before-function-paren] incorrect handling of abstract methods ([#2275](https://github.com/typescript-eslint/typescript-eslint/issues/2275)) ([ced6591](https://github.com/typescript-eslint/typescript-eslint/commit/ced65918b16f46c383496a9b4bd43eca8a76baf6)), closes [#2274](https://github.com/typescript-eslint/typescript-eslint/issues/2274) -* **eslint-plugin:** [switch-exhaustiveness-check] handle special characters in enum keys ([#2207](https://github.com/typescript-eslint/typescript-eslint/issues/2207)) ([98ab010](https://github.com/typescript-eslint/typescript-eslint/commit/98ab010fb7fca884984bb4200fd806ecee8071b6)) - - - +- **eslint-plugin:** [strict-bool-expr] add fixes and suggestions ([#2847](https://github.com/typescript-eslint/typescript-eslint/issues/2847)) ([3f9e9a1](https://github.com/typescript-eslint/typescript-eslint/commit/3f9e9a1e9fc3e507bd01d1913ef642cd129de402)) +## [4.16.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.16.0...v4.16.1) (2021-03-01) -# [3.6.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.5.0...v3.6.0) (2020-07-06) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin +# [4.16.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.15.2...v4.16.0) (2021-03-01) ### Bug Fixes -* **eslint-plugin:** [no-namespace] allow namespaces in nested declarations with `allowDeclarations` ([#2238](https://github.com/typescript-eslint/typescript-eslint/issues/2238)) ([c1df669](https://github.com/typescript-eslint/typescript-eslint/commit/c1df6694f7866d3ef7ede0b1c6c9dd6f3955e682)) -* **eslint-plugin:** [space-before-function-paren] handle abstract functions ([#2199](https://github.com/typescript-eslint/typescript-eslint/issues/2199)) ([88a3edf](https://github.com/typescript-eslint/typescript-eslint/commit/88a3edfce8349f871b7b660d2b76508b67c94eda)) - +- **eslint-plugin:** [consistent-indexed-object-style] do not autofix if interface has extends ([#3009](https://github.com/typescript-eslint/typescript-eslint/issues/3009)) ([b0475af](https://github.com/typescript-eslint/typescript-eslint/commit/b0475aff3920d748fa74b5a6d8a7ad5dd731aec4)) +- **eslint-plugin:** [no-implied-eval] handle conditional expression ([#3125](https://github.com/typescript-eslint/typescript-eslint/issues/3125)) ([8c65d30](https://github.com/typescript-eslint/typescript-eslint/commit/8c65d30a225a3b99e80326961d0cb0c8189b039c)) +- **eslint-plugin:** [no-unused-vars] don't report nested module declaration ([#3119](https://github.com/typescript-eslint/typescript-eslint/issues/3119)) ([4ca5888](https://github.com/typescript-eslint/typescript-eslint/commit/4ca58886adf3fc0fe31c263559990c8a534205f9)) +- **eslint-plugin:** [prefer-function-type] apply existing comments to the fixed code ([#3094](https://github.com/typescript-eslint/typescript-eslint/issues/3094)) ([c32f803](https://github.com/typescript-eslint/typescript-eslint/commit/c32f803d4480acf5ffc88e308b4243e5185c4f48)) +- **eslint-plugin:** [unbound-method] allow `super` expressions in `this` assignments ([#3010](https://github.com/typescript-eslint/typescript-eslint/issues/3010)) ([c65a139](https://github.com/typescript-eslint/typescript-eslint/commit/c65a1391be15bbcf3ae293b1c53686703883d546)) ### Features -* **eslint-plugin:** add rule `prefer-literal-enum-member` ([#1898](https://github.com/typescript-eslint/typescript-eslint/issues/1898)) ([fe2b2ec](https://github.com/typescript-eslint/typescript-eslint/commit/fe2b2ec39ef04ac8b73eef9d29d12fd1b24fa183)) - - - - - -# [3.5.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.4.0...v3.5.0) (2020-06-29) +- **eslint-plugin:** [member-delimiter-style] Add an option 'multilineDetection' to treat types and interfaces as single line if the last member ends on the same line as the closing bracket ([#2970](https://github.com/typescript-eslint/typescript-eslint/issues/2970)) ([cf86f42](https://github.com/typescript-eslint/typescript-eslint/commit/cf86f427186d58b0fce4bb3ff9571c4301babeb3)) +- **eslint-plugin:** [prom-func-async] report only function head ([#2872](https://github.com/typescript-eslint/typescript-eslint/issues/2872)) ([25f459c](https://github.com/typescript-eslint/typescript-eslint/commit/25f459cdc4f38d44b48554e04cfa1676538ccdfb)) +## [4.15.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.15.1...v4.15.2) (2021-02-22) ### Bug Fixes -* **eslint-plugin:** [naming-convention] support unicode in regex ([#2241](https://github.com/typescript-eslint/typescript-eslint/issues/2241)) ([5fdd21a](https://github.com/typescript-eslint/typescript-eslint/commit/5fdd21a1726fb6928098c4152aec55a30df960d4)) - - -### Features - -* add package scope-manager ([#1939](https://github.com/typescript-eslint/typescript-eslint/issues/1939)) ([682eb7e](https://github.com/typescript-eslint/typescript-eslint/commit/682eb7e009c3f22a542882dfd3602196a60d2a1e)) - - - - - -# [3.4.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.3.0...v3.4.0) (2020-06-22) +- **typescript-estree:** correct issues in AST definition ([#3083](https://github.com/typescript-eslint/typescript-eslint/issues/3083)) ([509a117](https://github.com/typescript-eslint/typescript-eslint/commit/509a11749f85400a01e9fecfecd12871ce562d3d)) +- add missing intrinsic keyword node to AST ([#3081](https://github.com/typescript-eslint/typescript-eslint/issues/3081)) ([409bf0b](https://github.com/typescript-eslint/typescript-eslint/commit/409bf0bb3e2ac4d8782408d436ebdefb42dba38b)) +- **eslint-plugin:** [no-var-requires] report when used in type assertion ([#3074](https://github.com/typescript-eslint/typescript-eslint/issues/3074)) ([763a252](https://github.com/typescript-eslint/typescript-eslint/commit/763a2520bfea09c3b6252ea36bc3ff10b05eca6c)) +## [4.15.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.15.0...v4.15.1) (2021-02-15) ### Bug Fixes -* **eslint-plugin:** [no-base-to-string] handle intersection types ([#2170](https://github.com/typescript-eslint/typescript-eslint/issues/2170)) ([9cca3a9](https://github.com/typescript-eslint/typescript-eslint/commit/9cca3a9584d5d5ef0536219c5a734f4e87efb543)) -* **eslint-plugin:** [unbound-method] handling destructuring ([#2228](https://github.com/typescript-eslint/typescript-eslint/issues/2228)) ([c3753c2](https://github.com/typescript-eslint/typescript-eslint/commit/c3753c21768d355ecdb9e7ae8e0bfdfbbc1d3bbe)) - - -### Features - -* **eslint-plugin:** [no-unnecessary-boolean-literal-compare] add option to check nullable booleans ([#1983](https://github.com/typescript-eslint/typescript-eslint/issues/1983)) ([c0b3057](https://github.com/typescript-eslint/typescript-eslint/commit/c0b3057b7f7d515891ad2efe32e4ef8c01e0478f)) -* **eslint-plugin:** add extension rule `no-loss-of-precision` ([#2196](https://github.com/typescript-eslint/typescript-eslint/issues/2196)) ([535b0f2](https://github.com/typescript-eslint/typescript-eslint/commit/535b0f2ddd82efa6a2c40307a61c480f4b3cdea3)) - - - - - -# [3.3.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.2.0...v3.3.0) (2020-06-15) +- **eslint-plugin:** [explicit-module-boundary-types] check allowNames on function declarations and property methods ([#3051](https://github.com/typescript-eslint/typescript-eslint/issues/3051)) ([0ade469](https://github.com/typescript-eslint/typescript-eslint/commit/0ade469dc1cf17d79c36a9c985630d60491ed847)) +# [4.15.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.14.2...v4.15.0) (2021-02-08) ### Bug Fixes -* **eslint-plugin:** [no-unused-expressions] handle ternary and short-circuit options ([#2194](https://github.com/typescript-eslint/typescript-eslint/issues/2194)) ([ee9f100](https://github.com/typescript-eslint/typescript-eslint/commit/ee9f100a2f9a874c2b361482742686eeaa9bdac7)) - - -### Features - -* **eslint-plugin:** [naming-convention] better error message and docs for prefix/suffix ([#2195](https://github.com/typescript-eslint/typescript-eslint/issues/2195)) ([a2ffe55](https://github.com/typescript-eslint/typescript-eslint/commit/a2ffe5568df0f7224bfe9141d298e538383d5f09)) - - - - - -# [3.2.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.1.0...v3.2.0) (2020-06-08) +- **eslint-plugin:** [no-extra-parens] handle ESLint 7.19.0 ([#2993](https://github.com/typescript-eslint/typescript-eslint/issues/2993)) ([4615048](https://github.com/typescript-eslint/typescript-eslint/commit/4615048d24359e0fc57b90a96acf4d8ded1dc7bf)) +- **eslint-plugin:** [prefer-function-type] correct fixer when signature ends with a semi ([#3002](https://github.com/typescript-eslint/typescript-eslint/issues/3002)) ([898dd39](https://github.com/typescript-eslint/typescript-eslint/commit/898dd3961944a5da3a129e9eba02634286e7aee4)) +- **scope-manager:** fix visiting of TSImportType ([#3008](https://github.com/typescript-eslint/typescript-eslint/issues/3008)) ([ce4fcbf](https://github.com/typescript-eslint/typescript-eslint/commit/ce4fcbf4401098387a2cf19ae8457c89c509239a)), closes [#3006](https://github.com/typescript-eslint/typescript-eslint/issues/3006) +## [4.14.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.14.1...v4.14.2) (2021-02-01) ### Bug Fixes -* **eslint-plugin:** [explicit-module-boundary-types] dont report return type errors on constructor overloads ([#2158](https://github.com/typescript-eslint/typescript-eslint/issues/2158)) ([53232d7](https://github.com/typescript-eslint/typescript-eslint/commit/53232d775ca0b808e2d75d9501f4411a868b2b48)) -* **eslint-plugin:** [explicit-module-boundary-types] handle bodyless arrow functions with explicit return types that return functions ([#2169](https://github.com/typescript-eslint/typescript-eslint/issues/2169)) ([58db655](https://github.com/typescript-eslint/typescript-eslint/commit/58db655133aaae006efe3e3ceee971cf88dc348f)) -* **eslint-plugin:** [explicit-module-boundary-types] handle nested functions and functions expressions in a typed variable declaration ([#2176](https://github.com/typescript-eslint/typescript-eslint/issues/2176)) ([6ff450d](https://github.com/typescript-eslint/typescript-eslint/commit/6ff450da3abec93223a33f6b52484c9ca99b7abe)) -* **eslint-plugin:** [no-extra-non-null-assertion] dont report for assertions not followed by the optional chain ([#2167](https://github.com/typescript-eslint/typescript-eslint/issues/2167)) ([e4c1834](https://github.com/typescript-eslint/typescript-eslint/commit/e4c1834c7c5934332dd1d58c09018453568c4889)) -* **eslint-plugin:** [no-unnecessary-conditionals] Handle comparison of generics and loose comparisons with undefined values ([#2152](https://github.com/typescript-eslint/typescript-eslint/issues/2152)) ([c86e2a2](https://github.com/typescript-eslint/typescript-eslint/commit/c86e2a235372149db9b1700d39c2145e0ce5221a)) -* **eslint-plugin:** [prefer-optional-chain] handling first member expression ([#2156](https://github.com/typescript-eslint/typescript-eslint/issues/2156)) ([de18660](https://github.com/typescript-eslint/typescript-eslint/commit/de18660a8cf8f7033798646d8c5b0938d1accb12)) -* **eslint-plugin:** [return-await] correct handling of ternaries ([#2168](https://github.com/typescript-eslint/typescript-eslint/issues/2168)) ([fe4c0bf](https://github.com/typescript-eslint/typescript-eslint/commit/fe4c0bf8c04f070d6642fbe86c5e5614bc88e8fd)) - - -### Features - -* **eslint-plugin:** [naming-convention] put identifiers in quotes in error messages ([#2182](https://github.com/typescript-eslint/typescript-eslint/issues/2182)) ([fc61932](https://github.com/typescript-eslint/typescript-eslint/commit/fc619326eedf7ef2efa51444ecdead81a36a204f)), closes [#2178](https://github.com/typescript-eslint/typescript-eslint/issues/2178) -* **eslint-plugin:** [require-array-sort-compare] add `ignoreStringArrays` option ([#1972](https://github.com/typescript-eslint/typescript-eslint/issues/1972)) ([6dee784](https://github.com/typescript-eslint/typescript-eslint/commit/6dee7840a3af1dfe4c38a128d1c4655bdac625df)) -* **eslint-plugin:** add rule `ban-tslint-comment` ([#2140](https://github.com/typescript-eslint/typescript-eslint/issues/2140)) ([43ee226](https://github.com/typescript-eslint/typescript-eslint/commit/43ee226ffbaaa3e7126081db9476c24b89ec16e9)) -* **eslint-plugin:** add rule `no-confusing-non-null-assertion` ([#1941](https://github.com/typescript-eslint/typescript-eslint/issues/1941)) ([9b51c44](https://github.com/typescript-eslint/typescript-eslint/commit/9b51c44f29d8b3e95a510985544e8ded8a14404d)) - - - - - -# [3.1.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.0.2...v3.1.0) (2020-06-01) +- **eslint-plugin:** [consistent-type-imports] incorrect handling of computed property type signatures ([#2990](https://github.com/typescript-eslint/typescript-eslint/issues/2990)) ([58f2655](https://github.com/typescript-eslint/typescript-eslint/commit/58f26555f62b5f59f13260306638d3148cde6079)), closes [#2989](https://github.com/typescript-eslint/typescript-eslint/issues/2989) +- **scope-manager:** correctly reference generic parameters when decorator metadata is enabled ([#2975](https://github.com/typescript-eslint/typescript-eslint/issues/2975)) ([7695ef3](https://github.com/typescript-eslint/typescript-eslint/commit/7695ef318f1cc8688acaabf4f2730769622f083f)), closes [#2972](https://github.com/typescript-eslint/typescript-eslint/issues/2972) +## [4.14.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.14.0...v4.14.1) (2021-01-25) ### Bug Fixes -* **eslint-plugin:** [explicit-module-boundary-types] don't check returned functions if parent function has return type ([#2084](https://github.com/typescript-eslint/typescript-eslint/issues/2084)) ([d7d4eeb](https://github.com/typescript-eslint/typescript-eslint/commit/d7d4eeb03f2918d5d9e361fdb47c2d42e83bd593)) -* **eslint-plugin:** [no-unnecessary-condition] handle comparison of any, unknown and loose comparisons with nullish values ([#2123](https://github.com/typescript-eslint/typescript-eslint/issues/2123)) ([1ae1d01](https://github.com/typescript-eslint/typescript-eslint/commit/1ae1d01e5603ec7cef8051ed018c3c3c88b29867)) -* **eslint-plugin:** [no-unnecessary-condition] improve optional chain handling ([#2111](https://github.com/typescript-eslint/typescript-eslint/issues/2111)) ([9ee399b](https://github.com/typescript-eslint/typescript-eslint/commit/9ee399b5906e82f346ff89141207a6630786de54)) -* **eslint-plugin:** [no-unnecessary-condition] improve optional chain handling 2 - electric boogaloo ([#2138](https://github.com/typescript-eslint/typescript-eslint/issues/2138)) ([c87cfaf](https://github.com/typescript-eslint/typescript-eslint/commit/c87cfaf6746775bb8ad9eb45b0002f068a822dbe)) -* **eslint-plugin:** [no-unused-expressions] ignore import expressions ([#2130](https://github.com/typescript-eslint/typescript-eslint/issues/2130)) ([e383691](https://github.com/typescript-eslint/typescript-eslint/commit/e3836910efdafd9edf04daed149c9e839c08047e)) -* **eslint-plugin:** [no-var-requires] false negative for TSAsExpression and MemberExpression ([#2139](https://github.com/typescript-eslint/typescript-eslint/issues/2139)) ([df95338](https://github.com/typescript-eslint/typescript-eslint/commit/df953388913b22d45242e65ce231d92a8b8a0080)) -* **experimental-utils:** downlevel type declarations for versions older than 3.8 ([#2133](https://github.com/typescript-eslint/typescript-eslint/issues/2133)) ([7925823](https://github.com/typescript-eslint/typescript-eslint/commit/792582326a8065270b69a0ffcaad5a7b4b103ff3)) +- **eslint-plugin:** [sort-type-union-intersection-members] consider `void` as a `nullish` ([#2944](https://github.com/typescript-eslint/typescript-eslint/issues/2944)) ([a241b25](https://github.com/typescript-eslint/typescript-eslint/commit/a241b25863eb063986fab76b511f478bbba91f47)), closes [#2940](https://github.com/typescript-eslint/typescript-eslint/issues/2940) +- **scope-manager:** fix incorrect handling of class decorators and class method default params ([#2943](https://github.com/typescript-eslint/typescript-eslint/issues/2943)) ([e1eac83](https://github.com/typescript-eslint/typescript-eslint/commit/e1eac8312268d1855a2ed7784b4d190ecb9c9fa4)), closes [#2941](https://github.com/typescript-eslint/typescript-eslint/issues/2941) [#2942](https://github.com/typescript-eslint/typescript-eslint/issues/2942) [#2751](https://github.com/typescript-eslint/typescript-eslint/issues/2751) +# [4.14.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.13.0...v4.14.0) (2021-01-18) ### Features -* **eslint-plugin:** [ban-ts-comments] add "allow-with-description" option ([#2099](https://github.com/typescript-eslint/typescript-eslint/issues/2099)) ([8a0fd18](https://github.com/typescript-eslint/typescript-eslint/commit/8a0fd1899f544470a35afb3117f4c71aad7e4e42)) -* **eslint-plugin:** [ban-types] allow selective disable of default options with `false` value ([#2137](https://github.com/typescript-eslint/typescript-eslint/issues/2137)) ([1cb8ca4](https://github.com/typescript-eslint/typescript-eslint/commit/1cb8ca483d029935310e6904580df8501837084d)) -* **eslint-plugin:** [explicit-module-boundary-types] improve accuracy and coverage ([#2135](https://github.com/typescript-eslint/typescript-eslint/issues/2135)) ([caaa859](https://github.com/typescript-eslint/typescript-eslint/commit/caaa8599284d02ab3341e282cad35a52d0fb86c7)) - - - - - -## [3.0.2](https://github.com/typescript-eslint/typescript-eslint/compare/v3.0.1...v3.0.2) (2020-05-27) - -**Note:** Version bump only for package @typescript-eslint/eslint-plugin - +- add support for decorator metadata in scope analysis and in consistent-type-imports ([#2751](https://github.com/typescript-eslint/typescript-eslint/issues/2751)) ([445e416](https://github.com/typescript-eslint/typescript-eslint/commit/445e416878b27a54bf07c2d3b84dabd7b06e51bc)), closes [#2559](https://github.com/typescript-eslint/typescript-eslint/issues/2559) +- **eslint-plugin:** add `object-curly-spacing` rule ([#2892](https://github.com/typescript-eslint/typescript-eslint/issues/2892)) ([32bd18d](https://github.com/typescript-eslint/typescript-eslint/commit/32bd18de80f4f8388717d0f0c16d493234362aa5)) - - - -## [3.0.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.0.0...v3.0.1) (2020-05-25) - - -### Bug Fixes - -* **eslint-plugin:** [naming-convention] handle no options correctly ([#2095](https://github.com/typescript-eslint/typescript-eslint/issues/2095)) ([fd7d02b](https://github.com/typescript-eslint/typescript-eslint/commit/fd7d02b31ebd995b7fdd857d7c054042aa4f2001)) -* **eslint-plugin:** [no-throw-literal] handle intersection and union types ([#2085](https://github.com/typescript-eslint/typescript-eslint/issues/2085)) ([cae037f](https://github.com/typescript-eslint/typescript-eslint/commit/cae037ff9b20363b970cc600a09505b98bf10a14)) -* **eslint-plugin:** [unbound-method] fix crash due to missing `Intl` ([#2090](https://github.com/typescript-eslint/typescript-eslint/issues/2090)) ([f2fa82c](https://github.com/typescript-eslint/typescript-eslint/commit/f2fa82c532ae858ccfb064268cfcc9df657a54be)) - - - - - -# [3.0.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.34.0...v3.0.0) (2020-05-21) - -## [Please see the release notes for v3.0.0](https://github.com/typescript-eslint/typescript-eslint/releases/tag/v3.0.0) +# [4.13.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.12.0...v4.13.0) (2021-01-11) ### Bug Fixes -* **eslint-plugin:** [dot-notation] fix typo in schema ([#2040](https://github.com/typescript-eslint/typescript-eslint/issues/2040)) ([242328f](https://github.com/typescript-eslint/typescript-eslint/commit/242328fa749ee4c72af93433a9bef95f329ac62f)) -* **eslint-plugin:** correct parser peerDep version ([fe59f69](https://github.com/typescript-eslint/typescript-eslint/commit/fe59f69381a0915a4f5135e2e88637a5eea246ba)) -* **experimental-utils:** add back SourceCode.isSpaceBetweenTokens ([ae82ea4](https://github.com/typescript-eslint/typescript-eslint/commit/ae82ea4a85a4ca332ebe6104e96c59dba30411be)) -* **typescript-estree:** remove now defunct `Import` node type ([f199cbd](https://github.com/typescript-eslint/typescript-eslint/commit/f199cbdbbd892b5ba03bfff66f463f3d9c92ee9b)) -* **typescript-estree:** use `TSEmptyBodyFunctionExpression` for body-less nodes ([#1289](https://github.com/typescript-eslint/typescript-eslint/issues/1289)) ([82e7163](https://github.com/typescript-eslint/typescript-eslint/commit/82e7163214b56ccde93ba97807b161669a50a60b)) - - -### Features - -* **eslint-plugin:** [ban-types] rework default options ([#848](https://github.com/typescript-eslint/typescript-eslint/issues/848)) ([8e31d5d](https://github.com/typescript-eslint/typescript-eslint/commit/8e31d5dbe9fe5227fdbefcecfd50ce5dd51360c3)) -* **eslint-plugin:** [no-floating-promises] ignore void operator by default ([#2003](https://github.com/typescript-eslint/typescript-eslint/issues/2003)) ([3626a67](https://github.com/typescript-eslint/typescript-eslint/commit/3626a673cf8117cc995245cd86e466e2553e9b0e)) -* **eslint-plugin:** [prefer-nullish-coalescing][prefer-optional-chain] remove unsafe fixers ([52b6085](https://github.com/typescript-eslint/typescript-eslint/commit/52b60852d0ba6bb6abe519c9d3ec1b231793e91d)) -* **experimental-utils:** upgrade eslint types for v7 ([#2023](https://github.com/typescript-eslint/typescript-eslint/issues/2023)) ([06869c9](https://github.com/typescript-eslint/typescript-eslint/commit/06869c9656fa37936126666845aee40aad546ebd)) -* upgrade to ESLint v7 ([#2022](https://github.com/typescript-eslint/typescript-eslint/issues/2022)) ([208de71](https://github.com/typescript-eslint/typescript-eslint/commit/208de71059746bf38e94bd460346ffb2698a3e12)) -* **eslint-plugin:** [no-unnecessary-condition] remove `checkArrayPredicates` and always check it ([#1579](https://github.com/typescript-eslint/typescript-eslint/issues/1579)) ([bfd9b60](https://github.com/typescript-eslint/typescript-eslint/commit/bfd9b606d17d30d5694967a1f01e0e1501ba1022)) -* **eslint-plugin:** [no-unnecessary-condition] remove option `ignoreRHS` ([#1163](https://github.com/typescript-eslint/typescript-eslint/issues/1163)) ([ee8dd8f](https://github.com/typescript-eslint/typescript-eslint/commit/ee8dd8f8a9e6c25ac426ce9bb71c5f012c51f264)) -* **eslint-plugin:** [no-unnecessary-condition] report when non-nullish is compared to `null`/`undefined` ([#1659](https://github.com/typescript-eslint/typescript-eslint/issues/1659)) ([7fa9060](https://github.com/typescript-eslint/typescript-eslint/commit/7fa906073903c5eb70609c25f1a91ada14dcdc71)) -* **eslint-plugin:** [restrict-template-expressions] `allowNumber: true` by default ([#2005](https://github.com/typescript-eslint/typescript-eslint/issues/2005)) ([643ec24](https://github.com/typescript-eslint/typescript-eslint/commit/643ec240bd901295d9e9ea5c43fc20109c33e982)) -* **eslint-plugin:** [restrict-template-expressions] rename `allowNullable` to `allowNullish` ([#2006](https://github.com/typescript-eslint/typescript-eslint/issues/2006)) ([264b017](https://github.com/typescript-eslint/typescript-eslint/commit/264b017c11c2ab132fcbad18b42a9a0fe639386e)) -* **eslint-plugin:** [strict-boolean-expression] rework options ([#1631](https://github.com/typescript-eslint/typescript-eslint/issues/1631)) ([cd14482](https://github.com/typescript-eslint/typescript-eslint/commit/cd1448240dca11762fcb9c10e18bb6541a840485)) -* **eslint-plugin:** delete deprecated rules ([#2002](https://github.com/typescript-eslint/typescript-eslint/issues/2002)) ([da0aec2](https://github.com/typescript-eslint/typescript-eslint/commit/da0aec2cfa27902aae7c438a2fe91343c822e4ae)) -* **eslint-plugin:** eslint-recommended: disable no-func-assign ([#984](https://github.com/typescript-eslint/typescript-eslint/issues/984)) ([ae9b8a9](https://github.com/typescript-eslint/typescript-eslint/commit/ae9b8a9c73c0328287de956466257d8bbfbdb20f)) -* **eslint-plugin:** eslint-recommended: disable no-obj-calls ([#1000](https://github.com/typescript-eslint/typescript-eslint/issues/1000)) ([b9ca14c](https://github.com/typescript-eslint/typescript-eslint/commit/b9ca14c5f5ec28a3fde1a9b2d2f6a4dc74d903e4)) -* **eslint-plugin:** update `eslint-recommended` set ([#1996](https://github.com/typescript-eslint/typescript-eslint/issues/1996)) ([9a96e18](https://github.com/typescript-eslint/typescript-eslint/commit/9a96e18400e0a0d738d159d9d01faf41d3586249)) -* **eslint-plugin:** update recommended sets ([#2001](https://github.com/typescript-eslint/typescript-eslint/issues/2001)) ([0126b4f](https://github.com/typescript-eslint/typescript-eslint/commit/0126b4f56f9197d561e90b09962ccceb4f88bc41)) -* **typescript-estree:** align nodes with estree 2020 ([#1389](https://github.com/typescript-eslint/typescript-eslint/issues/1389)) ([aff5b62](https://github.com/typescript-eslint/typescript-eslint/commit/aff5b62044f9b93f2087a1d261e9be3f8d6fd54d)) -* drop support for node v8 ([#1997](https://github.com/typescript-eslint/typescript-eslint/issues/1997)) ([b6c3b7b](https://github.com/typescript-eslint/typescript-eslint/commit/b6c3b7b84b8d199fa75a46432febd4a364a63217)) -* **typescript-estree:** always return parserServices ([#716](https://github.com/typescript-eslint/typescript-eslint/issues/716)) ([5b23443](https://github.com/typescript-eslint/typescript-eslint/commit/5b23443c48f3f62424db3e742243f3568080b946)) -* **typescript-estree:** handle 3.9's non-null assertion changes ([#2036](https://github.com/typescript-eslint/typescript-eslint/issues/2036)) ([06bec63](https://github.com/typescript-eslint/typescript-eslint/commit/06bec63c56536db070608ab136d2ad57083f0c6a)) - - - - - -# [2.34.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.33.0...v2.34.0) (2020-05-18) - - -### Features - -* **eslint-plugin:** [no-invalid-void-type] allow union of void and `allowInGenericTypeArguments` ([#1960](https://github.com/typescript-eslint/typescript-eslint/issues/1960)) ([1bc105a](https://github.com/typescript-eslint/typescript-eslint/commit/1bc105a2c6ae3fde9596f0419fed0de699dc57c7)) -* **eslint-plugin:** [restrict-template-expressions] improve error message ([#1926](https://github.com/typescript-eslint/typescript-eslint/issues/1926)) ([1af59ba](https://github.com/typescript-eslint/typescript-eslint/commit/1af59ba8ac0ceabb008d9c61556acf7db0a1d352)) -* **experimental-utils:** add `suggestion` property for rule modules ([#2033](https://github.com/typescript-eslint/typescript-eslint/issues/2033)) ([f42a5b0](https://github.com/typescript-eslint/typescript-eslint/commit/f42a5b09ebfa173f418a99c552b0cbe221567194)) - - - - - -# [2.33.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.32.0...v2.33.0) (2020-05-12) - +- **eslint-plugin:** support eslint@5 ([#2917](https://github.com/typescript-eslint/typescript-eslint/issues/2917)) ([f606846](https://github.com/typescript-eslint/typescript-eslint/commit/f606846af2617a0d8ee3ad5ce7c10864161ebf53)) ### Features -* **eslint-plugin:** add extension rule `lines-between-class-members` ([#1684](https://github.com/typescript-eslint/typescript-eslint/issues/1684)) ([08f93e6](https://github.com/typescript-eslint/typescript-eslint/commit/08f93e69347a8e7f3a7e8a1455bb5d069c2faeef)) - - - - - -# [2.32.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.31.0...v2.32.0) (2020-05-11) +- **eslint-plugin:** [sort-type-union-intersection-members] add nullish group ([#2919](https://github.com/typescript-eslint/typescript-eslint/issues/2919)) ([5558f41](https://github.com/typescript-eslint/typescript-eslint/commit/5558f410007da58a3f4726bbf9501c924ef166a1)) +# [4.12.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.11.1...v4.12.0) (2021-01-04) ### Bug Fixes -* **eslint-plugin:** [no-base-to-string] support boolean in unions ([#1979](https://github.com/typescript-eslint/typescript-eslint/issues/1979)) ([6987ecc](https://github.com/typescript-eslint/typescript-eslint/commit/6987ecc1dacfb45c0f8ed3e81d08aa708eb96ad1)) -* **eslint-plugin:** [no-type-alias] handle readonly types in aliases ([#1990](https://github.com/typescript-eslint/typescript-eslint/issues/1990)) ([56d9870](https://github.com/typescript-eslint/typescript-eslint/commit/56d987070f83d1b6410b04750b20a761fd793073)) -* **eslint-plugin:** [no-unused-expressions] inherit `messages` from base rule ([#1992](https://github.com/typescript-eslint/typescript-eslint/issues/1992)) ([51ca404](https://github.com/typescript-eslint/typescript-eslint/commit/51ca404af645eed194269ab7f8f67b97bd52e32d)) - +- **eslint-plugin:** [comma-spacing] handle empty type params ([#2915](https://github.com/typescript-eslint/typescript-eslint/issues/2915)) ([4d69fbb](https://github.com/typescript-eslint/typescript-eslint/commit/4d69fbba91ea3161213a0ab093e398fed091168c)) ### Features -* bump dependencies and align AST ([#2007](https://github.com/typescript-eslint/typescript-eslint/issues/2007)) ([18668b7](https://github.com/typescript-eslint/typescript-eslint/commit/18668b78fd7d1e5281af7fc26c76e0ca53297f69)) - - +- **eslint-plugin:** add rule `sort-type-union-intersection-members` ([#2913](https://github.com/typescript-eslint/typescript-eslint/issues/2913)) ([9092c04](https://github.com/typescript-eslint/typescript-eslint/commit/9092c0494ebd3486e38852198c1930f1432ef21f)) +## [4.11.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.11.0...v4.11.1) (2020-12-28) +### Bug Fixes -# [2.31.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.30.0...v2.31.0) (2020-05-04) +- **eslint-plugin:** [naming-convention] fix precedence of method and property meta selectors ([#2877](https://github.com/typescript-eslint/typescript-eslint/issues/2877)) ([2f10e1a](https://github.com/typescript-eslint/typescript-eslint/commit/2f10e1a5c795cac28a6e0a1a3a0adb5bd6be7f1c)) +# [4.11.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.10.0...v4.11.0) (2020-12-21) ### Bug Fixes -* **eslint-plugin:** [dot-notation] handle missing declarations ([#1947](https://github.com/typescript-eslint/typescript-eslint/issues/1947)) ([383f931](https://github.com/typescript-eslint/typescript-eslint/commit/383f93182599c00e231a0f0d36575ca0e19369a6)) -* **eslint-plugin:** [method-signature-style] fix overloaded methods to an intersection type ([#1966](https://github.com/typescript-eslint/typescript-eslint/issues/1966)) ([7f3fba3](https://github.com/typescript-eslint/typescript-eslint/commit/7f3fba348d432d7637e1c737df943ee1f9105062)) -* **eslint-plugin:** [return-await] await in a normal function ([#1962](https://github.com/typescript-eslint/typescript-eslint/issues/1962)) ([f82fd7b](https://github.com/typescript-eslint/typescript-eslint/commit/f82fd7bb81f986c4861d0b4e2ecdb0c496d7a602)) -* **eslint-plugin:** [unbound-method] false positives for unary expressions ([#1964](https://github.com/typescript-eslint/typescript-eslint/issues/1964)) ([b35070e](https://github.com/typescript-eslint/typescript-eslint/commit/b35070ec6f84ad5ce606386cdb6eeb91488dfdd7)) -* **eslint-plugin:** no-base-to-string boolean expression detect ([#1969](https://github.com/typescript-eslint/typescript-eslint/issues/1969)) ([f78f13a](https://github.com/typescript-eslint/typescript-eslint/commit/f78f13aedd59d5b5880903d48c779a6c50fd937e)) - +- **eslint-plugin:** [non-nullable-type-assertion-style] handle const assertion ([#2881](https://github.com/typescript-eslint/typescript-eslint/issues/2881)) ([53dc34d](https://github.com/typescript-eslint/typescript-eslint/commit/53dc34d3917b90c8ab0324fe8054619ddee98003)) ### Features -* **eslint-plugin:** [member-ordering] add decorators support ([#1870](https://github.com/typescript-eslint/typescript-eslint/issues/1870)) ([f7ec192](https://github.com/typescript-eslint/typescript-eslint/commit/f7ec1920607cb8eec8020b08cd7247de0bf19ce1)) -* **eslint-plugin:** [prefer-optional-chain] added option to convert to suggestion fixer ([#1965](https://github.com/typescript-eslint/typescript-eslint/issues/1965)) ([2f0824b](https://github.com/typescript-eslint/typescript-eslint/commit/2f0824b0a41f3043b6242fc1d49faae540abaf22)) -* **eslint-plugin:** new extended rule 'no-invalid-this' ([#1823](https://github.com/typescript-eslint/typescript-eslint/issues/1823)) ([b18bc35](https://github.com/typescript-eslint/typescript-eslint/commit/b18bc357507337b9725f8d9c1b549513075a0da5)) -* **experimental-utils:** expose our RuleTester extension ([#1948](https://github.com/typescript-eslint/typescript-eslint/issues/1948)) ([2dd1638](https://github.com/typescript-eslint/typescript-eslint/commit/2dd1638aaa2658ba99b2341861146b586f489121)) - - - - - -# [2.30.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.29.0...v2.30.0) (2020-04-27) +- **eslint-plugin:** [prom-func-async] add automatic fix ([#2845](https://github.com/typescript-eslint/typescript-eslint/issues/2845)) ([717e718](https://github.com/typescript-eslint/typescript-eslint/commit/717e718e91df2165422228c02dfa248cf55f65a1)) +# [4.10.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.9.1...v4.10.0) (2020-12-14) ### Bug Fixes -* **eslint-plugin:** [prefer-string-starts-ends-with] check for negative start index in slice ([#1920](https://github.com/typescript-eslint/typescript-eslint/issues/1920)) ([ed2bd60](https://github.com/typescript-eslint/typescript-eslint/commit/ed2bd6067f74ae33e36a084719bb91efedfba599)) -* **eslint-plugin:** fix no-base-to-string boolean literal check ([#1850](https://github.com/typescript-eslint/typescript-eslint/issues/1850)) ([2f45e99](https://github.com/typescript-eslint/typescript-eslint/commit/2f45e9992a8f12b6233716e77a6159f9cea2c879)) - +- **eslint-plugin:** [naming-convention] fix wrong member of `method` and `property` meta selectors ([#2856](https://github.com/typescript-eslint/typescript-eslint/issues/2856)) ([9a6c362](https://github.com/typescript-eslint/typescript-eslint/commit/9a6c3628a2f3a7748b7a4b9b0c55400c8d7dfeae)) ### Features -* **eslint-plugin:** add extension rule `dot-notation` ([#1867](https://github.com/typescript-eslint/typescript-eslint/issues/1867)) ([a85c3e1](https://github.com/typescript-eslint/typescript-eslint/commit/a85c3e1515d735b6c245cc658cdaec6deb05d630)) -* **eslint-plugin:** create `no-invalid-void-type` rule ([#1847](https://github.com/typescript-eslint/typescript-eslint/issues/1847)) ([f667ff1](https://github.com/typescript-eslint/typescript-eslint/commit/f667ff1708d4ed28b7ea5beea742889da69a76d9)) - - +- **eslint-plugin:** add rule `non-nullable-type-assertion-style` ([#2624](https://github.com/typescript-eslint/typescript-eslint/issues/2624)) ([7eee44f](https://github.com/typescript-eslint/typescript-eslint/commit/7eee44fff3041a9725d34bf2fcbfc6fd40a60c61)) +## [4.9.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.9.0...v4.9.1) (2020-12-07) +### Bug Fixes -# [2.29.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.28.0...v2.29.0) (2020-04-20) +- **eslint-plugin:** [method-signature-style] fix crash with methods without a return type ([#2836](https://github.com/typescript-eslint/typescript-eslint/issues/2836)) ([fed89f2](https://github.com/typescript-eslint/typescript-eslint/commit/fed89f24ebe42a6412f0eb19949d5d4771656189)), closes [#2834](https://github.com/typescript-eslint/typescript-eslint/issues/2834) +- **eslint-plugin:** [no-unused-vars] false-positive with class expressions ([#2833](https://github.com/typescript-eslint/typescript-eslint/issues/2833)) ([aadb39f](https://github.com/typescript-eslint/typescript-eslint/commit/aadb39f0ff500ee99ea80e9009ab61283ca9c8cd)), closes [#2831](https://github.com/typescript-eslint/typescript-eslint/issues/2831) +- **eslint-plugin:** [no-unused-vars] fix race condition between naming-convention and no-unused-vars ([#2848](https://github.com/typescript-eslint/typescript-eslint/issues/2848)) ([ccb6b94](https://github.com/typescript-eslint/typescript-eslint/commit/ccb6b9499a4a4077f2e3d81d0844860a25244a0f)), closes [#2844](https://github.com/typescript-eslint/typescript-eslint/issues/2844) +# [4.9.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.8.2...v4.9.0) (2020-11-30) ### Bug Fixes -* **eslint-plugin:** [no-base-to-string] soft remove `ignoreTaggedTemplateExpressions` option ([#1916](https://github.com/typescript-eslint/typescript-eslint/issues/1916)) ([369978e](https://github.com/typescript-eslint/typescript-eslint/commit/369978e9685bacb3e3882b0510ff06eaf8df4ca1)) - +- **eslint-plugin:** [consistent-indexed-object-style] convert readonly index signature to readonly record ([#2798](https://github.com/typescript-eslint/typescript-eslint/issues/2798)) ([29428a4](https://github.com/typescript-eslint/typescript-eslint/commit/29428a4dbef133563f2ee54b22908a01ab9a9472)) +- **eslint-plugin:** [consistent-type-imports] crash when using both default and namespace in one import ([#2778](https://github.com/typescript-eslint/typescript-eslint/issues/2778)) ([c816b84](https://github.com/typescript-eslint/typescript-eslint/commit/c816b84814214f7504a0d89a5cd3b08c595bfb50)) +- **eslint-plugin:** [explicit-module-boundary-types] ignore functions exported within typed object/array literals ([#2805](https://github.com/typescript-eslint/typescript-eslint/issues/2805)) ([73a63ee](https://github.com/typescript-eslint/typescript-eslint/commit/73a63ee9ea00b2db0a29f148d7863c3778e4a483)) +- **eslint-plugin:** [no-use-before-define] allow class references if they're within a class decorator ([#2827](https://github.com/typescript-eslint/typescript-eslint/issues/2827)) ([050023a](https://github.com/typescript-eslint/typescript-eslint/commit/050023aa7bd791d0be7b5788a9dcd8e61a00ce79)), closes [#2842](https://github.com/typescript-eslint/typescript-eslint/issues/2842) +- **eslint-plugin:** [triple-slash-reference] fix crash with external module reference ([#2788](https://github.com/typescript-eslint/typescript-eslint/issues/2788)) ([32b1b68](https://github.com/typescript-eslint/typescript-eslint/commit/32b1b6839fb32d93b7faa8fec74c9cb68ea587bb)) +- **scope-manager:** fix assertion assignments not being marked as write references ([#2809](https://github.com/typescript-eslint/typescript-eslint/issues/2809)) ([fa68492](https://github.com/typescript-eslint/typescript-eslint/commit/fa6849245ca55ca407dc031afbad456f2925a8e9)), closes [#2804](https://github.com/typescript-eslint/typescript-eslint/issues/2804) ### Features -* **eslint-plugin:** [no-floating-promise] add option to ignore IIFEs ([#1799](https://github.com/typescript-eslint/typescript-eslint/issues/1799)) ([cea51bf](https://github.com/typescript-eslint/typescript-eslint/commit/cea51bf130d6d3c2935f5e2dcc468196f2ad9d00)) -* **eslint-plugin:** [restrict-template-expressions] add support for intersection types ([#1803](https://github.com/typescript-eslint/typescript-eslint/issues/1803)) ([cc70e4f](https://github.com/typescript-eslint/typescript-eslint/commit/cc70e4fbadd0b15fd6af913a2e1e2ddd346fa558)) -* **eslint-plugin:** add extension rule `init-declarations` ([#1814](https://github.com/typescript-eslint/typescript-eslint/issues/1814)) ([b01f5e7](https://github.com/typescript-eslint/typescript-eslint/commit/b01f5e778ac28e0797a3734fc58d025bb224f418)) -* **eslint-plugin:** add extension rule `keyword-spacing` ([#1739](https://github.com/typescript-eslint/typescript-eslint/issues/1739)) ([c5106dd](https://github.com/typescript-eslint/typescript-eslint/commit/c5106dd4bf2bc8846cc39aa8bb50c33bec026d4d)) +- **eslint-plugin:** [naming-convention] add `requireDouble`, `allowDouble`, `allowSingleOrDouble` options for underscores ([#2812](https://github.com/typescript-eslint/typescript-eslint/issues/2812)) ([dd0576a](https://github.com/typescript-eslint/typescript-eslint/commit/dd0576a66c34810bc60e0958948c9a8104a3f1a3)) +- **eslint-plugin:** [naming-convention] add `requiresQuotes` modifier ([#2813](https://github.com/typescript-eslint/typescript-eslint/issues/2813)) ([6fc8409](https://github.com/typescript-eslint/typescript-eslint/commit/6fc84094928c3645a0e04c31bd4d759fdfbdcb74)), closes [#2761](https://github.com/typescript-eslint/typescript-eslint/issues/2761) [#1483](https://github.com/typescript-eslint/typescript-eslint/issues/1483) +- **eslint-plugin:** [naming-convention] add modifier `unused` ([#2810](https://github.com/typescript-eslint/typescript-eslint/issues/2810)) ([6a06944](https://github.com/typescript-eslint/typescript-eslint/commit/6a06944e60677a402e7ab432e6ac1209737a7027)) +- **eslint-plugin:** [naming-convention] add modifiers `exported`, `global`, and `destructured` ([#2808](https://github.com/typescript-eslint/typescript-eslint/issues/2808)) ([fb254a1](https://github.com/typescript-eslint/typescript-eslint/commit/fb254a1036b89f9b78f927d607358e65e81a2250)), closes [#2239](https://github.com/typescript-eslint/typescript-eslint/issues/2239) [#2512](https://github.com/typescript-eslint/typescript-eslint/issues/2512) [#2318](https://github.com/typescript-eslint/typescript-eslint/issues/2318) [#2802](https://github.com/typescript-eslint/typescript-eslint/issues/2802) +- **eslint-plugin:** [naming-convention] allow `destructured` modifier for `parameter` selector ([#2829](https://github.com/typescript-eslint/typescript-eslint/issues/2829)) ([525d2ff](https://github.com/typescript-eslint/typescript-eslint/commit/525d2ff9292d89e1445b273b5378159bca323a1e)), closes [#2828](https://github.com/typescript-eslint/typescript-eslint/issues/2828) +- **eslint-plugin:** [naming-convention] split `property` and `method` selectors into more granular `classXXX`, `objectLiteralXXX`, `typeXXX` ([#2807](https://github.com/typescript-eslint/typescript-eslint/issues/2807)) ([665b6d4](https://github.com/typescript-eslint/typescript-eslint/commit/665b6d4023fb9d821f348c39aefff0d7571a98bf)), closes [#1477](https://github.com/typescript-eslint/typescript-eslint/issues/1477) [#2802](https://github.com/typescript-eslint/typescript-eslint/issues/2802) +- **eslint-plugin:** [no-unused-vars] fork the base rule ([#2768](https://github.com/typescript-eslint/typescript-eslint/issues/2768)) ([a8227a6](https://github.com/typescript-eslint/typescript-eslint/commit/a8227a6185dd24de4bfc7d766931643871155021)), closes [#2782](https://github.com/typescript-eslint/typescript-eslint/issues/2782) [#2714](https://github.com/typescript-eslint/typescript-eslint/issues/2714) [#2648](https://github.com/typescript-eslint/typescript-eslint/issues/2648) +- **eslint-plugin:** [unbound-method] add support for methods with a `this: void` parameter ([#2796](https://github.com/typescript-eslint/typescript-eslint/issues/2796)) ([878dd4a](https://github.com/typescript-eslint/typescript-eslint/commit/878dd4ae8c408f1eb42790a8fac37f85040b7f3c)) +## [4.8.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.8.1...v4.8.2) (2020-11-23) +### Bug Fixes +- **eslint-plugin:** [prefer-literal-enum-member] allow pure template literal strings ([#2786](https://github.com/typescript-eslint/typescript-eslint/issues/2786)) ([f3bf6a1](https://github.com/typescript-eslint/typescript-eslint/commit/f3bf6a1791c9dc64bb18d45712f07767c9f96cbd)) +## [4.8.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.8.0...v4.8.1) (2020-11-17) -# [2.28.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.27.0...v2.28.0) (2020-04-13) +### Bug Fixes + +- **eslint-plugin:** [no-unnecessary-condition] false positive when array predicate returns unknown ([#2772](https://github.com/typescript-eslint/typescript-eslint/issues/2772)) ([111c244](https://github.com/typescript-eslint/typescript-eslint/commit/111c244c3eb157efeb5c43ff39f12633b27f091e)) +# [4.8.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.7.0...v4.8.0) (2020-11-16) ### Bug Fixes -* **eslint-plugin:** [method-signature-style] handle multiline params ([#1861](https://github.com/typescript-eslint/typescript-eslint/issues/1861)) ([5832a86](https://github.com/typescript-eslint/typescript-eslint/commit/5832a8643bbe174ec02df5966bb333e506e45f5d)) -* **eslint-plugin:** [no-empty-interface] use suggestion fixer for ambient contexts ([#1880](https://github.com/typescript-eslint/typescript-eslint/issues/1880)) ([62b2278](https://github.com/typescript-eslint/typescript-eslint/commit/62b2278aec0011c93eae17bed8b278114d3379a2)) -* **eslint-plugin:** [unbound-method] false positive on property function initializer ([#1890](https://github.com/typescript-eslint/typescript-eslint/issues/1890)) ([f1c3b18](https://github.com/typescript-eslint/typescript-eslint/commit/f1c3b18f7aadc81f7dca7aa32aa1a8fe424e04e7)) -* **eslint-plugin:** [unbound-method] ignore assignments _to_ methods ([#1736](https://github.com/typescript-eslint/typescript-eslint/issues/1736)) ([6b4680b](https://github.com/typescript-eslint/typescript-eslint/commit/6b4680b6e7343d9d98fa1de170f387a36d98b73e)) -* **eslint-plugin:** no-empty-interface autofix ([#1865](https://github.com/typescript-eslint/typescript-eslint/issues/1865)) ([829a2f7](https://github.com/typescript-eslint/typescript-eslint/commit/829a2f728f876d356908e2338c2d6620e58f9943)), closes [#1864](https://github.com/typescript-eslint/typescript-eslint/issues/1864) -* **eslint-plugin:** use `isTypeArrayTypeOrUnionOfArrayTypes` util for checking if type is array ([#1728](https://github.com/typescript-eslint/typescript-eslint/issues/1728)) ([05030f8](https://github.com/typescript-eslint/typescript-eslint/commit/05030f8d2bd5a50e95053bc61380891da71cc567)) +- **eslint-plugin:** [consistent-type-definitions] remove fixer when the interface is within a global module declaration ([#2739](https://github.com/typescript-eslint/typescript-eslint/issues/2739)) ([2326238](https://github.com/typescript-eslint/typescript-eslint/commit/2326238738c95acfc14c17f9b16798f1de6d267f)) +- **eslint-plugin:** [no-unsafe-member-access] ignore MemberExpression's whose parents are either TSClassImplements or TSInterfaceHeritage ([#2753](https://github.com/typescript-eslint/typescript-eslint/issues/2753)) ([535db3b](https://github.com/typescript-eslint/typescript-eslint/commit/535db3bf27ee1d7824ada9acd91d1b7833064628)) +# [4.7.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.6.1...v4.7.0) (2020-11-09) -### Features +### Bug Fixes -* **eslint-plugin:** [ban-ts-comment] support `ts-expect-error` ([#1706](https://github.com/typescript-eslint/typescript-eslint/issues/1706)) ([469cff3](https://github.com/typescript-eslint/typescript-eslint/commit/469cff332c041f38f60de052769287342455cff1)) -* **eslint-plugin:** [consistent-type-assertions] always allow `const` assertions ([#1713](https://github.com/typescript-eslint/typescript-eslint/issues/1713)) ([af2c00d](https://github.com/typescript-eslint/typescript-eslint/commit/af2c00de62f7e31eaeb88996ebf3f330cc8473b9)) -* **eslint-plugin:** [explicit-function-return-type] add option to allow concise arrows that start with void ([#1732](https://github.com/typescript-eslint/typescript-eslint/issues/1732)) ([2e9c202](https://github.com/typescript-eslint/typescript-eslint/commit/2e9c2028a8a0b226e0f87d4bcc997fa259ca3ebd)) -* **eslint-plugin:** [explicit-module-boundary-types] add optio… ([#1778](https://github.com/typescript-eslint/typescript-eslint/issues/1778)) ([3eee804](https://github.com/typescript-eslint/typescript-eslint/commit/3eee804461d017ea6189cd7f64fcd473623684b4)) -* **eslint-plugin:** [no-base-to-string] add option to ignore tagged templates ([#1763](https://github.com/typescript-eslint/typescript-eslint/issues/1763)) ([f5edb99](https://github.com/typescript-eslint/typescript-eslint/commit/f5edb9938c33f8b68f026eba00db3abe9359ced3)) -* **eslint-plugin:** [restrict-template-expressions] add option `allowAny` ([#1762](https://github.com/typescript-eslint/typescript-eslint/issues/1762)) ([d44c0f9](https://github.com/typescript-eslint/typescript-eslint/commit/d44c0f9bed2404ca00b020b35fd825929e213398)) -* **eslint-plugin:** add rule `prefer-reduce-type-parameter` ([#1707](https://github.com/typescript-eslint/typescript-eslint/issues/1707)) ([c92d240](https://github.com/typescript-eslint/typescript-eslint/commit/c92d240e49113779053eac32038382b282812afc)) -* **eslint-plugin:** add rule `prefer-ts-expect-error` ([#1705](https://github.com/typescript-eslint/typescript-eslint/issues/1705)) ([7021f21](https://github.com/typescript-eslint/typescript-eslint/commit/7021f2151a25db2a8edf17e06cd6f21e90761ec8)) -* **eslint-plugin:** add rule no-unsafe-assignment ([#1694](https://github.com/typescript-eslint/typescript-eslint/issues/1694)) ([a49b860](https://github.com/typescript-eslint/typescript-eslint/commit/a49b860cbbb2c7d718b99f561e2fb6eaadf16f17)) +- **eslint-plugin:** [array-type] parenthesize ReadonlyArray fix ([#2747](https://github.com/typescript-eslint/typescript-eslint/issues/2747)) ([83385ac](https://github.com/typescript-eslint/typescript-eslint/commit/83385ac351f45d3bcbd19f72711838e9a8473827)) +- **eslint-plugin:** [no-extra-non-null-assertion] false positive with non-nullable computed key ([#2737](https://github.com/typescript-eslint/typescript-eslint/issues/2737)) ([e82698c](https://github.com/typescript-eslint/typescript-eslint/commit/e82698c0ec796e460e40c3dd90a30bd100db05c2)) +### Features +- **eslint-plugin:** add rule `no-confusing-void-expression` ([#2605](https://github.com/typescript-eslint/typescript-eslint/issues/2605)) ([c8a4dad](https://github.com/typescript-eslint/typescript-eslint/commit/c8a4dadeab8a64fb4768deda8f65475435dd2cad)) +- support TS4.1 features ([#2748](https://github.com/typescript-eslint/typescript-eslint/issues/2748)) ([2be354b](https://github.com/typescript-eslint/typescript-eslint/commit/2be354bb15f9013a2da1b13a0c0836e9ef057e16)), closes [#2583](https://github.com/typescript-eslint/typescript-eslint/issues/2583) +## [4.6.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.6.0...v4.6.1) (2020-11-02) +### Bug Fixes -# [2.27.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.26.0...v2.27.0) (2020-04-06) +- **eslint-plugin:** [consistent-indexed-object-style] fix wrong autofix behaviour with generics ([#2722](https://github.com/typescript-eslint/typescript-eslint/issues/2722)) ([73d9713](https://github.com/typescript-eslint/typescript-eslint/commit/73d97130afe79b8a458c215581ce86c62009ad8b)) +- **eslint-plugin:** [no-shadow] ignore global module augmentation ([#2729](https://github.com/typescript-eslint/typescript-eslint/issues/2729)) ([d8c67a5](https://github.com/typescript-eslint/typescript-eslint/commit/d8c67a564a4cada5add8587f655aee2305cbc562)) +# [4.6.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.5.0...v4.6.0) (2020-10-26) ### Bug Fixes -* **eslint-plugin:** [no-throw-literal] fix crash caused by getBaseTypes ([#1830](https://github.com/typescript-eslint/typescript-eslint/issues/1830)) ([9d53c76](https://github.com/typescript-eslint/typescript-eslint/commit/9d53c761983dd964109b9f13eb9bfe20caf9defb)) -* **eslint-plugin:** [no-unsafe-call] fix incorrect selector ([#1826](https://github.com/typescript-eslint/typescript-eslint/issues/1826)) ([8ec53a3](https://github.com/typescript-eslint/typescript-eslint/commit/8ec53a3579fcb59cdffea0c60fbb755d056f4c8a)) -* **eslint-plugin:** [require-await] handle async generators ([#1782](https://github.com/typescript-eslint/typescript-eslint/issues/1782)) ([9642d9d](https://github.com/typescript-eslint/typescript-eslint/commit/9642d9dce693befac89a4e9d8bf8dd18f4361e2a)) -* **eslint-plugin:** no-explicit-any constructor functions (& mo… ([#1711](https://github.com/typescript-eslint/typescript-eslint/issues/1711)) ([ab8572e](https://github.com/typescript-eslint/typescript-eslint/commit/ab8572e30e14ebda91c8437be5ee35e7dc9add2e)) - +- **eslint-plugin:** [method-signature-style] correct fixer for overloads in an object literal type ([#2708](https://github.com/typescript-eslint/typescript-eslint/issues/2708)) ([0763913](https://github.com/typescript-eslint/typescript-eslint/commit/0763913c4a0d1061465ae3329704f1a7de4b9326)) +- **eslint-plugin:** [method-signature-style] don't auto-fix interfaces within namespaces ([#2678](https://github.com/typescript-eslint/typescript-eslint/issues/2678)) ([e012049](https://github.com/typescript-eslint/typescript-eslint/commit/e01204931e460f5e6731abc443c88d666ca0b07a)) +- **eslint-plugin:** [prefer-string-starts-ends-with] Check negative indices in the second position for slice ([#2696](https://github.com/typescript-eslint/typescript-eslint/issues/2696)) ([66e9c6e](https://github.com/typescript-eslint/typescript-eslint/commit/66e9c6e29f9f56bbd178ba6405f47053be591258)) ### Features -* **eslint-plugin:** new rule method-signature-style ([#1685](https://github.com/typescript-eslint/typescript-eslint/issues/1685)) ([c49d771](https://github.com/typescript-eslint/typescript-eslint/commit/c49d771ba62f1a21d3c1aec106341daddfcd3c9a)) -* **eslint-plugin:** sort members alphabetically ([#263](https://github.com/typescript-eslint/typescript-eslint/issues/263)) ([485e902](https://github.com/typescript-eslint/typescript-eslint/commit/485e90213a0f8baac0587f7d56925448883fc5bd)) -* **eslint-plugin-internal:** add plugin-test-formatting rule ([#1821](https://github.com/typescript-eslint/typescript-eslint/issues/1821)) ([9b0023a](https://github.com/typescript-eslint/typescript-eslint/commit/9b0023a4996ecdd7dfcb30abd1678091a78f3064)) +- **eslint-plugin:** [ban-types] support banning `[]` ([#2704](https://github.com/typescript-eslint/typescript-eslint/issues/2704)) ([ef8b5a7](https://github.com/typescript-eslint/typescript-eslint/commit/ef8b5a7e09cca4bdacf205da28f99f2b1a419d00)), closes [#2582](https://github.com/typescript-eslint/typescript-eslint/issues/2582) +- **eslint-plugin:** add `no-unnecessary-type-constraint` rule ([#2516](https://github.com/typescript-eslint/typescript-eslint/issues/2516)) ([880ac75](https://github.com/typescript-eslint/typescript-eslint/commit/880ac753b90d63034f0a33f8f512d9fabc17c8f9)) +- **eslint-plugin:** add extension rule `space-infix-ops` ([#2593](https://github.com/typescript-eslint/typescript-eslint/issues/2593)) ([343d20d](https://github.com/typescript-eslint/typescript-eslint/commit/343d20db23a1640e3bca8cf52b7db1fa46e092e6)) +# [4.5.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.4.1...v4.5.0) (2020-10-19) +### Bug Fixes +- **eslint-plugin:** [array-type] fix issues with readonly option ([#2667](https://github.com/typescript-eslint/typescript-eslint/issues/2667)) ([63d1d81](https://github.com/typescript-eslint/typescript-eslint/commit/63d1d8189c829c6543c7966a864b62c07fbd61a0)) +- **eslint-plugin:** [lines-between-class-members] fix typo in schema ([#2681](https://github.com/typescript-eslint/typescript-eslint/issues/2681)) ([a2a2514](https://github.com/typescript-eslint/typescript-eslint/commit/a2a2514f8a8eee478c8697c4ce42d3c586599b14)) +- **eslint-plugin:** [naming-convention] check bodyless function parameters ([#2675](https://github.com/typescript-eslint/typescript-eslint/issues/2675)) ([c505863](https://github.com/typescript-eslint/typescript-eslint/commit/c505863ac41755383e08893ba0bc4c0fd937eb1d)) +- **eslint-plugin:** [no-invalid-this] allow "this" in class property definitions ([#2685](https://github.com/typescript-eslint/typescript-eslint/issues/2685)) ([dccb6ee](https://github.com/typescript-eslint/typescript-eslint/commit/dccb6ee9f1cd9519c26808d10a5bed8291d0a8e4)) +- **eslint-plugin:** [no-misused-promises] False negative in LogicalExpression ([#2682](https://github.com/typescript-eslint/typescript-eslint/issues/2682)) ([30a6951](https://github.com/typescript-eslint/typescript-eslint/commit/30a695103e99d214fd40847aaa51c1631981c226)), closes [#2544](https://github.com/typescript-eslint/typescript-eslint/issues/2544) +- **eslint-plugin:** [no-unnecessary-type-assertion] correct fixer for vue files ([#2680](https://github.com/typescript-eslint/typescript-eslint/issues/2680)) ([55111af](https://github.com/typescript-eslint/typescript-eslint/commit/55111afd7819d29d65da4f41cc6a129f34aaeb3e)) +- **eslint-plugin:** [return-await] do not auto-fix when type is `any`/`unknown` ([#2671](https://github.com/typescript-eslint/typescript-eslint/issues/2671)) ([d690c8d](https://github.com/typescript-eslint/typescript-eslint/commit/d690c8dff3636d8c8a9a38bd422e0bedbd1d72cb)) +### Features -# [2.26.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.25.0...v2.26.0) (2020-03-30) +- **eslint-plugin:** [dot-notation] add `allowProtectedClassPropertyAccess` option ([#2622](https://github.com/typescript-eslint/typescript-eslint/issues/2622)) ([bbc9e35](https://github.com/typescript-eslint/typescript-eslint/commit/bbc9e3540576891552dc2dc54b2acbc54104be9d)) +- **eslint-plugin:** [prefer-readonly-parameter-types] add `ignoreInferredTypes` option ([#2668](https://github.com/typescript-eslint/typescript-eslint/issues/2668)) ([91010e8](https://github.com/typescript-eslint/typescript-eslint/commit/91010e88258bf47a0438e842c8ddca19e0414b48)) +- **eslint-plugin:** [restrict-plus-operands] add intersection type determination logic ([#2628](https://github.com/typescript-eslint/typescript-eslint/issues/2628)) ([da71362](https://github.com/typescript-eslint/typescript-eslint/commit/da713627c88354229f245866ccf1018fb56b6e53)) +- **typescript-estree:** add flag EXPERIMENTAL_useSourceOfProjectReferenceRedirect ([#2669](https://github.com/typescript-eslint/typescript-eslint/issues/2669)) ([90a5878](https://github.com/typescript-eslint/typescript-eslint/commit/90a587845088da1b205e4d7d77dbc3f9447b1c5a)) +## [4.4.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.4.0...v4.4.1) (2020-10-12) ### Bug Fixes -* **eslint-plugin:** [no-explicit-any] error with ignoreRestArgs ([#1796](https://github.com/typescript-eslint/typescript-eslint/issues/1796)) ([638d84d](https://github.com/typescript-eslint/typescript-eslint/commit/638d84ddd77d07117b3ec7c5431f3b0e44b1995d)) -* **eslint-plugin:** [no-unsafe-call] allow import expressions ([#1800](https://github.com/typescript-eslint/typescript-eslint/issues/1800)) ([4fa7107](https://github.com/typescript-eslint/typescript-eslint/commit/4fa710754ecc412b65ac3864fe0c7857c254ac1b)) -* **eslint-plugin:** [no-unsafe-return] error with unknown ([#2371](https://github.com/typescript-eslint/typescript-eslint/issues/2371)) ([e7528e6](https://github.com/typescript-eslint/typescript-eslint/commit/e7528e686f5fe5cce8504fc15d3cd06b8733712e)) +- **typescript-estree:** support TSv4 labelled tuple members ([#2378](https://github.com/typescript-eslint/typescript-eslint/issues/2378)) ([00d84ff](https://github.com/typescript-eslint/typescript-eslint/commit/00d84ffbcbe9d0ec98bdb2f2ce59959a27ce4dbe)) +# [3.8.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.7.1...v3.8.0) (2020-08-03) +### Bug Fixes +- **eslint-plugin:** [no-implied-eval] don't report when `Function` is imported ([#2348](https://github.com/typescript-eslint/typescript-eslint/issues/2348)) ([fa169e7](https://github.com/typescript-eslint/typescript-eslint/commit/fa169e79661821f0e0e64a56d6db9da42c3c8654)) +- **eslint-plugin:** [no-unsafe-assignment] fix typo in message ([#2347](https://github.com/typescript-eslint/typescript-eslint/issues/2347)) ([2027bb1](https://github.com/typescript-eslint/typescript-eslint/commit/2027bb11689b76c297f93ba8a918b35fe68e5b9d)) +### Features -## [2.19.2](https://github.com/typescript-eslint/typescript-eslint/compare/v2.19.1...v2.19.2) (2020-02-10) +- **eslint-plugin:** [naming-convention] allow specifying an array of selectors ([#2335](https://github.com/typescript-eslint/typescript-eslint/issues/2335)) ([3ef6bd5](https://github.com/typescript-eslint/typescript-eslint/commit/3ef6bd5cadc225e42ef1330d15919a39f53f2a2b)) +- **eslint-plugin:** add `prefer-enum-initializers` rule ([#2326](https://github.com/typescript-eslint/typescript-eslint/issues/2326)) ([4f38ea3](https://github.com/typescript-eslint/typescript-eslint/commit/4f38ea39c97289db11501d6368d01db8c5787257)) -**Note:** Version bump only for package @typescript-eslint/eslint-plugin +## [3.7.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.7.0...v3.7.1) (2020-07-27) +### Bug Fixes +- **eslint-plugin:** [adjacent-overload-signatures] fix false positive on call signatures and a method named `call` ([#2313](https://github.com/typescript-eslint/typescript-eslint/issues/2313)) ([30fafb0](https://github.com/typescript-eslint/typescript-eslint/commit/30fafb09422b3aca881f4785d89b0536092d4952)) +- **eslint-plugin:** [no-extra-parens] stop reporting on calling generic functions with one argument and type parameters containing parentheses ([#2319](https://github.com/typescript-eslint/typescript-eslint/issues/2319)) ([616a841](https://github.com/typescript-eslint/typescript-eslint/commit/616a841032bec310d9f31f1c987888273df27008)) +# [3.7.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.6.1...v3.7.0) (2020-07-20) +### Features -## [2.19.1](https://github.com/typescript-eslint/typescript-eslint/compare/v2.19.0...v2.19.1) (2020-02-10) +- **eslint-plugin:** [naming-convention] allow selecting only `const` variables ([#2291](https://github.com/typescript-eslint/typescript-eslint/issues/2291)) ([156d058](https://github.com/typescript-eslint/typescript-eslint/commit/156d058fee835fdf1ed827a5ad4a80d57190cc54)) +- **eslint-plugin:** [no-empty-function] add `decoratedFunctions` option ([#2295](https://github.com/typescript-eslint/typescript-eslint/issues/2295)) ([88f08f4](https://github.com/typescript-eslint/typescript-eslint/commit/88f08f410760f58fdc2de58ecd9dab9610821642)) +## [3.6.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.6.0...v3.6.1) (2020-07-13) ### Bug Fixes -* **eslint-plugin:** [unbound-method] blacklist a few unbound natives ([#1562](https://github.com/typescript-eslint/typescript-eslint/issues/1562)) ([4670aab](https://github.com/typescript-eslint/typescript-eslint/commit/4670aabef31d9017ad302f206b9c2f18d53c8ee4)) +- **eslint-plugin:** [no-unnecessary-condition] handle computed member access ([#2288](https://github.com/typescript-eslint/typescript-eslint/issues/2288)) ([3a187ca](https://github.com/typescript-eslint/typescript-eslint/commit/3a187cafb7302a3c05de0e6a236dd142a5e2d741)) +- **eslint-plugin:** [prefer-literal-enum-member] allow negative numbers ([#2277](https://github.com/typescript-eslint/typescript-eslint/issues/2277)) ([00ac9c3](https://github.com/typescript-eslint/typescript-eslint/commit/00ac9c3ccaad27bab08ec3c3a104f612bb593df5)) +- **eslint-plugin:** [space-before-function-paren] incorrect handling of abstract methods ([#2275](https://github.com/typescript-eslint/typescript-eslint/issues/2275)) ([ced6591](https://github.com/typescript-eslint/typescript-eslint/commit/ced65918b16f46c383496a9b4bd43eca8a76baf6)), closes [#2274](https://github.com/typescript-eslint/typescript-eslint/issues/2274) +- **eslint-plugin:** [switch-exhaustiveness-check] handle special characters in enum keys ([#2207](https://github.com/typescript-eslint/typescript-eslint/issues/2207)) ([98ab010](https://github.com/typescript-eslint/typescript-eslint/commit/98ab010fb7fca884984bb4200fd806ecee8071b6)) +# [3.6.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.5.0...v3.6.0) (2020-07-06) +### Bug Fixes +- **eslint-plugin:** [no-namespace] allow namespaces in nested declarations with `allowDeclarations` ([#2238](https://github.com/typescript-eslint/typescript-eslint/issues/2238)) ([c1df669](https://github.com/typescript-eslint/typescript-eslint/commit/c1df6694f7866d3ef7ede0b1c6c9dd6f3955e682)) +- **eslint-plugin:** [space-before-function-paren] handle abstract functions ([#2199](https://github.com/typescript-eslint/typescript-eslint/issues/2199)) ([88a3edf](https://github.com/typescript-eslint/typescript-eslint/commit/88a3edfce8349f871b7b660d2b76508b67c94eda)) +### Features -# [2.19.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.18.0...v2.19.0) (2020-02-03) +- **eslint-plugin:** add rule `prefer-literal-enum-member` ([#1898](https://github.com/typescript-eslint/typescript-eslint/issues/1898)) ([fe2b2ec](https://github.com/typescript-eslint/typescript-eslint/commit/fe2b2ec39ef04ac8b73eef9d29d12fd1b24fa183)) +# [3.5.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.4.0...v3.5.0) (2020-06-29) ### Bug Fixes -* **eslint-plugin:** [embt] fix allowTypedFunctionExpressions ([#1553](https://github.com/typescript-eslint/typescript-eslint/issues/1553)) ([9e7d161](https://github.com/typescript-eslint/typescript-eslint/commit/9e7d1616d78a0f94521f4e6d4b48344e5df2d9f7)) -* **eslint-plugin:** [require-await] improve performance ([#1536](https://github.com/typescript-eslint/typescript-eslint/issues/1536)) ([45ae0b9](https://github.com/typescript-eslint/typescript-eslint/commit/45ae0b9565ee6e9d01e82107d85ad7151a15af7b)) - +- **eslint-plugin:** [naming-convention] support unicode in regex ([#2241](https://github.com/typescript-eslint/typescript-eslint/issues/2241)) ([5fdd21a](https://github.com/typescript-eslint/typescript-eslint/commit/5fdd21a1726fb6928098c4152aec55a30df960d4)) ### Features -* **eslint-plugin:** [no-extra-non-null-assert] add fixer ([#1468](https://github.com/typescript-eslint/typescript-eslint/issues/1468)) ([54201ab](https://github.com/typescript-eslint/typescript-eslint/commit/54201aba37b2865c0ba4981be79d1fd989806133)) -* **eslint-plugin:** [no-float-prom] fixer + msg for ignoreVoid ([#1473](https://github.com/typescript-eslint/typescript-eslint/issues/1473)) ([159b16e](https://github.com/typescript-eslint/typescript-eslint/commit/159b16ec3a66f05478080c397df5c3f6e29535e4)) -* **eslint-plugin:** [unbound-method] support bound builtins ([#1526](https://github.com/typescript-eslint/typescript-eslint/issues/1526)) ([0a110eb](https://github.com/typescript-eslint/typescript-eslint/commit/0a110eb680749c8c4a2a3dc1375c1a83056e4c14)) -* **eslint-plugin:** add extension [no-dupe-class-members] ([#1492](https://github.com/typescript-eslint/typescript-eslint/issues/1492)) ([b22424e](https://github.com/typescript-eslint/typescript-eslint/commit/b22424e7d4a16042a027557f44e9191e0722b38b)) -* **eslint-plugin:** add no-unnecessary-boolean-literal-compare ([#242](https://github.com/typescript-eslint/typescript-eslint/issues/242)) ([6bebb1d](https://github.com/typescript-eslint/typescript-eslint/commit/6bebb1dc47897ee0e1f075d7e5dd89d8b0590f31)) -* **eslint-plugin:** add switch-exhaustiveness-check rule ([#972](https://github.com/typescript-eslint/typescript-eslint/issues/972)) ([9e0f6dd](https://github.com/typescript-eslint/typescript-eslint/commit/9e0f6ddef7cd29f355f398c90f1986e51c4854f7)) -* **eslint-plugin:** support negative matches for `filter` ([#1517](https://github.com/typescript-eslint/typescript-eslint/issues/1517)) ([b24fbe8](https://github.com/typescript-eslint/typescript-eslint/commit/b24fbe8790b540998e4085174251fb4d61bf96b0)) +- add package scope-manager ([#1939](https://github.com/typescript-eslint/typescript-eslint/issues/1939)) ([682eb7e](https://github.com/typescript-eslint/typescript-eslint/commit/682eb7e009c3f22a542882dfd3602196a60d2a1e)) +# [3.4.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.3.0...v3.4.0) (2020-06-22) +### Bug Fixes +- **eslint-plugin:** [no-base-to-string] handle intersection types ([#2170](https://github.com/typescript-eslint/typescript-eslint/issues/2170)) ([9cca3a9](https://github.com/typescript-eslint/typescript-eslint/commit/9cca3a9584d5d5ef0536219c5a734f4e87efb543)) +- **eslint-plugin:** [unbound-method] handling destructuring ([#2228](https://github.com/typescript-eslint/typescript-eslint/issues/2228)) ([c3753c2](https://github.com/typescript-eslint/typescript-eslint/commit/c3753c21768d355ecdb9e7ae8e0bfdfbbc1d3bbe)) +### Features -# [2.18.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.17.0...v2.18.0) (2020-01-27) +- **eslint-plugin:** [no-unnecessary-boolean-literal-compare] add option to check nullable booleans ([#1983](https://github.com/typescript-eslint/typescript-eslint/issues/1983)) ([c0b3057](https://github.com/typescript-eslint/typescript-eslint/commit/c0b3057b7f7d515891ad2efe32e4ef8c01e0478f)) +- **eslint-plugin:** add extension rule `no-loss-of-precision` ([#2196](https://github.com/typescript-eslint/typescript-eslint/issues/2196)) ([535b0f2](https://github.com/typescript-eslint/typescript-eslint/commit/535b0f2ddd82efa6a2c40307a61c480f4b3cdea3)) +# [3.3.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.2.0...v3.3.0) (2020-06-15) ### Bug Fixes -* **eslint-plugin:** [explicit-module-boundary-types] false positive for returned fns ([#1490](https://github.com/typescript-eslint/typescript-eslint/issues/1490)) ([5562ad5](https://github.com/typescript-eslint/typescript-eslint/commit/5562ad5ed902102d7c09a7fd47ca4ea7e50d6654)) -* improve token types and add missing type guards ([#1497](https://github.com/typescript-eslint/typescript-eslint/issues/1497)) ([ce41d7d](https://github.com/typescript-eslint/typescript-eslint/commit/ce41d7de33bcb7ccf96c03ac1438304c5a49ff54)) -* **eslint-plugin:** [naming-convention] fix filter option ([#1482](https://github.com/typescript-eslint/typescript-eslint/issues/1482)) ([718cd88](https://github.com/typescript-eslint/typescript-eslint/commit/718cd889c155a75413c571ac006c33fbc271dcc5)) -* **eslint-plugin:** fix property access on undefined error ([#1507](https://github.com/typescript-eslint/typescript-eslint/issues/1507)) ([d89e8e8](https://github.com/typescript-eslint/typescript-eslint/commit/d89e8e8a1114989e2727351bee7aadb6579f312b)) - +- **eslint-plugin:** [no-unused-expressions] handle ternary and short-circuit options ([#2194](https://github.com/typescript-eslint/typescript-eslint/issues/2194)) ([ee9f100](https://github.com/typescript-eslint/typescript-eslint/commit/ee9f100a2f9a874c2b361482742686eeaa9bdac7)) ### Features -* **eslint-plugin:** add comma-spacing ([#1495](https://github.com/typescript-eslint/typescript-eslint/issues/1495)) ([1fd86be](https://github.com/typescript-eslint/typescript-eslint/commit/1fd86befa6a940a0354c619dd2da08a5c5d69fb4)) -* **eslint-plugin:** add new rule prefer-as-const ([#1431](https://github.com/typescript-eslint/typescript-eslint/issues/1431)) ([420db96](https://github.com/typescript-eslint/typescript-eslint/commit/420db96921435e8bf7fb484ae74552a912a6adde)) -* **eslint-plugin:** create `ban-ts-comment` rule ([#1361](https://github.com/typescript-eslint/typescript-eslint/issues/1361)) ([2a83d13](https://github.com/typescript-eslint/typescript-eslint/commit/2a83d138a966cd5ce787d1eecf595b59b78232d4)) -* **experimental-utils:** make RuleMetaData.docs optional ([#1462](https://github.com/typescript-eslint/typescript-eslint/issues/1462)) ([cde97ac](https://github.com/typescript-eslint/typescript-eslint/commit/cde97aca24df5a0f28f37006ed130ebc217fb2ad)) +- **eslint-plugin:** [naming-convention] better error message and docs for prefix/suffix ([#2195](https://github.com/typescript-eslint/typescript-eslint/issues/2195)) ([a2ffe55](https://github.com/typescript-eslint/typescript-eslint/commit/a2ffe5568df0f7224bfe9141d298e538383d5f09)) +# [3.2.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.1.0...v3.2.0) (2020-06-08) +### Bug Fixes +- **eslint-plugin:** [explicit-module-boundary-types] dont report return type errors on constructor overloads ([#2158](https://github.com/typescript-eslint/typescript-eslint/issues/2158)) ([53232d7](https://github.com/typescript-eslint/typescript-eslint/commit/53232d775ca0b808e2d75d9501f4411a868b2b48)) +- **eslint-plugin:** [explicit-module-boundary-types] handle bodyless arrow functions with explicit return types that return functions ([#2169](https://github.com/typescript-eslint/typescript-eslint/issues/2169)) ([58db655](https://github.com/typescript-eslint/typescript-eslint/commit/58db655133aaae006efe3e3ceee971cf88dc348f)) +- **eslint-plugin:** [explicit-module-boundary-types] handle nested functions and functions expressions in a typed variable declaration ([#2176](https://github.com/typescript-eslint/typescript-eslint/issues/2176)) ([6ff450d](https://github.com/typescript-eslint/typescript-eslint/commit/6ff450da3abec93223a33f6b52484c9ca99b7abe)) +- **eslint-plugin:** [no-extra-non-null-assertion] dont report for assertions not followed by the optional chain ([#2167](https://github.com/typescript-eslint/typescript-eslint/issues/2167)) ([e4c1834](https://github.com/typescript-eslint/typescript-eslint/commit/e4c1834c7c5934332dd1d58c09018453568c4889)) +- **eslint-plugin:** [no-unnecessary-conditionals] Handle comparison of generics and loose comparisons with undefined values ([#2152](https://github.com/typescript-eslint/typescript-eslint/issues/2152)) ([c86e2a2](https://github.com/typescript-eslint/typescript-eslint/commit/c86e2a235372149db9b1700d39c2145e0ce5221a)) +- **eslint-plugin:** [prefer-optional-chain] handling first member expression ([#2156](https://github.com/typescript-eslint/typescript-eslint/issues/2156)) ([de18660](https://github.com/typescript-eslint/typescript-eslint/commit/de18660a8cf8f7033798646d8c5b0938d1accb12)) +- **eslint-plugin:** [return-await] correct handling of ternaries ([#2168](https://github.com/typescript-eslint/typescript-eslint/issues/2168)) ([fe4c0bf](https://github.com/typescript-eslint/typescript-eslint/commit/fe4c0bf8c04f070d6642fbe86c5e5614bc88e8fd)) +### Features -# [2.17.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.16.0...v2.17.0) (2020-01-20) +- **eslint-plugin:** [naming-convention] put identifiers in quotes in error messages ([#2182](https://github.com/typescript-eslint/typescript-eslint/issues/2182)) ([fc61932](https://github.com/typescript-eslint/typescript-eslint/commit/fc619326eedf7ef2efa51444ecdead81a36a204f)), closes [#2178](https://github.com/typescript-eslint/typescript-eslint/issues/2178) +- **eslint-plugin:** [require-array-sort-compare] add `ignoreStringArrays` option ([#1972](https://github.com/typescript-eslint/typescript-eslint/issues/1972)) ([6dee784](https://github.com/typescript-eslint/typescript-eslint/commit/6dee7840a3af1dfe4c38a128d1c4655bdac625df)) +- **eslint-plugin:** add rule `ban-tslint-comment` ([#2140](https://github.com/typescript-eslint/typescript-eslint/issues/2140)) ([43ee226](https://github.com/typescript-eslint/typescript-eslint/commit/43ee226ffbaaa3e7126081db9476c24b89ec16e9)) +- **eslint-plugin:** add rule `no-confusing-non-null-assertion` ([#1941](https://github.com/typescript-eslint/typescript-eslint/issues/1941)) ([9b51c44](https://github.com/typescript-eslint/typescript-eslint/commit/9b51c44f29d8b3e95a510985544e8ded8a14404d)) +# [3.1.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.0.2...v3.1.0) (2020-06-01) ### Bug Fixes -* **eslint-plugin:** [naming-convention] handle empty array-pattern ([#1450](https://github.com/typescript-eslint/typescript-eslint/issues/1450)) ([4726605](https://github.com/typescript-eslint/typescript-eslint/commit/4726605)) -* **eslint-plugin:** [unbound-method] handling of logical expr ([#1440](https://github.com/typescript-eslint/typescript-eslint/issues/1440)) ([9c5b857](https://github.com/typescript-eslint/typescript-eslint/commit/9c5b857)) -* **eslint-plugin:** set default-param-last as an extension rule ([#1445](https://github.com/typescript-eslint/typescript-eslint/issues/1445)) ([b5ef704](https://github.com/typescript-eslint/typescript-eslint/commit/b5ef704)) -* **typescript-estree:** correct type of `ArrayPattern.elements` ([#1451](https://github.com/typescript-eslint/typescript-eslint/issues/1451)) ([62e4ca0](https://github.com/typescript-eslint/typescript-eslint/commit/62e4ca0)) - +- **eslint-plugin:** [explicit-module-boundary-types] don't check returned functions if parent function has return type ([#2084](https://github.com/typescript-eslint/typescript-eslint/issues/2084)) ([d7d4eeb](https://github.com/typescript-eslint/typescript-eslint/commit/d7d4eeb03f2918d5d9e361fdb47c2d42e83bd593)) +- **eslint-plugin:** [no-unnecessary-condition] handle comparison of any, unknown and loose comparisons with nullish values ([#2123](https://github.com/typescript-eslint/typescript-eslint/issues/2123)) ([1ae1d01](https://github.com/typescript-eslint/typescript-eslint/commit/1ae1d01e5603ec7cef8051ed018c3c3c88b29867)) +- **eslint-plugin:** [no-unnecessary-condition] improve optional chain handling ([#2111](https://github.com/typescript-eslint/typescript-eslint/issues/2111)) ([9ee399b](https://github.com/typescript-eslint/typescript-eslint/commit/9ee399b5906e82f346ff89141207a6630786de54)) +- **eslint-plugin:** [no-unnecessary-condition] improve optional chain handling 2 - electric boogaloo ([#2138](https://github.com/typescript-eslint/typescript-eslint/issues/2138)) ([c87cfaf](https://github.com/typescript-eslint/typescript-eslint/commit/c87cfaf6746775bb8ad9eb45b0002f068a822dbe)) +- **eslint-plugin:** [no-unused-expressions] ignore import expressions ([#2130](https://github.com/typescript-eslint/typescript-eslint/issues/2130)) ([e383691](https://github.com/typescript-eslint/typescript-eslint/commit/e3836910efdafd9edf04daed149c9e839c08047e)) +- **eslint-plugin:** [no-var-requires] false negative for TSAsExpression and MemberExpression ([#2139](https://github.com/typescript-eslint/typescript-eslint/issues/2139)) ([df95338](https://github.com/typescript-eslint/typescript-eslint/commit/df953388913b22d45242e65ce231d92a8b8a0080)) +- **experimental-utils:** downlevel type declarations for versions older than 3.8 ([#2133](https://github.com/typescript-eslint/typescript-eslint/issues/2133)) ([7925823](https://github.com/typescript-eslint/typescript-eslint/commit/792582326a8065270b69a0ffcaad5a7b4b103ff3)) ### Features -* **eslint-plugin:** [naming-convention] allow not check format ([#1455](https://github.com/typescript-eslint/typescript-eslint/issues/1455)) ([61eb434](https://github.com/typescript-eslint/typescript-eslint/commit/61eb434)) -* **eslint-plugin:** [naming-convention] correct example ([#1455](https://github.com/typescript-eslint/typescript-eslint/issues/1455)) ([60683d7](https://github.com/typescript-eslint/typescript-eslint/commit/60683d7)) -* **eslint-plugin:** [no-extra-!-assert] flag ?. after !-assert ([#1460](https://github.com/typescript-eslint/typescript-eslint/issues/1460)) ([58c7c25](https://github.com/typescript-eslint/typescript-eslint/commit/58c7c25)) -* **eslint-plugin:** add explicit-module-boundary-types rule ([#1020](https://github.com/typescript-eslint/typescript-eslint/issues/1020)) ([bb0a846](https://github.com/typescript-eslint/typescript-eslint/commit/bb0a846)) -* **eslint-plugin:** add no-non-null-asserted-optional-chain ([#1469](https://github.com/typescript-eslint/typescript-eslint/issues/1469)) ([498aa24](https://github.com/typescript-eslint/typescript-eslint/commit/498aa24)) -* **experimental-utils:** expose getParserServices from utils ([#1448](https://github.com/typescript-eslint/typescript-eslint/issues/1448)) ([982c8bc](https://github.com/typescript-eslint/typescript-eslint/commit/982c8bc)) +- **eslint-plugin:** [ban-ts-comments] add "allow-with-description" option ([#2099](https://github.com/typescript-eslint/typescript-eslint/issues/2099)) ([8a0fd18](https://github.com/typescript-eslint/typescript-eslint/commit/8a0fd1899f544470a35afb3117f4c71aad7e4e42)) +- **eslint-plugin:** [ban-types] allow selective disable of default options with `false` value ([#2137](https://github.com/typescript-eslint/typescript-eslint/issues/2137)) ([1cb8ca4](https://github.com/typescript-eslint/typescript-eslint/commit/1cb8ca483d029935310e6904580df8501837084d)) +- **eslint-plugin:** [explicit-module-boundary-types] improve accuracy and coverage ([#2135](https://github.com/typescript-eslint/typescript-eslint/issues/2135)) ([caaa859](https://github.com/typescript-eslint/typescript-eslint/commit/caaa8599284d02ab3341e282cad35a52d0fb86c7)) + +## [3.0.2](https://github.com/typescript-eslint/typescript-eslint/compare/v3.0.1...v3.0.2) (2020-05-27) +**Note:** Version bump only for package @typescript-eslint/eslint-plugin +## [3.0.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.0.0...v3.0.1) (2020-05-25) +### Bug Fixes +- **eslint-plugin:** [naming-convention] handle no options correctly ([#2095](https://github.com/typescript-eslint/typescript-eslint/issues/2095)) ([fd7d02b](https://github.com/typescript-eslint/typescript-eslint/commit/fd7d02b31ebd995b7fdd857d7c054042aa4f2001)) +- **eslint-plugin:** [no-throw-literal] handle intersection and union types ([#2085](https://github.com/typescript-eslint/typescript-eslint/issues/2085)) ([cae037f](https://github.com/typescript-eslint/typescript-eslint/commit/cae037ff9b20363b970cc600a09505b98bf10a14)) +- **eslint-plugin:** [unbound-method] fix crash due to missing `Intl` ([#2090](https://github.com/typescript-eslint/typescript-eslint/issues/2090)) ([f2fa82c](https://github.com/typescript-eslint/typescript-eslint/commit/f2fa82c532ae858ccfb064268cfcc9df657a54be)) -# [2.16.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.15.0...v2.16.0) (2020-01-13) +# [3.0.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.34.0...v3.0.0) (2020-05-21) +## [Please see the release notes for v3.0.0](https://github.com/typescript-eslint/typescript-eslint/releases/tag/v3.0.0) ### Bug Fixes -* **eslint-plugin:** [no-magic-numbers] handle UnaryExpression for enums ([#1415](https://github.com/typescript-eslint/typescript-eslint/issues/1415)) ([852fc31](https://github.com/typescript-eslint/typescript-eslint/commit/852fc31)) -* **eslint-plugin:** [no-unnec-type-assert] handle JSX attributes ([#1002](https://github.com/typescript-eslint/typescript-eslint/issues/1002)) ([3c5659b](https://github.com/typescript-eslint/typescript-eslint/commit/3c5659b)) -* **eslint-plugin:** handle error classes using generics ([#1428](https://github.com/typescript-eslint/typescript-eslint/issues/1428)) ([b139540](https://github.com/typescript-eslint/typescript-eslint/commit/b139540)) -* **typescript-estree:** resolve path relative to tsconfigRootDir ([#1439](https://github.com/typescript-eslint/typescript-eslint/issues/1439)) ([c709056](https://github.com/typescript-eslint/typescript-eslint/commit/c709056)) +- **eslint-plugin:** [dot-notation] fix typo in schema ([#2040](https://github.com/typescript-eslint/typescript-eslint/issues/2040)) ([242328f](https://github.com/typescript-eslint/typescript-eslint/commit/242328fa749ee4c72af93433a9bef95f329ac62f)) +- **eslint-plugin:** correct parser peerDep version ([fe59f69](https://github.com/typescript-eslint/typescript-eslint/commit/fe59f69381a0915a4f5135e2e88637a5eea246ba)) +- **experimental-utils:** add back SourceCode.isSpaceBetweenTokens ([ae82ea4](https://github.com/typescript-eslint/typescript-eslint/commit/ae82ea4a85a4ca332ebe6104e96c59dba30411be)) +- **typescript-estree:** remove now defunct `Import` node type ([f199cbd](https://github.com/typescript-eslint/typescript-eslint/commit/f199cbdbbd892b5ba03bfff66f463f3d9c92ee9b)) +- **typescript-estree:** use `TSEmptyBodyFunctionExpression` for body-less nodes ([#1289](https://github.com/typescript-eslint/typescript-eslint/issues/1289)) ([82e7163](https://github.com/typescript-eslint/typescript-eslint/commit/82e7163214b56ccde93ba97807b161669a50a60b)) + +### Features + +- **eslint-plugin:** [ban-types] rework default options ([#848](https://github.com/typescript-eslint/typescript-eslint/issues/848)) ([8e31d5d](https://github.com/typescript-eslint/typescript-eslint/commit/8e31d5dbe9fe5227fdbefcecfd50ce5dd51360c3)) +- **eslint-plugin:** [no-floating-promises] ignore void operator by default ([#2003](https://github.com/typescript-eslint/typescript-eslint/issues/2003)) ([3626a67](https://github.com/typescript-eslint/typescript-eslint/commit/3626a673cf8117cc995245cd86e466e2553e9b0e)) +- **eslint-plugin:** [prefer-nullish-coalescing][prefer-optional-chain] remove unsafe fixers ([52b6085](https://github.com/typescript-eslint/typescript-eslint/commit/52b60852d0ba6bb6abe519c9d3ec1b231793e91d)) +- **experimental-utils:** upgrade eslint types for v7 ([#2023](https://github.com/typescript-eslint/typescript-eslint/issues/2023)) ([06869c9](https://github.com/typescript-eslint/typescript-eslint/commit/06869c9656fa37936126666845aee40aad546ebd)) +- upgrade to ESLint v7 ([#2022](https://github.com/typescript-eslint/typescript-eslint/issues/2022)) ([208de71](https://github.com/typescript-eslint/typescript-eslint/commit/208de71059746bf38e94bd460346ffb2698a3e12)) +- **eslint-plugin:** [no-unnecessary-condition] remove `checkArrayPredicates` and always check it ([#1579](https://github.com/typescript-eslint/typescript-eslint/issues/1579)) ([bfd9b60](https://github.com/typescript-eslint/typescript-eslint/commit/bfd9b606d17d30d5694967a1f01e0e1501ba1022)) +- **eslint-plugin:** [no-unnecessary-condition] remove option `ignoreRHS` ([#1163](https://github.com/typescript-eslint/typescript-eslint/issues/1163)) ([ee8dd8f](https://github.com/typescript-eslint/typescript-eslint/commit/ee8dd8f8a9e6c25ac426ce9bb71c5f012c51f264)) +- **eslint-plugin:** [no-unnecessary-condition] report when non-nullish is compared to `null`/`undefined` ([#1659](https://github.com/typescript-eslint/typescript-eslint/issues/1659)) ([7fa9060](https://github.com/typescript-eslint/typescript-eslint/commit/7fa906073903c5eb70609c25f1a91ada14dcdc71)) +- **eslint-plugin:** [restrict-template-expressions] `allowNumber: true` by default ([#2005](https://github.com/typescript-eslint/typescript-eslint/issues/2005)) ([643ec24](https://github.com/typescript-eslint/typescript-eslint/commit/643ec240bd901295d9e9ea5c43fc20109c33e982)) +- **eslint-plugin:** [restrict-template-expressions] rename `allowNullable` to `allowNullish` ([#2006](https://github.com/typescript-eslint/typescript-eslint/issues/2006)) ([264b017](https://github.com/typescript-eslint/typescript-eslint/commit/264b017c11c2ab132fcbad18b42a9a0fe639386e)) +- **eslint-plugin:** [strict-boolean-expression] rework options ([#1631](https://github.com/typescript-eslint/typescript-eslint/issues/1631)) ([cd14482](https://github.com/typescript-eslint/typescript-eslint/commit/cd1448240dca11762fcb9c10e18bb6541a840485)) +- **eslint-plugin:** delete deprecated rules ([#2002](https://github.com/typescript-eslint/typescript-eslint/issues/2002)) ([da0aec2](https://github.com/typescript-eslint/typescript-eslint/commit/da0aec2cfa27902aae7c438a2fe91343c822e4ae)) +- **eslint-plugin:** eslint-recommended: disable no-func-assign ([#984](https://github.com/typescript-eslint/typescript-eslint/issues/984)) ([ae9b8a9](https://github.com/typescript-eslint/typescript-eslint/commit/ae9b8a9c73c0328287de956466257d8bbfbdb20f)) +- **eslint-plugin:** eslint-recommended: disable no-obj-calls ([#1000](https://github.com/typescript-eslint/typescript-eslint/issues/1000)) ([b9ca14c](https://github.com/typescript-eslint/typescript-eslint/commit/b9ca14c5f5ec28a3fde1a9b2d2f6a4dc74d903e4)) +- **eslint-plugin:** update `eslint-recommended` set ([#1996](https://github.com/typescript-eslint/typescript-eslint/issues/1996)) ([9a96e18](https://github.com/typescript-eslint/typescript-eslint/commit/9a96e18400e0a0d738d159d9d01faf41d3586249)) +- **eslint-plugin:** update recommended sets ([#2001](https://github.com/typescript-eslint/typescript-eslint/issues/2001)) ([0126b4f](https://github.com/typescript-eslint/typescript-eslint/commit/0126b4f56f9197d561e90b09962ccceb4f88bc41)) +- **typescript-estree:** align nodes with estree 2020 ([#1389](https://github.com/typescript-eslint/typescript-eslint/issues/1389)) ([aff5b62](https://github.com/typescript-eslint/typescript-eslint/commit/aff5b62044f9b93f2087a1d261e9be3f8d6fd54d)) +- drop support for node v8 ([#1997](https://github.com/typescript-eslint/typescript-eslint/issues/1997)) ([b6c3b7b](https://github.com/typescript-eslint/typescript-eslint/commit/b6c3b7b84b8d199fa75a46432febd4a364a63217)) +- **typescript-estree:** always return parserServices ([#716](https://github.com/typescript-eslint/typescript-eslint/issues/716)) ([5b23443](https://github.com/typescript-eslint/typescript-eslint/commit/5b23443c48f3f62424db3e742243f3568080b946)) +- **typescript-estree:** handle 3.9's non-null assertion changes ([#2036](https://github.com/typescript-eslint/typescript-eslint/issues/2036)) ([06bec63](https://github.com/typescript-eslint/typescript-eslint/commit/06bec63c56536db070608ab136d2ad57083f0c6a)) +# [2.34.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.33.0...v2.34.0) (2020-05-18) ### Features -* **eslint-plugin:** [no-unnec-cond] array predicate callbacks ([#1206](https://github.com/typescript-eslint/typescript-eslint/issues/1206)) ([f7ad716](https://github.com/typescript-eslint/typescript-eslint/commit/f7ad716)) -* **eslint-plugin:** add default-param-last rule ([#1418](https://github.com/typescript-eslint/typescript-eslint/issues/1418)) ([a37ff9f](https://github.com/typescript-eslint/typescript-eslint/commit/a37ff9f)) -* **eslint-plugin:** add rule naming-conventions ([#1318](https://github.com/typescript-eslint/typescript-eslint/issues/1318)) ([9eab26f](https://github.com/typescript-eslint/typescript-eslint/commit/9eab26f)) -* **typescript-estree:** add strict type mapping to esTreeNodeToTSNodeMap ([#1382](https://github.com/typescript-eslint/typescript-eslint/issues/1382)) ([d3d70a3](https://github.com/typescript-eslint/typescript-eslint/commit/d3d70a3)) - - +- **eslint-plugin:** [no-invalid-void-type] allow union of void and `allowInGenericTypeArguments` ([#1960](https://github.com/typescript-eslint/typescript-eslint/issues/1960)) ([1bc105a](https://github.com/typescript-eslint/typescript-eslint/commit/1bc105a2c6ae3fde9596f0419fed0de699dc57c7)) +- **eslint-plugin:** [restrict-template-expressions] improve error message ([#1926](https://github.com/typescript-eslint/typescript-eslint/issues/1926)) ([1af59ba](https://github.com/typescript-eslint/typescript-eslint/commit/1af59ba8ac0ceabb008d9c61556acf7db0a1d352)) +- **experimental-utils:** add `suggestion` property for rule modules ([#2033](https://github.com/typescript-eslint/typescript-eslint/issues/2033)) ([f42a5b0](https://github.com/typescript-eslint/typescript-eslint/commit/f42a5b09ebfa173f418a99c552b0cbe221567194)) +# [2.33.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.32.0...v2.33.0) (2020-05-12) +### Features -# [2.15.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.14.0...v2.15.0) (2020-01-06) +- **eslint-plugin:** add extension rule `lines-between-class-members` ([#1684](https://github.com/typescript-eslint/typescript-eslint/issues/1684)) ([08f93e6](https://github.com/typescript-eslint/typescript-eslint/commit/08f93e69347a8e7f3a7e8a1455bb5d069c2faeef)) +# [2.32.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.31.0...v2.32.0) (2020-05-11) ### Bug Fixes -* **eslint-plugin:** crash in no-unnecessary-type-arguments ([#1401](https://github.com/typescript-eslint/typescript-eslint/issues/1401)) ([01c939f](https://github.com/typescript-eslint/typescript-eslint/commit/01c939f)) - +- **eslint-plugin:** [no-base-to-string] support boolean in unions ([#1979](https://github.com/typescript-eslint/typescript-eslint/issues/1979)) ([6987ecc](https://github.com/typescript-eslint/typescript-eslint/commit/6987ecc1dacfb45c0f8ed3e81d08aa708eb96ad1)) +- **eslint-plugin:** [no-type-alias] handle readonly types in aliases ([#1990](https://github.com/typescript-eslint/typescript-eslint/issues/1990)) ([56d9870](https://github.com/typescript-eslint/typescript-eslint/commit/56d987070f83d1b6410b04750b20a761fd793073)) +- **eslint-plugin:** [no-unused-expressions] inherit `messages` from base rule ([#1992](https://github.com/typescript-eslint/typescript-eslint/issues/1992)) ([51ca404](https://github.com/typescript-eslint/typescript-eslint/commit/51ca404af645eed194269ab7f8f67b97bd52e32d)) ### Features -* **eslint-plugin:** [strict-bool-expr] add allowSafe option ([#1385](https://github.com/typescript-eslint/typescript-eslint/issues/1385)) ([9344233](https://github.com/typescript-eslint/typescript-eslint/commit/9344233)) -* **eslint-plugin:** add no-implied-eval ([#1375](https://github.com/typescript-eslint/typescript-eslint/issues/1375)) ([254d276](https://github.com/typescript-eslint/typescript-eslint/commit/254d276)) +- bump dependencies and align AST ([#2007](https://github.com/typescript-eslint/typescript-eslint/issues/2007)) ([18668b7](https://github.com/typescript-eslint/typescript-eslint/commit/18668b78fd7d1e5281af7fc26c76e0ca53297f69)) +# [2.31.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.30.0...v2.31.0) (2020-05-04) +### Bug Fixes +- **eslint-plugin:** [dot-notation] handle missing declarations ([#1947](https://github.com/typescript-eslint/typescript-eslint/issues/1947)) ([383f931](https://github.com/typescript-eslint/typescript-eslint/commit/383f93182599c00e231a0f0d36575ca0e19369a6)) +- **eslint-plugin:** [method-signature-style] fix overloaded methods to an intersection type ([#1966](https://github.com/typescript-eslint/typescript-eslint/issues/1966)) ([7f3fba3](https://github.com/typescript-eslint/typescript-eslint/commit/7f3fba348d432d7637e1c737df943ee1f9105062)) +- **eslint-plugin:** [return-await] await in a normal function ([#1962](https://github.com/typescript-eslint/typescript-eslint/issues/1962)) ([f82fd7b](https://github.com/typescript-eslint/typescript-eslint/commit/f82fd7bb81f986c4861d0b4e2ecdb0c496d7a602)) +- **eslint-plugin:** [unbound-method] false positives for unary expressions ([#1964](https://github.com/typescript-eslint/typescript-eslint/issues/1964)) ([b35070e](https://github.com/typescript-eslint/typescript-eslint/commit/b35070ec6f84ad5ce606386cdb6eeb91488dfdd7)) +- **eslint-plugin:** no-base-to-string boolean expression detect ([#1969](https://github.com/typescript-eslint/typescript-eslint/issues/1969)) ([f78f13a](https://github.com/typescript-eslint/typescript-eslint/commit/f78f13aedd59d5b5880903d48c779a6c50fd937e)) +### Features -# [2.14.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.13.0...v2.14.0) (2019-12-30) +- **eslint-plugin:** [member-ordering] add decorators support ([#1870](https://github.com/typescript-eslint/typescript-eslint/issues/1870)) ([f7ec192](https://github.com/typescript-eslint/typescript-eslint/commit/f7ec1920607cb8eec8020b08cd7247de0bf19ce1)) +- **eslint-plugin:** [prefer-optional-chain] added option to convert to suggestion fixer ([#1965](https://github.com/typescript-eslint/typescript-eslint/issues/1965)) ([2f0824b](https://github.com/typescript-eslint/typescript-eslint/commit/2f0824b0a41f3043b6242fc1d49faae540abaf22)) +- **eslint-plugin:** new extended rule 'no-invalid-this' ([#1823](https://github.com/typescript-eslint/typescript-eslint/issues/1823)) ([b18bc35](https://github.com/typescript-eslint/typescript-eslint/commit/b18bc357507337b9725f8d9c1b549513075a0da5)) +- **experimental-utils:** expose our RuleTester extension ([#1948](https://github.com/typescript-eslint/typescript-eslint/issues/1948)) ([2dd1638](https://github.com/typescript-eslint/typescript-eslint/commit/2dd1638aaa2658ba99b2341861146b586f489121)) +# [2.30.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.29.0...v2.30.0) (2020-04-27) ### Bug Fixes -* **eslint-plugin:** type assertion in rule no-extra-parens ([#1376](https://github.com/typescript-eslint/typescript-eslint/issues/1376)) ([f40639e](https://github.com/typescript-eslint/typescript-eslint/commit/f40639e)) - +- **eslint-plugin:** [prefer-string-starts-ends-with] check for negative start index in slice ([#1920](https://github.com/typescript-eslint/typescript-eslint/issues/1920)) ([ed2bd60](https://github.com/typescript-eslint/typescript-eslint/commit/ed2bd6067f74ae33e36a084719bb91efedfba599)) +- **eslint-plugin:** fix no-base-to-string boolean literal check ([#1850](https://github.com/typescript-eslint/typescript-eslint/issues/1850)) ([2f45e99](https://github.com/typescript-eslint/typescript-eslint/commit/2f45e9992a8f12b6233716e77a6159f9cea2c879)) ### Features -* add internal eslint plugin for repo-specific lint rules ([#1373](https://github.com/typescript-eslint/typescript-eslint/issues/1373)) ([3a15413](https://github.com/typescript-eslint/typescript-eslint/commit/3a15413)) +- **eslint-plugin:** add extension rule `dot-notation` ([#1867](https://github.com/typescript-eslint/typescript-eslint/issues/1867)) ([a85c3e1](https://github.com/typescript-eslint/typescript-eslint/commit/a85c3e1515d735b6c245cc658cdaec6deb05d630)) +- **eslint-plugin:** create `no-invalid-void-type` rule ([#1847](https://github.com/typescript-eslint/typescript-eslint/issues/1847)) ([f667ff1](https://github.com/typescript-eslint/typescript-eslint/commit/f667ff1708d4ed28b7ea5beea742889da69a76d9)) +# [2.29.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.28.0...v2.29.0) (2020-04-20) +### Bug Fixes +- **eslint-plugin:** [no-base-to-string] soft remove `ignoreTaggedTemplateExpressions` option ([#1916](https://github.com/typescript-eslint/typescript-eslint/issues/1916)) ([369978e](https://github.com/typescript-eslint/typescript-eslint/commit/369978e9685bacb3e3882b0510ff06eaf8df4ca1)) +### Features -# [2.13.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.12.0...v2.13.0) (2019-12-23) +- **eslint-plugin:** [no-floating-promise] add option to ignore IIFEs ([#1799](https://github.com/typescript-eslint/typescript-eslint/issues/1799)) ([cea51bf](https://github.com/typescript-eslint/typescript-eslint/commit/cea51bf130d6d3c2935f5e2dcc468196f2ad9d00)) +- **eslint-plugin:** [restrict-template-expressions] add support for intersection types ([#1803](https://github.com/typescript-eslint/typescript-eslint/issues/1803)) ([cc70e4f](https://github.com/typescript-eslint/typescript-eslint/commit/cc70e4fbadd0b15fd6af913a2e1e2ddd346fa558)) +- **eslint-plugin:** add extension rule `init-declarations` ([#1814](https://github.com/typescript-eslint/typescript-eslint/issues/1814)) ([b01f5e7](https://github.com/typescript-eslint/typescript-eslint/commit/b01f5e778ac28e0797a3734fc58d025bb224f418)) +- **eslint-plugin:** add extension rule `keyword-spacing` ([#1739](https://github.com/typescript-eslint/typescript-eslint/issues/1739)) ([c5106dd](https://github.com/typescript-eslint/typescript-eslint/commit/c5106dd4bf2bc8846cc39aa8bb50c33bec026d4d)) +# [2.28.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.27.0...v2.28.0) (2020-04-13) ### Bug Fixes -* **eslint-plugin:** [quotes] ignore backticks for Enum members ([#1355](https://github.com/typescript-eslint/typescript-eslint/issues/1355)) ([e51048c](https://github.com/typescript-eslint/typescript-eslint/commit/e51048c)) -* **eslint-plugin:** [type-annotation-spacing] typo in messages ([#1354](https://github.com/typescript-eslint/typescript-eslint/issues/1354)) ([82e0dbc](https://github.com/typescript-eslint/typescript-eslint/commit/82e0dbc)) -* **eslint-plugin:** add isTypeAssertion utility function ([#1369](https://github.com/typescript-eslint/typescript-eslint/issues/1369)) ([bb1671e](https://github.com/typescript-eslint/typescript-eslint/commit/bb1671e)) -* **eslint-plugin:** use AST_NODE_TYPES enum instead of strings ([#1366](https://github.com/typescript-eslint/typescript-eslint/issues/1366)) ([bd0276b](https://github.com/typescript-eslint/typescript-eslint/commit/bd0276b)) - +- **eslint-plugin:** [method-signature-style] handle multiline params ([#1861](https://github.com/typescript-eslint/typescript-eslint/issues/1861)) ([5832a86](https://github.com/typescript-eslint/typescript-eslint/commit/5832a8643bbe174ec02df5966bb333e506e45f5d)) +- **eslint-plugin:** [no-empty-interface] use suggestion fixer for ambient contexts ([#1880](https://github.com/typescript-eslint/typescript-eslint/issues/1880)) ([62b2278](https://github.com/typescript-eslint/typescript-eslint/commit/62b2278aec0011c93eae17bed8b278114d3379a2)) +- **eslint-plugin:** [unbound-method] false positive on property function initializer ([#1890](https://github.com/typescript-eslint/typescript-eslint/issues/1890)) ([f1c3b18](https://github.com/typescript-eslint/typescript-eslint/commit/f1c3b18f7aadc81f7dca7aa32aa1a8fe424e04e7)) +- **eslint-plugin:** [unbound-method] ignore assignments _to_ methods ([#1736](https://github.com/typescript-eslint/typescript-eslint/issues/1736)) ([6b4680b](https://github.com/typescript-eslint/typescript-eslint/commit/6b4680b6e7343d9d98fa1de170f387a36d98b73e)) +- **eslint-plugin:** no-empty-interface autofix ([#1865](https://github.com/typescript-eslint/typescript-eslint/issues/1865)) ([829a2f7](https://github.com/typescript-eslint/typescript-eslint/commit/829a2f728f876d356908e2338c2d6620e58f9943)), closes [#1864](https://github.com/typescript-eslint/typescript-eslint/issues/1864) +- **eslint-plugin:** use `isTypeArrayTypeOrUnionOfArrayTypes` util for checking if type is array ([#1728](https://github.com/typescript-eslint/typescript-eslint/issues/1728)) ([05030f8](https://github.com/typescript-eslint/typescript-eslint/commit/05030f8d2bd5a50e95053bc61380891da71cc567)) ### Features -* **eslint-plugin:** [ban-types] handle empty type literal {} ([#1348](https://github.com/typescript-eslint/typescript-eslint/issues/1348)) ([1c0ce9b](https://github.com/typescript-eslint/typescript-eslint/commit/1c0ce9b)) -* **eslint-plugin:** [no-use-before-define] opt to ignore enum ([#1242](https://github.com/typescript-eslint/typescript-eslint/issues/1242)) ([6edd911](https://github.com/typescript-eslint/typescript-eslint/commit/6edd911)) -* **eslint-plugin:** [pref-str-starts/ends-with] optional chain… ([#1357](https://github.com/typescript-eslint/typescript-eslint/issues/1357)) ([fd37bc3](https://github.com/typescript-eslint/typescript-eslint/commit/fd37bc3)) -* **eslint-plugin:** add no-extra-semi [extension] ([#1237](https://github.com/typescript-eslint/typescript-eslint/issues/1237)) ([425f65c](https://github.com/typescript-eslint/typescript-eslint/commit/425f65c)) -* **eslint-plugin:** add no-throw-literal [extension] ([#1331](https://github.com/typescript-eslint/typescript-eslint/issues/1331)) ([2aa696c](https://github.com/typescript-eslint/typescript-eslint/commit/2aa696c)) -* **eslint-plugin:** more optional chain support in rules ([#1363](https://github.com/typescript-eslint/typescript-eslint/issues/1363)) ([3dd1b02](https://github.com/typescript-eslint/typescript-eslint/commit/3dd1b02)) -* **typescript-estree:** computed members discriminated unions ([#1349](https://github.com/typescript-eslint/typescript-eslint/issues/1349)) ([013df9a](https://github.com/typescript-eslint/typescript-eslint/commit/013df9a)) -* **typescript-estree:** tighten prop name and destructure types ([#1346](https://github.com/typescript-eslint/typescript-eslint/issues/1346)) ([f335c50](https://github.com/typescript-eslint/typescript-eslint/commit/f335c50)) +- **eslint-plugin:** [ban-ts-comment] support `ts-expect-error` ([#1706](https://github.com/typescript-eslint/typescript-eslint/issues/1706)) ([469cff3](https://github.com/typescript-eslint/typescript-eslint/commit/469cff332c041f38f60de052769287342455cff1)) +- **eslint-plugin:** [consistent-type-assertions] always allow `const` assertions ([#1713](https://github.com/typescript-eslint/typescript-eslint/issues/1713)) ([af2c00d](https://github.com/typescript-eslint/typescript-eslint/commit/af2c00de62f7e31eaeb88996ebf3f330cc8473b9)) +- **eslint-plugin:** [explicit-function-return-type] add option to allow concise arrows that start with void ([#1732](https://github.com/typescript-eslint/typescript-eslint/issues/1732)) ([2e9c202](https://github.com/typescript-eslint/typescript-eslint/commit/2e9c2028a8a0b226e0f87d4bcc997fa259ca3ebd)) +- **eslint-plugin:** [explicit-module-boundary-types] add optio… ([#1778](https://github.com/typescript-eslint/typescript-eslint/issues/1778)) ([3eee804](https://github.com/typescript-eslint/typescript-eslint/commit/3eee804461d017ea6189cd7f64fcd473623684b4)) +- **eslint-plugin:** [no-base-to-string] add option to ignore tagged templates ([#1763](https://github.com/typescript-eslint/typescript-eslint/issues/1763)) ([f5edb99](https://github.com/typescript-eslint/typescript-eslint/commit/f5edb9938c33f8b68f026eba00db3abe9359ced3)) +- **eslint-plugin:** [restrict-template-expressions] add option `allowAny` ([#1762](https://github.com/typescript-eslint/typescript-eslint/issues/1762)) ([d44c0f9](https://github.com/typescript-eslint/typescript-eslint/commit/d44c0f9bed2404ca00b020b35fd825929e213398)) +- **eslint-plugin:** add rule `prefer-reduce-type-parameter` ([#1707](https://github.com/typescript-eslint/typescript-eslint/issues/1707)) ([c92d240](https://github.com/typescript-eslint/typescript-eslint/commit/c92d240e49113779053eac32038382b282812afc)) +- **eslint-plugin:** add rule `prefer-ts-expect-error` ([#1705](https://github.com/typescript-eslint/typescript-eslint/issues/1705)) ([7021f21](https://github.com/typescript-eslint/typescript-eslint/commit/7021f2151a25db2a8edf17e06cd6f21e90761ec8)) +- **eslint-plugin:** add rule no-unsafe-assignment ([#1694](https://github.com/typescript-eslint/typescript-eslint/issues/1694)) ([a49b860](https://github.com/typescript-eslint/typescript-eslint/commit/a49b860cbbb2c7d718b99f561e2fb6eaadf16f17)) +# [2.27.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.26.0...v2.27.0) (2020-04-06) +### Bug Fixes +- **eslint-plugin:** [no-throw-literal] fix crash caused by getBaseTypes ([#1830](https://github.com/typescript-eslint/typescript-eslint/issues/1830)) ([9d53c76](https://github.com/typescript-eslint/typescript-eslint/commit/9d53c761983dd964109b9f13eb9bfe20caf9defb)) +- **eslint-plugin:** [no-unsafe-call] fix incorrect selector ([#1826](https://github.com/typescript-eslint/typescript-eslint/issues/1826)) ([8ec53a3](https://github.com/typescript-eslint/typescript-eslint/commit/8ec53a3579fcb59cdffea0c60fbb755d056f4c8a)) +- **eslint-plugin:** [require-await] handle async generators ([#1782](https://github.com/typescript-eslint/typescript-eslint/issues/1782)) ([9642d9d](https://github.com/typescript-eslint/typescript-eslint/commit/9642d9dce693befac89a4e9d8bf8dd18f4361e2a)) +- **eslint-plugin:** no-explicit-any constructor functions (& mo… ([#1711](https://github.com/typescript-eslint/typescript-eslint/issues/1711)) ([ab8572e](https://github.com/typescript-eslint/typescript-eslint/commit/ab8572e30e14ebda91c8437be5ee35e7dc9add2e)) +### Features -# [2.12.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.11.0...v2.12.0) (2019-12-16) +- **eslint-plugin:** new rule method-signature-style ([#1685](https://github.com/typescript-eslint/typescript-eslint/issues/1685)) ([c49d771](https://github.com/typescript-eslint/typescript-eslint/commit/c49d771ba62f1a21d3c1aec106341daddfcd3c9a)) +- **eslint-plugin:** sort members alphabetically ([#263](https://github.com/typescript-eslint/typescript-eslint/issues/263)) ([485e902](https://github.com/typescript-eslint/typescript-eslint/commit/485e90213a0f8baac0587f7d56925448883fc5bd)) +- **eslint-plugin-internal:** add plugin-test-formatting rule ([#1821](https://github.com/typescript-eslint/typescript-eslint/issues/1821)) ([9b0023a](https://github.com/typescript-eslint/typescript-eslint/commit/9b0023a4996ecdd7dfcb30abd1678091a78f3064)) +# [2.26.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.25.0...v2.26.0) (2020-03-30) ### Bug Fixes -* **eslint-plugin:** [prefer-null-coal] fixer w/ mixed logicals ([#1326](https://github.com/typescript-eslint/typescript-eslint/issues/1326)) ([f9a9fbf](https://github.com/typescript-eslint/typescript-eslint/commit/f9a9fbf)) -* **eslint-plugin:** [quotes] ignore backticks for interface properties ([#1311](https://github.com/typescript-eslint/typescript-eslint/issues/1311)) ([3923a09](https://github.com/typescript-eslint/typescript-eslint/commit/3923a09)) - +- **eslint-plugin:** [no-explicit-any] error with ignoreRestArgs ([#1796](https://github.com/typescript-eslint/typescript-eslint/issues/1796)) ([638d84d](https://github.com/typescript-eslint/typescript-eslint/commit/638d84ddd77d07117b3ec7c5431f3b0e44b1995d)) +- **eslint-plugin:** [no-unsafe-call] allow import expressions ([#1800](https://github.com/typescript-eslint/typescript-eslint/issues/1800)) ([4fa7107](https://github.com/typescript-eslint/typescript-eslint/commit/4fa710754ecc412b65ac3864fe0c7857c254ac1b)) +- **eslint-plugin:** [no-unsafe-return] error with ESLint Plugin TypeScript +# `@typescript-eslint/eslint-plugin` -

An ESLint plugin which provides lint rules for TypeScript codebases.

+An ESLint plugin which provides lint rules for TypeScript codebases. -

- CI - NPM Version - NPM Downloads -

+[![NPM Version](https://img.shields.io/npm/v/@typescript-eslint/eslint-plugin.svg?style=flat-square)](https://www.npmjs.com/package/@typescript-eslint/eslint-plugin) +[![NPM Downloads](https://img.shields.io/npm/dm/@typescript-eslint/eslint-plugin.svg?style=flat-square)](https://www.npmjs.com/package/@typescript-eslint/eslint-plugin) -## Getting Started +👉 See **https://typescript-eslint.io/getting-started** for our Getting Started docs. -- **[You can find our Getting Started docs here](https://typescript-eslint.io/docs/linting)** -- **[You can find our FAQ / Troubleshooting docs here](https://typescript-eslint.io/docs/linting/troubleshooting)** - -These docs walk you through setting up ESLint, this plugin, and our parser. If you know what you're doing and just want to quick start, read on... - -## Quick-start - -### Installation - -Make sure you have TypeScript and [`@typescript-eslint/parser`](../parser) installed: - -```bash -$ yarn add -D typescript @typescript-eslint/parser -$ npm i --save-dev typescript @typescript-eslint/parser -``` - -Then install the plugin: - -```bash -$ yarn add -D @typescript-eslint/eslint-plugin -$ npm i --save-dev @typescript-eslint/eslint-plugin -``` - -It is important that you use the same version number for `@typescript-eslint/parser` and `@typescript-eslint/eslint-plugin`. - -**Note:** If you installed ESLint globally (using the `-g` flag) then you must also install `@typescript-eslint/eslint-plugin` globally. - -### Usage - -Add `@typescript-eslint/parser` to the `parser` field and `@typescript-eslint` to the plugins section of your `.eslintrc` configuration file, then configure the rules you want to use under the rules section. - -```json -{ - "parser": "@typescript-eslint/parser", - "plugins": ["@typescript-eslint"], - "rules": { - "@typescript-eslint/rule-name": "error" - } -} -``` - -You can also enable all the recommended rules for our plugin. Add `plugin:@typescript-eslint/recommended` in extends: - -```json -{ - "extends": ["plugin:@typescript-eslint/recommended"] -} -``` - -### Recommended Configs - -You can also use [`eslint:recommended`](https://eslint.org/docs/rules/) (the set of rules which are recommended for all projects by the ESLint Team) with this plugin: - -```json -{ - "extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended"] -} -``` - -As of version 2 of this plugin, _by design_, none of the rules in the main `recommended` config require type-checking in order to run. This means that they are more lightweight and faster to run. - -Some highly valuable rules require type-checking in order to be implemented correctly, however, so we provide an additional config you can extend from called `recommended-requiring-type-checking`. You would apply this _in addition_ to the recommended configs previously mentioned, e.g.: - -```json -{ - "extends": [ - "eslint:recommended", - "plugin:@typescript-eslint/recommended", - "plugin:@typescript-eslint/recommended-requiring-type-checking" - ] -} -``` - -Pro Tip: For larger codebases you may want to consider splitting our linting into two separate stages: 1. fast feedback rules which operate purely based on syntax (no type-checking), 2. rules which are based on semantics (type-checking). - -**[You can read more about linting with type information here](https://typescript-eslint.io/docs/linting/typed-linting)** - -## Supported Rules - -For the exhaustive list of supported rules, [please see our website](https://typescript-eslint.io/rules/). - -## Contributing - -[See the contributing guide here](../../CONTRIBUTING.md). +> See https://typescript-eslint.io for general documentation on typescript-eslint, the tooling that allows you to run ESLint and Prettier on TypeScript code. diff --git a/packages/eslint-plugin/docs/rules/README.md b/packages/eslint-plugin/docs/rules/README.md index 7c6bd00d36d..04e2d987056 100644 --- a/packages/eslint-plugin/docs/rules/README.md +++ b/packages/eslint-plugin/docs/rules/README.md @@ -7,7 +7,7 @@ slug: / --- `@typescript-eslint/eslint-plugin` includes over 100 rules that detect best practice violations, bugs, and/or stylistic issues specifically for TypeScript code. -See [Configs](/docs/linting/configs) for how to enable recommended rules using configs. +See [Configs](/linting/configs) for how to enable recommended rules using configs. ## Supported Rules diff --git a/packages/eslint-plugin/docs/rules/TEMPLATE.md b/packages/eslint-plugin/docs/rules/TEMPLATE.md index a49ed54ac02..ddc6def34a5 100644 --- a/packages/eslint-plugin/docs/rules/TEMPLATE.md +++ b/packages/eslint-plugin/docs/rules/TEMPLATE.md @@ -2,7 +2,7 @@ > > See **https://typescript-eslint.io/rules/your-rule-name** for documentation. -## Rule Details +## Examples To fill out: tell us more about this rule. @@ -20,33 +20,6 @@ To fill out: tell us more about this rule. // To fill out: correct code ``` -## Options - -This rule is not configurable. - -```jsonc -// .eslintrc.json -{ - "rules": { - "@typescript-eslint/your-rule-name": "error" - } -} -``` - -If not configurable: This rule is not configurable. - -If configurable... - -```ts -type Options = { - someOption?: boolean; -}; - -const defaultOptions: Options = { - someOption: false, -}; -``` - ## When Not To Use It To fill out: why wouldn't you want to use this rule? diff --git a/packages/eslint-plugin/docs/rules/adjacent-overload-signatures.md b/packages/eslint-plugin/docs/rules/adjacent-overload-signatures.md index 57677bd4ac1..b221b449724 100644 --- a/packages/eslint-plugin/docs/rules/adjacent-overload-signatures.md +++ b/packages/eslint-plugin/docs/rules/adjacent-overload-signatures.md @@ -1,12 +1,16 @@ +--- +description: 'Require that function overload signatures be consecutive.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/adjacent-overload-signatures** for documentation. -Grouping overloaded members together can improve readability of the code. - -## Rule Details +Function overload signatures represent multiple ways a function can be called, potentially with different return types. +It's typical for an interface or type alias describing a function to place all overload signatures next to each other. +If Signatures placed elsewhere in the type are easier to be missed by future developers reading the code. -This rule aims to standardize the way overloaded members are organized. +## Examples @@ -84,19 +88,6 @@ export function foo(n: number): void; export function foo(sn: string | number): void; ``` -## Options - -```jsonc -// .eslintrc.json -{ - "rules": { - "@typescript-eslint/adjacent-overload-signatures": "error" - } -} -``` - -This rule is not configurable. - ## When Not To Use It If you don't care about the general structure of the code, then you will not need this rule. diff --git a/packages/eslint-plugin/docs/rules/array-type.md b/packages/eslint-plugin/docs/rules/array-type.md index 9a9ac0985bc..66905370cf0 100644 --- a/packages/eslint-plugin/docs/rules/array-type.md +++ b/packages/eslint-plugin/docs/rules/array-type.md @@ -1,34 +1,17 @@ +--- +description: 'Require consistently using either `T[]` or `Array` for arrays.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/array-type** for documentation. -Using the same style for array definitions across your codebase makes it easier for your developers to read and understand the types. - -## Rule Details - -This rule aims to standardize usage of array types within your codebase. +TypeScript provides two equivalent ways to define an array type: `T[]` and `Array`. +The two styles are functionally equivalent. +Using the same style consistently across your codebase makes it easier for developers to read and understand array types. ## Options -```ts -type ArrayOption = 'array' | 'generic' | 'array-simple'; -type Options = { - default: ArrayOption; - readonly?: ArrayOption; -}; - -const defaultOptions: Options = { - default: 'array', -}; -``` - -The rule accepts an options object with the following properties: - -- `default` - sets the array type expected for mutable cases. -- `readonly` - sets the array type expected for readonly arrays. If this is omitted, then the value for `default` will be used. - -Each property can be set to one of three strings: `'array' | 'generic' | 'array-simple'`. - The default config will enforce that all mutable and readonly arrays use the `'array'` syntax. ### `"array"` diff --git a/packages/eslint-plugin/docs/rules/await-thenable.md b/packages/eslint-plugin/docs/rules/await-thenable.md index d0d3d5f7d52..8179a90af19 100644 --- a/packages/eslint-plugin/docs/rules/await-thenable.md +++ b/packages/eslint-plugin/docs/rules/await-thenable.md @@ -1,13 +1,18 @@ +--- +description: 'Disallow awaiting a value that is not a Thenable.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/await-thenable** for documentation. -This rule disallows awaiting a value that is not a "Thenable" (an object which has `then` method, such as a Promise). -While it is valid JavaScript to await a non-`Promise`-like value (it will resolve immediately), this pattern is often a programmer error, such as forgetting to add parenthesis to call a function that returns a Promise. +A "Thenable" value is an object with has a `then` method, such as a Promise. +The `await` keyword is generally used to retrieve the result of calling a Thenable's `then` method. -## Rule Details +If the `await` keyword is used on a value that is not a Thenable, the value is directly resolved immediately. +While doing so is valid JavaScript, it is often a programmer error, such as forgetting to add parenthesis to call a function that returns a Promise. -Examples of code for this rule: +## Examples @@ -29,19 +34,6 @@ const createValue = async () => 'value'; await createValue(); ``` -## Options - -```jsonc -// .eslintrc.json -{ - "rules": { - "@typescript-eslint/await-thenable": "error" - } -} -``` - -This rule is not configurable. - ## When Not To Use It If you want to allow code to `await` non-Promise values. diff --git a/packages/eslint-plugin/docs/rules/ban-ts-comment.md b/packages/eslint-plugin/docs/rules/ban-ts-comment.md index f560c55ff05..b0fa17f6aa0 100644 --- a/packages/eslint-plugin/docs/rules/ban-ts-comment.md +++ b/packages/eslint-plugin/docs/rules/ban-ts-comment.md @@ -1,9 +1,14 @@ +--- +description: 'Disallow `@ts-` comments or require descriptions after directives.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/ban-ts-comment** for documentation. TypeScript provides several directive comments that can be used to alter how it processes files. -Using these to suppress TypeScript Compiler Errors reduces the effectiveness of TypeScript overall. +Using these to suppress TypeScript compiler errors reduces the effectiveness of TypeScript overall. +Instead, it's generally better to correct the types of code, to make directives unnecessary. The directive comments supported by TypeScript are: @@ -14,35 +19,11 @@ The directive comments supported by TypeScript are: // @ts-check ``` -## Rule Details - This rule lets you set which directive comments you want to allow in your codebase. -By default, only `@ts-check` is allowed, as it enables rather than suppresses errors. - -The configuration looks like this: -```ts -type DirectiveConfig = - | boolean - | 'allow-with-description' - | { descriptionFormat: string }; - -interface Options { - 'ts-expect-error'?: DirectiveConfig; - 'ts-ignore'?: DirectiveConfig; - 'ts-nocheck'?: DirectiveConfig; - 'ts-check'?: DirectiveConfig; - minimumDescriptionLength?: number; -} +## Options -const defaultOptions: Options = { - 'ts-expect-error': 'allow-with-description', - 'ts-ignore': true, - 'ts-nocheck': true, - 'ts-check': false, - minimumDescriptionLength: 3, -}; -``` +By default, only `@ts-check` is allowed, as it enables rather than suppresses errors. ### `ts-expect-error`, `ts-ignore`, `ts-nocheck`, `ts-check` directives diff --git a/packages/eslint-plugin/docs/rules/ban-tslint-comment.md b/packages/eslint-plugin/docs/rules/ban-tslint-comment.md index 3e5789bc005..96a5e9b91db 100644 --- a/packages/eslint-plugin/docs/rules/ban-tslint-comment.md +++ b/packages/eslint-plugin/docs/rules/ban-tslint-comment.md @@ -1,12 +1,16 @@ +--- +description: 'Disallow `// tslint:` comments.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/ban-tslint-comment** for documentation. Useful when migrating from TSLint to ESLint. Once TSLint has been removed, this rule helps locate TSLint annotations (e.g. `// tslint:disable`). -## Rule Details +> See the [TSLint rule flags docs](https://palantir.github.io/tslint/usage/rule-flags) for reference. -All TSLint [rule flags](https://palantir.github.io/tslint/usage/rule-flags/) +## Examples @@ -30,19 +34,6 @@ someCode(); // tslint:disable-line someCode(); // This is a comment that just happens to mention tslint ``` -## Options - -```jsonc -// .eslintrc.json -{ - "rules": { - "@typescript-eslint/ban-tslint-comment": "warn" - } -} -``` - -This rule is not configurable. - ## When Not To Use It If you are still using TSLint. diff --git a/packages/eslint-plugin/docs/rules/ban-types.md b/packages/eslint-plugin/docs/rules/ban-types.md index 256b12372fe..3f2e663669a 100644 --- a/packages/eslint-plugin/docs/rules/ban-types.md +++ b/packages/eslint-plugin/docs/rules/ban-types.md @@ -1,81 +1,66 @@ +--- +description: 'Disallow certain types.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/ban-types** for documentation. -Some builtin types have aliases, some types are considered dangerous or harmful. +Some built-in types have aliases, while some types are considered dangerous or harmful. It's often a good idea to ban certain types to help with consistency and safety. -## Rule Details - This rule bans specific types and can suggest alternatives. Note that it does not ban the corresponding runtime objects from being used. -## Options +## Examples -```ts -type Options = { - types?: { - [typeName: string]: - | false - | string - | { - message: string; - fixWith?: string; - }; - }; - extendDefaults?: boolean; -}; -``` - -The rule accepts a single object as options. - -### `types` +Examples of code with the default options: -An object whose keys are the types you want to ban, and the values are error messages. + -The type can either be a type name literal (`Foo`), a type name with generic parameter instantiation(s) (`Foo`), the empty object literal (`{}`), or the empty tuple type (`[]`). +### ❌ Incorrect -The values can be: +```ts +// use lower-case primitives for consistency +const str: String = 'foo'; +const bool: Boolean = true; +const num: Number = 1; +const symb: Symbol = Symbol('foo'); +const bigInt: BigInt = 1n; -- A string, which is the error message to be reported; or -- `false` to specifically un-ban this type (useful when you are using `extendDefaults`); or -- An object with the following properties: - - `message: string` - the message to display when the type is matched. - - `fixWith?: string` - a string to replace the banned type with when the fixer is run. If this is omitted, no fix will be done. +// use a proper function type +const func: Function = () => 1; -### `extendDefaults` +// use safer object types +const lowerObj: Object = {}; +const capitalObj: Object = { a: 'string' }; -If you're specifying custom `types`, you can set this to `true` to extend the default `types` configuration. This is a convenience option to save you copying across the defaults when adding another type. +const curly1: {} = 1; +const curly2: {} = { a: 'string' }; +``` -If this is `false`, the rule will _only_ use the types defined in your configuration. +### ✅ Correct -Example configuration: +```ts +// use lower-case primitives for consistency +const str: string = 'foo'; +const bool: boolean = true; +const num: number = 1; +const symb: symbol = Symbol('foo'); +const bigInt: bigint = 1n; -```jsonc -{ - "@typescript-eslint/ban-types": [ - "error", - { - "types": { - // add a custom message to help explain why not to use it - "Foo": "Don't use Foo because it is unsafe", +// use a proper function type +const func: () => number = () => 1; - // add a custom message, AND tell the plugin how to fix it - "OldAPI": { - "message": "Use NewAPI instead", - "fixWith": "NewAPI" - }, +// use safer object types +const lowerObj: object = {}; +const capitalObj: { a: string } = { a: 'string' }; - // un-ban a type that's banned by default - "{}": false - }, - "extendDefaults": true - } - ] -} +const curly1: number = 1; +const curly2: Record<'a', string> = { a: 'string' }; ``` -### Default Options +## Options The default options provide a set of "best practices", intended to provide safety and standardization in your codebase: @@ -87,12 +72,6 @@ The default options provide a set of "best practices", intended to provide safet - This is a point of confusion for many developers, who think it means "any object type". - See [this comment for more information](https://github.com/typescript-eslint/typescript-eslint/issues/2063#issuecomment-675156492). -:::important - -The default options suggest using `Record`; this was a stylistic decision, as the built-in `Record` type is considered to look cleaner. - -::: -
Default Options @@ -118,7 +97,6 @@ const defaultTypes = { message: 'Use bigint instead', fixWith: 'bigint', }, - Function: { message: [ 'The `Function` type accepts any function-like value.', @@ -127,20 +105,20 @@ const defaultTypes = { 'If you are expecting the function to accept certain arguments, you should explicitly define the function shape.', ].join('\n'), }, - // object typing Object: { message: [ 'The `Object` type actually means "any non-nullish value", so it is marginally better than `unknown`.', - '- If you want a type meaning "any object", you probably want `Record` instead.', + '- If you want a type meaning "any object", you probably want `object` instead.', '- If you want a type meaning "any value", you probably want `unknown` instead.', ].join('\n'), }, '{}': { message: [ '`{}` actually means "any non-nullish value".', - '- If you want a type meaning "any object", you probably want `Record` instead.', + '- If you want a type meaning "any object", you probably want `object` instead.', '- If you want a type meaning "any value", you probably want `unknown` instead.', + '- If you want a type meaning "empty object", you probably want `Record` instead.', ].join('\n'), }, }; @@ -148,52 +126,48 @@ const defaultTypes = {
-### Examples - -Examples of code with the default options: - - +### `types` -#### ❌ Incorrect +An object whose keys are the types you want to ban, and the values are error messages. -```ts -// use lower-case primitives for consistency -const str: String = 'foo'; -const bool: Boolean = true; -const num: Number = 1; -const symb: Symbol = Symbol('foo'); -const bigInt: BigInt = 1n; +The type can either be a type name literal (`Foo`), a type name with generic parameter instantiation(s) (`Foo`), the empty object literal (`{}`), or the empty tuple type (`[]`). -// use a proper function type -const func: Function = () => 1; +The values can be: -// use safer object types -const capitalObj1: Object = 1; -const capitalObj2: Object = { a: 'string' }; +- A string, which is the error message to be reported; or +- `false` to specifically un-ban this type (useful when you are using `extendDefaults`); or +- An object with the following properties: + - `message: string` - the message to display when the type is matched. + - `fixWith?: string` - a string to replace the banned type with when the fixer is run. If this is omitted, no fix will be done. -const curly1: {} = 1; -const curly2: {} = { a: 'string' }; -``` +### `extendDefaults` -#### ✅ Correct +If you're specifying custom `types`, you can set this to `true` to extend the default `types` configuration. This is a convenience option to save you copying across the defaults when adding another type. -```ts -// use lower-case primitives for consistency -const str: string = 'foo'; -const bool: boolean = true; -const num: number = 1; -const symb: symbol = Symbol('foo'); -const bigInt: bigint = 1n; +If this is `false`, the rule will _only_ use the types defined in your configuration. -// use a proper function type -const func: () => number = () => 1; +Example configuration: -// use safer object types -const lowerObj: object = {}; +```jsonc +{ + "@typescript-eslint/ban-types": [ + "error", + { + "types": { + // add a custom message to help explain why not to use it + "Foo": "Don't use Foo because it is unsafe", -const capitalObj1: number = 1; -const capitalObj2: { a: string } = { a: 'string' }; + // add a custom message, AND tell the plugin how to fix it + "OldAPI": { + "message": "Use NewAPI instead", + "fixWith": "NewAPI" + }, -const curly1: number = 1; -const curly2: Record<'a', string> = { a: 'string' }; + // un-ban a type that's banned by default + "{}": false + }, + "extendDefaults": true + } + ] +} ``` diff --git a/packages/eslint-plugin/docs/rules/brace-style.md b/packages/eslint-plugin/docs/rules/brace-style.md index 923a841fcbd..4e032c80580 100644 --- a/packages/eslint-plugin/docs/rules/brace-style.md +++ b/packages/eslint-plugin/docs/rules/brace-style.md @@ -1,28 +1,12 @@ +--- +description: 'Enforce consistent brace style for blocks.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/brace-style** for documentation. -## Rule Details +## Examples This rule extends the base [`eslint/brace-style`](https://eslint.org/docs/rules/brace-style) rule. It adds support for `enum`, `interface`, `namespace` and `module` declarations. - -## How to Use - -```jsonc -{ - // note you must disable the base rule as it can report incorrect errors - "brace-style": "off", - "@typescript-eslint/brace-style": ["error"] -} -``` - -## Options - -See [`eslint/brace-style` options](https://eslint.org/docs/rules/brace-style#options). - - - -Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/docs/rules/brace-style.md) - - diff --git a/packages/eslint-plugin/docs/rules/camelcase.md b/packages/eslint-plugin/docs/rules/camelcase.md index cea28224965..1b3c0e89318 100644 --- a/packages/eslint-plugin/docs/rules/camelcase.md +++ b/packages/eslint-plugin/docs/rules/camelcase.md @@ -1,7 +1,9 @@ -## DEPRECATED +:::danger Deprecated This rule has been deprecated in favour of the [`naming-convention`](./naming-convention.md) rule. +::: + #### ❌ Incorrect ```ts +/* eslint @typescript-eslint/consistent-indexed-object-style: ["error", "record"] */ + interface Foo { [key: string]: unknown; } @@ -56,24 +48,28 @@ type Foo = { #### ✅ Correct ```ts +/* eslint @typescript-eslint/consistent-indexed-object-style: ["error", "record"] */ + type Foo = Record; ``` ### `index-signature` -Examples of code with `index-signature` option. - #### ❌ Incorrect ```ts +/* eslint @typescript-eslint/consistent-indexed-object-style: ["error", "index-signature"] */ + type Foo = Record; ``` #### ✅ Correct ```ts +/* eslint @typescript-eslint/consistent-indexed-object-style: ["error", "index-signature"] */ + interface Foo { [key: string]: unknown; } diff --git a/packages/eslint-plugin/docs/rules/consistent-type-assertions.md b/packages/eslint-plugin/docs/rules/consistent-type-assertions.md index bb624e83b9d..4c7f87ee955 100644 --- a/packages/eslint-plugin/docs/rules/consistent-type-assertions.md +++ b/packages/eslint-plugin/docs/rules/consistent-type-assertions.md @@ -1,35 +1,30 @@ +--- +description: 'Enforce consistent usage of type assertions.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/consistent-type-assertions** for documentation. -## Rule Details +TypeScript provides two syntaxes for "type assertions": -This rule aims to standardize the use of type assertion style across the codebase. +- Angle brackets: `value` +- As: `value as Type` -Type assertions are also commonly referred as "type casting" in TypeScript (even though it is technically slightly different to what is understood by type casting in other languages), so you can think of type assertions and type casting referring to the same thing. It is essentially you saying to the TypeScript compiler, "in this case, I know better than you!". +This rule aims to standardize the use of type assertion style across the codebase. +Keeping to one syntax consistently helps with code readability. -In addition to ensuring that type assertions are written in a consistent way, this rule also helps make your codebase more type-safe. +:::note +Type assertions are also commonly referred as "type casting" in TypeScript. +However, that term is technically slightly different to what is understood by type casting in other languages. +Type assertions are a way to say to the TypeScript compiler, _"I know better than you, it's actually this different type!"_. +::: -`const` assertions, [introduced in TypeScript 3.4](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-4.html#const-assertions), is always allowed by this rule. Examples of it include `let x = "hello" as const;` and `let x = "hello";`. +[`const` assertions](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-4.html#const-assertions) are always allowed by this rule. +Examples of them include `let x = "hello" as const;` and `let x = "hello";`. ## Options -```ts -type Options = - | { - assertionStyle: 'as' | 'angle-bracket'; - objectLiteralTypeAssertions: 'allow' | 'allow-as-parameter' | 'never'; - } - | { - assertionStyle: 'never'; - }; - -const defaultOptions: Options = { - assertionStyle: 'as', - objectLiteralTypeAssertions: 'allow', -}; -``` - ### `assertionStyle` This option defines the expected assertion style. Valid values for `assertionStyle` are: @@ -52,7 +47,7 @@ The const assertion `const x = { foo: 1 } as const`, introduced in TypeScript 3. Assertions to `any` are also ignored by this option. -Examples of code for `{ assertionStyle: 'as', objectLiteralTypeAssertions: 'never' }` +Examples of code for `{ assertionStyle: 'as', objectLiteralTypeAssertions: 'never' }`: @@ -80,7 +75,7 @@ function foo(): T { -Examples of code for `{ assertionStyle: 'as', objectLiteralTypeAssertions: 'allow-as-parameter' }` +Examples of code for `{ assertionStyle: 'as', objectLiteralTypeAssertions: 'allow-as-parameter' }`: diff --git a/packages/eslint-plugin/docs/rules/consistent-type-definitions.md b/packages/eslint-plugin/docs/rules/consistent-type-definitions.md index 625bb7ba493..9d72abe36ae 100644 --- a/packages/eslint-plugin/docs/rules/consistent-type-definitions.md +++ b/packages/eslint-plugin/docs/rules/consistent-type-definitions.md @@ -1,8 +1,12 @@ +--- +description: 'Enforce type definitions to consistently use either `interface` or `type`.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/consistent-type-definitions** for documentation. -There are two ways to define a type. +TypeScript provides two common ways to define an object type: `interface` and `type`. ```ts // type alias @@ -18,37 +22,31 @@ interface T2 { } ``` -## Options +The two are generally very similar, and can often be used interchangeably. +Using the same type declaration style consistently helps with code readability. -This rule accepts one string option: +## Options -- `"interface"`: enforce using `interface`s for object type definitions. +- `"interface"` _(default)_: enforce using `interface`s for object type definitions. - `"type"`: enforce using `type`s for object type definitions. -For example: - -```jsonc -{ - // Use type for object definitions - "@typescript-eslint/consistent-type-definitions": ["error", "type"] -} -``` - ### `interface` -Examples of code with `interface` option. - #### ❌ Incorrect ```ts +/* eslint @typescript-eslint/consistent-type-definitions: ["error", "interface"] */ + type T = { x: number }; ``` #### ✅ Correct ```ts +/* eslint @typescript-eslint/consistent-type-definitions: ["error", "interface"] */ + type T = string; type Foo = string | {}; @@ -59,13 +57,13 @@ interface T { ### `type` -Examples of code with `type` option. - #### ❌ Incorrect ```ts +/* eslint @typescript-eslint/consistent-type-definitions: ["error", "type"] */ + interface T { x: number; } @@ -74,6 +72,8 @@ interface T { #### ✅ Correct ```ts +/* eslint @typescript-eslint/consistent-type-definitions: ["error", "type"] */ + type T = { x: number }; ``` diff --git a/packages/eslint-plugin/docs/rules/consistent-type-exports.md b/packages/eslint-plugin/docs/rules/consistent-type-exports.md index 5383a1225b1..ec15e9fdecb 100644 --- a/packages/eslint-plugin/docs/rules/consistent-type-exports.md +++ b/packages/eslint-plugin/docs/rules/consistent-type-exports.md @@ -1,17 +1,15 @@ +--- +description: 'Enforce consistent usage of type exports.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/consistent-type-exports** for documentation. -TypeScript 3.8 added support for type-only exports. - -Type-only exports allow you to specify that 1 or more named exports are exported as type-only. This allows -transpilers to drop exports without knowing the types of the dependencies. - -## Rule Details - -This rule aims to standardize the use of type exports style across a codebase. +TypeScript allows specifying a `type` keyword on exports to indicate that the export exists only in the type system, not at runtime. +This allows transpilers to drop exports without knowing the types of the dependencies. -Given a class `Button`, and an interface `ButtonProps`, examples of code: +## Examples @@ -21,11 +19,11 @@ Given a class `Button`, and an interface `ButtonProps`, examples of code: interface ButtonProps { onClick: () => void; } + class Button implements ButtonProps { - onClick() { - console.log('button!'); - } + onClick = () => console.log('button!'); } + export { Button, ButtonProps }; ``` @@ -35,27 +33,17 @@ export { Button, ButtonProps }; interface ButtonProps { onClick: () => void; } + class Button implements ButtonProps { - onClick() { - console.log('button!'); - } + onClick = () => console.log('button!'); } + export { Button }; export type { ButtonProps }; ``` ## Options -```ts -interface Options { - fixMixedExportsWithInlineTypeSpecifier?: boolean; -} - -const defaultOptions: Options = { - fixMixedExportsWithInlineTypeSpecifier: false, -}; -``` - ### `fixMixedExportsWithInlineTypeSpecifier` When this is set to true, the rule will autofix "mixed" export cases using TS 4.5's "inline type specifier". @@ -106,6 +94,5 @@ export { Button, type ButtonProps } from 'some-library'; ## When Not To Use It -- If you are using a TypeScript version less than 3.8, then you will not be able to use this rule as type exports are not supported. - If you specifically want to use both export kinds for stylistic reasons, you can disable this rule. - If you use `--isolatedModules` the compiler would error if a type is not re-exported using `export type`. If you also don't wish to enforce one style over the other, you can disable this rule. diff --git a/packages/eslint-plugin/docs/rules/consistent-type-imports.md b/packages/eslint-plugin/docs/rules/consistent-type-imports.md index be63fff5551..baa41eccda1 100644 --- a/packages/eslint-plugin/docs/rules/consistent-type-imports.md +++ b/packages/eslint-plugin/docs/rules/consistent-type-imports.md @@ -1,33 +1,21 @@ +--- +description: 'Enforce consistent usage of type imports.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/consistent-type-imports** for documentation. -TypeScript 3.8 added support for type-only imports. -Type-only imports allow you to specify that an import can only be used in a type location, allowing certain optimizations within compilers. - -## Rule Details - -This rule aims to standardize the use of type imports style across the codebase. +TypeScript allows specifying a `type` keyword on imports to indicate that the export exists only in the type system, not at runtime. +This allows transpilers to drop imports without knowing the types of the dependencies. ## Options -```ts -type Options = { - prefer: 'type-imports' | 'no-type-imports'; - disallowTypeAnnotations: boolean; -}; - -const defaultOptions: Options = { - prefer: 'type-imports', - disallowTypeAnnotations: true, -}; -``` - ### `prefer` This option defines the expected import kind for type-only imports. Valid values for `prefer` are: -- `type-imports` will enforce that you always use `import type Foo from '...'` except referenced by metadata of decorators. It is default. +- `type-imports` will enforce that you always use `import type Foo from '...'` except referenced by metadata of decorators. It is the default. - `no-type-imports` will enforce that you always use `import Foo from '...'`. Examples of **correct** code with `{prefer: 'type-imports'}`, and **incorrect** code with `{prefer: 'no-type-imports'}`. @@ -48,19 +36,68 @@ type T = Foo; const x: Bar = 1; ``` +### `fixStyle` + +This option defines the expected type modifier to be added when an import is detected as used only in the type position. Valid values for `fixStyle` are: + +- `separate-type-imports` will add the type keyword after the import keyword `import type { A } from '...'`. It is the default. +- `inline-type-imports` will inline the type keyword `import { type A } from '...'` and is only available in TypeScript 4.5 and onwards. See [documentation here](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-5.html#type-modifiers-on-import-names 'TypeScript 4.5 documentation on type modifiers and import names'). + + + +#### ❌ Incorrect + +```ts +import { Foo } from 'Foo'; +import Bar from 'Bar'; +type T = Foo; +const x: Bar = 1; +``` + +#### ✅ With `separate-type-imports` + +```ts +import type { Foo } from 'Foo'; +import type Bar from 'Bar'; +type T = Foo; +const x: Bar = 1; +``` + +#### ✅ With `inline-type-imports` + +```ts +import { type Foo } from 'Foo'; +import type Bar from 'Bar'; +type T = Foo; +const x: Bar = 1; +``` + + + ### `disallowTypeAnnotations` -If `true`, type imports in type annotations (`import()`) is not allowed. +If `true`, type imports in type annotations (`import()`) are not allowed. Default is `true`. -Examples of **incorrect** code with `{disallowTypeAnnotations: true}`. +Examples of **incorrect** code with `{disallowTypeAnnotations: true}`: ```ts type T = import('Foo').Foo; const x: import('Bar') = 1; ``` +## Usage with `emitDecoratorMetadata` + +The `emitDecoratorMetadata` compiler option changes the code the TypeScript emits. In short - it causes TypeScript to create references to value imports when they are used in a type-only location. If you are using `emitDecoratorMetadata` then our tooling will require additional information in order for the rule to work correctly. + +If you are using [type-aware linting](https://typescript-eslint.io/linting/typed-linting), then you just need to ensure that the `tsconfig.json` you've configured for `parserOptions.project` has `emitDecoratorMetadata` turned on. Otherwise you can explicitly tell our tooling to analyze your code as if the compiler option was turned on [by setting `parserOptions.emitDecoratorMetadata` to `true`](https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/parser/README.md#parseroptionsemitdecoratormetadata). + ## When Not To Use It -- If you are not using TypeScript 3.8 (or greater), then you will not be able to use this rule, as type-only imports are not allowed. - If you specifically want to use both import kinds for stylistic reasons, you can disable this rule. + +## Related To + +- [`no-import-type-side-effects`](./no-import-type-side-effects.md) +- [`import/consistent-type-specifier-style`](https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/consistent-type-specifier-style.md) +- [`import/no-duplicates` with `{"prefer-inline": true}`](https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-duplicates.md#inline-type-imports) diff --git a/packages/eslint-plugin/docs/rules/default-param-last.md b/packages/eslint-plugin/docs/rules/default-param-last.md index 3de8f8c8cd7..e5902b200c0 100644 --- a/packages/eslint-plugin/docs/rules/default-param-last.md +++ b/packages/eslint-plugin/docs/rules/default-param-last.md @@ -1,8 +1,12 @@ +--- +description: 'Enforce default parameters to be last.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/default-param-last** for documentation. -## Rule Details +## Examples This rule extends the base [`eslint/default-param-last`](https://eslint.org/docs/rules/default-param-last) rule. It adds support for optional parameters. @@ -12,7 +16,7 @@ It adds support for optional parameters. ### ❌ Incorrect ```ts -/* eslint @typescript-eslint/default-param-last: ["error"] */ +/* eslint @typescript-eslint/default-param-last: "error" */ function f(a = 0, b: number) {} function f(a: number, b = 0, c: number) {} @@ -28,7 +32,7 @@ class Foo { ### ✅ Correct ```ts -/* eslint @typescript-eslint/default-param-last: ["error"] */ +/* eslint @typescript-eslint/default-param-last: "error" */ function f(a = 0) {} function f(a: number, b = 0) {} @@ -42,23 +46,3 @@ class Foo { constructor(public a, private b?: number) {} } ``` - -## How to Use - -```jsonc -{ - // note you must disable the base rule as it can report incorrect errors - "default-param-last": "off", - "@typescript-eslint/default-param-last": ["error"] -} -``` - -## Options - -See [`eslint/default-param-last` options](https://eslint.org/docs/rules/default-param-last#options). - - - -Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/docs/rules/default-param-last.md) - - diff --git a/packages/eslint-plugin/docs/rules/dot-notation.md b/packages/eslint-plugin/docs/rules/dot-notation.md index e0c7b390e5a..e48e2c9a9b4 100644 --- a/packages/eslint-plugin/docs/rules/dot-notation.md +++ b/packages/eslint-plugin/docs/rules/dot-notation.md @@ -1,8 +1,12 @@ +--- +description: 'Enforce dot notation whenever possible.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/dot-notation** for documentation. -## Rule Details +## Examples This rule extends the base [`eslint/dot-notation`](https://eslint.org/docs/rules/dot-notation) rule. It adds: @@ -10,19 +14,8 @@ It adds: - Support for optionally ignoring computed `private` and/or `protected` member access. - Compatibility with TypeScript's `noPropertyAccessFromIndexSignature` option. -## How to Use - -```jsonc -{ - // note you must disable the base rule as it can report incorrect errors - "dot-notation": "off", - "@typescript-eslint/dot-notation": ["error"] -} -``` - ## Options -See [`eslint/dot-notation`](https://eslint.org/docs/rules/dot-notation#options) options. This rule adds the following options: ```ts @@ -31,6 +24,7 @@ interface Options extends BaseDotNotationOptions { allowProtectedClassPropertyAccess?: boolean; allowIndexSignaturePropertyAccess?: boolean; } + const defaultOptions: Options = { ...baseDotNotationDefaultOptions, allowPrivateClassPropertyAccess: false, @@ -43,7 +37,7 @@ If the TypeScript compiler option `noPropertyAccessFromIndexSignature` is set to ### `allowPrivateClassPropertyAccess` -Example of a correct code when `allowPrivateClassPropertyAccess` is set to `true` +Example of a correct code when `allowPrivateClassPropertyAccess` is set to `true`: ```ts class X { @@ -56,7 +50,7 @@ x['priv_prop'] = 123; ### `allowProtectedClassPropertyAccess` -Example of a correct code when `allowProtectedClassPropertyAccess` is set to `true` +Example of a correct code when `allowProtectedClassPropertyAccess` is set to `true`: ```ts class X { @@ -69,7 +63,7 @@ x['protected_prop'] = 123; ### `allowIndexSignaturePropertyAccess` -Example of correct code when `allowIndexSignaturePropertyAccess` is set to `true` +Example of correct code when `allowIndexSignaturePropertyAccess` is set to `true`: ```ts class X { @@ -81,9 +75,3 @@ x['hello'] = 123; ``` If the TypeScript compiler option `noPropertyAccessFromIndexSignature` is set to `true`, then the above code is always allowed, even if `allowIndexSignaturePropertyAccess` is `false`. - - - -Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/docs/rules/dot-notation.md) - - diff --git a/packages/eslint-plugin/docs/rules/explicit-function-return-type.md b/packages/eslint-plugin/docs/rules/explicit-function-return-type.md index d42e793a5cb..3a67a7e2372 100644 --- a/packages/eslint-plugin/docs/rules/explicit-function-return-type.md +++ b/packages/eslint-plugin/docs/rules/explicit-function-return-type.md @@ -1,15 +1,20 @@ +--- +description: 'Require explicit return types on functions and class methods.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/explicit-function-return-type** for documentation. -Explicit types for function return values makes it clear to any calling code what type is returned. -This ensures that the return value is assigned to a variable of the correct type; or in the case -where there is no return value, that the calling code doesn't try to use the undefined value when it -shouldn't. +Functions in TypeScript often don't need to be given an explicit return type annotation. +Leaving off the return type is less code to read or write and allows the compiler to infer it from the contents of the function. + +However, explicit return types do make it visually more clear what type is returned by a function. +They can also speed up TypeScript type checking performance in large codebases with many large functions. -## Rule Details +This rule enforces that functions do have an explicit return type annotation. -This rule aims to ensure that the values returned from functions are of the expected type. +## Examples @@ -63,36 +68,6 @@ class Test { ## Options -The rule accepts an options object with the following properties: - -```ts -type Options = { - // if true, only functions which are part of a declaration will be checked - allowExpressions?: boolean; - // if true, type annotations are also allowed on the variable of a function expression rather than on the function directly - allowTypedFunctionExpressions?: boolean; - // if true, functions immediately returning another function expression will not be checked - allowHigherOrderFunctions?: boolean; - // if true, arrow functions immediately returning a `as const` value will not be checked - allowDirectConstAssertionInArrowFunctions?: boolean; - // if true, concise arrow functions that start with the void keyword will not be checked - allowConciseArrowFunctionExpressionsStartingWithVoid?: boolean; - /** - * An array of function/method names that will not have their arguments or their return values checked. - */ - allowedNames?: string[]; -}; - -const defaults = { - allowExpressions: false, - allowTypedFunctionExpressions: true, - allowHigherOrderFunctions: true, - allowDirectConstAssertionInArrowFunctions: true, - allowConciseArrowFunctionExpressionsStartingWithVoid: false, - allowedNames: [], -}; -``` - ### Configuring in a mixed JS/TS codebase If you are working on a codebase within which you lint non-TypeScript code (i.e. `.js`/`.mjs`/`.cjs`/`.jsx`), you should ensure that you should use [ESLint `overrides`](https://eslint.org/docs/user-guide/configuring#disabling-rules-only-for-a-group-of-files) to only enable the rule on `.ts`/`.mts`/`.cts`/`.tsx` files. If you don't, then you will get unfixable lint errors reported within `.js`/`.mjs`/`.cjs`/`.jsx` files. @@ -108,7 +83,7 @@ If you are working on a codebase within which you lint non-TypeScript code (i.e. // enable the rule specifically for TypeScript files "files": ["*.ts", "*.mts", "*.cts", "*.tsx"], "rules": { - "@typescript-eslint/explicit-function-return-type": ["error"] + "@typescript-eslint/explicit-function-return-type": "error" } } ] diff --git a/packages/eslint-plugin/docs/rules/explicit-member-accessibility.md b/packages/eslint-plugin/docs/rules/explicit-member-accessibility.md index 98f297000bd..87d7d23b038 100644 --- a/packages/eslint-plugin/docs/rules/explicit-member-accessibility.md +++ b/packages/eslint-plugin/docs/rules/explicit-member-accessibility.md @@ -1,42 +1,27 @@ +--- +description: 'Require explicit accessibility modifiers on class properties and methods.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/explicit-member-accessibility** for documentation. -Leaving off accessibility modifier and making everything public can make -your interface hard to use by others. -If you make all internal pieces private or protected, your interface will -be easier to use. +TypeScript allows placing explicit `public`, `protected`, and `private` accessibility modifiers in front of class members. +The modifiers exist solely in the type system and just server to describe who is allowed to access those members. + +Leaving off accessibility modifiers makes for less code to read and write. +Members are `public` by default. -## Rule Details +However, adding in explicit accessibility modifiers can be helpful in codebases with many classes for enforcing proper privacy of members. +Some developers also find it preferable for code readability to keep member publicity explicit. + +## Examples This rule aims to make code more readable and explicit about who can use which properties. ## Options -```ts -type AccessibilityLevel = - | 'explicit' // require an accessor (including public) - | 'no-public' // don't require public - | 'off'; // don't check - -type Options = { - accessibility?: AccessibilityLevel; - ignoredMethodNames?: string[]; - overrides?: { - accessors?: AccessibilityLevel; - constructors?: AccessibilityLevel; - methods?: AccessibilityLevel; - properties?: AccessibilityLevel; - parameterProperties?: AccessibilityLevel; - }; -}; - -const defaultOptions: Options = { - accessibility: 'explicit', -}; -``` - ### Configuring in a mixed JS/TS codebase If you are working on a codebase within which you lint non-TypeScript code (i.e. `.js`/`.mjs`/`.cjs`/`.jsx`), you should ensure that you should use [ESLint `overrides`](https://eslint.org/docs/user-guide/configuring#disabling-rules-only-for-a-group-of-files) to only enable the rule on `.ts`/`.mts`/`.cts`/`.tsx` files. If you don't, then you will get unfixable lint errors reported within `.js`/`.mjs`/`.cjs`/`.jsx` files. @@ -52,7 +37,7 @@ If you are working on a codebase within which you lint non-TypeScript code (i.e. // enable the rule specifically for TypeScript files "files": ["*.ts", "*.mts", "*.cts", "*.tsx"], "rules": { - "@typescript-eslint/explicit-member-accessibility": ["error"] + "@typescript-eslint/explicit-member-accessibility": "error" } } ] @@ -343,4 +328,4 @@ If you think defaulting to public is a good default, then you should consider us ## Further Reading -- TypeScript [Accessibility Modifiers](https://www.typescriptlang.org/docs/handbook/classes.html#public-private-and-protected-modifiers) +- TypeScript [Accessibility Modifiers Handbook Docs](https://www.typescriptlang.org/docs/handbook/2/classes.html#member-visibility) diff --git a/packages/eslint-plugin/docs/rules/explicit-module-boundary-types.md b/packages/eslint-plugin/docs/rules/explicit-module-boundary-types.md index 9aa84b23a7c..2995d3b2c7e 100644 --- a/packages/eslint-plugin/docs/rules/explicit-module-boundary-types.md +++ b/packages/eslint-plugin/docs/rules/explicit-module-boundary-types.md @@ -1,12 +1,16 @@ +--- +description: "Require explicit return and argument types on exported functions' and classes' public class methods." +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/explicit-module-boundary-types** for documentation. Explicit types for function return values and arguments makes it clear to any calling code what is the module boundary's input and output. +Adding explicit type annotations for those types can help improve code readability. +It can also improve TypeScript type checking performance on larger codebases. -## Rule Details - -This rule aims to ensure that the values returned from a module are of the expected type. +## Examples @@ -68,46 +72,6 @@ class Test { ## Options -The rule accepts an options object with the following properties: - -```ts -type Options = { - /** - * If true, the rule will not report for arguments that are explicitly typed as `any` - */ - allowArgumentsExplicitlyTypedAsAny?: boolean; - /** - * If true, body-less arrow functions that return an `as const` type assertion will not - * require an explicit return value annotation. - * You must still type the parameters of the function. - */ - allowDirectConstAssertionInArrowFunctions?: boolean; - /** - * An array of function/method names that will not have their arguments or their return values checked. - */ - allowedNames?: string[]; - /** - * If true, functions immediately returning another function expression will not - * require an explicit return value annotation. - * You must still type the parameters of the function. - */ - allowHigherOrderFunctions?: boolean; - /** - * If true, type annotations are also allowed on the variable of a function expression - * rather than on the function arguments/return value directly. - */ - allowTypedFunctionExpressions?: boolean; -}; - -const defaults = { - allowArgumentsExplicitlyTypedAsAny: false, - allowDirectConstAssertionInArrowFunctions: true, - allowedNames: [], - allowHigherOrderFunctions: true, - allowTypedFunctionExpressions: true, -}; -``` - ### Configuring in a mixed JS/TS codebase If you are working on a codebase within which you lint non-TypeScript code (i.e. `.js`/`.mjs`/`.cjs`/`.jsx`), you should ensure that you should use [ESLint `overrides`](https://eslint.org/docs/user-guide/configuring#disabling-rules-only-for-a-group-of-files) to only enable the rule on `.ts`/`.mts`/`.cts`/`.tsx` files. If you don't, then you will get unfixable lint errors reported within `.js`/`.mjs`/`.cjs`/`.jsx` files. @@ -123,7 +87,7 @@ If you are working on a codebase within which you lint non-TypeScript code (i.e. // enable the rule specifically for TypeScript files "files": ["*.ts", "*.mts", "*.cts", "*.tsx"], "rules": { - "@typescript-eslint/explicit-module-boundary-types": ["error"] + "@typescript-eslint/explicit-module-boundary-types": "error" } } ] diff --git a/packages/eslint-plugin/docs/rules/func-call-spacing.md b/packages/eslint-plugin/docs/rules/func-call-spacing.md index 315e5388240..c30bbface28 100644 --- a/packages/eslint-plugin/docs/rules/func-call-spacing.md +++ b/packages/eslint-plugin/docs/rules/func-call-spacing.md @@ -1,28 +1,12 @@ +--- +description: 'Require or disallow spacing between function identifiers and their invocations.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/func-call-spacing** for documentation. -## Rule Details +## Examples This rule extends the base [`eslint/func-call-spacing`](https://eslint.org/docs/rules/func-call-spacing) rule. It adds support for generic type parameters on function calls. - -## How to Use - -```jsonc -{ - // note you must disable the base rule as it can report incorrect errors - "func-call-spacing": "off", - "@typescript-eslint/func-call-spacing": ["error"] -} -``` - -## Options - -See [`eslint/func-call-spacing` options](https://eslint.org/docs/rules/func-call-spacing#options). - - - -Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/docs/rules/func-call-spacing.md) - - diff --git a/packages/eslint-plugin/docs/rules/indent.md b/packages/eslint-plugin/docs/rules/indent.md index 063087231a5..3d291c8b81c 100644 --- a/packages/eslint-plugin/docs/rules/indent.md +++ b/packages/eslint-plugin/docs/rules/indent.md @@ -1,32 +1,20 @@ +--- +description: 'Enforce consistent indentation.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/indent** for documentation. ## Warning -PLEASE READ THIS ISSUE BEFORE USING THIS RULE [#1824](https://github.com/typescript-eslint/typescript-eslint/issues/1824) - -## Rule Details - -This rule extends the base [`eslint/indent`](https://eslint.org/docs/rules/indent) rule. -It adds support for TypeScript nodes. - -## How to Use - -```jsonc -{ - // note you must disable the base rule as it can report incorrect errors - "indent": "off", - "@typescript-eslint/indent": ["error"] -} -``` - -## Options +:::warning -See [`eslint/indent` options](https://eslint.org/docs/rules/indent#options). +Please read [Issue #1824: Problems with the indent rule](https://github.com/typescript-eslint/typescript-eslint/issues/1824) before using this rule! - +::: -Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/docs/rules/indent.md) +## Examples - +This rule extends the base [`eslint/indent`](https://eslint.org/docs/rules/indent) rule. +It adds support for TypeScript nodes. diff --git a/packages/eslint-plugin/docs/rules/init-declarations.md b/packages/eslint-plugin/docs/rules/init-declarations.md index 3569bd70602..da086da8392 100644 --- a/packages/eslint-plugin/docs/rules/init-declarations.md +++ b/packages/eslint-plugin/docs/rules/init-declarations.md @@ -1,28 +1,12 @@ +--- +description: 'Require or disallow initialization in variable declarations.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/init-declarations** for documentation. -## Rule Details +## Examples This rule extends the base [`eslint/init-declarations`](https://eslint.org/docs/rules/init-declarations) rule. It adds support for TypeScript's `declare` variables. - -## How to Use - -```jsonc -{ - // note you must disable the base rule as it can report incorrect errors - "init-declarations": "off", - "@typescript-eslint/init-declarations": ["error"] -} -``` - -## Options - -See [`eslint/init-declarations` options](https://eslint.org/docs/rules/init-declarations#options). - - - -Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/docs/rules/init-declarations.md) - - diff --git a/packages/eslint-plugin/docs/rules/key-spacing.md b/packages/eslint-plugin/docs/rules/key-spacing.md new file mode 100644 index 00000000000..35108c28f86 --- /dev/null +++ b/packages/eslint-plugin/docs/rules/key-spacing.md @@ -0,0 +1,12 @@ +--- +description: 'Enforce consistent spacing between property names and type annotations in types and interfaces.' +--- + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/key-spacing** for documentation. + +## Examples + +This rule extends the base [`eslint/key-spacing`](https://eslint.org/docs/rules/key-spacing) rule. +This version adds support for type annotations on interfaces, classes and type literals properties. diff --git a/packages/eslint-plugin/docs/rules/keyword-spacing.md b/packages/eslint-plugin/docs/rules/keyword-spacing.md index 6bf0de5e187..5fe8888ff99 100644 --- a/packages/eslint-plugin/docs/rules/keyword-spacing.md +++ b/packages/eslint-plugin/docs/rules/keyword-spacing.md @@ -1,28 +1,12 @@ +--- +description: 'Enforce consistent spacing before and after keywords.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/keyword-spacing** for documentation. -## Rule Details +## Examples This rule extends the base [`eslint/keyword-spacing`](https://eslint.org/docs/rules/keyword-spacing) rule. This version adds support for generic type parameters on function calls. - -## How to Use - -```jsonc -{ - // note you must disable the base rule as it can report incorrect errors - "keyword-spacing": "off", - "@typescript-eslint/keyword-spacing": ["error"] -} -``` - -## Options - -See [`eslint/keyword-spacing` options](https://eslint.org/docs/rules/keyword-spacing#options). - - - -Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/docs/rules/keyword-spacing.md) - - diff --git a/packages/eslint-plugin/docs/rules/lines-between-class-members.md b/packages/eslint-plugin/docs/rules/lines-between-class-members.md index 2d9de3a73ce..13636d07a2c 100644 --- a/packages/eslint-plugin/docs/rules/lines-between-class-members.md +++ b/packages/eslint-plugin/docs/rules/lines-between-class-members.md @@ -1,31 +1,21 @@ +--- +description: 'Require or disallow an empty line between class members.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/lines-between-class-members** for documentation. -This rule improves readability by enforcing lines between class members. It will not check empty lines before the first member and after the last member. This rule require or disallow an empty line between class members. +This rule improves readability by enforcing lines between class members. It will not check empty lines before the first member and after the last member. This rule will require or disallow an empty line between class members. -## Rule Details +## Examples This rule extends the base [`eslint/lines-between-class-members`](https://eslint.org/docs/rules/lines-between-class-members) rule. It adds support for ignoring overload methods in a class. -See the [ESLint documentation](https://eslint.org/docs/rules/lines-between-class-members) for more details on the `lines-between-class-members` rule. - -## Rule Changes - -```jsonc -{ - // note you must disable the base rule as it can report incorrect errors - "lines-between-class-members": "off", - "@typescript-eslint/lines-between-class-members": ["error"] -} -``` - -In addition to the options supported by the `lines-between-class-members` rule in ESLint core, the rule adds the following options: - ## Options -This rule has a string option and an object option. +In addition to the options supported by the `lines-between-class-members` rule in ESLint core, the rule adds the following options: - Object option: @@ -71,9 +61,3 @@ class foo { qux() {} } ``` - - - -Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/docs/rules/lines-between-class-members.md) - - diff --git a/packages/eslint-plugin/docs/rules/member-delimiter-style.md b/packages/eslint-plugin/docs/rules/member-delimiter-style.md index 3935222e1c7..d2e1f59ec4f 100644 --- a/packages/eslint-plugin/docs/rules/member-delimiter-style.md +++ b/packages/eslint-plugin/docs/rules/member-delimiter-style.md @@ -1,83 +1,34 @@ +--- +description: 'Require a specific member delimiter style for interfaces and type literals.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/member-delimiter-style** for documentation. -Enforces a consistent member delimiter style in interfaces and type literals. There are three member delimiter styles primarily used in TypeScript: - -- Semicolon style (default, preferred in TypeScript). +TypeScript allows three delimiters between members in interfaces and type aliases: ```ts interface Foo { + // Semicolons (default, preferred in TypeScript): name: string; - greet(): void; -} - -type Bar = { - name: string; - greet(): void; -} -``` -- Comma style (JSON style). - - -```ts -interface Foo { + // Commas (JSON-like): name: string, - greet(): void, -} -type Bar = { - name: string, - greet(): void, -} -``` - -- Line break (none) style. - - -```ts -interface Foo { + // Line breaks (none): name: string - greet(): void -} - -type Bar = { - name: string - greet(): void } ``` -The rule also enforces the presence (or absence) of the delimiter in the last member of the interface and/or type literal. -Finally, this rule can enforce separate delimiter syntax for single line declarations. +For code readability, it's generally best to use the same style consistently in your codebase. -## Rule Details - -This rule aims to standardize the way interface and type literal members are delimited. +This rule enforces keeping to one configurable code style. +It can also standardize the presence (or absence) of a delimiter in the last member of a construct, as well as a separate delimiter syntax for single line declarations. ## Options -```ts -interface BaseConfig { - multiline?: { - delimiter?: 'none' | 'semi' | 'comma'; - requireLast?: boolean; - }; - singleline?: { - delimiter?: 'semi' | 'comma'; - requireLast?: boolean; - }; -} -type Config = BaseConfig & { - overrides?: { - interface?: BaseConfig; - typeLiteral?: BaseConfig; - }; - multilineDetection?: 'brackets' | 'last-member'; -}; -``` - Default config: ```json diff --git a/packages/eslint-plugin/docs/rules/member-ordering.md b/packages/eslint-plugin/docs/rules/member-ordering.md index 5dd18d6beec..919ec88186f 100644 --- a/packages/eslint-plugin/docs/rules/member-ordering.md +++ b/packages/eslint-plugin/docs/rules/member-ordering.md @@ -1,12 +1,13 @@ +--- +description: 'Require a consistent member declaration order.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/member-ordering** for documentation. -A consistent ordering of fields, methods and constructors can make interfaces, type literals, classes and class expressions easier to read, navigate, and edit. - -## Rule Details - -This rule aims to standardize the way class declarations, class expressions, interfaces and type literals are structured and ordered. +This rule aims to standardize the way classes, interfaces, and type literals are structured and ordered. +A consistent ordering of fields, methods and constructors can make code easier to read, navigate, and edit. ## Options @@ -23,7 +24,13 @@ type OrderConfig = MemberType[] | SortedOrderConfig | 'never'; interface SortedOrderConfig { memberTypes?: MemberType[] | 'never'; - order: 'alphabetically' | 'alphabetically-case-insensitive' | 'as-written'; + optionalityOrder?: 'optional-first' | 'required-first'; + order: + | 'alphabetically' + | 'alphabetically-case-insensitive' + | 'as-written' + | 'natural' + | 'natural-case-insensitive'; } // See below for the more specific MemberType strings @@ -38,9 +45,10 @@ You can configure `OrderConfig` options for: - **`interfaces`**?: override ordering specifically for interfaces - **`typeLiterals`**?: override ordering specifically for type literals -The `OrderConfig` settings for each kind of construct may configure sorting on one or both two levels: +The `OrderConfig` settings for each kind of construct may configure sorting on up to three levels: -- **`memberType`**: organizing on member type groups such as methods vs. properties +- **`memberTypes`**: organizing on member type groups such as methods vs. properties +- **`optionalityOrder`**: whether to put all optional members first or all required members first - **`order`**: organizing based on member names, such as alphabetically ### Groups @@ -48,13 +56,24 @@ The `OrderConfig` settings for each kind of construct may configure sorting on o You can define many different groups based on different attributes of members. The supported member attributes are, in order: -- **Accessibility** (`'public' | 'protected' | 'private'`) +- **Accessibility** (`'public' | 'protected' | 'private' | '#private'`) - **Decoration** (`'decorated'`): Whether the member has an explicit accessibility decorator - **Kind** (`'call-signature' | 'constructor' | 'field' | 'get' | 'method' | 'set' | 'signature'`) Member attributes may be joined with a `'-'` to combine into more specific groups. For example, `'public-field'` would come before `'private-field'`. +### Orders + +The `order` value specifies what order members should be within a group. +It defaults to `as-written`, meaning any order is fine. +Other allowed values are: + +- `alphabetically`: Sorted in a-z alphabetical order, directly using string `<` comparison (so `B` comes before `a`) +- `alphabetically-case-insensitive`: Sorted in a-z alphabetical order, ignoring case (so `a` comes before `B`) +- `natural`: Same as `alphabetically`, but using [`natural-compare-lite`](https://github.com/litejs/natural-compare-lite) for more friendly sorting of numbers +- `natural-case-insensitive`: Same as `alphabetically-case-insensitive`, but using [`natural-compare-lite`](https://github.com/litejs/natural-compare-lite) for more friendly sorting of numbers + ### Default configuration The default configuration looks as follows: @@ -64,11 +83,13 @@ The default configuration looks as follows: "default": [ // Index signature "signature", + "call-signature", // Fields "public-static-field", "protected-static-field", "private-static-field", + "#private-static-field", "public-decorated-field", "protected-decorated-field", @@ -77,14 +98,15 @@ The default configuration looks as follows: "public-instance-field", "protected-instance-field", "private-instance-field", + "#private-instance-field", "public-abstract-field", "protected-abstract-field", - "private-abstract-field", "public-field", "protected-field", "private-field", + "#private-field", "static-field", "instance-field", @@ -94,6 +116,9 @@ The default configuration looks as follows: "field", + // Static initialization + "static-initialization", + // Constructors "public-constructor", "protected-constructor", @@ -105,6 +130,7 @@ The default configuration looks as follows: "public-static-get", "protected-static-get", "private-static-get", + "#private-static-get", "public-decorated-get", "protected-decorated-get", @@ -113,14 +139,15 @@ The default configuration looks as follows: "public-instance-get", "protected-instance-get", "private-instance-get", + "#private-instance-get", "public-abstract-get", "protected-abstract-get", - "private-abstract-get", "public-get", "protected-get", "private-get", + "#private-get", "static-get", "instance-get", @@ -134,6 +161,7 @@ The default configuration looks as follows: "public-static-set", "protected-static-set", "private-static-set", + "#private-static-set", "public-decorated-set", "protected-decorated-set", @@ -142,14 +170,15 @@ The default configuration looks as follows: "public-instance-set", "protected-instance-set", "private-instance-set", + "#private-instance-set", "public-abstract-set", "protected-abstract-set", - "private-abstract-set", "public-set", "protected-set", "private-set", + "#private-set", "static-set", "instance-set", @@ -163,6 +192,7 @@ The default configuration looks as follows: "public-static-method", "protected-static-method", "private-static-method", + "#private-static-method", "public-decorated-method", "protected-decorated-method", @@ -171,14 +201,15 @@ The default configuration looks as follows: "public-instance-method", "protected-instance-method", "private-instance-method", + "#private-instance-method", "public-abstract-method", "protected-abstract-method", - "private-abstract-method", "public-method", "protected-method", "private-method", + "#private-method", "static-method", "instance-method", @@ -882,6 +913,96 @@ interface Foo { } ``` +#### Sorting Optional Members First or Last + +The `optionalityOrder` option may be enabled to place all optional members in a group at the beginning or end of that group. + +This config places all optional members before all required members: + +```jsonc +// .eslintrc.json +{ + "rules": { + "@typescript-eslint/member-ordering": [ + "error", + { + "default": { + "optionalityOrder": "optional-first", + "order": "alphabetically" + } + } + ] + } +} +``` + + + +##### ❌ Incorrect + +```ts +interface Foo { + a: boolean; + b?: number; + c: string; +} +``` + +##### ✅ Correct + +```ts +interface Foo { + b?: number; + a: boolean; + c: string; +} +``` + + + +This config places all required members before all optional members: + +```jsonc +// .eslintrc.json +{ + "rules": { + "@typescript-eslint/member-ordering": [ + "error", + { + "default": { + "optionalityOrder": "required-first", + "order": "alphabetically" + } + } + ] + } +} +``` + + + +##### ❌ Incorrect + +```ts +interface Foo { + a: boolean; + b?: number; + c: string; +} +``` + +##### ✅ Correct + +```ts +interface Foo { + a: boolean; + c: string; + b?: number; +} +``` + + + ## All Supported Options ### Member Types (Granular Form) @@ -898,15 +1019,35 @@ The most explicit and granular form is the following: "public-static-field", "protected-static-field", "private-static-field", + "#private-static-field", + "public-decorated-field", "protected-decorated-field", "private-decorated-field", + "public-instance-field", "protected-instance-field", "private-instance-field", + "#private-instance-field", + "public-abstract-field", "protected-abstract-field", - "private-abstract-field", + + "public-field", + "protected-field", + "private-field", + "#private-field", + + "static-field", + "instance-field", + "abstract-field", + + "decorated-field", + + "field", + + // Static initialization + "static-initialization", // Constructors "public-constructor", @@ -917,6 +1058,7 @@ The most explicit and granular form is the following: "public-static-get", "protected-static-get", "private-static-get", + "#private-static-get", "public-decorated-get", "protected-decorated-get", @@ -925,14 +1067,15 @@ The most explicit and granular form is the following: "public-instance-get", "protected-instance-get", "private-instance-get", + "#private-instance-get", "public-abstract-get", "protected-abstract-get", - "private-abstract-get", "public-get", "protected-get", "private-get", + "#private-get", "static-get", "instance-get", @@ -946,6 +1089,7 @@ The most explicit and granular form is the following: "public-static-set", "protected-static-set", "private-static-set", + "#private-static-set", "public-decorated-set", "protected-decorated-set", @@ -954,10 +1098,10 @@ The most explicit and granular form is the following: "public-instance-set", "protected-instance-set", "private-instance-set", + "#private-instance-set", "public-abstract-set", "protected-abstract-set", - "private-abstract-set", "public-set", "protected-set", @@ -975,15 +1119,16 @@ The most explicit and granular form is the following: "public-static-method", "protected-static-method", "private-static-method", + "#private-static-method", "public-decorated-method", "protected-decorated-method", "private-decorated-method", "public-instance-method", "protected-instance-method", "private-instance-method", + "#private-instance-method", "public-abstract-method", - "protected-abstract-method", - "private-abstract-method" + "protected-abstract-method" ] ``` @@ -1006,6 +1151,9 @@ It is also possible to group member types by their accessibility (`static`, `ins "protected-field", // = ["protected-static-field", "protected-instance-field"] "private-field", // = ["private-static-field", "private-instance-field"] + // Static initialization + // No accessibility for static initialization. + // Constructors // Only the accessibility of constructors is configurable. See below. @@ -1043,6 +1191,9 @@ their accessibility. "decorated-field", // = ["public-decorated-field", "protected-decorated-field", "private-decorated-field"] + // Static initialization + // No decorators for static initialization. + // Constructors // There are no decorators for constructors. @@ -1051,14 +1202,14 @@ their accessibility. "protected-decorated-get", "private-decorated-get", - "decorated-get" // = ["public-decorated-get", "protected-decorated-get", "private-decorated-get"] + "decorated-get", // = ["public-decorated-get", "protected-decorated-get", "private-decorated-get"] // Setters "public-decorated-set", "protected-decorated-set", "private-decorated-set", - "decorated-set" // = ["public-decorated-set", "protected-decorated-set", "private-decorated-set"] + "decorated-set", // = ["public-decorated-set", "protected-decorated-set", "private-decorated-set"] // Methods "public-decorated-method", @@ -1081,7 +1232,10 @@ Another option is to group the member types by their scope (`public`, `protected // Fields "static-field", // = ["public-static-field", "protected-static-field", "private-static-field"] "instance-field", // = ["public-instance-field", "protected-instance-field", "private-instance-field"] - "abstract-field", // = ["public-abstract-field", "protected-abstract-field", "private-abstract-field"] + "abstract-field", // = ["public-abstract-field", "protected-abstract-field"] + + // Static initialization + // No scope for static initialization. // Constructors "constructor", // = ["public-constructor", "protected-constructor", "private-constructor"] @@ -1089,17 +1243,17 @@ Another option is to group the member types by their scope (`public`, `protected // Getters "static-get", // = ["public-static-get", "protected-static-get", "private-static-get"] "instance-get", // = ["public-instance-get", "protected-instance-get", "private-instance-get"] - "abstract-get" // = ["public-abstract-get", "protected-abstract-get", "private-abstract-get"] + "abstract-get", // = ["public-abstract-get", "protected-abstract-get"] // Setters "static-set", // = ["public-static-set", "protected-static-set", "private-static-set"] "instance-set", // = ["public-instance-set", "protected-instance-set", "private-instance-set"] - "abstract-set" // = ["public-abstract-set", "protected-abstract-set", "private-abstract-set"] + "abstract-set", // = ["public-abstract-set", "protected-abstract-set"] // Methods "static-method", // = ["public-static-method", "protected-static-method", "private-static-method"] "instance-method", // = ["public-instance-method", "protected-instance-method", "private-instance-method"] - "abstract-method" // = ["public-abstract-method", "protected-abstract-method", "private-abstract-method"] + "abstract-method" // = ["public-abstract-method", "protected-abstract-method"] ] ``` @@ -1114,22 +1268,25 @@ The third grouping option is to ignore both scope and accessibility. // Fields "field", // = ["public-static-field", "protected-static-field", "private-static-field", "public-instance-field", "protected-instance-field", "private-instance-field", - // "public-abstract-field", "protected-abstract-field", private-abstract-field"] + // "public-abstract-field", "protected-abstract-field"] + + // Static initialization + // No grouping for static initialization. // Constructors // Only the accessibility of constructors is configurable. // Getters - "get" // = ["public-static-get", "protected-static-get", "private-static-get", "public-instance-get", "protected-instance-get", "private-instance-get", - // "public-abstract-get", "protected-abstract-get", "private-abstract-get"] + "get", // = ["public-static-get", "protected-static-get", "private-static-get", "public-instance-get", "protected-instance-get", "private-instance-get", + // "public-abstract-get", "protected-abstract-get"] // Setters - "set" // = ["public-static-set", "protected-static-set", "private-static-set", "public-instance-set", "protected-instance-set", "private-instance-set", - // "public-abstract-set", "protected-abstract-set", "private-abstract-set"] + "set", // = ["public-static-set", "protected-static-set", "private-static-set", "public-instance-set", "protected-instance-set", "private-instance-set", + // "public-abstract-set", "protected-abstract-set"] // Methods "method" // = ["public-static-method", "protected-static-method", "private-static-method", "public-instance-method", "protected-instance-method", "private-instance-method", - // "public-abstract-method", "protected-abstract-method", "private-abstract-method"] + // "public-abstract-method", "protected-abstract-method"] ] ``` @@ -1145,6 +1302,9 @@ It is also possible to group different member types at the same rank. // Fields "field", + // Static initialization + "static-initialization", + // Constructors "constructor", diff --git a/packages/eslint-plugin/docs/rules/method-signature-style.md b/packages/eslint-plugin/docs/rules/method-signature-style.md index ad947db3261..4997ea09281 100644 --- a/packages/eslint-plugin/docs/rules/method-signature-style.md +++ b/packages/eslint-plugin/docs/rules/method-signature-style.md @@ -1,21 +1,25 @@ +--- +description: 'Enforce using a particular method signature syntax.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/method-signature-style** for documentation. -There are two ways to define an object/interface function property. +TypeScript provides two ways to define an object/interface function property: ```ts -// method shorthand syntax -interface T1 { +interface Example { + // method shorthand syntax func(arg: string): number; -} -// regular property with function type -interface T2 { + // regular property with function type func: (arg: string) => number; } ``` +The two are very similar; most of the time it doesn't matter which one you use. + A good practice is to use the TypeScript's `strict` option (which implies `strictFunctionTypes`) which enables correct typechecking for function properties only (method signatures get old behavior). TypeScript FAQ: diff --git a/packages/eslint-plugin/docs/rules/naming-convention.md b/packages/eslint-plugin/docs/rules/naming-convention.md index 08da84d15b4..ab0405592c4 100644 --- a/packages/eslint-plugin/docs/rules/naming-convention.md +++ b/packages/eslint-plugin/docs/rules/naming-convention.md @@ -1,3 +1,7 @@ +--- +description: 'Enforce naming conventions for everything across a codebase.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/naming-convention** for documentation. @@ -5,9 +9,7 @@ Enforcing naming conventions helps keep the codebase consistent, and reduces overhead when thinking about how to name a variable. Additionally, a well-designed style guide can help communicate intent, such as by enforcing all private properties begin with an `_`, and all global-level constants are written in `UPPER_CASE`. -There are many different rules that have existed over time, but they have had the problem of not having enough granularity, meaning it was hard to have a well defined style guide, and most of the time you needed 3 or more rules at once to enforce different conventions, hoping they didn't conflict. - -## Rule Details +## Examples This rule allows you to enforce conventions for any identifier, using granular selectors to create a fine-grained style guide. @@ -147,7 +149,7 @@ The `leadingUnderscore` / `trailingUnderscore` options control whether leading/t The `prefix` / `suffix` options control which prefix/suffix strings must exist for the identifier. Accepts an array of strings. -If these are provided, the identifier must start with one of the provided values. For example, if you provide `{ prefix: ['IFace', 'Class', 'Type'] }`, then the following names are valid: `IFaceFoo`, `ClassBar`, `TypeBaz`, but the name `Bang` is not valid, as it contains none of the prefixes. +If these are provided, the identifier must start with one of the provided values. For example, if you provide `{ prefix: ['Class', 'IFace', 'Type'] }`, then the following names are valid: `ClassBar`, `IFaceFoo`, `TypeBaz`, but the name `Bang` is not valid, as it contains none of the prefixes. **Note:** As [documented above](#format-options), the prefix is trimmed before format is validated, therefore PascalCase must be used to allow variables such as `isEnabled` using the prefix `is`. @@ -155,11 +157,11 @@ If these are provided, the identifier must start with one of the provided values - `selector` allows you to specify what types of identifiers to target. - Accepts one or array of selectors to define an option block that applies to one or multiple selectors. - - For example, if you provide `{ selector: ['variable', 'function'] }`, then it will apply the same option to variable and function nodes. + - For example, if you provide `{ selector: ['function', 'variable'] }`, then it will apply the same option to variable and function nodes. - See [Allowed Selectors, Modifiers and Types](#allowed-selectors-modifiers-and-types) below for the complete list of allowed selectors. -- `modifiers` allows you to specify which modifiers to granularly apply to, such as the accessibility (`private`/`public`/`protected`), or if the thing is `static`, etc. +- `modifiers` allows you to specify which modifiers to granularly apply to, such as the accessibility (`#private`/`private`/`protected`/`public`), or if the thing is `static`, etc. - The name must match _all_ of the modifiers. - - For example, if you provide `{ modifiers: ['private', 'static', 'readonly'] }`, then it will only match something that is `private static readonly`, and something that is just `private` will not match. + - For example, if you provide `{ modifiers: ['private','readonly','static'] }`, then it will only match something that is `private static readonly`, and something that is just `private` will not match. - The following `modifiers` are allowed: - `const` - matches a variable declared as being `const` (`const x = 1`). - `destructured` - matches a variable declared via an object destructuring pattern (`const {x, z = 2}`). @@ -169,8 +171,10 @@ If these are provided, the identifier must start with one of the provided values - `unused` - matches anything that is not used. - `requiresQuotes` - matches any name that requires quotes as it is not a valid identifier (i.e. has a space, a dash, etc in it). - `public` - matches any member that is either explicitly declared as `public`, or has no visibility modifier (i.e. implicitly public). - - `readonly`, `static`, `abstract`, `protected`, `private` - matches any member explicitly declared with the given modifier. -- `types` allows you to specify which types to match. This option supports simple, primitive types only (`boolean`, `string`, `number`, `array`, `function`). + - `abstract`,`override`,`private`,`protected`,`readonly`,`static` - matches any member explicitly declared with the given modifier. + - `#private` - matches any member with a private identifier (an identifier that starts with `#`) + - `async` - matches any method, function, or function variable which is async via the `async` keyword (e.g. does not match functions that return promises without using `async` keyword) +- `types` allows you to specify which types to match. This option supports simple, primitive types only (`array`,`boolean`,`function`,`number`,`string`). - The name must match _one_ of the types. - **_NOTE - Using this option will require that you lint with type information._** - For example, this lets you do things like enforce that `boolean` variables are prefixed with a verb. @@ -191,39 +195,39 @@ There are two types of selectors, individual selectors, and grouped selectors. Individual Selectors match specific, well-defined sets. There is no overlap between each of the individual selectors. -- `variable` - matches any `var` / `let` / `const` variable name. - - Allowed `modifiers`: `const`, `destructured`, `global`, `exported`, `unused`. - - Allowed `types`: `boolean`, `string`, `number`, `function`, `array`. +- `variable` - matches any `let` / `const` / `var` variable name. + - Allowed `modifiers`: `async`, `const`, `destructured`, `exported`, `global`, `unused`. + - Allowed `types`: `array`, `boolean`, `function`, `number`, `string`. - `function` - matches any named function declaration or named function expression. - - Allowed `modifiers`: `global`, `exported`, `unused`. + - Allowed `modifiers`: `async`, `exported`, `global`, `unused`. - Allowed `types`: none. - `parameter` - matches any function parameter. Does not match parameter properties. - Allowed `modifiers`: `destructured`, `unused`. - Allowed `types`: `boolean`, `string`, `number`, `function`, `array`. - `classProperty` - matches any class property. Does not match properties that have direct function expression or arrow function expression values. - - Allowed `modifiers`: `abstract`, `private`, `protected`, `public`, `readonly`, `requiresQuotes`, `static`. - - Allowed `types`: `boolean`, `string`, `number`, `function`, `array`. + - Allowed `modifiers`: `abstract`, `override`, `#private`, `private`, `protected`, `public`, `readonly`, `requiresQuotes`, `static`. + - Allowed `types`: `array`, `boolean`, `function`, `number`, `string`. - `objectLiteralProperty` - matches any object literal property. Does not match properties that have direct function expression or arrow function expression values. - Allowed `modifiers`: `public`, `requiresQuotes`. - - Allowed `types`: `boolean`, `string`, `number`, `function`, `array`. + - Allowed `types`: `array`, `boolean`, `function`, `number`, `string`. - `typeProperty` - matches any object type property. Does not match properties that have direct function expression or arrow function expression values. - Allowed `modifiers`: `public`, `readonly`, `requiresQuotes`. - - Allowed `types`: `boolean`, `string`, `number`, `function`, `array`. + - Allowed `types`: `array`, `boolean`, `function`, `number`, `string`. - `parameterProperty` - matches any parameter property. - Allowed `modifiers`: `private`, `protected`, `public`, `readonly`. - - Allowed `types`: `boolean`, `string`, `number`, `function`, `array`. + - Allowed `types`: `array`, `boolean`, `function`, `number`, `string`. - `classMethod` - matches any class method. Also matches properties that have direct function expression or arrow function expression values. Does not match accessors. - - Allowed `modifiers`: `abstract`, `private`, `protected`, `public`, `requiresQuotes`, `static`. + - Allowed `modifiers`: `abstract`, `async`, `override`, `#private`, `private`, `protected`, `public`, `requiresQuotes`, `static`. - Allowed `types`: none. - `objectLiteralMethod` - matches any object literal method. Also matches properties that have direct function expression or arrow function expression values. Does not match accessors. - - Allowed `modifiers`: `public`, `requiresQuotes`. + - Allowed `modifiers`: `async`, `public`, `requiresQuotes`. - Allowed `types`: none. - `typeMethod` - matches any object type method. Also matches properties that have direct function expression or arrow function expression values. Does not match accessors. - Allowed `modifiers`: `public`, `requiresQuotes`. - Allowed `types`: none. - `accessor` - matches any accessor. - - Allowed `modifiers`: `abstract`, `private`, `protected`, `public`, `requiresQuotes`, `static`. - - Allowed `types`: `boolean`, `string`, `number`, `function`, `array`. + - Allowed `modifiers`: `abstract`, `override`, `private`, `protected`, `public`, `requiresQuotes`, `static`. + - Allowed `types`: `array`, `boolean`, `function`, `number`, `string`. - `enumMember` - matches any enum member. - Allowed `modifiers`: `requiresQuotes`. - Allowed `types`: none. @@ -250,20 +254,20 @@ Group Selectors are provided for convenience, and essentially bundle up sets of - `default` - matches everything. - Allowed `modifiers`: all modifiers. - Allowed `types`: none. -- `variableLike` - matches the same as `variable`, `function` and `parameter`. - - Allowed `modifiers`: `unused`. +- `variableLike` - matches the same as `function`, `parameter` and `variable`. + - Allowed `modifiers`: `async`, `unused`. - Allowed `types`: none. -- `memberLike` - matches the same as `property`, `parameterProperty`, `method`, `accessor`, `enumMember`. - - Allowed `modifiers`: `private`, `protected`, `public`, `static`, `readonly`, `abstract`, `requiresQuotes`. +- `memberLike` - matches the same as `accessor`, `enumMember`, `method`, `parameterProperty`, `property`. + - Allowed `modifiers`: `abstract`, `async`, `override`, `#private`, `private`, `protected`, `public`, `readonly`, `requiresQuotes`, `static`. - Allowed `types`: none. -- `typeLike` - matches the same as `class`, `interface`, `typeAlias`, `enum`, `typeParameter`. +- `typeLike` - matches the same as `class`, `enum`, `interface`, `typeAlias`, `typeParameter`. - Allowed `modifiers`: `abstract`, `unused`. - Allowed `types`: none. - `property` - matches the same as `classProperty`, `objectLiteralProperty`, `typeProperty`. - - Allowed `modifiers`: `private`, `protected`, `public`, `static`, `readonly`, `abstract`, `requiresQuotes`. - - Allowed `types`: `boolean`, `string`, `number`, `function`, `array`. + - Allowed `modifiers`: `abstract`, `async`, `override`, `#private`, `private`, `protected`, `public`, `readonly`, `requiresQuotes`, `static`. + - Allowed `types`: `array`, `boolean`, `function`, `number`, `string`. - `method` - matches the same as `classMethod`, `objectLiteralMethod`, `typeMethod`. - - Allowed `modifiers`: `private`, `protected`, `public`, `static`, `readonly`, `abstract`, `requiresQuotes`. + - Allowed `modifiers`: `abstract`, `async`, `override`, `#private`, `private`, `protected`, `public`, `readonly`, `requiresQuotes`, `static`. - Allowed `types`: none. ## FAQ diff --git a/packages/eslint-plugin/docs/rules/no-array-constructor.md b/packages/eslint-plugin/docs/rules/no-array-constructor.md index 6251ddf53dc..c6b147752f2 100644 --- a/packages/eslint-plugin/docs/rules/no-array-constructor.md +++ b/packages/eslint-plugin/docs/rules/no-array-constructor.md @@ -1,8 +1,12 @@ +--- +description: 'Disallow generic `Array` constructors.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/no-array-constructor** for documentation. -## Rule Details +## Examples This rule extends the base [`eslint/no-array-constructor`](https://eslint.org/docs/rules/no-array-constructor) rule. It adds support for the generically typed `Array` constructor (`new Array()`). @@ -29,23 +33,3 @@ new Array(x, y, z); Array(500); new Array(someOtherArray.length); ``` - -## How to Use - -```jsonc -{ - // note you must disable the base rule as it can report incorrect errors - "no-array-constructor": "off", - "@typescript-eslint/no-array-constructor": ["error"] -} -``` - -## Options - -See [`eslint/no-array-constructor` options](https://eslint.org/docs/rules/no-array-constructor#options). - - - -Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/docs/rules/no-array-constructor.md) - - diff --git a/packages/eslint-plugin/docs/rules/no-base-to-string.md b/packages/eslint-plugin/docs/rules/no-base-to-string.md index 8e64d5eac78..7409f5e134e 100644 --- a/packages/eslint-plugin/docs/rules/no-base-to-string.md +++ b/packages/eslint-plugin/docs/rules/no-base-to-string.md @@ -1,21 +1,19 @@ +--- +description: 'Require `.toString()` to only be called on objects which provide useful information when stringified.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/no-base-to-string** for documentation. -Requires `.toString()` to only be called on objects which provide useful information when stringified. - JavaScript will call `toString()` on an object when it is converted to a string, such as when `+` adding to a string or in `${}` template literals. +The default Object `.toString()` returns `"[object Object]"`, which is often not what was intended. +This rule reports on stringified values that aren't primitives and don't define a more useful `.toString()` method. -The default Object `.toString()` returns `"[object Object]"`, so this rule requires stringified objects define a more useful `.toString()` method. - -Note that `Function` provides its own `.toString()` that returns the function's code. -Functions are not flagged by this rule. - -This rule has some overlap with [`restrict-plus-operands`](./restrict-plus-operands.md) and [`restrict-template-expressions`](./restrict-template-expressions.md). +> Note that `Function` provides its own `.toString()` that returns the function's code. +> Functions are not flagged by this rule. -## Rule Details - -This rule prevents accidentally defaulting to the base Object `.toString()` method. +## Examples @@ -60,16 +58,6 @@ const literalWithToString = { ## Options -```ts -type Options = { - ignoredTypeNames?: string[]; -}; - -const defaultOptions: Options = { - ignoredTypeNames: ['RegExp'], -}; -``` - ### `ignoredTypeNames` A string array of type names to ignore, this is useful for types missing `toString()` (but actually has `toString()`). @@ -90,4 +78,11 @@ let text = `${value}`; If you don't mind `"[object Object]"` in your strings, then you will not need this rule. +## Related To + +- [`restrict-plus-operands`](./restrict-plus-operands.md) +- [`restrict-template-expressions`](./restrict-template-expressions.md) + +## Further Reading + - [`Object.prototype.toString()` MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/toString) diff --git a/packages/eslint-plugin/docs/rules/no-confusing-non-null-assertion.md b/packages/eslint-plugin/docs/rules/no-confusing-non-null-assertion.md index f77d111bc8c..34d474cf853 100644 --- a/packages/eslint-plugin/docs/rules/no-confusing-non-null-assertion.md +++ b/packages/eslint-plugin/docs/rules/no-confusing-non-null-assertion.md @@ -1,9 +1,11 @@ +--- +description: 'Disallow non-null assertion in locations that may be confusing.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/no-confusing-non-null-assertion** for documentation. -## Rule Details - Using a non-null assertion (`!`) next to an assign or equals check (`=` or `==` or `===`) creates code that is confusing as it looks similar to a not equals check (`!=` `!==`). ```typescript @@ -12,6 +14,10 @@ a !== b; // not equals test(`!==`) a! === b; // a non-null assertions(`!`) and an triple equals test(`===`) ``` +This rule flags confusing `!` assertions and suggests either removing them or wrapping the asserted expression in `()` parenthesis. + +## Examples + ### ❌ Incorrect @@ -41,19 +47,6 @@ const isEqualsBar = foo.bar == 'hello'; const isEqualsNum = (1 + foo.num!) == 2; ``` -## Options - -```jsonc -// .eslintrc.json -{ - "rules": { - "@typescript-eslint/no-confusing-non-null-assertion": "warn" - } -} -``` - -This rule is not configurable. - ## When Not To Use It If you don't care about this confusion, then you will not need this rule. diff --git a/packages/eslint-plugin/docs/rules/no-confusing-void-expression.md b/packages/eslint-plugin/docs/rules/no-confusing-void-expression.md index b4d1503d306..dbc0aaee9e8 100644 --- a/packages/eslint-plugin/docs/rules/no-confusing-void-expression.md +++ b/packages/eslint-plugin/docs/rules/no-confusing-void-expression.md @@ -1,13 +1,16 @@ +--- +description: 'Require expressions of type void to appear in statement position.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/no-confusing-void-expression** for documentation. -Returning the results of an expression whose type is void can be misleading. -Attempting to do so is likely a symptom of expecting a different return type from a function. -Even if used correctly, it can be misleading for other developers, -who don't know what a particular function does and if its result matters. +`void` in TypeScript refers to a function return that is meant to be ignored. +Attempting to use a `void`-typed value, such as storing the result of a called function in a variable, is often a sign of a programmer error. +`void` can also be misleading for other developers even if used correctly. -This rule provides automatic fixes for most common cases. +This rule prevents `void` type expressions from being used in misleading locations such as being assigned to a variable, provided as a function argument, or returned from a function. ## Examples @@ -66,33 +69,8 @@ cond ? console.log('true') : console.error('false'); ## Options -An object option can be specified. Each boolean flag makes the rule less strict. - -```ts -type Options = { - ignoreArrowShorthand?: boolean; - ignoreVoidOperator?: boolean; -}; - -const defaults: Options = { - ignoreArrowShorthand: false, - ignoreVoidOperator: false, -}; -``` - ### `ignoreArrowShorthand` -`false` by default. - -```json -{ - "@typescript-eslint/no-confusing-void-expression": [ - "error", - { "ignoreArrowShorthand": true } - ] -} -``` - It might be undesirable to wrap every arrow function shorthand expression with braces. Especially when using Prettier formatter, which spreads such code across 3 lines instead of 1. @@ -104,17 +82,6 @@ promise.then(value => window.postMessage(value)); ### `ignoreVoidOperator` -`false` by default. - -```json -{ - "@typescript-eslint/no-confusing-void-expression": [ - "error", - { "ignoreVoidOperator": true } - ] -} -``` - It might be preferable to only use some distinct syntax to explicitly mark the confusing but valid usage of void expressions. This option allows void expressions which are explicitly wrapped in the `void` operator. diff --git a/packages/eslint-plugin/docs/rules/no-dupe-class-members.md b/packages/eslint-plugin/docs/rules/no-dupe-class-members.md index 32e6c5dfdfb..432ac55f014 100644 --- a/packages/eslint-plugin/docs/rules/no-dupe-class-members.md +++ b/packages/eslint-plugin/docs/rules/no-dupe-class-members.md @@ -1,28 +1,12 @@ +--- +description: 'Disallow duplicate class members.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/no-dupe-class-members** for documentation. -## Rule Details +## Examples This rule extends the base [`eslint/no-dupe-class-members`](https://eslint.org/docs/rules/no-dupe-class-members) rule. It adds support for TypeScript's method overload definitions. - -## How to Use - -```jsonc -{ - // note you must disable the base rule as it can report incorrect errors - "no-dupe-class-members": "off", - "@typescript-eslint/no-dupe-class-members": ["error"] -} -``` - -## Options - -See [`eslint/no-dupe-class-members` options](https://eslint.org/docs/rules/no-dupe-class-members#options). - - - -Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/docs/rules/no-dupe-class-members.md) - - diff --git a/packages/eslint-plugin/docs/rules/no-duplicate-enum-values.md b/packages/eslint-plugin/docs/rules/no-duplicate-enum-values.md index 3e284d3eec6..22b951a4a16 100644 --- a/packages/eslint-plugin/docs/rules/no-duplicate-enum-values.md +++ b/packages/eslint-plugin/docs/rules/no-duplicate-enum-values.md @@ -1,12 +1,19 @@ +--- +description: 'Disallow duplicate enum member values.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/no-duplicate-enum-values** for documentation. Although TypeScript supports duplicate enum member values, people usually expect members to have unique values within the same enum. Duplicate values can lead to bugs that are hard to track down. -## Rule Details +## Examples + +This rule disallows defining an enum with multiple members initialized to the same value. -This rule disallows defining an enum with multiple members initialized to the same value. Now it only enforces on enum members initialized with String or Number literals. Members without initializer or initialized with an expression are not checked by this rule. +> This rule only enforces on enum members initialized with string or number literals. +> Members without an initializer or initialized with an expression are not checked by this rule. @@ -21,8 +28,8 @@ enum E { ```ts enum E { - A = 'A' - B = 'A' + A = 'A', + B = 'A', } ``` @@ -37,20 +44,7 @@ enum E { ```ts enum E { - A = 'A' - B = 'B' + A = 'A', + B = 'B', } ``` - -## Options - -```jsonc -// .eslintrc.json -{ - "rules": { - "@typescript-eslint/no-duplicate-enum-values": "warn" - } -} -``` - -This rule is not configurable. diff --git a/packages/eslint-plugin/docs/rules/no-duplicate-imports.md b/packages/eslint-plugin/docs/rules/no-duplicate-imports.md index 613043bedb4..5f523a7b0f4 100644 --- a/packages/eslint-plugin/docs/rules/no-duplicate-imports.md +++ b/packages/eslint-plugin/docs/rules/no-duplicate-imports.md @@ -1,32 +1,12 @@ +--- +description: 'Disallow duplicate imports.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/no-duplicate-imports** for documentation. -## DEPRECATED +:::danger Deprecated This rule has been deprecated in favour of the [`import/no-duplicates`](https://github.com/import-js/eslint-plugin-import/blob/HEAD/docs/rules/no-duplicates.md) rule. - -## Rule Details - -This rule extends the base [`eslint/no-duplicate-imports`](https://eslint.org/docs/rules/no-duplicate-imports) rule. -This version adds support for type-only import and export. - -## How to Use - -```jsonc -{ - // note you must disable the base rule as it can report incorrect errors - "no-duplicate-imports": "off", - "@typescript-eslint/no-duplicate-imports": ["error"] -} -``` - -## Options - -See [`eslint/no-duplicate-imports` options](https://eslint.org/docs/rules/no-duplicate-imports#options). - - - -Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/docs/rules/no-duplicate-imports.md) - - +::: diff --git a/packages/eslint-plugin/docs/rules/no-dynamic-delete.md b/packages/eslint-plugin/docs/rules/no-dynamic-delete.md index 7c6090f812f..e6afb335bc8 100644 --- a/packages/eslint-plugin/docs/rules/no-dynamic-delete.md +++ b/packages/eslint-plugin/docs/rules/no-dynamic-delete.md @@ -1,14 +1,18 @@ +--- +description: 'Disallow using the `delete` operator on computed key expressions.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/no-dynamic-delete** for documentation. Deleting dynamically computed keys can be dangerous and in some cases not well optimized. - -## Rule Details - Using the `delete` operator on keys that aren't runtime constants could be a sign that you're using the wrong data structures. Using `Object`s with added and removed keys can cause occasional edge case bugs, such as if a key is named `"hasOwnProperty"`. -Consider using a `Map` or `Set` if you’re storing collections of objects. + +> Consider using a `Map` or `Set` if you’re storing collections of objects. + +## Examples @@ -40,19 +44,6 @@ delete container[7]; delete container['-Infinity']; ``` -## Options - -```jsonc -// .eslintrc.json -{ - "rules": { - "@typescript-eslint/no-dynamic-delete": "warn" - } -} -``` - -This rule is not configurable. - ## When Not To Use It When you know your keys are safe to delete, this rule can be unnecessary. diff --git a/packages/eslint-plugin/docs/rules/no-empty-function.md b/packages/eslint-plugin/docs/rules/no-empty-function.md index 121db4ff878..529a8a2df7a 100644 --- a/packages/eslint-plugin/docs/rules/no-empty-function.md +++ b/packages/eslint-plugin/docs/rules/no-empty-function.md @@ -1,27 +1,20 @@ +--- +description: 'Disallow empty functions.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/no-empty-function** for documentation. -## Rule Details +## Examples This rule extends the base [`eslint/no-empty-function`](https://eslint.org/docs/rules/no-empty-function) rule. It adds support for handling TypeScript specific code that would otherwise trigger the rule. One example of valid TypeScript specific code that would otherwise trigger the `no-empty-function` rule is the use of [parameter properties](https://www.typescriptlang.org/docs/handbook/classes.html#parameter-properties) in constructor functions. -## How to Use - -```jsonc -{ - // note you must disable the base rule as it can report incorrect errors - "no-empty-function": "off", - "@typescript-eslint/no-empty-function": ["error"] -} -``` - ## Options -See [`eslint/no-empty-function` options](https://eslint.org/docs/rules/no-empty-function#options). This rule adds the following options: ```ts @@ -93,19 +86,3 @@ class Foo extends Base { protected override greet(): void {} } ``` - -## How to Use - -```jsonc -{ - // note you must disable the base rule as it can report incorrect errors - "no-empty-function": "off", - "@typescript-eslint/no-empty-function": ["error"] -} -``` - - - -Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/docs/rules/no-empty-function.md) - - diff --git a/packages/eslint-plugin/docs/rules/no-empty-interface.md b/packages/eslint-plugin/docs/rules/no-empty-interface.md index beed5a85ecc..699ebccb64a 100644 --- a/packages/eslint-plugin/docs/rules/no-empty-interface.md +++ b/packages/eslint-plugin/docs/rules/no-empty-interface.md @@ -1,14 +1,18 @@ +--- +description: 'Disallow the declaration of empty interfaces.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/no-empty-interface** for documentation. -An empty interface is equivalent to its supertype. If the interface does not implement a supertype, then -the interface is equivalent to an empty object (`{}`). In both cases it can be omitted. - -## Rule Details +An empty interface in TypeScript does very little: any non-nullable value is assignable to `{}`. +Using an empty interface is often a sign of programmer error, such as misunderstanding the concept of `{}` or forgetting to fill in fields. This rule aims to ensure that only meaningful interfaces are declared in the code. +## Examples + ### ❌ Incorrect @@ -44,7 +48,7 @@ interface Baz extends Foo, Bar {} -### Options +## Options This rule accepts a single object option with the following default configuration: diff --git a/packages/eslint-plugin/docs/rules/no-explicit-any.md b/packages/eslint-plugin/docs/rules/no-explicit-any.md index f8e42896dbd..efec5011373 100644 --- a/packages/eslint-plugin/docs/rules/no-explicit-any.md +++ b/packages/eslint-plugin/docs/rules/no-explicit-any.md @@ -1,17 +1,18 @@ +--- +description: 'Disallow the `any` type.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/no-explicit-any** for documentation. -Using the `any` type defeats the purpose of using TypeScript. -When `any` is used, all compiler type checks around that value are ignored. +The `any` type in TypeScript is a dangerous "escape hatch" from the type system. +Using `any` disables many type checking rules and is generally best used only as a last resort or when prototyping code. +This rule reports on explicit uses of the `any` keyword as a type annotation. -## Rule Details +> TypeScript's `--noImplicitAny` compiler option prevents an implied `any`, but doesn't prevent `any` from being explicitly used the way this rule does. -This rule doesn't allow `any` types to be defined. -It aims to keep TypeScript maximally useful. -TypeScript has a compiler flag for `--noImplicitAny` that will prevent -an `any` type from being implied by the compiler, but doesn't prevent -`any` from being explicitly used. +## Examples @@ -93,22 +94,6 @@ function greet(param: Array): Array {} ## Options -The rule accepts an options object with the following properties: - -```ts -type Options = { - // if true, auto-fixing will be made available in which the "any" type is converted to an "unknown" type - fixToUnknown: boolean; - // specify if arrays from the rest operator are considered okay - ignoreRestArgs: boolean; -}; - -const defaults = { - fixToUnknown: false, - ignoreRestArgs: false, -}; -``` - ### `ignoreRestArgs` A boolean to specify if arrays from the rest operator are considered okay. `false` by default. @@ -176,6 +161,14 @@ interface Garply { If an unknown type or a library without typings is used and you want to be able to specify `any`. +## Related To + +- [`no-unsafe-argument`](./no-unsafe-argument.md) +- [`no-unsafe-assignment`](./no-unsafe-assignment.md) +- [`no-unsafe-call`](./no-unsafe-call.md) +- [`no-unsafe-member-access`](./no-unsafe-member-access.md) +- [`no-unsafe-return`](./no-unsafe-return.md) + ## Further Reading - TypeScript [any type](https://www.typescriptlang.org/docs/handbook/basic-types.html#any) diff --git a/packages/eslint-plugin/docs/rules/no-extra-non-null-assertion.md b/packages/eslint-plugin/docs/rules/no-extra-non-null-assertion.md index 6c7068b693b..db2c584827c 100644 --- a/packages/eslint-plugin/docs/rules/no-extra-non-null-assertion.md +++ b/packages/eslint-plugin/docs/rules/no-extra-non-null-assertion.md @@ -1,10 +1,15 @@ +--- +description: 'Disallow extra non-null assertions.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/no-extra-non-null-assertion** for documentation. -## Rule Details +The `!` non-null assertion operator in TypeScript is used to assert that a value's type does not include `null` or `undefined`. +Using the operator any more than once on a single value does nothing. -Examples of code for this rule: +## Examples @@ -45,16 +50,3 @@ function foo(bar?: { n: number }) { return bar?.n; } ``` - -## Options - -```jsonc -// .eslintrc.json -{ - "rules": { - "@typescript-eslint/no-extra-non-null-assertion": "error" - } -} -``` - -This rule is not configurable. diff --git a/packages/eslint-plugin/docs/rules/no-extra-parens.md b/packages/eslint-plugin/docs/rules/no-extra-parens.md index 8bd5ac2c7d6..0c5cc21941e 100644 --- a/packages/eslint-plugin/docs/rules/no-extra-parens.md +++ b/packages/eslint-plugin/docs/rules/no-extra-parens.md @@ -1,28 +1,12 @@ +--- +description: 'Disallow unnecessary parentheses.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/no-extra-parens** for documentation. -## Rule Details +## Examples This rule extends the base [`eslint/no-extra-parens`](https://eslint.org/docs/rules/no-extra-parens) rule. It adds support for TypeScript type assertions. - -## How to Use - -```jsonc -{ - // note you must disable the base rule as it can report incorrect errors - "no-extra-parens": "off", - "@typescript-eslint/no-extra-parens": ["error"] -} -``` - -## Options - -See [`eslint/no-extra-parens` options](https://eslint.org/docs/rules/no-extra-parens#options). - - - -Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/docs/rules/no-extra-parens.md) - - diff --git a/packages/eslint-plugin/docs/rules/no-extra-semi.md b/packages/eslint-plugin/docs/rules/no-extra-semi.md index 0b94c91de59..086bd87f450 100644 --- a/packages/eslint-plugin/docs/rules/no-extra-semi.md +++ b/packages/eslint-plugin/docs/rules/no-extra-semi.md @@ -1,28 +1,12 @@ +--- +description: 'Disallow unnecessary semicolons.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/no-extra-semi** for documentation. -## Rule Details +## Examples This rule extends the base [`eslint/no-extra-semi`](https://eslint.org/docs/rules/no-extra-semi) rule. It adds support for class properties. - -## How to Use - -```jsonc -{ - // note you must disable the base rule as it can report incorrect errors - "no-extra-semi": "off", - "@typescript-eslint/no-extra-semi": ["error"] -} -``` - -## Options - -See [`eslint/no-extra-semi` options](https://eslint.org/docs/rules/no-extra-semi#options). - - - -Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/docs/rules/no-extra-semi.md) - - diff --git a/packages/eslint-plugin/docs/rules/no-extraneous-class.md b/packages/eslint-plugin/docs/rules/no-extraneous-class.md index fa990f2cebf..4cf0a2c67ad 100644 --- a/packages/eslint-plugin/docs/rules/no-extraneous-class.md +++ b/packages/eslint-plugin/docs/rules/no-extraneous-class.md @@ -1,24 +1,26 @@ +--- +description: 'Disallow classes used as namespaces.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/no-extraneous-class** for documentation. -This rule warns when a class has no non-static members, such as for a class used exclusively as a static namespace. - -## Rule Details +This rule reports when a class has no non-static members, such as for a class used exclusively as a static namespace. Users who come from a [OOP](https://en.wikipedia.org/wiki/Object-oriented_programming) paradigm may wrap their utility functions in an extra class, instead of putting them at the top level of an ECMAScript module. Doing so is generally unnecessary in JavaScript and TypeScript projects. - Wrapper classes add extra cognitive complexity to code without adding any structural improvements - Whatever would be put on them, such as utility functions, are already organized by virtue of being in a module. - - As an alternative, you can always `import * as ...` the module to get all of them in a single object. + - As an alternative, you can `import * as ...` the module to get all of them in a single object. - IDEs can't provide as good suggestions for static class or namespace imported properties when you start typing property names - It's more difficult to statically analyze code for unused variables, etc. when they're all on the class (see: [Finding dead code (and dead types) in TypeScript](https://effectivetypescript.com/2020/10/20/tsprune)). -This rule also flags classes that have only a constructor and no fields. +This rule also reports classes that have only a constructor and no fields. Those classes can generally be replaced with a standalone function. -Examples of code for this rule: +## Examples @@ -192,28 +194,6 @@ export function incrementCount() { ## Options -This rule accepts a single object option. - -```ts -type Options = { - // allow extraneous classes if they only contain a constructor - allowConstructorOnly?: boolean; - // allow extraneous classes if they have no body (i.e. are empty) - allowEmpty?: boolean; - // allow extraneous classes if they only contain static members - allowStaticOnly?: boolean; - // allow extraneous classes if they have a decorator - allowWithDecorator?: boolean; -}; - -const defaultOptions: Options = { - allowConstructorOnly: false, - allowEmpty: false, - allowStaticOnly: false, - allowWithDecorator: false, -}; -``` - This rule normally bans classes that are empty (have no constructor or fields). The rule's options each add an exemption for a specific type of class. diff --git a/packages/eslint-plugin/docs/rules/no-floating-promises.md b/packages/eslint-plugin/docs/rules/no-floating-promises.md index 45fddc3c621..289e42f903c 100644 --- a/packages/eslint-plugin/docs/rules/no-floating-promises.md +++ b/packages/eslint-plugin/docs/rules/no-floating-promises.md @@ -1,11 +1,15 @@ +--- +description: 'Require Promise-like statements to be handled appropriately.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/no-floating-promises** for documentation. A "floating" Promise is one that is created without any code set up to handle any errors it might throw. - Floating Promises can cause several issues, such as improperly sequenced operations, ignored Promise rejections, and more. +This rule reports when a Promise is created and not properly handled. Valid ways of handling a Promise-valued statement include: - `await`ing it @@ -18,9 +22,7 @@ Valid ways of handling a Promise-valued statement include: See [`no-misused-promises`](./no-misused-promises.md) for detecting code that provides Promises to _logical_ locations such as if statements. ::: -## Rule Details - -Examples of code for this rule: +## Examples @@ -61,22 +63,6 @@ Promise.reject('value').finally(() => {}); ## Options -The rule accepts an options object with the following properties: - -```ts -type Options = { - // if true, checking void expressions will be skipped - ignoreVoid?: boolean; - // if true, checking for async iife will be skipped - ignoreIIFE?: boolean; -}; - -const defaults = { - ignoreVoid: true, - ignoreIIFE: false, -}; -``` - ### `ignoreVoid` This allows you to stop the rule reporting promises consumed with void operator. diff --git a/packages/eslint-plugin/docs/rules/no-for-in-array.md b/packages/eslint-plugin/docs/rules/no-for-in-array.md index 29d0c2548a4..759f427b9ac 100644 --- a/packages/eslint-plugin/docs/rules/no-for-in-array.md +++ b/packages/eslint-plugin/docs/rules/no-for-in-array.md @@ -1,57 +1,56 @@ +--- +description: 'Disallow iterating over an array with a for-in loop.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/no-for-in-array** for documentation. -This rule prohibits iterating over an array with a for-in loop. - -## Rule Details - -A for-in loop (`for (var k in o)`) iterates over the properties of an Object. +A for-in loop (`for (var i in o)`) iterates over the properties of an Object. While it is legal to use for-in loops with array types, it is not common. for-in will iterate over the indices of the array as strings, omitting any "holes" in the array. -More common is to use for-of, which iterates over the values of an array. -If you want to iterate over the indices, alternatives include: -```js -array.forEach((value, index) => { ... }); -for (const [index, value] of array.entries()) { ... } -for (let i = 0; i < array.length; i++) { ... } -``` - -Examples of code for this rule: +## Examples ### ❌ Incorrect ```js -for (const x in [3, 4, 5]) { - console.log(x); +declare const array: string[]; + +for (const i in array) { + console.log(array[i]); +} + +for (const i in array) { + console.log(i, array[i]); } ``` ### ✅ Correct ```js -for (const x in { a: 3, b: 4, c: 5 }) { - console.log(x); +declare const array: string[]; + +for (const value of array) { + console.log(value); } -``` -## Options +for (let i = 0; i < array.length; i += 1) { + console.log(i, array[i]); +} + +array.forEach((value, i) => { + console.log(i, value); +}) -```jsonc -// .eslintrc.json -{ - "rules": { - "@typescript-eslint/no-for-in-array": "error" - } +for (const [i, value] of array.entries()) { + console.log(i, value); } ``` -This rule is not configurable. - ## When Not To Use It If you want to iterate through a loop using the indices in an array as strings, you can turn off this rule. diff --git a/packages/eslint-plugin/docs/rules/no-implicit-any-catch.md b/packages/eslint-plugin/docs/rules/no-implicit-any-catch.md index 97afdfd5787..ea75c981890 100644 --- a/packages/eslint-plugin/docs/rules/no-implicit-any-catch.md +++ b/packages/eslint-plugin/docs/rules/no-implicit-any-catch.md @@ -1,7 +1,16 @@ +--- +description: 'Disallow usage of the implicit `any` type in catch clauses.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/no-implicit-any-catch** for documentation. +:::danger Deprecated + +This rule has been deprecated as TypeScript versions >=4 includes a `useUnknownInCatchVariables` compiler option with the same check. +::: + TypeScript 4.0 added support for adding an explicit `any` or `unknown` type annotation on a catch clause variable. By default, TypeScript will type a catch clause variable as `any`, so explicitly annotating it as `unknown` can add a lot of safety to your codebase. @@ -10,12 +19,10 @@ The `noImplicitAny` flag in TypeScript does not cover this for backwards compati ## DEPRECATED -## Rule Details +## Examples This rule requires an explicit type to be declared on a catch clause variable. -Examples of code for this rule: - ### ❌ Incorrect @@ -45,26 +52,10 @@ try { ## Options -The rule accepts an options object with the following properties: - -```ts -type Options = { - // if false, disallow specifying `: any` as the error type as well. See also `no-explicit-any` - allowExplicitAny: boolean; -}; - -const defaults = { - allowExplicitAny: false, -}; -``` - ### `allowExplicitAny` The follow is is **_not_** considered a warning with `{ allowExplicitAny: true }` - - - ```ts try { // ... @@ -73,8 +64,6 @@ try { } ``` - - ## When Not To Use It If you are not using TypeScript 4.0 (or greater), then you will not be able to use this rule, annotations on catch clauses is not supported. diff --git a/packages/eslint-plugin/docs/rules/no-implied-eval.md b/packages/eslint-plugin/docs/rules/no-implied-eval.md index 5cd9a9113a5..918b6a12e75 100644 --- a/packages/eslint-plugin/docs/rules/no-implied-eval.md +++ b/packages/eslint-plugin/docs/rules/no-implied-eval.md @@ -1,3 +1,7 @@ +--- +description: 'Disallow the use of `eval()`-like methods.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/no-implied-eval** for documentation. @@ -21,12 +25,10 @@ passed in to be interpreted. The same can be done with `setInterval()`, `setImme The best practice is to avoid using `new Function()` or `execScript()` and always use a function for the first argument of `setTimeout()`, `setInterval()` and `setImmediate()`. -## Rule Details +## Examples This rule aims to eliminate implied `eval()` through the use of `new Function()`, `setTimeout()`, `setInterval()`, `setImmediate()` or `execScript()`. -Examples of code for this rule: - ### ❌ Incorrect @@ -94,22 +96,6 @@ class Foo { setTimeout(Foo.fn, 100); ``` -## How to Use - -```jsonc -{ - // note you must disable the base rule as it can report incorrect errors - "no-implied-eval": "off", - "@typescript-eslint/no-implied-eval": ["error"] -} -``` - ## When Not To Use It If you want to allow `new Function()` or `setTimeout()`, `setInterval()`, `setImmediate()` and `execScript()` with string arguments, then you can safely disable this rule. - - - -Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/docs/rules/no-implied-eval.md) - - diff --git a/packages/eslint-plugin/docs/rules/no-import-type-side-effects.md b/packages/eslint-plugin/docs/rules/no-import-type-side-effects.md new file mode 100644 index 00000000000..35b8f2c5282 --- /dev/null +++ b/packages/eslint-plugin/docs/rules/no-import-type-side-effects.md @@ -0,0 +1,75 @@ +--- +description: 'Enforce the use of top-level import type qualifier when an import only has specifiers with inline type qualifiers.' +--- + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/no-import-type-side-effects** for documentation. + +The [`--verbatimModuleSyntax`](https://www.typescriptlang.org/tsconfig#verbatimModuleSyntax) compiler option causes TypeScript to do simple and predictable transpilation on import declarations. +Namely, it completely removes import declarations with a top-level `type` qualifier, and it removes any import specifiers with an inline `type` qualifier. + +The latter behavior does have one potentially surprising effect in that in certain cases TS can leave behind a "side effect" import at runtime: + +```ts +import { type A, type B } from 'mod'; + +// is transpiled to + +import {} from 'mod'; +// which is the same as +import 'mod'; +``` + +For the rare case of needing to import for side effects, this may be desirable - but for most cases you will not want to leave behind an unnecessary side effect import. + +## Examples + +This rule enforces that you use a top-level `type` qualifier for imports when it only imports specifiers with an inline `type` qualifier + + + +### ❌ Incorrect + +```ts +import { type A } from 'mod'; +import { type A as AA } from 'mod'; +import { type A, type B } from 'mod'; +import { type A as AA, type B as BB } from 'mod'; +``` + +### ✅ Correct + +```ts +import type { A } from 'mod'; +import type { A as AA } from 'mod'; +import type { A, B } from 'mod'; +import type { A as AA, B as BB } from 'mod'; + +import T from 'mod'; +import type T from 'mod'; + +import * as T from 'mod'; +import type * as T from 'mod'; + +import { T } from 'mod'; +import type { T } from 'mod'; +import { T, U } from 'mod'; +import type { T, U } from 'mod'; +import { type T, U } from 'mod'; +import { T, type U } from 'mod'; + +import type T, { U } from 'mod'; +import T, { type U } from 'mod'; +``` + +## When Not To Use It + +- If you want to leave behind side effect imports, then you shouldn't use this rule. +- If you're not using TypeScript 5.0's `verbatimModuleSyntax` option, then you don't need this rule. + +## Related To + +- [`consistent-type-imports`](./consistent-type-imports.md) +- [`import/consistent-type-specifier-style`](https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/consistent-type-specifier-style.md) +- [`import/no-duplicates` with `{"prefer-inline": true}`](https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-duplicates.md#inline-type-imports) diff --git a/packages/eslint-plugin/docs/rules/no-inferrable-types.md b/packages/eslint-plugin/docs/rules/no-inferrable-types.md index 73fcfd7ae52..0427bf8acad 100644 --- a/packages/eslint-plugin/docs/rules/no-inferrable-types.md +++ b/packages/eslint-plugin/docs/rules/no-inferrable-types.md @@ -1,68 +1,34 @@ +--- +description: 'Disallow explicit type declarations for variables or parameters initialized to a number, string, or boolean.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/no-inferrable-types** for documentation. -Explicit types where they can be easily inferred may add unnecessary verbosity. - -## Rule Details - -This rule disallows explicit type declarations on parameters, variables -and properties where the type can be easily inferred from its value. - -## Options +TypeScript is able to infer the types of parameters, properties, and variables from their default or initial values. +There is no need to use an explicit `:` type annotation on one of those constructs initialized to a boolean, number, or string. +Doing so adds unnecessary verbosity to code -making it harder to read- and in some cases can prevent TypeScript from inferring a more specific literal type (e.g. `10`) instead of the more general primitive type (e.g. `number`) -This rule accepts the following options: - -```ts -interface Options { - ignoreParameters?: boolean; - ignoreProperties?: boolean; -} -``` - -### Default - -The default options are: - -```json -{ - "ignoreParameters": false, - "ignoreProperties": false -} -``` - -With these options, the following patterns are: +## Examples -#### ❌ Incorrect +### ❌ Incorrect ```ts const a: bigint = 10n; -const a: bigint = -10n; const a: bigint = BigInt(10); -const a: bigint = -BigInt(10); -const a: boolean = false; -const a: boolean = true; -const a: boolean = Boolean(null); const a: boolean = !0; +const a: boolean = Boolean(null); +const a: boolean = true; +const a: null = null; const a: number = 10; -const a: number = +10; -const a: number = -10; -const a: number = Number('1'); -const a: number = +Number('1'); -const a: number = -Number('1'); const a: number = Infinity; -const a: number = +Infinity; -const a: number = -Infinity; const a: number = NaN; -const a: number = +NaN; -const a: number = -NaN; -const a: null = null; +const a: number = Number('1'); const a: RegExp = /a/; -const a: RegExp = RegExp('a'); const a: RegExp = new RegExp('a'); -const a: string = 'str'; const a: string = `str`; const a: string = String(1); const a: symbol = Symbol('a'); @@ -76,34 +42,21 @@ class Foo { function fn(a: number = 5, b: boolean = true) {} ``` -#### ✅ Correct +### ✅ Correct ```ts const a = 10n; -const a = -10n; const a = BigInt(10); -const a = -BigInt(10); -const a = false; -const a = true; -const a = Boolean(null); const a = !0; +const a = Boolean(null); +const a = true; +const a = null; const a = 10; -const a = +10; -const a = -10; -const a = Number('1'); -const a = +Number('1'); -const a = -Number('1'); const a = Infinity; -const a = +Infinity; -const a = -Infinity; const a = NaN; -const a = +NaN; -const a = -NaN; -const a = null; +const a = Number('1'); const a = /a/; -const a = RegExp('a'); const a = new RegExp('a'); -const a = 'str'; const a = `str`; const a = String(1); const a = Symbol('a'); @@ -115,12 +68,12 @@ class Foo { } function fn(a = 5, b = true) {} - -function fn(a: number, b: boolean, c: string) {} ``` +## Options + ### `ignoreParameters` When set to true, the following pattern is considered valid: diff --git a/packages/eslint-plugin/docs/rules/no-invalid-this.md b/packages/eslint-plugin/docs/rules/no-invalid-this.md index 22e7de7260b..4d6abe81f70 100644 --- a/packages/eslint-plugin/docs/rules/no-invalid-this.md +++ b/packages/eslint-plugin/docs/rules/no-invalid-this.md @@ -1,32 +1,12 @@ +--- +description: 'Disallow `this` keywords outside of classes or class-like objects.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/no-invalid-this** for documentation. -## Rule Details +## Examples This rule extends the base [`eslint/no-invalid-this`](https://eslint.org/docs/rules/no-invalid-this) rule. It adds support for TypeScript's `this` parameters. - -## How to Use - -```jsonc -{ - // note you must disable the base rule as it can report incorrect errors - "no-invalid-this": "off", - "@typescript-eslint/no-invalid-this": ["error"] -} -``` - -## Options - -See [`eslint/no-invalid-this` options](https://eslint.org/docs/rules/no-invalid-this#options). - -## When Not To Use It - -When you are indifferent as to how your variables are initialized. - - - -Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/docs/rules/no-invalid-this.md) - - diff --git a/packages/eslint-plugin/docs/rules/no-invalid-void-type.md b/packages/eslint-plugin/docs/rules/no-invalid-void-type.md index 0b4f9338522..d2b60d59e68 100644 --- a/packages/eslint-plugin/docs/rules/no-invalid-void-type.md +++ b/packages/eslint-plugin/docs/rules/no-invalid-void-type.md @@ -1,22 +1,19 @@ +--- +description: 'Disallow `void` type outside of generic or return types.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/no-invalid-void-type** for documentation. -Disallows usage of `void` type outside of return types or generic type arguments. -If `void` is used as return type, it shouldn’t be a part of intersection/union type with most other types. - -## Rationale - -The `void` type means “nothing” or that a function does not return any value, -in contrast with implicit `undefined` type which means that a function returns a value `undefined`. -So “nothing” cannot be mixed with any other types, other than `never`, which accepts all types. -If you need this - use the `undefined` type instead. +`void` in TypeScript refers to a function return that is meant to be ignored. +Attempting to use a `void` type outside of a return type or generic type argument is often a sign of programmer error. +`void` can also be misleading for other developers even if used correctly. -## Rule Details +> The `void` type means cannot be mixed with any other types, other than `never`, which accepts all types. +> If you think you need this then you probably want the `undefined` type instead. -This rule aims to ensure that the `void` type is only used in valid places. - -Examples of code for this rule: +## Examples @@ -57,18 +54,6 @@ type stillVoid = void | never; ## Options -```ts -interface Options { - allowInGenericTypeArguments?: boolean | string[]; - allowAsThisParameter?: boolean; -} - -const defaultOptions: Options = { - allowInGenericTypeArguments: true, - allowAsThisParameter: false, -}; -``` - ### `allowInGenericTypeArguments` This option lets you control if `void` can be used as a valid value for generic type parameters. diff --git a/packages/eslint-plugin/docs/rules/no-loop-func.md b/packages/eslint-plugin/docs/rules/no-loop-func.md index 906ab28e856..e2ba64a8ecd 100644 --- a/packages/eslint-plugin/docs/rules/no-loop-func.md +++ b/packages/eslint-plugin/docs/rules/no-loop-func.md @@ -1,28 +1,12 @@ +--- +description: 'Disallow function declarations that contain unsafe references inside loop statements.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/no-loop-func** for documentation. -## Rule Details +## Examples This rule extends the base [`eslint/no-loop-func`](https://eslint.org/docs/rules/no-loop-func) rule. It adds support for TypeScript types. - -## How to Use - -```jsonc -{ - // note you must disable the base rule as it can report incorrect errors - "no-loop-func": "off", - "@typescript-eslint/no-loop-func": ["error"] -} -``` - -## Options - -See [`eslint/no-loop-func` options](https://eslint.org/docs/rules/no-loop-func#options). - - - -Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/docs/rules/no-loop-func.md) - - diff --git a/packages/eslint-plugin/docs/rules/no-loss-of-precision.md b/packages/eslint-plugin/docs/rules/no-loss-of-precision.md index bf0ed85f39d..f8db7ef6021 100644 --- a/packages/eslint-plugin/docs/rules/no-loss-of-precision.md +++ b/packages/eslint-plugin/docs/rules/no-loss-of-precision.md @@ -1,25 +1,12 @@ +--- +description: 'Disallow literal numbers that lose precision.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/no-loss-of-precision** for documentation. -## Rule Details +## Examples This rule extends the base [`eslint/no-loss-of-precision`](https://eslint.org/docs/rules/no-loss-of-precision) rule. It adds support for [numeric separators](https://github.com/tc39/proposal-numeric-separator). -Note that this rule requires ESLint v7. - -## How to Use - -```jsonc -{ - // note you must disable the base rule as it can report incorrect errors - "no-loss-of-precision": "off", - "@typescript-eslint/no-loss-of-precision": ["error"] -} -``` - - - -Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/docs/rules/no-loss-of-precision.md) - - diff --git a/packages/eslint-plugin/docs/rules/no-magic-numbers.md b/packages/eslint-plugin/docs/rules/no-magic-numbers.md index b352b892ffc..258af4dd4cf 100644 --- a/packages/eslint-plugin/docs/rules/no-magic-numbers.md +++ b/packages/eslint-plugin/docs/rules/no-magic-numbers.md @@ -1,8 +1,12 @@ +--- +description: 'Disallow magic numbers.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/no-magic-numbers** for documentation. -## Rule Details +## Examples This rule extends the base [`eslint/no-magic-numbers`](https://eslint.org/docs/rules/no-magic-numbers) rule. It adds support for: @@ -11,24 +15,8 @@ It adds support for: - `enum` members (`enum Foo { bar = 1 }`), - `readonly` class properties (`class Foo { readonly bar = 1 }`). -## How to Use - -```jsonc -{ - // note you must disable the base rule as it can report incorrect errors - "no-magic-numbers": "off", - "@typescript-eslint/no-magic-numbers": [ - "error", - { - /* options */ - } - ] -} -``` - ## Options -See [`eslint/no-magic-numbers` options](https://eslint.org/docs/rules/no-magic-numbers#options). This rule adds the following options: ```ts @@ -141,9 +129,3 @@ Examples of **correct** code for the `{ "ignoreTypeIndexes": true }` option: type Foo = Bar[0]; type Baz = Parameters[2]; ``` - - - -Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/docs/rules/no-magic-numbers.md) - - diff --git a/packages/eslint-plugin/docs/rules/no-meaningless-void-operator.md b/packages/eslint-plugin/docs/rules/no-meaningless-void-operator.md index e0aba22a723..f904c473d66 100644 --- a/packages/eslint-plugin/docs/rules/no-meaningless-void-operator.md +++ b/packages/eslint-plugin/docs/rules/no-meaningless-void-operator.md @@ -1,16 +1,20 @@ +--- +description: 'Disallow the `void` operator except when used to discard a value.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/no-meaningless-void-operator** for documentation. -Disallows the `void` operator when its argument is already of type `void` or `undefined`. - -## Rule Details +`void` in TypeScript refers to a function return that is meant to be ignored. +The `void` operator is a useful tool to convey the programmer's intent to discard a value. +For example, it is recommended as one way of suppressing [`@typescript-eslint/no-floating-promises`](./no-floating-promises.md) instead of adding `.catch()` to a promise. -The `void` operator is a useful tool to convey the programmer's intent to discard a value. For example, it is recommended as one way of suppressing [`@typescript-eslint/no-floating-promises`](./no-floating-promises.md) instead of adding `.catch()` to a promise. +This rule helps an authors catch API changes where previously a value was being discarded at a call site, but the callee changed so it no longer returns a value. +When combined with [no-unused-expressions](https://eslint.org/docs/rules/no-unused-expressions), it also helps _readers_ of the code by ensuring consistency: a statement that looks like `void foo();` is **always** discarding a return value, and a statement that looks like `foo();` is **never** discarding a return value. +This rule reports on any `void` operator whose argument is already of type `void` or `undefined`. -This rule helps an author catch API changes where previously a value was being discarded at a call site, but the callee changed so it no longer returns a value. When combined with [no-unused-expressions](https://eslint.org/docs/rules/no-unused-expressions), it also helps _readers_ of the code by ensuring consistency: a statement that looks like `void foo();` is **always** discarding a return value, and a statement that looks like `foo();` is **never** discarding a return value. - -Examples of code for this rule: +## Examples @@ -40,17 +44,4 @@ void bar(); // discarding a number ## Options -This rule accepts a single object option with the following default configuration: - -```json -{ - "@typescript-eslint/no-meaningless-void-operator": [ - "error", - { - "checkNever": false - } - ] -} -``` - -- `checkNever: true` will suggest removing `void` when the argument has type `never`. +`checkNever: true` will suggest removing `void` when the argument has type `never`. diff --git a/packages/eslint-plugin/docs/rules/no-misused-new.md b/packages/eslint-plugin/docs/rules/no-misused-new.md index b79af1f3eb3..a311c40be7a 100644 --- a/packages/eslint-plugin/docs/rules/no-misused-new.md +++ b/packages/eslint-plugin/docs/rules/no-misused-new.md @@ -1,19 +1,25 @@ +--- +description: 'Enforce valid definition of `new` and `constructor`.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/no-misused-new** for documentation. -Warns on apparent attempts to define constructors for interfaces or `new` for classes. +JavaScript classes may define a `constructor` method that runs when a class instance is newly created. +TypeScript allows interfaces that describe a static class object to define a `new()` method (though this is rarely used in real world code). +Developers new to JavaScript classes and/or TypeScript interfaces may sometimes confuse when to use `constructor` or `new`. -## Rule Details +This rule reports when a class defines a method named `new` or an interface defines a method named `constructor`. -Examples of code for this rule: +## Examples ### ❌ Incorrect ```ts -class C { +declare class C { new(): C; } @@ -26,23 +32,15 @@ interface I { ### ✅ Correct ```ts -class C { - constructor() {} +declare class C { + constructor(); } + interface I { new (): C; } ``` -## Options - -```jsonc -// .eslintrc.json -{ - "rules": { - "@typescript-eslint/no-misused-new": "error" - } -} -``` +## When Not To Use It -This rule is not configurable. +If you intentionally want a class with a `new` method, and you're confident nobody working in your code will mistake it with a constructor. diff --git a/packages/eslint-plugin/docs/rules/no-misused-promises.md b/packages/eslint-plugin/docs/rules/no-misused-promises.md index 62156bc8f13..72d4e5c670b 100644 --- a/packages/eslint-plugin/docs/rules/no-misused-promises.md +++ b/packages/eslint-plugin/docs/rules/no-misused-promises.md @@ -1,3 +1,7 @@ +--- +description: 'Disallow Promises in places not designed to handle them.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/no-misused-promises** for documentation. @@ -11,40 +15,8 @@ functions are handled/awaited. See [`no-floating-promises`](./no-floating-promises.md) for detecting unhandled Promise _statements_. ::: -## Rule Details - -This rule accepts a single option which is an object with `checksConditionals`, -`checksVoidReturn`, and `checksSpreads` properties indicating which types of -misuse to flag. All are enabled by default. - ## Options -```ts -type Options = [ - { - checksConditionals?: boolean; - checksVoidReturn?: boolean | ChecksVoidReturnOptions; - checksSpreads?: boolean; - }, -]; - -interface ChecksVoidReturnOptions { - arguments?: boolean; - attributes?: boolean; - properties?: boolean; - returns?: boolean; - variables?: boolean; -} - -const defaultOptions: Options = [ - { - checksConditionals: true, - checksVoidReturn: true, - checksSpreads: true, - }, -]; -``` - ### `"checksConditionals"` If you don't want to check conditionals, you can configure the rule with `"checksConditionals": false`: @@ -62,6 +34,45 @@ If you don't want to check conditionals, you can configure the rule with `"check Doing so prevents the rule from looking at code like `if (somePromise)`. +Examples of code for this rule with `checksConditionals: true`: + + + +#### ❌ Incorrect + +```ts +const promise = Promise.resolve('value'); + +if (promise) { + // Do something +} + +const val = promise ? 123 : 456; + +while (promise) { + // Do something +} +``` + +#### ✅ Correct + +```ts +const promise = Promise.resolve('value'); + +// Always `await` the Promise in a conditional +if (await promise) { + // Do something +} + +const val = (await promise) ? 123 : 456; + +while (await promise) { + // Do something +} +``` + + + ### `"checksVoidReturn"` Likewise, if you don't want functions that return promises where a void return is @@ -103,64 +114,6 @@ For example, if you don't mind that passing a `() => Promise` to a `() => } ``` -### `"checksSpreads"` - -If you don't want to check object spreads, you can add this configuration: - -```json -{ - "@typescript-eslint/no-misused-promises": [ - "error", - { - "checksSpreads": false - } - ] -} -``` - -### `checksConditionals: true` - -Examples of code for this rule with `checksConditionals: true`: - - - -#### ❌ Incorrect - -```ts -const promise = Promise.resolve('value'); - -if (promise) { - // Do something -} - -const val = promise ? 123 : 456; - -while (promise) { - // Do something -} -``` - -#### ✅ Correct - -```ts -const promise = Promise.resolve('value'); - -// Always `await` the Promise in a conditional -if (await promise) { - // Do something -} - -const val = (await promise) ? 123 : 456; - -while (await promise) { - // Do something -} -``` - - - -### `checksVoidReturn: true` - Examples of code for this rule with `checksVoidReturn: true`: @@ -229,7 +182,20 @@ eventEmitter.on('some-event', () => { -### `checksSpreads: true` +### `"checksSpreads"` + +If you don't want to check object spreads, you can add this configuration: + +```json +{ + "@typescript-eslint/no-misused-promises": [ + "error", + { + "checksSpreads": false + } + ] +} +``` Examples of code for this rule with `checksSpreads: true`: diff --git a/packages/eslint-plugin/docs/rules/no-namespace.md b/packages/eslint-plugin/docs/rules/no-namespace.md index f59c865c5b7..e5f2d431d57 100644 --- a/packages/eslint-plugin/docs/rules/no-namespace.md +++ b/packages/eslint-plugin/docs/rules/no-namespace.md @@ -1,26 +1,20 @@ +--- +description: 'Disallow TypeScript namespaces.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/no-namespace** for documentation. -Custom TypeScript modules (`module foo {}`) and namespaces (`namespace foo {}`) are considered outdated -ways to organize TypeScript code. ES2015 module syntax is now preferred (`import`/`export`). - -This rule still allows the use of TypeScript module declarations to describe external APIs (`declare module 'foo' {}`). - -## Rule Details - -This rule aims to standardize the way modules are declared. +TypeScript historically allowed a form of code organization called "custom modules" (`module Example {}`), later renamed to "namespaces" (`namespace Example`). +Namespaces are an outdated way to organize TypeScript code. +ES2015 module syntax is now preferred (`import`/`export`). -## Options - -This rule, in its default state, does not require any argument. If you would like to enable one -or more of the following you may pass an object with the options set as follows: +> This rule does not report on the use of TypeScript module declarations to describe external APIs (`declare module 'foo' {}`). -- `allowDeclarations` set to `true` will allow you to `declare` custom TypeScript modules and namespaces (Default: `false`). -- `allowDefinitionFiles` set to `true` will allow you to `declare` and use custom TypeScript modules and namespaces - inside definition files (Default: `true`). +## Examples -Examples of code for the default `{ "allowDeclarations": false, "allowDefinitionFiles": true }` options: +Examples of code with the default options: @@ -44,9 +38,11 @@ declare module 'foo' {} +## Options + ### `allowDeclarations` -Examples of code for the `{ "allowDeclarations": true }` option: +Examples of code with the `{ "allowDeclarations": true }` option: diff --git a/packages/eslint-plugin/docs/rules/no-non-null-asserted-nullish-coalescing.md b/packages/eslint-plugin/docs/rules/no-non-null-asserted-nullish-coalescing.md index b9008a8f78c..09bf9be3be8 100644 --- a/packages/eslint-plugin/docs/rules/no-non-null-asserted-nullish-coalescing.md +++ b/packages/eslint-plugin/docs/rules/no-non-null-asserted-nullish-coalescing.md @@ -1,21 +1,21 @@ +--- +description: 'Disallow non-null assertions in the left operand of a nullish coalescing operator.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/no-non-null-asserted-nullish-coalescing** for documentation. -## Rule Details - -The nullish coalescing operator is designed to provide a default value when dealing with `null` or `undefined`. -Using non-null assertions in the left operand of the nullish coalescing operator is redundant. +The `??` nullish coalescing runtime operator allows providing a default value when dealing with `null` or `undefined`. +Using a `!` non-null assertion type operator in the left operand of a nullish coalescing operator is redundant, and likely a sign of programmer error or confusion over the two operators. -Examples of code for this rule: +## Examples ### ❌ Incorrect ```ts -/* eslint @typescript-eslint/no-non-null-asserted-nullish-coalescing: "error" */ - foo! ?? bar; foo.bazz! ?? bar; foo!.bazz! ?? bar; @@ -32,8 +32,6 @@ x! ?? ''; ### ✅ Correct ```ts -/* eslint @typescript-eslint/no-non-null-asserted-nullish-coalescing: "error" */ - foo ?? bar; foo ?? bar!; foo!.bazz ?? bar; @@ -45,23 +43,6 @@ let x: string; x! ?? ''; ``` -## Options - -```jsonc -// .eslintrc.json -{ - "rules": { - "@typescript-eslint/no-non-null-asserted-nullish-coalescing": "warn" - } -} -``` - -This rule is not configurable. - -## When Not To Use It - -If you are not using TypeScript 3.7 (or greater), then you will not need to use this rule, as the nullish coalescing operator is not supported. - ## Further Reading - [TypeScript 3.7 Release Notes](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-7.html) diff --git a/packages/eslint-plugin/docs/rules/no-non-null-asserted-optional-chain.md b/packages/eslint-plugin/docs/rules/no-non-null-asserted-optional-chain.md index aff4d5b47c4..4a6c1607a94 100644 --- a/packages/eslint-plugin/docs/rules/no-non-null-asserted-optional-chain.md +++ b/packages/eslint-plugin/docs/rules/no-non-null-asserted-optional-chain.md @@ -1,66 +1,34 @@ +--- +description: 'Disallow non-null assertions after an optional chain expression.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/no-non-null-asserted-optional-chain** for documentation. -## Rule Details +`?.` optional chain expressions provide `undefined` if an object is `null` or `undefined`. +Using a `!` non-null assertion to assert the result of an `?.` optional chain expression is non-nullable is likely wrong. -Optional chain expressions are designed to return `undefined` if the optional property is nullish. -Using non-null assertions after an optional chain expression is wrong, and introduces a serious type safety hole into your code. +> Most of the time, either the object was not nullable and did not need the `?.` for its property lookup, or the `!` is incorrect and introducing a type safety hole. -Examples of code for this rule: +## Examples ### ❌ Incorrect ```ts -/* eslint @typescript-eslint/no-non-null-asserted-optional-chain: "error" */ - foo?.bar!; foo?.bar()!; - -// Prior to TS3.9, foo?.bar!.baz meant (foo?.bar).baz - i.e. the non-null assertion is applied to the entire chain so far. -// For TS3.9 and greater, the non-null assertion is only applied to the property itself, so it's safe. -// The following is incorrect code if you're using less than TS3.9 -foo?.bar!.baz; -foo?.bar!(); -foo?.bar!().baz; ``` ### ✅ Correct ```ts -/* eslint @typescript-eslint/no-non-null-asserted-optional-chain: "error" */ - foo?.bar; -(foo?.bar).baz; -foo?.bar(); foo?.bar(); -foo?.bar().baz; - -// The following is correct code if you're using TS3.9 or greater -foo?.bar!.baz; -foo?.bar!(); -foo?.bar!().baz; ``` -## Options - -```jsonc -// .eslintrc.json -{ - "rules": { - "@typescript-eslint/no-non-null-asserted-optional-chain": "error" - } -} -``` - -This rule is not configurable. - -## When Not To Use It - -If you are not using TypeScript 3.7 (or greater), then you will not need to use this rule, as the operator is not supported. - ## Further Reading - [TypeScript 3.7 Release Notes](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-7.html) diff --git a/packages/eslint-plugin/docs/rules/no-non-null-assertion.md b/packages/eslint-plugin/docs/rules/no-non-null-assertion.md index 0eb9b4970c5..874e01605c8 100644 --- a/packages/eslint-plugin/docs/rules/no-non-null-assertion.md +++ b/packages/eslint-plugin/docs/rules/no-non-null-assertion.md @@ -1,50 +1,42 @@ +--- +description: 'Disallow non-null assertions using the `!` postfix operator.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/no-non-null-assertion** for documentation. -## Rule Details - -Using non-null assertions cancels the benefits of the strict null-checking mode. +TypeScript's `!` non-null assertion operator asserts to the type system that an expression is non-nullable, as in not `null` or `undefined`. +Using assertions to tell the type system new information is often a sign that code is not fully type-safe. +It's generally better to structure program logic so that TypeScript understands when values may be nullable. -Examples of code for this rule: +## Examples ### ❌ Incorrect ```ts -interface Foo { - bar?: string; +interface Example { + property?: string; } -const foo: Foo = getFoo(); -const includesBaz: boolean = foo.bar!.includes('baz'); +declare const example: Example; +const includesBaz = example.property!.includes('baz'); ``` ### ✅ Correct ```ts -interface Foo { - bar?: string; +interface Example { + property?: string; } -const foo: Foo = getFoo(); -const includesBaz: boolean = foo.bar?.includes('baz') ?? false; +declare const example: Example; +const includesBaz = example.property?.includes('baz') ?? false; ``` -## Options - -```jsonc -// .eslintrc.json -{ - "rules": { - "@typescript-eslint/no-non-null-assertion": "warn" - } -} -``` - -This rule is not configurable. - ## When Not To Use It -If you don't care about strict null-checking, then you will not need this rule. +If your project does not use the `strictNullChecks` compiler option, this rule is likely useless to you. +If your code is often wildly incorrect with respect to strict null-checking, your code may not yet be ready for this rule. diff --git a/packages/eslint-plugin/docs/rules/no-parameter-properties.md b/packages/eslint-plugin/docs/rules/no-parameter-properties.md index 3eaf0605503..16a91864d59 100644 --- a/packages/eslint-plugin/docs/rules/no-parameter-properties.md +++ b/packages/eslint-plugin/docs/rules/no-parameter-properties.md @@ -1,11 +1,20 @@ +--- +description: 'Disallow the use of parameter properties in class constructors.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/no-parameter-properties** for documentation. +:::danger Deprecated + +This rule has been deprecated in favour of the equivalent, better named [`parameter-properties`](./parameter-properties.md) rule. +::: + Parameter properties can be confusing to those new to TypeScript as they are less explicit than other ways of declaring and initializing class members. -## Rule Details +## Examples This rule disallows the use of parameter properties in constructors, forcing the user to explicitly declare all properties in the class. diff --git a/packages/eslint-plugin/docs/rules/no-redeclare.md b/packages/eslint-plugin/docs/rules/no-redeclare.md index 4ebaba2ee5e..faef214667c 100644 --- a/packages/eslint-plugin/docs/rules/no-redeclare.md +++ b/packages/eslint-plugin/docs/rules/no-redeclare.md @@ -1,25 +1,18 @@ +--- +description: 'Disallow variable redeclaration.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/no-redeclare** for documentation. -## Rule Details +## Examples This rule extends the base [`eslint/no-redeclare`](https://eslint.org/docs/rules/no-redeclare) rule. It adds support for TypeScript function overloads, and declaration merging. -## How to Use - -```jsonc -{ - // note you must disable the base rule as it can report incorrect errors - "no-redeclare": "off", - "@typescript-eslint/no-redeclare": ["error"] -} -``` - ## Options -See [`eslint/no-redeclare` options](https://eslint.org/docs/rules/no-redeclare#options). This rule adds the following options: ```ts @@ -78,9 +71,3 @@ type something = string; // eslint-disable-next-line @typescript-eslint/no-redeclare -- intentionally naming the variable the same as the type const something = 2; ``` - - - -Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/docs/rules/no-redeclare.md) - - diff --git a/packages/eslint-plugin/docs/rules/no-redundant-type-constituents.md b/packages/eslint-plugin/docs/rules/no-redundant-type-constituents.md index cbfde25358f..69cd6c83af0 100644 --- a/packages/eslint-plugin/docs/rules/no-redundant-type-constituents.md +++ b/packages/eslint-plugin/docs/rules/no-redundant-type-constituents.md @@ -1,9 +1,11 @@ +--- +description: 'Disallow members of unions and intersections that do nothing or override type information.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/no-redundant-type-constituents** for documentation. -## Rule Details - Some types can override some other types ("constituents") in a union or intersection and/or be overridden by some other types. TypeScript's set theory of types includes cases where a constituent type might be useless in the parent union or intersection. @@ -20,7 +22,7 @@ Within `&` intersections: - literal types "override" any primitive types in an intersection - literal types such as `""` "override" any of their primitive types such as `string` -Examples of code for this rule: +## Examples @@ -62,27 +64,11 @@ type IntersectionNever = string; type IntersectionBooleanLiteral = false; type IntersectionNumberLiteral = 1; type IntersectionStringLiteral = 'foo'; - -type ReturnUnionNever = () => string | never; ``` -## Options - -```jsonc -// .eslintrc.json -{ - "rules": { - "@typescript-eslint/no-redundant-type-constituents": "warn" - } -} -``` - -This rule is not configurable. - ## Limitations This rule plays it safe and only works with bottom types, top types, and comparing literal types to primitive types. -It also does not provide an auto-fixer just yet. ## Further Reading diff --git a/packages/eslint-plugin/docs/rules/no-require-imports.md b/packages/eslint-plugin/docs/rules/no-require-imports.md index 0a3ddd5d2f9..6e75a3d41cd 100644 --- a/packages/eslint-plugin/docs/rules/no-require-imports.md +++ b/packages/eslint-plugin/docs/rules/no-require-imports.md @@ -1,49 +1,37 @@ +--- +description: 'Disallow invocation of `require()`.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/no-require-imports** for documentation. Prefer the newer ES6-style imports over `require()`. -## Rule Details - -Examples of code for this rule: +## Examples ### ❌ Incorrect ```ts -var lib = require('lib'); -let lib2 = require('lib2'); -var lib5 = require('lib5'), - lib6 = require('lib6'); -import lib8 = require('lib8'); +const lib1 = require('lib1'); +const { lib2 } = require('lib2'); +import lib3 = require('lib3'); ``` ### ✅ Correct ```ts -import { l } from 'lib'; -var lib3 = load('not_an_import'); -var lib4 = lib2.subImport; -var lib7 = 700; -import lib9 = lib2.anotherSubImport; -import lib10 from 'lib10'; +import * as lib1 from 'lib1'; +import { lib2 } from 'lib2'; +import * as lib3 from 'lib3'; ``` -## Options - -```jsonc -// .eslintrc.json -{ - "rules": { - "@typescript-eslint/no-require-imports": "warn" - } -} -``` +## When Not To Use It -This rule is not configurable. +If you don't care about using newer module syntax, then you will not need this rule. -## When Not To Use It +## Related To -If you don't care about TypeScript module syntax, then you will not need this rule. +- [`no-var-requires`](./no-var-requires.md) diff --git a/packages/eslint-plugin/docs/rules/no-restricted-imports.md b/packages/eslint-plugin/docs/rules/no-restricted-imports.md index 89f615c194e..900a9cdd030 100644 --- a/packages/eslint-plugin/docs/rules/no-restricted-imports.md +++ b/packages/eslint-plugin/docs/rules/no-restricted-imports.md @@ -1,24 +1,17 @@ +--- +description: 'Disallow specified modules when loaded by `import`.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/no-restricted-imports** for documentation. -## Rule Details +## Examples This rule extends the base [`eslint/no-restricted-imports`](https://eslint.org/docs/rules/no-restricted-imports) rule. -## How to Use - -```jsonc -{ - // note you must disable the base rule as it can report incorrect errors - "no-restricted-imports": "off", - "@typescript-eslint/no-restricted-imports": ["error"] -} -``` - ## Options -See [`eslint/no-restricted-imports` options](https://eslint.org/docs/rules/no-restricted-imports#options). This rule adds the following options: ### `allowTypeImports` diff --git a/packages/eslint-plugin/docs/rules/no-shadow.md b/packages/eslint-plugin/docs/rules/no-shadow.md index 3da0a6bc6fb..1dfadba55aa 100644 --- a/packages/eslint-plugin/docs/rules/no-shadow.md +++ b/packages/eslint-plugin/docs/rules/no-shadow.md @@ -1,25 +1,18 @@ +--- +description: 'Disallow variable declarations from shadowing variables declared in the outer scope.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/no-shadow** for documentation. -## Rule Details +## Examples This rule extends the base [`eslint/no-shadow`](https://eslint.org/docs/rules/no-shadow) rule. It adds support for TypeScript's `this` parameters and global augmentation, and adds options for TypeScript features. -## How to Use - -```jsonc -{ - // note you must disable the base rule as it can report incorrect errors - "no-shadow": "off", - "@typescript-eslint/no-shadow": ["error"] -} -``` - ## Options -See [`eslint/no-shadow` options](https://eslint.org/docs/rules/no-shadow#options). This rule adds the following options: ```ts @@ -86,8 +79,23 @@ const test = 1; type Func = (test: string) => typeof test; ``` - +## FAQ + +### Why does the rule report on enum members that share the same name as a variable in a parent scope? -Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/docs/rules/no-shadow.md) +Reporting on this case isn't a bug - it is completely intentional and correct reporting! The rule reports due to a relatively unknown feature of enums - enum members create a variable within the enum scope so that they can be referenced within the enum without a qualifier. + +To illustrate this with an example: + +```ts +const A = 2; +enum Test { + A = 1, + B = A, +} + +console.log(Test.B); +// what should be logged? +``` - +Naively looking at the above code, it might look like the log should output `2`, because the outer variable `A`'s value is `2` - however, the code instead outputs `1`, which is the value of `Test.A`. This is because the unqualified code `B = A` is equivalent to the fully-qualified code `B = Test.A`. Due to this behavior, the enum member has **shadowed** the outer variable declaration. diff --git a/packages/eslint-plugin/docs/rules/no-this-alias.md b/packages/eslint-plugin/docs/rules/no-this-alias.md index 3433ae28eb0..640d5a6a2b5 100644 --- a/packages/eslint-plugin/docs/rules/no-this-alias.md +++ b/packages/eslint-plugin/docs/rules/no-this-alias.md @@ -1,25 +1,29 @@ +--- +description: 'Disallow aliasing `this`.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/no-this-alias** for documentation. -This rule prohibits assigning variables to `this`. - -## Rule Details - Assigning a variable to `this` instead of properly using arrow lambdas may be a symptom of pre-ES6 practices or not managing scope well. -Instead of storing a reference to `this` and using it inside a `function () {`: +## Examples + + + +### ❌ Incorrect ```js const self = this; -> + setTimeout(function () { - self.doWork(); + self.doWork(); }); ``` -Use `() =>` arrow lambdas, as they preserve `this` scope for you: +### ✅ Correct ```js setTimeout(() => { @@ -27,30 +31,8 @@ setTimeout(() => { }); ``` -Examples of **incorrect** code for this rule: - -(see the rationale above) - -Examples of **correct** code for this rule: - -(see the rationale above) - ## Options -You can pass an object option: - -```jsonc -{ - "@typescript-eslint/no-this-alias": [ - "error", - { - "allowDestructuring": false, // Disallow `const { props, state } = this`; true by default - "allowedNames": ["self"] // Allow `const self = this`; `[]` by default - } - ] -} -``` - ## When Not To Use It If you need to assign `this` to variables, you shouldn’t use this rule. diff --git a/packages/eslint-plugin/docs/rules/no-throw-literal.md b/packages/eslint-plugin/docs/rules/no-throw-literal.md index a95aeb1a06b..f4d189067b9 100644 --- a/packages/eslint-plugin/docs/rules/no-throw-literal.md +++ b/packages/eslint-plugin/docs/rules/no-throw-literal.md @@ -1,3 +1,7 @@ +--- +description: 'Disallow throwing literals as exceptions.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/no-throw-literal** for documentation. @@ -7,12 +11,10 @@ The fundamental benefit of `Error` objects is that they automatically keep track This rule restricts what can be thrown as an exception. When it was first created, it only prevented literals from being thrown (hence the name), but it has now been expanded to only allow expressions which have a possibility of being an `Error` object. With the `allowThrowingAny` and `allowThrowingUnknown`, it can be configured to only allow throwing values which are guaranteed to be an instance of `Error`. -## Rule Details +## Examples This rule is aimed at maintaining consistency when throwing exception by disallowing to throw literals and other expressions which cannot possibly be an `Error` object. -Examples of code for this rule: - ### ❌ Incorrect @@ -85,34 +87,25 @@ class CustomError extends Error { throw new CustomError(); ``` -## How to Use +## Options -```jsonc -{ - // note you must disable the base rule as it can report incorrect errors - "no-throw-literal": "off", - "@typescript-eslint/no-throw-literal": ["error"] -} -``` +This rule adds the following options: -### Options - -```jsonc -{ - "@typescript-eslint/no-throw-literal": [ - "error", - { - "allowThrowingAny": true, // Default is to allow throwing values of type any - "allowThrowingUnknown": true // Default is to allow throwing values of type unknown - } - ] +```ts +interface Options { + /** + * Whether to always allow throwing values typed as `any`. + */ + allowThrowingAny?: boolean; + + /** + * Whether to always allow throwing values typed as `unknown`. + */ + allowThrowingUnknown?: boolean; } -``` - ---- - - -Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/docs/rules/no-throw-literal.md) - - +const defaultOptions: Options = { + allowThrowingAny: false, + allowThrowingUnknown: false, +}; +``` diff --git a/packages/eslint-plugin/docs/rules/no-type-alias.md b/packages/eslint-plugin/docs/rules/no-type-alias.md index e2b95b91738..a9774ebdde1 100644 --- a/packages/eslint-plugin/docs/rules/no-type-alias.md +++ b/packages/eslint-plugin/docs/rules/no-type-alias.md @@ -1,3 +1,7 @@ +--- +description: 'Disallow type aliases.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/no-type-alias** for documentation. @@ -74,25 +78,13 @@ On the other hand, using a type alias as an interface can limit your ability to: Finally, mapping types is an advanced technique and leaving it open can quickly become a pain point in your application. -## Rule Details +## Examples This rule disallows the use of type aliases in favor of interfaces and simplified types (primitives, tuples, unions, intersections, etc). ## Options -This rule, in its default state, does not require any argument. If you would like to enable one -or more of the following you may pass an object with the options set as follows: - -- `allowAliases` set to `"always"` will allow you to do aliasing (Defaults to `"never"`). -- `allowCallbacks` set to `"always"` will allow you to use type aliases with callbacks (Defaults to `"never"`) -- `allowConditionalTypes` set to `"always"` will allow you to use type aliases with conditional types (Defaults to `"never"`) -- `allowConstructors` set to `"always"` will allow you to use type aliases with constructors (Defaults to `"never"`) -- `allowLiterals` set to `"always"` will allow you to use type aliases with literal objects (Defaults to `"never"`) -- `allowMappedTypes` set to `"always"` will allow you to use type aliases as mapping tools (Defaults to `"never"`) -- `allowTupleTypes` set to `"always"` will allow you to use type aliases with tuples (Defaults to `"never"`) -- `allowGenerics` set to `"always"` will allow you to use type aliases with generics (Defaults to `"never"`) - ### `allowAliases` This applies to primitive types and reference types. diff --git a/packages/eslint-plugin/docs/rules/no-unnecessary-boolean-literal-compare.md b/packages/eslint-plugin/docs/rules/no-unnecessary-boolean-literal-compare.md index 80142fe6538..69c9a33441b 100644 --- a/packages/eslint-plugin/docs/rules/no-unnecessary-boolean-literal-compare.md +++ b/packages/eslint-plugin/docs/rules/no-unnecessary-boolean-literal-compare.md @@ -1,26 +1,25 @@ +--- +description: 'Disallow unnecessary equality comparisons against boolean literals.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/no-unnecessary-boolean-literal-compare** for documentation. -Comparing boolean values to boolean literals is unnecessary, those comparisons result in the same booleans. Using the boolean values directly, or via a unary negation (`!value`), is more concise and clearer. - -## Rule Details +Comparing boolean values to boolean literals is unnecessary: those comparisons result in the same booleans. +Using the boolean values directly, or via a unary negation (`!value`), is more concise and clearer. This rule ensures that you do not include unnecessary comparisons with boolean literals. A comparison is considered unnecessary if it checks a boolean literal against any variable with just the `boolean` type. -A comparison is **_not_** considered unnecessary if the type is a union of booleans (`string | boolean`, `someObject | boolean`). - -**Warning**: Do not use this rule when `strictNullChecks` is disabled. -ESLint is not able to distinguish between `false` and `undefined` or `null` values. -This can cause unintended code changes when using autofix. +A comparison is **_not_** considered unnecessary if the type is a union of booleans (`string | boolean`, `SomeObject | boolean`, etc.). -**Note**: Throughout this page, only strict equality (`===` and `!==`) are -used in the examples. However, the implementation of the rule does not -distinguish between strict and loose equality. Any example below that uses -`===` would be treated the same way if `==` was used, and any example below -that uses `!==` would be treated the same way if `!=` was used. +## Examples -Examples of code for this rule: +:::note +Throughout this page, only strict equality (`===` and `!==`) are used in the examples. +However, the implementation of the rule does not distinguish between strict and loose equality. +Any example below that uses `===` would be treated the same way if `==` was used, and `!==` would be treated the same way if `!=` was used. +::: @@ -50,30 +49,10 @@ if (someStringBoolean === true) { ## Options -The rule accepts an options object with the following properties. - -```ts -type Options = { - // if false, comparisons between a nullable boolean variable to `true` will be checked and fixed - allowComparingNullableBooleansToTrue?: boolean; - // if false, comparisons between a nullable boolean variable to `false` will be checked and fixed - allowComparingNullableBooleansToFalse?: boolean; -}; -``` - -### Defaults - This rule always checks comparisons between a boolean variable and a boolean literal. Comparisons between nullable boolean variables and boolean literals are **not** checked by default. -```ts -const defaults = { - allowComparingNullableBooleansToTrue: true, - allowComparingNullableBooleansToFalse: true, -}; -``` - ### `allowComparingNullableBooleansToTrue` Examples of code for this rule with `{ allowComparingNullableBooleansToTrue: false }`: @@ -146,3 +125,9 @@ if (!(someNullCondition ?? true)) { | `nullableBooleanVar !== true` | `!nullableBooleanVar` | Only checked/fixed if the `allowComparingNullableBooleansToTrue` option is `false` | | `nullableBooleanVar === false` | `nullableBooleanVar ?? true` | Only checked/fixed if the `allowComparingNullableBooleansToFalse` option is `false` | | `nullableBooleanVar !== false` | `!(nullableBooleanVar ?? true)` | Only checked/fixed if the `allowComparingNullableBooleansToFalse` option is `false` | + +## Not To Use It + +Do not use this rule when `strictNullChecks` is disabled. +ESLint is not able to distinguish between `false` and `undefined` or `null` values. +This can cause unintended code changes when using autofix. diff --git a/packages/eslint-plugin/docs/rules/no-unnecessary-condition.md b/packages/eslint-plugin/docs/rules/no-unnecessary-condition.md index 2594184ea02..8e052f2379f 100644 --- a/packages/eslint-plugin/docs/rules/no-unnecessary-condition.md +++ b/packages/eslint-plugin/docs/rules/no-unnecessary-condition.md @@ -1,8 +1,13 @@ +--- +description: 'Disallow conditionals where the type is always truthy or always falsy.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/no-unnecessary-condition** for documentation. -Any expression being used as a condition must be able to evaluate as truthy or falsy in order to be considered "necessary". Conversely, any expression that always evaluates to truthy or always evaluates to falsy, as determined by the type of the expression, is considered unnecessary and will be flagged by this rule. +Any expression being used as a condition must be able to evaluate as truthy or falsy in order to be considered "necessary". +Conversely, any expression that always evaluates to truthy or always evaluates to falsy, as determined by the type of the expression, is considered unnecessary and will be flagged by this rule. The following expressions are checked: @@ -10,9 +15,7 @@ The following expressions are checked: - Conditions for `if`, `for`, `while`, and `do-while` statements - Base values of optional chain expressions -## Rule Details - -Examples of code for this rule: +## Examples @@ -70,20 +73,6 @@ function bar(arg?: string | null) { ## Options -```ts -type Options = { - // if true, the rule will ignore constant loop conditions - allowConstantLoopConditions?: boolean; - // if true, the rule will not error when running with a tsconfig that has strictNullChecks turned **off** - allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing?: boolean; -}; - -const defaultOptions: Options = { - allowConstantLoopConditions: false, - allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing: false, -}; -``` - ### `allowConstantLoopConditions` Example of correct code for `{ allowConstantLoopConditions: true }`: diff --git a/packages/eslint-plugin/docs/rules/no-unnecessary-qualifier.md b/packages/eslint-plugin/docs/rules/no-unnecessary-qualifier.md index 31905c485f4..6ca2afe17f5 100644 --- a/packages/eslint-plugin/docs/rules/no-unnecessary-qualifier.md +++ b/packages/eslint-plugin/docs/rules/no-unnecessary-qualifier.md @@ -1,32 +1,21 @@ +--- +description: 'Disallow unnecessary namespace qualifiers.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/no-unnecessary-qualifier** for documentation. -## Rule Details - -This rule aims to let users know when a namespace or enum qualifier is unnecessary, -whether used for a type or for a value. +Members of TypeScript enums and namespaces are generally retrieved as qualified property lookups: e.g. `Enum.member`. +However, when accessed within their parent enum or namespace, the qualifier is unnecessary: e.g. just `member` instead of `Enum.member`. +This rule reports when an enum or namespace qualifier is unnecessary. -Examples of code for this rule: +## Examples ### ❌ Incorrect -```ts -namespace A { - export type B = number; - const x: A.B = 3; -} -``` - -```ts -namespace A { - export const x = 3; - export const y = A.x; -} -``` - ```ts enum A { B, @@ -36,59 +25,27 @@ enum A { ```ts namespace A { - export namespace B { - export type T = number; - const x: A.B.T = 3; - } + export type B = number; + const x: A.B = 3; } ``` ### ✅ Correct -```ts -namespace X { - export type T = number; -} - -namespace Y { - export const x: X.T = 3; -} -``` - ```ts enum A { - X, - Y, -} - -enum B { - Z = A.X, + B, + C = B, } ``` ```ts -namespace X { - export type T = number; - namespace Y { - type T = string; - const x: X.T = 0; - } -} -``` - -## Options - -```jsonc -// .eslintrc.json -{ - "rules": { - "@typescript-eslint/no-unnecessary-qualifier": "warn" - } +namespace A { + export type B = number; + const x: B = 3; } ``` -This rule is not configurable. - ## When Not To Use It -If you don't care about having unneeded namespace or enum qualifiers, then you don't need to use this rule. +If you don't care about having unneeded enum or namespace qualifiers, then you don't need to use this rule. diff --git a/packages/eslint-plugin/docs/rules/no-unnecessary-type-arguments.md b/packages/eslint-plugin/docs/rules/no-unnecessary-type-arguments.md index 6f15d149375..43526aec571 100644 --- a/packages/eslint-plugin/docs/rules/no-unnecessary-type-arguments.md +++ b/packages/eslint-plugin/docs/rules/no-unnecessary-type-arguments.md @@ -1,21 +1,22 @@ +--- +description: 'Disallow type arguments that are equal to the default.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/no-unnecessary-type-arguments** for documentation. -Warns if an explicitly specified type argument is the default for that type parameter. - -## Rule Details - Type parameters in TypeScript may specify a default value. For example: ```ts -function f() {} +function f(...) {...} ``` -It is redundant to provide an explicit type parameter equal to that default. +It is redundant to provide an explicit type parameter equal to that default: e.g. calling `f(...)`. +This rule reports when an explicitly specified type argument is the default for that type parameter. -Examples of code for this rule: +## Examples @@ -24,15 +25,21 @@ Examples of code for this rule: ```ts function f() {} f(); +``` +```ts function g() {} g(); +``` +```ts class C {} -function h(c: C) {} new C(); + class D extends C {} +``` +```ts interface I {} class Impl implements I {} ``` @@ -41,28 +48,26 @@ class Impl implements I {} ```ts function f() {} +f(); f(); +``` +```ts function g() {} +g(); g(); +``` +```ts class C {} +new C(); new C(); + +class D extends C {} class D extends C {} +``` +```ts interface I {} class Impl implements I {} ``` - -## Options - -```jsonc -// .eslintrc.json -{ - "rules": { - "@typescript-eslint/no-unnecessary-type-arguments": "warn" - } -} -``` - -This rule is not configurable. diff --git a/packages/eslint-plugin/docs/rules/no-unnecessary-type-assertion.md b/packages/eslint-plugin/docs/rules/no-unnecessary-type-assertion.md index b8e91cf74c4..72698d8980a 100644 --- a/packages/eslint-plugin/docs/rules/no-unnecessary-type-assertion.md +++ b/packages/eslint-plugin/docs/rules/no-unnecessary-type-assertion.md @@ -1,14 +1,16 @@ +--- +description: 'Disallow type assertions that do not change the type of an expression.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/no-unnecessary-type-assertion** for documentation. -This rule prohibits using a type assertion that does not change the type of an expression. - -## Rule Details - -This rule aims to prevent unnecessary type assertions. +TypeScript can be told an expression is a different type than expected using `as` type assertions. +Leaving `as` assertions in the codebase increases visual clutter and harms code readability, so it's generally best practice to remove them if they don't change the type of an expression. +This rule reports when a type assertion does not change the type of an expression. -Examples of code for this rule: +## Examples @@ -61,9 +63,9 @@ function foo(x: number | undefined): number { ## Options -This rule optionally takes an object with a single property `typesToIgnore`, which can be set to a list of type names to ignore. +### `typesToIgnore` -For example, with `@typescript-eslint/no-unnecessary-type-assertion: ["error", { typesToIgnore: ['Foo'] }]`, the following is **correct** code": +With `@typescript-eslint/no-unnecessary-type-assertion: ["error", { typesToIgnore: ['Foo'] }]`, the following is **correct** code": ```ts type Foo = 3; diff --git a/packages/eslint-plugin/docs/rules/no-unnecessary-type-constraint.md b/packages/eslint-plugin/docs/rules/no-unnecessary-type-constraint.md index 4cd813ec0d6..b8672d945d5 100644 --- a/packages/eslint-plugin/docs/rules/no-unnecessary-type-constraint.md +++ b/packages/eslint-plugin/docs/rules/no-unnecessary-type-constraint.md @@ -1,18 +1,16 @@ +--- +description: 'Disallow unnecessary constraints on generic types.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/no-unnecessary-type-constraint** for documentation. -## Rule Details - -Type parameters (``) may be "constrained" with an `extends` keyword ([docs](https://www.typescriptlang.org/docs/handbook/generics.html#generic-constraints)). -When not provided, type parameters happen to default to: - -- As of TypeScript 3.9: `unknown` ([docs](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-9.html#type-parameters-that-extend-any-no-longer-act-as-any)) -- Before that, as of 3.5: `any` ([docs](https://devblogs.microsoft.com/typescript/announcing-typescript-3-5/#breaking-changes)) +Generic type parameters (``) in TypeScript may be "constrained" with an [`extends` keyword](https://www.typescriptlang.org/docs/handbook/generics.html#generic-constraints). +When no `extends` is provided, type parameters default a constraint to `any`. +It is therefore redundant to `extend` from `any`. -It is therefore redundant to `extend` from these types in later versions of TypeScript. - -Examples of code for this rule: +## Examples @@ -20,24 +18,16 @@ Examples of code for this rule: ```ts interface FooAny {} -interface FooUnknown {} type BarAny = {}; -type BarUnknown = {}; class BazAny { - quxUnknown() {} -} - -class BazUnknown { - quxUnknown() {} + quxAny() {} } const QuuxAny = () => {}; -const QuuxUnknown = () => {}; function QuuzAny() {} -function QuuzUnknown() {} ``` ### ✅ Correct @@ -48,7 +38,7 @@ interface Foo {} type Bar = {}; class Baz { - qux { } + qux { } } const Quux = () => {}; @@ -56,19 +46,6 @@ const Quux = () => {}; function Quuz() {} ``` -## Options - -```jsonc -// .eslintrc.json -{ - "rules": { - "@typescript-eslint/no-unnecessary-type-constraint": "error" - } -} -``` - -This rule is not configurable. - ## When Not To Use It If you don't care about the specific styles of your type constraints, or never use them in the first place, then you will not need this rule. diff --git a/packages/eslint-plugin/docs/rules/no-unsafe-argument.md b/packages/eslint-plugin/docs/rules/no-unsafe-argument.md index 15e1c82e7ff..6390409827a 100644 --- a/packages/eslint-plugin/docs/rules/no-unsafe-argument.md +++ b/packages/eslint-plugin/docs/rules/no-unsafe-argument.md @@ -1,17 +1,24 @@ +--- +description: 'Disallow calling a function with a value with type `any`.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/no-unsafe-argument** for documentation. +The `any` type in TypeScript is a dangerous "escape hatch" from the type system. +Using `any` disables many type checking rules and is generally best used only as a last resort or when prototyping code. + Despite your best intentions, the `any` type can sometimes leak into your codebase. -Call a function with `any` typed argument are not checked at all by TypeScript, so it creates a potential safety hole, and source of bugs in your codebase. +Calling a function with an `any` typed argument creates a potential safety hole and source of bugs. -## Rule Details +This rule disallows calling a function with `any` in its arguments. +That includes spreading arrays or tuples with `any` typed elements as function arguments. -This rule disallows calling a function with `any` in its arguments, and it will disallow spreading `any[]`. -This rule also disallows spreading a tuple type with one of its elements typed as `any`. -This rule also compares the argument's type to the variable's type to ensure you don't pass an unsafe `any` in a generic position to a receiver that's expecting a specific type. For example, it will error if you assign `Set` to an argument declared as `Set`. +This rule also compares generic type argument types to ensure you don't pass an unsafe `any` in a generic position to a receiver that's expecting a specific type. +For example, it will error if you pass `Set` as an argument to a parameter declared as `Set`. -Examples of code for this rule: +## Examples @@ -64,26 +71,13 @@ foo(new Set(), new Map()); There are cases where the rule allows passing an argument of `any` to `unknown`. -Example of `any` to `unknown` assignment that are allowed. +Example of `any` to `unknown` assignment that are allowed: ```ts declare function foo(arg1: unknown, arg2: Set, arg3: unknown[]): void; foo(1 as any, new Set(), [] as any[]); ``` -## Options - -```jsonc -// .eslintrc.json -{ - "rules": { - "@typescript-eslint/no-unsafe-argument": "error" - } -} -``` - -This rule is not configurable. - ## Related To - [`no-explicit-any`](./no-explicit-any.md) diff --git a/packages/eslint-plugin/docs/rules/no-unsafe-assignment.md b/packages/eslint-plugin/docs/rules/no-unsafe-assignment.md index 309d0b13d2e..98228f81683 100644 --- a/packages/eslint-plugin/docs/rules/no-unsafe-assignment.md +++ b/packages/eslint-plugin/docs/rules/no-unsafe-assignment.md @@ -1,16 +1,23 @@ +--- +description: 'Disallow assigning a value with type `any` to variables and properties.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/no-unsafe-assignment** for documentation. -Despite your best intentions, the `any` type can sometimes leak into your codebase. -Assigning an `any` typed value to a variable can be hard to pick up on, particularly if it leaks in from an external library. Operations on the variable will not be checked at all by TypeScript, so it creates a potential safety hole, and source of bugs in your codebase. +The `any` type in TypeScript is a dangerous "escape hatch" from the type system. +Using `any` disables many type checking rules and is generally best used only as a last resort or when prototyping code. -## Rule Details +Despite your best intentions, the `any` type can sometimes leak into your codebase. +Assigning an `any` typed value to a variable can be hard to pick up on, particularly if it leaks in from an external library. This rule disallows assigning `any` to a variable, and assigning `any[]` to an array destructuring. -This rule also compares the assigned type to the variable's type to ensure you don't assign an unsafe `any` in a generic position to a receiver that's expecting a specific type. For example, it will error if you assign `Set` to a variable declared as `Set`. -Examples of code for this rule: +This rule also compares generic type argument types to ensure you don't pass an unsafe `any` in a generic position to a receiver that's expecting a specific type. +For example, it will error if you assign `Set` to a variable declared as `Set`. + +## Examples @@ -66,7 +73,7 @@ const x: Set>> = new Set>>(); There are cases where the rule allows assignment of `any` to `unknown`. -Example of `any` to `unknown` assignment that are allowed. +Example of `any` to `unknown` assignment that are allowed: ```ts const x: unknown = y as any; @@ -74,19 +81,6 @@ const x: unknown[] = y as any[]; const x: Set = y as Set; ``` -## Options - -```jsonc -// .eslintrc.json -{ - "rules": { - "@typescript-eslint/no-unsafe-assignment": "error" - } -} -``` - -This rule is not configurable. - ## Related To - [`no-explicit-any`](./no-explicit-any.md) diff --git a/packages/eslint-plugin/docs/rules/no-unsafe-call.md b/packages/eslint-plugin/docs/rules/no-unsafe-call.md index 103aa55e7b2..8fddb2774b6 100644 --- a/packages/eslint-plugin/docs/rules/no-unsafe-call.md +++ b/packages/eslint-plugin/docs/rules/no-unsafe-call.md @@ -1,15 +1,20 @@ +--- +description: 'Disallow calling a value with type `any`.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/no-unsafe-call** for documentation. -Despite your best intentions, the `any` type can sometimes leak into your codebase. -The arguments to, and return value of calling an `any` typed variable are not checked at all by TypeScript, so it creates a potential safety hole, and source of bugs in your codebase. +The `any` type in TypeScript is a dangerous "escape hatch" from the type system. +Using `any` disables many type checking rules and is generally best used only as a last resort or when prototyping code. -## Rule Details +Despite your best intentions, the `any` type can sometimes leak into your codebase. +Calling an `any`-typed value as a function creates a potential type safety hole and source of bugs in your codebase. -This rule disallows calling any variable that is typed as `any`. +This rule disallows calling any value that is typed as `any`. -Examples of code for this rule: +## Examples @@ -48,19 +53,6 @@ new Map(); String.raw`foo`; ``` -## Options - -```jsonc -// .eslintrc.json -{ - "rules": { - "@typescript-eslint/no-unsafe-call": "error" - } -} -``` - -This rule is not configurable. - ## Related To - [`no-explicit-any`](./no-explicit-any.md) diff --git a/packages/eslint-plugin/docs/rules/no-unsafe-declaration-merging.md b/packages/eslint-plugin/docs/rules/no-unsafe-declaration-merging.md new file mode 100644 index 00000000000..9c917aa3ee0 --- /dev/null +++ b/packages/eslint-plugin/docs/rules/no-unsafe-declaration-merging.md @@ -0,0 +1,54 @@ +--- +description: 'Disallow unsafe declaration merging.' +--- + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/no-unsafe-declaration-merging** for documentation. + +TypeScript's "declaration merging" supports merging separate declarations with the same name. + +Declaration merging between classes and interfaces is unsafe. +The TypeScript compiler doesn't check whether properties are initialized, which can cause lead to TypeScript not detecting code that will cause runtime errors. + +```ts +interface Foo { + nums: number[]; +} + +class Foo {} + +const foo = new Foo(); + +foo.nums.push(1); // Runtime Error: Cannot read properties of undefined. +``` + +## Examples + + + +### ❌ Incorrect + +```ts +interface Foo {} + +class Foo {} +``` + +### ✅ Correct + +```ts +interface Foo {} +class Bar implements Foo {} + +namespace Baz {} +namespace Baz {} +enum Baz {} + +namespace Qux {} +function Qux() {} +``` + +## Further Reading + +- [Declaration Merging](https://www.typescriptlang.org/docs/handbook/declaration-merging.html) diff --git a/packages/eslint-plugin/docs/rules/no-unsafe-member-access.md b/packages/eslint-plugin/docs/rules/no-unsafe-member-access.md index c90028aa664..dfefaccd8b4 100644 --- a/packages/eslint-plugin/docs/rules/no-unsafe-member-access.md +++ b/packages/eslint-plugin/docs/rules/no-unsafe-member-access.md @@ -1,15 +1,20 @@ +--- +description: 'Disallow member access on a value with type `any`.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/no-unsafe-member-access** for documentation. -Despite your best intentions, the `any` type can sometimes leak into your codebase. -Member access on `any` typed variables is not checked at all by TypeScript, so it creates a potential safety hole, and source of bugs in your codebase. +The `any` type in TypeScript is a dangerous "escape hatch" from the type system. +Using `any` disables many type checking rules and is generally best used only as a last resort or when prototyping code. -## Rule Details +Despite your best intentions, the `any` type can sometimes leak into your codebase. +Accessing a member of an `any`-typed value creates a potential type safety hole and source of bugs in your codebase. This rule disallows member access on any variable that is typed as `any`. -Examples of code for this rule: +## Examples @@ -54,19 +59,6 @@ arr[idx]; arr[idx++]; ``` -## Options - -```jsonc -// .eslintrc.json -{ - "rules": { - "@typescript-eslint/no-unsafe-member-access": "error" - } -} -``` - -This rule is not configurable. - ## Related To - [`no-explicit-any`](./no-explicit-any.md) diff --git a/packages/eslint-plugin/docs/rules/no-unsafe-return.md b/packages/eslint-plugin/docs/rules/no-unsafe-return.md index d2e5a36f309..796580f23dd 100644 --- a/packages/eslint-plugin/docs/rules/no-unsafe-return.md +++ b/packages/eslint-plugin/docs/rules/no-unsafe-return.md @@ -1,16 +1,23 @@ +--- +description: 'Disallow returning a value with type `any` from a function.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/no-unsafe-return** for documentation. -Despite your best intentions, the `any` type can sometimes leak into your codebase. -Returned `any` typed values are not checked at all by TypeScript, so it creates a potential safety hole, and source of bugs in your codebase. +The `any` type in TypeScript is a dangerous "escape hatch" from the type system. +Using `any` disables many type checking rules and is generally best used only as a last resort or when prototyping code. -## Rule Details +Despite your best intentions, the `any` type can sometimes leak into your codebase. +Returning an an `any`-typed value from a function creates a potential type safety hole and source of bugs in your codebase. This rule disallows returning `any` or `any[]` from a function. -This rule also compares the return type to the function's declared/inferred return type to ensure you don't return an unsafe `any` in a generic position to a receiver that's expecting a specific type. For example, it will error if you return `Set` from a function declared as returning `Set`. -Examples of code for this rule: +This rule also compares generic type argument types to ensure you don't return an unsafe `any` in a generic position to a function that's expecting a specific type. +For example, it will error if you return `Set` from a function declared as returning `Set`. + +## Examples @@ -79,7 +86,7 @@ const assignability2: TAssign = () => new Set(['foo']); There are cases where the rule allows to return `any` to `unknown`. -Examples of `any` to `unknown` return that are allowed. +Examples of `any` to `unknown` return that are allowed: ```ts function foo1(): unknown { @@ -91,19 +98,6 @@ function foo2(): unknown[] { } ``` -## Options - -```jsonc -// .eslintrc.json -{ - "rules": { - "@typescript-eslint/no-unsafe-return": "error" - } -} -``` - -This rule is not configurable. - ## Related To - [`no-explicit-any`](./no-explicit-any.md) diff --git a/packages/eslint-plugin/docs/rules/no-unused-expressions.md b/packages/eslint-plugin/docs/rules/no-unused-expressions.md index 2e6a002ba51..4e439431d45 100644 --- a/packages/eslint-plugin/docs/rules/no-unused-expressions.md +++ b/packages/eslint-plugin/docs/rules/no-unused-expressions.md @@ -1,28 +1,12 @@ +--- +description: 'Disallow unused expressions.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/no-unused-expressions** for documentation. -## Rule Details +## Examples This rule extends the base [`eslint/no-unused-expressions`](https://eslint.org/docs/rules/no-unused-expressions) rule. It adds support for optional call expressions `x?.()`, and directive in module declarations. - -## How to Use - -```jsonc -{ - // note you must disable the base rule as it can report incorrect errors - "no-unused-expressions": "off", - "@typescript-eslint/no-unused-expressions": ["error"] -} -``` - -## Options - -See [`eslint/no-unused-expressions` options](https://eslint.org/docs/rules/no-unused-expressions#options). - - - -Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/docs/rules/no-unused-expressions.md) - - diff --git a/packages/eslint-plugin/docs/rules/no-unused-vars.md b/packages/eslint-plugin/docs/rules/no-unused-vars.md index 4902c1e7259..8fd90f74ae5 100644 --- a/packages/eslint-plugin/docs/rules/no-unused-vars.md +++ b/packages/eslint-plugin/docs/rules/no-unused-vars.md @@ -1,28 +1,12 @@ +--- +description: 'Disallow unused variables.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/no-unused-vars** for documentation. -## Rule Details +## Examples This rule extends the base [`eslint/no-unused-vars`](https://eslint.org/docs/rules/no-unused-vars) rule. It adds support for TypeScript features, such as types. - -## How to Use - -```jsonc -{ - // note you must disable the base rule as it can report incorrect errors - "no-unused-vars": "off", - "@typescript-eslint/no-unused-vars": ["error"] -} -``` - -## Options - -See [`eslint/no-unused-vars` options](https://eslint.org/docs/rules/no-unused-vars#options). - - - -Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/docs/rules/no-unused-vars.md) - - diff --git a/packages/eslint-plugin/docs/rules/no-use-before-define.md b/packages/eslint-plugin/docs/rules/no-use-before-define.md index dfc9c354d49..0350658347a 100644 --- a/packages/eslint-plugin/docs/rules/no-use-before-define.md +++ b/packages/eslint-plugin/docs/rules/no-use-before-define.md @@ -1,25 +1,18 @@ +--- +description: 'Disallow the use of variables before they are defined.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/no-use-before-define** for documentation. -## Rule Details +## Examples This rule extends the base [`eslint/no-use-before-define`](https://eslint.org/docs/rules/no-use-before-define) rule. It adds support for `type`, `interface` and `enum` declarations. -## How to Use - -```jsonc -{ - // note you must disable the base rule as it can report incorrect errors - "no-use-before-define": "off", - "@typescript-eslint/no-use-before-define": ["error"] -} -``` - ## Options -See [`eslint/no-use-before-define` options](https://eslint.org/docs/rules/no-use-before-define#options). This rule adds the following options: ```ts @@ -102,13 +95,3 @@ type StringOrNumber = string | number; let var2: Enum; enum Enum {} ``` - -### Other Options - -See [`eslint/no-use-before-define` options](https://eslint.org/docs/rules/no-use-before-define#options). - - - -Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/docs/rules/no-use-before-define.md) - - diff --git a/packages/eslint-plugin/docs/rules/no-useless-constructor.md b/packages/eslint-plugin/docs/rules/no-useless-constructor.md index 8892c1c9e29..0f570ab9e59 100644 --- a/packages/eslint-plugin/docs/rules/no-useless-constructor.md +++ b/packages/eslint-plugin/docs/rules/no-useless-constructor.md @@ -1,8 +1,12 @@ +--- +description: 'Disallow unnecessary constructors.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/no-useless-constructor** for documentation. -## Rule Details +## Examples This rule extends the base [`eslint/no-useless-constructor`](https://eslint.org/docs/rules/no-useless-constructor) rule. It adds support for: @@ -11,27 +15,7 @@ It adds support for: - `public` constructors when there is no superclass, - constructors with only parameter properties. -## How to Use - -```jsonc -{ - // note you must disable the base rule as it can report incorrect errors - "no-useless-constructor": "off", - "@typescript-eslint/no-useless-constructor": ["error"] -} -``` - -## Options - -See [`eslint/no-useless-constructor` options](https://eslint.org/docs/rules/no-useless-constructor#options). - - - -Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/docs/rules/no-useless-constructor.md) - - - -## Caveat +### Caveat This lint rule will report on constructors whose sole purpose is to change visibility of a parent constructor. See [discussion on this rule's lack of type information](https://github.com/typescript-eslint/typescript-eslint/issues/3820#issuecomment-917821240) for context. diff --git a/packages/eslint-plugin/docs/rules/no-useless-empty-export.md b/packages/eslint-plugin/docs/rules/no-useless-empty-export.md index 1687bfacc91..9358e954b3f 100644 --- a/packages/eslint-plugin/docs/rules/no-useless-empty-export.md +++ b/packages/eslint-plugin/docs/rules/no-useless-empty-export.md @@ -1,18 +1,22 @@ +--- +description: "Disallow empty exports that don't change anything in a module file." +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/no-useless-empty-export** for documentation. -## Rule Details - An empty `export {}` statement is sometimes useful in TypeScript code to turn a file that would otherwise be a script file into a module file. -Per the TypeScript Handbook [Modules](https://www.typescriptlang.org/docs/handbook/modules.html) page: +Per the [TypeScript Handbook Modules page](https://www.typescriptlang.org/docs/handbook/modules.html): > In TypeScript, just as in ECMAScript 2015, any file containing a top-level import or export is considered a module. > Conversely, a file without any top-level import or export declarations is treated as a script whose contents are available in the global scope (and therefore to modules as well). However, an `export {}` statement does nothing if there are any other top-level import or export statements in a file. -Examples of code for this rule: +This rule reports an `export {}` that doesn't do anything in a file already using ES modules. + +## Examples @@ -37,16 +41,3 @@ export const value = 'Hello, world!'; ```ts import 'some-other-module'; ``` - -## Options - -```jsonc -// .eslintrc.json -{ - "rules": { - "@typescript-eslint/no-useless-empty-export": "warn" - } -} -``` - -This rule is not configurable. diff --git a/packages/eslint-plugin/docs/rules/no-var-requires.md b/packages/eslint-plugin/docs/rules/no-var-requires.md index 247535b011e..7230e4e8aeb 100644 --- a/packages/eslint-plugin/docs/rules/no-var-requires.md +++ b/packages/eslint-plugin/docs/rules/no-var-requires.md @@ -1,12 +1,14 @@ +--- +description: 'Disallow `require` statements except in import statements.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/no-var-requires** for documentation. In other words, the use of forms such as `var foo = require("foo")` are banned. Instead use ES6 style imports or `import foo = require("foo")` imports. -## Rule Details - -Examples of code for this rule: +## Examples @@ -26,19 +28,10 @@ require('foo'); import foo from 'foo'; ``` -## Options - -```jsonc -// .eslintrc.json -{ - "rules": { - "@typescript-eslint/no-var-requires": "error" - } -} -``` +## When Not To Use It -This rule is not configurable. +If you don't care about using newer module syntax, then you will not need this rule. -## When Not To Use It +## Related To -If you don't care about TypeScript module syntax, then you will not need this rule. +- [`no-require-imports`](./no-require-imports.md) diff --git a/packages/eslint-plugin/docs/rules/non-nullable-type-assertion-style.md b/packages/eslint-plugin/docs/rules/non-nullable-type-assertion-style.md index 486f464d77e..8f068f062e6 100644 --- a/packages/eslint-plugin/docs/rules/non-nullable-type-assertion-style.md +++ b/packages/eslint-plugin/docs/rules/non-nullable-type-assertion-style.md @@ -1,12 +1,20 @@ +--- +description: 'Enforce non-null assertions over explicit type casts.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/non-nullable-type-assertion-style** for documentation. -This rule detects when an `as` cast is doing the same job as a `!` would, and suggests fixing the code to be an `!`. +There are two common ways to assert to TypeScript that a value is its type without `null` or `undefined`: + +- `!`: Non-null assertion +- `as`: Traditional type assertion with a coincidentally equivalent type -## Rule Details +`!` non-null assertions are generally preferred for requiring less code and being harder to fall out of sync as types change. +This rule reports when an `as` cast is doing the same job as a `!` would, and suggests fixing the code to be an `!`. -Examples of code for this rule: +## Examples @@ -28,19 +36,6 @@ const definitely = maybe!; const alsoDefinitely = maybe!; ``` -## Options - -```jsonc -// .eslintrc.json -{ - "rules": { - "@typescript-eslint/non-nullable-type-assertion-style": "warn" - } -} -``` - -This rule is not configurable. - ## When Not To Use It If you don't mind having unnecessarily verbose type casts, you can avoid this rule. diff --git a/packages/eslint-plugin/docs/rules/object-curly-spacing.md b/packages/eslint-plugin/docs/rules/object-curly-spacing.md index 31f878363b1..1b333cae45e 100644 --- a/packages/eslint-plugin/docs/rules/object-curly-spacing.md +++ b/packages/eslint-plugin/docs/rules/object-curly-spacing.md @@ -1,28 +1,12 @@ +--- +description: 'Enforce consistent spacing inside braces.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/object-curly-spacing** for documentation. -## Rule Details +## Examples This rule extends the base [`eslint/object-curly-spacing`](https://eslint.org/docs/rules/object-curly-spacing) rule. It adds support for TypeScript's object types. - -## How to Use - -```jsonc -{ - // note you must disable the base rule as it can report incorrect errors - "object-curly-spacing": "off", - "@typescript-eslint/object-curly-spacing": ["error"] -} -``` - -## Options - -See [`eslint/object-curly-spacing` options](https://eslint.org/docs/rules/object-curly-spacing#options). - - - -Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/docs/rules/object-curly-spacing.md) - - diff --git a/packages/eslint-plugin/docs/rules/padding-line-between-statements.md b/packages/eslint-plugin/docs/rules/padding-line-between-statements.md index 69951c37852..5387cacac36 100644 --- a/packages/eslint-plugin/docs/rules/padding-line-between-statements.md +++ b/packages/eslint-plugin/docs/rules/padding-line-between-statements.md @@ -1,34 +1,25 @@ +--- +description: 'Require or disallow padding lines between statements.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/padding-line-between-statements** for documentation. -## Rule Details +## Examples This rule extends the base [`eslint/padding-line-between-statements`](https://eslint.org/docs/rules/padding-line-between-statements) rule. +It adds support for TypeScript constructs such as `interface` and `type`. -**It adds support for TypeScript constructs such as `interface` and `type`.** +## Options -## How to Use +In addition to options provided by ESLint, `interface` and `type` can be used as statement types. -```jsonc -{ - // note you must disable the base rule as it can report incorrect errors - "padding-line-between-statements": "off", - "@typescript-eslint/padding-line-between-statements": [ - "error", - { - "blankLine": "always", - "prev": "var", - "next": "return" - } - ] -} -``` +For example, to add blank lines before interfaces and type definitions: ```jsonc { // Example - Add blank lines before interface and type definitions. - // note you must disable the base rule as it can report incorrect errors "padding-line-between-statements": "off", "@typescript-eslint/padding-line-between-statements": [ "error", @@ -41,16 +32,4 @@ This rule extends the base [`eslint/padding-line-between-statements`](https://es } ``` -## Options - -See [`eslint/padding-line-between-statements` options](https://eslint.org/docs/rules/padding-line-between-statements#options). - -In addition to options provided by ESLint, `interface` and `type` can be used as statement types. - **Note:** ESLint `cjs-export` and `cjs-import` statement types are renamed to `exports` and `require` respectively. - - - -Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/docs/rules/padding-line-between-statements.md) - - diff --git a/packages/eslint-plugin/docs/rules/parameter-properties.md b/packages/eslint-plugin/docs/rules/parameter-properties.md index 3b8e4821ea3..e0e30ddbd3a 100644 --- a/packages/eslint-plugin/docs/rules/parameter-properties.md +++ b/packages/eslint-plugin/docs/rules/parameter-properties.md @@ -1,14 +1,15 @@ +--- +description: 'Require or disallow parameter properties in class constructors.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/parameter-properties** for documentation. -Parameter properties can be confusing to those new to TypeScript as they are less explicit than other ways -of declaring and initializing class members. - -## Rule Details +TypeScript includes a "parameter properties" shorthand for declaring a class constructor parameter and class property in one location. +Parameter properties can be confusing to those new to TypeScript as they are less explicit than other ways of declaring and initializing class members. -This rule disallows the use of parameter properties in constructors, forcing the user to explicitly -declare all properties in the class. +This rule can be configured to always disallow the use of parameter properties or enforce their usage when possible. ## Options diff --git a/packages/eslint-plugin/docs/rules/prefer-as-const.md b/packages/eslint-plugin/docs/rules/prefer-as-const.md index ce6de334544..628c573044c 100644 --- a/packages/eslint-plugin/docs/rules/prefer-as-const.md +++ b/packages/eslint-plugin/docs/rules/prefer-as-const.md @@ -1,12 +1,20 @@ +--- +description: 'Enforce the use of `as const` over literal type.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/prefer-as-const** for documentation. -This rule recommends usage of `const` assertion when type primitive value is equal to type. +There are two common ways to tell TypeScript that a literal value should be interpreted as its literal type (e.g. `2`) rather than general primitive type (e.g. `number`); + +- `as const`: telling TypeScript to infer the literal type automatically +- `as` with the literal type: explicitly telling the literal type to TypeScript -## Rule Details +`as const` is generally preferred, as it doesn't require re-typing the literal value. +This rule reports when an `as` with an explicit literal type can be replaced with an `as const`. -Examples of code for this rule: +## Examples @@ -31,19 +39,6 @@ let foo = { bar: 'baz' }; -## Options - -```jsonc -// .eslintrc.json -{ - "rules": { - "@typescript-eslint/prefer-as-const": "error" - } -} -``` - -This rule is not configurable. - ## When Not To Use It If you are using TypeScript < 3.4 diff --git a/packages/eslint-plugin/docs/rules/prefer-enum-initializers.md b/packages/eslint-plugin/docs/rules/prefer-enum-initializers.md index c16f00bc864..1c4204b665c 100644 --- a/packages/eslint-plugin/docs/rules/prefer-enum-initializers.md +++ b/packages/eslint-plugin/docs/rules/prefer-enum-initializers.md @@ -1,33 +1,19 @@ +--- +description: 'Require each enum member value to be explicitly initialized.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/prefer-enum-initializers** for documentation. -This rule recommends having each `enum`s member value explicitly initialized. - -`enum`s are a practical way to organize semantically related constant values. However, by implicitly defining values, `enum`s can lead to unexpected bugs if it's modified without paying attention to the order of its items. - -## Rule Details - -`enum`s infers sequential numbers automatically when initializers are omitted: - -```ts -enum Status { - Open, // infer 0 - Closed, // infer 1 -} -``` +TypeScript `enum`s are a practical way to organize semantically related constant values. +Members of `enum`s that don't have explicit values are by default given sequentially increasing numbers. -If a new member is added to the top of `Status`, both `Open` and `Closed` would have its values altered: +In projects where the value of `enum` members are important, allowing implicit values for enums can cause bugs if `enum`s are modified over time. -```ts -enum Status { - Pending, // infer 0 - Open, // infer 1 - Closed, // infer 2 -} -``` +This rule recommends having each `enum` member value explicitly initialized. -Examples of code for this rule: +## Examples @@ -71,19 +57,6 @@ enum Color { } ``` -## Options - -```jsonc -// .eslintrc.json -{ - "rules": { - "@typescript-eslint/prefer-enum-initializers": "warn" - } -} -``` - -This rule is not configurable. - ## When Not To Use It If you don't care about `enum`s having implicit values you can safely disable this rule. diff --git a/packages/eslint-plugin/docs/rules/prefer-for-of.md b/packages/eslint-plugin/docs/rules/prefer-for-of.md index 575e45b39e1..83b7846acb0 100644 --- a/packages/eslint-plugin/docs/rules/prefer-for-of.md +++ b/packages/eslint-plugin/docs/rules/prefer-for-of.md @@ -1,56 +1,46 @@ +--- +description: 'Enforce the use of `for-of` loop over the standard `for` loop where possible.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/prefer-for-of** for documentation. -This rule recommends a for-of loop when the loop index is only used to read from an array that is being iterated. - -## Rule Details +Many developers default to writing `for (let i = 0; i < ...` loops to iterate over arrays. +However, in many of those arrays, the loop iterator variable (e.g. `i`) is only used to access the respective element of the array. +In those cases, a `for-of` loop is easier to read and write. -For cases where the index is only used to read from the array being iterated, a for-of loop is easier to read and write. +This rule recommends a for-of loop when the loop index is only used to read from an array that is being iterated. -Examples of code for this rule: +## Examples ### ❌ Incorrect ```js -for (let i = 0; i < arr.length; i++) { - console.log(arr[i]); +declare const array: string[]; + +for (let i = 0; i < array.length; i++) { + console.log(array[i]); } ``` ### ✅ Correct ```js -for (const x of arr) { - console.log(x); -} +declare const array: string[]; -for (let i = 0; i < arr.length; i++) { - // i is used to write to arr, so for-of could not be used. - arr[i] = 0; -} - -for (let i = 0; i < arr.length; i++) { - // i is used independent of arr, so for-of could not be used. - console.log(i, arr[i]); +for (const x of array) { + console.log(x); } -``` - -## Options -```jsonc -// .eslintrc.json -{ - "rules": { - "@typescript-eslint/prefer-for-of": "warn" - } +for (let i = 0; i < array.length; i++) { + // i is used, so for-of could not be used. + console.log(i, array[i]); } ``` -This rule is not configurable. - ## When Not To Use It If you transpile for browsers that do not support for-of loops, you may wish to use traditional for loops that produce more compact code. diff --git a/packages/eslint-plugin/docs/rules/prefer-function-type.md b/packages/eslint-plugin/docs/rules/prefer-function-type.md index 8c0e9de2b5c..5ec8490a487 100644 --- a/packages/eslint-plugin/docs/rules/prefer-function-type.md +++ b/packages/eslint-plugin/docs/rules/prefer-function-type.md @@ -1,37 +1,40 @@ +--- +description: 'Enforce using function types instead of interfaces with call signatures.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/prefer-function-type** for documentation. -## Rule Details +TypeScript allows for two common ways to declare a type for a function: + +- Function type: `() => string` +- Object type with a signature: `{ (): string }` + +The function type form is generally preferred when possible for being more succinct. This rule suggests using a function type instead of an interface or object type literal with a single call signature. -Examples of code for this rule: +## Examples ### ❌ Incorrect ```ts -interface Foo { +interface Example { (): string; } ``` ```ts -function foo(bar: { (): number }): number { - return bar(); +function foo(example: { (): number }): number { + return example(); } ``` ```ts -interface Foo extends Function { - (): void; -} -``` - -```ts -interface MixinMethod { +interface ReturnsSelf { // returns the function itself, not the `this` argument. (arg: string): this; } @@ -40,12 +43,20 @@ interface MixinMethod { ### ✅ Correct ```ts -interface Foo { - (): void; - bar: number; +type Example = () => string; +``` + +```ts +function foo(example: () => number): number { + return bar(); } ``` +```ts +// returns the function itself, not the `this` argument. +type ReturnsSelf = (arg: string) => ReturnsSelf; +``` + ```ts function foo(bar: { (): string; baz: number }): string { return bar(); @@ -61,13 +72,6 @@ interface Bar extends Foo { } ``` -```ts -// returns the `this` argument of function, retaining it's type. -type MixinMethod = (this: TSelf, arg: string) => TSelf; -// a function that returns itself is much clearer in this form. -type ReturnsSelf = (arg: string) => ReturnsSelf; -``` - ```ts // multiple call signatures (overloads) is allowed: interface Overloaded { @@ -78,19 +82,6 @@ interface Overloaded { type Intersection = ((data: string) => number) & ((id: number) => string); ``` -## Options - -```jsonc -// .eslintrc.json -{ - "rules": { - "@typescript-eslint/prefer-function-type": "warn" - } -} -``` - -This rule is not configurable. - ## When Not To Use It If you specifically want to use an interface or type literal with a single call signature for stylistic reasons, you can disable this rule. diff --git a/packages/eslint-plugin/docs/rules/prefer-includes.md b/packages/eslint-plugin/docs/rules/prefer-includes.md index 3eec29ab892..8c1a709c2de 100644 --- a/packages/eslint-plugin/docs/rules/prefer-includes.md +++ b/packages/eslint-plugin/docs/rules/prefer-includes.md @@ -1,35 +1,33 @@ +--- +description: 'Enforce `includes` method over `indexOf` method.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/prefer-includes** for documentation. -Until ES5, we were using `String#indexOf` method to check whether a string contains an arbitrary substring or not. -Until ES2015, we were using `Array#indexOf` method to check whether an array contains an arbitrary value or not. - -ES2015 has added `String#includes` and ES2016 has added `Array#includes`. -It makes code more understandable if we use those `includes` methods for the purpose. - -## Rule Details - -This rule is aimed at suggesting `includes` method if `indexOf` method was used to check whether an object contains an arbitrary value or not. - -If the receiver object of the `indexOf` method call has `includes` method and the two methods have the same parameters, this rule does suggestion. -There are such types: `String`, `Array`, `ReadonlyArray`, and typed arrays. +Prior to ES2015, `Array#indexOf` and `String#indexOf` comparisons against `-1` were the standard ways to check whether a value exists in an array or string, respectively. +Alternatives that are easier to read and write now exist: ES2015 added `String#includes` and ES2016 added `Array#includes`. +This rule reports when an `.indexOf` call can be replaced with an `.includes`. Additionally, this rule reports the tests of simple regular expressions in favor of `String#includes`. -Examples of code for this rule: +> This rule will report on any receiver object of an `indexOf` method call that has an `includes` method where the two methods have the same parameters. +> Matching types include: `String`, `Array`, `ReadonlyArray`, and typed arrays. + +## Examples ### ❌ Incorrect ```ts -let str: string; -let array: any[]; -let readonlyArray: ReadonlyArray; -let typedArray: UInt8Array; -let maybe: string; -let userDefined: { +const str: string; +const array: any[]; +const readonlyArray: ReadonlyArray; +const typedArray: UInt8Array; +const maybe: string; +const userDefined: { indexOf(x: any): number; includes(x: any): boolean; }; @@ -41,48 +39,39 @@ typedArray.indexOf(value) > -1; maybe?.indexOf('') !== -1; userDefined.indexOf(value) >= 0; -// simple RegExp test -/foo/.test(str); +/example/.test(str); ``` ### ✅ Correct ```ts -let array: any[]; -let readonlyArray: ReadonlyArray; -let typedArray: UInt8Array; -let userDefined: { +const str: string; +const array: any[]; +const readonlyArray: ReadonlyArray; +const typedArray: UInt8Array; +const maybe: string; +const userDefined: { indexOf(x: any): number; includes(x: any): boolean; }; -let mismatchExample: { - indexOf(x: any, fromIndex?: number): number; - includes(x: any): boolean; -}; str.includes(value); array.includes(value); readonlyArray.includes(value); typedArray.includes(value); +maybe?.includes(''); userDefined.includes(value); -// the two methods have different parameters. -mismatchExample.indexOf(value) >= 0; -``` - -## Options +str.includes('example'); -```jsonc -// .eslintrc.json -{ - "rules": { - "@typescript-eslint/prefer-includes": "warn" - } -} +// The two methods have different parameters. +declare const mismatchExample: { + indexOf(x: unknown, fromIndex?: number): number; + includes(x: unknown): boolean; +}; +mismatchExample.indexOf(value) >= 0; ``` -This rule is not configurable. - ## When Not To Use It If you don't want to suggest `includes`, you can safely turn this rule off. diff --git a/packages/eslint-plugin/docs/rules/prefer-literal-enum-member.md b/packages/eslint-plugin/docs/rules/prefer-literal-enum-member.md index 31f452be2ef..2c0bd40a33d 100644 --- a/packages/eslint-plugin/docs/rules/prefer-literal-enum-member.md +++ b/packages/eslint-plugin/docs/rules/prefer-literal-enum-member.md @@ -1,8 +1,14 @@ +--- +description: 'Require all enum members to be literal values.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/prefer-literal-enum-member** for documentation. -TypeScript allows the value of an enum member to be many different kinds of valid JavaScript expressions. However, because enums create their own scope whereby each enum member becomes a variable in that scope, unexpected values could be used at runtime. Example: +TypeScript allows the value of an enum member to be many different kinds of valid JavaScript expressions. +However, because enums create their own scope whereby each enum member becomes a variable in that scope, developers are often surprised at the resultant values. +For example: ```ts const imOutside = 2; @@ -17,17 +23,12 @@ enum Foo { } ``` -The answer is that `Foo.c` will be `1` at runtime. The [playground](https://www.typescriptlang.org/play/#src=const%20imOutside%20%3D%202%3B%0D%0Aconst%20b%20%3D%202%3B%0D%0Aenum%20Foo%20%7B%0D%0A%20%20%20%20outer%20%3D%20imOutside%2C%0D%0A%20%20%20%20a%20%3D%201%2C%0D%0A%20%20%20%20b%20%3D%20a%2C%0D%0A%20%20%20%20c%20%3D%20b%2C%0D%0A%20%20%20%20%2F%2F%20does%20c%20%3D%3D%20Foo.b%20%3D%3D%20Foo.c%20%3D%3D%201%3F%0D%0A%20%20%20%20%2F%2F%20or%20does%20c%20%3D%3D%20b%20%3D%3D%202%3F%0D%0A%7D) illustrates this quite nicely. - -## Rule Details - -This rule is meant to prevent unexpected results in code by requiring the use of literal values as enum members to prevent unexpected runtime behavior. Template literals, arrays, objects, constructors, and all other expression types can end up using a variable from its scope or the parent scope, which can result in the same unexpected behavior at runtime. +> The answer is that `Foo.c` will be `1` at runtime [[TypeScript playground](https://www.typescriptlang.org/play/#src=const%20imOutside%20%3D%202%3B%0D%0Aconst%20b%20%3D%202%3B%0D%0Aenum%20Foo%20%7B%0D%0A%20%20%20%20outer%20%3D%20imOutside%2C%0D%0A%20%20%20%20a%20%3D%201%2C%0D%0A%20%20%20%20b%20%3D%20a%2C%0D%0A%20%20%20%20c%20%3D%20b%2C%0D%0A%20%20%20%20%2F%2F%20does%20c%20%3D%3D%20Foo.b%20%3D%3D%20Foo.c%20%3D%3D%201%3F%0D%0A%20%20%20%20%2F%2F%20or%20does%20c%20%3D%3D%20b%20%3D%3D%202%3F%0D%0A%7D)]. -## Options - -- `allowBitwiseExpressions` set to `true` will allow you to use bitwise expressions in enum initializer (Default: `false`). +Therefore, it's often better to prevent unexpected results in code by requiring the use of literal values as enum members. +This rule reports when an enum member is given a value that is not a literal. -Examples of code for this rule: +## Examples @@ -58,13 +59,15 @@ enum Valid { -### `allowBitwiseExpressions` +## Options + +- `allowBitwiseExpressions` set to `true` will allow you to use bitwise expressions in enum initializer (Default: `false`). Examples of code for the `{ "allowBitwiseExpressions": true }` option: -#### ❌ Incorrect +### ❌ Incorrect ```ts const x = 1; @@ -79,7 +82,7 @@ enum Foo { } ``` -#### ✅ Correct +### ✅ Correct ```ts enum Foo { diff --git a/packages/eslint-plugin/docs/rules/prefer-namespace-keyword.md b/packages/eslint-plugin/docs/rules/prefer-namespace-keyword.md index bc7b601934d..f25b124c776 100644 --- a/packages/eslint-plugin/docs/rules/prefer-namespace-keyword.md +++ b/packages/eslint-plugin/docs/rules/prefer-namespace-keyword.md @@ -1,30 +1,44 @@ +--- +description: 'Require using `namespace` keyword over `module` keyword to declare custom TypeScript modules.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/prefer-namespace-keyword** for documentation. -In an effort to prevent further confusion between custom TypeScript modules and the new ES2015 modules, starting -with TypeScript `v1.5` the keyword `namespace` is now the preferred way to declare custom TypeScript modules. +TypeScript historically allowed a form of code organization called "custom modules" (`module Example {}`), later renamed to "namespaces" (`namespace Example`). -## Rule Details +Namespaces are an outdated way to organize TypeScript code. +ES2015 module syntax is now preferred (`import`/`export`). -This rule aims to standardize the way modules are declared. +For projects still using custom modules / namespaces, it's preferred to refer to them as namespaces. +This rule reports when the `module` keyword is used instead of `namespace`. -## When Not To Use It +> This rule does not report on the use of TypeScript module declarations to describe external APIs (`declare module 'foo' {}`). -If you are using the ES2015 module syntax, then you will not need this rule. +## Examples + + + +### ❌ Incorrect + +```ts +module Example {} +``` + +### ✅ Correct -## Options +```ts +namespace Example {} -```jsonc -// .eslintrc.json -{ - "rules": { - "@typescript-eslint/prefer-namespace-keyword": "error" - } -} +declare module 'foo' {} ``` -This rule is not configurable. + + +## When Not To Use It + +If you are using the ES2015 module syntax, then you will not need this rule. ## Further Reading diff --git a/packages/eslint-plugin/docs/rules/prefer-nullish-coalescing.md b/packages/eslint-plugin/docs/rules/prefer-nullish-coalescing.md index c82399072dd..d2fc95f4066 100644 --- a/packages/eslint-plugin/docs/rules/prefer-nullish-coalescing.md +++ b/packages/eslint-plugin/docs/rules/prefer-nullish-coalescing.md @@ -1,66 +1,22 @@ +--- +description: 'Enforce using the nullish coalescing operator instead of logical chaining.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/prefer-nullish-coalescing** for documentation. -TypeScript 3.7 added support for the nullish coalescing operator. -This operator allows you to safely cascade a value when dealing with `null` or `undefined`. - -```ts -function myFunc(foo: string | null) { - return foo ?? 'a string'; -} - -// is equivalent to - -function myFunc(foo: string | null) { - return foo !== null && foo !== undefined ? foo : 'a string'; -} -``` - -Because the nullish coalescing operator _only_ coalesces when the original value is `null` or `undefined`, it is much safer than relying upon logical OR operator chaining `||`; which coalesces on any _falsy_ value: - -```ts -const emptyString = ''; - -const nullish1 = emptyString ?? 'unsafe'; -const logical1 = emptyString || 'unsafe'; - -// nullish1 === '' -// logical1 === 'unsafe' - -declare const nullString: string | null; - -const nullish2 = nullString ?? 'safe'; -const logical2 = nullString || 'safe'; +The `??` nullish coalescing runtime operator allows providing a default value when dealing with `null` or `undefined`. +Because the nullish coalescing operator _only_ coalesces when the original value is `null` or `undefined`, it is much safer than relying upon logical OR operator chaining `||`, which coalesces on any _falsy_ value. -// nullish2 === 'safe' -// logical2 === 'safe' -``` - -## Rule Details +This rule reports when an `||` operator can be safely replaced with a `??`. -This rule aims enforce the usage of the safer operator. +:::caution +This rule will not work as expected if [`strictNullChecks`](https://www.typescriptlang.org/tsconfig#strictNullChecks) is not enabled. +::: ## Options -```ts -type Options = [ - { - ignoreTernaryTests?: boolean; - ignoreConditionalTests?: boolean; - ignoreMixedLogicalExpressions?: boolean; - }, -]; - -const defaultOptions = [ - { - ignoreTernaryTests: true; - ignoreConditionalTests: true, - ignoreMixedLogicalExpressions: true, - }, -]; -``` - ### `ignoreTernaryTests` Setting this option to `true` (the default) will cause the rule to ignore any ternary expressions that could be simplified by using the nullish coalescing operator. diff --git a/packages/eslint-plugin/docs/rules/prefer-optional-chain.md b/packages/eslint-plugin/docs/rules/prefer-optional-chain.md index 730842c1512..4a9ada8b08f 100644 --- a/packages/eslint-plugin/docs/rules/prefer-optional-chain.md +++ b/packages/eslint-plugin/docs/rules/prefer-optional-chain.md @@ -1,56 +1,18 @@ +--- +description: 'Enforce using concise optional chain expressions instead of chained logical ands, negated logical ors, or empty objects.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/prefer-optional-chain** for documentation. -TypeScript 3.7 added support for the optional chain operator. -This operator allows you to safely access properties and methods on objects when they are potentially `null` or `undefined`. - -```ts -type T = { - a?: { - b?: { - c: string; - method?: () => void; - }; - }; -}; - -function myFunc(foo: T | null) { - return foo?.a?.b?.c; -} -// is roughly equivalent to -function myFunc(foo: T | null) { - return foo && foo.a && foo.a.b && foo.a.b.c; -} -// or -function myFunc(foo: T | null) { - return (((foo || {}).a || {}).b || {}).c; -} - -function myFunc(foo: T | null) { - return foo?.['a']?.b?.c; -} -// is roughly equivalent to -function myFunc(foo: T | null) { - return foo && foo['a'] && foo['a'].b && foo['a'].b.c; -} - -function myFunc(foo: T | null) { - return foo?.a?.b?.method?.(); -} -// is roughly equivalent to -function myFunc(foo: T | null) { - return foo && foo.a && foo.a.b && foo.a.b.method && foo.a.b.method(); -} -``` - +`?.` optional chain expressions provide `undefined` if an object is `null` or `undefined`. Because the optional chain operator _only_ chains when the property value is `null` or `undefined`, it is much safer than relying upon logical AND operator chaining `&&`; which chains on any _truthy_ value. +It is also often less code to use `?.` optional chaining than `&&` truthiness checks. -## Rule Details - -This rule aims enforce the usage of the safer operator. +This rule reports on code where an `&&` operator can be safely replaced with `?.` optional chaining. -Examples of code for this rule: +## Examples @@ -61,9 +23,15 @@ foo && foo.a && foo.a.b && foo.a.b.c; foo && foo['a'] && foo['a'].b && foo['a'].b.c; foo && foo.a && foo.a.b && foo.a.b.method && foo.a.b.method(); +// With empty objects (((foo || {}).a || {}).b || {}).c; (((foo || {})['a'] || {}).b || {}).c; +// With negated `or`s +!foo || !foo.bar; +!foo || !foo[bar]; +!foo || !foo.bar || !foo.bar.baz || !foo.bar.baz(); + // this rule also supports converting chained strict nullish checks: foo && foo.a != null && @@ -81,26 +49,21 @@ foo?.['a']?.b?.c; foo?.a?.b?.method?.(); foo?.a?.b?.c?.d?.e; -``` - -**Note:** there are a few edge cases where this rule will false positive. Use your best judgement when evaluating reported errors. -## Options - -```jsonc -// .eslintrc.json -{ - "rules": { - "@typescript-eslint/prefer-optional-chain": "warn" - } -} +!foo?.bar; +!foo?.[bar]; +!foo?.bar?.baz?.(); ``` -This rule is not configurable. + + +:::note +There are a few edge cases where this rule will false positive. Use your best judgement when evaluating reported errors. +::: ## When Not To Use It -If you are not using TypeScript 3.7 (or greater), then you will not be able to use this rule, as the operator is not supported. +If you don't mind using more explicit `&&`s, you don't need this rule. ## Further Reading diff --git a/packages/eslint-plugin/docs/rules/prefer-readonly-parameter-types.md b/packages/eslint-plugin/docs/rules/prefer-readonly-parameter-types.md index 022b4e841bc..b1e912abe37 100644 --- a/packages/eslint-plugin/docs/rules/prefer-readonly-parameter-types.md +++ b/packages/eslint-plugin/docs/rules/prefer-readonly-parameter-types.md @@ -1,3 +1,7 @@ +--- +description: 'Require function parameters to be typed as `readonly` to prevent accidental mutation of inputs.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/prefer-readonly-parameter-types** for documentation. @@ -6,8 +10,6 @@ Mutating function arguments can lead to confusing, hard to debug behavior. Whilst it's easy to implicitly remember to not modify function arguments, explicitly typing arguments as readonly provides clear contract to consumers. This contract makes it easier for a consumer to reason about if a function has side-effects. -## Rule Details - This rule allows you to enforce that function parameters resolve to readonly types. A type is considered readonly if: @@ -17,7 +19,7 @@ A type is considered readonly if: - it is a readonly tuple type whose elements are all considered readonly. - it is an object type whose properties are all marked as readonly, and whose values are all considered readonly. -Examples of code for this rule: +## Examples @@ -127,19 +129,6 @@ interface Foo { ## Options -```ts -interface Options { - checkParameterProperties?: boolean; - ignoreInferredTypes?: boolean; -} - -const defaultOptions: Options = { - checkParameterProperties: true, - ignoreInferredTypes: false, - treatMethodsAsReadonly: false, -}; -``` - ### `checkParameterProperties` This option allows you to enable or disable the checking of parameter properties. diff --git a/packages/eslint-plugin/docs/rules/prefer-readonly.md b/packages/eslint-plugin/docs/rules/prefer-readonly.md index e21f26a278b..774b55b39ff 100644 --- a/packages/eslint-plugin/docs/rules/prefer-readonly.md +++ b/packages/eslint-plugin/docs/rules/prefer-readonly.md @@ -1,15 +1,17 @@ +--- +description: "Require private members to be marked as `readonly` if they're never modified outside of the constructor." +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/prefer-readonly** for documentation. -This rule enforces that private members are marked as `readonly` if they're never modified outside of the constructor. - -## Rule Details - Member variables with the privacy `private` are never permitted to be modified outside of their declaring class. If that class never modifies their value, they may safely be marked as `readonly`. -Examples of code for this rule: +This rule reports on private members are marked as `readonly` if they're never modified outside of the constructor. + +## Examples @@ -52,8 +54,6 @@ class Container { ## Options -This rule, in its default state, does not require any argument. - ### `onlyInlineLambdas` You may pass `"onlyInlineLambdas": true` as a rule option within an object to restrict checking only to members immediately assigned a lambda value. diff --git a/packages/eslint-plugin/docs/rules/prefer-reduce-type-parameter.md b/packages/eslint-plugin/docs/rules/prefer-reduce-type-parameter.md index 5db156aa47f..520a25a653b 100644 --- a/packages/eslint-plugin/docs/rules/prefer-reduce-type-parameter.md +++ b/packages/eslint-plugin/docs/rules/prefer-reduce-type-parameter.md @@ -1,3 +1,7 @@ +--- +description: 'Enforce using type parameter when calling `Array#reduce` instead of casting.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/prefer-reduce-type-parameter** for documentation. @@ -8,18 +12,16 @@ Since these values are empty, their types are not usable: - `[]` has type `never[]`, which can't have items pushed into it as nothing is type `never` - `{}` has type `{}`, which doesn't have an index signature and so can't have properties added to it -A common solution to this problem is to cast the initial value. While this will work, it's not the most optimal -solution as casting has subtle effects on the underlying types that can allow bugs to slip in. +A common solution to this problem is to use an `as` assertion on the initial value. +While this will work, it's not the most optimal solution as type assertions have subtle effects on the underlying types that can allow bugs to slip in. -A better (and lesser known) solution is to pass the type in as a generic parameter to `Array#reduce` explicitly. +A better solution is to pass the type in as a generic type argument to `Array#reduce` explicitly. This means that TypeScript doesn't have to try to infer the type, and avoids the common pitfalls that come with casting. -## Rule Details - -This rule looks for calls to `Array#reduce`, and warns if an initial value is being passed & casted, -suggesting instead to pass the cast type to `Array#reduce` as its generic parameter. +This rule looks for calls to `Array#reduce`, and reports if an initial value is being passed & asserted. +It will suggest instead pass the asserted type to `Array#reduce` as a generic type argument. -Examples of code for this rule: +## Examples @@ -51,19 +53,6 @@ Examples of code for this rule: ); ``` -## Options - -```jsonc -// .eslintrc.json -{ - "rules": { - "@typescript-eslint/prefer-reduce-type-parameter": "warn" - } -} -``` - -This rule is not configurable. - ## When Not To Use It If you don't want to use typechecking in your linting, you can't use this rule. diff --git a/packages/eslint-plugin/docs/rules/prefer-regexp-exec.md b/packages/eslint-plugin/docs/rules/prefer-regexp-exec.md index a487ea3d3e2..0d9f127be38 100644 --- a/packages/eslint-plugin/docs/rules/prefer-regexp-exec.md +++ b/packages/eslint-plugin/docs/rules/prefer-regexp-exec.md @@ -1,20 +1,19 @@ +--- +description: 'Enforce `RegExp#exec` over `String#match` if no global flag is provided.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/prefer-regexp-exec** for documentation. -As `String#match` is defined to be the same as `RegExp#exec` when the regular expression does not include the `g` flag, prefer a consistent usage. - -## Rule Details - -This rule is aimed at enforcing a consistent way to apply regular expressions to strings. - -From [`String#match` on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/match): +`String#match` is defined to work the same as `RegExp#exec` when the regular expression does not include the `g` flag. +Keeping to consistently using one of the two can help improve code readability. -> If the regular expression does not include the g flag, returns the same result as `RegExp.exec()`. +This rule reports when a `String#match` call can be replaced with an equivalent `RegExp#exec`. -`RegExp#exec` may also be slightly faster than `String#match`; this is the reason to choose it as the preferred usage. +> `RegExp#exec` may also be slightly faster than `String#match`; this is the reason to choose it as the preferred usage. -Examples of code for this rule: +## Examples @@ -42,19 +41,6 @@ const search = /thing/; search.exec(text); ``` -## Options - -```jsonc -// .eslintrc.json -{ - "rules": { - "@typescript-eslint/prefer-regexp-exec": "warn" - } -} -``` - -This rule is not configurable. - ## When Not To Use It -If you prefer consistent use of `String#match` for both, with `g` flag and without it, you can turn this rule off. +If you prefer consistent use of `String#match` for both with `g` flag and without it, you can turn this rule off. diff --git a/packages/eslint-plugin/docs/rules/prefer-return-this-type.md b/packages/eslint-plugin/docs/rules/prefer-return-this-type.md index 0581d81ad02..b09c03ba52f 100644 --- a/packages/eslint-plugin/docs/rules/prefer-return-this-type.md +++ b/packages/eslint-plugin/docs/rules/prefer-return-this-type.md @@ -1,13 +1,22 @@ +--- +description: 'Enforce that `this` is used when only `this` type is returned.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/prefer-return-this-type** for documentation. -[Method chaining](https://en.wikipedia.org/wiki/Method_chaining) is a common pattern in OOP languages and TypeScript provides a special [polymorphic this type](https://www.typescriptlang.org/docs/handbook/2/classes.html#this-types). -If any type other than `this` is specified as the return type of these chaining methods, TypeScript will fail to cast it when invoking in subclass. +[Method chaining](https://en.wikipedia.org/wiki/Method_chaining) is a common pattern in OOP languages and TypeScript provides a special [polymorphic `this` type](https://www.typescriptlang.org/docs/handbook/2/classes.html#this-types) to facilitate it. +Class methods that explicitly declare a return type of the class name instead of `this` make it harder for extending classes to call that method: the returned object will be typed as the base class, not the derived class. + +This rule reports when a class method declares a return type of that class name instead of `this`. ```ts class Animal { eat(): Animal { + // ~~~~~~ + // Either removing this type annotation or replacing + // it with `this` would remove the type error below. console.log("I'm moving!"); return this; } @@ -21,33 +30,13 @@ class Cat extends Animal { } const cat = new Cat(); +cat.eat().meow(); +// ~~~~ // Error: Property 'meow' does not exist on type 'Animal'. // because `eat` returns `Animal` and not all animals meow. -cat.eat().meow(); - -// the error can be fixed by removing the return type of `eat` or use `this` as the return type. -class Animal { - eat(): this { - console.log("I'm moving!"); - return this; - } -} - -class Cat extends Animal { - meow(): this { - console.log('Meow~'); - return this; - } -} - -const cat = new Cat(); -// no errors. Because `eat` returns `Cat` now -cat.eat().meow(); ``` -## Rule Details - -Examples of code for this rule: +## Examples @@ -93,19 +82,6 @@ class Derived extends Base { } ``` -## Options - -```jsonc -// .eslintrc.json -{ - "rules": { - "@typescript-eslint/prefer-return-this-type": "warn" - } -} -``` - -This rule is not configurable. - ## When Not To Use It If you don't use method chaining or explicit return values, you can safely turn this rule off. diff --git a/packages/eslint-plugin/docs/rules/prefer-string-starts-ends-with.md b/packages/eslint-plugin/docs/rules/prefer-string-starts-ends-with.md index 2be24df3c21..573ce53ed09 100644 --- a/packages/eslint-plugin/docs/rules/prefer-string-starts-ends-with.md +++ b/packages/eslint-plugin/docs/rules/prefer-string-starts-ends-with.md @@ -1,22 +1,25 @@ +--- +description: 'Enforce using `String#startsWith` and `String#endsWith` over other equivalent methods of checking substrings.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/prefer-string-starts-ends-with** for documentation. There are multiple ways to verify if a string starts or ends with a specific string, such as `foo.indexOf('bar') === 0`. -Since ES2015 has added `String#startsWith` and `String#endsWith`, this rule reports other ways to be consistent. - -## Rule Details +As of ES2015, the most common way in JavaScript is to use `String#startsWith` and `String#endsWith`. +Keeping to those methods consistently helps with code readability. -This rule is aimed at enforcing a consistent way to check whether a string starts or ends with a specific string. +This rule reports when a string method can be replaced safely with `String#startsWith` or `String#endsWith`. -Examples of code for this rule: +## Examples ### ❌ Incorrect ```ts -let foo: string; +declare const foo: string; // starts with foo[0] === 'b'; @@ -40,23 +43,15 @@ foo.match(/bar$/) != null; ### ✅ Correct ```ts -foo.startsWith('bar'); -foo.endsWith('bar'); -``` +declare const foo: string; -## Options +// starts with +foo.startsWith('bar'); -```jsonc -// .eslintrc.json -{ - "rules": { - "@typescript-eslint/prefer-string-starts-ends-with": "warn" - } -} +// ends with +foo.endsWith('bar'); ``` -This rule is not configurable. - ## When Not To Use It If you don't mind that style, you can turn this rule off safely. diff --git a/packages/eslint-plugin/docs/rules/prefer-ts-expect-error.md b/packages/eslint-plugin/docs/rules/prefer-ts-expect-error.md index bfcaad11b0a..8cc2abb2305 100644 --- a/packages/eslint-plugin/docs/rules/prefer-ts-expect-error.md +++ b/packages/eslint-plugin/docs/rules/prefer-ts-expect-error.md @@ -1,22 +1,20 @@ +--- +description: 'Enforce using `@ts-expect-error` over `@ts-ignore`.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/prefer-ts-expect-error** for documentation. -TypeScript allows you to suppress all errors on a line by placing a single-line comment or a comment block line starting with `@ts-ignore` immediately before the erroring line. -While powerful, there is no way to know if a `@ts-ignore` is actually suppressing an error without manually investigating what happens when the `@ts-ignore` is removed. +TypeScript allows you to suppress all errors on a line by placing a comment starting with `@ts-ignore` or `@ts-expect-error` immediately before the erroring line. +The two directives work the same, except `@ts-expect-error` causes a type error if placed before a line that's not erroring in the first place. This means its easy for `@ts-ignore`s to be forgotten about, and remain in code even after the error they were suppressing is fixed. This is dangerous, as if a new error arises on that line it'll be suppressed by the forgotten about `@ts-ignore`, and so be missed. -To address this, TS3.9 ships with a new single-line comment directive: `// @ts-expect-error`. - -This directive operates in the same manner as `@ts-ignore`, but will error if the line it's meant to be suppressing doesn't actually contain an error, making it a lot safer. - -## Rule Details - -This rule looks for usages of `@ts-ignore`, and flags them to be replaced with `@ts-expect-error`. +## Examples -Examples of code for this rule: +This rule reports any usage of `@ts-ignore`, including a fixer to replace with `@ts-expect-error`. @@ -62,22 +60,9 @@ const isOptionEnabled = (key: string): boolean => { }; ``` -## Options - -```jsonc -// .eslintrc.json -{ - "rules": { - "@typescript-eslint/prefer-ts-expect-error": "warn" - } -} -``` - -This rule is not configurable. - ## When Not To Use It -If you are **NOT** using TypeScript 3.9 (or greater), then you will not be able to use this rule, as the directive is not supported +If you are compiling against multiple versions of TypeScript and using `@ts-ignore` to ignore version-specific type errors, this rule might get in your way. ## Further Reading diff --git a/packages/eslint-plugin/docs/rules/promise-function-async.md b/packages/eslint-plugin/docs/rules/promise-function-async.md index 424536ee5f2..e697217dc5d 100644 --- a/packages/eslint-plugin/docs/rules/promise-function-async.md +++ b/packages/eslint-plugin/docs/rules/promise-function-async.md @@ -1,3 +1,7 @@ +--- +description: 'Require any function or method that returns a Promise to be marked async.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/promise-function-async** for documentation. @@ -11,7 +15,7 @@ In contrast, non-`async` `Promise` - returning functions are technically capable Code that handles the results of those functions will often need to handle both cases, which can get complex. This rule's practice removes a requirement for creating code to handle both cases. -## Rule Details +## Examples Examples of code for this rule @@ -36,32 +40,3 @@ async function functionReturnsPromise() { return Promise.resolve('value'); } ``` - -## Options - -Options may be provided as an object with: - -- `allowAny` to indicate that `any` or `unknown` shouldn't be considered Promises (`true` by default). -- `allowedPromiseNames` to indicate any extra names of classes or interfaces to be considered Promises when returned. - -In addition, each of the following properties may be provided, and default to `true`: - -- `checkArrowFunctions` -- `checkFunctionDeclarations` -- `checkFunctionExpressions` -- `checkMethodDeclarations` - -```json -{ - "@typescript-eslint/promise-function-async": [ - "error", - { - "allowedPromiseNames": ["Thenable"], - "checkArrowFunctions": true, - "checkFunctionDeclarations": true, - "checkFunctionExpressions": true, - "checkMethodDeclarations": true - } - ] -} -``` diff --git a/packages/eslint-plugin/docs/rules/quotes.md b/packages/eslint-plugin/docs/rules/quotes.md index 61cadea2047..b67c5dc8966 100644 --- a/packages/eslint-plugin/docs/rules/quotes.md +++ b/packages/eslint-plugin/docs/rules/quotes.md @@ -1,28 +1,12 @@ +--- +description: 'Enforce the consistent use of either backticks, double, or single quotes.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/quotes** for documentation. -## Rule Details +## Examples This rule extends the base [`eslint/quotes`](https://eslint.org/docs/rules/quotes) rule. It adds support for TypeScript features which allow quoted names, but not backtick quoted names. - -## How to Use - -```jsonc -{ - // note you must disable the base rule as it can report incorrect errors - "quotes": "off", - "@typescript-eslint/quotes": ["error"] -} -``` - -## Options - -See [`eslint/quotes` options](https://eslint.org/docs/rules/quotes#options). - - - -Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/docs/rules/quotes.md) - - diff --git a/packages/eslint-plugin/docs/rules/require-array-sort-compare.md b/packages/eslint-plugin/docs/rules/require-array-sort-compare.md index d4b006c1d70..66b39a004cd 100644 --- a/packages/eslint-plugin/docs/rules/require-array-sort-compare.md +++ b/packages/eslint-plugin/docs/rules/require-array-sort-compare.md @@ -1,31 +1,26 @@ +--- +description: 'Require `Array#sort` calls to always provide a `compareFunction`.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/require-array-sort-compare** for documentation. -This rule prevents invoking the `Array#sort()` method without providing a `compare` argument. -When called without a compare function, `Array#sort()` converts all non-undefined array elements into strings and then compares said strings based off their UTF-16 code units. +When called without a compare function, `Array#sort()` converts all non-undefined array elements into strings and then compares said strings based off their UTF-16 code units [[ECMA specification](https://www.ecma-international.org/ecma-262/9.0/#sec-sortcompare)]. The result is that elements are sorted alphabetically, regardless of their type. -When sorting numbers, this results in the classic "10 before 2" order: +For example, when sorting numbers, this results in a "10 before 2" order: ```ts [1, 2, 3, 10, 20, 30].sort(); //→ [1, 10, 2, 20, 3, 30] ``` -This also means that `Array#sort` does not always sort consistently, as elements may have custom `#toString` implementations that are not deterministic; this trap is noted in the language specification thusly: - -:::note -Method calls performed by the `ToString` abstract operations in steps 5 and 7 have the potential to cause `SortCompare` to not behave as a consistent comparison function. +This rule reports on any call to the `Array#sort()` method that doesn't provide a `compare` argument. -https://www.ecma-international.org/ecma-262/9.0/#sec-sortcompare -::: - -## Rule Details +## Examples This rule aims to ensure all calls of the native `Array#sort` method provide a `compareFunction`, while ignoring calls to user-defined `sort` methods. -Examples of code for this rule: - ### ❌ Incorrect @@ -54,21 +49,6 @@ userDefinedType.sort(); ## Options -The rule accepts an options object with the following properties: - -```ts -type Options = { - /** - * If true, an array which all elements are string is ignored. - */ - ignoreStringArrays?: boolean; -}; - -const defaults = { - ignoreStringArrays: false, -}; -``` - ### `ignoreStringArrays` Examples of code for this rule with `{ ignoreStringArrays: true }`: @@ -95,4 +75,4 @@ const three = '3'; ## When Not To Use It -If you understand the language specification enough, you can turn this rule off safely. +If you understand the language specification enough, and/or only ever sort arrays in a string-like manner, you can turn this rule off safely. diff --git a/packages/eslint-plugin/docs/rules/require-await.md b/packages/eslint-plugin/docs/rules/require-await.md index 21d6271c38c..f4ccd6fc21a 100644 --- a/packages/eslint-plugin/docs/rules/require-await.md +++ b/packages/eslint-plugin/docs/rules/require-await.md @@ -1,8 +1,12 @@ +--- +description: 'Disallow async functions which have no `await` expression.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/require-await** for documentation. -## Rule Details +## Examples This rule extends the base [`eslint/require-await`](https://eslint.org/docs/rules/require-await) rule. It uses type information to add support for `async` functions that return a `Promise`. @@ -18,21 +22,3 @@ const returnsPromise2 = () => returnsPromise1(); ``` ## How to Use - -```jsonc -{ - // note you must disable the base rule as it can report incorrect errors - "require-await": "off", - "@typescript-eslint/require-await": "error" -} -``` - -## Options - -See [`eslint/require-await` options](https://eslint.org/docs/rules/require-await#options). - - - -Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/docs/rules/require-await.md) - - diff --git a/packages/eslint-plugin/docs/rules/restrict-plus-operands.md b/packages/eslint-plugin/docs/rules/restrict-plus-operands.md index 5b984f0b21c..fc823f6da9f 100644 --- a/packages/eslint-plugin/docs/rules/restrict-plus-operands.md +++ b/packages/eslint-plugin/docs/rules/restrict-plus-operands.md @@ -1,10 +1,17 @@ +--- +description: 'Require both operands of addition to be the same type and be `bigint`, `number`, or `string`.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/restrict-plus-operands** for documentation. -## Rule Details +TypeScript allows `+` adding together two values of any type(s). +However, adding values that are not the same type and/or are not the same primitive type is often a sign of programmer error. + +This rule reports when a `+` operation combines two values of different types, or a type that is not `bigint`, `number`, or `string`. -Examples of code for this rule: +## Examples @@ -24,22 +31,6 @@ var foo = 1n + 1n; ## Options -The rule accepts an options object with the following properties: - -```ts -type Options = { - // if true, check compound assignments (`+=`) - checkCompoundAssignments?: boolean; - // if true, 'any' itself and `string`,`bigint`, `number` is allowed. - allowAny?: boolean; -}; - -const defaults = { - checkCompoundAssignments: false, - allowAny: false, -}; -``` - ### `checkCompoundAssignments` Examples of code for this rule with `{ checkCompoundAssignments: true }`: @@ -93,10 +84,15 @@ var fn = (a: any, b: bigint) => a + b; var fn = (a: any, b: number) => a + b; ``` -## How to Use +## When Not To Use It -```json -{ - "@typescript-eslint/restrict-plus-operands": "error" -} -``` +If you don't mind `"[object Object]"` in your strings, then you will not need this rule. + +## Related To + +- [`no-base-to-string`](./no-base-to-string.md) +- [`restrict-template-expressions`](./restrict-template-expressions.md) + +## Further Reading + +- [`Object.prototype.toString()` MDN documentation](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/toString) diff --git a/packages/eslint-plugin/docs/rules/restrict-template-expressions.md b/packages/eslint-plugin/docs/rules/restrict-template-expressions.md index 37423d23abc..e2d18d8e267 100644 --- a/packages/eslint-plugin/docs/rules/restrict-template-expressions.md +++ b/packages/eslint-plugin/docs/rules/restrict-template-expressions.md @@ -1,10 +1,16 @@ +--- +description: 'Enforce template literal expressions to be of `string` type.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/restrict-template-expressions** for documentation. -## Rule Details +JavaScript will call `toString()` on an object when it is converted to a string, such as when `+` adding to a string or in `${}` template literals. +The default Object `.toString()` returns `"[object Object]"`, which is often not what was intended. +This rule reports on values used in a template literal string that aren't primitives and don't define a more useful `.toString()` method. -Examples of code for this rule: +## Examples @@ -31,31 +37,6 @@ const msg3 = `stringWithKindProp = ${stringWithKindProp}`; ## Options -The rule accepts an options object with the following properties: - -```ts -type Options = { - // if true, also allow number type in template expressions - allowNumber?: boolean; - // if true, also allow boolean type in template expressions - allowBoolean?: boolean; - // if true, also allow any in template expressions - allowAny?: boolean; - // if true, also allow null and undefined in template expressions - allowNullish?: boolean; - // if true, also allow RegExp in template expressions - allowRegExp?: boolean; -}; - -const defaults = { - allowNumber: true, - allowBoolean: false, - allowAny: false, - allowNullish: false, - allowRegExp: false, -}; -``` - ### `allowNumber` Examples of additional **correct** code for this rule with `{ allowNumber: true }`: @@ -108,3 +89,8 @@ const msg1 = `arg = ${arg}`; const arg = /foo/; const msg1 = `arg = ${arg}`; ``` + +## Related To + +- [`no-base-to-string`](./no-base-to-string.md) +- [`restrict-plus-operands`](./restrict-plus-operands.md) diff --git a/packages/eslint-plugin/docs/rules/return-await.md b/packages/eslint-plugin/docs/rules/return-await.md index 1aa62401ae4..205c0eb0e8d 100644 --- a/packages/eslint-plugin/docs/rules/return-await.md +++ b/packages/eslint-plugin/docs/rules/return-await.md @@ -1,24 +1,18 @@ +--- +description: 'Enforce consistent returning of awaited values.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/return-await** for documentation. Returning an awaited promise can make sense for better stack trace information as well as for consistent error handling (returned promises will not be caught in an async function try/catch). -## Rule Details +## Examples This rule builds on top of the [`eslint/no-return-await`](https://eslint.org/docs/rules/no-return-await) rule. It expands upon the base rule to add support for optionally requiring `return await` in certain cases. -## How to Use - -```jsonc -{ - // note you must disable the base rule as it can report incorrect errors - "no-return-await": "off", - "@typescript-eslint/return-await": "error" -} -``` - ## Options ```ts diff --git a/packages/eslint-plugin/docs/rules/semi.md b/packages/eslint-plugin/docs/rules/semi.md index 0c37c9f4baa..16622a1d856 100644 --- a/packages/eslint-plugin/docs/rules/semi.md +++ b/packages/eslint-plugin/docs/rules/semi.md @@ -1,32 +1,16 @@ +--- +description: 'Require or disallow semicolons instead of ASI.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/semi** for documentation. This rule enforces consistent use of semicolons after statements. -## Rule Details +## Examples This rule extends the base [`eslint/semi`](https://eslint.org/docs/rules/semi) rule. It adds support for TypeScript features that require semicolons. See also the [`@typescript-eslint/member-delimiter-style`](member-delimiter-style.md) rule, which allows you to specify the delimiter for `type` and `interface` members. - -## How to Use - -```jsonc -{ - // note you must disable the base rule as it can report incorrect errors - "semi": "off", - "@typescript-eslint/semi": ["error"] -} -``` - -## Options - -See [`eslint/semi` options](https://eslint.org/docs/rules/semi#options). - - - -Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/docs/rules/semi.md) - - diff --git a/packages/eslint-plugin/docs/rules/sort-type-constituents.md b/packages/eslint-plugin/docs/rules/sort-type-constituents.md new file mode 100644 index 00000000000..264ef2b52df --- /dev/null +++ b/packages/eslint-plugin/docs/rules/sort-type-constituents.md @@ -0,0 +1,101 @@ +--- +description: 'Enforce constituents of a type union/intersection to be sorted alphabetically.' +--- + +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/sort-type-constituents** for documentation. + +Sorting union (`|`) and intersection (`&`) types can help: + +- keep your codebase standardized +- find repeated types +- reduce diff churn + +This rule reports on any types that aren't sorted alphabetically. + +> Types are sorted case-insensitively and treating numbers like a human would, falling back to character code sorting in case of ties. + +## Examples + + + +### ❌ Incorrect + +```ts +type T1 = B | A; + +type T2 = { b: string } & { a: string }; + +type T3 = [1, 2, 4] & [1, 2, 3]; + +type T4 = + | [1, 2, 4] + | [1, 2, 3] + | { b: string } + | { a: string } + | (() => void) + | (() => string) + | 'b' + | 'a' + | 'b' + | 'a' + | readonly string[] + | readonly number[] + | string[] + | number[] + | B + | A + | string + | any; +``` + +### ✅ Correct + +```ts +type T1 = A | B; + +type T2 = { a: string } & { b: string }; + +type T3 = [1, 2, 3] & [1, 2, 4]; + +type T4 = + | any + | string + | A + | B + | number[] + | string[] + | readonly number[] + | readonly string[] + | 'a' + | 'b' + | 'a' + | 'b' + | (() => string) + | (() => void) + | { a: string } + | { b: string } + | [1, 2, 3] + | [1, 2, 4]; +``` + +## Options + +### `groupOrder` + +Each constituent of the type is placed into a group, and then the rule sorts alphabetically within each group. +The ordering of groups is determined by this option. + +- `conditional` - Conditional types (`A extends B ? C : D`) +- `function` - Function and constructor types (`() => void`, `new () => type`) +- `import` - Import types (`import('path')`) +- `intersection` - Intersection types (`A & B`) +- `keyword` - Keyword types (`any`, `string`, etc) +- `literal` - Literal types (`1`, `'b'`, `true`, etc) +- `named` - Named types (`A`, `A['prop']`, `B[]`, `Array`) +- `object` - Object types (`{ a: string }`, `{ [key: string]: number }`) +- `operator` - Operator types (`keyof A`, `typeof B`, `readonly C[]`) +- `tuple` - Tuple types (`[A, B, C]`) +- `union` - Union types (`A | B`) +- `nullish` - `null` and `undefined` diff --git a/packages/eslint-plugin/docs/rules/sort-type-union-intersection-members.md b/packages/eslint-plugin/docs/rules/sort-type-union-intersection-members.md index 0e02b686b87..edaa195df6b 100644 --- a/packages/eslint-plugin/docs/rules/sort-type-union-intersection-members.md +++ b/packages/eslint-plugin/docs/rules/sort-type-union-intersection-members.md @@ -1,31 +1,27 @@ +--- +description: 'Enforce members of a type union/intersection to be sorted alphabetically.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/sort-type-union-intersection-members** for documentation. +:::danger Deprecated + +This rule has been renamed to [`sort-type-constituents`](./sort-type-constituents.md). +::: + Sorting union (`|`) and intersection (`&`) types can help: - keep your codebase standardized - find repeated types - reduce diff churn -## Rule Details - -Sorting within each group is done using the following code: - -```ts -const collator = new Intl.Collator('en', { - sensitivity: 'base', - numeric: true, -}); - -function compare(a, b) { - return collator.compare(a, b) || (a < b ? -1 : a > b ? 1 : 0); -} -``` +This rule reports on any types that aren't sorted alphabetically. -In other words, the types are sorted alphabetically, case-insensitively and treating numbers like a human would, falling back to character code sorting in case of ties. +> Types are sorted case-insensitively and treating numbers like a human would, falling back to character code sorting in case of ties. -Examples of code for this rule: +## Examples @@ -91,49 +87,6 @@ type T4 = ## Options -```ts -type Options = { - // true to check intersection types, false otherwise - checkIntersections?: boolean; - // true to check union types, false otherwise - checkUnions?: boolean; - // the ordering of the groups - groupOrder?: ( - | 'conditional' - | 'function' - | 'import' - | 'intersection' - | 'keyword' - | 'literal' - | 'named' - | 'object' - | 'operator' - | 'tuple' - | 'union' - | 'nullish' - )[]; -}; - -const defaultOptions: Options = { - checkIntersections: true, - checkUnions: true, - groupOrder: [ - 'named', - 'keyword', - 'operator', - 'literal', - 'function', - 'import', - 'conditional', - 'object', - 'tuple', - 'intersection', - 'union', - 'nullish', - ], -}; -``` - ### `groupOrder` Each member of the type is placed into a group, and then the rule sorts alphabetically within each group. diff --git a/packages/eslint-plugin/docs/rules/space-before-blocks.md b/packages/eslint-plugin/docs/rules/space-before-blocks.md index bb2ec8e4b89..716de2294f6 100644 --- a/packages/eslint-plugin/docs/rules/space-before-blocks.md +++ b/packages/eslint-plugin/docs/rules/space-before-blocks.md @@ -1,11 +1,17 @@ +--- +description: 'Enforce consistent spacing before blocks.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/space-before-blocks** for documentation. -## Rule Details +## Examples This rule extends the base [`eslint/space-before-blocks`](https://eslint.org/docs/rules/space-before-blocks) rule. -It adds support for interfaces and enums: +It adds support for interfaces and enums. + + ### ❌ Incorrect @@ -31,24 +37,6 @@ interface State { } ``` -In case a more specific options object is passed these blocks will follow `classes` configuration option. - -## How to Use - -```jsonc -{ - // note you must disable the base rule as it can report incorrect errors - "space-before-blocks": "off", - "@typescript-eslint/space-before-blocks": ["error"] -} -``` - ## Options -See [`eslint/space-before-blocks` options](https://eslint.org/docs/rules/space-before-blocks#options). - - - -Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/master/docs/rules/space-before-blocks.md) - - +In case a more specific options object is passed these blocks will follow `classes` configuration option. diff --git a/packages/eslint-plugin/docs/rules/space-before-function-paren.md b/packages/eslint-plugin/docs/rules/space-before-function-paren.md index 80ab4ffc6a0..f2c1b5e846c 100644 --- a/packages/eslint-plugin/docs/rules/space-before-function-paren.md +++ b/packages/eslint-plugin/docs/rules/space-before-function-paren.md @@ -1,28 +1,12 @@ +--- +description: 'Enforce consistent spacing before function parenthesis.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/space-before-function-paren** for documentation. -## Rule Details +## Examples This rule extends the base [`eslint/space-before-function-paren`](https://eslint.org/docs/rules/space-before-function-paren) rule. It adds support for generic type parameters on function calls. - -## How to Use - -```jsonc -{ - // note you must disable the base rule as it can report incorrect errors - "space-before-function-paren": "off", - "@typescript-eslint/space-before-function-paren": ["error"] -} -``` - -## Options - -See [`eslint/space-before-function-paren` options](https://eslint.org/docs/rules/space-before-function-paren#options). - - - -Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/docs/rules/space-before-function-paren.md) - - diff --git a/packages/eslint-plugin/docs/rules/space-infix-ops.md b/packages/eslint-plugin/docs/rules/space-infix-ops.md index e791420b653..b6b0ecda788 100644 --- a/packages/eslint-plugin/docs/rules/space-infix-ops.md +++ b/packages/eslint-plugin/docs/rules/space-infix-ops.md @@ -1,32 +1,16 @@ +--- +description: 'Require spacing around infix operators.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/space-infix-ops** for documentation. This rule extends the base [`eslint/space-infix-ops`](https://eslint.org/docs/rules/space-infix-ops) rule. - -It also add support for enum members +It adds support for enum members. ```ts enum MyEnum { KEY = 'value', } ``` - -## How to Use - -```jsonc -{ - "space-infix-ops": "off", - "@typescript-eslint/space-infix-ops": ["error", { "int32Hint": false }] -} -``` - -## Options - -See [`eslint/space-infix-ops` options](https://eslint.org/docs/rules/space-infix-ops#options). - - - -Taken with ❤️ [from ESLint core](https://github.com/eslint/eslint/blob/main/docs/rules/space-infix-ops.md) - - diff --git a/packages/eslint-plugin/docs/rules/strict-boolean-expressions.md b/packages/eslint-plugin/docs/rules/strict-boolean-expressions.md index a86e8146ba6..b7e8c13a9be 100644 --- a/packages/eslint-plugin/docs/rules/strict-boolean-expressions.md +++ b/packages/eslint-plugin/docs/rules/strict-boolean-expressions.md @@ -1,3 +1,7 @@ +--- +description: 'Disallow certain types in boolean expressions.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/strict-boolean-expressions** for documentation. @@ -17,8 +21,6 @@ The following nodes are considered boolean expressions and their type is checked ## Examples -Examples of code for this rule: - ### ❌ Incorrect @@ -85,29 +87,6 @@ const foo = (arg: any) => (Boolean(arg) ? 1 : 0); ## Options -```ts -type Options = { - allowString?: boolean; - allowNumber?: boolean; - allowNullableObject?: boolean; - allowNullableBoolean?: boolean; - allowNullableString?: boolean; - allowNullableNumber?: boolean; - allowAny?: boolean; -}; - -const defaultOptions: Options = { - allowString: true, - allowNumber: true, - allowNullableObject: true, - allowNullableBoolean: false, - allowNullableString: false, - allowNullableNumber: false, - allowAny: false, - allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing: false, -}; -``` - ### `allowString` Allows `string` in a boolean context. diff --git a/packages/eslint-plugin/docs/rules/switch-exhaustiveness-check.md b/packages/eslint-plugin/docs/rules/switch-exhaustiveness-check.md index cfe2ef234a4..9320624924b 100644 --- a/packages/eslint-plugin/docs/rules/switch-exhaustiveness-check.md +++ b/packages/eslint-plugin/docs/rules/switch-exhaustiveness-check.md @@ -1,12 +1,17 @@ +--- +description: 'Require switch-case statements to be exhaustive with union type.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/switch-exhaustiveness-check** for documentation. -Union type may have a lot of parts. It's easy to forget to consider all cases in switch. This rule reminds which parts are missing. If domain of the problem requires to have only a partial switch, developer may _explicitly_ add a default clause. +When working with union types in TypeScript, it's common to want to write a `switch` statement intended to contain a `case` for each constituent (possible type in the union). +However, if the union type changes, it's easy to forget to modify the cases to account for any new types. -## Rule Details +This rule reports when a `switch` statement over a value typed as a union of literals is missing a case for any of those literal types and does not have a `default` clause. -Examples of code for this rule: +## Examples @@ -26,10 +31,9 @@ const day = 'Monday' as Day; let result = 0; switch (day) { - case 'Monday': { + case 'Monday': result = 1; break; - } } ``` @@ -49,34 +53,27 @@ const day = 'Monday' as Day; let result = 0; switch (day) { - case 'Monday': { + case 'Monday': result = 1; break; - } - case 'Tuesday': { + case 'Tuesday': result = 2; break; - } - case 'Wednesday': { + case 'Wednesday': result = 3; break; - } - case 'Thursday': { + case 'Thursday': result = 4; break; - } - case 'Friday': { + case 'Friday': result = 5; break; - } - case 'Saturday': { + case 'Saturday': result = 6; break; - } - case 'Sunday': { + case 'Sunday': result = 7; break; - } } ``` @@ -96,29 +93,14 @@ const day = 'Monday' as Day; let result = 0; switch (day) { - case 'Monday': { + case 'Monday': result = 1; break; - } - default: { + default: result = 42; - } -} -``` - -## Options - -```jsonc -// .eslintrc.json -{ - "rules": { - "@typescript-eslint/switch-exhaustiveness-check": "warn" - } } ``` -This rule is not configurable. - ## When Not To Use It -If program doesn't have union types with many parts. Downside of this rule is the need for type information, so it's slower than regular rules. +If you don't frequently `switch` over union types with many parts, or intentionally wish to leave out some parts. diff --git a/packages/eslint-plugin/docs/rules/triple-slash-reference.md b/packages/eslint-plugin/docs/rules/triple-slash-reference.md index ce73a33d594..f48f7c98497 100644 --- a/packages/eslint-plugin/docs/rules/triple-slash-reference.md +++ b/packages/eslint-plugin/docs/rules/triple-slash-reference.md @@ -1,10 +1,18 @@ +--- +description: 'Disallow certain triple slash directives in favor of ES6-style import declarations.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/triple-slash-reference** for documentation. -Use of triple-slash reference type directives is discouraged in favor of the newer `import` style. This rule allows you to ban use of `/// `, `/// `, or `/// ` directives. +TypeScript's `///` triple-slash references are a way to indicate that types from another module are available in a file. +Use of triple-slash reference type directives is generally discouraged in favor of ECMAScript Module `import`s. +This rule reports on the use of `/// `, `/// `, or `/// ` directives. + +## Examples -## Rule Details +## Options With `{ "path": "never", "types": "never", "lib": "never" }` options set, the following will all be **incorrect** usage: @@ -44,22 +52,6 @@ import * as foo from 'foo'; import foo = require('foo'); ``` -## Options - -```ts -type Options = { - lib?: 'always' | 'never'; - path?: 'always' | 'never'; - types?: 'always' | 'never' | 'prefer-import'; -}; - -const defaultOptions: Options = { - lib: 'always', - path: 'never', - types: 'prefer-import', -}; -``` - ## When To Use It If you want to ban use of one or all of the triple slash reference directives, or any time you might use triple-slash type reference directives and ES6 import declarations in the same file. diff --git a/packages/eslint-plugin/docs/rules/type-annotation-spacing.md b/packages/eslint-plugin/docs/rules/type-annotation-spacing.md index 7adc9fd0e59..36cfab06592 100644 --- a/packages/eslint-plugin/docs/rules/type-annotation-spacing.md +++ b/packages/eslint-plugin/docs/rules/type-annotation-spacing.md @@ -1,3 +1,7 @@ +--- +description: 'Require consistent spacing around type annotations.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/type-annotation-spacing** for documentation. @@ -31,27 +35,17 @@ type Foo = (string: name)=> string; type Foo = (string: name) =>string; ``` -## Rule Details +## Examples This rule aims to enforce specific spacing patterns around type annotations and function types in type literals. ## Options -This rule has an object option: - -- `"before": false`, (default for colon) disallows spaces before the colon/arrow. -- `"before": true`, (default for arrow) requires a space before the colon/arrow. -- `"after": true`, (default) requires a space after the colon/arrow. -- `"after": false`, disallows spaces after the colon/arrow. -- `"overrides"`, overrides the default options for type annotations with `colon` (e.g. `const foo: string`) and function types with `arrow` (e.g. `type Foo = () => {}`). Additionally allows granular overrides for `variable` (`const foo: string`),`parameter` (`function foo(bar: string) {...}`),`property` (`interface Foo { bar: string }`) and `returnType` (`function foo(): string {...}`) annotations. - -### defaults - Examples of code for this rule with no options at all: -#### ❌ Incorrect +### ❌ Incorrect ```ts @@ -80,7 +74,7 @@ type Foo = () =>{}; type Foo = ()=> {}; ``` -#### ✅ Correct +### ✅ Correct ```ts diff --git a/packages/eslint-plugin/docs/rules/typedef.md b/packages/eslint-plugin/docs/rules/typedef.md index 8976c521197..11e2b39c440 100644 --- a/packages/eslint-plugin/docs/rules/typedef.md +++ b/packages/eslint-plugin/docs/rules/typedef.md @@ -1,3 +1,7 @@ +--- +description: 'Require type annotations in certain places.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/typedef** for documentation. @@ -5,6 +9,9 @@ TypeScript cannot always infer types for all places in code. Some locations require type annotations for their types to be inferred. +This rule can enforce type annotations in locations regardless of whether they're required. +This is typically used to maintain consistency for element types that sometimes require them. + ```ts class ContainsText { // There must be a type annotation here to infer the type @@ -18,44 +25,19 @@ class ContainsText { } ``` -**_Note:_** requiring type annotations unnecessarily can be cumbersome to maintain and generally reduces code readability. -TypeScript is often better at inferring types than easily written type annotations would allow. +> To enforce type definitions existing on call signatures, use [`explicit-function-return-type`](./explicit-function-return-type.md), or [`explicit-module-boundary-types`](./explicit-module-boundary-types.md). -**Instead of enabling `typedef`, it is generally recommended to use the `--noImplicitAny` and `--strictPropertyInitialization` compiler options to enforce type annotations only when useful.** +:::caution -## Rule Details +Requiring type annotations unnecessarily can be cumbersome to maintain and generally reduces code readability. +TypeScript is often better at inferring types than easily written type annotations would allow. -This rule can enforce type annotations in locations regardless of whether they're required. -This is typically used to maintain consistency for element types that sometimes require them. +**Instead of enabling `typedef`, it is generally recommended to use the `--noImplicitAny` and `--strictPropertyInitialization` compiler options to enforce type annotations only when useful.** -> To enforce type definitions existing on call signatures, use `explicit-function-return-type`, or `explicit-module-boundary-types`. +::: ## Options -```ts -type Options = { - arrayDestructuring?: boolean; - arrowParameter?: boolean; - memberVariableDeclaration?: boolean; - objectDestructuring?: boolean; - parameter?: boolean; - propertyDeclaration?: boolean; - variableDeclaration?: boolean; - variableDeclarationIgnoreFunction?: boolean; -}; - -const defaultOptions: Options = { - arrayDestructuring: false, - arrowParameter: false, - memberVariableDeclaration: false, - objectDestructuring: false, - parameter: false, - propertyDeclaration: false, - variableDeclaration: false, - variableDeclarationIgnoreFunction: false, -}; -``` - For example, with the following configuration: ```json diff --git a/packages/eslint-plugin/docs/rules/unbound-method.md b/packages/eslint-plugin/docs/rules/unbound-method.md index b42e274ec59..99dc8ba7963 100644 --- a/packages/eslint-plugin/docs/rules/unbound-method.md +++ b/packages/eslint-plugin/docs/rules/unbound-method.md @@ -1,15 +1,22 @@ +--- +description: 'Enforce unbound methods are called with their expected scope.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/unbound-method** for documentation. -Class functions don't preserve the class scope when passed as standalone variables. +Class method functions don't preserve the class scope when passed as standalone variables ("unbound"). If your function does not access `this`, [you can annotate it with `this: void`](https://www.typescriptlang.org/docs/handbook/2/functions.html#declaring-this-in-a-function), or consider using an arrow function instead. +Otherwise, passing class methods around as values can remove type safety by failing to capture `this`. -If you're working with `jest`, you can use [`eslint-plugin-jest`'s version of this rule](https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/unbound-method.md) to lint your test files, which knows when it's ok to pass an unbound method to `expect` calls. +This rule reports when a class method is referenced in an unbound manner. -## Rule Details +:::note Tip +If you're working with `jest`, you can use [`eslint-plugin-jest`'s version of this rule](https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/unbound-method.md) to lint your test files, which knows when it's ok to pass an unbound method to `expect` calls. +::: -Examples of code for this rule +## Examples @@ -72,10 +79,6 @@ const { double } = arith; ## Options -The rule accepts an options object with the following property: - -- `ignoreStatic` to not check whether `static` methods are correctly bound - ### `ignoreStatic` Examples of **correct** code for this rule with `{ ignoreStatic: true }`: @@ -93,19 +96,6 @@ const { log } = OtherClass; log(); ``` -## Example - -```json -{ - "@typescript-eslint/unbound-method": [ - "error", - { - "ignoreStatic": true - } - ] -} -``` - ## When Not To Use It If your code intentionally waits to bind methods after use, such as by passing a `scope: this` along with the method, you can disable this rule. diff --git a/packages/eslint-plugin/docs/rules/unified-signatures.md b/packages/eslint-plugin/docs/rules/unified-signatures.md index 290c3f33739..609eb3a7bb5 100644 --- a/packages/eslint-plugin/docs/rules/unified-signatures.md +++ b/packages/eslint-plugin/docs/rules/unified-signatures.md @@ -1,28 +1,18 @@ +--- +description: 'Disallow two overloads that could be unified into one with a union or an optional/rest parameter.' +--- + > 🛑 This file is source code, not the primary documentation location! 🛑 > > See **https://typescript-eslint.io/rules/unified-signatures** for documentation. -## Rule Details - -This rule aims to keep the source code as maintainable as possible by reducing the amount of overloads. - -## Options +Function overload signatures are a TypeScript way to define a function that can be called in multiple very different ways. +Overload signatures add syntax and theoretical bloat, so it's generally best to avoid using them when possible. +Switching to union types and/or optional or rest parameters can often avoid the need for overload signatures. -```ts -type Options = { - ignoreDifferentlyNamedParameters?: boolean; -}; - -const defaultOptions: Options = { - ignoreDifferentlyNamedParameters: false, -}; -``` +This rule reports when function overload signatures can be replaced by a single function signature. -The rule accepts an options object with the following property: - -- `ignoreDifferentlyNamedParameters`: whether two parameters with different names at the same index should be considered different even if their types are the same. - -Examples of code for this rule with the default options: +## Examples @@ -48,6 +38,17 @@ function x(x: number | string): void; function y(...x: number[]): void; ``` +```ts +// This rule won't check overload signatures with different rest parameter types. +// See https://github.com/microsoft/TypeScript/issues/5077 +function f(...a: number[]): void; +function f(...a: string[]): void; +``` + +## Options + +### `ignoreDifferentlyNamedParameters` + Examples of code for this rule with `ignoreDifferentlyNamedParameters`: @@ -59,11 +60,6 @@ function f(a: number): void; function f(a: string): void; ``` -```ts -function f(...a: number[]): void; -function f(...b: string[]): void; -``` - ### ✅ Correct ```ts @@ -71,7 +67,4 @@ function f(a: number): void; function f(b: string): void; ``` -```ts -function f(...a: number[]): void; -function f(...a: string[]): void; -``` +## Options diff --git a/packages/eslint-plugin/index.d.ts b/packages/eslint-plugin/index.d.ts index 0a45db55e32..53a17f6fc33 100644 --- a/packages/eslint-plugin/index.d.ts +++ b/packages/eslint-plugin/index.d.ts @@ -1,4 +1,4 @@ -import { TSESLint } from '@typescript-eslint/utils'; +import type { TSESLint } from '@typescript-eslint/utils'; export const rules: Record>; export const configs: Record; diff --git a/packages/eslint-plugin/jest.config.js b/packages/eslint-plugin/jest.config.js index 910991b20cf..72e29aa600b 100644 --- a/packages/eslint-plugin/jest.config.js +++ b/packages/eslint-plugin/jest.config.js @@ -4,4 +4,5 @@ /** @type {import('@jest/types').Config.InitialOptions} */ module.exports = { ...require('../../jest.config.base.js'), + coveragePathIgnorePatterns: ['src/index.ts$', 'src/configs/.*.ts$'], }; diff --git a/packages/eslint-plugin/package.json b/packages/eslint-plugin/package.json index efde7c0bbbf..724b3eea0f1 100644 --- a/packages/eslint-plugin/package.json +++ b/packages/eslint-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/eslint-plugin", - "version": "5.31.0", + "version": "5.50.0", "description": "TypeScript plugin for ESLint", "keywords": [ "eslint", @@ -37,19 +37,20 @@ "clean": "tsc -b tsconfig.build.json --clean", "postclean": "rimraf dist && rimraf coverage", "format": "prettier --write \"./**/*.{ts,mts,cts,tsx,js,mjs,cjs,jsx,json,md,css}\" --ignore-path ../../.prettierignore", - "generate:configs": "../../node_modules/.bin/ts-node --files --transpile-only tools/generate-configs.ts", - "generate:rules-lists": "../../node_modules/.bin/ts-node --files --transpile-only tools/generate-rules-lists.ts", - "lint": "eslint . --ignore-path ../../.eslintignore", + "generate:breaking-changes": "yarn tsx tools/generate-breaking-changes.ts", + "generate:configs": "yarn tsx tools/generate-configs.ts", + "lint": "nx lint", "test": "jest --coverage", "typecheck": "tsc -p tsconfig.json --noEmit" }, "dependencies": { - "@typescript-eslint/scope-manager": "5.31.0", - "@typescript-eslint/type-utils": "5.31.0", - "@typescript-eslint/utils": "5.31.0", + "@typescript-eslint/scope-manager": "5.50.0", + "@typescript-eslint/type-utils": "5.50.0", + "@typescript-eslint/utils": "5.50.0", "debug": "^4.3.4", - "functional-red-black-tree": "^1.0.1", + "grapheme-splitter": "^1.0.4", "ignore": "^5.2.0", + "natural-compare-lite": "^1.4.0", "regexpp": "^3.2.0", "semver": "^7.3.7", "tsutils": "^3.21.0" @@ -58,9 +59,13 @@ "@types/debug": "*", "@types/json-schema": "*", "@types/marked": "*", + "@types/natural-compare-lite": "^1.4.0", "@types/prettier": "*", "chalk": "^5.0.1", + "cross-fetch": "^3.1.5", + "grapheme-splitter": "^1.0.4", "json-schema": "*", + "markdown-table": "^3.0.2", "marked": "^4.0.15", "prettier": "*", "title-case": "^3.0.3", diff --git a/packages/eslint-plugin/project.json b/packages/eslint-plugin/project.json index d04cdcb07b1..72ca4c7a9d0 100644 --- a/packages/eslint-plugin/project.json +++ b/packages/eslint-plugin/project.json @@ -1,5 +1,15 @@ { - "root": "packages/eslint-plugin", + "name": "eslint-plugin", + "$schema": "../../node_modules/nx/schemas/project-schema.json", "type": "library", - "implicitDependencies": [] + "implicitDependencies": [], + "targets": { + "lint": { + "executor": "@nrwl/linter:eslint", + "outputs": ["{options.outputFile}"], + "options": { + "lintFilePatterns": ["packages/eslint-plugin/**/*.ts"] + } + } + } } diff --git a/packages/eslint-plugin/src/configs/all.ts b/packages/eslint-plugin/src/configs/all.ts index 8742d36b208..eb3856f10c3 100644 --- a/packages/eslint-plugin/src/configs/all.ts +++ b/packages/eslint-plugin/src/configs/all.ts @@ -37,6 +37,8 @@ export = { '@typescript-eslint/indent': 'error', 'init-declarations': 'off', '@typescript-eslint/init-declarations': 'error', + 'key-spacing': 'off', + '@typescript-eslint/key-spacing': 'error', 'keyword-spacing': 'off', '@typescript-eslint/keyword-spacing': 'error', 'lines-between-class-members': 'off', @@ -53,7 +55,6 @@ export = { 'no-dupe-class-members': 'off', '@typescript-eslint/no-dupe-class-members': 'error', '@typescript-eslint/no-duplicate-enum-values': 'error', - 'no-duplicate-imports': 'off', '@typescript-eslint/no-dynamic-delete': 'error', 'no-empty-function': 'off', '@typescript-eslint/no-empty-function': 'error', @@ -69,6 +70,7 @@ export = { '@typescript-eslint/no-for-in-array': 'error', 'no-implied-eval': 'off', '@typescript-eslint/no-implied-eval': 'error', + '@typescript-eslint/no-import-type-side-effects': 'error', '@typescript-eslint/no-inferrable-types': 'error', 'no-invalid-this': 'off', '@typescript-eslint/no-invalid-this': 'error', @@ -86,7 +88,6 @@ export = { '@typescript-eslint/no-non-null-asserted-nullish-coalescing': 'error', '@typescript-eslint/no-non-null-asserted-optional-chain': 'error', '@typescript-eslint/no-non-null-assertion': 'error', - '@typescript-eslint/parameter-properties': 'error', 'no-redeclare': 'off', '@typescript-eslint/no-redeclare': 'error', '@typescript-eslint/no-redundant-type-constituents': 'error', @@ -108,6 +109,7 @@ export = { '@typescript-eslint/no-unsafe-argument': 'error', '@typescript-eslint/no-unsafe-assignment': 'error', '@typescript-eslint/no-unsafe-call': 'error', + '@typescript-eslint/no-unsafe-declaration-merging': 'error', '@typescript-eslint/no-unsafe-member-access': 'error', '@typescript-eslint/no-unsafe-return': 'error', 'no-unused-expressions': 'off', @@ -125,6 +127,7 @@ export = { '@typescript-eslint/object-curly-spacing': 'error', 'padding-line-between-statements': 'off', '@typescript-eslint/padding-line-between-statements': 'error', + '@typescript-eslint/parameter-properties': 'error', '@typescript-eslint/prefer-as-const': 'error', '@typescript-eslint/prefer-enum-initializers': 'error', '@typescript-eslint/prefer-for-of': 'error', @@ -153,7 +156,7 @@ export = { '@typescript-eslint/return-await': 'error', semi: 'off', '@typescript-eslint/semi': 'error', - '@typescript-eslint/sort-type-union-intersection-members': 'error', + '@typescript-eslint/sort-type-constituents': 'error', 'space-before-blocks': 'off', '@typescript-eslint/space-before-blocks': 'error', 'space-before-function-paren': 'off', diff --git a/packages/eslint-plugin/src/configs/eslint-recommended.ts b/packages/eslint-plugin/src/configs/eslint-recommended.ts index 71443e1f52e..af3c0050c01 100644 --- a/packages/eslint-plugin/src/configs/eslint-recommended.ts +++ b/packages/eslint-plugin/src/configs/eslint-recommended.ts @@ -16,7 +16,7 @@ export = { 'no-dupe-keys': 'off', // ts(1117) 'no-func-assign': 'off', // ts(2539) 'no-import-assign': 'off', // ts(2539) & ts(2540) - 'no-new-symbol': 'off', // ts(2588) + 'no-new-symbol': 'off', // ts(7009) 'no-obj-calls': 'off', // ts(2349) 'no-redeclare': 'off', // ts(2451) 'no-setter-return': 'off', // ts(2408) diff --git a/packages/eslint-plugin/src/configs/strict.ts b/packages/eslint-plugin/src/configs/strict.ts index a9c91f7c1ca..99b4e83b508 100644 --- a/packages/eslint-plugin/src/configs/strict.ts +++ b/packages/eslint-plugin/src/configs/strict.ts @@ -8,8 +8,8 @@ export = { '@typescript-eslint/array-type': 'warn', '@typescript-eslint/ban-tslint-comment': 'warn', '@typescript-eslint/class-literal-property-style': 'warn', - '@typescript-eslint/consistent-indexed-object-style': 'warn', '@typescript-eslint/consistent-generic-constructors': 'warn', + '@typescript-eslint/consistent-indexed-object-style': 'warn', '@typescript-eslint/consistent-type-assertions': 'warn', '@typescript-eslint/consistent-type-definitions': 'warn', 'dot-notation': 'off', @@ -27,6 +27,7 @@ export = { '@typescript-eslint/no-unnecessary-boolean-literal-compare': 'warn', '@typescript-eslint/no-unnecessary-condition': 'warn', '@typescript-eslint/no-unnecessary-type-arguments': 'warn', + '@typescript-eslint/no-unsafe-declaration-merging': 'warn', 'no-useless-constructor': 'off', '@typescript-eslint/no-useless-constructor': 'warn', '@typescript-eslint/non-nullable-type-assertion-style': 'warn', diff --git a/packages/eslint-plugin/src/index.ts b/packages/eslint-plugin/src/index.ts index a0d8a6d9663..03899ac43cb 100644 --- a/packages/eslint-plugin/src/index.ts +++ b/packages/eslint-plugin/src/index.ts @@ -1,11 +1,10 @@ -import rules from './rules'; - import all from './configs/all'; import base from './configs/base'; import eslintRecommended from './configs/eslint-recommended'; import recommended from './configs/recommended'; import recommendedRequiringTypeChecking from './configs/recommended-requiring-type-checking'; import strict from './configs/strict'; +import rules from './rules'; export = { rules, diff --git a/packages/eslint-plugin/src/rules/adjacent-overload-signatures.ts b/packages/eslint-plugin/src/rules/adjacent-overload-signatures.ts index ab45274e165..498a9bf5ae1 100644 --- a/packages/eslint-plugin/src/rules/adjacent-overload-signatures.ts +++ b/packages/eslint-plugin/src/rules/adjacent-overload-signatures.ts @@ -1,4 +1,6 @@ -import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; + import * as util from '../util'; type RuleNode = @@ -6,7 +8,8 @@ type RuleNode = | TSESTree.Program | TSESTree.TSModuleBlock | TSESTree.TSTypeLiteral - | TSESTree.TSInterfaceBody; + | TSESTree.TSInterfaceBody + | TSESTree.BlockStatement; type Member = | TSESTree.ClassElement | TSESTree.ProgramStatement @@ -17,7 +20,7 @@ export default util.createRule({ meta: { type: 'suggestion', docs: { - description: 'Require that member overloads be consecutive', + description: 'Require that function overload signatures be consecutive', recommended: 'error', }, schema: [], @@ -62,7 +65,7 @@ export default util.createRule({ case AST_NODE_TYPES.TSDeclareFunction: case AST_NODE_TYPES.FunctionDeclaration: { const name = member.id?.name ?? null; - if (name === null) { + if (name == null) { return null; } return { @@ -119,6 +122,7 @@ export default util.createRule({ case AST_NODE_TYPES.Program: case AST_NODE_TYPES.TSModuleBlock: case AST_NODE_TYPES.TSInterfaceBody: + case AST_NODE_TYPES.BlockStatement: return node.body; case AST_NODE_TYPES.TSTypeLiteral: @@ -139,7 +143,7 @@ export default util.createRule({ members.forEach(member => { const method = getMemberMethod(member); - if (method === null) { + if (method == null) { lastMethod = null; return; } @@ -170,6 +174,7 @@ export default util.createRule({ TSModuleBlock: checkBodyForOverloadMethods, TSTypeLiteral: checkBodyForOverloadMethods, TSInterfaceBody: checkBodyForOverloadMethods, + BlockStatement: checkBodyForOverloadMethods, }; }, }); diff --git a/packages/eslint-plugin/src/rules/array-type.ts b/packages/eslint-plugin/src/rules/array-type.ts index 54ccef7c2db..5739b661d5b 100644 --- a/packages/eslint-plugin/src/rules/array-type.ts +++ b/packages/eslint-plugin/src/rules/array-type.ts @@ -1,4 +1,6 @@ -import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; + import * as util from '../util'; /** @@ -83,14 +85,13 @@ type MessageIds = | 'errorStringArraySimple' | 'errorStringGenericSimple'; -const arrayOption = { enum: ['array', 'generic', 'array-simple'] }; - export default util.createRule({ name: 'array-type', meta: { type: 'suggestion', docs: { - description: 'Require using either `T[]` or `Array` for arrays', + description: + 'Require consistently using either `T[]` or `Array` for arrays', recommended: 'strict', }, fixable: 'code', @@ -104,15 +105,30 @@ export default util.createRule({ errorStringGenericSimple: "Array type using '{{readonlyPrefix}}{{type}}[]' is forbidden for non-simple types. Use '{{className}}<{{type}}>' instead.", }, - schema: [ - { - type: 'object', - properties: { - default: arrayOption, - readonly: arrayOption, + schema: { + $defs: { + arrayOption: { + enum: ['array', 'generic', 'array-simple'], }, }, - ], + prefixItems: [ + { + properties: { + default: { + $ref: '#/$defs/arrayOption', + description: 'The array type expected for mutable cases...', + }, + readonly: { + $ref: '#/$defs/arrayOption', + description: + 'The array type expected for readonly cases. If omitted, the value for `default` will be used.', + }, + }, + type: 'object', + }, + ], + type: 'array', + }, }, defaultOptions: [ { @@ -236,8 +252,7 @@ export default util.createRule({ } const type = typeParams[0]; - const typeParens = - !util.isParenthesized(type, sourceCode) && typeNeedsParentheses(type); + const typeParens = typeNeedsParentheses(type); const parentParens = readonlyPrefix && node.parent?.type === AST_NODE_TYPES.TSArrayType && diff --git a/packages/eslint-plugin/src/rules/ban-ts-comment.ts b/packages/eslint-plugin/src/rules/ban-ts-comment.ts index e5cb60876ea..511a951280e 100644 --- a/packages/eslint-plugin/src/rules/ban-ts-comment.ts +++ b/packages/eslint-plugin/src/rules/ban-ts-comment.ts @@ -1,4 +1,5 @@ import { AST_TOKEN_TYPES } from '@typescript-eslint/utils'; + import * as util from '../util'; type DirectiveConfig = @@ -14,24 +15,6 @@ interface Options { minimumDescriptionLength?: number; } -const directiveConfigSchema = { - oneOf: [ - { - type: 'boolean', - default: true, - }, - { - enum: ['allow-with-description'], - }, - { - type: 'object', - properties: { - descriptionFormat: { type: 'string' }, - }, - }, - ], -}; - export const defaultMinimumDescriptionLength = 3; type MessageIds = @@ -45,7 +28,7 @@ export default util.createRule<[Options], MessageIds>({ type: 'problem', docs: { description: - 'Disallow `@ts-` comments or require descriptions after directive', + 'Disallow `@ts-` comments or require descriptions after directives', recommended: 'error', }, messages: { @@ -56,22 +39,45 @@ export default util.createRule<[Options], MessageIds>({ tsDirectiveCommentDescriptionNotMatchPattern: 'The description for the "@ts-{{directive}}" directive must match the {{format}} format.', }, - schema: [ - { - type: 'object', - properties: { - 'ts-expect-error': directiveConfigSchema, - 'ts-ignore': directiveConfigSchema, - 'ts-nocheck': directiveConfigSchema, - 'ts-check': directiveConfigSchema, - minimumDescriptionLength: { - type: 'number', - default: defaultMinimumDescriptionLength, - }, + schema: { + $defs: { + directiveConfigSchema: { + oneOf: [ + { + type: 'boolean', + default: true, + }, + { + enum: ['allow-with-description'], + }, + { + type: 'object', + properties: { + descriptionFormat: { type: 'string' }, + }, + }, + ], }, - additionalProperties: false, }, - ], + prefixItems: [ + { + properties: { + 'ts-expect-error': { + $ref: '#/$defs/directiveConfigSchema', + }, + 'ts-ignore': { $ref: '#/$defs/directiveConfigSchema' }, + 'ts-nocheck': { $ref: '#/$defs/directiveConfigSchema' }, + 'ts-check': { $ref: '#/$defs/directiveConfigSchema' }, + minimumDescriptionLength: { + type: 'number', + default: defaultMinimumDescriptionLength, + }, + }, + additionalProperties: false, + }, + ], + type: 'array', + }, }, defaultOptions: [ { @@ -141,7 +147,10 @@ export default util.createRule<[Options], MessageIds>({ minimumDescriptionLength = defaultMinimumDescriptionLength, } = options; const format = descriptionFormats.get(fullDirective); - if (description.trim().length < minimumDescriptionLength) { + if ( + util.getStringLength(description.trim()) < + minimumDescriptionLength + ) { context.report({ data: { directive, minimumDescriptionLength }, node: comment, diff --git a/packages/eslint-plugin/src/rules/ban-tslint-comment.ts b/packages/eslint-plugin/src/rules/ban-tslint-comment.ts index 144a4620257..849fbcc911e 100644 --- a/packages/eslint-plugin/src/rules/ban-tslint-comment.ts +++ b/packages/eslint-plugin/src/rules/ban-tslint-comment.ts @@ -1,4 +1,5 @@ import { AST_TOKEN_TYPES } from '@typescript-eslint/utils'; + import * as util from '../util'; // tslint regex diff --git a/packages/eslint-plugin/src/rules/ban-types.ts b/packages/eslint-plugin/src/rules/ban-types.ts index e122c1baafe..4dff7f3dfe0 100644 --- a/packages/eslint-plugin/src/rules/ban-types.ts +++ b/packages/eslint-plugin/src/rules/ban-types.ts @@ -1,4 +1,6 @@ -import { TSESLint, TSESTree, AST_NODE_TYPES } from '@typescript-eslint/utils'; +import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; + import * as util from '../util'; type Types = Record< @@ -34,7 +36,7 @@ function stringifyNode( function getCustomMessage( bannedType: null | string | { message?: string; fixWith?: string }, ): string { - if (bannedType === null) { + if (bannedType == null) { return ''; } @@ -84,14 +86,14 @@ const defaultTypes: Types = { Object: { message: [ 'The `Object` type actually means "any non-nullish value", so it is marginally better than `unknown`.', - '- If you want a type meaning "any object", you probably want `Record` instead.', + '- If you want a type meaning "any object", you probably want `object` instead.', '- If you want a type meaning "any value", you probably want `unknown` instead.', ].join('\n'), }, '{}': { message: [ '`{}` actually means "any non-nullish value".', - '- If you want a type meaning "any object", you probably want `Record` instead.', + '- If you want a type meaning "any object", you probably want `object` instead.', '- If you want a type meaning "any value", you probably want `unknown` instead.', '- If you want a type meaning "empty object", you probably want `Record` instead.', ].join('\n'), diff --git a/packages/eslint-plugin/src/rules/brace-style.ts b/packages/eslint-plugin/src/rules/brace-style.ts index 5d820b4c7e6..43d4ba63c3c 100644 --- a/packages/eslint-plugin/src/rules/brace-style.ts +++ b/packages/eslint-plugin/src/rules/brace-style.ts @@ -1,11 +1,11 @@ -import { TSESTree } from '@typescript-eslint/utils'; -import { getESLintCoreRule } from '../util/getESLintCoreRule'; -import { - InferOptionsTypeFromRule, +import type { TSESTree } from '@typescript-eslint/utils'; + +import type { InferMessageIdsTypeFromRule, - createRule, - isTokenOnSameLine, + InferOptionsTypeFromRule, } from '../util'; +import { createRule, isTokenOnSameLine } from '../util'; +import { getESLintCoreRule } from '../util/getESLintCoreRule'; const baseRule = getESLintCoreRule('brace-style'); @@ -29,6 +29,7 @@ export default createRule({ defaultOptions: ['1tbs'], create(context) { const [style, { allowSingleLine } = { allowSingleLine: false }] = + // eslint-disable-next-line no-restricted-syntax -- Use raw options for extended rules. context.options; const isAllmanStyle = style === 'allman'; diff --git a/packages/eslint-plugin/src/rules/class-literal-property-style.ts b/packages/eslint-plugin/src/rules/class-literal-property-style.ts index 1dc876a821b..ed49b144e47 100644 --- a/packages/eslint-plugin/src/rules/class-literal-property-style.ts +++ b/packages/eslint-plugin/src/rules/class-literal-property-style.ts @@ -1,4 +1,6 @@ -import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; + import * as util from '../util'; type Options = ['fields' | 'getters']; @@ -15,7 +17,7 @@ const printNodeModifiers = ( ): string => `${node.accessibility ?? ''}${ node.static ? ' static' : '' - } ${final} `.trimLeft(); + } ${final} `.trimStart(); const isSupportedLiteral = ( node: TSESTree.Node, diff --git a/packages/eslint-plugin/src/rules/comma-dangle.ts b/packages/eslint-plugin/src/rules/comma-dangle.ts index f3986151489..149218c4e7e 100644 --- a/packages/eslint-plugin/src/rules/comma-dangle.ts +++ b/packages/eslint-plugin/src/rules/comma-dangle.ts @@ -1,6 +1,8 @@ +import type { TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; + import * as util from '../util'; import { getESLintCoreRule } from '../util/getESLintCoreRule'; -import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/utils'; const baseRule = getESLintCoreRule('comma-dangle'); @@ -46,7 +48,7 @@ export default util.createRule({ extendsBaseRule: true, }, schema: { - definitions: { + $defs: { value: { enum: OPTION_VALUE_SCHEME, }, @@ -59,19 +61,19 @@ export default util.createRule({ { oneOf: [ { - $ref: '#/definitions/value', + $ref: '#/$defs/value', }, { type: 'object', properties: { - arrays: { $ref: '#/definitions/valueWithIgnore' }, - objects: { $ref: '#/definitions/valueWithIgnore' }, - imports: { $ref: '#/definitions/valueWithIgnore' }, - exports: { $ref: '#/definitions/valueWithIgnore' }, - functions: { $ref: '#/definitions/valueWithIgnore' }, - enums: { $ref: '#/definitions/valueWithIgnore' }, - generics: { $ref: '#/definitions/valueWithIgnore' }, - tuples: { $ref: '#/definitions/valueWithIgnore' }, + arrays: { $ref: '#/$defs/valueWithIgnore' }, + objects: { $ref: '#/$defs/valueWithIgnore' }, + imports: { $ref: '#/$defs/valueWithIgnore' }, + exports: { $ref: '#/$defs/valueWithIgnore' }, + functions: { $ref: '#/$defs/valueWithIgnore' }, + enums: { $ref: '#/$defs/valueWithIgnore' }, + generics: { $ref: '#/$defs/valueWithIgnore' }, + tuples: { $ref: '#/$defs/valueWithIgnore' }, }, additionalProperties: false, }, diff --git a/packages/eslint-plugin/src/rules/comma-spacing.ts b/packages/eslint-plugin/src/rules/comma-spacing.ts index ac9520440f3..a1ebcc181f2 100644 --- a/packages/eslint-plugin/src/rules/comma-spacing.ts +++ b/packages/eslint-plugin/src/rules/comma-spacing.ts @@ -1,9 +1,11 @@ -import { TSESTree, AST_TOKEN_TYPES } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; +import { AST_TOKEN_TYPES } from '@typescript-eslint/utils'; + import { + createRule, isClosingParenToken, isCommaToken, isTokenOnSameLine, - createRule, } from '../util'; type Options = [ @@ -17,7 +19,7 @@ type MessageIds = 'unexpected' | 'missing'; export default createRule({ name: 'comma-spacing', meta: { - type: 'suggestion', + type: 'layout', docs: { description: 'Enforce consistent spacing before and after commas', recommended: false, @@ -66,7 +68,7 @@ export default createRule({ let previousToken = sourceCode.getFirstToken(node); for (const element of node.elements) { let token: TSESTree.Token | null; - if (element === null) { + if (element == null) { token = sourceCode.getTokenAfter(previousToken!); if (token && isCommaToken(token)) { ignoredTokens.add(token); @@ -110,6 +112,7 @@ export default createRule({ if ( prevToken && isTokenOnSameLine(prevToken, commaToken) && + // eslint-disable-next-line deprecation/deprecation -- TODO - switch once our min ESLint version is 6.7.0 spaceBefore !== sourceCode.isSpaceBetweenTokens(prevToken, commaToken) ) { context.report({ @@ -139,6 +142,7 @@ export default createRule({ if ( nextToken && isTokenOnSameLine(commaToken, nextToken) && + // eslint-disable-next-line deprecation/deprecation -- TODO - switch once our min ESLint version is 6.7.0 spaceAfter !== sourceCode.isSpaceBetweenTokens(commaToken, nextToken) ) { context.report({ diff --git a/packages/eslint-plugin/src/rules/consistent-generic-constructors.ts b/packages/eslint-plugin/src/rules/consistent-generic-constructors.ts index 98a02ef070f..4bd2eaf8e71 100644 --- a/packages/eslint-plugin/src/rules/consistent-generic-constructors.ts +++ b/packages/eslint-plugin/src/rules/consistent-generic-constructors.ts @@ -1,4 +1,6 @@ -import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; + import { createRule } from '../util'; type MessageIds = 'preferTypeAnnotation' | 'preferConstructor'; diff --git a/packages/eslint-plugin/src/rules/consistent-indexed-object-style.ts b/packages/eslint-plugin/src/rules/consistent-indexed-object-style.ts index 98f9b74b81e..441b311ac95 100644 --- a/packages/eslint-plugin/src/rules/consistent-indexed-object-style.ts +++ b/packages/eslint-plugin/src/rules/consistent-indexed-object-style.ts @@ -1,4 +1,6 @@ -import { AST_NODE_TYPES, TSESLint, TSESTree } from '@typescript-eslint/utils'; +import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES, ASTUtils } from '@typescript-eslint/utils'; + import { createRule } from '../util'; type MessageIds = 'preferRecord' | 'preferIndexSignature'; @@ -65,7 +67,7 @@ export default createRule({ if (parentId) { const scope = context.getScope(); - const superVar = scope.set.get(parentId.name); + const superVar = ASTUtils.findVariable(scope, parentId.name); if (superVar) { const isCircular = superVar.references.some( item => diff --git a/packages/eslint-plugin/src/rules/consistent-type-assertions.ts b/packages/eslint-plugin/src/rules/consistent-type-assertions.ts index 6626b728afb..66268b0adc6 100644 --- a/packages/eslint-plugin/src/rules/consistent-type-assertions.ts +++ b/packages/eslint-plugin/src/rules/consistent-type-assertions.ts @@ -1,5 +1,7 @@ +import type { TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; + import * as util from '../util'; -import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/utils'; // intentionally mirroring the options type MessageIds = diff --git a/packages/eslint-plugin/src/rules/consistent-type-definitions.ts b/packages/eslint-plugin/src/rules/consistent-type-definitions.ts index 80fd0ffafa7..fdf7ac947c6 100644 --- a/packages/eslint-plugin/src/rules/consistent-type-definitions.ts +++ b/packages/eslint-plugin/src/rules/consistent-type-definitions.ts @@ -1,9 +1,6 @@ -import { - AST_NODE_TYPES, - AST_TOKEN_TYPES, - TSESLint, - TSESTree, -} from '@typescript-eslint/utils'; +import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES, AST_TOKEN_TYPES } from '@typescript-eslint/utils'; + import * as util from '../util'; export default util.createRule({ diff --git a/packages/eslint-plugin/src/rules/consistent-type-exports.ts b/packages/eslint-plugin/src/rules/consistent-type-exports.ts index 7d504103dbc..54364054690 100644 --- a/packages/eslint-plugin/src/rules/consistent-type-exports.ts +++ b/packages/eslint-plugin/src/rules/consistent-type-exports.ts @@ -1,10 +1,11 @@ -import { - TSESTree, +import type { ParserServices, - AST_NODE_TYPES, TSESLint, + TSESTree, } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; import { SymbolFlags } from 'typescript'; + import * as util from '../util'; type Options = [ diff --git a/packages/eslint-plugin/src/rules/consistent-type-imports.ts b/packages/eslint-plugin/src/rules/consistent-type-imports.ts index ce642b64a92..4c5cf771901 100644 --- a/packages/eslint-plugin/src/rules/consistent-type-imports.ts +++ b/packages/eslint-plugin/src/rules/consistent-type-imports.ts @@ -1,17 +1,16 @@ -import { - TSESLint, - TSESTree, - AST_TOKEN_TYPES, - AST_NODE_TYPES, -} from '@typescript-eslint/utils'; +import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; + import * as util from '../util'; type Prefer = 'type-imports' | 'no-type-imports'; +type FixStyle = 'separate-type-imports' | 'inline-type-imports'; type Options = [ { prefer?: Prefer; disallowTypeAnnotations?: boolean; + fixStyle?: FixStyle; }, ]; @@ -22,6 +21,8 @@ interface SourceImports { typeOnlyNamedImport: TSESTree.ImportDeclaration | null; // ImportDeclaration for value-only import only with named imports. valueOnlyNamedImport: TSESTree.ImportDeclaration | null; + // ImportDeclaration for value-only import only with default imports and/or named imports. + valueImport: TSESTree.ImportDeclaration | null; } interface ReportValueImport { node: TSESTree.ImportDeclaration; @@ -31,18 +32,6 @@ interface ReportValueImport { inlineTypeSpecifiers: TSESTree.ImportSpecifier[]; } -function isImportToken( - token: TSESTree.Token, -): token is TSESTree.KeywordToken & { value: 'import' } { - return token.type === AST_TOKEN_TYPES.Keyword && token.value === 'import'; -} - -function isTypeToken( - token: TSESTree.Token, -): token is TSESTree.IdentifierToken & { value: 'type' } { - return token.type === AST_TOKEN_TYPES.Identifier && token.value === 'type'; -} - type MessageIds = | 'typeOverValue' | 'someImportsAreOnlyTypes' @@ -82,6 +71,9 @@ export default util.createRule({ disallowTypeAnnotations: { type: 'boolean', }, + fixStyle: { + enum: ['separate-type-imports', 'inline-type-imports'], + }, }, additionalProperties: false, }, @@ -93,12 +85,14 @@ export default util.createRule({ { prefer: 'type-imports', disallowTypeAnnotations: true, + fixStyle: 'separate-type-imports', }, ], create(context, [option]) { const prefer = option.prefer ?? 'type-imports'; const disallowTypeAnnotations = option.disallowTypeAnnotations !== false; + const fixStyle = option.fixStyle ?? 'separate-type-imports'; const sourceCode = context.getSourceCode(); const sourceImportsMap: { [key: string]: SourceImports } = {}; @@ -109,13 +103,15 @@ export default util.createRule({ // prefer type imports ImportDeclaration(node): void { const source = node.source.value; + // sourceImports is the object containing all the specifics for a particular import source, type or value const sourceImports = sourceImportsMap[source] ?? (sourceImportsMap[source] = { source, - reportValueImports: [], - typeOnlyNamedImport: null, - valueOnlyNamedImport: null, + reportValueImports: [], // if there is a mismatch where type importKind but value specifiers + typeOnlyNamedImport: null, // if only type imports + valueOnlyNamedImport: null, // if only value imports with named specifiers + valueImport: null, // if only value imports }); if (node.importKind === 'type') { if ( @@ -125,6 +121,7 @@ export default util.createRule({ specifier.type === AST_NODE_TYPES.ImportSpecifier, ) ) { + // definitely import type { TypeX } sourceImports.typeOnlyNamedImport = node; } } else { @@ -136,6 +133,15 @@ export default util.createRule({ ) ) { sourceImports.valueOnlyNamedImport = node; + sourceImports.valueImport = node; + } else if ( + !sourceImports.valueImport && + node.specifiers.some( + specifier => + specifier.type === AST_NODE_TYPES.ImportDefaultSpecifier, + ) + ) { + sourceImports.valueImport = node; } } @@ -246,14 +252,15 @@ export default util.createRule({ 'Program:exit'(): void { for (const sourceImports of Object.values(sourceImportsMap)) { if (sourceImports.reportValueImports.length === 0) { + // nothing to fix. value specifiers and type specifiers are correctly written continue; } for (const report of sourceImports.reportValueImports) { if ( report.valueSpecifiers.length === 0 && - report.unusedSpecifiers.length === 0 + report.unusedSpecifiers.length === 0 && + report.node.importKind !== 'type' ) { - // import is all type-only, convert the entire import to `import type` context.report({ node: report.node, messageId: 'typeOverValue', @@ -268,12 +275,13 @@ export default util.createRule({ } else { const isTypeImport = report.node.importKind === 'type'; - // we have a mixed type/value import, so we need to split them out into multiple exports + // we have a mixed type/value import or just value imports, so we need to split them out into multiple imports if separate-type-imports is configured const importNames = ( isTypeImport - ? report.valueSpecifiers + ? report.valueSpecifiers // import type { A } from 'roo'; // WHERE A is used in value position : report.typeSpecifiers - ).map(specifier => `"${specifier.local.name}"`); + ) // import { A, B } from 'roo'; // WHERE A is used in type position and B is in value position + .map(specifier => `"${specifier.local.name}"`); const message = ((): { messageId: MessageIds; @@ -297,12 +305,12 @@ export default util.createRule({ if (isTypeImport) { return { messageId: 'someImportsInDecoMeta', - data: { typeImports }, + data: { typeImports }, // typeImports are all the value specifiers that are in the type position }; } else { return { messageId: 'someImportsAreOnlyTypes', - data: { typeImports }, + data: { typeImports }, // typeImports are all the type specifiers in the value position }; } } @@ -313,12 +321,14 @@ export default util.createRule({ ...message, *fix(fixer) { if (isTypeImport) { + // take all the valueSpecifiers and put them on a new line yield* fixToValueImportDeclaration( fixer, report, sourceImports, ); } else { + // take all the typeSpecifiers and put them on a new line yield* fixToTypeImportDeclaration( fixer, report, @@ -399,12 +409,12 @@ export default util.createRule({ } /** - * Returns information for fixing named specifiers. + * Returns information for fixing named specifiers, type or value */ function getFixesNamedSpecifiers( fixer: TSESLint.RuleFixer, node: TSESTree.ImportDeclaration, - typeNamedSpecifiers: TSESTree.ImportSpecifier[], + subsetNamedSpecifiers: TSESTree.ImportSpecifier[], allNamedSpecifiers: TSESTree.ImportSpecifier[], ): { typeNamedSpecifiersText: string; @@ -418,12 +428,12 @@ export default util.createRule({ } const typeNamedSpecifiersTexts: string[] = []; const removeTypeNamedSpecifiers: TSESLint.RuleFix[] = []; - if (typeNamedSpecifiers.length === allNamedSpecifiers.length) { + if (subsetNamedSpecifiers.length === allNamedSpecifiers.length) { // import Foo, {Type1, Type2} from 'foo' // import DefType, {Type1, Type2} from 'foo' const openingBraceToken = util.nullThrows( sourceCode.getTokenBefore( - typeNamedSpecifiers[0], + subsetNamedSpecifiers[0], util.isOpeningBraceToken, ), util.NullThrowsReasons.MissingToken('{', node.type), @@ -454,20 +464,20 @@ export default util.createRule({ ), ); } else { - const typeNamedSpecifierGroups: TSESTree.ImportSpecifier[][] = []; + const namedSpecifierGroups: TSESTree.ImportSpecifier[][] = []; let group: TSESTree.ImportSpecifier[] = []; for (const namedSpecifier of allNamedSpecifiers) { - if (typeNamedSpecifiers.includes(namedSpecifier)) { + if (subsetNamedSpecifiers.includes(namedSpecifier)) { group.push(namedSpecifier); } else if (group.length) { - typeNamedSpecifierGroups.push(group); + namedSpecifierGroups.push(group); group = []; } } if (group.length) { - typeNamedSpecifierGroups.push(group); + namedSpecifierGroups.push(group); } - for (const namedSpecifiers of typeNamedSpecifierGroups) { + for (const namedSpecifiers of namedSpecifierGroups) { const { removeRange, textRange } = getNamedSpecifierRanges( namedSpecifiers, allNamedSpecifiers, @@ -544,7 +554,53 @@ export default util.createRule({ if (!util.isCommaToken(before) && !util.isOpeningBraceToken(before)) { insertText = `,${insertText}`; } - return fixer.insertTextBefore(closingBraceToken, `${insertText}`); + return fixer.insertTextBefore(closingBraceToken, insertText); + } + + /** + * insert type keyword to named import node. + * e.g. + * import ADefault, { Already, type Type1, type Type2 } from 'foo' + * ^^^^ insert + */ + function* fixInsertTypeKeywordInNamedSpecifierList( + fixer: TSESLint.RuleFixer, + typeSpecifiers: TSESTree.ImportSpecifier[], + ): IterableIterator { + for (const spec of typeSpecifiers) { + const insertText = sourceCode.text.slice(...spec.range); + yield fixer.replaceTextRange(spec.range, `type ${insertText}`); + } + } + + function* fixInlineTypeImportDeclaration( + fixer: TSESLint.RuleFixer, + report: ReportValueImport, + sourceImports: SourceImports, + ): IterableIterator { + const { node } = report; + // For a value import, will only add an inline type to named specifiers + const { namedSpecifiers } = classifySpecifier(node); + const typeNamedSpecifiers = namedSpecifiers.filter(specifier => + report.typeSpecifiers.includes(specifier), + ); + + if (sourceImports.valueImport) { + // add import named type specifiers to its value import + // import ValueA, { type A } + // ^^^^ insert + const { namedSpecifiers: valueImportNamedSpecifiers } = + classifySpecifier(sourceImports.valueImport); + if ( + sourceImports.valueOnlyNamedImport || + valueImportNamedSpecifiers.length + ) { + yield* fixInsertTypeKeywordInNamedSpecifierList( + fixer, + typeNamedSpecifiers, + ); + } + } } function* fixToTypeImportDeclaration( @@ -570,13 +626,31 @@ export default util.createRule({ // import Type from 'foo' yield* fixInsertTypeSpecifierForImportDeclaration(fixer, node, true); return; + } else if ( + fixStyle === 'inline-type-imports' && + !report.typeSpecifiers.includes(defaultSpecifier) && + namedSpecifiers.length > 0 && + !namespaceSpecifier + ) { + // if there is a default specifier but it isn't a type specifier, then just add the inline type modifier to the named specifiers + // import AValue, {BValue, Type1, Type2} from 'foo' + yield* fixInlineTypeImportDeclaration(fixer, report, sourceImports); + return; } - } else { + } else if (!namespaceSpecifier) { if ( + fixStyle === 'inline-type-imports' && + namedSpecifiers.some(specifier => + report.typeSpecifiers.includes(specifier), + ) + ) { + // import {AValue, Type1, Type2} from 'foo' + yield* fixInlineTypeImportDeclaration(fixer, report, sourceImports); + return; + } else if ( namedSpecifiers.every(specifier => report.typeSpecifiers.includes(specifier), - ) && - !namespaceSpecifier + ) ) { // import {Type1, Type2} from 'foo' yield* fixInsertTypeSpecifierForImportDeclaration(fixer, node, false); @@ -609,12 +683,25 @@ export default util.createRule({ afterFixes.push(insertTypeNamedSpecifiers); } } else { - yield fixer.insertTextBefore( - node, - `import type {${ - fixesNamedSpecifiers.typeNamedSpecifiersText - }} from ${sourceCode.getText(node.source)};\n`, - ); + // The import is both default and named. Insert named on new line because can't mix default type import and named type imports + if (fixStyle === 'inline-type-imports') { + yield fixer.insertTextBefore( + node, + `import {${typeNamedSpecifiers + .map(spec => { + const insertText = sourceCode.text.slice(...spec.range); + return `type ${insertText}`; + }) + .join(', ')}} from ${sourceCode.getText(node.source)};\n`, + ); + } else { + yield fixer.insertTextBefore( + node, + `import type {${ + fixesNamedSpecifiers.typeNamedSpecifiersText + }} from ${sourceCode.getText(node.source)};\n`, + ); + } } } @@ -652,7 +739,7 @@ export default util.createRule({ ) { if (report.typeSpecifiers.length === node.specifiers.length) { const importToken = util.nullThrows( - sourceCode.getFirstToken(node, isImportToken), + sourceCode.getFirstToken(node, util.isImportKeyword), util.NullThrowsReasons.MissingToken('import', node.type), ); // import type Type from 'foo' @@ -701,7 +788,7 @@ export default util.createRule({ // import type Foo from 'foo' // ^^^^^ insert const importToken = util.nullThrows( - sourceCode.getFirstToken(node, isImportToken), + sourceCode.getFirstToken(node, util.isImportKeyword), util.NullThrowsReasons.MissingToken('import', node.type), ); yield fixer.insertTextAfter(importToken, ' type'); @@ -739,8 +826,6 @@ export default util.createRule({ closingBraceToken.range[1], ); if (node.specifiers.length > 1) { - // import type Foo from 'foo' - // import type {...} from 'foo' // <- insert yield fixer.insertTextAfter( node, `\nimport type${specifiersText} from ${sourceCode.getText( @@ -797,6 +882,9 @@ export default util.createRule({ } } + // we have some valueSpecifiers intermixed in types that need to be put on their own line + // import type { Type1, A } from 'foo' + // import type { A } from 'foo' const valueNamedSpecifiers = namedSpecifiers.filter(specifier => report.valueSpecifiers.includes(specifier), ); @@ -822,6 +910,8 @@ export default util.createRule({ afterFixes.push(insertTypeNamedSpecifiers); } } else { + // some are types. + // Add new value import and later remove those value specifiers from import type yield fixer.insertTextBefore( node, `import {${ @@ -843,14 +933,14 @@ export default util.createRule({ // import type Foo from 'foo' // ^^^^ remove const importToken = util.nullThrows( - sourceCode.getFirstToken(node, isImportToken), + sourceCode.getFirstToken(node, util.isImportKeyword), util.NullThrowsReasons.MissingToken('import', node.type), ); const typeToken = util.nullThrows( sourceCode.getFirstTokenBetween( importToken, node.specifiers[0]?.local ?? node.source, - isTypeToken, + util.isTypeKeyword, ), util.NullThrowsReasons.MissingToken('type', node.type), ); @@ -865,8 +955,10 @@ export default util.createRule({ fixer: TSESLint.RuleFixer, node: TSESTree.ImportSpecifier, ): IterableIterator { + // import { type Foo } from 'foo' + // ^^^^ remove const typeToken = util.nullThrows( - sourceCode.getFirstToken(node, isTypeToken), + sourceCode.getFirstToken(node, util.isTypeKeyword), util.NullThrowsReasons.MissingToken('type', node.type), ); const afterToken = util.nullThrows( diff --git a/packages/eslint-plugin/src/rules/default-param-last.ts b/packages/eslint-plugin/src/rules/default-param-last.ts index a701e3765dd..ba9d5da7b4e 100644 --- a/packages/eslint-plugin/src/rules/default-param-last.ts +++ b/packages/eslint-plugin/src/rules/default-param-last.ts @@ -1,5 +1,7 @@ +import type { TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; + import { createRule } from '../util'; -import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/utils'; export default createRule({ name: 'default-param-last', diff --git a/packages/eslint-plugin/src/rules/dot-notation.ts b/packages/eslint-plugin/src/rules/dot-notation.ts index 8b9d82d6362..9f0b0d1304b 100644 --- a/packages/eslint-plugin/src/rules/dot-notation.ts +++ b/packages/eslint-plugin/src/rules/dot-notation.ts @@ -1,13 +1,13 @@ -import { TSESTree } from '@typescript-eslint/utils'; -import * as ts from 'typescript'; +import type { TSESTree } from '@typescript-eslint/utils'; import * as tsutils from 'tsutils'; -import { getESLintCoreRule } from '../util/getESLintCoreRule'; -import { - createRule, - getParserServices, +import * as ts from 'typescript'; + +import type { InferMessageIdsTypeFromRule, InferOptionsTypeFromRule, } from '../util'; +import { createRule, getModifiers, getParserServices } from '../util'; +import { getESLintCoreRule } from '../util/getESLintCoreRule'; const baseRule = getESLintCoreRule('dot-notation'); @@ -95,13 +95,14 @@ export default createRule({ const propertySymbol = typeChecker.getSymbolAtLocation( esTreeNodeToTSNodeMap.get(node.property), ); - const modifierKind = - propertySymbol?.getDeclarations()?.[0]?.modifiers?.[0].kind; + const modifierKind = getModifiers( + propertySymbol?.getDeclarations()?.[0], + )?.[0].kind; if ( (allowPrivateClassPropertyAccess && - modifierKind == ts.SyntaxKind.PrivateKeyword) || + modifierKind === ts.SyntaxKind.PrivateKeyword) || (allowProtectedClassPropertyAccess && - modifierKind == ts.SyntaxKind.ProtectedKeyword) + modifierKind === ts.SyntaxKind.ProtectedKeyword) ) { return; } @@ -115,7 +116,7 @@ export default createRule({ const indexType = objectType .getNonNullableType() .getStringIndexType(); - if (indexType != undefined) { + if (indexType !== undefined) { return; } } diff --git a/packages/eslint-plugin/src/rules/explicit-function-return-type.ts b/packages/eslint-plugin/src/rules/explicit-function-return-type.ts index 1f69834d478..1d216ebff1d 100644 --- a/packages/eslint-plugin/src/rules/explicit-function-return-type.ts +++ b/packages/eslint-plugin/src/rules/explicit-function-return-type.ts @@ -1,9 +1,11 @@ -import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; + import * as util from '../util'; import { + ancestorHasReturnType, checkFunctionReturnType, isValidFunctionExpressionReturnType, - ancestorHasReturnType, } from '../util/explicitReturnTypeUtils'; type Options = [ @@ -34,26 +36,38 @@ export default util.createRule({ { type: 'object', properties: { - allowExpressions: { + allowConciseArrowFunctionExpressionsStartingWithVoid: { + description: + 'Whether to allow arrow functions that start with the `void` keyword.', type: 'boolean', }, - allowTypedFunctionExpressions: { + allowExpressions: { + description: + 'Whether to ignore function expressions (functions which are not part of a declaration).', type: 'boolean', }, allowHigherOrderFunctions: { + description: + 'Whether to ignore functions immediately returning another function expression.', type: 'boolean', }, - allowDirectConstAssertionInArrowFunctions: { + allowTypedFunctionExpressions: { + description: + 'Whether to ignore type annotations on the variable of function expressions.', type: 'boolean', }, - allowConciseArrowFunctionExpressionsStartingWithVoid: { + allowDirectConstAssertionInArrowFunctions: { + description: + 'Whether to ignore arrow functions immediately returning a `as const` value.', type: 'boolean', }, allowedNames: { - type: 'array', + description: + 'An array of function/method names that will not have their arguments or return values checked.', items: { type: 'string', }, + type: 'array', }, }, additionalProperties: false, @@ -78,7 +92,7 @@ export default util.createRule({ | TSESTree.FunctionExpression | TSESTree.FunctionDeclaration, ): boolean { - if (!options.allowedNames || !options.allowedNames.length) { + if (!options.allowedNames?.length) { return false; } diff --git a/packages/eslint-plugin/src/rules/explicit-member-accessibility.ts b/packages/eslint-plugin/src/rules/explicit-member-accessibility.ts index b67221aee54..3fc42a956f6 100644 --- a/packages/eslint-plugin/src/rules/explicit-member-accessibility.ts +++ b/packages/eslint-plugin/src/rules/explicit-member-accessibility.ts @@ -1,9 +1,6 @@ -import { - AST_NODE_TYPES, - AST_TOKEN_TYPES, - TSESLint, - TSESTree, -} from '@typescript-eslint/utils'; +import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES, AST_TOKEN_TYPES } from '@typescript-eslint/utils'; + import * as util from '../util'; type AccessibilityLevel = @@ -25,13 +22,32 @@ interface Config { type Options = [Config]; -type MessageIds = 'unwantedPublicAccessibility' | 'missingAccessibility'; +type MessageIds = + | 'unwantedPublicAccessibility' + | 'missingAccessibility' + | 'addExplicitAccessibility'; -const accessibilityLevel = { enum: ['explicit', 'no-public', 'off'] }; +const accessibilityLevel = { + oneOf: [ + { + const: 'explicit', + description: 'Always require an accessor.', + }, + { + const: 'no-public', + description: 'Require an accessor except when public.', + }, + { + const: 'off', + description: 'Never check whether there is an accessor.', + }, + ], +}; export default util.createRule({ name: 'explicit-member-accessibility', meta: { + hasSuggestions: true, type: 'problem', docs: { description: @@ -45,34 +61,43 @@ export default util.createRule({ 'Missing accessibility modifier on {{type}} {{name}}.', unwantedPublicAccessibility: 'Public accessibility modifier on {{type}} {{name}}.', + addExplicitAccessibility: "Add '{{ type }}' accessibility modifier", }, - schema: [ - { - type: 'object', - properties: { - accessibility: accessibilityLevel, - overrides: { - type: 'object', - properties: { - accessors: accessibilityLevel, - constructors: accessibilityLevel, - methods: accessibilityLevel, - properties: accessibilityLevel, - parameterProperties: accessibilityLevel, - }, + schema: { + $defs: { + accessibilityLevel, + }, + prefixItems: [ + { + type: 'object', + properties: { + accessibility: { $ref: '#/$defs/accessibilityLevel' }, + overrides: { + type: 'object', + properties: { + accessors: { $ref: '#/$defs/accessibilityLevel' }, + constructors: { $ref: '#/$defs/accessibilityLevel' }, + methods: { $ref: '#/$defs/accessibilityLevel' }, + properties: { $ref: '#/$defs/accessibilityLevel' }, + parameterProperties: { + $ref: '#/$defs/accessibilityLevel', + }, + }, - additionalProperties: false, - }, - ignoredMethodNames: { - type: 'array', - items: { - type: 'string', + additionalProperties: false, + }, + ignoredMethodNames: { + type: 'array', + items: { + type: 'string', + }, }, }, + additionalProperties: false, }, - additionalProperties: false, - }, - ], + ], + type: 'array', + }, }, defaultOptions: [{ accessibility: 'explicit' }], create(context, [option]) { @@ -85,26 +110,6 @@ export default util.createRule({ const propCheck = overrides.properties ?? baseCheck; const paramPropCheck = overrides.parameterProperties ?? baseCheck; const ignoredMethodNames = new Set(option.ignoredMethodNames ?? []); - /** - * Generates the report for rule violations - */ - function reportIssue( - messageId: MessageIds, - nodeType: string, - node: TSESTree.Node, - nodeName: string, - fix: TSESLint.ReportFixFunction | null = null, - ): void { - context.report({ - node, - messageId, - data: { - type: nodeType, - name: nodeName, - }, - fix, - }); - } /** * Checks if a method declaration has an accessibility modifier. @@ -146,20 +151,25 @@ export default util.createRule({ check === 'no-public' && methodDefinition.accessibility === 'public' ) { - reportIssue( - 'unwantedPublicAccessibility', - nodeType, - methodDefinition, - methodName, - getUnwantedPublicAccessibilityFixer(methodDefinition), - ); + context.report({ + node: methodDefinition, + messageId: 'unwantedPublicAccessibility', + data: { + type: nodeType, + name: methodName, + }, + fix: getUnwantedPublicAccessibilityFixer(methodDefinition), + }); } else if (check === 'explicit' && !methodDefinition.accessibility) { - reportIssue( - 'missingAccessibility', - nodeType, - methodDefinition, - methodName, - ); + context.report({ + node: methodDefinition, + messageId: 'missingAccessibility', + data: { + type: nodeType, + name: methodName, + }, + suggest: getMissingAccessibilitySuggestions(methodDefinition), + }); } } @@ -205,6 +215,48 @@ export default util.createRule({ }; } + /** + * Creates a fixer that adds a "public" keyword with following spaces + */ + function getMissingAccessibilitySuggestions( + node: + | TSESTree.MethodDefinition + | TSESTree.PropertyDefinition + | TSESTree.TSAbstractMethodDefinition + | TSESTree.TSAbstractPropertyDefinition + | TSESTree.TSParameterProperty, + ): TSESLint.ReportSuggestionArray { + function fix( + accessibility: TSESTree.Accessibility, + fixer: TSESLint.RuleFixer, + ): TSESLint.RuleFix | null { + if (node?.decorators?.length) { + const lastDecorator = node.decorators[node.decorators.length - 1]; + const nextToken = sourceCode.getTokenAfter(lastDecorator)!; + return fixer.insertTextBefore(nextToken, `${accessibility} `); + } + return fixer.insertTextBefore(node, `${accessibility} `); + } + + return [ + { + messageId: 'addExplicitAccessibility', + data: { type: 'public' }, + fix: fixer => fix('public', fixer), + }, + { + messageId: 'addExplicitAccessibility', + data: { type: 'private' }, + fix: fixer => fix('private', fixer), + }, + { + messageId: 'addExplicitAccessibility', + data: { type: 'protected' }, + fix: fixer => fix('protected', fixer), + }, + ]; + } + /** * Checks if property has an accessibility modifier. * @param propertyDefinition The node representing a PropertyDefinition. @@ -228,23 +280,28 @@ export default util.createRule({ propCheck === 'no-public' && propertyDefinition.accessibility === 'public' ) { - reportIssue( - 'unwantedPublicAccessibility', - nodeType, - propertyDefinition, - propertyName, - getUnwantedPublicAccessibilityFixer(propertyDefinition), - ); + context.report({ + node: propertyDefinition, + messageId: 'unwantedPublicAccessibility', + data: { + type: nodeType, + name: propertyName, + }, + fix: getUnwantedPublicAccessibilityFixer(propertyDefinition), + }); } else if ( propCheck === 'explicit' && !propertyDefinition.accessibility ) { - reportIssue( - 'missingAccessibility', - nodeType, - propertyDefinition, - propertyName, - ); + context.report({ + node: propertyDefinition, + messageId: 'missingAccessibility', + data: { + type: nodeType, + name: propertyName, + }, + suggest: getMissingAccessibilitySuggestions(propertyDefinition), + }); } } @@ -273,19 +330,29 @@ export default util.createRule({ switch (paramPropCheck) { case 'explicit': { if (!node.accessibility) { - reportIssue('missingAccessibility', nodeType, node, nodeName); + context.report({ + node, + messageId: 'missingAccessibility', + data: { + type: nodeType, + name: nodeName, + }, + suggest: getMissingAccessibilitySuggestions(node), + }); } break; } case 'no-public': { if (node.accessibility === 'public' && node.readonly) { - reportIssue( - 'unwantedPublicAccessibility', - nodeType, + context.report({ node, - nodeName, - getUnwantedPublicAccessibilityFixer(node), - ); + messageId: 'unwantedPublicAccessibility', + data: { + type: nodeType, + name: nodeName, + }, + fix: getUnwantedPublicAccessibilityFixer(node), + }); } break; } 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 3f9f50086cc..e7552e0cbd8 100644 --- a/packages/eslint-plugin/src/rules/explicit-module-boundary-types.ts +++ b/packages/eslint-plugin/src/rules/explicit-module-boundary-types.ts @@ -1,14 +1,18 @@ -import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils'; import { DefinitionType } from '@typescript-eslint/scope-manager'; +import type { TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; + import * as util from '../util'; +import type { + FunctionExpression, + FunctionNode, +} from '../util/explicitReturnTypeUtils'; import { + ancestorHasReturnType, checkFunctionExpressionReturnType, checkFunctionReturnType, doesImmediatelyReturnFunctionExpression, - FunctionExpression, - FunctionNode, isTypedFunctionExpression, - ancestorHasReturnType, } from '../util/explicitReturnTypeUtils'; type Options = [ @@ -50,21 +54,35 @@ export default util.createRule({ type: 'object', properties: { allowArgumentsExplicitlyTypedAsAny: { + description: + 'Whether to ignore arguments that are explicitly typed as `any`.', type: 'boolean', }, allowDirectConstAssertionInArrowFunctions: { + description: [ + 'Whether to ignore return type annotations on body-less arrow functions that return an `as const` type assertion.', + 'You must still type the parameters of the function.', + ].join('\n'), type: 'boolean', }, allowedNames: { - type: 'array', + description: + 'An array of function/method names that will not have their arguments or return values checked.', items: { type: 'string', }, + type: 'array', }, allowHigherOrderFunctions: { + description: [ + 'Whether to ignore return type annotations on functions immediately returning another function expression.', + 'You must still type the parameters of the function.', + ].join('\n'), type: 'boolean', }, allowTypedFunctionExpressions: { + description: + 'Whether to ignore type annotations on the variable of a function expresion.', type: 'boolean', }, // DEPRECATED - To be removed in next major diff --git a/packages/eslint-plugin/src/rules/func-call-spacing.ts b/packages/eslint-plugin/src/rules/func-call-spacing.ts index dca898ff718..c57f4e16b46 100644 --- a/packages/eslint-plugin/src/rules/func-call-spacing.ts +++ b/packages/eslint-plugin/src/rules/func-call-spacing.ts @@ -1,4 +1,5 @@ -import { TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; + import * as util from '../util'; export type Options = [ diff --git a/packages/eslint-plugin/src/rules/indent-new-do-not-use/BinarySearchTree.ts b/packages/eslint-plugin/src/rules/indent-new-do-not-use/BinarySearchTree.ts deleted file mode 100644 index 8c2db5cb18b..00000000000 --- a/packages/eslint-plugin/src/rules/indent-new-do-not-use/BinarySearchTree.ts +++ /dev/null @@ -1,59 +0,0 @@ -// The following code is adapted from the the code in eslint. -// License: https://github.com/eslint/eslint/blob/48700fc8408f394887cdedd071b22b757700fdcb/LICENSE - -import { TSESTree } from '@typescript-eslint/utils'; -import createTree from 'functional-red-black-tree'; - -export interface TreeValue { - offset: number; - from: TSESTree.Token | null; - force: boolean; -} - -/** - * A mutable balanced binary search tree that stores (key, value) pairs. The keys are numeric, and must be unique. - * This is intended to be a generic wrapper around a balanced binary search tree library, so that the underlying implementation - * can easily be swapped out. - */ -export class BinarySearchTree { - private rbTree = createTree(); - - /** - * Inserts an entry into the tree. - */ - public insert(key: number, value: TreeValue): void { - const iterator = this.rbTree.find(key); - - if (iterator.valid) { - this.rbTree = iterator.update(value); - } else { - this.rbTree = this.rbTree.insert(key, value); - } - } - - /** - * Finds the entry with the largest key less than or equal to the provided key - * @returns The found entry, or null if no such entry exists. - */ - public findLe(key: number): { key: number; value: TreeValue } { - const iterator = this.rbTree.le(key); - - return { key: iterator.key, value: iterator.value }; - } - - /** - * Deletes all of the keys in the interval [start, end) - */ - public deleteRange(start: number, end: number): void { - // Exit without traversing the tree if the range has zero size. - if (start === end) { - return; - } - const iterator = this.rbTree.ge(start); - - while (iterator.valid && iterator.key < end) { - this.rbTree = this.rbTree.remove(iterator.key); - iterator.next(); - } - } -} diff --git a/packages/eslint-plugin/src/rules/indent-new-do-not-use/OffsetStorage.ts b/packages/eslint-plugin/src/rules/indent-new-do-not-use/OffsetStorage.ts deleted file mode 100644 index a5fb8d5a448..00000000000 --- a/packages/eslint-plugin/src/rules/indent-new-do-not-use/OffsetStorage.ts +++ /dev/null @@ -1,279 +0,0 @@ -// The following code is adapted from the the code in eslint. -// License: https://github.com/eslint/eslint/blob/48700fc8408f394887cdedd071b22b757700fdcb/LICENSE - -import { TSESTree } from '@typescript-eslint/utils'; -import { BinarySearchTree, TreeValue } from './BinarySearchTree'; -import { TokenInfo } from './TokenInfo'; - -/** - * A class to store information on desired offsets of tokens from each other - */ -export class OffsetStorage { - private readonly tokenInfo: TokenInfo; - private readonly indentSize: number; - private readonly indentType: string; - private readonly tree: BinarySearchTree; - private readonly lockedFirstTokens: WeakMap; - private readonly desiredIndentCache: WeakMap; - private readonly ignoredTokens: WeakSet; - /** - * @param tokenInfo a TokenInfo instance - * @param indentSize The desired size of each indentation level - * @param indentType The indentation character - */ - constructor(tokenInfo: TokenInfo, indentSize: number, indentType: string) { - this.tokenInfo = tokenInfo; - this.indentSize = indentSize; - this.indentType = indentType; - - this.tree = new BinarySearchTree(); - this.tree.insert(0, { offset: 0, from: null, force: false }); - - this.lockedFirstTokens = new WeakMap(); - this.desiredIndentCache = new WeakMap(); - this.ignoredTokens = new WeakSet(); - } - - private getOffsetDescriptor(token: TSESTree.Token): TreeValue { - return this.tree.findLe(token.range[0]).value; - } - - /** - * Sets the offset column of token B to match the offset column of token A. - * **WARNING**: This matches a *column*, even if baseToken is not the first token on its line. In - * most cases, `setDesiredOffset` should be used instead. - * @param baseToken The first token - * @param offsetToken The second token, whose offset should be matched to the first token - */ - public matchOffsetOf( - baseToken: TSESTree.Token, - offsetToken: TSESTree.Token, - ): void { - /* - * lockedFirstTokens is a map from a token whose indentation is controlled by the "first" option to - * the token that it depends on. For example, with the `ArrayExpression: first` option, the first - * token of each element in the array after the first will be mapped to the first token of the first - * element. The desired indentation of each of these tokens is computed based on the desired indentation - * of the "first" element, rather than through the normal offset mechanism. - */ - this.lockedFirstTokens.set(offsetToken, baseToken); - } - - /** - * Sets the desired offset of a token. - * - * This uses a line-based offset collapsing behavior to handle tokens on the same line. - * For example, consider the following two cases: - * - * ( - * [ - * bar - * ] - * ) - * - * ([ - * bar - * ]) - * - * Based on the first case, it's clear that the `bar` token needs to have an offset of 1 indent level (4 spaces) from - * the `[` token, and the `[` token has to have an offset of 1 indent level from the `(` token. Since the `(` token is - * the first on its line (with an indent of 0 spaces), the `bar` token needs to be offset by 2 indent levels (8 spaces) - * from the start of its line. - * - * However, in the second case `bar` should only be indented by 4 spaces. This is because the offset of 1 indent level - * between the `(` and the `[` tokens gets "collapsed" because the two tokens are on the same line. As a result, the - * `(` token is mapped to the `[` token with an offset of 0, and the rule correctly decides that `bar` should be indented - * by 1 indent level from the start of the line. - * - * This is useful because rule listeners can usually just call `setDesiredOffset` for all the tokens in the node, - * without needing to check which lines those tokens are on. - * - * Note that since collapsing only occurs when two tokens are on the same line, there are a few cases where non-intuitive - * behavior can occur. For example, consider the following cases: - * - * foo( - * ). - * bar( - * baz - * ) - * - * foo( - * ).bar( - * baz - * ) - * - * Based on the first example, it would seem that `bar` should be offset by 1 indent level from `foo`, and `baz` - * should be offset by 1 indent level from `bar`. However, this is not correct, because it would result in `baz` - * being indented by 2 indent levels in the second case (since `foo`, `bar`, and `baz` are all on separate lines, no - * collapsing would occur). - * - * Instead, the correct way would be to offset `baz` by 1 level from `bar`, offset `bar` by 1 level from the `)`, and - * offset the `)` by 0 levels from `foo`. This ensures that the offset between `bar` and the `)` are correctly collapsed - * in the second case. - * - * @param token The token - * @param fromToken The token that `token` should be offset from - * @param offset The desired indent level - */ - public setDesiredOffset( - token: TSESTree.Token, - fromToken: TSESTree.Token | null, - offset: number, - ): void { - this.setDesiredOffsets(token.range, fromToken, offset); - } - - /** - * Sets the desired offset of all tokens in a range - * It's common for node listeners in this file to need to apply the same offset to a large, contiguous range of tokens. - * Moreover, the offset of any given token is usually updated multiple times (roughly once for each node that contains - * it). This means that the offset of each token is updated O(AST depth) times. - * It would not be performant to store and update the offsets for each token independently, because the rule would end - * up having a time complexity of O(number of tokens * AST depth), which is quite slow for large files. - * - * Instead, the offset tree is represented as a collection of contiguous offset ranges in a file. For example, the following - * list could represent the state of the offset tree at a given point: - * - * * Tokens starting in the interval [0, 15) are aligned with the beginning of the file - * * Tokens starting in the interval [15, 30) are offset by 1 indent level from the `bar` token - * * Tokens starting in the interval [30, 43) are offset by 1 indent level from the `foo` token - * * Tokens starting in the interval [43, 820) are offset by 2 indent levels from the `bar` token - * * Tokens starting in the interval [820, ∞) are offset by 1 indent level from the `baz` token - * - * The `setDesiredOffsets` methods inserts ranges like the ones above. The third line above would be inserted by using: - * `setDesiredOffsets([30, 43], fooToken, 1);` - * - * @param range A [start, end] pair. All tokens with range[0] <= token.start < range[1] will have the offset applied. - * @param fromToken The token that this is offset from - * @param offset The desired indent level - * @param force `true` if this offset should not use the normal collapsing behavior. This should almost always be false. - */ - public setDesiredOffsets( - range: [number, number], - fromToken: TSESTree.Token | null, - offset = 0, - force = false, - ): void { - /* - * Offset ranges are stored as a collection of nodes, where each node maps a numeric key to an offset - * descriptor. The tree for the example above would have the following nodes: - * - * * key: 0, value: { offset: 0, from: null } - * * key: 15, value: { offset: 1, from: barToken } - * * key: 30, value: { offset: 1, from: fooToken } - * * key: 43, value: { offset: 2, from: barToken } - * * key: 820, value: { offset: 1, from: bazToken } - * - * To find the offset descriptor for any given token, one needs to find the node with the largest key - * which is <= token.start. To make this operation fast, the nodes are stored in a balanced binary - * search tree indexed by key. - */ - - const descriptorToInsert = { offset, from: fromToken, force }; - - const descriptorAfterRange = this.tree.findLe(range[1]).value; - - const fromTokenIsInRange = - fromToken && - fromToken.range[0] >= range[0] && - fromToken.range[1] <= range[1]; - // this has to be before the delete + insert below or else you'll get into a cycle - const fromTokenDescriptor = fromTokenIsInRange - ? this.getOffsetDescriptor(fromToken) - : null; - - // First, remove any existing nodes in the range from the tree. - this.tree.deleteRange(range[0] + 1, range[1]); - - // Insert a new node into the tree for this range - this.tree.insert(range[0], descriptorToInsert); - - /* - * To avoid circular offset dependencies, keep the `fromToken` token mapped to whatever it was mapped to previously, - * even if it's in the current range. - */ - if (fromTokenIsInRange) { - this.tree.insert(fromToken.range[0], fromTokenDescriptor!); - this.tree.insert(fromToken.range[1], descriptorToInsert); - } - - /* - * To avoid modifying the offset of tokens after the range, insert another node to keep the offset of the following - * tokens the same as it was before. - */ - this.tree.insert(range[1], descriptorAfterRange); - } - - /** - * Gets the desired indent of a token - * @returns The desired indent of the token - */ - public getDesiredIndent(token: TSESTree.Token): string { - if (!this.desiredIndentCache.has(token)) { - if (this.ignoredTokens.has(token)) { - /* - * If the token is ignored, use the actual indent of the token as the desired indent. - * This ensures that no errors are reported for this token. - */ - this.desiredIndentCache.set( - token, - this.tokenInfo.getTokenIndent(token), - ); - } else if (this.lockedFirstTokens.has(token)) { - const firstToken = this.lockedFirstTokens.get(token)!; - - this.desiredIndentCache.set( - token, - - // (indentation for the first element's line) - this.getDesiredIndent( - this.tokenInfo.getFirstTokenOfLine(firstToken), - ) + - // (space between the start of the first element's line and the first element) - this.indentType.repeat( - firstToken.loc.start.column - - this.tokenInfo.getFirstTokenOfLine(firstToken).loc.start.column, - ), - ); - } else { - const offsetInfo = this.getOffsetDescriptor(token); - const offset = - offsetInfo.from && - offsetInfo.from.loc.start.line === token.loc.start.line && - !/^\s*?\n/u.test(token.value) && - !offsetInfo.force - ? 0 - : offsetInfo.offset * this.indentSize; - - this.desiredIndentCache.set( - token, - (offsetInfo.from ? this.getDesiredIndent(offsetInfo.from) : '') + - this.indentType.repeat(offset), - ); - } - } - - return this.desiredIndentCache.get(token)!; - } - - /** - * Ignores a token, preventing it from being reported. - */ - ignoreToken(token: TSESTree.Token): void { - if (this.tokenInfo.isFirstTokenOfLine(token)) { - this.ignoredTokens.add(token); - } - } - - /** - * Gets the first token that the given token's indentation is dependent on - * @returns The token that the given token depends on, or `null` if the given token is at the top level - */ - getFirstDependency( - token: Exclude, - ): Exclude | null; - getFirstDependency(token: TSESTree.Token): TSESTree.Token | null; - getFirstDependency(token: TSESTree.Token): TSESTree.Token | null { - return this.getOffsetDescriptor(token).from; - } -} diff --git a/packages/eslint-plugin/src/rules/indent-new-do-not-use/TokenInfo.ts b/packages/eslint-plugin/src/rules/indent-new-do-not-use/TokenInfo.ts deleted file mode 100644 index 831852d5e66..00000000000 --- a/packages/eslint-plugin/src/rules/indent-new-do-not-use/TokenInfo.ts +++ /dev/null @@ -1,63 +0,0 @@ -// The following code is adapted from the the code in eslint. -// License: https://github.com/eslint/eslint/blob/48700fc8408f394887cdedd071b22b757700fdcb/LICENSE - -import { TSESLint, TSESTree } from '@typescript-eslint/utils'; - -/** - * A helper class to get token-based info related to indentation - */ -export class TokenInfo { - private readonly sourceCode: TSESLint.SourceCode; - public readonly firstTokensByLineNumber: Map; - - constructor(sourceCode: TSESLint.SourceCode) { - this.sourceCode = sourceCode; - this.firstTokensByLineNumber = sourceCode.tokensAndComments.reduce( - (map, token) => { - if (!map.has(token.loc.start.line)) { - map.set(token.loc.start.line, token); - } - if ( - !map.has(token.loc.end.line) && - sourceCode.text - .slice(token.range[1] - token.loc.end.column, token.range[1]) - .trim() - ) { - map.set(token.loc.end.line, token); - } - return map; - }, - new Map(), - ); - } - - /** - * Gets the first token on a given token's line - * @returns The first token on the given line - */ - public getFirstTokenOfLine( - token: TSESTree.Token | TSESTree.Node, - ): TSESTree.Token { - return this.firstTokensByLineNumber.get(token.loc.start.line)!; - } - - /** - * Determines whether a token is the first token in its line - * @returns `true` if the token is the first on its line - */ - public isFirstTokenOfLine(token: TSESTree.Token): boolean { - return this.getFirstTokenOfLine(token) === token; - } - - /** - * Get the actual indent of a token - * @param token Token to examine. This should be the first token on its line. - * @returns The indentation characters that precede the token - */ - public getTokenIndent(token: TSESTree.Token): string { - return this.sourceCode.text.slice( - token.range[0] - token.loc.start.column, - token.range[0], - ); - } -} diff --git a/packages/eslint-plugin/src/rules/indent-new-do-not-use/index.ts b/packages/eslint-plugin/src/rules/indent-new-do-not-use/index.ts deleted file mode 100644 index fa7013b9837..00000000000 --- a/packages/eslint-plugin/src/rules/indent-new-do-not-use/index.ts +++ /dev/null @@ -1,1729 +0,0 @@ -//------------------------------------------------------------------------------ -// Requirements -//------------------------------------------------------------------------------ - -import { - AST_NODE_TYPES, - AST_TOKEN_TYPES, - TSESLint, - TSESTree, -} from '@typescript-eslint/utils'; - -import { OffsetStorage } from './OffsetStorage'; -import { TokenInfo } from './TokenInfo'; -import { - createRule, - ExcludeKeys, - isClosingBraceToken, - isClosingBracketToken, - isClosingParenToken, - isColonToken, - isCommentToken, - isNotClosingParenToken, - isNotOpeningParenToken, - isOpeningBraceToken, - isOpeningParenToken, - isSemicolonToken, - RequireKeys, -} from '../../util'; - -const GLOBAL_LINEBREAK_REGEX = /\r\n|[\r\n\u2028\u2029]/gu; -const WHITESPACE_REGEX = /\s*$/u; - -//------------------------------------------------------------------------------ -// Rule Definition -//------------------------------------------------------------------------------ - -const KNOWN_NODES = new Set([ - AST_NODE_TYPES.AssignmentExpression, - AST_NODE_TYPES.AssignmentPattern, - AST_NODE_TYPES.ArrayExpression, - AST_NODE_TYPES.ArrayPattern, - AST_NODE_TYPES.ArrowFunctionExpression, - AST_NODE_TYPES.AwaitExpression, - AST_NODE_TYPES.BlockStatement, - AST_NODE_TYPES.BinaryExpression, - AST_NODE_TYPES.BreakStatement, - AST_NODE_TYPES.CallExpression, - AST_NODE_TYPES.CatchClause, - AST_NODE_TYPES.ClassBody, - AST_NODE_TYPES.ClassDeclaration, - AST_NODE_TYPES.ClassExpression, - AST_NODE_TYPES.ConditionalExpression, - AST_NODE_TYPES.ContinueStatement, - AST_NODE_TYPES.DoWhileStatement, - AST_NODE_TYPES.DebuggerStatement, - AST_NODE_TYPES.EmptyStatement, - AST_NODE_TYPES.ExpressionStatement, - AST_NODE_TYPES.ForStatement, - AST_NODE_TYPES.ForInStatement, - AST_NODE_TYPES.ForOfStatement, - AST_NODE_TYPES.FunctionDeclaration, - AST_NODE_TYPES.FunctionExpression, - AST_NODE_TYPES.Identifier, - AST_NODE_TYPES.IfStatement, - AST_NODE_TYPES.Literal, - AST_NODE_TYPES.LabeledStatement, - AST_NODE_TYPES.LogicalExpression, - AST_NODE_TYPES.MemberExpression, - AST_NODE_TYPES.MetaProperty, - AST_NODE_TYPES.MethodDefinition, - AST_NODE_TYPES.NewExpression, - AST_NODE_TYPES.ObjectExpression, - AST_NODE_TYPES.ObjectPattern, - AST_NODE_TYPES.Program, - AST_NODE_TYPES.Property, - AST_NODE_TYPES.RestElement, - AST_NODE_TYPES.ReturnStatement, - AST_NODE_TYPES.SequenceExpression, - AST_NODE_TYPES.SpreadElement, - AST_NODE_TYPES.Super, - AST_NODE_TYPES.SwitchCase, - AST_NODE_TYPES.SwitchStatement, - AST_NODE_TYPES.TaggedTemplateExpression, - AST_NODE_TYPES.TemplateElement, - AST_NODE_TYPES.TemplateLiteral, - AST_NODE_TYPES.ThisExpression, - AST_NODE_TYPES.ThrowStatement, - AST_NODE_TYPES.TryStatement, - AST_NODE_TYPES.UnaryExpression, - AST_NODE_TYPES.UpdateExpression, - AST_NODE_TYPES.VariableDeclaration, - AST_NODE_TYPES.VariableDeclarator, - AST_NODE_TYPES.WhileStatement, - AST_NODE_TYPES.WithStatement, - AST_NODE_TYPES.YieldExpression, - AST_NODE_TYPES.JSXIdentifier, - AST_NODE_TYPES.JSXMemberExpression, - AST_NODE_TYPES.JSXEmptyExpression, - AST_NODE_TYPES.JSXExpressionContainer, - AST_NODE_TYPES.JSXElement, - AST_NODE_TYPES.JSXClosingElement, - AST_NODE_TYPES.JSXOpeningElement, - AST_NODE_TYPES.JSXAttribute, - AST_NODE_TYPES.JSXSpreadAttribute, - AST_NODE_TYPES.JSXText, - AST_NODE_TYPES.ExportDefaultDeclaration, - AST_NODE_TYPES.ExportNamedDeclaration, - AST_NODE_TYPES.ExportAllDeclaration, - AST_NODE_TYPES.ExportSpecifier, - AST_NODE_TYPES.ImportDeclaration, - AST_NODE_TYPES.ImportSpecifier, - AST_NODE_TYPES.ImportDefaultSpecifier, - AST_NODE_TYPES.ImportNamespaceSpecifier, - - // Class properties aren't yet supported by eslint... - AST_NODE_TYPES.PropertyDefinition, - - // ts keywords - AST_NODE_TYPES.TSAbstractKeyword, - AST_NODE_TYPES.TSAnyKeyword, - AST_NODE_TYPES.TSBooleanKeyword, - AST_NODE_TYPES.TSNeverKeyword, - AST_NODE_TYPES.TSNumberKeyword, - AST_NODE_TYPES.TSStringKeyword, - AST_NODE_TYPES.TSSymbolKeyword, - AST_NODE_TYPES.TSUndefinedKeyword, - AST_NODE_TYPES.TSUnknownKeyword, - AST_NODE_TYPES.TSVoidKeyword, - AST_NODE_TYPES.TSNullKeyword, - - // ts specific nodes we want to support - AST_NODE_TYPES.TSAbstractPropertyDefinition, - AST_NODE_TYPES.TSAbstractMethodDefinition, - AST_NODE_TYPES.TSArrayType, - AST_NODE_TYPES.TSAsExpression, - AST_NODE_TYPES.TSCallSignatureDeclaration, - AST_NODE_TYPES.TSConditionalType, - AST_NODE_TYPES.TSConstructorType, - AST_NODE_TYPES.TSConstructSignatureDeclaration, - AST_NODE_TYPES.TSDeclareFunction, - AST_NODE_TYPES.TSEmptyBodyFunctionExpression, - AST_NODE_TYPES.TSEnumDeclaration, - AST_NODE_TYPES.TSEnumMember, - AST_NODE_TYPES.TSExportAssignment, - AST_NODE_TYPES.TSExternalModuleReference, - AST_NODE_TYPES.TSFunctionType, - AST_NODE_TYPES.TSImportType, - AST_NODE_TYPES.TSIndexedAccessType, - AST_NODE_TYPES.TSIndexSignature, - AST_NODE_TYPES.TSInferType, - AST_NODE_TYPES.TSInterfaceBody, - AST_NODE_TYPES.TSInterfaceDeclaration, - AST_NODE_TYPES.TSInterfaceHeritage, - AST_NODE_TYPES.TSIntersectionType, - AST_NODE_TYPES.TSImportEqualsDeclaration, - AST_NODE_TYPES.TSLiteralType, - AST_NODE_TYPES.TSMappedType, - AST_NODE_TYPES.TSMethodSignature, - 'TSMinusToken', - AST_NODE_TYPES.TSModuleBlock, - AST_NODE_TYPES.TSModuleDeclaration, - AST_NODE_TYPES.TSNonNullExpression, - AST_NODE_TYPES.TSParameterProperty, - 'TSPlusToken', - AST_NODE_TYPES.TSPropertySignature, - AST_NODE_TYPES.TSQualifiedName, - 'TSQuestionToken', - AST_NODE_TYPES.TSRestType, - AST_NODE_TYPES.TSThisType, - AST_NODE_TYPES.TSTupleType, - AST_NODE_TYPES.TSTypeAnnotation, - AST_NODE_TYPES.TSTypeLiteral, - AST_NODE_TYPES.TSTypeOperator, - AST_NODE_TYPES.TSTypeParameter, - AST_NODE_TYPES.TSTypeParameterDeclaration, - AST_NODE_TYPES.TSTypeParameterInstantiation, - AST_NODE_TYPES.TSTypeReference, - AST_NODE_TYPES.TSUnionType, -]); -const STATEMENT_LIST_PARENTS = new Set([ - AST_NODE_TYPES.Program, - AST_NODE_TYPES.BlockStatement, - AST_NODE_TYPES.SwitchCase, -]); -const DEFAULT_VARIABLE_INDENT = 1; -const DEFAULT_PARAMETER_INDENT = 1; -const DEFAULT_FUNCTION_BODY_INDENT = 1; - -/* - * General rule strategy: - * 1. An OffsetStorage instance stores a map of desired offsets, where each token has a specified offset from another - * specified token or to the first column. - * 2. As the AST is traversed, modify the desired offsets of tokens accordingly. For example, when entering a - * BlockStatement, offset all of the tokens in the BlockStatement by 1 indent level from the opening curly - * brace of the BlockStatement. - * 3. After traversing the AST, calculate the expected indentation levels of every token according to the - * OffsetStorage container. - * 4. For each line, compare the expected indentation of the first token to the actual indentation in the file, - * and report the token if the two values are not equal. - */ - -const ELEMENT_LIST_SCHEMA = { - oneOf: [ - { - type: 'integer', - minimum: 0, - }, - { - enum: ['first', 'off'], - }, - ], -}; - -interface VariableDeclaratorObj { - var?: ElementList; - let?: ElementList; - const?: ElementList; -} -type ElementList = number | 'first' | 'off'; -interface IndentConfig { - SwitchCase?: number; - VariableDeclarator?: ElementList | VariableDeclaratorObj; - outerIIFEBody?: number; - MemberExpression?: number | 'off'; - FunctionDeclaration?: { - parameters?: ElementList; - body?: number; - }; - FunctionExpression?: { - parameters?: ElementList; - body?: number; - }; - CallExpression?: { - arguments?: ElementList; - }; - ArrayExpression?: ElementList; - ObjectExpression?: ElementList; - ImportDeclaration?: ElementList; - flatTernaryExpressions?: boolean; - ignoredNodes?: string[]; - ignoreComments?: boolean; -} -type Options = [('tab' | number)?, IndentConfig?]; -type MessageIds = 'wrongIndentation'; - -type AppliedOptions = ExcludeKeys< - // slight hack to make interface work with Record - RequireKeys, keyof IndentConfig>, - AST_NODE_TYPES.VariableDeclarator -> & { - VariableDeclarator: 'off' | VariableDeclaratorObj; -}; - -export default createRule({ - name: 'indent', - meta: { - type: 'layout', - docs: { - description: 'Enforce consistent indentation.', - recommended: false, - }, - fixable: 'whitespace', - schema: [ - { - oneOf: [ - { - enum: ['tab'], - }, - { - type: 'integer', - minimum: 0, - }, - ], - }, - { - type: 'object', - properties: { - SwitchCase: { - type: 'integer', - minimum: 0, - default: 0, - }, - VariableDeclarator: { - oneOf: [ - ELEMENT_LIST_SCHEMA, - { - type: 'object', - properties: { - var: ELEMENT_LIST_SCHEMA, - let: ELEMENT_LIST_SCHEMA, - const: ELEMENT_LIST_SCHEMA, - }, - additionalProperties: false, - }, - ], - }, - outerIIFEBody: { - type: 'integer', - minimum: 0, - }, - MemberExpression: { - oneOf: [ - { - type: 'integer', - minimum: 0, - }, - { - enum: ['off'], - }, - ], - }, - FunctionDeclaration: { - type: 'object', - properties: { - parameters: ELEMENT_LIST_SCHEMA, - body: { - type: 'integer', - minimum: 0, - }, - }, - additionalProperties: false, - }, - FunctionExpression: { - type: 'object', - properties: { - parameters: ELEMENT_LIST_SCHEMA, - body: { - type: 'integer', - minimum: 0, - }, - }, - additionalProperties: false, - }, - CallExpression: { - type: 'object', - properties: { - arguments: ELEMENT_LIST_SCHEMA, - }, - additionalProperties: false, - }, - ArrayExpression: ELEMENT_LIST_SCHEMA, - ObjectExpression: ELEMENT_LIST_SCHEMA, - ImportDeclaration: ELEMENT_LIST_SCHEMA, - flatTernaryExpressions: { - type: 'boolean', - default: false, - }, - ignoredNodes: { - type: 'array', - items: { - type: 'string', - not: { - pattern: ':exit$', - }, - }, - }, - ignoreComments: { - type: 'boolean', - default: false, - }, - }, - additionalProperties: false, - }, - ], - messages: { - wrongIndentation: - 'Expected indentation of {{expected}} but found {{actual}}.', - }, - }, - defaultOptions: [ - // typescript docs and playground use 4 space indent - 4, - { - // typescript docs indent the case from the switch - // https://www.typescriptlang.org/docs/handbook/release-notes/typescript-1-8.html#example-4 - SwitchCase: 1, - VariableDeclarator: { - var: DEFAULT_VARIABLE_INDENT, - let: DEFAULT_VARIABLE_INDENT, - const: DEFAULT_VARIABLE_INDENT, - }, - outerIIFEBody: 1, - FunctionDeclaration: { - parameters: DEFAULT_PARAMETER_INDENT, - body: DEFAULT_FUNCTION_BODY_INDENT, - }, - FunctionExpression: { - parameters: DEFAULT_PARAMETER_INDENT, - body: DEFAULT_FUNCTION_BODY_INDENT, - }, - CallExpression: { - arguments: DEFAULT_PARAMETER_INDENT, - }, - MemberExpression: 1, - ArrayExpression: 1, - ObjectExpression: 1, - ImportDeclaration: 1, - flatTernaryExpressions: false, - ignoredNodes: [], - ignoreComments: false, - }, - ], - create(context, [userIndent, userOptions]) { - const indentType = userIndent === 'tab' ? 'tab' : 'space'; - const indentSize = userIndent === 'tab' ? 1 : userIndent!; - - const options = userOptions as AppliedOptions; - if ( - typeof userOptions!.VariableDeclarator === 'number' || - userOptions!.VariableDeclarator === 'first' - ) { - // typescript doesn't narrow the type for some reason - options.VariableDeclarator = { - var: userOptions!.VariableDeclarator as number | 'first', - let: userOptions!.VariableDeclarator as number | 'first', - const: userOptions!.VariableDeclarator as number | 'first', - }; - } - - const sourceCode = context.getSourceCode(); - const tokenInfo = new TokenInfo(sourceCode); - const offsets = new OffsetStorage( - tokenInfo, - indentSize, - indentType === 'space' ? ' ' : '\t', - ); - const parameterParens = new WeakSet(); - - /** - * Creates an error message for a line, given the expected/actual indentation. - * @param expectedAmount The expected amount of indentation characters for this line - * @param actualSpaces The actual number of indentation spaces that were found on this line - * @param actualTabs The actual number of indentation tabs that were found on this line - * @returns An error message for this line - */ - function createErrorMessageData( - expectedAmount: number, - actualSpaces: number, - actualTabs: number, - ): { expected: string; actual: string | number } { - const expectedStatement = `${expectedAmount} ${indentType}${ - expectedAmount === 1 ? '' : 's' - }`; // e.g. "2 tabs" - const foundSpacesWord = `space${actualSpaces === 1 ? '' : 's'}`; // e.g. "space" - const foundTabsWord = `tab${actualTabs === 1 ? '' : 's'}`; // e.g. "tabs" - let foundStatement; - - if (actualSpaces > 0) { - /* - * Abbreviate the message if the expected indentation is also spaces. - * e.g. 'Expected 4 spaces but found 2' rather than 'Expected 4 spaces but found 2 spaces' - */ - foundStatement = - indentType === 'space' - ? actualSpaces - : `${actualSpaces} ${foundSpacesWord}`; - } else if (actualTabs > 0) { - foundStatement = - indentType === 'tab' ? actualTabs : `${actualTabs} ${foundTabsWord}`; - } else { - foundStatement = '0'; - } - return { - expected: expectedStatement, - actual: foundStatement, - }; - } - - /** - * Reports a given indent violation - * @param token Token violating the indent rule - * @param neededIndent Expected indentation string - */ - function report(token: TSESTree.Token, neededIndent: string): void { - const actualIndent = Array.from(tokenInfo.getTokenIndent(token)); - const numSpaces = actualIndent.filter(char => char === ' ').length; - const numTabs = actualIndent.filter(char => char === '\t').length; - - context.report({ - node: token, - messageId: 'wrongIndentation', - data: createErrorMessageData(neededIndent.length, numSpaces, numTabs), - loc: { - start: { line: token.loc.start.line, column: 0 }, - end: { line: token.loc.start.line, column: token.loc.start.column }, - }, - fix(fixer) { - return fixer.replaceTextRange( - [token.range[0] - token.loc.start.column, token.range[0]], - neededIndent, - ); - }, - }); - } - - /** - * Checks if a token's indentation is correct - * @param token Token to examine - * @param desiredIndent Desired indentation of the string - * @returns `true` if the token's indentation is correct - */ - function validateTokenIndent( - token: TSESTree.Token, - desiredIndent: string, - ): boolean { - const indentation = tokenInfo.getTokenIndent(token); - - return ( - indentation === desiredIndent || - // To avoid conflicts with no-mixed-spaces-and-tabs, don't report mixed spaces and tabs. - (indentation.includes(' ') && indentation.includes('\t')) - ); - } - - /** - * Check to see if the node is a file level IIFE - * @param node The function node to check. - * @returns True if the node is the outer IIFE - */ - function isOuterIIFE(node: TSESTree.Node): boolean { - /* - * Verify that the node is an IIFE - */ - if ( - !node.parent || - node.parent.type !== AST_NODE_TYPES.CallExpression || - node.parent.callee !== node - ) { - return false; - } - - /* - * Navigate legal ancestors to determine whether this IIFE is outer. - * A "legal ancestor" is an expression or statement that causes the function to get executed immediately. - * For example, `!(function(){})()` is an outer IIFE even though it is preceded by a ! operator. - */ - let statement = node.parent?.parent; - - while ( - statement && - ((statement.type === AST_NODE_TYPES.UnaryExpression && - ['!', '~', '+', '-'].includes(statement.operator)) || - statement.type === AST_NODE_TYPES.AssignmentExpression || - statement.type === AST_NODE_TYPES.LogicalExpression || - statement.type === AST_NODE_TYPES.SequenceExpression || - statement.type === AST_NODE_TYPES.VariableDeclarator) - ) { - statement = statement.parent; - } - - return ( - !!statement && - (statement.type === AST_NODE_TYPES.ExpressionStatement || - statement.type === AST_NODE_TYPES.VariableDeclaration) && - !!statement.parent && - statement.parent.type === AST_NODE_TYPES.Program - ); - } - - /** - * Counts the number of linebreaks that follow the last non-whitespace character in a string - * @param str The string to check - * @returns The number of JavaScript linebreaks that follow the last non-whitespace character, - * or the total number of linebreaks if the string is all whitespace. - */ - function countTrailingLinebreaks(str: string): number { - const trailingWhitespace = WHITESPACE_REGEX.exec(str)![0]; - const linebreakMatches = GLOBAL_LINEBREAK_REGEX.exec(trailingWhitespace); - - return linebreakMatches === null ? 0 : linebreakMatches.length; - } - - /** - * Check indentation for lists of elements (arrays, objects, function params) - * @param elements List of elements that should be offset - * @param startToken The start token of the list that element should be aligned against, e.g. '[' - * @param endToken The end token of the list, e.g. ']' - * @param offset The amount that the elements should be offset - */ - function addElementListIndent( - elements: (TSESTree.Node | null)[], - startToken: TSESTree.Token, - endToken: TSESTree.Token, - offset: number | string, - ): void { - /** - * Gets the first token of a given element, including surrounding parentheses. - * @param element A node in the `elements` list - * @returns The first token of this element - */ - function getFirstToken(element: TSESTree.Node): TSESTree.Token { - let token = sourceCode.getTokenBefore(element)!; - - while (isOpeningParenToken(token) && token !== startToken) { - token = sourceCode.getTokenBefore(token)!; - } - return sourceCode.getTokenAfter(token)!; - } - - // Run through all the tokens in the list, and offset them by one indent level (mainly for comments, other things will end up overridden) - offsets.setDesiredOffsets( - [startToken.range[1], endToken.range[0]], - startToken, - typeof offset === 'number' ? offset : 1, - ); - offsets.setDesiredOffset(endToken, startToken, 0); - - // If the preference is "first" but there is no first element (e.g. sparse arrays w/ empty first slot), fall back to 1 level. - const firstElement = elements[0]; - if (offset === 'first' && elements.length && !firstElement) { - return; - } - elements.forEach((element, index) => { - if (!element) { - // Skip holes in arrays - return; - } - if (offset === 'off') { - // Ignore the first token of every element if the "off" option is used - offsets.ignoreToken(getFirstToken(element)); - } - - // Offset the following elements correctly relative to the first element - if (index === 0) { - return; - } - if ( - offset === 'first' && - tokenInfo.isFirstTokenOfLine(getFirstToken(element)) - ) { - offsets.matchOffsetOf( - getFirstToken(firstElement!), - getFirstToken(element), - ); - } else { - const previousElement = elements[index - 1]; - const firstTokenOfPreviousElement = - previousElement && getFirstToken(previousElement); - const previousElementLastToken = - previousElement && sourceCode.getLastToken(previousElement)!; - - if ( - previousElement && - previousElementLastToken && - previousElementLastToken.loc.end.line - - countTrailingLinebreaks(previousElementLastToken.value) > - startToken.loc.end.line - ) { - offsets.setDesiredOffsets( - [previousElement.range[1], element.range[1]], - firstTokenOfPreviousElement, - 0, - ); - } - } - }); - } - - /** - * Check and decide whether to check for indentation for blockless nodes - * Scenarios are for or while statements without braces around them - */ - function addBlocklessNodeIndent(node: TSESTree.Node): void { - if (node.type !== AST_NODE_TYPES.BlockStatement) { - const lastParentToken = sourceCode.getTokenBefore( - node, - isNotOpeningParenToken, - )!; - - let firstBodyToken = sourceCode.getFirstToken(node)!; - let lastBodyToken = sourceCode.getLastToken(node)!; - - while ( - isOpeningParenToken(sourceCode.getTokenBefore(firstBodyToken)!) && - isClosingParenToken(sourceCode.getTokenAfter(lastBodyToken)!) - ) { - firstBodyToken = sourceCode.getTokenBefore(firstBodyToken)!; - lastBodyToken = sourceCode.getTokenAfter(lastBodyToken)!; - } - - offsets.setDesiredOffsets( - [firstBodyToken.range[0], lastBodyToken.range[1]], - lastParentToken, - 1, - ); - - /* - * For blockless nodes with semicolon-first style, don't indent the semicolon. - * e.g. - * if (foo) bar() - * ; [1, 2, 3].map(foo) - */ - const lastToken = sourceCode.getLastToken(node); - - if ( - lastToken && - node.type !== AST_NODE_TYPES.EmptyStatement && - isSemicolonToken(lastToken) - ) { - offsets.setDesiredOffset(lastToken, lastParentToken, 0); - } - } - } - - /** - * Checks the indentation for nodes that are like function calls - */ - function addFunctionCallIndent( - node: TSESTree.CallExpression | TSESTree.NewExpression, - ): void { - const openingParen = node.arguments.length - ? sourceCode.getFirstTokenBetween( - node.callee, - node.arguments[0], - isOpeningParenToken, - )! - : sourceCode.getLastToken(node, 1)!; - const closingParen = sourceCode.getLastToken(node)!; - - parameterParens.add(openingParen); - parameterParens.add(closingParen); - offsets.setDesiredOffset( - openingParen, - sourceCode.getTokenBefore(openingParen), - 0, - ); - - addElementListIndent( - node.arguments, - openingParen, - closingParen, - options.CallExpression.arguments!, - ); - } - - /** - * Checks the indentation of parenthesized values, given a list of tokens in a program - * @param tokens A list of tokens - */ - function addParensIndent(tokens: TSESTree.Token[]): void { - const parenStack: TSESTree.Token[] = []; - const parenPairs: { left: TSESTree.Token; right: TSESTree.Token }[] = []; - - tokens.forEach(nextToken => { - // Accumulate a list of parenthesis pairs - if (isOpeningParenToken(nextToken)) { - parenStack.push(nextToken); - } else if (isClosingParenToken(nextToken)) { - parenPairs.unshift({ left: parenStack.pop()!, right: nextToken }); - } - }); - - parenPairs.forEach(pair => { - const leftParen = pair.left; - const rightParen = pair.right; - - // We only want to handle parens around expressions, so exclude parentheses that are in function parameters and function call arguments. - if ( - !parameterParens.has(leftParen) && - !parameterParens.has(rightParen) - ) { - const parenthesizedTokens = new Set( - sourceCode.getTokensBetween(leftParen, rightParen), - ); - - parenthesizedTokens.forEach(token => { - if (!parenthesizedTokens.has(offsets.getFirstDependency(token)!)) { - offsets.setDesiredOffset(token, leftParen, 1); - } - }); - } - - offsets.setDesiredOffset(rightParen, leftParen, 0); - }); - } - - /** - * Ignore all tokens within an unknown node whose offset do not depend - * on another token's offset within the unknown node - */ - function ignoreNode(node: TSESTree.Node): void { - const unknownNodeTokens = new Set( - sourceCode.getTokens(node, { includeComments: true }), - ); - - unknownNodeTokens.forEach(token => { - if (!unknownNodeTokens.has(offsets.getFirstDependency(token)!)) { - const firstTokenOfLine = tokenInfo.getFirstTokenOfLine(token); - - if (token === firstTokenOfLine) { - offsets.ignoreToken(token); - } else { - offsets.setDesiredOffset(token, firstTokenOfLine, 0); - } - } - }); - } - - /** - * Check whether the given token is on the first line of a statement. - * @param leafNode The expression node that the token belongs directly. - * @returns `true` if the token is on the first line of a statement. - */ - function isOnFirstLineOfStatement( - token: TSESTree.Token, - leafNode: TSESTree.Node, - ): boolean { - let node: TSESTree.Node | undefined = leafNode; - - while ( - node.parent && - !node.parent.type.endsWith('Statement') && - !node.parent.type.endsWith('Declaration') - ) { - node = node.parent; - } - node = node.parent; - - return !node || node.loc.start.line === token.loc.start.line; - } - - /** - * Check whether there are any blank (whitespace-only) lines between - * two tokens on separate lines. - * @returns `true` if the tokens are on separate lines and - * there exists a blank line between them, `false` otherwise. - */ - function hasBlankLinesBetween( - firstToken: TSESTree.Token, - secondToken: TSESTree.Token, - ): boolean { - const firstTokenLine = firstToken.loc.end.line; - const secondTokenLine = secondToken.loc.start.line; - - if ( - firstTokenLine === secondTokenLine || - firstTokenLine === secondTokenLine - 1 - ) { - return false; - } - - for (let line = firstTokenLine + 1; line < secondTokenLine; ++line) { - if (!tokenInfo.firstTokensByLineNumber.has(line)) { - return true; - } - } - - return false; - } - - const ignoredNodeFirstTokens = new Set(); - - const baseOffsetListeners: TSESLint.RuleListener = { - 'ArrayExpression, ArrayPattern'( - node: TSESTree.ArrayExpression | TSESTree.ArrayPattern, - ) { - const openingBracket = sourceCode.getFirstToken(node)!; - const closingBracket = sourceCode.getTokenAfter( - node.elements[node.elements.length - 1] ?? openingBracket, - isClosingBracketToken, - )!; - - addElementListIndent( - node.elements, - openingBracket, - closingBracket, - options.ArrayExpression, - ); - }, - - ArrowFunctionExpression(node) { - const firstToken = sourceCode.getFirstToken(node)!; - - if (isOpeningParenToken(firstToken)) { - const openingParen = firstToken; - const closingParen = sourceCode.getTokenBefore( - node.body, - isClosingParenToken, - )!; - - parameterParens.add(openingParen); - parameterParens.add(closingParen); - addElementListIndent( - node.params, - openingParen, - closingParen, - options.FunctionExpression.parameters!, - ); - } - addBlocklessNodeIndent(node.body); - }, - - AssignmentExpression(node) { - const operator = sourceCode.getFirstTokenBetween( - node.left, - node.right, - token => token.value === node.operator, - )!; - - offsets.setDesiredOffsets( - [operator.range[0], node.range[1]], - sourceCode.getLastToken(node.left), - 1, - ); - offsets.ignoreToken(operator); - offsets.ignoreToken(sourceCode.getTokenAfter(operator)!); - }, - - 'BinaryExpression, LogicalExpression'( - node: TSESTree.BinaryExpression | TSESTree.LogicalExpression, - ) { - const operator = sourceCode.getFirstTokenBetween( - node.left, - node.right, - token => token.value === node.operator, - )!; - - /* - * For backwards compatibility, don't check BinaryExpression indents, e.g. - * var foo = bar && - * baz; - */ - - const tokenAfterOperator = sourceCode.getTokenAfter(operator)!; - - offsets.ignoreToken(operator); - offsets.ignoreToken(tokenAfterOperator); - offsets.setDesiredOffset(tokenAfterOperator, operator, 0); - }, - - 'BlockStatement, ClassBody'( - node: TSESTree.BlockStatement | TSESTree.ClassBody, - ) { - let blockIndentLevel; - - if (node.parent && isOuterIIFE(node.parent)) { - blockIndentLevel = options.outerIIFEBody; - } else if ( - node.parent && - (node.parent.type === AST_NODE_TYPES.FunctionExpression || - node.parent.type === AST_NODE_TYPES.ArrowFunctionExpression) - ) { - blockIndentLevel = options.FunctionExpression.body; - } else if ( - node.parent && - node.parent.type === AST_NODE_TYPES.FunctionDeclaration - ) { - blockIndentLevel = options.FunctionDeclaration.body; - } else { - blockIndentLevel = 1; - } - - /* - * For blocks that aren't lone statements, ensure that the opening curly brace - * is aligned with the parent. - */ - if (node.parent && !STATEMENT_LIST_PARENTS.has(node.parent.type)) { - offsets.setDesiredOffset( - sourceCode.getFirstToken(node)!, - sourceCode.getFirstToken(node.parent), - 0, - ); - } - addElementListIndent( - node.body, - sourceCode.getFirstToken(node)!, - sourceCode.getLastToken(node)!, - blockIndentLevel!, - ); - }, - - CallExpression: addFunctionCallIndent, - - 'ClassDeclaration[superClass], ClassExpression[superClass]'( - node: TSESTree.ClassDeclaration | TSESTree.ClassExpression, - ) { - const classToken = sourceCode.getFirstToken(node)!; - const extendsToken = sourceCode.getTokenBefore( - node.superClass!, - isNotOpeningParenToken, - )!; - - offsets.setDesiredOffsets( - [extendsToken.range[0], node.body.range[0]], - classToken, - 1, - ); - }, - - ConditionalExpression(node) { - const firstToken = sourceCode.getFirstToken(node)!; - - // `flatTernaryExpressions` option is for the following style: - // var a = - // foo > 0 ? bar : - // foo < 0 ? baz : - // /*else*/ qiz ; - if ( - !options.flatTernaryExpressions || - node.test.loc.end.line !== node.consequent.loc.start.line || - isOnFirstLineOfStatement(firstToken, node) - ) { - const questionMarkToken = sourceCode.getFirstTokenBetween( - node.test, - node.consequent, - token => - token.type === AST_TOKEN_TYPES.Punctuator && token.value === '?', - )!; - const colonToken = sourceCode.getFirstTokenBetween( - node.consequent, - node.alternate, - token => - token.type === AST_TOKEN_TYPES.Punctuator && token.value === ':', - )!; - - const firstConsequentToken = - sourceCode.getTokenAfter(questionMarkToken)!; - const lastConsequentToken = sourceCode.getTokenBefore(colonToken)!; - const firstAlternateToken = sourceCode.getTokenAfter(colonToken)!; - - offsets.setDesiredOffset(questionMarkToken, firstToken, 1); - offsets.setDesiredOffset(colonToken, firstToken, 1); - - offsets.setDesiredOffset(firstConsequentToken, firstToken, 1); - - /* - * The alternate and the consequent should usually have the same indentation. - * If they share part of a line, align the alternate against the first token of the consequent. - * This allows the alternate to be indented correctly in cases like this: - * foo ? ( - * bar - * ) : ( // this '(' is aligned with the '(' above, so it's considered to be aligned with `foo` - * baz // as a result, `baz` is offset by 1 rather than 2 - * ) - */ - if ( - lastConsequentToken.loc.end.line === - firstAlternateToken.loc.start.line - ) { - offsets.setDesiredOffset( - firstAlternateToken, - firstConsequentToken, - 0, - ); - } else { - /** - * If the alternate and consequent do not share part of a line, offset the alternate from the first - * token of the conditional expression. For example: - * foo ? bar - * : baz - * - * If `baz` were aligned with `bar` rather than being offset by 1 from `foo`, `baz` would end up - * having no expected indentation. - */ - offsets.setDesiredOffset(firstAlternateToken, firstToken, 1); - } - } - }, - - 'DoWhileStatement, WhileStatement, ForInStatement, ForOfStatement': ( - node: - | TSESTree.DoWhileStatement - | TSESTree.WhileStatement - | TSESTree.ForInStatement - | TSESTree.ForOfStatement, - ) => { - addBlocklessNodeIndent(node.body); - }, - - ExportNamedDeclaration(node) { - if (node.declaration === null) { - const closingCurly = sourceCode.getLastToken( - node, - isClosingBraceToken, - )!; - - // Indent the specifiers in `export {foo, bar, baz}` - addElementListIndent( - node.specifiers, - sourceCode.getFirstToken(node, { skip: 1 })!, - closingCurly, - 1, - ); - - if (node.source) { - // Indent everything after and including the `from` token in `export {foo, bar, baz} from 'qux'` - offsets.setDesiredOffsets( - [closingCurly.range[1], node.range[1]], - sourceCode.getFirstToken(node), - 1, - ); - } - } - }, - - ForStatement(node) { - const forOpeningParen = sourceCode.getFirstToken(node, 1)!; - - if (node.init) { - offsets.setDesiredOffsets(node.init.range, forOpeningParen, 1); - } - if (node.test) { - offsets.setDesiredOffsets(node.test.range, forOpeningParen, 1); - } - if (node.update) { - offsets.setDesiredOffsets(node.update.range, forOpeningParen, 1); - } - addBlocklessNodeIndent(node.body); - }, - - 'FunctionDeclaration, FunctionExpression'( - node: TSESTree.FunctionDeclaration | TSESTree.FunctionExpression, - ) { - const closingParen = sourceCode.getTokenBefore(node.body)!; - const openingParen = sourceCode.getTokenBefore( - node.params.length ? node.params[0] : closingParen, - )!; - - parameterParens.add(openingParen); - parameterParens.add(closingParen); - addElementListIndent( - node.params, - openingParen, - closingParen, - options[node.type].parameters!, - ); - }, - - IfStatement(node) { - addBlocklessNodeIndent(node.consequent); - if ( - node.alternate && - node.alternate.type !== AST_NODE_TYPES.IfStatement - ) { - addBlocklessNodeIndent(node.alternate); - } - }, - - ImportDeclaration(node) { - if ( - node.specifiers.some( - specifier => specifier.type === AST_NODE_TYPES.ImportSpecifier, - ) - ) { - const openingCurly = sourceCode.getFirstToken( - node, - isOpeningBraceToken, - )!; - const closingCurly = sourceCode.getLastToken( - node, - isClosingBraceToken, - )!; - - addElementListIndent( - node.specifiers.filter( - specifier => specifier.type === AST_NODE_TYPES.ImportSpecifier, - ), - openingCurly, - closingCurly, - options.ImportDeclaration, - ); - } - - const fromToken = sourceCode.getLastToken( - node, - token => - token.type === AST_TOKEN_TYPES.Identifier && token.value === 'from', - )!; - const sourceToken = sourceCode.getLastToken( - node, - token => token.type === AST_TOKEN_TYPES.String, - )!; - const semiToken = sourceCode.getLastToken( - node, - token => - token.type === AST_TOKEN_TYPES.Punctuator && token.value === ';', - )!; - - if (fromToken) { - const end = - semiToken && semiToken.range[1] === sourceToken.range[1] - ? node.range[1] - : sourceToken.range[1]; - - offsets.setDesiredOffsets( - [fromToken.range[0], end], - sourceCode.getFirstToken(node), - 1, - ); - } - }, - - 'MemberExpression, JSXMemberExpression, MetaProperty'( - node: - | TSESTree.MemberExpression - | TSESTree.JSXMemberExpression - | TSESTree.MetaProperty, - ) { - const object = - node.type === AST_NODE_TYPES.MetaProperty ? node.meta : node.object; - const isComputed = 'computed' in node && node.computed; - const firstNonObjectToken = sourceCode.getFirstTokenBetween( - object, - node.property, - isNotClosingParenToken, - )!; - const secondNonObjectToken = - sourceCode.getTokenAfter(firstNonObjectToken)!; - - const objectParenCount = sourceCode.getTokensBetween( - object, - node.property, - { filter: isClosingParenToken }, - ).length; - const firstObjectToken = objectParenCount - ? sourceCode.getTokenBefore(object, { skip: objectParenCount - 1 })! - : sourceCode.getFirstToken(object)!; - const lastObjectToken = sourceCode.getTokenBefore(firstNonObjectToken)!; - const firstPropertyToken = isComputed - ? firstNonObjectToken - : secondNonObjectToken; - - if (isComputed) { - // For computed MemberExpressions, match the closing bracket with the opening bracket. - offsets.setDesiredOffset( - sourceCode.getLastToken(node)!, - firstNonObjectToken, - 0, - ); - offsets.setDesiredOffsets( - node.property.range, - firstNonObjectToken, - 1, - ); - } - - /* - * If the object ends on the same line that the property starts, match against the last token - * of the object, to ensure that the MemberExpression is not indented. - * - * Otherwise, match against the first token of the object, e.g. - * foo - * .bar - * .baz // <-- offset by 1 from `foo` - */ - const offsetBase = - lastObjectToken.loc.end.line === firstPropertyToken.loc.start.line - ? lastObjectToken - : firstObjectToken; - - if (typeof options.MemberExpression === 'number') { - // Match the dot (for non-computed properties) or the opening bracket (for computed properties) against the object. - offsets.setDesiredOffset( - firstNonObjectToken, - offsetBase, - options.MemberExpression, - ); - - /* - * For computed MemberExpressions, match the first token of the property against the opening bracket. - * Otherwise, match the first token of the property against the object. - */ - offsets.setDesiredOffset( - secondNonObjectToken, - isComputed ? firstNonObjectToken : offsetBase, - options.MemberExpression, - ); - } else { - // If the MemberExpression option is off, ignore the dot and the first token of the property. - offsets.ignoreToken(firstNonObjectToken); - offsets.ignoreToken(secondNonObjectToken); - - // To ignore the property indentation, ensure that the property tokens depend on the ignored tokens. - offsets.setDesiredOffset(firstNonObjectToken, offsetBase, 0); - offsets.setDesiredOffset( - secondNonObjectToken, - firstNonObjectToken, - 0, - ); - } - }, - - NewExpression(node) { - // Only indent the arguments if the NewExpression has parens (e.g. `new Foo(bar)` or `new Foo()`, but not `new Foo` - if ( - node.arguments.length > 0 || - (isClosingParenToken(sourceCode.getLastToken(node)!) && - isOpeningParenToken(sourceCode.getLastToken(node, 1)!)) - ) { - addFunctionCallIndent(node); - } - }, - - 'ObjectExpression, ObjectPattern'( - node: TSESTree.ObjectExpression | TSESTree.ObjectPattern, - ) { - const openingCurly = sourceCode.getFirstToken(node)!; - const closingCurly = sourceCode.getTokenAfter( - node.properties.length - ? node.properties[node.properties.length - 1] - : openingCurly, - isClosingBraceToken, - )!; - - addElementListIndent( - node.properties, - openingCurly, - closingCurly, - options.ObjectExpression, - ); - }, - - Property(node) { - if (!node.shorthand && !node.method && node.kind === 'init') { - const colon = sourceCode.getFirstTokenBetween( - node.key, - node.value, - isColonToken, - )!; - - offsets.ignoreToken(sourceCode.getTokenAfter(colon)!); - } - }, - - SwitchStatement(node) { - const openingCurly = sourceCode.getTokenAfter( - node.discriminant, - isOpeningBraceToken, - )!; - const closingCurly = sourceCode.getLastToken(node)!; - - offsets.setDesiredOffsets( - [openingCurly.range[1], closingCurly.range[0]], - openingCurly, - options.SwitchCase, - ); - - if (node.cases.length) { - sourceCode - .getTokensBetween(node.cases[node.cases.length - 1], closingCurly, { - includeComments: true, - filter: isCommentToken, - }) - .forEach(token => offsets.ignoreToken(token)); - } - }, - - SwitchCase(node) { - if ( - !( - node.consequent.length === 1 && - node.consequent[0].type === AST_NODE_TYPES.BlockStatement - ) - ) { - const caseKeyword = sourceCode.getFirstToken(node)!; - const tokenAfterCurrentCase = sourceCode.getTokenAfter(node)!; - - offsets.setDesiredOffsets( - [caseKeyword.range[1], tokenAfterCurrentCase.range[0]], - caseKeyword, - 1, - ); - } - }, - - TemplateLiteral(node) { - node.expressions.forEach((_, index) => { - const previousQuasi = node.quasis[index]; - const nextQuasi = node.quasis[index + 1]; - const tokenToAlignFrom = - previousQuasi.loc.start.line === previousQuasi.loc.end.line - ? sourceCode.getFirstToken(previousQuasi) - : null; - - offsets.setDesiredOffsets( - [previousQuasi.range[1], nextQuasi.range[0]], - tokenToAlignFrom, - 1, - ); - offsets.setDesiredOffset( - sourceCode.getFirstToken(nextQuasi)!, - tokenToAlignFrom, - 0, - ); - }); - }, - - VariableDeclaration(node) { - if (node.declarations.length === 0) { - return; - } - - let variableIndent = Object.prototype.hasOwnProperty.call( - options.VariableDeclarator, - node.kind, - ) - ? (options.VariableDeclarator as VariableDeclaratorObj)[node.kind] - : DEFAULT_VARIABLE_INDENT; - - const firstToken = sourceCode.getFirstToken(node)!; - const lastToken = sourceCode.getLastToken(node)!; - - if (variableIndent === 'first') { - if (node.declarations.length > 1) { - addElementListIndent( - node.declarations, - firstToken, - lastToken, - 'first', - ); - return; - } - - variableIndent = DEFAULT_VARIABLE_INDENT; - } - - if ( - node.declarations[node.declarations.length - 1].loc.start.line > - node.loc.start.line - ) { - /* - * VariableDeclarator indentation is a bit different from other forms of indentation, in that the - * indentation of an opening bracket sometimes won't match that of a closing bracket. For example, - * the following indentations are correct: - * - * var foo = { - * ok: true - * }; - * - * var foo = { - * ok: true, - * }, - * bar = 1; - * - * Account for when exiting the AST (after indentations have already been set for the nodes in - * the declaration) by manually increasing the indentation level of the tokens in this declarator - * on the same line as the start of the declaration, provided that there are declarators that - * follow this one. - */ - offsets.setDesiredOffsets( - node.range, - firstToken, - variableIndent as number, - true, - ); - } else { - offsets.setDesiredOffsets( - node.range, - firstToken, - variableIndent as number, - ); - } - - if (isSemicolonToken(lastToken)) { - offsets.ignoreToken(lastToken); - } - }, - - VariableDeclarator(node) { - if (node.init) { - const equalOperator = sourceCode.getTokenBefore( - node.init, - isNotOpeningParenToken, - )!; - const tokenAfterOperator = sourceCode.getTokenAfter(equalOperator)!; - - offsets.ignoreToken(equalOperator); - offsets.ignoreToken(tokenAfterOperator); - offsets.setDesiredOffsets( - [tokenAfterOperator.range[0], node.range[1]], - equalOperator, - 1, - ); - offsets.setDesiredOffset( - equalOperator, - sourceCode.getLastToken(node.id), - 0, - ); - } - }, - - 'JSXAttribute[value]'(node: TSESTree.JSXAttribute) { - const nodeValue = node.value!; - const equalsToken = sourceCode.getFirstTokenBetween( - node.name, - nodeValue, - token => - token.type === AST_TOKEN_TYPES.Punctuator && token.value === '=', - )!; - - offsets.setDesiredOffsets( - [equalsToken.range[0], nodeValue.range[1]], - sourceCode.getFirstToken(node.name), - 1, - ); - }, - - JSXElement(node) { - if (node.closingElement) { - addElementListIndent( - node.children, - sourceCode.getFirstToken(node.openingElement)!, - sourceCode.getFirstToken(node.closingElement)!, - 1, - ); - } - }, - - JSXOpeningElement(node) { - const firstToken = sourceCode.getFirstToken(node)!; - let closingToken; - - if (node.selfClosing) { - closingToken = sourceCode.getLastToken(node, { skip: 1 })!; - offsets.setDesiredOffset( - sourceCode.getLastToken(node)!, - closingToken, - 0, - ); - } else { - closingToken = sourceCode.getLastToken(node)!; - } - offsets.setDesiredOffsets( - node.name.range, - sourceCode.getFirstToken(node), - ); - addElementListIndent(node.attributes, firstToken, closingToken, 1); - }, - - JSXClosingElement(node) { - const firstToken = sourceCode.getFirstToken(node); - - offsets.setDesiredOffsets(node.name.range, firstToken, 1); - }, - - JSXExpressionContainer(node) { - const openingCurly = sourceCode.getFirstToken(node)!; - const closingCurly = sourceCode.getLastToken(node)!; - - offsets.setDesiredOffsets( - [openingCurly.range[1], closingCurly.range[0]], - openingCurly, - 1, - ); - }, - - '*'(node: TSESTree.Node) { - const firstToken = sourceCode.getFirstToken(node); - - // Ensure that the children of every node are indented at least as much as the first token. - if (firstToken && !ignoredNodeFirstTokens.has(firstToken)) { - offsets.setDesiredOffsets(node.range, firstToken, 0); - } - }, - }; - - const listenerCallQueue: { - listener: TSESLint.RuleFunction; - node: TSESTree.Node; - }[] = []; - - /* - * To ignore the indentation of a node: - * 1. Don't call the node's listener when entering it (if it has a listener) - * 2. Don't set any offsets against the first token of the node. - * 3. Call `ignoreNode` on the node sometime after exiting it and before validating offsets. - */ - const offsetListeners = Object.keys( - baseOffsetListeners, - ).reduce( - /* - * Offset listener calls are deferred until traversal is finished, and are called as - * part of the final `Program:exit` listener. This is necessary because a node might - * be matched by multiple selectors. - * - * Example: Suppose there is an offset listener for `Identifier`, and the user has - * specified in configuration that `MemberExpression > Identifier` should be ignored. - * Due to selector specificity rules, the `Identifier` listener will get called first. However, - * if a given Identifier node is supposed to be ignored, then the `Identifier` offset listener - * should not have been called at all. Without doing extra selector matching, we don't know - * whether the Identifier matches the `MemberExpression > Identifier` selector until the - * `MemberExpression > Identifier` listener is called. - * - * To avoid this, the `Identifier` listener isn't called until traversal finishes and all - * ignored nodes are known. - */ - (acc, key) => { - const listener = baseOffsetListeners[ - key - ] as TSESLint.RuleFunction; - // eslint-disable-next-line @typescript-eslint/explicit-function-return-type - acc[key] = node => listenerCallQueue.push({ listener, node }); - - return acc; - }, - {}, - ); - - // For each ignored node selector, set up a listener to collect it into the `ignoredNodes` set. - const ignoredNodes = new Set(); - - /** - * Ignores a node - * @param node The node to ignore - */ - function addToIgnoredNodes(node: TSESTree.Node): void { - ignoredNodes.add(node); - ignoredNodeFirstTokens.add(sourceCode.getFirstToken(node)); - } - - const ignoredNodeListeners = options.ignoredNodes.reduce( - (listeners, ignoredSelector) => - Object.assign(listeners, { [ignoredSelector]: addToIgnoredNodes }), - {}, - ); - - /* - * Join the listeners, and add a listener to verify that all tokens actually have the correct indentation - * at the end. - * - * Using Object.assign will cause some offset listeners to be overwritten if the same selector also appears - * in `ignoredNodeListeners`. This isn't a problem because all of the matching nodes will be ignored, - * so those listeners wouldn't be called anyway. - */ - return Object.assign(offsetListeners, ignoredNodeListeners, { - '*:exit'(node: TSESTree.Node) { - // If a node's type is nonstandard, we can't tell how its children should be offset, so ignore it. - if (!KNOWN_NODES.has(node.type)) { - addToIgnoredNodes(node); - } - }, - 'Program:exit'() { - // If ignoreComments option is enabled, ignore all comment tokens. - if (options.ignoreComments) { - sourceCode - .getAllComments() - .forEach(comment => offsets.ignoreToken(comment)); - } - - // Invoke the queued offset listeners for the nodes that aren't ignored. - listenerCallQueue - .filter(nodeInfo => !ignoredNodes.has(nodeInfo.node)) - .forEach(nodeInfo => nodeInfo.listener(nodeInfo.node)); - - // Update the offsets for ignored nodes to prevent their child tokens from being reported. - ignoredNodes.forEach(ignoreNode); - - addParensIndent(sourceCode.ast.tokens); - - /* - * Create a Map from (token) => (precedingToken). - * This is necessary because sourceCode.getTokenBefore does not handle a comment as an argument correctly. - */ - const precedingTokens = sourceCode.ast.comments.reduce( - (commentMap, comment) => { - const tokenBefore = sourceCode.getTokenBefore(comment, { - includeComments: true, - })!; - - return commentMap.set( - comment, - commentMap.get(tokenBefore) ?? tokenBefore, - ); - }, - new WeakMap(), - ); - - sourceCode.lines.forEach((_, lineIndex) => { - const lineNumber = lineIndex + 1; - - if (!tokenInfo.firstTokensByLineNumber.has(lineNumber)) { - // Don't check indentation on blank lines - return; - } - - const firstTokenOfLine = - tokenInfo.firstTokensByLineNumber.get(lineNumber)!; - - if (firstTokenOfLine.loc.start.line !== lineNumber) { - // Don't check the indentation of multi-line tokens (e.g. template literals or block comments) twice. - return; - } - - // If the token matches the expected expected indentation, don't report it. - if ( - validateTokenIndent( - firstTokenOfLine, - offsets.getDesiredIndent(firstTokenOfLine), - ) - ) { - return; - } - - if (isCommentToken(firstTokenOfLine)) { - const tokenBefore = precedingTokens.get(firstTokenOfLine)!; - const tokenAfter = tokenBefore - ? sourceCode.getTokenAfter(tokenBefore)! - : sourceCode.ast.tokens[0]; - - const mayAlignWithBefore = - tokenBefore && - !hasBlankLinesBetween(tokenBefore, firstTokenOfLine); - const mayAlignWithAfter = - tokenAfter && !hasBlankLinesBetween(firstTokenOfLine, tokenAfter); - - // If a comment matches the expected indentation of the token immediately before or after, don't report it. - if ( - (mayAlignWithBefore && - validateTokenIndent( - firstTokenOfLine, - offsets.getDesiredIndent(tokenBefore), - )) || - (mayAlignWithAfter && - validateTokenIndent( - firstTokenOfLine, - offsets.getDesiredIndent(tokenAfter), - )) - ) { - return; - } - } - - // Otherwise, report the token/comment. - report(firstTokenOfLine, offsets.getDesiredIndent(firstTokenOfLine)); - }); - }, - }); - }, -}); diff --git a/packages/eslint-plugin/src/rules/indent.ts b/packages/eslint-plugin/src/rules/indent.ts index 748d720f451..19796054a4c 100644 --- a/packages/eslint-plugin/src/rules/indent.ts +++ b/packages/eslint-plugin/src/rules/indent.ts @@ -5,9 +5,11 @@ */ /* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-assignment */ -import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/utils'; -import { getESLintCoreRule } from '../util/getESLintCoreRule'; +import type { TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; + import * as util from '../util'; +import { getESLintCoreRule } from '../util/getESLintCoreRule'; const baseRule = getESLintCoreRule('indent'); diff --git a/packages/eslint-plugin/src/rules/index.ts b/packages/eslint-plugin/src/rules/index.ts index 29a47ec2384..bbddfc8d470 100644 --- a/packages/eslint-plugin/src/rules/index.ts +++ b/packages/eslint-plugin/src/rules/index.ts @@ -22,6 +22,7 @@ import explicitModuleBoundaryTypes from './explicit-module-boundary-types'; import funcCallSpacing from './func-call-spacing'; import indent from './indent'; import initDeclarations from './init-declarations'; +import keySpacing from './key-spacing'; import keywordSpacing from './keyword-spacing'; import linesBetweenClassMembers from './lines-between-class-members'; import memberDelimiterStyle from './member-delimiter-style'; @@ -47,6 +48,7 @@ import noFloatingPromises from './no-floating-promises'; import noForInArray from './no-for-in-array'; import noImplicitAnyCatch from './no-implicit-any-catch'; import noImpliedEval from './no-implied-eval'; +import noImportTypeSideEffects from './no-import-type-side-effects'; import noInferrableTypes from './no-inferrable-types'; import noInvalidThis from './no-invalid-this'; import noInvalidVoidType from './no-invalid-void-type'; @@ -78,6 +80,7 @@ import noUnnecessaryTypeConstraint from './no-unnecessary-type-constraint'; import noUnsafeArgument from './no-unsafe-argument'; import noUnsafeAssignment from './no-unsafe-assignment'; import noUnsafeCall from './no-unsafe-call'; +import noUnsafeDeclarationMerging from './no-unsafe-declaration-merging'; import noUnsafeMemberAccess from './no-unsafe-member-access'; import noUnsafeReturn from './no-unsafe-return'; import noUnusedExpressions from './no-unused-expressions'; @@ -114,6 +117,7 @@ import restrictPlusOperands from './restrict-plus-operands'; import restrictTemplateExpressions from './restrict-template-expressions'; import returnAwait from './return-await'; import semi from './semi'; +import sortTypeConstituents from './sort-type-constituents'; import sortTypeUnionIntersectionMembers from './sort-type-union-intersection-members'; import spaceBeforeBlocks from './space-before-blocks'; import spaceBeforeFunctionParen from './space-before-function-paren'; @@ -151,6 +155,7 @@ export default { 'func-call-spacing': funcCallSpacing, indent: indent, 'init-declarations': initDeclarations, + 'key-spacing': keySpacing, 'keyword-spacing': keywordSpacing, 'lines-between-class-members': linesBetweenClassMembers, 'member-delimiter-style': memberDelimiterStyle, @@ -176,6 +181,7 @@ export default { 'no-for-in-array': noForInArray, 'no-implicit-any-catch': noImplicitAnyCatch, 'no-implied-eval': noImpliedEval, + 'no-import-type-side-effects': noImportTypeSideEffects, 'no-inferrable-types': noInferrableTypes, 'no-invalid-this': noInvalidThis, 'no-invalid-void-type': noInvalidVoidType, @@ -207,6 +213,7 @@ export default { 'no-unsafe-argument': noUnsafeArgument, 'no-unsafe-assignment': noUnsafeAssignment, 'no-unsafe-call': noUnsafeCall, + 'no-unsafe-declaration-merging': noUnsafeDeclarationMerging, 'no-unsafe-member-access': noUnsafeMemberAccess, 'no-unsafe-return': noUnsafeReturn, 'no-unused-expressions': noUnusedExpressions, @@ -243,6 +250,7 @@ export default { 'restrict-template-expressions': restrictTemplateExpressions, 'return-await': returnAwait, semi: semi, + 'sort-type-constituents': sortTypeConstituents, 'sort-type-union-intersection-members': sortTypeUnionIntersectionMembers, 'space-before-blocks': spaceBeforeBlocks, 'space-before-function-paren': spaceBeforeFunctionParen, diff --git a/packages/eslint-plugin/src/rules/init-declarations.ts b/packages/eslint-plugin/src/rules/init-declarations.ts index df20ff572a2..27bdf3c75a5 100644 --- a/packages/eslint-plugin/src/rules/init-declarations.ts +++ b/packages/eslint-plugin/src/rules/init-declarations.ts @@ -1,10 +1,12 @@ -import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils'; -import { getESLintCoreRule } from '../util/getESLintCoreRule'; -import { - createRule, +import type { TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; + +import type { InferMessageIdsTypeFromRule, InferOptionsTypeFromRule, } from '../util'; +import { createRule } from '../util'; +import { getESLintCoreRule } from '../util/getESLintCoreRule'; const baseRule = getESLintCoreRule('init-declarations'); diff --git a/packages/eslint-plugin/src/rules/key-spacing.ts b/packages/eslint-plugin/src/rules/key-spacing.ts new file mode 100644 index 00000000000..2562107ee05 --- /dev/null +++ b/packages/eslint-plugin/src/rules/key-spacing.ts @@ -0,0 +1,431 @@ +import type { TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; + +import * as util from '../util'; +import { getESLintCoreRule } from '../util/getESLintCoreRule'; + +const baseRule = getESLintCoreRule('key-spacing'); + +export type Options = util.InferOptionsTypeFromRule; +export type MessageIds = util.InferMessageIdsTypeFromRule; + +// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment +const baseSchema = Array.isArray(baseRule.meta.schema) + ? baseRule.meta.schema[0] + : baseRule.meta.schema; + +/** + * TODO: replace with native .at() once Node 14 stops being supported + */ +function at(arr: T[], position: number): T | undefined { + if (position < 0) { + return arr[arr.length + position]; + } + return arr[position]; +} + +export default util.createRule({ + name: 'key-spacing', + meta: { + type: 'layout', + docs: { + description: + 'Enforce consistent spacing between property names and type annotations in types and interfaces', + recommended: false, + extendsBaseRule: true, + }, + fixable: 'whitespace', + hasSuggestions: baseRule.meta.hasSuggestions, + schema: [baseSchema], + messages: baseRule.meta.messages, + }, + defaultOptions: [{}], + + create(context, [options]) { + const sourceCode = context.getSourceCode(); + const baseRules = baseRule.create(context); + + /** + * @returns the column of the position after converting all unicode characters in the line to 1 char length + */ + function adjustedColumn(position: TSESTree.Position): number { + const line = position.line - 1; // position.line is 1-indexed + return util.getStringLength( + at(sourceCode.lines, line)!.slice(0, position.column), + ); + } + + /** + * Starting from the given a node (a property.key node here) looks forward + * until it finds the last token before a colon punctuator and returns it. + */ + function getLastTokenBeforeColon(node: TSESTree.Node): TSESTree.Token { + const colonToken = sourceCode.getTokenAfter(node, util.isColonToken)!; + + return sourceCode.getTokenBefore(colonToken)!; + } + + type KeyTypeNode = + | TSESTree.TSIndexSignature + | TSESTree.TSPropertySignature + | TSESTree.PropertyDefinition; + + type KeyTypeNodeWithTypeAnnotation = KeyTypeNode & { + typeAnnotation: TSESTree.TSTypeAnnotation; + }; + + function isKeyTypeNode( + node: TSESTree.Node, + ): node is KeyTypeNodeWithTypeAnnotation { + return ( + (node.type === AST_NODE_TYPES.TSPropertySignature || + node.type === AST_NODE_TYPES.TSIndexSignature || + node.type === AST_NODE_TYPES.PropertyDefinition) && + !!node.typeAnnotation + ); + } + + /** + * To handle index signatures, to get the whole text for the parameters + */ + function getKeyText(node: KeyTypeNodeWithTypeAnnotation): string { + if (node.type !== AST_NODE_TYPES.TSIndexSignature) { + return sourceCode.getText(node.key); + } + + const code = sourceCode.getText(node); + return code.slice( + 0, + sourceCode.getTokenAfter( + at(node.parameters, -1)!, + util.isClosingBracketToken, + )!.range[1] - node.range[0], + ); + } + + /** + * To handle index signatures, be able to get the end position of the parameters + */ + function getKeyLocEnd( + node: KeyTypeNodeWithTypeAnnotation, + ): TSESTree.Position { + return getLastTokenBeforeColon( + node.type !== AST_NODE_TYPES.TSIndexSignature + ? node.key + : at(node.parameters, -1)!, + ).loc.end; + } + + function checkBeforeColon( + node: KeyTypeNodeWithTypeAnnotation, + expectedWhitespaceBeforeColon: number, + mode: 'strict' | 'minimum', + ): void { + const { typeAnnotation } = node; + const colon = typeAnnotation.loc.start.column; + const keyEnd = getKeyLocEnd(node); + const difference = colon - keyEnd.column - expectedWhitespaceBeforeColon; + if (mode === 'strict' ? difference : difference < 0) { + context.report({ + node, + messageId: difference > 0 ? 'extraKey' : 'missingKey', + fix: fixer => { + if (difference > 0) { + return fixer.removeRange([ + typeAnnotation.range[0] - difference, + typeAnnotation.range[0], + ]); + } else { + return fixer.insertTextBefore( + typeAnnotation, + ' '.repeat(-difference), + ); + } + }, + data: { + computed: '', + key: getKeyText(node), + }, + }); + } + } + + function checkAfterColon( + node: KeyTypeNodeWithTypeAnnotation, + expectedWhitespaceAfterColon: number, + mode: 'strict' | 'minimum', + ): void { + const { typeAnnotation } = node; + const colon = typeAnnotation.loc.start.column; + const typeStart = typeAnnotation.typeAnnotation.loc.start.column; + const difference = typeStart - colon - 1 - expectedWhitespaceAfterColon; + if (mode === 'strict' ? difference : difference < 0) { + context.report({ + node, + messageId: difference > 0 ? 'extraValue' : 'missingValue', + fix: fixer => { + if (difference > 0) { + return fixer.removeRange([ + typeAnnotation.typeAnnotation.range[0] - difference, + typeAnnotation.typeAnnotation.range[0], + ]); + } else { + return fixer.insertTextBefore( + typeAnnotation.typeAnnotation, + ' '.repeat(-difference), + ); + } + }, + data: { + computed: '', + key: getKeyText(node), + }, + }); + } + } + + // adapted from https://github.com/eslint/eslint/blob/ba74253e8bd63e9e163bbee0540031be77e39253/lib/rules/key-spacing.js#L356 + function continuesAlignGroup( + lastMember: TSESTree.Node, + candidate: TSESTree.Node, + ): boolean { + const groupEndLine = lastMember.loc.start.line; + const candidateValueStartLine = ( + isKeyTypeNode(candidate) ? candidate.typeAnnotation : candidate + ).loc.start.line; + + if (candidateValueStartLine === groupEndLine) { + return false; + } + + if (candidateValueStartLine - groupEndLine === 1) { + return true; + } + + /* + * Check that the first comment is adjacent to the end of the group, the + * last comment is adjacent to the candidate property, and that successive + * comments are adjacent to each other. + */ + const leadingComments = sourceCode.getCommentsBefore(candidate); + + if ( + leadingComments.length && + leadingComments[0].loc.start.line - groupEndLine <= 1 && + candidateValueStartLine - at(leadingComments, -1)!.loc.end.line <= 1 + ) { + for (let i = 1; i < leadingComments.length; i++) { + if ( + leadingComments[i].loc.start.line - + leadingComments[i - 1].loc.end.line > + 1 + ) { + return false; + } + } + return true; + } + + return false; + } + + function checkAlignGroup(group: TSESTree.Node[]): void { + let alignColumn = 0; + const align: 'value' | 'colon' = + (typeof options.align === 'object' + ? options.align.on + : typeof options.multiLine?.align === 'object' + ? options.multiLine.align.on + : options.multiLine?.align ?? options.align) ?? 'colon'; + const beforeColon = + (typeof options.align === 'object' + ? options.align.beforeColon + : options.multiLine + ? typeof options.multiLine.align === 'object' + ? options.multiLine.align.beforeColon + : options.multiLine.beforeColon + : options.beforeColon) ?? false; + const expectedWhitespaceBeforeColon = beforeColon ? 1 : 0; + const afterColon = + (typeof options.align === 'object' + ? options.align.afterColon + : options.multiLine + ? typeof options.multiLine.align === 'object' + ? options.multiLine.align.afterColon + : options.multiLine.afterColon + : options.afterColon) ?? true; + const expectedWhitespaceAfterColon = afterColon ? 1 : 0; + const mode = + (typeof options.align === 'object' + ? options.align.mode + : options.multiLine + ? typeof options.multiLine.align === 'object' + ? // same behavior as in original rule + options.multiLine.align.mode ?? options.multiLine.mode + : options.multiLine.mode + : options.mode) ?? 'strict'; + + for (const node of group) { + if (isKeyTypeNode(node)) { + const keyEnd = adjustedColumn(getKeyLocEnd(node)); + alignColumn = Math.max( + alignColumn, + align === 'colon' + ? keyEnd + expectedWhitespaceBeforeColon + : keyEnd + + ':'.length + + expectedWhitespaceAfterColon + + expectedWhitespaceBeforeColon, + ); + } + } + + for (const node of group) { + if (!isKeyTypeNode(node)) { + continue; + } + const { typeAnnotation } = node; + const toCheck = + align === 'colon' ? typeAnnotation : typeAnnotation.typeAnnotation; + const difference = adjustedColumn(toCheck.loc.start) - alignColumn; + + if (difference) { + context.report({ + node, + messageId: + difference > 0 + ? align === 'colon' + ? 'extraKey' + : 'extraValue' + : align === 'colon' + ? 'missingKey' + : 'missingValue', + fix: fixer => { + if (difference > 0) { + return fixer.removeRange([ + toCheck.range[0] - difference, + toCheck.range[0], + ]); + } else { + return fixer.insertTextBefore(toCheck, ' '.repeat(-difference)); + } + }, + data: { + computed: '', + key: getKeyText(node), + }, + }); + } + + if (align === 'colon') { + checkAfterColon(node, expectedWhitespaceAfterColon, mode); + } else { + checkBeforeColon(node, expectedWhitespaceBeforeColon, mode); + } + } + } + + function checkIndividualNode( + node: TSESTree.Node, + { singleLine }: { singleLine: boolean }, + ): void { + const beforeColon = + (singleLine + ? options.singleLine + ? options.singleLine.beforeColon + : options.beforeColon + : options.multiLine + ? options.multiLine.beforeColon + : options.beforeColon) ?? false; + const expectedWhitespaceBeforeColon = beforeColon ? 1 : 0; + const afterColon = + (singleLine + ? options.singleLine + ? options.singleLine.afterColon + : options.afterColon + : options.multiLine + ? options.multiLine.afterColon + : options.afterColon) ?? true; + const expectedWhitespaceAfterColon = afterColon ? 1 : 0; + const mode = + (singleLine + ? options.singleLine + ? options.singleLine.mode + : options.mode + : options.multiLine + ? options.multiLine.mode + : options.mode) ?? 'strict'; + + if (isKeyTypeNode(node)) { + checkBeforeColon(node, expectedWhitespaceBeforeColon, mode); + checkAfterColon(node, expectedWhitespaceAfterColon, mode); + } + } + + function validateBody( + body: + | TSESTree.TSTypeLiteral + | TSESTree.TSInterfaceBody + | TSESTree.ClassBody, + ): void { + const isSingleLine = body.loc.start.line === body.loc.end.line; + + const members = + body.type === AST_NODE_TYPES.TSTypeLiteral ? body.members : body.body; + + let alignGroups: TSESTree.Node[][] = []; + let unalignedElements: TSESTree.Node[] = []; + + if (options.align || options.multiLine?.align) { + let currentAlignGroup: TSESTree.Node[] = []; + alignGroups.push(currentAlignGroup); + + let prevNode: TSESTree.Node | undefined = undefined; + + for (const node of members) { + let prevAlignedNode = at(currentAlignGroup, -1); + if (prevAlignedNode !== prevNode) { + prevAlignedNode = undefined; + } + + if (prevAlignedNode && continuesAlignGroup(prevAlignedNode, node)) { + currentAlignGroup.push(node); + } else if (prevNode?.loc.start.line === node.loc.start.line) { + if (prevAlignedNode) { + // Here, prevNode === prevAlignedNode === currentAlignGroup.at(-1) + unalignedElements.push(prevAlignedNode); + currentAlignGroup.pop(); + } + unalignedElements.push(node); + } else { + currentAlignGroup = [node]; + alignGroups.push(currentAlignGroup); + } + + prevNode = node; + } + + unalignedElements = unalignedElements.concat( + ...alignGroups.filter(group => group.length === 1), + ); + alignGroups = alignGroups.filter(group => group.length >= 2); + } else { + unalignedElements = members; + } + + for (const group of alignGroups) { + checkAlignGroup(group); + } + + for (const node of unalignedElements) { + checkIndividualNode(node, { singleLine: isSingleLine }); + } + } + return { + ...baseRules, + TSTypeLiteral: validateBody, + TSInterfaceBody: validateBody, + ClassBody: validateBody, + }; + }, +}); diff --git a/packages/eslint-plugin/src/rules/keyword-spacing.ts b/packages/eslint-plugin/src/rules/keyword-spacing.ts index e314ec9de0f..aa09fb3d1b8 100644 --- a/packages/eslint-plugin/src/rules/keyword-spacing.ts +++ b/packages/eslint-plugin/src/rules/keyword-spacing.ts @@ -1,12 +1,33 @@ -import { AST_TOKEN_TYPES } from '@typescript-eslint/utils'; -import { getESLintCoreRule } from '../util/getESLintCoreRule'; +import type { TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES, AST_TOKEN_TYPES } from '@typescript-eslint/utils'; + import * as util from '../util'; +import { getESLintCoreRule } from '../util/getESLintCoreRule'; const baseRule = getESLintCoreRule('keyword-spacing'); export type Options = util.InferOptionsTypeFromRule; export type MessageIds = util.InferMessageIdsTypeFromRule; +// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment +const baseSchema = Array.isArray(baseRule.meta.schema) + ? baseRule.meta.schema[0] + : baseRule.meta.schema; +const schema = util.deepMerge( + // eslint-disable-next-line @typescript-eslint/no-unsafe-argument -- https://github.com/microsoft/TypeScript/issues/17002 + baseSchema, + { + properties: { + overrides: { + properties: { + // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access + type: baseSchema.properties.overrides.properties.import, + }, + }, + }, + }, +); + export default util.createRule({ name: 'keyword-spacing', meta: { @@ -18,12 +39,12 @@ export default util.createRule({ }, fixable: 'whitespace', hasSuggestions: baseRule.meta.hasSuggestions, - schema: baseRule.meta.schema, + schema: [schema], messages: baseRule.meta.messages, }, defaultOptions: [{}], - create(context) { + create(context, [{ after, overrides }]) { const sourceCode = context.getSourceCode(); const baseRules = baseRule.create(context); return { @@ -49,6 +70,49 @@ export default util.createRule({ // make sure to reset the type afterward so we don't permanently mutate the AST asToken.type = oldTokenType; }, + 'ImportDeclaration[importKind=type]'( + node: TSESTree.ImportDeclaration, + ): void { + const { type: typeOptionOverride = {} } = overrides ?? {}; + const typeToken = sourceCode.getFirstToken(node, { skip: 1 })!; + const punctuatorToken = sourceCode.getTokenAfter(typeToken)!; + if ( + node.specifiers?.[0]?.type === AST_NODE_TYPES.ImportDefaultSpecifier + ) { + return; + } + const spacesBetweenTypeAndPunctuator = + punctuatorToken.range[0] - typeToken.range[1]; + if ( + (typeOptionOverride.after ?? after) === true && + spacesBetweenTypeAndPunctuator === 0 + ) { + context.report({ + loc: typeToken.loc, + messageId: 'expectedAfter', + data: { value: 'type' }, + fix(fixer) { + return fixer.insertTextAfter(typeToken, ' '); + }, + }); + } + if ( + (typeOptionOverride.after ?? after) === false && + spacesBetweenTypeAndPunctuator > 0 + ) { + context.report({ + loc: typeToken.loc, + messageId: 'unexpectedAfter', + data: { value: 'type' }, + fix(fixer) { + return fixer.removeRange([ + typeToken.range[1], + typeToken.range[1] + spacesBetweenTypeAndPunctuator, + ]); + }, + }); + } + }, }; }, }); diff --git a/packages/eslint-plugin/src/rules/lines-between-class-members.ts b/packages/eslint-plugin/src/rules/lines-between-class-members.ts index 4446568e874..2f37b365dae 100644 --- a/packages/eslint-plugin/src/rules/lines-between-class-members.ts +++ b/packages/eslint-plugin/src/rules/lines-between-class-members.ts @@ -1,6 +1,8 @@ -import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils'; -import { getESLintCoreRule } from '../util/getESLintCoreRule'; +import type { TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; + import * as util from '../util'; +import { getESLintCoreRule } from '../util/getESLintCoreRule'; const baseRule = getESLintCoreRule('lines-between-class-members'); diff --git a/packages/eslint-plugin/src/rules/member-delimiter-style.ts b/packages/eslint-plugin/src/rules/member-delimiter-style.ts index 2919a2091f6..53d2019e97d 100644 --- a/packages/eslint-plugin/src/rules/member-delimiter-style.ts +++ b/packages/eslint-plugin/src/rules/member-delimiter-style.ts @@ -1,4 +1,6 @@ -import { TSESLint, TSESTree, AST_NODE_TYPES } from '@typescript-eslint/utils'; +import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; + import * as util from '../util'; type Delimiter = 'comma' | 'none' | 'semi'; @@ -133,13 +135,13 @@ const makeFixFunction = ({ export default util.createRule({ name: 'member-delimiter-style', meta: { - type: 'suggestion', + type: 'layout', docs: { description: 'Require a specific member delimiter style for interfaces and type literals', recommended: false, }, - fixable: 'code', + fixable: 'whitespace', messages: { unexpectedComma: 'Unexpected separator (,).', unexpectedSemi: 'Unexpected separator (;).', diff --git a/packages/eslint-plugin/src/rules/member-ordering.ts b/packages/eslint-plugin/src/rules/member-ordering.ts index 4ddb4954593..f8db5ade0ca 100644 --- a/packages/eslint-plugin/src/rules/member-ordering.ts +++ b/packages/eslint-plugin/src/rules/member-ordering.ts @@ -1,12 +1,13 @@ -import { - AST_NODE_TYPES, - TSESLint, - TSESTree, - JSONSchema, -} from '@typescript-eslint/utils'; +import type { JSONSchema, TSESLint, TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; +import naturalCompare from 'natural-compare-lite'; + import * as util from '../util'; -export type MessageIds = 'incorrectGroupOrder' | 'incorrectOrder'; +export type MessageIds = + | 'incorrectGroupOrder' + | 'incorrectOrder' + | 'incorrectRequiredMembersOrder'; type MemberKind = | 'call-signature' @@ -15,7 +16,8 @@ type MemberKind = | 'get' | 'method' | 'set' - | 'signature'; + | 'signature' + | 'static-initialization'; type DecoratedMemberKind = 'field' | 'method' | 'get' | 'set'; @@ -23,29 +25,40 @@ type NonCallableMemberKind = Exclude; type MemberScope = 'static' | 'instance' | 'abstract'; +type Accessibility = TSESTree.Accessibility | '#private'; + type BaseMemberType = | MemberKind - | `${TSESTree.Accessibility}-${Exclude}` - | `${TSESTree.Accessibility}-decorated-${DecoratedMemberKind}` + | `${Accessibility}-${Exclude< + MemberKind, + 'signature' | 'static-initialization' + >}` + | `${Accessibility}-decorated-${DecoratedMemberKind}` | `decorated-${DecoratedMemberKind}` - | `${TSESTree.Accessibility}-${MemberScope}-${NonCallableMemberKind}` + | `${Accessibility}-${MemberScope}-${NonCallableMemberKind}` | `${MemberScope}-${NonCallableMemberKind}`; type MemberType = BaseMemberType | BaseMemberType[]; -type Order = +type AlphabeticalOrder = | 'alphabetically' | 'alphabetically-case-insensitive' - | 'as-written'; + | 'natural' + | 'natural-case-insensitive'; + +type Order = AlphabeticalOrder | 'as-written'; interface SortedOrderConfig { memberTypes?: MemberType[] | 'never'; + optionalityOrder?: OptionalityOrder; order: Order; } type OrderConfig = MemberType[] | SortedOrderConfig | 'never'; type Member = TSESTree.ClassElement | TSESTree.TypeElement; +type OptionalityOrder = 'optional-first' | 'required-first'; + export type Options = [ { default?: OrderConfig; @@ -86,7 +99,17 @@ const objectConfig = (memberTypes: MemberType[]): JSONSchema.JSONSchema4 => ({ }, order: { type: 'string', - enum: ['alphabetically', 'alphabetically-case-insensitive', 'as-written'], + enum: [ + 'alphabetically', + 'alphabetically-case-insensitive', + 'as-written', + 'natural', + 'natural-case-insensitive', + ], + }, + optionalityOrder: { + type: 'string', + enum: ['optional-first', 'required-first'], }, }, additionalProperties: false, @@ -101,6 +124,7 @@ export const defaultOrder: MemberType[] = [ 'public-static-field', 'protected-static-field', 'private-static-field', + '#private-static-field', 'public-decorated-field', 'protected-decorated-field', @@ -109,14 +133,15 @@ export const defaultOrder: MemberType[] = [ 'public-instance-field', 'protected-instance-field', 'private-instance-field', + '#private-instance-field', 'public-abstract-field', 'protected-abstract-field', - 'private-abstract-field', 'public-field', 'protected-field', 'private-field', + '#private-field', 'static-field', 'instance-field', @@ -126,6 +151,9 @@ export const defaultOrder: MemberType[] = [ 'field', + // Static initialization + 'static-initialization', + // Constructors 'public-constructor', 'protected-constructor', @@ -137,6 +165,7 @@ export const defaultOrder: MemberType[] = [ 'public-static-get', 'protected-static-get', 'private-static-get', + '#private-static-get', 'public-decorated-get', 'protected-decorated-get', @@ -145,14 +174,15 @@ export const defaultOrder: MemberType[] = [ 'public-instance-get', 'protected-instance-get', 'private-instance-get', + '#private-instance-get', 'public-abstract-get', 'protected-abstract-get', - 'private-abstract-get', 'public-get', 'protected-get', 'private-get', + '#private-get', 'static-get', 'instance-get', @@ -166,6 +196,7 @@ export const defaultOrder: MemberType[] = [ 'public-static-set', 'protected-static-set', 'private-static-set', + '#private-static-set', 'public-decorated-set', 'protected-decorated-set', @@ -174,14 +205,15 @@ export const defaultOrder: MemberType[] = [ 'public-instance-set', 'protected-instance-set', 'private-instance-set', + '#private-instance-set', 'public-abstract-set', 'protected-abstract-set', - 'private-abstract-set', 'public-set', 'protected-set', 'private-set', + '#private-set', 'static-set', 'instance-set', @@ -195,6 +227,7 @@ export const defaultOrder: MemberType[] = [ 'public-static-method', 'protected-static-method', 'private-static-method', + '#private-static-method', 'public-decorated-method', 'protected-decorated-method', @@ -203,14 +236,15 @@ export const defaultOrder: MemberType[] = [ 'public-instance-method', 'protected-instance-method', 'private-instance-method', + '#private-instance-method', 'public-abstract-method', 'protected-abstract-method', - 'private-abstract-method', 'public-method', 'protected-method', 'private-method', + '#private-method', 'static-method', 'instance-method', @@ -231,34 +265,54 @@ const allMemberTypes = Array.from( 'constructor', 'get', 'set', + 'static-initialization', ] as const ).reduce>((all, type) => { all.add(type); - (['public', 'protected', 'private'] as const).forEach(accessibility => { - if (type !== 'signature') { - all.add(`${accessibility}-${type}`); // e.g. `public-field` - } + (['public', 'protected', 'private', '#private'] as const).forEach( + accessibility => { + if ( + type !== 'signature' && + type !== 'static-initialization' && + type !== 'call-signature' && + !(type === 'constructor' && accessibility === '#private') + ) { + all.add(`${accessibility}-${type}`); // e.g. `public-field` + } - // Only class instance fields, methods, get and set can have decorators attached to them - if ( - type === 'field' || - type === 'method' || - type === 'get' || - type === 'set' - ) { - all.add(`${accessibility}-decorated-${type}`); - all.add(`decorated-${type}`); - } + // Only class instance fields, methods, get and set can have decorators attached to them + if ( + accessibility !== '#private' && + (type === 'field' || + type === 'method' || + type === 'get' || + type === 'set') + ) { + all.add(`${accessibility}-decorated-${type}`); + all.add(`decorated-${type}`); + } - if (type !== 'constructor' && type !== 'signature') { - // There is no `static-constructor` or `instance-constructor` or `abstract-constructor` - (['static', 'instance', 'abstract'] as const).forEach(scope => { - all.add(`${scope}-${type}`); - all.add(`${accessibility}-${scope}-${type}`); - }); - } - }); + if ( + type !== 'constructor' && + type !== 'signature' && + type !== 'call-signature' + ) { + // There is no `static-constructor` or `instance-constructor` or `abstract-constructor` + if (accessibility === '#private' || accessibility === 'private') { + (['static', 'instance'] as const).forEach(scope => { + all.add(`${scope}-${type}`); + all.add(`${accessibility}-${scope}-${type}`); + }); + } else { + (['static', 'instance', 'abstract'] as const).forEach(scope => { + all.add(`${scope}-${type}`); + all.add(`${accessibility}-${scope}-${type}`); + }); + } + } + }, + ); return all; }, new Set()), @@ -295,6 +349,8 @@ function getNodeType(node: Member): MemberKind | null { return 'field'; case AST_NODE_TYPES.TSIndexSignature: return 'signature'; + case AST_NODE_TYPES.StaticBlock: + return 'static-initialization'; default: return null; } @@ -352,11 +408,33 @@ function getMemberName( return 'call'; case AST_NODE_TYPES.TSIndexSignature: return util.getNameFromIndexSignature(node); + case AST_NODE_TYPES.StaticBlock: + return 'static block'; default: return null; } } +/** + * Returns true if the member is optional based on the member type. + * + * @param node the node to be evaluated. + * + * @returns Whether the member is optional, or false if it cannot be optional at all. + */ +function isMemberOptional(node: Member): boolean { + switch (node.type) { + case AST_NODE_TYPES.TSPropertySignature: + case AST_NODE_TYPES.TSMethodSignature: + case AST_NODE_TYPES.TSAbstractPropertyDefinition: + case AST_NODE_TYPES.PropertyDefinition: + case AST_NODE_TYPES.TSAbstractMethodDefinition: + case AST_NODE_TYPES.MethodDefinition: + return !!node.optional; + } + return false; +} + /** * Gets the calculated rank using the provided method definition. * The algorithm is as follows: @@ -388,6 +466,16 @@ function getRankOrder( return rank; } +function getAccessibility(node: Member): Accessibility { + if ('accessibility' in node && node.accessibility) { + return node.accessibility; + } + if ('key' in node && node.key?.type === AST_NODE_TYPES.PrivateIdentifier) { + return '#private'; + } + return 'public'; +} + /** * Gets the rank of the node given the order. * @param node the node to be evaluated. @@ -401,7 +489,7 @@ function getRank( ): number { const type = getNodeType(node); - if (type === null) { + if (type == null) { // shouldn't happen but just in case, put it on the end return orderConfig.length - 1; } @@ -416,10 +504,7 @@ function getRank( : abstract ? 'abstract' : 'instance'; - const accessibility = - 'accessibility' in node && node.accessibility - ? node.accessibility - : 'public'; + const accessibility = getAccessibility(node); // Collect all existing member groups that apply to this node... // (e.g. 'public-instance-field', 'instance-field', 'public-field', 'constructor' etc.) @@ -438,7 +523,7 @@ function getRank( memberGroups.push(`decorated-${type}`); } - if (type !== 'signature') { + if (type !== 'signature' && type !== 'static-initialization') { if (type !== 'constructor') { // Constructors have no scope memberGroups.push(`${accessibility}-${scope}-${type}`); @@ -506,6 +591,7 @@ export default util.createRule({ 'Member {{member}} should be declared before member {{beforeMember}}.', incorrectGroupOrder: 'Member {{name}} should be declared before all {{rank}} definitions.', + incorrectRequiredMembersOrder: `Member {{member}} should be declared after all {{optionalOrRequired}} members.`, }, schema: [ { @@ -620,7 +706,7 @@ export default util.createRule({ */ function checkAlphaSort( members: Member[], - caseSensitive: boolean, + order: AlphabeticalOrder, ): boolean { let previousName = ''; let isCorrectlySorted = true; @@ -631,11 +717,7 @@ export default util.createRule({ // Note: Not all members have names if (name) { - if ( - caseSensitive - ? name < previousName - : name.toLowerCase() < previousName.toLowerCase() - ) { + if (naturalOutOfOrder(name, previousName, order)) { context.report({ node: member, messageId: 'incorrectOrder', @@ -655,6 +737,78 @@ export default util.createRule({ return isCorrectlySorted; } + function naturalOutOfOrder( + name: string, + previousName: string, + order: AlphabeticalOrder, + ): boolean { + switch (order) { + case 'alphabetically': + return name < previousName; + case 'alphabetically-case-insensitive': + return name.toLowerCase() < previousName.toLowerCase(); + case 'natural': + return naturalCompare(name, previousName) !== 1; + case 'natural-case-insensitive': + return ( + naturalCompare(name.toLowerCase(), previousName.toLowerCase()) !== 1 + ); + } + } + + /** + * Checks if the order of optional and required members is correct based + * on the given 'required' parameter. + * + * @param members Members to be validated. + * @param optionalityOrder Where to place optional members, if not intermixed. + * + * @return True if all required and optional members are correctly sorted. + */ + function checkRequiredOrder( + members: Member[], + optionalityOrder: OptionalityOrder | undefined, + ): boolean { + const switchIndex = members.findIndex( + (member, i) => + i && isMemberOptional(member) !== isMemberOptional(members[i - 1]), + ); + + const report = (member: Member): void => + context.report({ + messageId: 'incorrectRequiredMembersOrder', + loc: member.loc, + data: { + member: getMemberName(member, context.getSourceCode()), + optionalOrRequired: + optionalityOrder === 'required-first' ? 'required' : 'optional', + }, + }); + + // if the optionality of the first item is correct (based on optionalityOrder) + // then the first 0 inclusive to switchIndex exclusive members all + // have the correct optionality + if ( + isMemberOptional(members[0]) !== + (optionalityOrder === 'optional-first') + ) { + report(members[0]); + return false; + } + + for (let i = switchIndex + 1; i < members.length; i++) { + if ( + isMemberOptional(members[i]) !== + isMemberOptional(members[switchIndex]) + ) { + report(members[switchIndex]); + return false; + } + } + + return true; + } + /** * Validates if all members are correctly sorted. * @@ -672,36 +826,63 @@ export default util.createRule({ } // Standardize config - let order: Order | null = null; - let memberTypes; + let order: Order | undefined; + let memberTypes: string | MemberType[] | undefined; + let optionalityOrder: OptionalityOrder | undefined; + + // returns true if everything is good and false if an error was reported + const checkOrder = (memberSet: Member[]): boolean => { + const hasAlphaSort = !!(order && order !== 'as-written'); + + // Check order + if (Array.isArray(memberTypes)) { + const grouped = checkGroupSort( + memberSet, + memberTypes, + supportsModifiers, + ); + + if (grouped == null) { + return false; + } + + if (hasAlphaSort) { + return !grouped.some( + groupMember => + !checkAlphaSort(groupMember, order as AlphabeticalOrder), + ); + } + } else if (hasAlphaSort) { + return checkAlphaSort(memberSet, order as AlphabeticalOrder); + } + + return true; + }; if (Array.isArray(orderConfig)) { memberTypes = orderConfig; } else { order = orderConfig.order; memberTypes = orderConfig.memberTypes; + optionalityOrder = orderConfig.optionalityOrder; } - const hasAlphaSort = order?.startsWith('alphabetically'); - const alphaSortIsCaseSensitive = - order !== 'alphabetically-case-insensitive'; + if (!optionalityOrder) { + checkOrder(members); + return; + } - // Check order - if (Array.isArray(memberTypes)) { - const grouped = checkGroupSort(members, memberTypes, supportsModifiers); + const switchIndex = members.findIndex( + (member, i) => + i && isMemberOptional(member) !== isMemberOptional(members[i - 1]), + ); - if (grouped === null) { + if (switchIndex !== -1) { + if (!checkRequiredOrder(members, optionalityOrder)) { return; } - - if (hasAlphaSort) { - grouped.some( - groupMember => - !checkAlphaSort(groupMember, alphaSortIsCaseSensitive), - ); - } - } else if (hasAlphaSort) { - checkAlphaSort(members, alphaSortIsCaseSensitive); + checkOrder(members.slice(0, switchIndex)); + checkOrder(members.slice(switchIndex)); } } diff --git a/packages/eslint-plugin/src/rules/method-signature-style.ts b/packages/eslint-plugin/src/rules/method-signature-style.ts index 6e744753aa9..93b21408511 100644 --- a/packages/eslint-plugin/src/rules/method-signature-style.ts +++ b/packages/eslint-plugin/src/rules/method-signature-style.ts @@ -1,4 +1,6 @@ -import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; + import * as util from '../util'; export type Options = [('property' | 'method')?]; diff --git a/packages/eslint-plugin/src/rules/naming-convention-utils/enums.ts b/packages/eslint-plugin/src/rules/naming-convention-utils/enums.ts index c9460305847..02900ab1d8b 100644 --- a/packages/eslint-plugin/src/rules/naming-convention-utils/enums.ts +++ b/packages/eslint-plugin/src/rules/naming-convention-utils/enums.ts @@ -91,28 +91,33 @@ enum Modifiers { public = 1 << 3, protected = 1 << 4, private = 1 << 5, - abstract = 1 << 6, + '#private' = 1 << 6, + abstract = 1 << 7, // destructured variable - destructured = 1 << 7, + destructured = 1 << 8, // variables declared in the top-level scope - global = 1 << 8, + global = 1 << 9, // things that are exported - exported = 1 << 9, + exported = 1 << 10, // things that are unused - unused = 1 << 10, + unused = 1 << 11, // properties that require quoting - requiresQuotes = 1 << 11, + requiresQuotes = 1 << 12, + // class members that are overridden + override = 1 << 13, + // class methods, object function properties, or functions that are async via the `async` keyword + async = 1 << 14, // make sure TypeModifiers starts at Modifiers + 1 or else sorting won't work } type ModifiersString = keyof typeof Modifiers; enum TypeModifiers { - boolean = 1 << 12, - string = 1 << 13, - number = 1 << 14, - function = 1 << 15, - array = 1 << 16, + boolean = 1 << 15, + string = 1 << 16, + number = 1 << 17, + function = 1 << 18, + array = 1 << 19, } type TypeModifiersString = keyof typeof TypeModifiers; diff --git a/packages/eslint-plugin/src/rules/naming-convention-utils/schema.ts b/packages/eslint-plugin/src/rules/naming-convention-utils/schema.ts index 4136f7186bf..ff91d2e156d 100644 --- a/packages/eslint-plugin/src/rules/naming-convention-utils/schema.ts +++ b/packages/eslint-plugin/src/rules/naming-convention-utils/schema.ts @@ -1,15 +1,18 @@ -import { JSONSchema } from '@typescript-eslint/utils'; -import { +import type { JSONSchema } from '@typescript-eslint/utils'; + +import * as util from '../../util'; +import type { IndividualAndMetaSelectorsString, + ModifiersString, +} from './enums'; +import { MetaSelectors, Modifiers, - ModifiersString, PredefinedFormats, Selectors, TypeModifiers, UnderscoreOptions, } from './enums'; -import * as util from '../../util'; const UNDERSCORE_SCHEMA: JSONSchema.JSONSchema4 = { type: 'string', @@ -167,34 +170,45 @@ const SCHEMA: JSONSchema.JSONSchema4 = { selectorsSchema(), ...selectorSchema('default', false, util.getEnumNames(Modifiers)), - ...selectorSchema('variableLike', false, ['unused']), + ...selectorSchema('variableLike', false, ['unused', 'async']), ...selectorSchema('variable', true, [ 'const', 'destructured', 'exported', 'global', 'unused', + 'async', + ]), + ...selectorSchema('function', false, [ + 'exported', + 'global', + 'unused', + 'async', ]), - ...selectorSchema('function', false, ['exported', 'global', 'unused']), ...selectorSchema('parameter', true, ['destructured', 'unused']), ...selectorSchema('memberLike', false, [ 'abstract', 'private', + '#private', 'protected', 'public', 'readonly', 'requiresQuotes', 'static', + 'override', + 'async', ]), ...selectorSchema('classProperty', true, [ 'abstract', 'private', + '#private', 'protected', 'public', 'readonly', 'requiresQuotes', 'static', + 'override', ]), ...selectorSchema('objectLiteralProperty', true, [ 'public', @@ -214,33 +228,43 @@ const SCHEMA: JSONSchema.JSONSchema4 = { ...selectorSchema('property', true, [ 'abstract', 'private', + '#private', 'protected', 'public', 'readonly', 'requiresQuotes', 'static', + 'override', + 'async', ]), ...selectorSchema('classMethod', false, [ 'abstract', 'private', + '#private', 'protected', 'public', 'requiresQuotes', 'static', + 'override', + 'async', ]), ...selectorSchema('objectLiteralMethod', false, [ 'public', 'requiresQuotes', + 'async', ]), ...selectorSchema('typeMethod', false, ['public', 'requiresQuotes']), ...selectorSchema('method', false, [ 'abstract', 'private', + '#private', 'protected', 'public', 'requiresQuotes', 'static', + 'override', + 'async', ]), ...selectorSchema('accessor', true, [ 'abstract', @@ -249,6 +273,7 @@ const SCHEMA: JSONSchema.JSONSchema4 = { 'public', 'requiresQuotes', 'static', + 'override', ]), ...selectorSchema('enumMember', false, ['requiresQuotes']), diff --git a/packages/eslint-plugin/src/rules/naming-convention-utils/shared.ts b/packages/eslint-plugin/src/rules/naming-convention-utils/shared.ts index 927fe83f9ef..9772f91ced8 100644 --- a/packages/eslint-plugin/src/rules/naming-convention-utils/shared.ts +++ b/packages/eslint-plugin/src/rules/naming-convention-utils/shared.ts @@ -1,10 +1,10 @@ -import { +import type { IndividualAndMetaSelectorsString, - MetaSelectors, MetaSelectorsString, Selectors, SelectorsString, } from './enums'; +import { MetaSelectors } from './enums'; function selectorTypeToMessageString(selectorType: SelectorsString): string { const notCamelCase = selectorType.replace(/([A-Z])/g, ' $1'); diff --git a/packages/eslint-plugin/src/rules/naming-convention-utils/types.ts b/packages/eslint-plugin/src/rules/naming-convention-utils/types.ts index 9a45bc0aeef..d5c15994b8b 100644 --- a/packages/eslint-plugin/src/rules/naming-convention-utils/types.ts +++ b/packages/eslint-plugin/src/rules/naming-convention-utils/types.ts @@ -1,5 +1,7 @@ -import { TSESLint, TSESTree } from '@typescript-eslint/utils'; -import { +import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; + +import type { MessageIds, Options } from '../naming-convention'; +import type { IndividualAndMetaSelectorsString, MetaSelectors, Modifiers, @@ -13,7 +15,6 @@ import { UnderscoreOptions, UnderscoreOptionsString, } from './enums'; -import { MessageIds, Options } from '../naming-convention'; interface MatchRegex { regex: string; @@ -63,7 +64,7 @@ type ValidatorFunction = ( node: TSESTree.Identifier | TSESTree.PrivateIdentifier | TSESTree.Literal, modifiers?: Set, ) => void; -type ParsedOptions = Record; +type ParsedOptions = Record; type Context = Readonly>; export type { diff --git a/packages/eslint-plugin/src/rules/naming-convention-utils/validator.ts b/packages/eslint-plugin/src/rules/naming-convention-utils/validator.ts index 43550b681c0..c2b87ccc33b 100644 --- a/packages/eslint-plugin/src/rules/naming-convention-utils/validator.ts +++ b/packages/eslint-plugin/src/rules/naming-convention-utils/validator.ts @@ -1,11 +1,14 @@ -import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/utils'; -import * as ts from 'typescript'; +import type { TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; +import type * as ts from 'typescript'; + +import * as util from '../../util'; +import type { SelectorsString } from './enums'; import { MetaSelectors, Modifiers, PredefinedFormats, Selectors, - SelectorsString, TypeModifiers, UnderscoreOptions, } from './enums'; @@ -16,7 +19,6 @@ import { selectorTypeToMessageString, } from './shared'; import type { Context, NormalizedSelector } from './types'; -import * as util from '../../util'; function createValidator( type: SelectorsString, @@ -99,25 +101,25 @@ function createValidator( let name: string | null = originalName; name = validateUnderscore('leading', config, name, node, originalName); - if (name === null) { + if (name == null) { // fail return; } name = validateUnderscore('trailing', config, name, node, originalName); - if (name === null) { + if (name == null) { // fail return; } name = validateAffix('prefix', config, name, node, originalName); - if (name === null) { + if (name == null) { // fail return; } name = validateAffix('suffix', config, name, node, originalName); - if (name === null) { + if (name == null) { // fail return; } @@ -381,7 +383,7 @@ function createValidator( modifiers: Set, ): boolean { const formats = config.format; - if (formats === null || formats.length === 0) { + if (!formats?.length) { return true; } @@ -425,7 +427,7 @@ function isCorrectType( context: Context, selector: Selectors, ): boolean { - if (config.types === null) { + if (config.types == null) { return true; } diff --git a/packages/eslint-plugin/src/rules/naming-convention.ts b/packages/eslint-plugin/src/rules/naming-convention.ts index a27d9b09df0..f5a59614851 100644 --- a/packages/eslint-plugin/src/rules/naming-convention.ts +++ b/packages/eslint-plugin/src/rules/naming-convention.ts @@ -1,15 +1,15 @@ -import { AST_NODE_TYPES, TSESLint, TSESTree } from '@typescript-eslint/utils'; import { PatternVisitor } from '@typescript-eslint/scope-manager'; +import type { TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES, TSESLint } from '@typescript-eslint/utils'; import type { ScriptTarget } from 'typescript'; + import * as util from '../util'; -import { +import type { Context, - Modifiers, - parseOptions, - SCHEMA, Selector, ValidatorFunction, } from './naming-convention-utils'; +import { Modifiers, parseOptions, SCHEMA } from './naming-convention-utils'; type MessageIds = | 'unexpectedUnderscore' @@ -95,7 +95,7 @@ export default util.createRule({ .getParserServices(context, true) .program.getCompilerOptions(); function handleMember( - validator: ValidatorFunction | null, + validator: ValidatorFunction, node: | TSESTree.PropertyNonComputedName | TSESTree.PropertyDefinitionNonComputedName @@ -127,7 +127,9 @@ export default util.createRule({ | TSESTree.TSParameterProperty, ): Set { const modifiers = new Set(); - if (node.accessibility) { + if ('key' in node && node.key.type === AST_NODE_TYPES.PrivateIdentifier) { + modifiers.add(Modifiers['#private']); + } else if (node.accessibility) { modifiers.add(Modifiers[node.accessibility]); } else { modifiers.add(Modifiers.public); @@ -138,6 +140,9 @@ export default util.createRule({ if ('readonly' in node && node.readonly) { modifiers.add(Modifiers.readonly); } + if ('override' in node && node.override) { + modifiers.add(Modifiers.override); + } if ( node.type === AST_NODE_TYPES.TSAbstractPropertyDefinition || node.type === AST_NODE_TYPES.TSAbstractMethodDefinition @@ -182,168 +187,226 @@ export default util.createRule({ ); } - return { + function isAsyncMemberOrProperty( + propertyOrMemberNode: + | TSESTree.PropertyNonComputedName + | TSESTree.TSMethodSignatureNonComputedName + | TSESTree.PropertyDefinitionNonComputedName + | TSESTree.TSAbstractPropertyDefinitionNonComputedName + | TSESTree.MethodDefinitionNonComputedName + | TSESTree.TSAbstractMethodDefinitionNonComputedName, + ): boolean { + return Boolean( + 'value' in propertyOrMemberNode && + propertyOrMemberNode.value && + 'async' in propertyOrMemberNode.value && + propertyOrMemberNode.value.async, + ); + } + + function isAsyncVariableIdentifier(id: TSESTree.Identifier): boolean { + return Boolean( + id.parent && + (('async' in id.parent && id.parent.async) || + ('init' in id.parent && + id.parent.init && + 'async' in id.parent.init && + id.parent.init.async)), + ); + } + + const selectors: { + readonly [k in keyof TSESLint.RuleListener]: Readonly<{ + validator: ValidatorFunction; + handler: ( + node: Parameters>[0], + validator: ValidatorFunction, + ) => void; + }>; + } = { // #region variable - VariableDeclarator(node: TSESTree.VariableDeclarator): void { - const validator = validators.variable; - if (!validator) { - return; - } - const identifiers = getIdentifiersFromPattern(node.id); + VariableDeclarator: { + validator: validators.variable, + handler: (node, validator): void => { + const identifiers = getIdentifiersFromPattern(node.id); - const baseModifiers = new Set(); - const parent = node.parent; - if (parent?.type === AST_NODE_TYPES.VariableDeclaration) { - if (parent.kind === 'const') { - baseModifiers.add(Modifiers.const); - } + const baseModifiers = new Set(); + const parent = node.parent; + if (parent?.type === AST_NODE_TYPES.VariableDeclaration) { + if (parent.kind === 'const') { + baseModifiers.add(Modifiers.const); + } - if (isGlobal(context.getScope())) { - baseModifiers.add(Modifiers.global); + if (isGlobal(context.getScope())) { + baseModifiers.add(Modifiers.global); + } } - } - identifiers.forEach(id => { - const modifiers = new Set(baseModifiers); + identifiers.forEach(id => { + const modifiers = new Set(baseModifiers); - if (isDestructured(id)) { - modifiers.add(Modifiers.destructured); - } + if (isDestructured(id)) { + modifiers.add(Modifiers.destructured); + } - if (isExported(parent, id.name, context.getScope())) { - modifiers.add(Modifiers.exported); - } + if (isExported(parent, id.name, context.getScope())) { + modifiers.add(Modifiers.exported); + } - if (isUnused(id.name)) { - modifiers.add(Modifiers.unused); - } + if (isUnused(id.name)) { + modifiers.add(Modifiers.unused); + } - validator(id, modifiers); - }); + if (isAsyncVariableIdentifier(id)) { + modifiers.add(Modifiers.async); + } + + validator(id, modifiers); + }); + }, }, // #endregion // #region function - 'FunctionDeclaration, TSDeclareFunction, FunctionExpression'( - node: - | TSESTree.FunctionDeclaration - | TSESTree.TSDeclareFunction - | TSESTree.FunctionExpression, - ): void { - const validator = validators.function; - if (!validator || node.id === null) { - return; - } + 'FunctionDeclaration, TSDeclareFunction, FunctionExpression': { + validator: validators.function, + handler: ( + node: + | TSESTree.FunctionDeclaration + | TSESTree.TSDeclareFunction + | TSESTree.FunctionExpression, + validator, + ): void => { + if (node.id == null) { + return; + } - const modifiers = new Set(); - // functions create their own nested scope - const scope = context.getScope().upper; + const modifiers = new Set(); + // functions create their own nested scope + const scope = context.getScope().upper; - if (isGlobal(scope)) { - modifiers.add(Modifiers.global); - } + if (isGlobal(scope)) { + modifiers.add(Modifiers.global); + } - if (isExported(node, node.id.name, scope)) { - modifiers.add(Modifiers.exported); - } + if (isExported(node, node.id.name, scope)) { + modifiers.add(Modifiers.exported); + } - if (isUnused(node.id.name, scope)) { - modifiers.add(Modifiers.unused); - } + if (isUnused(node.id.name, scope)) { + modifiers.add(Modifiers.unused); + } + + if (node.async) { + modifiers.add(Modifiers.async); + } - validator(node.id, modifiers); + validator(node.id, modifiers); + }, }, // #endregion function // #region parameter - 'FunctionDeclaration, TSDeclareFunction, TSEmptyBodyFunctionExpression, FunctionExpression, ArrowFunctionExpression'( - node: - | TSESTree.FunctionDeclaration - | TSESTree.TSDeclareFunction - | TSESTree.TSEmptyBodyFunctionExpression - | TSESTree.FunctionExpression - | TSESTree.ArrowFunctionExpression, - ): void { - const validator = validators.parameter; - if (!validator) { - return; - } - - node.params.forEach(param => { - if (param.type === AST_NODE_TYPES.TSParameterProperty) { - return; - } - - const identifiers = getIdentifiersFromPattern(param); - - identifiers.forEach(i => { - const modifiers = new Set(); - - if (isDestructured(i)) { - modifiers.add(Modifiers.destructured); - } - - if (isUnused(i.name)) { - modifiers.add(Modifiers.unused); - } - - validator(i, modifiers); - }); - }); - }, + 'FunctionDeclaration, TSDeclareFunction, TSEmptyBodyFunctionExpression, FunctionExpression, ArrowFunctionExpression': + { + validator: validators.parameter, + handler: ( + node: + | TSESTree.FunctionDeclaration + | TSESTree.TSDeclareFunction + | TSESTree.TSEmptyBodyFunctionExpression + | TSESTree.FunctionExpression + | TSESTree.ArrowFunctionExpression, + validator, + ): void => { + node.params.forEach(param => { + if (param.type === AST_NODE_TYPES.TSParameterProperty) { + return; + } + + const identifiers = getIdentifiersFromPattern(param); + + identifiers.forEach(i => { + const modifiers = new Set(); + + if (isDestructured(i)) { + modifiers.add(Modifiers.destructured); + } + + if (isUnused(i.name)) { + modifiers.add(Modifiers.unused); + } + + validator(i, modifiers); + }); + }); + }, + }, // #endregion parameter // #region parameterProperty - TSParameterProperty(node): void { - const validator = validators.parameterProperty; - if (!validator) { - return; - } - - const modifiers = getMemberModifiers(node); + TSParameterProperty: { + validator: validators.parameterProperty, + handler: (node, validator): void => { + const modifiers = getMemberModifiers(node); - const identifiers = getIdentifiersFromPattern(node.parameter); + const identifiers = getIdentifiersFromPattern(node.parameter); - identifiers.forEach(i => { - validator(i, modifiers); - }); + identifiers.forEach(i => { + validator(i, modifiers); + }); + }, }, // #endregion parameterProperty // #region property - ':not(ObjectPattern) > Property[computed = false][kind = "init"][value.type != "ArrowFunctionExpression"][value.type != "FunctionExpression"][value.type != "TSEmptyBodyFunctionExpression"]'( - node: TSESTree.PropertyNonComputedName, - ): void { - const modifiers = new Set([Modifiers.public]); - handleMember(validators.objectLiteralProperty, node, modifiers); - }, - - ':matches(PropertyDefinition, TSAbstractPropertyDefinition)[computed = false][value.type != "ArrowFunctionExpression"][value.type != "FunctionExpression"][value.type != "TSEmptyBodyFunctionExpression"]'( - node: - | TSESTree.PropertyDefinitionNonComputedName - | TSESTree.TSAbstractPropertyDefinitionNonComputedName, - ): void { - const modifiers = getMemberModifiers(node); - handleMember(validators.classProperty, node, modifiers); - }, - - 'TSPropertySignature[computed = false]'( - node: TSESTree.TSPropertySignatureNonComputedName, - ): void { - const modifiers = new Set([Modifiers.public]); - if (node.readonly) { - modifiers.add(Modifiers.readonly); - } + ':not(ObjectPattern) > Property[computed = false][kind = "init"][value.type != "ArrowFunctionExpression"][value.type != "FunctionExpression"][value.type != "TSEmptyBodyFunctionExpression"]': + { + validator: validators.objectLiteralProperty, + handler: ( + node: TSESTree.PropertyNonComputedName, + validator, + ): void => { + const modifiers = new Set([Modifiers.public]); + handleMember(validator, node, modifiers); + }, + }, + + ':matches(PropertyDefinition, TSAbstractPropertyDefinition)[computed = false][value.type != "ArrowFunctionExpression"][value.type != "FunctionExpression"][value.type != "TSEmptyBodyFunctionExpression"]': + { + validator: validators.classProperty, + handler: ( + node: + | TSESTree.PropertyDefinitionNonComputedName + | TSESTree.TSAbstractPropertyDefinitionNonComputedName, + validator, + ): void => { + const modifiers = getMemberModifiers(node); + handleMember(validator, node, modifiers); + }, + }, + + 'TSPropertySignature[computed = false]': { + validator: validators.typeProperty, + handler: ( + node: TSESTree.TSPropertySignatureNonComputedName, + validator, + ): void => { + const modifiers = new Set([Modifiers.public]); + if (node.readonly) { + modifiers.add(Modifiers.readonly); + } - handleMember(validators.typeProperty, node, modifiers); + handleMember(validator, node, modifiers); + }, }, // #endregion property @@ -354,13 +417,22 @@ export default util.createRule({ 'Property[computed = false][kind = "init"][value.type = "ArrowFunctionExpression"]', 'Property[computed = false][kind = "init"][value.type = "FunctionExpression"]', 'Property[computed = false][kind = "init"][value.type = "TSEmptyBodyFunctionExpression"]', - ].join(', ')]( - node: - | TSESTree.PropertyNonComputedName - | TSESTree.TSMethodSignatureNonComputedName, - ): void { - const modifiers = new Set([Modifiers.public]); - handleMember(validators.objectLiteralMethod, node, modifiers); + ].join(', ')]: { + validator: validators.objectLiteralMethod, + handler: ( + node: + | TSESTree.PropertyNonComputedName + | TSESTree.TSMethodSignatureNonComputedName, + validator, + ): void => { + const modifiers = new Set([Modifiers.public]); + + if (isAsyncMemberOrProperty(node)) { + modifiers.add(Modifiers.async); + } + + handleMember(validator, node, modifiers); + }, }, [[ @@ -368,198 +440,218 @@ export default util.createRule({ ':matches(PropertyDefinition, TSAbstractPropertyDefinition)[computed = false][value.type = "FunctionExpression"]', ':matches(PropertyDefinition, TSAbstractPropertyDefinition)[computed = false][value.type = "TSEmptyBodyFunctionExpression"]', ':matches(MethodDefinition, TSAbstractMethodDefinition)[computed = false][kind = "method"]', - ].join(', ')]( - node: - | TSESTree.PropertyDefinitionNonComputedName - | TSESTree.TSAbstractPropertyDefinitionNonComputedName - | TSESTree.MethodDefinitionNonComputedName - | TSESTree.TSAbstractMethodDefinitionNonComputedName, - ): void { - const modifiers = getMemberModifiers(node); - handleMember(validators.classMethod, node, modifiers); + ].join(', ')]: { + validator: validators.classMethod, + handler: ( + node: + | TSESTree.PropertyDefinitionNonComputedName + | TSESTree.TSAbstractPropertyDefinitionNonComputedName + | TSESTree.MethodDefinitionNonComputedName + | TSESTree.TSAbstractMethodDefinitionNonComputedName, + validator, + ): void => { + const modifiers = getMemberModifiers(node); + + if (isAsyncMemberOrProperty(node)) { + modifiers.add(Modifiers.async); + } + + handleMember(validator, node, modifiers); + }, }, - 'TSMethodSignature[computed = false]'( - node: TSESTree.TSMethodSignatureNonComputedName, - ): void { - const modifiers = new Set([Modifiers.public]); - handleMember(validators.typeMethod, node, modifiers); + 'TSMethodSignature[computed = false]': { + validator: validators.typeMethod, + handler: ( + node: TSESTree.TSMethodSignatureNonComputedName, + validator, + ): void => { + const modifiers = new Set([Modifiers.public]); + handleMember(validator, node, modifiers); + }, }, // #endregion method // #region accessor - 'Property[computed = false]:matches([kind = "get"], [kind = "set"])'( - node: TSESTree.PropertyNonComputedName, - ): void { - const modifiers = new Set([Modifiers.public]); - handleMember(validators.accessor, node, modifiers); + 'Property[computed = false]:matches([kind = "get"], [kind = "set"])': { + validator: validators.accessor, + handler: (node: TSESTree.PropertyNonComputedName, validator): void => { + const modifiers = new Set([Modifiers.public]); + handleMember(validator, node, modifiers); + }, }, - 'MethodDefinition[computed = false]:matches([kind = "get"], [kind = "set"])'( - node: TSESTree.MethodDefinitionNonComputedName, - ): void { - const modifiers = getMemberModifiers(node); - handleMember(validators.accessor, node, modifiers); - }, + 'MethodDefinition[computed = false]:matches([kind = "get"], [kind = "set"])': + { + validator: validators.accessor, + handler: ( + node: TSESTree.MethodDefinitionNonComputedName, + validator, + ): void => { + const modifiers = getMemberModifiers(node); + handleMember(validator, node, modifiers); + }, + }, // #endregion accessor // #region enumMember // computed is optional, so can't do [computed = false] - 'TSEnumMember[computed != true]'( - node: TSESTree.TSEnumMemberNonComputedName, - ): void { - const validator = validators.enumMember; - if (!validator) { - return; - } - - const id = node.id; - const modifiers = new Set(); - - if (requiresQuoting(id, compilerOptions.target)) { - modifiers.add(Modifiers.requiresQuotes); - } + 'TSEnumMember[computed != true]': { + validator: validators.enumMember, + handler: ( + node: TSESTree.TSEnumMemberNonComputedName, + validator, + ): void => { + const id = node.id; + const modifiers = new Set(); + + if (requiresQuoting(id, compilerOptions.target)) { + modifiers.add(Modifiers.requiresQuotes); + } - validator(id, modifiers); + validator(id, modifiers); + }, }, // #endregion enumMember // #region class - 'ClassDeclaration, ClassExpression'( - node: TSESTree.ClassDeclaration | TSESTree.ClassExpression, - ): void { - const validator = validators.class; - if (!validator) { - return; - } - - const id = node.id; - if (id === null) { - return; - } + 'ClassDeclaration, ClassExpression': { + validator: validators.class, + handler: ( + node: TSESTree.ClassDeclaration | TSESTree.ClassExpression, + validator, + ): void => { + const id = node.id; + if (id == null) { + return; + } - const modifiers = new Set(); - // classes create their own nested scope - const scope = context.getScope().upper; + const modifiers = new Set(); + // classes create their own nested scope + const scope = context.getScope().upper; - if (node.abstract) { - modifiers.add(Modifiers.abstract); - } + if (node.abstract) { + modifiers.add(Modifiers.abstract); + } - if (isExported(node, id.name, scope)) { - modifiers.add(Modifiers.exported); - } + if (isExported(node, id.name, scope)) { + modifiers.add(Modifiers.exported); + } - if (isUnused(id.name, scope)) { - modifiers.add(Modifiers.unused); - } + if (isUnused(id.name, scope)) { + modifiers.add(Modifiers.unused); + } - validator(id, modifiers); + validator(id, modifiers); + }, }, // #endregion class // #region interface - TSInterfaceDeclaration(node): void { - const validator = validators.interface; - if (!validator) { - return; - } - - const modifiers = new Set(); - const scope = context.getScope(); + TSInterfaceDeclaration: { + validator: validators.interface, + handler: (node, validator): void => { + const modifiers = new Set(); + const scope = context.getScope(); - if (isExported(node, node.id.name, scope)) { - modifiers.add(Modifiers.exported); - } + if (isExported(node, node.id.name, scope)) { + modifiers.add(Modifiers.exported); + } - if (isUnused(node.id.name, scope)) { - modifiers.add(Modifiers.unused); - } + if (isUnused(node.id.name, scope)) { + modifiers.add(Modifiers.unused); + } - validator(node.id, modifiers); + validator(node.id, modifiers); + }, }, // #endregion interface // #region typeAlias - TSTypeAliasDeclaration(node): void { - const validator = validators.typeAlias; - if (!validator) { - return; - } - - const modifiers = new Set(); - const scope = context.getScope(); + TSTypeAliasDeclaration: { + validator: validators.typeAlias, + handler: (node, validator): void => { + const modifiers = new Set(); + const scope = context.getScope(); - if (isExported(node, node.id.name, scope)) { - modifiers.add(Modifiers.exported); - } + if (isExported(node, node.id.name, scope)) { + modifiers.add(Modifiers.exported); + } - if (isUnused(node.id.name, scope)) { - modifiers.add(Modifiers.unused); - } + if (isUnused(node.id.name, scope)) { + modifiers.add(Modifiers.unused); + } - validator(node.id, modifiers); + validator(node.id, modifiers); + }, }, // #endregion typeAlias // #region enum - TSEnumDeclaration(node): void { - const validator = validators.enum; - if (!validator) { - return; - } - - const modifiers = new Set(); - // enums create their own nested scope - const scope = context.getScope().upper; + TSEnumDeclaration: { + validator: validators.enum, + handler: (node, validator): void => { + const modifiers = new Set(); + // enums create their own nested scope + const scope = context.getScope().upper; - if (isExported(node, node.id.name, scope)) { - modifiers.add(Modifiers.exported); - } + if (isExported(node, node.id.name, scope)) { + modifiers.add(Modifiers.exported); + } - if (isUnused(node.id.name, scope)) { - modifiers.add(Modifiers.unused); - } + if (isUnused(node.id.name, scope)) { + modifiers.add(Modifiers.unused); + } - validator(node.id, modifiers); + validator(node.id, modifiers); + }, }, // #endregion enum // #region typeParameter - 'TSTypeParameterDeclaration > TSTypeParameter'( - node: TSESTree.TSTypeParameter, - ): void { - const validator = validators.typeParameter; - if (!validator) { - return; - } - - const modifiers = new Set(); - const scope = context.getScope(); + 'TSTypeParameterDeclaration > TSTypeParameter': { + validator: validators.typeParameter, + handler: (node: TSESTree.TSTypeParameter, validator): void => { + const modifiers = new Set(); + const scope = context.getScope(); - if (isUnused(node.name.name, scope)) { - modifiers.add(Modifiers.unused); - } + if (isUnused(node.name.name, scope)) { + modifiers.add(Modifiers.unused); + } - validator(node.name, modifiers); + validator(node.name, modifiers); + }, }, // #endregion typeParameter }; + + return Object.fromEntries( + Object.entries(selectors) + .map(([selector, { validator, handler }]) => { + return [ + selector, + (node: Parameters[0]): void => { + handler(node, validator); + }, + ] as const; + }) + .filter((s): s is NonNullable => s != null), + ); }, }); diff --git a/packages/eslint-plugin/src/rules/no-array-constructor.ts b/packages/eslint-plugin/src/rules/no-array-constructor.ts index d87bdbefee0..758a06458dc 100644 --- a/packages/eslint-plugin/src/rules/no-array-constructor.ts +++ b/packages/eslint-plugin/src/rules/no-array-constructor.ts @@ -1,4 +1,6 @@ -import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; + import * as util from '../util'; export default util.createRule({ diff --git a/packages/eslint-plugin/src/rules/no-base-to-string.ts b/packages/eslint-plugin/src/rules/no-base-to-string.ts index eded1ff018e..8b8521491f2 100644 --- a/packages/eslint-plugin/src/rules/no-base-to-string.ts +++ b/packages/eslint-plugin/src/rules/no-base-to-string.ts @@ -1,4 +1,5 @@ -import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; import * as ts from 'typescript'; import * as util from '../util'; @@ -47,7 +48,7 @@ export default util.createRule({ }, defaultOptions: [ { - ignoredTypeNames: ['RegExp'], + ignoredTypeNames: ['Error', 'RegExp', 'URL', 'URLSearchParams'], }, ], create(context, [option]) { diff --git a/packages/eslint-plugin/src/rules/no-confusing-non-null-assertion.ts b/packages/eslint-plugin/src/rules/no-confusing-non-null-assertion.ts index c6a3234e999..6268a9e6c75 100644 --- a/packages/eslint-plugin/src/rules/no-confusing-non-null-assertion.ts +++ b/packages/eslint-plugin/src/rules/no-confusing-non-null-assertion.ts @@ -1,9 +1,6 @@ -import { - AST_NODE_TYPES, - AST_TOKEN_TYPES, - TSESLint, - TSESTree, -} from '@typescript-eslint/utils'; +import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES, AST_TOKEN_TYPES } from '@typescript-eslint/utils'; + import * as util from '../util'; export default util.createRule({ diff --git a/packages/eslint-plugin/src/rules/no-confusing-void-expression.ts b/packages/eslint-plugin/src/rules/no-confusing-void-expression.ts index 15b152c0002..01e5b45dbb8 100644 --- a/packages/eslint-plugin/src/rules/no-confusing-void-expression.ts +++ b/packages/eslint-plugin/src/rules/no-confusing-void-expression.ts @@ -1,6 +1,8 @@ -import { AST_NODE_TYPES, TSESLint, TSESTree } from '@typescript-eslint/utils'; +import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; import * as tsutils from 'tsutils'; import * as ts from 'typescript'; + import * as util from '../util'; export type Options = [ diff --git a/packages/eslint-plugin/src/rules/no-dupe-class-members.ts b/packages/eslint-plugin/src/rules/no-dupe-class-members.ts index 843a7411895..62c1a8feb80 100644 --- a/packages/eslint-plugin/src/rules/no-dupe-class-members.ts +++ b/packages/eslint-plugin/src/rules/no-dupe-class-members.ts @@ -1,6 +1,8 @@ -import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils'; -import { getESLintCoreRule } from '../util/getESLintCoreRule'; +import type { TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; + import * as util from '../util'; +import { getESLintCoreRule } from '../util/getESLintCoreRule'; const baseRule = getESLintCoreRule('no-dupe-class-members'); diff --git a/packages/eslint-plugin/src/rules/no-duplicate-enum-values.ts b/packages/eslint-plugin/src/rules/no-duplicate-enum-values.ts index dcd0f6be36f..4bb011d1234 100644 --- a/packages/eslint-plugin/src/rules/no-duplicate-enum-values.ts +++ b/packages/eslint-plugin/src/rules/no-duplicate-enum-values.ts @@ -1,4 +1,6 @@ -import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; + import * as util from '../util'; export default util.createRule({ @@ -9,7 +11,7 @@ export default util.createRule({ description: 'Disallow duplicate enum member values', recommended: 'strict', }, - hasSuggestions: true, + hasSuggestions: false, messages: { duplicateValue: 'Duplicate enum member value {{value}}.', }, diff --git a/packages/eslint-plugin/src/rules/no-duplicate-imports.ts b/packages/eslint-plugin/src/rules/no-duplicate-imports.ts index b4808f79013..c84fd26468f 100644 --- a/packages/eslint-plugin/src/rules/no-duplicate-imports.ts +++ b/packages/eslint-plugin/src/rules/no-duplicate-imports.ts @@ -1,6 +1,8 @@ -import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils'; -import { getESLintCoreRule } from '../util/getESLintCoreRule'; +import type { TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; + import * as util from '../util'; +import { getESLintCoreRule } from '../util/getESLintCoreRule'; const baseRule = getESLintCoreRule('no-duplicate-imports'); diff --git a/packages/eslint-plugin/src/rules/no-dynamic-delete.ts b/packages/eslint-plugin/src/rules/no-dynamic-delete.ts index 1654b2d2c69..09d5b5420d8 100644 --- a/packages/eslint-plugin/src/rules/no-dynamic-delete.ts +++ b/packages/eslint-plugin/src/rules/no-dynamic-delete.ts @@ -1,5 +1,7 @@ -import { TSESTree, AST_NODE_TYPES, TSESLint } from '@typescript-eslint/utils'; +import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; import * as tsutils from 'tsutils'; + import * as util from '../util'; export default util.createRule({ diff --git a/packages/eslint-plugin/src/rules/no-empty-function.ts b/packages/eslint-plugin/src/rules/no-empty-function.ts index d3a9f74b770..a78e4b86db4 100644 --- a/packages/eslint-plugin/src/rules/no-empty-function.ts +++ b/packages/eslint-plugin/src/rules/no-empty-function.ts @@ -1,6 +1,8 @@ -import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils'; -import { getESLintCoreRule } from '../util/getESLintCoreRule'; +import type { TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; + import * as util from '../util'; +import { getESLintCoreRule } from '../util/getESLintCoreRule'; const baseRule = getESLintCoreRule('no-empty-function'); diff --git a/packages/eslint-plugin/src/rules/no-empty-interface.ts b/packages/eslint-plugin/src/rules/no-empty-interface.ts index e8985919091..d74034114bb 100644 --- a/packages/eslint-plugin/src/rules/no-empty-interface.ts +++ b/packages/eslint-plugin/src/rules/no-empty-interface.ts @@ -1,5 +1,7 @@ +import type { TSESLint } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; + import * as util from '../util'; -import { TSESLint } from '@typescript-eslint/utils'; type Options = [ { @@ -15,7 +17,6 @@ export default util.createRule({ docs: { description: 'Disallow the declaration of empty interfaces', recommended: 'error', - suggestion: true, }, fixable: 'code', hasSuggestions: true, @@ -73,29 +74,39 @@ export default util.createRule({ )}${typeParam} = ${sourceCode.getText(extend[0])}`, ); }; + const scope = context.getScope(); - // Check if interface is within ambient declaration - let useAutoFix = true; - if (util.isDefinitionFile(filename)) { - const scope = context.getScope(); - if (scope.type === 'tsModule' && scope.block.declare) { - useAutoFix = false; - } - } + const mergedWithClassDeclaration = scope.set + .get(node.id.name) + ?.defs?.some( + def => def.node.type === AST_NODE_TYPES.ClassDeclaration, + ); + + const isInAmbientDeclaration = !!( + util.isDefinitionFile(filename) && + scope.type === 'tsModule' && + scope.block.declare + ); + + const useAutoFix = !( + isInAmbientDeclaration || mergedWithClassDeclaration + ); context.report({ node: node.id, messageId: 'noEmptyWithSuper', ...(useAutoFix ? { fix } - : { + : !mergedWithClassDeclaration + ? { suggest: [ { messageId: 'noEmptyWithSuper', fix, }, ], - }), + } + : null), }); } } diff --git a/packages/eslint-plugin/src/rules/no-explicit-any.ts b/packages/eslint-plugin/src/rules/no-explicit-any.ts index e0e8bfd2b9c..6823a3c7bcd 100644 --- a/packages/eslint-plugin/src/rules/no-explicit-any.ts +++ b/packages/eslint-plugin/src/rules/no-explicit-any.ts @@ -1,4 +1,6 @@ -import { AST_NODE_TYPES, TSESLint, TSESTree } from '@typescript-eslint/utils'; +import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; + import * as util from '../util'; export type Options = [ @@ -16,7 +18,6 @@ export default util.createRule({ docs: { description: 'Disallow the `any` type', recommended: 'warn', - suggestion: true, }, fixable: 'code', hasSuggestions: true, @@ -33,9 +34,12 @@ export default util.createRule({ additionalProperties: false, properties: { fixToUnknown: { + description: + 'Whether to enable auto-fixing in which the `any` type is converted to the `unknown` type.', type: 'boolean', }, ignoreRestArgs: { + description: 'Whether to ignore rest parameter arrays.', type: 'boolean', }, }, diff --git a/packages/eslint-plugin/src/rules/no-extra-non-null-assertion.ts b/packages/eslint-plugin/src/rules/no-extra-non-null-assertion.ts index 6ffe529700a..a69cd262d6e 100644 --- a/packages/eslint-plugin/src/rules/no-extra-non-null-assertion.ts +++ b/packages/eslint-plugin/src/rules/no-extra-non-null-assertion.ts @@ -1,4 +1,5 @@ -import { TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; + import * as util from '../util'; export default util.createRule({ @@ -6,7 +7,7 @@ export default util.createRule({ meta: { type: 'problem', docs: { - description: 'Disallow extra non-null assertion', + description: 'Disallow extra non-null assertions', recommended: 'error', }, fixable: 'code', diff --git a/packages/eslint-plugin/src/rules/no-extra-parens.ts b/packages/eslint-plugin/src/rules/no-extra-parens.ts index 8f018b2c4bf..322a7447a72 100644 --- a/packages/eslint-plugin/src/rules/no-extra-parens.ts +++ b/packages/eslint-plugin/src/rules/no-extra-parens.ts @@ -1,9 +1,11 @@ // any is required to work around manipulating the AST in weird ways /* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-assignment */ -import { AST_NODE_TYPES, TSESTree, TSESLint } from '@typescript-eslint/utils'; -import { getESLintCoreRule } from '../util/getESLintCoreRule'; +import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; + import * as util from '../util'; +import { getESLintCoreRule } from '../util/getESLintCoreRule'; const baseRule = getESLintCoreRule('no-extra-parens'); @@ -79,7 +81,9 @@ export default util.createRule({ if ( node.arguments.length === 1 && node.typeArguments?.params.some( - param => param.type === AST_NODE_TYPES.TSImportType, + param => + param.type === AST_NODE_TYPES.TSImportType || + param.type === AST_NODE_TYPES.TSArrayType, ) ) { return rule({ @@ -122,11 +126,45 @@ export default util.createRule({ } }, // AssignmentExpression - // AwaitExpression + AwaitExpression(node) { + if (util.isTypeAssertion(node.argument)) { + // reduces the precedence of the node so the rule thinks it needs to be wrapped + return rules.AwaitExpression({ + ...node, + argument: { + ...node.argument, + type: AST_NODE_TYPES.SequenceExpression as any, + }, + }); + } + return rules.AwaitExpression(node); + }, BinaryExpression: binaryExp, CallExpression: callExp, - // ClassDeclaration - // ClassExpression + ClassDeclaration(node) { + if (node.superClass?.type === AST_NODE_TYPES.TSAsExpression) { + return rules.ClassDeclaration({ + ...node, + superClass: { + ...node.superClass, + type: AST_NODE_TYPES.SequenceExpression as any, + }, + }); + } + return rules.ClassDeclaration(node); + }, + ClassExpression(node) { + if (node.superClass?.type === AST_NODE_TYPES.TSAsExpression) { + return rules.ClassExpression({ + ...node, + superClass: { + ...node.superClass, + type: AST_NODE_TYPES.SequenceExpression as any, + }, + }); + } + return rules.ClassExpression(node); + }, ConditionalExpression(node) { // reduces the precedence of the node so the rule thinks it needs to be wrapped if (util.isTypeAssertion(node.test)) { @@ -148,7 +186,7 @@ export default util.createRule({ }); } if (util.isTypeAssertion(node.alternate)) { - // reduces the precedence of the node so the rule thinks it needs to be rapped + // reduces the precedence of the node so the rule thinks it needs to be wrapped return rules.ConditionalExpression({ ...node, alternate: { diff --git a/packages/eslint-plugin/src/rules/no-extra-semi.ts b/packages/eslint-plugin/src/rules/no-extra-semi.ts index 7100b5d6f88..6fcfb4871ee 100644 --- a/packages/eslint-plugin/src/rules/no-extra-semi.ts +++ b/packages/eslint-plugin/src/rules/no-extra-semi.ts @@ -1,5 +1,5 @@ -import { getESLintCoreRule } from '../util/getESLintCoreRule'; import * as util from '../util'; +import { getESLintCoreRule } from '../util/getESLintCoreRule'; const baseRule = getESLintCoreRule('no-extra-semi'); diff --git a/packages/eslint-plugin/src/rules/no-extraneous-class.ts b/packages/eslint-plugin/src/rules/no-extraneous-class.ts index f280780ef89..b7b93c8c77c 100644 --- a/packages/eslint-plugin/src/rules/no-extraneous-class.ts +++ b/packages/eslint-plugin/src/rules/no-extraneous-class.ts @@ -1,4 +1,6 @@ -import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; + import * as util from '../util'; type Options = [ @@ -25,15 +27,23 @@ export default util.createRule({ additionalProperties: false, properties: { allowConstructorOnly: { + description: + 'Whether to allow extraneous classes that contain only a constructor.', type: 'boolean', }, allowEmpty: { + description: + 'Whether to allow extraneous classes that have no body (i.e. are empty).', type: 'boolean', }, allowStaticOnly: { + description: + 'Whether to allow extraneous classes that only contain static members.', type: 'boolean', }, allowWithDecorator: { + description: + 'Whether to allow extraneous classes that include a decorator.', type: 'boolean', }, }, diff --git a/packages/eslint-plugin/src/rules/no-floating-promises.ts b/packages/eslint-plugin/src/rules/no-floating-promises.ts index c59d0f08a6e..c4ce3db8e1c 100644 --- a/packages/eslint-plugin/src/rules/no-floating-promises.ts +++ b/packages/eslint-plugin/src/rules/no-floating-promises.ts @@ -1,8 +1,10 @@ +import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; import * as tsutils from 'tsutils'; import * as ts from 'typescript'; -import { TSESLint, AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils'; import * as util from '../util'; +import { OperatorPrecedence } from '../util'; type Options = [ { @@ -11,7 +13,11 @@ type Options = [ }, ]; -type MessageId = 'floating' | 'floatingVoid' | 'floatingFixVoid'; +type MessageId = + | 'floating' + | 'floatingVoid' + | 'floatingFixVoid' + | 'floatingFixAwait'; export default util.createRule({ name: 'no-floating-promises', @@ -20,13 +26,13 @@ export default util.createRule({ description: 'Require Promise-like statements to be handled appropriately', recommended: 'error', - suggestion: true, requiresTypeChecking: true, }, hasSuggestions: true, messages: { floating: 'Promises must be awaited, end with a call to .catch, or end with a call to .then with a rejection handler.', + floatingFixAwait: 'Add await operator.', floatingVoid: 'Promises must be awaited, end with a call to .catch, end with a call to .then with a rejection handler' + ' or be explicitly marked as ignored with the `void` operator.', @@ -36,8 +42,15 @@ export default util.createRule({ { type: 'object', properties: { - ignoreVoid: { type: 'boolean' }, - ignoreIIFE: { type: 'boolean' }, + ignoreVoid: { + description: 'Whether to ignore `void` expressions.', + type: 'boolean', + }, + ignoreIIFE: { + description: + 'Whether to ignore async IIFEs (Immediately Invocated Function Expressions).', + type: 'boolean', + }, }, additionalProperties: false, }, @@ -54,7 +67,6 @@ export default util.createRule({ create(context, [options]) { const parserServices = util.getParserServices(context); const checker = parserServices.program.getTypeChecker(); - const sourceCode = context.getSourceCode(); return { ExpressionStatement(node): void { @@ -76,10 +88,21 @@ export default util.createRule({ suggest: [ { messageId: 'floatingFixVoid', - fix(fixer): TSESLint.RuleFix { - let code = sourceCode.getText(node); - code = `void ${code}`; - return fixer.replaceText(node, code); + fix(fixer): TSESLint.RuleFix | TSESLint.RuleFix[] { + const tsNode = parserServices.esTreeNodeToTSNodeMap.get( + node.expression, + ); + if (isHigherPrecedenceThanUnary(tsNode)) { + return fixer.insertTextBefore(node, 'void '); + } else { + return [ + fixer.insertTextBefore(node, 'void ('), + fixer.insertTextAfterRange( + [expression.range[1], expression.range[1]], + ')', + ), + ]; + } }, }, ], @@ -88,12 +111,50 @@ export default util.createRule({ context.report({ node, messageId: 'floating', + suggest: [ + { + messageId: 'floatingFixAwait', + fix(fixer): TSESLint.RuleFix | TSESLint.RuleFix[] { + if ( + expression.type === AST_NODE_TYPES.UnaryExpression && + expression.operator === 'void' + ) { + return fixer.replaceTextRange( + [expression.range[0], expression.range[0] + 4], + 'await', + ); + } + const tsNode = parserServices.esTreeNodeToTSNodeMap.get( + node.expression, + ); + if (isHigherPrecedenceThanUnary(tsNode)) { + return fixer.insertTextBefore(node, 'await '); + } else { + return [ + fixer.insertTextBefore(node, 'await ('), + fixer.insertTextAfterRange( + [expression.range[1], expression.range[1]], + ')', + ), + ]; + } + }, + }, + ], }); } } }, }; + function isHigherPrecedenceThanUnary(node: ts.Node): boolean { + const operator = tsutils.isBinaryExpression(node) + ? node.operatorToken.kind + : ts.SyntaxKind.Unknown; + const nodePrecedence = util.getOperatorPrecedence(node.kind, operator); + return nodePrecedence > OperatorPrecedence.Unary; + } + function isAsyncIife(node: TSESTree.ExpressionStatement): boolean { if (node.expression.type !== AST_NODE_TYPES.CallExpression) { return false; @@ -160,6 +221,11 @@ export default util.createRule({ // `new Promise()`), the promise is not handled because it doesn't have the // necessary then/catch call at the end of the chain. return true; + } else if (node.type === AST_NODE_TYPES.LogicalExpression) { + return ( + isUnhandledPromise(checker, node.left) || + isUnhandledPromise(checker, node.right) + ); } // We conservatively return false for all other types of expressions because diff --git a/packages/eslint-plugin/src/rules/no-for-in-array.ts b/packages/eslint-plugin/src/rules/no-for-in-array.ts index c382a11021c..34590d4e569 100644 --- a/packages/eslint-plugin/src/rules/no-for-in-array.ts +++ b/packages/eslint-plugin/src/rules/no-for-in-array.ts @@ -1,4 +1,5 @@ import * as ts from 'typescript'; + import * as util from '../util'; export default util.createRule({ diff --git a/packages/eslint-plugin/src/rules/no-implicit-any-catch.ts b/packages/eslint-plugin/src/rules/no-implicit-any-catch.ts index b48d68fde45..bed757b8072 100644 --- a/packages/eslint-plugin/src/rules/no-implicit-any-catch.ts +++ b/packages/eslint-plugin/src/rules/no-implicit-any-catch.ts @@ -1,5 +1,7 @@ +import type { TSESLint } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; + import * as util from '../util'; -import { TSESLint, AST_NODE_TYPES } from '@typescript-eslint/utils'; export type Options = [ { @@ -19,7 +21,6 @@ export default util.createRule({ docs: { description: 'Disallow usage of the implicit `any` type in catch clauses', recommended: false, - suggestion: true, }, fixable: 'code', hasSuggestions: true, @@ -35,6 +36,8 @@ export default util.createRule({ additionalProperties: false, properties: { allowExplicitAny: { + description: + 'Whether to disallow specifying `: any` as the error type as well. See also `no-explicit-any`.', type: 'boolean', }, }, diff --git a/packages/eslint-plugin/src/rules/no-implied-eval.ts b/packages/eslint-plugin/src/rules/no-implied-eval.ts index 54938b9fd49..d88cd05ff6f 100644 --- a/packages/eslint-plugin/src/rules/no-implied-eval.ts +++ b/packages/eslint-plugin/src/rules/no-implied-eval.ts @@ -1,6 +1,8 @@ -import * as ts from 'typescript'; -import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; import * as tsutils from 'tsutils'; +import * as ts from 'typescript'; + import * as util from '../util'; const FUNCTION_CONSTRUCTOR = 'Function'; @@ -133,7 +135,7 @@ export default util.createRule({ node: TSESTree.NewExpression | TSESTree.CallExpression, ): void { const calleeName = getCalleeName(node.callee); - if (calleeName === null) { + if (calleeName == null) { return; } diff --git a/packages/eslint-plugin/src/rules/no-import-type-side-effects.ts b/packages/eslint-plugin/src/rules/no-import-type-side-effects.ts new file mode 100644 index 00000000000..ce80a654afe --- /dev/null +++ b/packages/eslint-plugin/src/rules/no-import-type-side-effects.ts @@ -0,0 +1,76 @@ +import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; + +import * as util from '../util'; + +type Options = []; +type MessageIds = 'useTopLevelQualifier'; + +export default util.createRule({ + name: 'no-import-type-side-effects', + meta: { + type: 'problem', + docs: { + description: + 'Enforce the use of top-level import type qualifier when an import only has specifiers with inline type qualifiers', + recommended: false, + }, + fixable: 'code', + messages: { + useTopLevelQualifier: + 'TypeScript will only remove the inline type specifiers which will leave behind a side effect import at runtime. Convert this to a top-level type qualifier to properly remove the entire import.', + }, + schema: [], + }, + defaultOptions: [], + create(context) { + const sourceCode = context.getSourceCode(); + return { + 'ImportDeclaration[importKind!="type"]'( + node: TSESTree.ImportDeclaration, + ): void { + const specifiers: TSESTree.ImportSpecifier[] = []; + for (const specifier of node.specifiers) { + if ( + specifier.type !== AST_NODE_TYPES.ImportSpecifier || + specifier.importKind !== 'type' + ) { + return; + } + specifiers.push(specifier); + } + + context.report({ + node, + messageId: 'useTopLevelQualifier', + fix(fixer) { + const fixes: TSESLint.RuleFix[] = []; + for (const specifier of specifiers) { + const qualifier = util.nullThrows( + sourceCode.getFirstToken(specifier, util.isTypeKeyword), + util.NullThrowsReasons.MissingToken( + 'type keyword', + 'import specifier', + ), + ); + fixes.push( + fixer.removeRange([ + qualifier.range[0], + specifier.imported.range[0], + ]), + ); + } + + const importKeyword = util.nullThrows( + sourceCode.getFirstToken(node, util.isImportKeyword), + util.NullThrowsReasons.MissingToken('import keyword', 'import'), + ); + fixes.push(fixer.insertTextAfter(importKeyword, ' type')); + + return fixes; + }, + }); + }, + }; + }, +}); diff --git a/packages/eslint-plugin/src/rules/no-inferrable-types.ts b/packages/eslint-plugin/src/rules/no-inferrable-types.ts index e77b694cc70..1bc83c07c70 100644 --- a/packages/eslint-plugin/src/rules/no-inferrable-types.ts +++ b/packages/eslint-plugin/src/rules/no-inferrable-types.ts @@ -1,5 +1,7 @@ /* eslint-disable @typescript-eslint/internal/prefer-ast-types-enum */ -import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; + import * as util from '../util'; type Options = [ @@ -145,7 +147,7 @@ export default util.createRule({ } case AST_NODE_TYPES.TSNullKeyword: - return init.type === AST_NODE_TYPES.Literal && init.value === null; + return init.type === AST_NODE_TYPES.Literal && init.value == null; case AST_NODE_TYPES.TSStringKeyword: return ( diff --git a/packages/eslint-plugin/src/rules/no-invalid-this.ts b/packages/eslint-plugin/src/rules/no-invalid-this.ts index 0ea8692e64a..36236d0b4af 100644 --- a/packages/eslint-plugin/src/rules/no-invalid-this.ts +++ b/packages/eslint-plugin/src/rules/no-invalid-this.ts @@ -1,10 +1,12 @@ -import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/utils'; -import { getESLintCoreRule } from '../util/getESLintCoreRule'; -import { - InferOptionsTypeFromRule, - createRule, +import type { TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; + +import type { InferMessageIdsTypeFromRule, + InferOptionsTypeFromRule, } from '../util'; +import { createRule } from '../util'; +import { getESLintCoreRule } from '../util/getESLintCoreRule'; const baseRule = getESLintCoreRule('no-invalid-this'); diff --git a/packages/eslint-plugin/src/rules/no-invalid-void-type.ts b/packages/eslint-plugin/src/rules/no-invalid-void-type.ts index ee20f3eee7e..4071b1306d2 100644 --- a/packages/eslint-plugin/src/rules/no-invalid-void-type.ts +++ b/packages/eslint-plugin/src/rules/no-invalid-void-type.ts @@ -1,4 +1,6 @@ -import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; + import * as util from '../util'; interface Options { @@ -11,7 +13,8 @@ type MessageIds = | 'invalidVoidNotReturnOrGeneric' | 'invalidVoidNotReturn' | 'invalidVoidNotReturnOrThisParam' - | 'invalidVoidNotReturnOrThisParamOrGeneric'; + | 'invalidVoidNotReturnOrThisParamOrGeneric' + | 'invalidVoidUnionConstituent'; export default util.createRule<[Options], MessageIds>({ name: 'no-invalid-void-type', @@ -23,14 +26,16 @@ export default util.createRule<[Options], MessageIds>({ }, messages: { invalidVoidForGeneric: - '{{ generic }} may not have void as a type variable.', + '{{ generic }} may not have void as a type argument.', invalidVoidNotReturnOrGeneric: - 'void is only valid as a return type or generic type variable.', + 'void is only valid as a return type or generic type argument.', invalidVoidNotReturn: 'void is only valid as a return type.', invalidVoidNotReturnOrThisParam: 'void is only valid as return type or type of `this` parameter.', invalidVoidNotReturnOrThisParamOrGeneric: - 'void is only valid as a return type or generic type variable or the type of a `this` parameter.', + 'void is only valid as a return type or generic type argument or the type of a `this` parameter.', + invalidVoidUnionConstituent: + 'void is not valid as a constituent in a union type', }, schema: [ { @@ -125,6 +130,21 @@ export default util.createRule<[Options], MessageIds>({ } } + /** + * @brief checks if the generic type parameter defaults to void + */ + function checkDefaultVoid( + node: TSESTree.TSVoidKeyword, + parentNode: TSESTree.TSTypeParameter, + ): void { + if (parentNode.default !== node) { + context.report({ + messageId: getNotReturnOrGenericMessageId(node), + node, + }); + } + } + /** * @brief checks that a union containing void is valid * @return true if every member of the union is specified as a valid type in @@ -160,6 +180,16 @@ export default util.createRule<[Options], MessageIds>({ return; } + // allow if allowInGenericTypeArguments is specified, and report if the generic type parameter extends void + if ( + allowInGenericTypeArguments && + node.parent.type === AST_NODE_TYPES.TSTypeParameter && + node.parent.default?.type === AST_NODE_TYPES.TSVoidKeyword + ) { + checkDefaultVoid(node, node.parent); + return; + } + // union w/ void must contain types from validUnionMembers, or a valid generic void type if ( node.parent.type === AST_NODE_TYPES.TSUnionType && @@ -191,7 +221,7 @@ export default util.createRule<[Options], MessageIds>({ allowInGenericTypeArguments && allowAsThisParameter ? 'invalidVoidNotReturnOrThisParamOrGeneric' : allowInGenericTypeArguments - ? 'invalidVoidNotReturnOrGeneric' + ? getNotReturnOrGenericMessageId(node) : allowAsThisParameter ? 'invalidVoidNotReturnOrThisParam' : 'invalidVoidNotReturn', @@ -201,3 +231,11 @@ export default util.createRule<[Options], MessageIds>({ }; }, }); + +function getNotReturnOrGenericMessageId( + node: TSESTree.TSVoidKeyword, +): MessageIds { + return node.parent!.type === AST_NODE_TYPES.TSUnionType + ? 'invalidVoidUnionConstituent' + : 'invalidVoidNotReturnOrGeneric'; +} diff --git a/packages/eslint-plugin/src/rules/no-loop-func.ts b/packages/eslint-plugin/src/rules/no-loop-func.ts index 7d4a238f5f4..9e24cef086c 100644 --- a/packages/eslint-plugin/src/rules/no-loop-func.ts +++ b/packages/eslint-plugin/src/rules/no-loop-func.ts @@ -1,6 +1,8 @@ -import { AST_NODE_TYPES, TSESLint, TSESTree } from '@typescript-eslint/utils'; -import { getESLintCoreRule } from '../util/getESLintCoreRule'; +import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; + import * as util from '../util'; +import { getESLintCoreRule } from '../util/getESLintCoreRule'; const baseRule = getESLintCoreRule('no-loop-func'); diff --git a/packages/eslint-plugin/src/rules/no-loss-of-precision.ts b/packages/eslint-plugin/src/rules/no-loss-of-precision.ts index 2e02b187836..2c0d84364e4 100644 --- a/packages/eslint-plugin/src/rules/no-loss-of-precision.ts +++ b/packages/eslint-plugin/src/rules/no-loss-of-precision.ts @@ -1,4 +1,5 @@ -import { TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; + import * as util from '../util'; import { maybeGetESLintCoreRule } from '../util/getESLintCoreRule'; @@ -24,7 +25,7 @@ export default util.createRule({ }, defaultOptions: [], create(context) { - /* istanbul ignore if */ if (baseRule === null) { + /* istanbul ignore if */ if (baseRule == null) { throw new Error( '@typescript-eslint/no-loss-of-precision requires at least ESLint v7.1.0', ); diff --git a/packages/eslint-plugin/src/rules/no-magic-numbers.ts b/packages/eslint-plugin/src/rules/no-magic-numbers.ts index 3307298cb54..604e82d2186 100644 --- a/packages/eslint-plugin/src/rules/no-magic-numbers.ts +++ b/packages/eslint-plugin/src/rules/no-magic-numbers.ts @@ -1,4 +1,6 @@ -import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; + import * as util from '../util'; import { getESLintCoreRule } from '../util/getESLintCoreRule'; diff --git a/packages/eslint-plugin/src/rules/no-meaningless-void-operator.ts b/packages/eslint-plugin/src/rules/no-meaningless-void-operator.ts index e509b186dc8..79d0611e5d0 100644 --- a/packages/eslint-plugin/src/rules/no-meaningless-void-operator.ts +++ b/packages/eslint-plugin/src/rules/no-meaningless-void-operator.ts @@ -1,8 +1,10 @@ -import { ESLintUtils, TSESLint, TSESTree } from '@typescript-eslint/utils'; +import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; +import { ESLintUtils } from '@typescript-eslint/utils'; import * as tsutils from 'tsutils'; -import * as util from '../util'; import * as ts from 'typescript'; +import * as util from '../util'; + type Options = [ { checkNever: boolean; @@ -20,7 +22,6 @@ export default util.createRule< description: 'Disallow the `void` operator except when used to discard a value', recommended: 'strict', - suggestion: true, requiresTypeChecking: true, }, fixable: 'code', diff --git a/packages/eslint-plugin/src/rules/no-misused-new.ts b/packages/eslint-plugin/src/rules/no-misused-new.ts index da5f034c965..7a4dcc69dab 100644 --- a/packages/eslint-plugin/src/rules/no-misused-new.ts +++ b/packages/eslint-plugin/src/rules/no-misused-new.ts @@ -1,4 +1,6 @@ -import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; + import * as util from '../util'; export default util.createRule({ diff --git a/packages/eslint-plugin/src/rules/no-misused-promises.ts b/packages/eslint-plugin/src/rules/no-misused-promises.ts index 89804bf001b..15bf0c501d1 100644 --- a/packages/eslint-plugin/src/rules/no-misused-promises.ts +++ b/packages/eslint-plugin/src/rules/no-misused-promises.ts @@ -1,4 +1,5 @@ -import { AST_NODE_TYPES, TSESLint, TSESTree } from '@typescript-eslint/utils'; +import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; import * as tsutils from 'tsutils'; import * as ts from 'typescript'; @@ -212,13 +213,13 @@ export default util.createRule({ node: TSESTree.CallExpression | TSESTree.NewExpression, ): void { const tsNode = parserServices.esTreeNodeToTSNodeMap.get(node); - const voidParams = voidFunctionParams(checker, tsNode); - if (voidParams.size === 0) { + const voidArgs = voidFunctionArguments(checker, tsNode); + if (voidArgs.size === 0) { return; } for (const [index, argument] of node.arguments.entries()) { - if (!voidParams.has(index)) { + if (!voidArgs.has(index)) { continue; } @@ -249,7 +250,7 @@ export default util.createRule({ function checkVariableDeclaration(node: TSESTree.VariableDeclarator): void { const tsNode = parserServices.esTreeNodeToTSNodeMap.get(node); - if (tsNode.initializer === undefined || node.init === null) { + if (tsNode.initializer === undefined || node.init == null) { return; } const varType = checker.getTypeAtLocation(tsNode.name); @@ -343,7 +344,7 @@ export default util.createRule({ function checkReturnStatement(node: TSESTree.ReturnStatement): void { const tsNode = parserServices.esTreeNodeToTSNodeMap.get(node); - if (tsNode.expression === undefined || node.argument === null) { + if (tsNode.expression === undefined || node.argument == null) { return; } const contextualType = checker.getContextualType(tsNode.expression); @@ -367,7 +368,7 @@ export default util.createRule({ const tsNode = parserServices.esTreeNodeToTSNodeMap.get(node); const value = tsNode.initializer; if ( - node.value === null || + node.value == null || value === undefined || !ts.isJsxExpression(value) || value.expression === undefined @@ -485,13 +486,40 @@ function isFunctionParam( return false; } -// Get the positions of parameters which are void functions (and not also +function checkThenableOrVoidArgument( + checker: ts.TypeChecker, + node: ts.CallExpression | ts.NewExpression, + type: ts.Type, + index: number, + thenableReturnIndices: Set, + voidReturnIndices: Set, +): void { + if (isThenableReturningFunctionType(checker, node.expression, type)) { + thenableReturnIndices.add(index); + } else if (isVoidReturningFunctionType(checker, node.expression, type)) { + // If a certain argument accepts both thenable and void returns, + // a promise-returning function is valid + if (!thenableReturnIndices.has(index)) { + voidReturnIndices.add(index); + } + } +} + +// Get the positions of arguments which are void functions (and not also // thenable functions). These are the candidates for the void-return check at // the current call site. -function voidFunctionParams( +// If the function parameters end with a 'rest' parameter, then we consider +// the array type parameter (e.g. '...args:Array') when determining +// if trailing arguments are candidates. +function voidFunctionArguments( checker: ts.TypeChecker, node: ts.CallExpression | ts.NewExpression, ): Set { + // 'new' can be used without any arguments, as in 'let b = new Object;' + // In this case, there are no argument positions to check, so return early. + if (!node.arguments) { + return new Set(); + } const thenableReturnIndices = new Set(); const voidReturnIndices = new Set(); const type = checker.getTypeAtLocation(node.expression); @@ -506,17 +534,60 @@ function voidFunctionParams( : subType.getConstructSignatures(); for (const signature of signatures) { for (const [index, parameter] of signature.parameters.entries()) { - const type = checker.getTypeOfSymbolAtLocation( + const decl = parameter.valueDeclaration; + let type = checker.getTypeOfSymbolAtLocation( parameter, node.expression, ); - if (isThenableReturningFunctionType(checker, node.expression, type)) { - thenableReturnIndices.add(index); - } else if ( - !thenableReturnIndices.has(index) && - isVoidReturningFunctionType(checker, node.expression, type) - ) { - voidReturnIndices.add(index); + + // If this is a array 'rest' parameter, check all of the argument indices + // from the current argument to the end. + // Note - we currently do not support 'spread' arguments - adding support for them + // is tracked in https://github.com/typescript-eslint/typescript-eslint/issues/5744 + if (decl && ts.isParameter(decl) && decl.dotDotDotToken) { + if (checker.isArrayType(type)) { + // Unwrap 'Array' to 'MaybeVoidFunction', + // so that we'll handle it in the same way as a non-rest + // 'param: MaybeVoidFunction' + type = checker.getTypeArguments(type)[0]; + for (let i = index; i < node.arguments.length; i++) { + checkThenableOrVoidArgument( + checker, + node, + type, + i, + thenableReturnIndices, + voidReturnIndices, + ); + } + } else if (checker.isTupleType(type)) { + // Check each type in the tuple - for example, [boolean, () => void] would + // add the index of the second tuple parameter to 'voidReturnIndices' + const typeArgs = checker.getTypeArguments(type); + for ( + let i = index; + i < node.arguments.length && i - index < typeArgs.length; + i++ + ) { + checkThenableOrVoidArgument( + checker, + node, + typeArgs[i - index], + i, + thenableReturnIndices, + voidReturnIndices, + ); + } + } + } else { + checkThenableOrVoidArgument( + checker, + node, + type, + index, + thenableReturnIndices, + voidReturnIndices, + ); } } } diff --git a/packages/eslint-plugin/src/rules/no-namespace.ts b/packages/eslint-plugin/src/rules/no-namespace.ts index 2a840fda314..2a9a4a251be 100644 --- a/packages/eslint-plugin/src/rules/no-namespace.ts +++ b/packages/eslint-plugin/src/rules/no-namespace.ts @@ -1,4 +1,6 @@ -import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; + import * as util from '../util'; type Options = [ @@ -14,21 +16,25 @@ export default util.createRule({ meta: { type: 'suggestion', docs: { - description: 'Disallow custom TypeScript modules and namespaces', + description: 'Disallow TypeScript namespaces', recommended: 'error', }, messages: { moduleSyntaxIsPreferred: - 'ES2015 module syntax is preferred over custom TypeScript modules and namespaces.', + 'ES2015 module syntax is preferred over namespaces.', }, schema: [ { type: 'object', properties: { allowDeclarations: { + description: + 'Whether to allow `declare` with custom TypeScript namespaces.', type: 'boolean', }, allowDefinitionFiles: { + description: + 'Whether to allow `declare` with custom TypeScript namespaces inside definition files.', type: 'boolean', }, }, diff --git a/packages/eslint-plugin/src/rules/no-non-null-asserted-nullish-coalescing.ts b/packages/eslint-plugin/src/rules/no-non-null-asserted-nullish-coalescing.ts index 518b3e739f2..a79fa4062b1 100644 --- a/packages/eslint-plugin/src/rules/no-non-null-asserted-nullish-coalescing.ts +++ b/packages/eslint-plugin/src/rules/no-non-null-asserted-nullish-coalescing.ts @@ -1,5 +1,8 @@ -import { ASTUtils, TSESTree, TSESLint } from '@typescript-eslint/utils'; -import { Definition, DefinitionType } from '@typescript-eslint/scope-manager'; +import type { Definition } from '@typescript-eslint/scope-manager'; +import { DefinitionType } from '@typescript-eslint/scope-manager'; +import type { TSESLint } from '@typescript-eslint/utils'; +import { ASTUtils, TSESTree } from '@typescript-eslint/utils'; + import * as util from '../util'; function hasAssignmentBeforeNode( @@ -24,7 +27,7 @@ function isDefinitionWithAssignment(definition: Definition): boolean { const variableDeclarator = definition.node; return ( - variableDeclarator.definite === true || variableDeclarator.init !== null + variableDeclarator.definite === true || variableDeclarator.init != null ); } diff --git a/packages/eslint-plugin/src/rules/no-non-null-asserted-optional-chain.ts b/packages/eslint-plugin/src/rules/no-non-null-asserted-optional-chain.ts index 9e1b3c94656..d63b3ad43e3 100644 --- a/packages/eslint-plugin/src/rules/no-non-null-asserted-optional-chain.ts +++ b/packages/eslint-plugin/src/rules/no-non-null-asserted-optional-chain.ts @@ -1,6 +1,8 @@ -import { TSESTree, TSESLint, AST_NODE_TYPES } from '@typescript-eslint/utils'; -import * as ts from 'typescript'; +import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; import * as semver from 'semver'; +import * as ts from 'typescript'; + import * as util from '../util'; const is3dot9 = semver.satisfies( @@ -19,7 +21,6 @@ export default util.createRule({ description: 'Disallow non-null assertions after an optional chain expression', recommended: 'error', - suggestion: true, }, hasSuggestions: true, messages: { diff --git a/packages/eslint-plugin/src/rules/no-non-null-assertion.ts b/packages/eslint-plugin/src/rules/no-non-null-assertion.ts index c92c31e517a..7a11802a737 100644 --- a/packages/eslint-plugin/src/rules/no-non-null-assertion.ts +++ b/packages/eslint-plugin/src/rules/no-non-null-assertion.ts @@ -1,4 +1,6 @@ -import { TSESLint, AST_NODE_TYPES } from '@typescript-eslint/utils'; +import type { TSESLint } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; + import * as util from '../util'; type MessageIds = 'noNonNull' | 'suggestOptionalChain'; @@ -11,7 +13,6 @@ export default util.createRule<[], MessageIds>({ description: 'Disallow non-null assertions using the `!` postfix operator', recommended: 'warn', - suggestion: true, }, hasSuggestions: true, messages: { diff --git a/packages/eslint-plugin/src/rules/no-parameter-properties.ts b/packages/eslint-plugin/src/rules/no-parameter-properties.ts index d510332f0c0..3952dfc581f 100644 --- a/packages/eslint-plugin/src/rules/no-parameter-properties.ts +++ b/packages/eslint-plugin/src/rules/no-parameter-properties.ts @@ -1,4 +1,6 @@ -import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; + import * as util from '../util'; type Modifier = diff --git a/packages/eslint-plugin/src/rules/no-redeclare.ts b/packages/eslint-plugin/src/rules/no-redeclare.ts index d81c5225d08..2b10c97c8e7 100644 --- a/packages/eslint-plugin/src/rules/no-redeclare.ts +++ b/packages/eslint-plugin/src/rules/no-redeclare.ts @@ -1,4 +1,6 @@ -import { TSESTree, TSESLint, AST_NODE_TYPES } from '@typescript-eslint/utils'; +import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; + import * as util from '../util'; type MessageIds = 'redeclared' | 'redeclaredAsBuiltin' | 'redeclaredBySyntax'; diff --git a/packages/eslint-plugin/src/rules/no-redundant-type-constituents.ts b/packages/eslint-plugin/src/rules/no-redundant-type-constituents.ts index 1ee8c3c4959..33237a8ae4e 100644 --- a/packages/eslint-plugin/src/rules/no-redundant-type-constituents.ts +++ b/packages/eslint-plugin/src/rules/no-redundant-type-constituents.ts @@ -1,6 +1,7 @@ -import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils'; import * as tsutils from 'tsutils'; import * as ts from 'typescript'; + import * as util from '../util'; const literalToPrimitiveTypeFlags = { diff --git a/packages/eslint-plugin/src/rules/no-require-imports.ts b/packages/eslint-plugin/src/rules/no-require-imports.ts index ba899d6b704..9abe1250406 100644 --- a/packages/eslint-plugin/src/rules/no-require-imports.ts +++ b/packages/eslint-plugin/src/rules/no-require-imports.ts @@ -1,4 +1,6 @@ -import { ASTUtils, TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; +import { ASTUtils } from '@typescript-eslint/utils'; + import * as util from '../util'; export default util.createRule({ diff --git a/packages/eslint-plugin/src/rules/no-restricted-imports.ts b/packages/eslint-plugin/src/rules/no-restricted-imports.ts index 13afc7a895d..c2c2b54aa72 100644 --- a/packages/eslint-plugin/src/rules/no-restricted-imports.ts +++ b/packages/eslint-plugin/src/rules/no-restricted-imports.ts @@ -1,15 +1,16 @@ -import { TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; import type { ArrayOfStringOrObject, ArrayOfStringOrObjectPatterns, } from 'eslint/lib/rules/no-restricted-imports'; -import ignore, { Ignore } from 'ignore'; -import { - createRule, - deepMerge, +import type { Ignore } from 'ignore'; +import ignore from 'ignore'; + +import type { InferMessageIdsTypeFromRule, InferOptionsTypeFromRule, } from '../util'; +import { createRule, deepMerge } from '../util'; import { getESLintCoreRule } from '../util/getESLintCoreRule'; const baseRule = getESLintCoreRule('no-restricted-imports'); diff --git a/packages/eslint-plugin/src/rules/no-shadow.ts b/packages/eslint-plugin/src/rules/no-shadow.ts index a6b9b7fd735..e9b73370966 100644 --- a/packages/eslint-plugin/src/rules/no-shadow.ts +++ b/packages/eslint-plugin/src/rules/no-shadow.ts @@ -1,15 +1,11 @@ -import { - ASTUtils, - AST_NODE_TYPES, - TSESLint, - TSESTree, -} from '@typescript-eslint/utils'; -import { +import type { Definition, - DefinitionType, ImportBindingDefinition, - ScopeType, } from '@typescript-eslint/scope-manager'; +import { DefinitionType, ScopeType } from '@typescript-eslint/scope-manager'; +import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES, ASTUtils } from '@typescript-eslint/utils'; + import * as util from '../util'; type MessageIds = 'noShadow' | 'noShadowGlobal'; @@ -24,6 +20,12 @@ type Options = [ }, ]; +const allowedFunctionVariableDefTypes = new Set([ + AST_NODE_TYPES.TSCallSignatureDeclaration, + AST_NODE_TYPES.TSFunctionType, + AST_NODE_TYPES.TSMethodSignature, +]); + export default util.createRule({ name: 'no-shadow', meta: { @@ -151,8 +153,9 @@ export default util.createRule({ return false; } - const id = variable.identifiers[0]; - return util.isFunctionType(id.parent); + return variable.defs.every(def => + allowedFunctionVariableDefTypes.has(def.node.type), + ); } function isGenericOfStaticMethod( diff --git a/packages/eslint-plugin/src/rules/no-this-alias.ts b/packages/eslint-plugin/src/rules/no-this-alias.ts index 5750b8209b1..2301bf11a99 100644 --- a/packages/eslint-plugin/src/rules/no-this-alias.ts +++ b/packages/eslint-plugin/src/rules/no-this-alias.ts @@ -1,4 +1,6 @@ -import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; + import * as util from '../util'; type Options = [ @@ -23,9 +25,13 @@ export default util.createRule({ additionalProperties: false, properties: { allowDestructuring: { + description: + 'Whether to ignore destructurings, such as `const { props, state } = this`.', type: 'boolean', }, allowedNames: { + description: + 'Names to ignore, such as ["self"] for `const self = this;`.', type: 'array', items: { type: 'string', diff --git a/packages/eslint-plugin/src/rules/no-throw-literal.ts b/packages/eslint-plugin/src/rules/no-throw-literal.ts index 36522c15398..9f79ea0ff47 100644 --- a/packages/eslint-plugin/src/rules/no-throw-literal.ts +++ b/packages/eslint-plugin/src/rules/no-throw-literal.ts @@ -1,6 +1,8 @@ +import type { TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; import * as ts from 'typescript'; + import * as util from '../util'; -import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/utils'; type MessageIds = 'object' | 'undef'; diff --git a/packages/eslint-plugin/src/rules/no-type-alias.ts b/packages/eslint-plugin/src/rules/no-type-alias.ts index 9c091cd7dde..67d72588f65 100644 --- a/packages/eslint-plugin/src/rules/no-type-alias.ts +++ b/packages/eslint-plugin/src/rules/no-type-alias.ts @@ -1,8 +1,6 @@ -import { - AST_NODE_TYPES, - AST_TOKEN_TYPES, - TSESTree, -} from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES, AST_TOKEN_TYPES } from '@typescript-eslint/utils'; + import * as util from '../util'; type Values = @@ -60,27 +58,36 @@ export default util.createRule({ type: 'object', properties: { allowAliases: { + description: 'Whether to allow direct one-to-one type aliases.', enum: enumValues, }, allowCallbacks: { + description: 'Whether to allow type aliases for callbacks.', enum: ['always', 'never'], }, allowConditionalTypes: { + description: 'Whether to allow type aliases for conditional types.', enum: ['always', 'never'], }, allowConstructors: { + description: 'Whether to allow type aliases with constructors.', enum: ['always', 'never'], }, allowLiterals: { + description: + 'Whether to allow type aliases with object literal types.', enum: enumValues, }, allowMappedTypes: { + description: 'Whether to allow type aliases with mapped types.', enum: enumValues, }, allowTupleTypes: { + description: 'Whether to allow type aliases with tuple types.', enum: enumValues, }, allowGenerics: { + description: 'Whether to allow type aliases with generic types.', enum: ['always', 'never'], }, }, diff --git a/packages/eslint-plugin/src/rules/no-unnecessary-boolean-literal-compare.ts b/packages/eslint-plugin/src/rules/no-unnecessary-boolean-literal-compare.ts index d135b3dd18a..f874905b738 100644 --- a/packages/eslint-plugin/src/rules/no-unnecessary-boolean-literal-compare.ts +++ b/packages/eslint-plugin/src/rules/no-unnecessary-boolean-literal-compare.ts @@ -1,6 +1,8 @@ -import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; import * as tsutils from 'tsutils'; import * as ts from 'typescript'; + import * as util from '../util'; type MessageIds = @@ -56,9 +58,13 @@ export default util.createRule({ type: 'object', properties: { allowComparingNullableBooleansToTrue: { + description: + 'Whether to allow comparisons between nullable boolean variables and `true`.', type: 'boolean', }, allowComparingNullableBooleansToFalse: { + description: + 'Whether to allow comparisons between nullable boolean variables and `false`.', type: 'boolean', }, }, diff --git a/packages/eslint-plugin/src/rules/no-unnecessary-condition.ts b/packages/eslint-plugin/src/rules/no-unnecessary-condition.ts index df6580be86a..42f12748af9 100644 --- a/packages/eslint-plugin/src/rules/no-unnecessary-condition.ts +++ b/packages/eslint-plugin/src/rules/no-unnecessary-condition.ts @@ -1,30 +1,28 @@ +import type { TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES, AST_TOKEN_TYPES } from '@typescript-eslint/utils'; import { - TSESTree, - AST_NODE_TYPES, - AST_TOKEN_TYPES, -} from '@typescript-eslint/utils'; -import * as ts from 'typescript'; -import { - unionTypeParts, - isFalsyType, + getCallSignaturesOfType, isBooleanLiteralType, + isFalsyType, isLiteralType, - getCallSignaturesOfType, isStrictCompilerOptionEnabled, + unionTypeParts, } from 'tsutils'; +import * as ts from 'typescript'; + import { - isTypeFlagSet, createRule, - getParserServices, getConstrainedTypeAtLocation, + getParserServices, + getTypeName, getTypeOfPropertyOfName, - isNullableType, - nullThrows, - NullThrowsReasons, isIdentifier, + isNullableType, isTypeAnyType, + isTypeFlagSet, isTypeUnknownType, - getTypeName, + nullThrows, + NullThrowsReasons, } from '../util'; // Truthiness utilities @@ -98,9 +96,13 @@ export default createRule({ type: 'object', properties: { allowConstantLoopConditions: { + description: + 'Whether to ignore constant loop conditions, such as `while (true)`.', type: 'boolean', }, allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing: { + description: + 'Whether to not error when running with a tsconfig that has strictNullChecks turned.', type: 'boolean', }, }, @@ -328,6 +330,7 @@ export default createRule({ if (isStrictNullChecks) { const UNDEFINED = ts.TypeFlags.Undefined; const NULL = ts.TypeFlags.Null; + const VOID = ts.TypeFlags.Void; const isComparable = (type: ts.Type, flag: ts.TypeFlags): boolean => { // Allow comparison to `any`, `unknown` or a naked type parameter. flag |= @@ -337,7 +340,7 @@ export default createRule({ // Allow loose comparison to nullish values. if (node.operator === '==' || node.operator === '!=') { - flag |= NULL | UNDEFINED; + flag |= NULL | UNDEFINED | VOID; } return isTypeFlagSet(type, flag); @@ -345,9 +348,9 @@ export default createRule({ if ( (leftType.flags === UNDEFINED && - !isComparable(rightType, UNDEFINED)) || + !isComparable(rightType, UNDEFINED | VOID)) || (rightType.flags === UNDEFINED && - !isComparable(leftType, UNDEFINED)) || + !isComparable(leftType, UNDEFINED | VOID)) || (leftType.flags === NULL && !isComparable(rightType, NULL)) || (rightType.flags === NULL && !isComparable(leftType, NULL)) ) { @@ -381,7 +384,7 @@ export default createRule({ | TSESTree.ForStatement | TSESTree.WhileStatement, ): void { - if (node.test === null) { + if (node.test == null) { // e.g. `for(;;)` return; } @@ -551,7 +554,12 @@ export default createRule({ type, property.name, ); - return propType && isNullableType(propType, { allowUndefined: true }); + + if (propType) { + return isNullableType(propType, { allowUndefined: true }); + } + + return !!checker.getIndexInfoOfType(type, ts.IndexKind.String); }); return ( !isOwnNullable && isNullableType(prevType, { allowUndefined: true }) @@ -560,9 +568,7 @@ export default createRule({ return false; } - function isOptionableExpression( - node: TSESTree.LeftHandSideExpression, - ): boolean { + function isOptionableExpression(node: TSESTree.Expression): boolean { const type = getNodeType(node); const isOwnNullable = node.type === AST_NODE_TYPES.MemberExpression diff --git a/packages/eslint-plugin/src/rules/no-unnecessary-qualifier.ts b/packages/eslint-plugin/src/rules/no-unnecessary-qualifier.ts index f56aa2660b3..632ad6c5ba0 100644 --- a/packages/eslint-plugin/src/rules/no-unnecessary-qualifier.ts +++ b/packages/eslint-plugin/src/rules/no-unnecessary-qualifier.ts @@ -1,6 +1,8 @@ -import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils'; -import * as ts from 'typescript'; +import type { TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; import * as tsutils from 'tsutils'; +import * as ts from 'typescript'; + import * as util from '../util'; export default util.createRule({ @@ -51,7 +53,7 @@ export default util.createRule({ const alias = tryGetAliasedSymbol(symbol, checker); - return alias !== null && symbolIsNamespaceInScope(alias); + return alias != null && symbolIsNamespaceInScope(alias); } function getSymbolInScope( diff --git a/packages/eslint-plugin/src/rules/no-unnecessary-type-arguments.ts b/packages/eslint-plugin/src/rules/no-unnecessary-type-arguments.ts index 4a8acc9bd1c..6d300b36fe1 100644 --- a/packages/eslint-plugin/src/rules/no-unnecessary-type-arguments.ts +++ b/packages/eslint-plugin/src/rules/no-unnecessary-type-arguments.ts @@ -1,6 +1,7 @@ -import { TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; import * as tsutils from 'tsutils'; import * as ts from 'typescript'; + import * as util from '../util'; import { findFirstResult } from '../util'; diff --git a/packages/eslint-plugin/src/rules/no-unnecessary-type-assertion.ts b/packages/eslint-plugin/src/rules/no-unnecessary-type-assertion.ts index d9ef180abd5..38248f31123 100644 --- a/packages/eslint-plugin/src/rules/no-unnecessary-type-assertion.ts +++ b/packages/eslint-plugin/src/rules/no-unnecessary-type-assertion.ts @@ -1,12 +1,14 @@ -import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; import { - isObjectType, isObjectFlagSet, + isObjectType, isStrictCompilerOptionEnabled, isTypeFlagSet, isVariableDeclaration, } from 'tsutils'; import * as ts from 'typescript'; + import * as util from '../util'; type Options = [ @@ -37,6 +39,7 @@ export default util.createRule({ type: 'object', properties: { typesToIgnore: { + description: 'A list of type names to ignore.', type: 'array', items: { type: 'string', diff --git a/packages/eslint-plugin/src/rules/no-unnecessary-type-constraint.ts b/packages/eslint-plugin/src/rules/no-unnecessary-type-constraint.ts index bb1c9333c9b..a337200a9a7 100644 --- a/packages/eslint-plugin/src/rules/no-unnecessary-type-constraint.ts +++ b/packages/eslint-plugin/src/rules/no-unnecessary-type-constraint.ts @@ -1,6 +1,8 @@ -import { AST_NODE_TYPES, TSESTree, TSESLint } from '@typescript-eslint/utils'; +import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; import * as semver from 'semver'; import * as ts from 'typescript'; + import * as util from '../util'; type MakeRequired = Omit & @@ -31,7 +33,6 @@ export default util.createRule({ docs: { description: 'Disallow unnecessary constraints on generic types', recommended: 'error', - suggestion: true, }, hasSuggestions: true, messages: { @@ -89,6 +90,9 @@ export default util.createRule({ suggest: [ { messageId: 'removeUnnecessaryConstraint', + data: { + constraint, + }, fix(fixer): TSESLint.RuleFix | null { return fixer.replaceTextRange( [node.name.range[1], node.constraint.range[1]], diff --git a/packages/eslint-plugin/src/rules/no-unsafe-argument.ts b/packages/eslint-plugin/src/rules/no-unsafe-argument.ts index 867b9c94627..b5aced4d68c 100644 --- a/packages/eslint-plugin/src/rules/no-unsafe-argument.ts +++ b/packages/eslint-plugin/src/rules/no-unsafe-argument.ts @@ -1,5 +1,7 @@ -import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; import * as ts from 'typescript'; + import * as util from '../util'; type MessageIds = @@ -142,7 +144,7 @@ export default util.createRule<[], MessageIds>({ unsafeArgument: 'Unsafe argument of type `{{sender}}` assigned to a parameter of type `{{receiver}}`.', unsafeTupleSpread: - 'Unsafe spread of a tuple type. The {{index}} element is of type `{{sender}}` and is assigned to a parameter of type `{{reciever}}`.', + 'Unsafe spread of a tuple type. The argument is of type `{{sender}}` and is assigned to a parameter of type `{{receiver}}`.', unsafeArraySpread: 'Unsafe spread of an `any` array type.', unsafeSpread: 'Unsafe spread of an `any` type.', }, diff --git a/packages/eslint-plugin/src/rules/no-unsafe-assignment.ts b/packages/eslint-plugin/src/rules/no-unsafe-assignment.ts index 00f60c6f2ac..4833d84a84c 100644 --- a/packages/eslint-plugin/src/rules/no-unsafe-assignment.ts +++ b/packages/eslint-plugin/src/rules/no-unsafe-assignment.ts @@ -1,6 +1,8 @@ -import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; import * as tsutils from 'tsutils'; -import * as ts from 'typescript'; +import type * as ts from 'typescript'; + import * as util from '../util'; import { getThisExpression } from '../util'; diff --git a/packages/eslint-plugin/src/rules/no-unsafe-call.ts b/packages/eslint-plugin/src/rules/no-unsafe-call.ts index 799bba94295..dfa6fa2fb4c 100644 --- a/packages/eslint-plugin/src/rules/no-unsafe-call.ts +++ b/packages/eslint-plugin/src/rules/no-unsafe-call.ts @@ -1,5 +1,6 @@ -import { TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; import * as tsutils from 'tsutils'; + import * as util from '../util'; import { getThisExpression } from '../util'; diff --git a/packages/eslint-plugin/src/rules/no-unsafe-declaration-merging.ts b/packages/eslint-plugin/src/rules/no-unsafe-declaration-merging.ts new file mode 100644 index 00000000000..89d68db6e67 --- /dev/null +++ b/packages/eslint-plugin/src/rules/no-unsafe-declaration-merging.ts @@ -0,0 +1,73 @@ +import type { Scope } from '@typescript-eslint/scope-manager'; +import type { TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; + +import * as util from '../util'; + +export default util.createRule({ + name: 'no-unsafe-declaration-merging', + meta: { + type: 'problem', + docs: { + description: 'Disallow unsafe declaration merging', + recommended: 'strict', + requiresTypeChecking: false, + }, + messages: { + unsafeMerging: + 'Unsafe declaration merging between classes and interfaces.', + }, + schema: [], + }, + defaultOptions: [], + create(context) { + function checkUnsafeDeclaration( + scope: Scope, + node: TSESTree.Identifier, + unsafeKind: AST_NODE_TYPES, + ): void { + const variable = scope.set.get(node.name); + if (!variable) { + return; + } + + const defs = variable.defs; + if (defs.length <= 1) { + return; + } + + if (defs.some(def => def.node.type === unsafeKind)) { + context.report({ + node, + messageId: 'unsafeMerging', + }); + } + } + + return { + ClassDeclaration(node): void { + if (node.id) { + // by default eslint returns the inner class scope for the ClassDeclaration node + // but we want the outer scope within which merged variables will sit + const currentScope = context.getScope().upper; + if (currentScope == null) { + return; + } + + checkUnsafeDeclaration( + currentScope, + node.id, + AST_NODE_TYPES.TSInterfaceDeclaration, + ); + } + }, + TSInterfaceDeclaration(node): void { + checkUnsafeDeclaration( + context.getScope(), + node.id, + AST_NODE_TYPES.ClassDeclaration, + ); + }, + }; + }, +}); diff --git a/packages/eslint-plugin/src/rules/no-unsafe-member-access.ts b/packages/eslint-plugin/src/rules/no-unsafe-member-access.ts index c3d55e3a5bc..410ff78f545 100644 --- a/packages/eslint-plugin/src/rules/no-unsafe-member-access.ts +++ b/packages/eslint-plugin/src/rules/no-unsafe-member-access.ts @@ -1,5 +1,7 @@ -import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; import * as tsutils from 'tsutils'; + import * as util from '../util'; import { getThisExpression } from '../util'; diff --git a/packages/eslint-plugin/src/rules/no-unsafe-return.ts b/packages/eslint-plugin/src/rules/no-unsafe-return.ts index d313d183726..63d60ff81f8 100644 --- a/packages/eslint-plugin/src/rules/no-unsafe-return.ts +++ b/packages/eslint-plugin/src/rules/no-unsafe-return.ts @@ -1,5 +1,7 @@ -import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; import * as tsutils from 'tsutils'; + import * as util from '../util'; import { getThisExpression } from '../util'; diff --git a/packages/eslint-plugin/src/rules/no-unused-expressions.ts b/packages/eslint-plugin/src/rules/no-unused-expressions.ts index 56eb1521a0d..96830736f9d 100644 --- a/packages/eslint-plugin/src/rules/no-unused-expressions.ts +++ b/packages/eslint-plugin/src/rules/no-unused-expressions.ts @@ -1,6 +1,8 @@ -import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils'; -import { getESLintCoreRule } from '../util/getESLintCoreRule'; +import type { TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; + import * as util from '../util'; +import { getESLintCoreRule } from '../util/getESLintCoreRule'; const baseRule = getESLintCoreRule('no-unused-expressions'); diff --git a/packages/eslint-plugin/src/rules/no-unused-vars.ts b/packages/eslint-plugin/src/rules/no-unused-vars.ts index fb16cf5786e..77da885048d 100644 --- a/packages/eslint-plugin/src/rules/no-unused-vars.ts +++ b/packages/eslint-plugin/src/rules/no-unused-vars.ts @@ -1,5 +1,7 @@ -import { AST_NODE_TYPES, TSESLint, TSESTree } from '@typescript-eslint/utils'; import { PatternVisitor } from '@typescript-eslint/scope-manager'; +import type { TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES, TSESLint } from '@typescript-eslint/utils'; + import * as util from '../util'; export type MessageIds = 'unusedVar'; @@ -82,7 +84,7 @@ export default util.createRule({ }, }, defaultOptions: [{}], - create(context) { + create(context, [firstOption]) { const filename = context.getFilename(); const sourceCode = context.getSourceCode(); const MODULE_DECL_CACHE = new Map(); @@ -95,8 +97,6 @@ export default util.createRule({ caughtErrors: 'none', }; - const [firstOption] = context.options; - if (firstOption) { if (typeof firstOption === 'string') { options.vars = firstOption; diff --git a/packages/eslint-plugin/src/rules/no-use-before-define.ts b/packages/eslint-plugin/src/rules/no-use-before-define.ts index 3a5b51938b7..b88cd82d39d 100644 --- a/packages/eslint-plugin/src/rules/no-use-before-define.ts +++ b/packages/eslint-plugin/src/rules/no-use-before-define.ts @@ -1,5 +1,7 @@ -import { AST_NODE_TYPES, TSESLint, TSESTree } from '@typescript-eslint/utils'; import { DefinitionType } from '@typescript-eslint/scope-manager'; +import type { TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES, TSESLint } from '@typescript-eslint/utils'; + import * as util from '../util'; const SENTINEL_TYPE = @@ -15,16 +17,18 @@ function parseOptions(options: string | Config | null): Required { let variables = true; let typedefs = true; let ignoreTypeReferences = true; + let allowNamedExports = false; if (typeof options === 'string') { functions = options !== 'nofunc'; - } else if (typeof options === 'object' && options !== null) { + } else if (typeof options === 'object' && options != null) { functions = options.functions !== false; classes = options.classes !== false; enums = options.enums !== false; variables = options.variables !== false; typedefs = options.typedefs !== false; ignoreTypeReferences = options.ignoreTypeReferences !== false; + allowNamedExports = options.allowNamedExports !== false; } return { @@ -34,6 +38,7 @@ function parseOptions(options: string | Config | null): Required { variables, typedefs, ignoreTypeReferences, + allowNamedExports, }; } @@ -59,7 +64,7 @@ function isOuterEnum( reference: TSESLint.Scope.Reference, ): boolean { return ( - variable.defs[0].type == DefinitionType.TSEnumName && + variable.defs[0].type === DefinitionType.TSEnumName && variable.scope.variableScope !== reference.from.variableScope ); } @@ -90,6 +95,17 @@ function isOuterVariable( ); } +/** + * Checks whether or not a given reference is a export reference. + */ +function isNamedExports(reference: TSESLint.Scope.Reference): boolean { + const { identifier } = reference; + return ( + identifier.parent?.type === AST_NODE_TYPES.ExportSpecifier && + identifier.parent.local === identifier + ); +} + /** * Recursively checks whether or not a given reference has a type query declaration among it's parents */ @@ -218,6 +234,7 @@ interface Config { variables?: boolean; typedefs?: boolean; ignoreTypeReferences?: boolean; + allowNamedExports?: boolean; } type Options = ['nofunc' | Config]; type MessageIds = 'noUseBeforeDefine'; @@ -249,6 +266,7 @@ export default util.createRule({ variables: { type: 'boolean' }, typedefs: { type: 'boolean' }, ignoreTypeReferences: { type: 'boolean' }, + allowNamedExports: { type: 'boolean' }, }, additionalProperties: false, }, @@ -264,6 +282,7 @@ export default util.createRule({ variables: true, typedefs: true, ignoreTypeReferences: true, + allowNamedExports: false, }, ], create(context, optionsWithDefault) { @@ -300,6 +319,16 @@ export default util.createRule({ return true; } + function isDefinedBeforeUse( + variable: TSESLint.Scope.Variable, + reference: TSESLint.Scope.Reference, + ): boolean { + return ( + variable.identifiers[0].range[1] <= reference.identifier.range[1] && + !isInInitializer(variable, reference) + ); + } + /** * Finds and validates all variables in a given scope. */ @@ -307,18 +336,40 @@ export default util.createRule({ scope.references.forEach(reference => { const variable = reference.resolved; + function report(): void { + context.report({ + node: reference.identifier, + messageId: 'noUseBeforeDefine', + data: { + name: reference.identifier.name, + }, + }); + } + // Skips when the reference is: // - initializations. // - referring to an undefined variable. // - referring to a global environment variable (there're no identifiers). // - located preceded by the variable (except in initializers). // - allowed by options. + if (reference.init) { + return; + } + + if (!options.allowNamedExports && isNamedExports(reference)) { + if (!variable || !isDefinedBeforeUse(variable, reference)) { + report(); + } + return; + } + + if (!variable) { + return; + } + if ( - reference.init || - !variable || variable.identifiers.length === 0 || - (variable.identifiers[0].range[1] <= reference.identifier.range[1] && - !isInInitializer(variable, reference)) || + isDefinedBeforeUse(variable, reference) || !isForbidden(variable, reference) || isClassRefInClassDecorator(variable, reference) || reference.from.type === TSESLint.Scope.ScopeType.functionType @@ -327,13 +378,7 @@ export default util.createRule({ } // Reports. - context.report({ - node: reference.identifier, - messageId: 'noUseBeforeDefine', - data: { - name: reference.identifier.name, - }, - }); + report(); }); scope.childScopes.forEach(findVariablesInScope); diff --git a/packages/eslint-plugin/src/rules/no-useless-constructor.ts b/packages/eslint-plugin/src/rules/no-useless-constructor.ts index 10e55cfbe0e..98fcc9631c5 100644 --- a/packages/eslint-plugin/src/rules/no-useless-constructor.ts +++ b/packages/eslint-plugin/src/rules/no-useless-constructor.ts @@ -1,6 +1,8 @@ -import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/utils'; -import { getESLintCoreRule } from '../util/getESLintCoreRule'; +import type { TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; + import * as util from '../util'; +import { getESLintCoreRule } from '../util/getESLintCoreRule'; const baseRule = getESLintCoreRule('no-useless-constructor'); @@ -31,14 +33,13 @@ function checkAccessibility(node: TSESTree.MethodDefinition): boolean { } /** - * Check if method is not unless due to typescript parameter properties + * Check if method is not useless due to typescript parameter properties and decorators */ function checkParams(node: TSESTree.MethodDefinition): boolean { - return ( - !node.value.params || - !node.value.params.some( - param => param.type === AST_NODE_TYPES.TSParameterProperty, - ) + return !node.value.params.some( + param => + param.type === AST_NODE_TYPES.TSParameterProperty || + param.decorators?.length, ); } diff --git a/packages/eslint-plugin/src/rules/no-useless-empty-export.ts b/packages/eslint-plugin/src/rules/no-useless-empty-export.ts index c06c47b8f8e..e671fbf5b1d 100644 --- a/packages/eslint-plugin/src/rules/no-useless-empty-export.ts +++ b/packages/eslint-plugin/src/rules/no-useless-empty-export.ts @@ -1,4 +1,6 @@ -import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; + import * as util from '../util'; function isEmptyExport( @@ -28,10 +30,9 @@ export default util.createRule({ description: "Disallow empty exports that don't change anything in a module file", recommended: false, - suggestion: true, }, fixable: 'code', - hasSuggestions: true, + hasSuggestions: false, messages: { uselessExport: 'Empty export does nothing and can be removed.', }, diff --git a/packages/eslint-plugin/src/rules/no-var-requires.ts b/packages/eslint-plugin/src/rules/no-var-requires.ts index 9942b2108ce..dedc42cf30f 100644 --- a/packages/eslint-plugin/src/rules/no-var-requires.ts +++ b/packages/eslint-plugin/src/rules/no-var-requires.ts @@ -1,4 +1,6 @@ -import { ASTUtils, AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES, ASTUtils } from '@typescript-eslint/utils'; + import * as util from '../util'; type Options = []; diff --git a/packages/eslint-plugin/src/rules/non-nullable-type-assertion-style.ts b/packages/eslint-plugin/src/rules/non-nullable-type-assertion-style.ts index ce160c66e07..4953cf8041e 100644 --- a/packages/eslint-plugin/src/rules/non-nullable-type-assertion-style.ts +++ b/packages/eslint-plugin/src/rules/non-nullable-type-assertion-style.ts @@ -1,4 +1,5 @@ -import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; import * as tsutils from 'tsutils'; import * as ts from 'typescript'; @@ -11,7 +12,6 @@ export default util.createRule({ description: 'Enforce non-null assertions over explicit type casts', recommended: 'strict', requiresTypeChecking: true, - suggestion: true, }, fixable: 'code', messages: { diff --git a/packages/eslint-plugin/src/rules/object-curly-spacing.ts b/packages/eslint-plugin/src/rules/object-curly-spacing.ts index c64ca54ba17..1c1c737c842 100644 --- a/packages/eslint-plugin/src/rules/object-curly-spacing.ts +++ b/packages/eslint-plugin/src/rules/object-curly-spacing.ts @@ -1,17 +1,17 @@ -import { - AST_NODE_TYPES, - AST_TOKEN_TYPES, - TSESTree, -} from '@typescript-eslint/utils'; -import { getESLintCoreRule } from '../util/getESLintCoreRule'; -import { - createRule, +import type { TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES, AST_TOKEN_TYPES } from '@typescript-eslint/utils'; + +import type { InferMessageIdsTypeFromRule, InferOptionsTypeFromRule, +} from '../util'; +import { + createRule, isClosingBraceToken, isClosingBracketToken, isTokenOnSameLine, } from '../util'; +import { getESLintCoreRule } from '../util/getESLintCoreRule'; const baseRule = getESLintCoreRule('object-curly-spacing'); @@ -20,6 +20,7 @@ export type MessageIds = InferMessageIdsTypeFromRule; export default createRule({ name: 'object-curly-spacing', + // eslint-disable-next-line eslint-plugin/prefer-message-ids,eslint-plugin/require-meta-type,eslint-plugin/require-meta-schema,eslint-plugin/require-meta-fixable -- all in base rule - https://github.com/not-an-aardvark/eslint-plugin-eslint-plugin/issues/274 meta: { ...baseRule.meta, docs: { @@ -30,6 +31,7 @@ export default createRule({ }, defaultOptions: ['never'], create(context) { + // eslint-disable-next-line no-restricted-syntax -- Use raw options for extended rules. const [firstOption, secondOption] = context.options; const spaced = firstOption === 'always'; const sourceCode = context.getSourceCode(); diff --git a/packages/eslint-plugin/src/rules/padding-line-between-statements.ts b/packages/eslint-plugin/src/rules/padding-line-between-statements.ts index e9d62632c82..f9b97096afc 100644 --- a/packages/eslint-plugin/src/rules/padding-line-between-statements.ts +++ b/packages/eslint-plugin/src/rules/padding-line-between-statements.ts @@ -1,4 +1,6 @@ -import { AST_NODE_TYPES, TSESLint, TSESTree } from '@typescript-eslint/utils'; +import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; + import * as util from '../util'; /** @@ -592,9 +594,9 @@ export default util.createRule({ extendsBaseRule: true, }, fixable: 'whitespace', - hasSuggestions: true, + hasSuggestions: false, schema: { - definitions: { + $defs: { paddingType: { enum: Object.keys(PaddingTypes), }, @@ -615,9 +617,9 @@ export default util.createRule({ items: { type: 'object', properties: { - blankLine: { $ref: '#/definitions/paddingType' }, - prev: { $ref: '#/definitions/statementType' }, - next: { $ref: '#/definitions/statementType' }, + blankLine: { $ref: '#/$defs/paddingType' }, + prev: { $ref: '#/$defs/statementType' }, + next: { $ref: '#/$defs/statementType' }, }, additionalProperties: false, required: ['blankLine', 'prev', 'next'], @@ -632,6 +634,7 @@ export default util.createRule({ defaultOptions: [], create(context) { const sourceCode = context.getSourceCode(); + // eslint-disable-next-line no-restricted-syntax -- We need all raw options. const configureList = context.options || []; type Scope = null | { diff --git a/packages/eslint-plugin/src/rules/parameter-properties.ts b/packages/eslint-plugin/src/rules/parameter-properties.ts index 58d83408897..32547d9650f 100644 --- a/packages/eslint-plugin/src/rules/parameter-properties.ts +++ b/packages/eslint-plugin/src/rules/parameter-properties.ts @@ -1,4 +1,6 @@ -import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; + import * as util from '../util'; type Modifier = @@ -36,32 +38,40 @@ export default util.createRule({ preferParameterProperty: 'Property {{parameter}} should be declared as a parameter property.', }, - schema: [ - { - type: 'object', - properties: { - allow: { - type: 'array', - items: { - enum: [ - 'readonly', - 'private', - 'protected', - 'public', - 'private readonly', - 'protected readonly', - 'public readonly', - ], + schema: { + $defs: { + modifier: { + enum: [ + 'readonly', + 'private', + 'protected', + 'public', + 'private readonly', + 'protected readonly', + 'public readonly', + ], + }, + }, + prefixItems: [ + { + type: 'object', + properties: { + allow: { + type: 'array', + items: { + $ref: '#/$defs/modifier', + }, + minItems: 1, + }, + prefer: { + enum: ['class-property', 'parameter-property'], }, - minItems: 1, - }, - prefer: { - enum: ['class-property', 'parameter-property'], }, + additionalProperties: false, }, - additionalProperties: false, - }, - ], + ], + type: 'array', + }, }, defaultOptions: [ { diff --git a/packages/eslint-plugin/src/rules/prefer-as-const.ts b/packages/eslint-plugin/src/rules/prefer-as-const.ts index ca6b9921656..b8cc483d6ee 100644 --- a/packages/eslint-plugin/src/rules/prefer-as-const.ts +++ b/packages/eslint-plugin/src/rules/prefer-as-const.ts @@ -1,4 +1,6 @@ -import { AST_NODE_TYPES, TSESLint, TSESTree } from '@typescript-eslint/utils'; +import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; + import * as util from '../util'; export default util.createRule({ @@ -8,7 +10,6 @@ export default util.createRule({ docs: { description: 'Enforce the use of `as const` over literal type', recommended: 'error', - suggestion: true, }, fixable: 'code', hasSuggestions: true, @@ -65,6 +66,11 @@ export default util.createRule({ TSTypeAssertion(node): void { compareTypes(node.expression, node.typeAnnotation, true); }, + PropertyDefinition(node): void { + if (node.value && node.typeAnnotation) { + compareTypes(node.value, node.typeAnnotation.typeAnnotation, false); + } + }, VariableDeclarator(node): void { if (node.init && node.id.typeAnnotation) { compareTypes(node.init, node.id.typeAnnotation.typeAnnotation, false); diff --git a/packages/eslint-plugin/src/rules/prefer-enum-initializers.ts b/packages/eslint-plugin/src/rules/prefer-enum-initializers.ts index bad327a5be2..c852d9fdd57 100644 --- a/packages/eslint-plugin/src/rules/prefer-enum-initializers.ts +++ b/packages/eslint-plugin/src/rules/prefer-enum-initializers.ts @@ -1,4 +1,5 @@ -import { TSESLint, TSESTree } from '@typescript-eslint/utils'; +import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; + import * as util from '../util'; type MessageIds = 'defineInitializer' | 'defineInitializerSuggestion'; @@ -11,7 +12,6 @@ export default util.createRule<[], MessageIds>({ description: 'Require each enum member value to be explicitly initialized', recommended: false, - suggestion: true, }, hasSuggestions: true, messages: { diff --git a/packages/eslint-plugin/src/rules/prefer-for-of.ts b/packages/eslint-plugin/src/rules/prefer-for-of.ts index c5cde3227bc..ddde074a234 100644 --- a/packages/eslint-plugin/src/rules/prefer-for-of.ts +++ b/packages/eslint-plugin/src/rules/prefer-for-of.ts @@ -1,4 +1,6 @@ -import { AST_NODE_TYPES, TSESLint, TSESTree } from '@typescript-eslint/utils'; +import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; + import * as util from '../util'; export default util.createRule({ @@ -22,8 +24,7 @@ export default util.createRule({ node: TSESTree.Node | null, ): node is TSESTree.VariableDeclaration { return ( - node !== null && - node.type === AST_NODE_TYPES.VariableDeclaration && + node?.type === AST_NODE_TYPES.VariableDeclaration && node.kind !== 'const' && node.declarations.length === 1 ); @@ -37,7 +38,7 @@ export default util.createRule({ } function isZeroInitialized(node: TSESTree.VariableDeclarator): boolean { - return node.init !== null && isLiteral(node.init, 0); + return node.init != null && isLiteral(node.init, 0); } function isMatchingIdentifier( @@ -52,8 +53,7 @@ export default util.createRule({ name: string, ): TSESTree.Expression | null { if ( - node !== null && - node.type === AST_NODE_TYPES.BinaryExpression && + node?.type === AST_NODE_TYPES.BinaryExpression && node.operator === '<' && isMatchingIdentifier(node.left, name) && node.right.type === AST_NODE_TYPES.MemberExpression && diff --git a/packages/eslint-plugin/src/rules/prefer-function-type.ts b/packages/eslint-plugin/src/rules/prefer-function-type.ts index b5d2875e01c..db5dde69d00 100644 --- a/packages/eslint-plugin/src/rules/prefer-function-type.ts +++ b/packages/eslint-plugin/src/rules/prefer-function-type.ts @@ -1,9 +1,6 @@ -import { - AST_NODE_TYPES, - AST_TOKEN_TYPES, - TSESLint, - TSESTree, -} from '@typescript-eslint/utils'; +import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES, AST_TOKEN_TYPES } from '@typescript-eslint/utils'; + import * as util from '../util'; export const phrases = { @@ -85,8 +82,7 @@ export default util.createRule({ typeof member.returnType !== 'undefined' ) { if ( - tsThisTypes !== null && - tsThisTypes.length > 0 && + tsThisTypes?.length && node.type === AST_NODE_TYPES.TSInterfaceDeclaration ) { // the message can be confusing if we don't point directly to the `this` node instead of the whole member @@ -208,7 +204,7 @@ export default util.createRule({ // inside an interface keep track of all ThisType references. // unless it's inside a nested type literal in which case it's invalid code anyway // we don't want to incorrectly say "it refers to name" while typescript says it's completely invalid. - if (literalNesting === 0 && tsThisTypes !== null) { + if (literalNesting === 0 && tsThisTypes != null) { tsThisTypes.push(node); } }, diff --git a/packages/eslint-plugin/src/rules/prefer-includes.ts b/packages/eslint-plugin/src/rules/prefer-includes.ts index 0c07617b9dd..720d5fbe809 100644 --- a/packages/eslint-plugin/src/rules/prefer-includes.ts +++ b/packages/eslint-plugin/src/rules/prefer-includes.ts @@ -1,11 +1,14 @@ -import { AST_NODE_TYPES, TSESLint, TSESTree } from '@typescript-eslint/utils'; -import { AST as RegExpAST, parseRegExpLiteral } from 'regexpp'; +import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; +import type { AST as RegExpAST } from 'regexpp'; +import { parseRegExpLiteral } from 'regexpp'; import * as ts from 'typescript'; + import { createRule, + getConstrainedTypeAtLocation, getParserServices, getStaticValue, - getConstrainedTypeAtLocation, } from '../util'; export default createRule({ @@ -35,7 +38,7 @@ export default createRule({ function isNumber(node: TSESTree.Node, value: number): boolean { const evaluated = getStaticValue(node, globalScope); - return evaluated !== null && evaluated.value === value; + return evaluated != null && evaluated.value === value; } function isPositiveCheck(node: TSESTree.BinaryExpression): boolean { diff --git a/packages/eslint-plugin/src/rules/prefer-literal-enum-member.ts b/packages/eslint-plugin/src/rules/prefer-literal-enum-member.ts index 625c11627f8..ba659d1c40e 100644 --- a/packages/eslint-plugin/src/rules/prefer-literal-enum-member.ts +++ b/packages/eslint-plugin/src/rules/prefer-literal-enum-member.ts @@ -1,4 +1,5 @@ import { AST_NODE_TYPES } from '@typescript-eslint/utils'; + import { createRule } from '../util'; export default createRule({ diff --git a/packages/eslint-plugin/src/rules/prefer-namespace-keyword.ts b/packages/eslint-plugin/src/rules/prefer-namespace-keyword.ts index bf74d5bf13e..b40b62f3815 100644 --- a/packages/eslint-plugin/src/rules/prefer-namespace-keyword.ts +++ b/packages/eslint-plugin/src/rules/prefer-namespace-keyword.ts @@ -1,4 +1,5 @@ import { AST_NODE_TYPES, AST_TOKEN_TYPES } from '@typescript-eslint/utils'; + import * as util from '../util'; export default util.createRule({ diff --git a/packages/eslint-plugin/src/rules/prefer-nullish-coalescing.ts b/packages/eslint-plugin/src/rules/prefer-nullish-coalescing.ts index b2321fd0757..14157427efa 100644 --- a/packages/eslint-plugin/src/rules/prefer-nullish-coalescing.ts +++ b/packages/eslint-plugin/src/rules/prefer-nullish-coalescing.ts @@ -1,24 +1,24 @@ -import { - AST_NODE_TYPES, - AST_TOKEN_TYPES, - TSESLint, - TSESTree, -} from '@typescript-eslint/utils'; -import * as util from '../util'; +import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES, AST_TOKEN_TYPES } from '@typescript-eslint/utils'; +import * as tsutils from 'tsutils'; import * as ts from 'typescript'; +import * as util from '../util'; + export type Options = [ { ignoreConditionalTests?: boolean; ignoreTernaryTests?: boolean; ignoreMixedLogicalExpressions?: boolean; + allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing?: boolean; }, ]; export type MessageIds = | 'preferNullishOverOr' | 'preferNullishOverTernary' - | 'suggestNullish'; + | 'suggestNullish' + | 'noStrictNullCheck'; export default util.createRule({ name: 'prefer-nullish-coalescing', @@ -28,7 +28,6 @@ export default util.createRule({ description: 'Enforce using the nullish coalescing operator instead of logical chaining', recommended: 'strict', - suggestion: true, requiresTypeChecking: true, }, hasSuggestions: true, @@ -38,6 +37,8 @@ export default util.createRule({ preferNullishOverTernary: 'Prefer using nullish coalescing operator (`??`) instead of a ternary expression, as it is simpler to read.', suggestNullish: 'Fix to nullish coalescing operator (`??`).', + noStrictNullCheck: + 'This rule requires the `strictNullChecks` compiler option to be turned on to function correctly.', }, schema: [ { @@ -52,7 +53,7 @@ export default util.createRule({ ignoreMixedLogicalExpressions: { type: 'boolean', }, - forceSuggestionFixer: { + allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing: { type: 'boolean', }, }, @@ -65,6 +66,7 @@ export default util.createRule({ ignoreConditionalTests: true, ignoreTernaryTests: true, ignoreMixedLogicalExpressions: true, + allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing: false, }, ], create( @@ -74,12 +76,31 @@ export default util.createRule({ ignoreConditionalTests, ignoreTernaryTests, ignoreMixedLogicalExpressions, + allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing, }, ], ) { const parserServices = util.getParserServices(context); + const compilerOptions = parserServices.program.getCompilerOptions(); const sourceCode = context.getSourceCode(); const checker = parserServices.program.getTypeChecker(); + const isStrictNullChecks = tsutils.isStrictCompilerOptionEnabled( + compilerOptions, + 'strictNullChecks', + ); + + if ( + !isStrictNullChecks && + allowRuleToRunWithoutStrictNullChecksIKnowWhatIAmDoing !== true + ) { + context.report({ + loc: { + start: { line: 0, column: 0 }, + end: { line: 0, column: 0 }, + }, + messageId: 'noStrictNullCheck', + }); + } return { ConditionalExpression(node: TSESTree.ConditionalExpression): void { diff --git a/packages/eslint-plugin/src/rules/prefer-optional-chain.ts b/packages/eslint-plugin/src/rules/prefer-optional-chain.ts index 662439ac743..efccc2ccfd2 100644 --- a/packages/eslint-plugin/src/rules/prefer-optional-chain.ts +++ b/packages/eslint-plugin/src/rules/prefer-optional-chain.ts @@ -1,19 +1,22 @@ +import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; +import { isBinaryExpression } from 'tsutils'; import * as ts from 'typescript'; + import * as util from '../util'; -import { AST_NODE_TYPES, TSESTree, TSESLint } from '@typescript-eslint/utils'; -import { isBinaryExpression } from 'tsutils'; type ValidChainTarget = | TSESTree.BinaryExpression | TSESTree.CallExpression | TSESTree.ChainExpression | TSESTree.Identifier + | TSESTree.PrivateIdentifier | TSESTree.MemberExpression - | TSESTree.ThisExpression; + | TSESTree.ThisExpression + | TSESTree.MetaProperty; /* The AST is always constructed such the first element is always the deepest element. - I.e. for this code: `foo && foo.bar && foo.bar.baz && foo.bar.baz.buzz` The AST will look like this: { @@ -34,9 +37,8 @@ export default util.createRule({ type: 'suggestion', docs: { description: - 'Enforce using concise optional chain expressions instead of chained logical ands', + 'Enforce using concise optional chain expressions instead of chained logical ands, negated logical ors, or empty objects', recommended: 'strict', - suggestion: true, }, hasSuggestions: true, messages: { @@ -111,17 +113,101 @@ export default util.createRule({ ], }); }, + [[ + 'LogicalExpression[operator="||"] > UnaryExpression[operator="!"] > Identifier', + 'LogicalExpression[operator="||"] > UnaryExpression[operator="!"] > MemberExpression', + 'LogicalExpression[operator="||"] > UnaryExpression[operator="!"] > ChainExpression > MemberExpression', + 'LogicalExpression[operator="||"] > UnaryExpression[operator="!"] > MetaProperty', + ].join(',')]( + initialIdentifierOrNotEqualsExpr: + | TSESTree.Identifier + | TSESTree.MemberExpression + | TSESTree.MetaProperty, + ): void { + // selector guarantees this cast + const initialExpression = ( + initialIdentifierOrNotEqualsExpr.parent!.type === + AST_NODE_TYPES.ChainExpression + ? initialIdentifierOrNotEqualsExpr.parent.parent + : initialIdentifierOrNotEqualsExpr.parent + )!.parent as TSESTree.LogicalExpression; + + if ( + initialExpression.left.type !== AST_NODE_TYPES.UnaryExpression || + initialExpression.left.argument !== initialIdentifierOrNotEqualsExpr + ) { + // the node(identifier or member expression) is not the deepest left node + return; + } + + // walk up the tree to figure out how many logical expressions we can include + let previous: TSESTree.LogicalExpression = initialExpression; + let current: TSESTree.Node = initialExpression; + let previousLeftText = getText(initialIdentifierOrNotEqualsExpr); + let optionallyChainedCode = previousLeftText; + let expressionCount = 1; + while (current.type === AST_NODE_TYPES.LogicalExpression) { + if ( + current.right.type !== AST_NODE_TYPES.UnaryExpression || + !isValidChainTarget( + current.right.argument, + // only allow unary '!' with identifiers for the first chain - !foo || !foo() + expressionCount === 1, + ) + ) { + break; + } + const { rightText, shouldBreak } = breakIfInvalid({ + rightNode: current.right.argument, + previousLeftText, + }); + if (shouldBreak) { + break; + } + + let invalidOptionallyChainedPrivateProperty; + ({ + invalidOptionallyChainedPrivateProperty, + expressionCount, + previousLeftText, + optionallyChainedCode, + previous, + current, + } = normalizeRepeatingPatterns( + rightText, + expressionCount, + previousLeftText, + optionallyChainedCode, + previous, + current, + )); + if (invalidOptionallyChainedPrivateProperty) { + return; + } + } + + reportIfMoreThanOne({ + expressionCount, + previous, + optionallyChainedCode, + sourceCode, + context, + shouldHandleChainedAnds: false, + }); + }, [[ 'LogicalExpression[operator="&&"] > Identifier', 'LogicalExpression[operator="&&"] > MemberExpression', 'LogicalExpression[operator="&&"] > ChainExpression > MemberExpression', + 'LogicalExpression[operator="&&"] > MetaProperty', 'LogicalExpression[operator="&&"] > BinaryExpression[operator="!=="]', 'LogicalExpression[operator="&&"] > BinaryExpression[operator="!="]', ].join(',')]( initialIdentifierOrNotEqualsExpr: | TSESTree.BinaryExpression | TSESTree.Identifier - | TSESTree.MemberExpression, + | TSESTree.MemberExpression + | TSESTree.MetaProperty, ): void { // selector guarantees this cast const initialExpression = ( @@ -155,99 +241,81 @@ export default util.createRule({ ) { break; } - - const leftText = previousLeftText; - const rightText = getText(current.right); - // can't just use startsWith because of cases like foo && fooBar.baz; - const matchRegex = new RegExp( - `^${ - // escape regex characters - leftText.replace(/[.*+?^${}()|[\]\\]/g, '\\$&') - }[^a-zA-Z0-9_$]`, - ); - if ( - !matchRegex.test(rightText) && - // handle redundant cases like foo.bar && foo.bar - leftText !== rightText - ) { + const { rightText, shouldBreak } = breakIfInvalid({ + rightNode: current.right, + previousLeftText, + }); + if (shouldBreak) { break; } - // omit weird doubled up expression that make no sense like foo.bar && foo.bar - if (rightText !== leftText) { - expressionCount += 1; - previousLeftText = rightText; - - /* - Diff the left and right text to construct the fix string - There are the following cases: - - 1) - rightText === 'foo.bar.baz.buzz' - leftText === 'foo.bar.baz' - diff === '.buzz' - - 2) - rightText === 'foo.bar.baz.buzz()' - leftText === 'foo.bar.baz' - diff === '.buzz()' - - 3) - rightText === 'foo.bar.baz.buzz()' - leftText === 'foo.bar.baz.buzz' - diff === '()' - - 4) - rightText === 'foo.bar.baz[buzz]' - leftText === 'foo.bar.baz' - diff === '[buzz]' - - 5) - rightText === 'foo.bar.baz?.buzz' - leftText === 'foo.bar.baz' - diff === '?.buzz' - */ - const diff = rightText.replace(leftText, ''); - if (diff.startsWith('?')) { - // item was "pre optional chained" - optionallyChainedCode += diff; - } else { - const needsDot = diff.startsWith('(') || diff.startsWith('['); - optionallyChainedCode += `?${needsDot ? '.' : ''}${diff}`; - } + let invalidOptionallyChainedPrivateProperty; + ({ + invalidOptionallyChainedPrivateProperty, + expressionCount, + previousLeftText, + optionallyChainedCode, + previous, + current, + } = normalizeRepeatingPatterns( + rightText, + expressionCount, + previousLeftText, + optionallyChainedCode, + previous, + current, + )); + if (invalidOptionallyChainedPrivateProperty) { + return; } - - previous = current; - current = util.nullThrows( - current.parent, - util.NullThrowsReasons.MissingParent, - ); } - if (expressionCount > 1) { - if (previous.right.type === AST_NODE_TYPES.BinaryExpression) { - // case like foo && foo.bar !== someValue - optionallyChainedCode += ` ${ - previous.right.operator - } ${sourceCode.getText(previous.right.right)}`; - } - - context.report({ - node: previous, - messageId: 'preferOptionalChain', - suggest: [ - { - messageId: 'optionalChainSuggest', - fix: (fixer): TSESLint.RuleFix[] => [ - fixer.replaceText(previous, optionallyChainedCode), - ], - }, - ], - }); - } + reportIfMoreThanOne({ + expressionCount, + previous, + optionallyChainedCode, + sourceCode, + context, + shouldHandleChainedAnds: true, + }); }, }; + interface BreakIfInvalidResult { + leftText: string; + rightText: string; + shouldBreak: boolean; + } + + interface BreakIfInvalidOptions { + previousLeftText: string; + rightNode: ValidChainTarget; + } + + function breakIfInvalid({ + previousLeftText, + rightNode, + }: BreakIfInvalidOptions): BreakIfInvalidResult { + let shouldBreak = false; + + const rightText = getText(rightNode); + // can't just use startsWith because of cases like foo && fooBar.baz; + const matchRegex = new RegExp( + `^${ + // escape regex characters + previousLeftText.replace(/[.*+?^${}()|[\]\\]/g, '\\$&') + }[^a-zA-Z0-9_$]`, + ); + if ( + !matchRegex.test(rightText) && + // handle redundant cases like foo.bar && foo.bar + previousLeftText !== rightText + ) { + shouldBreak = true; + } + return { shouldBreak, leftText: previousLeftText, rightText }; + } + function getText(node: ValidChainTarget): string { if (node.type === AST_NODE_TYPES.BinaryExpression) { return getText( @@ -286,10 +354,17 @@ export default util.createRule({ return `${calleeText}${argumentsText}`; } - if (node.type === AST_NODE_TYPES.Identifier) { + if ( + node.type === AST_NODE_TYPES.Identifier || + node.type === AST_NODE_TYPES.PrivateIdentifier + ) { return node.name; } + if (node.type === AST_NODE_TYPES.MetaProperty) { + return `${node.meta.name}.${node.property.name}`; + } + if (node.type === AST_NODE_TYPES.ThisExpression) { return 'this'; } @@ -304,6 +379,11 @@ export default util.createRule({ return getText(node.expression); } + if (node.object.type === AST_NODE_TYPES.TSNonNullExpression) { + // Not supported mixing with TSNonNullExpression + return ''; + } + return getMemberExpressionText(node); } @@ -315,22 +395,20 @@ export default util.createRule({ // cases should match the list in ALLOWED_MEMBER_OBJECT_TYPES switch (node.object.type) { - case AST_NODE_TYPES.CallExpression: - case AST_NODE_TYPES.Identifier: - objectText = getText(node.object); - break; - case AST_NODE_TYPES.MemberExpression: objectText = getMemberExpressionText(node.object); break; + case AST_NODE_TYPES.CallExpression: + case AST_NODE_TYPES.Identifier: + case AST_NODE_TYPES.MetaProperty: case AST_NODE_TYPES.ThisExpression: objectText = getText(node.object); break; /* istanbul ignore next */ default: - throw new Error(`Unexpected member object type: ${node.object.type}`); + return ''; } let propertyText: string; @@ -343,6 +421,7 @@ export default util.createRule({ case AST_NODE_TYPES.Literal: case AST_NODE_TYPES.TemplateLiteral: + case AST_NODE_TYPES.BinaryExpression: propertyText = sourceCode.getText(node.property); break; @@ -352,9 +431,7 @@ export default util.createRule({ /* istanbul ignore next */ default: - throw new Error( - `Unexpected member property type: ${node.object.type}`, - ); + return ''; } return `${objectText}${node.optional ? '?.' : ''}[${propertyText}]`; @@ -364,12 +441,12 @@ export default util.createRule({ case AST_NODE_TYPES.Identifier: propertyText = getText(node.property); break; + case AST_NODE_TYPES.PrivateIdentifier: + propertyText = '#' + getText(node.property); + break; - /* istanbul ignore next */ default: - throw new Error( - `Unexpected member property type: ${node.object.type}`, - ); + propertyText = sourceCode.getText(node.property); } return `${objectText}${node.optional ? '?.' : '.'}${propertyText}`; @@ -383,6 +460,7 @@ const ALLOWED_MEMBER_OBJECT_TYPES: ReadonlySet = new Set([ AST_NODE_TYPES.Identifier, AST_NODE_TYPES.MemberExpression, AST_NODE_TYPES.ThisExpression, + AST_NODE_TYPES.MetaProperty, ]); const ALLOWED_COMPUTED_PROP_TYPES: ReadonlySet = new Set([ AST_NODE_TYPES.Identifier, @@ -392,8 +470,153 @@ const ALLOWED_COMPUTED_PROP_TYPES: ReadonlySet = new Set([ ]); const ALLOWED_NON_COMPUTED_PROP_TYPES: ReadonlySet = new Set([ AST_NODE_TYPES.Identifier, + AST_NODE_TYPES.PrivateIdentifier, ]); +interface ReportIfMoreThanOneOptions { + expressionCount: number; + previous: TSESTree.LogicalExpression; + optionallyChainedCode: string; + sourceCode: Readonly; + context: Readonly< + TSESLint.RuleContext< + 'preferOptionalChain' | 'optionalChainSuggest', + never[] + > + >; + shouldHandleChainedAnds: boolean; +} + +function reportIfMoreThanOne({ + expressionCount, + previous, + optionallyChainedCode, + sourceCode, + context, + shouldHandleChainedAnds, +}: ReportIfMoreThanOneOptions): void { + if (expressionCount > 1) { + if ( + shouldHandleChainedAnds && + previous.right.type === AST_NODE_TYPES.BinaryExpression + ) { + let operator = previous.right.operator; + if ( + previous.right.operator === '!==' && + // TODO(#4820): Use the type checker to know whether this is `null` + previous.right.right.type === AST_NODE_TYPES.Literal && + previous.right.right.raw === 'null' + ) { + // case like foo !== null && foo.bar !== null + operator = '!='; + } + // case like foo && foo.bar !== someValue + optionallyChainedCode += ` ${operator} ${sourceCode.getText( + previous.right.right, + )}`; + } + + context.report({ + node: previous, + messageId: 'preferOptionalChain', + suggest: [ + { + messageId: 'optionalChainSuggest', + fix: (fixer): TSESLint.RuleFix[] => [ + fixer.replaceText( + previous, + `${shouldHandleChainedAnds ? '' : '!'}${optionallyChainedCode}`, + ), + ], + }, + ], + }); + } +} + +interface NormalizedPattern { + invalidOptionallyChainedPrivateProperty: boolean; + expressionCount: number; + previousLeftText: string; + optionallyChainedCode: string; + previous: TSESTree.LogicalExpression; + current: TSESTree.Node; +} + +function normalizeRepeatingPatterns( + rightText: string, + expressionCount: number, + previousLeftText: string, + optionallyChainedCode: string, + previous: TSESTree.Node, + current: TSESTree.Node, +): NormalizedPattern { + const leftText = previousLeftText; + let invalidOptionallyChainedPrivateProperty = false; + // omit weird doubled up expression that make no sense like foo.bar && foo.bar + if (rightText !== previousLeftText) { + expressionCount += 1; + previousLeftText = rightText; + + /* + Diff the left and right text to construct the fix string + There are the following cases: + + 1) + rightText === 'foo.bar.baz.buzz' + leftText === 'foo.bar.baz' + diff === '.buzz' + + 2) + rightText === 'foo.bar.baz.buzz()' + leftText === 'foo.bar.baz' + diff === '.buzz()' + + 3) + rightText === 'foo.bar.baz.buzz()' + leftText === 'foo.bar.baz.buzz' + diff === '()' + + 4) + rightText === 'foo.bar.baz[buzz]' + leftText === 'foo.bar.baz' + diff === '[buzz]' + + 5) + rightText === 'foo.bar.baz?.buzz' + leftText === 'foo.bar.baz' + diff === '?.buzz' + */ + const diff = rightText.replace(leftText, ''); + if (diff.startsWith('.#')) { + // Do not handle direct optional chaining on private properties because of a typescript bug (https://github.com/microsoft/TypeScript/issues/42734) + // We still allow in computed properties + invalidOptionallyChainedPrivateProperty = true; + } + if (diff.startsWith('?')) { + // item was "pre optional chained" + optionallyChainedCode += diff; + } else { + const needsDot = diff.startsWith('(') || diff.startsWith('['); + optionallyChainedCode += `?${needsDot ? '.' : ''}${diff}`; + } + } + + previous = current as TSESTree.LogicalExpression; + current = util.nullThrows( + current.parent, + util.NullThrowsReasons.MissingParent, + ); + return { + invalidOptionallyChainedPrivateProperty, + expressionCount, + previousLeftText, + optionallyChainedCode, + previous, + current, + }; +} + function isValidChainTarget( node: TSESTree.Node, allowIdentifier: boolean, @@ -425,7 +648,8 @@ function isValidChainTarget( if ( allowIdentifier && (node.type === AST_NODE_TYPES.Identifier || - node.type === AST_NODE_TYPES.ThisExpression) + node.type === AST_NODE_TYPES.ThisExpression || + node.type === AST_NODE_TYPES.MetaProperty) ) { return true; } diff --git a/packages/eslint-plugin/src/rules/prefer-readonly-parameter-types.ts b/packages/eslint-plugin/src/rules/prefer-readonly-parameter-types.ts index a90e5fe84ad..4ba01de52b2 100644 --- a/packages/eslint-plugin/src/rules/prefer-readonly-parameter-types.ts +++ b/packages/eslint-plugin/src/rules/prefer-readonly-parameter-types.ts @@ -1,4 +1,6 @@ -import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; + import * as util from '../util'; type Options = [ diff --git a/packages/eslint-plugin/src/rules/prefer-readonly.ts b/packages/eslint-plugin/src/rules/prefer-readonly.ts index b9d9b76803b..3a9e6cdca66 100644 --- a/packages/eslint-plugin/src/rules/prefer-readonly.ts +++ b/packages/eslint-plugin/src/rules/prefer-readonly.ts @@ -1,8 +1,10 @@ +import type { TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES, ASTUtils } from '@typescript-eslint/utils'; import * as tsutils from 'tsutils'; import * as ts from 'typescript'; + import * as util from '../util'; import { typeIsOrHasBaseType } from '../util'; -import { ASTUtils, AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils'; type MessageIds = 'preferReadonly'; type Options = [ @@ -117,7 +119,10 @@ export default util.createRule({ ts.isArrayLiteralExpression(parent.parent)) ) { current = parent; - } else if (ts.isBinaryExpression(parent)) { + } else if ( + ts.isBinaryExpression(parent) && + !ts.isPropertyAccessExpression(current) + ) { return ( parent.left === current && parent.operatorToken.kind === ts.SyntaxKind.EqualsToken diff --git a/packages/eslint-plugin/src/rules/prefer-reduce-type-parameter.ts b/packages/eslint-plugin/src/rules/prefer-reduce-type-parameter.ts index 585e1fdc867..d3c18efa551 100644 --- a/packages/eslint-plugin/src/rules/prefer-reduce-type-parameter.ts +++ b/packages/eslint-plugin/src/rules/prefer-reduce-type-parameter.ts @@ -1,4 +1,6 @@ -import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; + import * as util from '../util'; type MemberExpressionWithCallExpressionParent = TSESTree.MemberExpression & { diff --git a/packages/eslint-plugin/src/rules/prefer-regexp-exec.ts b/packages/eslint-plugin/src/rules/prefer-regexp-exec.ts index 3d5fca34627..60bf310947f 100644 --- a/packages/eslint-plugin/src/rules/prefer-regexp-exec.ts +++ b/packages/eslint-plugin/src/rules/prefer-regexp-exec.ts @@ -1,6 +1,8 @@ -import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; import * as tsutils from 'tsutils'; -import * as ts from 'typescript'; +import type * as ts from 'typescript'; + import { createRule, getParserServices, @@ -121,7 +123,7 @@ export default createRule({ if ( argumentNode.type === AST_NODE_TYPES.Literal && - typeof argumentNode.value == 'string' + typeof argumentNode.value === 'string' ) { const regExp = RegExp(argumentNode.value); return context.report({ diff --git a/packages/eslint-plugin/src/rules/prefer-return-this-type.ts b/packages/eslint-plugin/src/rules/prefer-return-this-type.ts index 0766d98efbd..59a5c85b2bd 100644 --- a/packages/eslint-plugin/src/rules/prefer-return-this-type.ts +++ b/packages/eslint-plugin/src/rules/prefer-return-this-type.ts @@ -1,5 +1,7 @@ -import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; import * as ts from 'typescript'; + import { createRule, forEachReturnStatement, getParserServices } from '../util'; type ClassLikeDeclaration = diff --git a/packages/eslint-plugin/src/rules/prefer-string-starts-ends-with.ts b/packages/eslint-plugin/src/rules/prefer-string-starts-ends-with.ts index c658bce3dd1..104637062bb 100644 --- a/packages/eslint-plugin/src/rules/prefer-string-starts-ends-with.ts +++ b/packages/eslint-plugin/src/rules/prefer-string-starts-ends-with.ts @@ -1,5 +1,8 @@ -import { AST_NODE_TYPES, TSESLint, TSESTree } from '@typescript-eslint/utils'; -import { AST as RegExpAST, RegExpParser } from 'regexpp'; +import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; +import type { AST as RegExpAST } from 'regexpp'; +import { RegExpParser } from 'regexpp'; + import { createRule, getParserServices, @@ -44,7 +47,7 @@ export default createRule({ * Check if a given node is a string. * @param node The node to check. */ - function isStringType(node: TSESTree.LeftHandSideExpression): boolean { + function isStringType(node: TSESTree.Expression): boolean { const objectType = typeChecker.getTypeAtLocation( service.esTreeNodeToTSNodeMap.get(node), ); @@ -57,7 +60,7 @@ export default createRule({ */ function isNull(node: TSESTree.Node): node is TSESTree.Literal { const evaluated = getStaticValue(node, globalScope); - return evaluated != null && evaluated.value === null; + return evaluated != null && evaluated.value == null; } /** diff --git a/packages/eslint-plugin/src/rules/prefer-ts-expect-error.ts b/packages/eslint-plugin/src/rules/prefer-ts-expect-error.ts index 3be8b5159f1..55b5d2c56eb 100644 --- a/packages/eslint-plugin/src/rules/prefer-ts-expect-error.ts +++ b/packages/eslint-plugin/src/rules/prefer-ts-expect-error.ts @@ -1,6 +1,11 @@ +import type { TSESTree } from '@typescript-eslint/utils'; +import { AST_TOKEN_TYPES } from '@typescript-eslint/utils'; +import type { + RuleFix, + RuleFixer, +} from '@typescript-eslint/utils/dist/ts-eslint'; + import * as util from '../util'; -import { AST_TOKEN_TYPES, TSESTree } from '@typescript-eslint/utils'; -import { RuleFixer, RuleFix } from '@typescript-eslint/utils/dist/ts-eslint'; type MessageIds = 'preferExpectErrorComment'; diff --git a/packages/eslint-plugin/src/rules/promise-function-async.ts b/packages/eslint-plugin/src/rules/promise-function-async.ts index b1ade7bf01b..4387bc52c9b 100644 --- a/packages/eslint-plugin/src/rules/promise-function-async.ts +++ b/packages/eslint-plugin/src/rules/promise-function-async.ts @@ -1,9 +1,7 @@ -import { - AST_NODE_TYPES, - AST_TOKEN_TYPES, - TSESTree, -} from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES, AST_TOKEN_TYPES } from '@typescript-eslint/utils'; import * as ts from 'typescript'; + import * as util from '../util'; type Options = [ @@ -37,9 +35,13 @@ export default util.createRule({ type: 'object', properties: { allowAny: { + description: + 'Whether to consider `any` and `unknown` to be Promises.', type: 'boolean', }, allowedPromiseNames: { + description: + 'Any extra names of classes or interfaces to be considered Promises.', type: 'array', items: { type: 'string', @@ -173,7 +175,10 @@ export default util.createRule({ } // if current token is a keyword like `static` or `public` then skip it - while (keyToken.type === AST_TOKEN_TYPES.Keyword) { + while ( + keyToken.type === AST_TOKEN_TYPES.Keyword && + keyToken.range[0] < method.key.range[0] + ) { keyToken = sourceCode.getTokenAfter(keyToken)!; } diff --git a/packages/eslint-plugin/src/rules/quotes.ts b/packages/eslint-plugin/src/rules/quotes.ts index d24ac099533..4a23e9632d7 100644 --- a/packages/eslint-plugin/src/rules/quotes.ts +++ b/packages/eslint-plugin/src/rules/quotes.ts @@ -1,6 +1,8 @@ -import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils'; -import { getESLintCoreRule } from '../util/getESLintCoreRule'; +import type { TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; + import * as util from '../util'; +import { getESLintCoreRule } from '../util/getESLintCoreRule'; const baseRule = getESLintCoreRule('quotes'); diff --git a/packages/eslint-plugin/src/rules/require-array-sort-compare.ts b/packages/eslint-plugin/src/rules/require-array-sort-compare.ts index 5354c87afa6..aafd46e690d 100644 --- a/packages/eslint-plugin/src/rules/require-array-sort-compare.ts +++ b/packages/eslint-plugin/src/rules/require-array-sort-compare.ts @@ -1,4 +1,5 @@ -import { TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; + import * as util from '../util'; export type Options = [ @@ -32,6 +33,8 @@ export default util.createRule({ type: 'object', properties: { ignoreStringArrays: { + description: + 'Whether to ignore arrays in which all elements are strings.', type: 'boolean', }, }, @@ -47,7 +50,7 @@ export default util.createRule({ * Check if a given node is an array which all elements are string. * @param node */ - function isStringArrayNode(node: TSESTree.LeftHandSideExpression): boolean { + function isStringArrayNode(node: TSESTree.Expression): boolean { const type = checker.getTypeAtLocation( service.esTreeNodeToTSNodeMap.get(node), ); diff --git a/packages/eslint-plugin/src/rules/require-await.ts b/packages/eslint-plugin/src/rules/require-await.ts index 56067fe554a..076cd6077a0 100644 --- a/packages/eslint-plugin/src/rules/require-await.ts +++ b/packages/eslint-plugin/src/rules/require-await.ts @@ -1,6 +1,8 @@ -import { AST_NODE_TYPES, TSESLint, TSESTree } from '@typescript-eslint/utils'; +import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; import * as tsutils from 'tsutils'; -import * as ts from 'typescript'; +import type * as ts from 'typescript'; + import * as util from '../util'; interface ScopeInfo { @@ -104,7 +106,7 @@ export default util.createRule({ * function and the delegate is `true` */ function markAsHasDelegateGen(node: TSESTree.YieldExpression): void { - if (!scopeInfo || !scopeInfo.isGen || !node.argument) { + if (!scopeInfo?.isGen || !node.argument) { return; } diff --git a/packages/eslint-plugin/src/rules/restrict-plus-operands.ts b/packages/eslint-plugin/src/rules/restrict-plus-operands.ts index 3884dec24dd..ad5d0a832b7 100644 --- a/packages/eslint-plugin/src/rules/restrict-plus-operands.ts +++ b/packages/eslint-plugin/src/rules/restrict-plus-operands.ts @@ -1,5 +1,6 @@ -import { TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; import * as ts from 'typescript'; + import * as util from '../util'; type Options = [ @@ -21,7 +22,7 @@ export default util.createRule({ type: 'problem', docs: { description: - 'Require both operands of addition to have type `number` or `string`', + 'Require both operands of addition to be the same type and be `bigint`, `number`, or `string`', recommended: 'error', requiresTypeChecking: true, }, @@ -42,9 +43,11 @@ export default util.createRule({ additionalProperties: false, properties: { checkCompoundAssignments: { + description: 'Whether to check compound assignments such as `+=`.', type: 'boolean', }, allowAny: { + description: 'Whether to allow `any` typed values.', type: 'boolean', }, }, diff --git a/packages/eslint-plugin/src/rules/restrict-template-expressions.ts b/packages/eslint-plugin/src/rules/restrict-template-expressions.ts index 0140c3dc0d4..382f8ce0137 100644 --- a/packages/eslint-plugin/src/rules/restrict-template-expressions.ts +++ b/packages/eslint-plugin/src/rules/restrict-template-expressions.ts @@ -1,5 +1,7 @@ -import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; import * as ts from 'typescript'; + import * as util from '../util'; type Options = [ @@ -31,11 +33,31 @@ export default util.createRule({ { type: 'object', properties: { - allowNumber: { type: 'boolean' }, - allowBoolean: { type: 'boolean' }, - allowAny: { type: 'boolean' }, - allowNullish: { type: 'boolean' }, - allowRegExp: { type: 'boolean' }, + allowNumber: { + description: + 'Whether to allow `number` typed values in template expressions.', + type: 'boolean', + }, + allowBoolean: { + description: + 'Whether to allow `boolean` typed values in template expressions.', + type: 'boolean', + }, + allowAny: { + description: + 'Whether to allow `any` typed values in template expressions.', + type: 'boolean', + }, + allowNullish: { + description: + 'Whether to allow `nullish` typed values in template expressions.', + type: 'boolean', + }, + allowRegExp: { + description: + 'Whether to allow `regexp` typed values in template expressions.', + type: 'boolean', + }, }, }, ], diff --git a/packages/eslint-plugin/src/rules/return-await.ts b/packages/eslint-plugin/src/rules/return-await.ts index fbb78708bd4..1797e47e127 100644 --- a/packages/eslint-plugin/src/rules/return-await.ts +++ b/packages/eslint-plugin/src/rules/return-await.ts @@ -1,7 +1,9 @@ -import { AST_NODE_TYPES, TSESLint, TSESTree } from '@typescript-eslint/utils'; +import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; import * as tsutils from 'tsutils'; import { isBinaryExpression } from 'tsutils'; import * as ts from 'typescript'; + import * as util from '../util'; import { getOperatorPrecedence } from '../util/getOperatorPrecedence'; @@ -306,7 +308,7 @@ export default util.createRule({ }, ReturnStatement(node): void { const scopeInfo = scopeInfoStack[scopeInfoStack.length - 1]; - if (!scopeInfo || !scopeInfo.hasAsync || !node.argument) { + if (!scopeInfo?.hasAsync || !node.argument) { return; } findPossiblyReturnedNodes(node.argument).forEach(node => { diff --git a/packages/eslint-plugin/src/rules/semi.ts b/packages/eslint-plugin/src/rules/semi.ts index 8df56137311..c6da7c7912e 100644 --- a/packages/eslint-plugin/src/rules/semi.ts +++ b/packages/eslint-plugin/src/rules/semi.ts @@ -1,6 +1,8 @@ -import { TSESTree, TSESLint, AST_NODE_TYPES } from '@typescript-eslint/utils'; -import { getESLintCoreRule } from '../util/getESLintCoreRule'; +import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; + import * as util from '../util'; +import { getESLintCoreRule } from '../util/getESLintCoreRule'; const baseRule = getESLintCoreRule('semi'); diff --git a/packages/eslint-plugin/src/rules/sort-type-constituents.ts b/packages/eslint-plugin/src/rules/sort-type-constituents.ts new file mode 100644 index 00000000000..848b2ce0722 --- /dev/null +++ b/packages/eslint-plugin/src/rules/sort-type-constituents.ts @@ -0,0 +1,269 @@ +import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; + +import * as util from '../util'; +import { getEnumNames, typeNodeRequiresParentheses } from '../util'; + +enum Group { + conditional = 'conditional', + function = 'function', + import = 'import', + intersection = 'intersection', + keyword = 'keyword', + nullish = 'nullish', + literal = 'literal', + named = 'named', + object = 'object', + operator = 'operator', + tuple = 'tuple', + union = 'union', +} + +function getGroup(node: TSESTree.TypeNode): Group { + switch (node.type) { + case AST_NODE_TYPES.TSConditionalType: + return Group.conditional; + + case AST_NODE_TYPES.TSConstructorType: + case AST_NODE_TYPES.TSFunctionType: + return Group.function; + + case AST_NODE_TYPES.TSImportType: + return Group.import; + + case AST_NODE_TYPES.TSIntersectionType: + return Group.intersection; + + case AST_NODE_TYPES.TSAnyKeyword: + case AST_NODE_TYPES.TSBigIntKeyword: + case AST_NODE_TYPES.TSBooleanKeyword: + case AST_NODE_TYPES.TSNeverKeyword: + case AST_NODE_TYPES.TSNumberKeyword: + case AST_NODE_TYPES.TSObjectKeyword: + case AST_NODE_TYPES.TSStringKeyword: + case AST_NODE_TYPES.TSSymbolKeyword: + case AST_NODE_TYPES.TSThisType: + case AST_NODE_TYPES.TSUnknownKeyword: + case AST_NODE_TYPES.TSIntrinsicKeyword: + return Group.keyword; + + case AST_NODE_TYPES.TSNullKeyword: + case AST_NODE_TYPES.TSUndefinedKeyword: + case AST_NODE_TYPES.TSVoidKeyword: + return Group.nullish; + + case AST_NODE_TYPES.TSLiteralType: + case AST_NODE_TYPES.TSTemplateLiteralType: + return Group.literal; + + case AST_NODE_TYPES.TSArrayType: + case AST_NODE_TYPES.TSIndexedAccessType: + case AST_NODE_TYPES.TSInferType: + case AST_NODE_TYPES.TSTypeReference: + case AST_NODE_TYPES.TSQualifiedName: + return Group.named; + + case AST_NODE_TYPES.TSMappedType: + case AST_NODE_TYPES.TSTypeLiteral: + return Group.object; + + case AST_NODE_TYPES.TSTypeOperator: + case AST_NODE_TYPES.TSTypeQuery: + return Group.operator; + + case AST_NODE_TYPES.TSTupleType: + return Group.tuple; + + case AST_NODE_TYPES.TSUnionType: + return Group.union; + + // These types should never occur as part of a union/intersection + case AST_NODE_TYPES.TSAbstractKeyword: + case AST_NODE_TYPES.TSAsyncKeyword: + case AST_NODE_TYPES.TSDeclareKeyword: + case AST_NODE_TYPES.TSExportKeyword: + case AST_NODE_TYPES.TSNamedTupleMember: + case AST_NODE_TYPES.TSOptionalType: + case AST_NODE_TYPES.TSPrivateKeyword: + case AST_NODE_TYPES.TSProtectedKeyword: + case AST_NODE_TYPES.TSPublicKeyword: + case AST_NODE_TYPES.TSReadonlyKeyword: + case AST_NODE_TYPES.TSRestType: + case AST_NODE_TYPES.TSStaticKeyword: + case AST_NODE_TYPES.TSTypePredicate: + /* istanbul ignore next */ + throw new Error(`Unexpected Type ${node.type}`); + } +} + +export type Options = [ + { + checkIntersections?: boolean; + checkUnions?: boolean; + groupOrder?: string[]; + }, +]; +export type MessageIds = 'notSorted' | 'notSortedNamed' | 'suggestFix'; + +export default util.createRule({ + name: 'sort-type-constituents', + meta: { + type: 'suggestion', + docs: { + description: + 'Enforce constituents of a type union/intersection to be sorted alphabetically', + recommended: false, + }, + fixable: 'code', + hasSuggestions: true, + messages: { + notSorted: '{{type}} type constituents must be sorted.', + notSortedNamed: '{{type}} type {{name}} constituents must be sorted.', + suggestFix: 'Sort constituents of type (removes all comments).', + }, + schema: [ + { + type: 'object', + properties: { + checkIntersections: { + description: 'Whether to check intersection types.', + type: 'boolean', + }, + checkUnions: { + description: 'Whether to check union types.', + type: 'boolean', + }, + groupOrder: { + description: 'Ordering of the groups.', + type: 'array', + items: { + type: 'string', + enum: getEnumNames(Group), + }, + }, + }, + }, + ], + }, + defaultOptions: [ + { + checkIntersections: true, + checkUnions: true, + groupOrder: [ + Group.named, + Group.keyword, + Group.operator, + Group.literal, + Group.function, + Group.import, + Group.conditional, + Group.object, + Group.tuple, + Group.intersection, + Group.union, + Group.nullish, + ], + }, + ], + create(context, [{ checkIntersections, checkUnions, groupOrder }]) { + const sourceCode = context.getSourceCode(); + + const collator = new Intl.Collator('en', { + sensitivity: 'base', + numeric: true, + }); + + function checkSorting( + node: TSESTree.TSIntersectionType | TSESTree.TSUnionType, + ): void { + const sourceOrder = node.types.map(type => { + const group = groupOrder?.indexOf(getGroup(type)) ?? -1; + return { + group: group === -1 ? Number.MAX_SAFE_INTEGER : group, + node: type, + text: sourceCode.getText(type), + }; + }); + const expectedOrder = [...sourceOrder].sort((a, b) => { + if (a.group !== b.group) { + return a.group - b.group; + } + + return ( + collator.compare(a.text, b.text) || + (a.text < b.text ? -1 : a.text > b.text ? 1 : 0) + ); + }); + + const hasComments = node.types.some(type => { + const count = + sourceCode.getCommentsBefore(type).length + + sourceCode.getCommentsAfter(type).length; + return count > 0; + }); + + for (let i = 0; i < expectedOrder.length; i += 1) { + if (expectedOrder[i].node !== sourceOrder[i].node) { + let messageId: MessageIds = 'notSorted'; + const data = { + name: '', + type: + node.type === AST_NODE_TYPES.TSIntersectionType + ? 'Intersection' + : 'Union', + }; + if (node.parent?.type === AST_NODE_TYPES.TSTypeAliasDeclaration) { + messageId = 'notSortedNamed'; + data.name = node.parent.id.name; + } + + const fix: TSESLint.ReportFixFunction = fixer => { + const sorted = expectedOrder + .map(t => + typeNodeRequiresParentheses(t.node, t.text) || + (node.type === AST_NODE_TYPES.TSIntersectionType && + t.node.type === AST_NODE_TYPES.TSUnionType) + ? `(${t.text})` + : t.text, + ) + .join( + node.type === AST_NODE_TYPES.TSIntersectionType ? ' & ' : ' | ', + ); + + return fixer.replaceText(node, sorted); + }; + return context.report({ + node, + messageId, + data, + // don't autofix if any of the types have leading/trailing comments + // the logic for preserving them correctly is a pain - we may implement this later + ...(hasComments + ? { + suggest: [ + { + messageId: 'suggestFix', + fix, + }, + ], + } + : { fix }), + }); + } + } + } + + return { + ...(checkIntersections && { + TSIntersectionType(node): void { + checkSorting(node); + }, + }), + ...(checkUnions && { + TSUnionType(node): void { + checkSorting(node); + }, + }), + }; + }, +}); diff --git a/packages/eslint-plugin/src/rules/sort-type-union-intersection-members.ts b/packages/eslint-plugin/src/rules/sort-type-union-intersection-members.ts index f96c4677506..cbfa7a51594 100644 --- a/packages/eslint-plugin/src/rules/sort-type-union-intersection-members.ts +++ b/packages/eslint-plugin/src/rules/sort-type-union-intersection-members.ts @@ -1,6 +1,8 @@ -import { AST_NODE_TYPES, TSESLint, TSESTree } from '@typescript-eslint/utils'; +import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; + import * as util from '../util'; -import { getEnumNames } from '../util'; +import { getEnumNames, typeNodeRequiresParentheses } from '../util'; enum Group { conditional = 'conditional', @@ -58,6 +60,7 @@ function getGroup(node: TSESTree.TypeNode): Group { case AST_NODE_TYPES.TSIndexedAccessType: case AST_NODE_TYPES.TSInferType: case AST_NODE_TYPES.TSTypeReference: + case AST_NODE_TYPES.TSQualifiedName: return Group.named; case AST_NODE_TYPES.TSMappedType: @@ -75,22 +78,24 @@ function getGroup(node: TSESTree.TypeNode): Group { return Group.union; // These types should never occur as part of a union/intersection + case AST_NODE_TYPES.TSAbstractKeyword: + case AST_NODE_TYPES.TSAsyncKeyword: + case AST_NODE_TYPES.TSDeclareKeyword: + case AST_NODE_TYPES.TSExportKeyword: case AST_NODE_TYPES.TSNamedTupleMember: case AST_NODE_TYPES.TSOptionalType: + case AST_NODE_TYPES.TSPrivateKeyword: + case AST_NODE_TYPES.TSProtectedKeyword: + case AST_NODE_TYPES.TSPublicKeyword: + case AST_NODE_TYPES.TSReadonlyKeyword: case AST_NODE_TYPES.TSRestType: + case AST_NODE_TYPES.TSStaticKeyword: case AST_NODE_TYPES.TSTypePredicate: /* istanbul ignore next */ throw new Error(`Unexpected Type ${node.type}`); } } -function requiresParentheses(node: TSESTree.TypeNode): boolean { - return ( - node.type === AST_NODE_TYPES.TSFunctionType || - node.type === AST_NODE_TYPES.TSConstructorType - ); -} - export type Options = [ { checkIntersections?: boolean; @@ -103,6 +108,7 @@ export type MessageIds = 'notSorted' | 'notSortedNamed' | 'suggestFix'; export default util.createRule({ name: 'sort-type-union-intersection-members', meta: { + deprecated: true, type: 'suggestion', docs: { description: @@ -116,17 +122,21 @@ export default util.createRule({ notSortedNamed: '{{type}} type {{name}} members must be sorted.', suggestFix: 'Sort members of type (removes all comments).', }, + replacedBy: ['@typescript-eslint/sort-type-constituents'], schema: [ { type: 'object', properties: { checkIntersections: { + description: 'Whether to check intersection types.', type: 'boolean', }, checkUnions: { + description: 'Whether to check union types.', type: 'boolean', }, groupOrder: { + description: 'Ordering of the groups.', type: 'array', items: { type: 'string', @@ -211,7 +221,13 @@ export default util.createRule({ const fix: TSESLint.ReportFixFunction = fixer => { const sorted = expectedOrder - .map(t => (requiresParentheses(t.node) ? `(${t.text})` : t.text)) + .map(t => + typeNodeRequiresParentheses(t.node, t.text) || + (node.type === AST_NODE_TYPES.TSIntersectionType && + t.node.type === AST_NODE_TYPES.TSUnionType) + ? `(${t.text})` + : t.text, + ) .join( node.type === AST_NODE_TYPES.TSIntersectionType ? ' & ' : ' | ', ); diff --git a/packages/eslint-plugin/src/rules/space-before-blocks.ts b/packages/eslint-plugin/src/rules/space-before-blocks.ts index f4d4d28ef6a..5f16929aa52 100644 --- a/packages/eslint-plugin/src/rules/space-before-blocks.ts +++ b/packages/eslint-plugin/src/rules/space-before-blocks.ts @@ -1,6 +1,7 @@ -import { TSESTree } from '@typescript-eslint/utils'; -import { getESLintCoreRule } from '../util/getESLintCoreRule'; +import type { TSESTree } from '@typescript-eslint/utils'; + import * as util from '../util'; +import { getESLintCoreRule } from '../util/getESLintCoreRule'; const baseRule = getESLintCoreRule('space-before-blocks'); @@ -28,9 +29,8 @@ export default util.createRule({ }, }, defaultOptions: ['always'], - create(context) { + create(context, [config]) { const rules = baseRule.create(context); - const config = context.options[0]; const sourceCode = context.getSourceCode(); let requireSpace = true; @@ -46,6 +46,7 @@ export default util.createRule({ ): void { const precedingToken = sourceCode.getTokenBefore(node); if (precedingToken && util.isTokenOnSameLine(precedingToken, node)) { + // eslint-disable-next-line deprecation/deprecation -- TODO - switch once our min ESLint version is 6.7.0 const hasSpace = sourceCode.isSpaceBetweenTokens( precedingToken, node as TSESTree.Token, diff --git a/packages/eslint-plugin/src/rules/space-before-function-paren.ts b/packages/eslint-plugin/src/rules/space-before-function-paren.ts index 2b34036b832..5ff33aeb4fe 100644 --- a/packages/eslint-plugin/src/rules/space-before-function-paren.ts +++ b/packages/eslint-plugin/src/rules/space-before-function-paren.ts @@ -1,4 +1,6 @@ -import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; + import * as util from '../util'; type Option = 'never' | 'always'; @@ -138,7 +140,8 @@ export default util.createRule({ return; } - let leftToken: TSESTree.Token, rightToken: TSESTree.Token; + let leftToken: TSESTree.Token; + let rightToken: TSESTree.Token; if (node.typeParameters) { leftToken = sourceCode.getLastToken(node.typeParameters)!; rightToken = sourceCode.getTokenAfter(leftToken)!; @@ -146,6 +149,7 @@ export default util.createRule({ rightToken = sourceCode.getFirstToken(node, util.isOpeningParenToken)!; leftToken = sourceCode.getTokenBefore(rightToken)!; } + // eslint-disable-next-line deprecation/deprecation -- TODO - switch once our min ESLint version is 6.7.0 const hasSpacing = sourceCode.isSpaceBetweenTokens(leftToken, rightToken); if (hasSpacing && functionConfig === 'never') { diff --git a/packages/eslint-plugin/src/rules/space-infix-ops.ts b/packages/eslint-plugin/src/rules/space-infix-ops.ts index 9cab8d27f52..678cd2c4c8a 100644 --- a/packages/eslint-plugin/src/rules/space-infix-ops.ts +++ b/packages/eslint-plugin/src/rules/space-infix-ops.ts @@ -1,6 +1,7 @@ import { AST_TOKEN_TYPES, TSESTree } from '@typescript-eslint/utils'; -import { getESLintCoreRule } from '../util/getESLintCoreRule'; + import * as util from '../util'; +import { getESLintCoreRule } from '../util/getESLintCoreRule'; const baseRule = getESLintCoreRule('space-infix-ops'); diff --git a/packages/eslint-plugin/src/rules/strict-boolean-expressions.ts b/packages/eslint-plugin/src/rules/strict-boolean-expressions.ts index 5493e84d271..1e327a8a4b8 100644 --- a/packages/eslint-plugin/src/rules/strict-boolean-expressions.ts +++ b/packages/eslint-plugin/src/rules/strict-boolean-expressions.ts @@ -1,10 +1,8 @@ -import { - AST_NODE_TYPES, - ParserServices, - TSESTree, -} from '@typescript-eslint/utils'; +import type { ParserServices, TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; import * as tsutils from 'tsutils'; import * as ts from 'typescript'; + import * as util from '../util'; export type Options = [ @@ -166,16 +164,16 @@ export default util.createRule({ }); } - const checkedNodes = new Set(); + const traversedNodes = new Set(); return { - ConditionalExpression: checkTestExpression, - DoWhileStatement: checkTestExpression, - ForStatement: checkTestExpression, - IfStatement: checkTestExpression, - WhileStatement: checkTestExpression, - 'LogicalExpression[operator!="??"]': checkNode, - 'UnaryExpression[operator="!"]': checkUnaryLogicalExpression, + ConditionalExpression: traverseTestExpression, + DoWhileStatement: traverseTestExpression, + ForStatement: traverseTestExpression, + IfStatement: traverseTestExpression, + WhileStatement: traverseTestExpression, + 'LogicalExpression[operator!="??"]': traverseLogicalExpression, + 'UnaryExpression[operator="!"]': traverseUnaryLogicalExpression, }; type TestExpression = @@ -185,45 +183,81 @@ export default util.createRule({ | TSESTree.IfStatement | TSESTree.WhileStatement; - function checkTestExpression(node: TestExpression): void { + /** + * Inspects condition of a test expression. (`if`, `while`, `for`, etc.) + */ + function traverseTestExpression(node: TestExpression): void { if (node.test == null) { return; } - checkNode(node.test, true); + traverseNode(node.test, true); + } + + /** + * Inspects the argument of a unary logical expression (`!`). + */ + function traverseUnaryLogicalExpression( + node: TSESTree.UnaryExpression, + ): void { + traverseNode(node.argument, true); } - function checkUnaryLogicalExpression(node: TSESTree.UnaryExpression): void { - checkNode(node.argument, true); + /** + * Inspects the arguments of a logical expression (`&&`, `||`). + * + * If the logical expression is a descendant of a test expression, + * the `isCondition` flag should be set to true. + * Otherwise, if the logical expression is there on it's own, + * it's used for control flow and is not a condition itself. + */ + function traverseLogicalExpression( + node: TSESTree.LogicalExpression, + isCondition = false, + ): void { + // left argument is always treated as a condition + traverseNode(node.left, true); + // if the logical expression is used for control flow, + // then it's right argument is used for it's side effects only + traverseNode(node.right, isCondition); } /** - * This function analyzes the type of a node and checks if it is allowed in a boolean context. - * It can recurse when checking nested logical operators, so that only the outermost operands are reported. - * The right operand of a logical expression is ignored unless it's a part of a test expression (if/while/ternary/etc). - * @param node The AST node to check. - * @param isTestExpr Whether the node is a descendant of a test expression. + * Inspects any node. + * + * If it's a logical expression then it recursively traverses its arguments. + * If it's any other kind of node then it's type is finally checked against the rule, + * unless `isCondition` flag is set to false, in which case + * it's assumed to be used for side effects only and is skipped. */ - function checkNode(node: TSESTree.Node, isTestExpr = false): void { + function traverseNode(node: TSESTree.Node, isCondition: boolean): void { // prevent checking the same node multiple times - if (checkedNodes.has(node)) { + if (traversedNodes.has(node)) { return; } - checkedNodes.add(node); + traversedNodes.add(node); // for logical operator, we check its operands if ( node.type === AST_NODE_TYPES.LogicalExpression && node.operator !== '??' ) { - checkNode(node.left, isTestExpr); + traverseLogicalExpression(node, isCondition); + return; + } - // we ignore the right operand when not in a context of a test expression - if (isTestExpr) { - checkNode(node.right, isTestExpr); - } + // skip if node is not a condition + if (!isCondition) { return; } + checkNode(node); + } + + /** + * This function does the actual type check on a node. + * It analyzes the type of a node and checks if it is allowed in a boolean context. + */ + function checkNode(node: TSESTree.Node): void { const tsNode = parserServices.esTreeNodeToTSNodeMap.get(node); const type = util.getConstrainedTypeAtLocation(typeChecker, tsNode); const types = inspectVariantTypes(tsutils.unionTypeParts(type)); diff --git a/packages/eslint-plugin/src/rules/switch-exhaustiveness-check.ts b/packages/eslint-plugin/src/rules/switch-exhaustiveness-check.ts index bb11c245722..43d4913b4ca 100644 --- a/packages/eslint-plugin/src/rules/switch-exhaustiveness-check.ts +++ b/packages/eslint-plugin/src/rules/switch-exhaustiveness-check.ts @@ -1,5 +1,7 @@ -import { TSESLint, TSESTree } from '@typescript-eslint/utils'; +import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; +import { isTypeFlagSet, unionTypeParts } from 'tsutils'; import * as ts from 'typescript'; + import { createRule, getConstrainedTypeAtLocation, @@ -8,7 +10,6 @@ import { isOpeningBraceToken, requiresQuoting, } from '../util'; -import { isTypeFlagSet, unionTypeParts } from 'tsutils'; export default createRule({ name: 'switch-exhaustiveness-check', @@ -18,7 +19,6 @@ export default createRule({ description: 'Require switch-case statements to be exhaustive with union type', recommended: false, - suggestion: true, requiresTypeChecking: true, }, hasSuggestions: true, @@ -121,7 +121,7 @@ export default createRule({ const unionTypes = unionTypeParts(discriminantType); const caseTypes: Set = new Set(); for (const switchCase of node.cases) { - if (switchCase.test === null) { + if (switchCase.test == null) { // Switch has 'default' branch - do nothing. return; } diff --git a/packages/eslint-plugin/src/rules/triple-slash-reference.ts b/packages/eslint-plugin/src/rules/triple-slash-reference.ts index 89af3373584..4425e666338 100644 --- a/packages/eslint-plugin/src/rules/triple-slash-reference.ts +++ b/packages/eslint-plugin/src/rules/triple-slash-reference.ts @@ -1,8 +1,6 @@ -import { - AST_NODE_TYPES, - AST_TOKEN_TYPES, - TSESTree, -} from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES, AST_TOKEN_TYPES } from '@typescript-eslint/utils'; + import * as util from '../util'; type Options = [ @@ -89,7 +87,7 @@ export default util.createRule({ } }, Program(node): void { - if (lib === 'always' && path === 'always' && types == 'always') { + if (lib === 'always' && path === 'always' && types === 'always') { return; } programNode = node; diff --git a/packages/eslint-plugin/src/rules/type-annotation-spacing.ts b/packages/eslint-plugin/src/rules/type-annotation-spacing.ts index d10040fdf8d..cdc77c22903 100644 --- a/packages/eslint-plugin/src/rules/type-annotation-spacing.ts +++ b/packages/eslint-plugin/src/rules/type-annotation-spacing.ts @@ -1,4 +1,5 @@ -import { TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; + import * as util from '../util'; import { isClassOrTypeElement, @@ -180,6 +181,7 @@ export default util.createRule({ if (type === ':' && previousToken.value === '?') { if ( + // eslint-disable-next-line deprecation/deprecation -- TODO - switch once our min ESLint version is 6.7.0 sourceCode.isSpaceBetweenTokens(previousToken, punctuatorTokenStart) ) { context.report({ diff --git a/packages/eslint-plugin/src/rules/typedef.ts b/packages/eslint-plugin/src/rules/typedef.ts index 4f5fe6eae65..dd1f6ed871b 100644 --- a/packages/eslint-plugin/src/rules/typedef.ts +++ b/packages/eslint-plugin/src/rules/typedef.ts @@ -1,4 +1,6 @@ -import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; + import * as util from '../util'; const enum OptionKeys { diff --git a/packages/eslint-plugin/src/rules/unbound-method.ts b/packages/eslint-plugin/src/rules/unbound-method.ts index 2c62881e81b..6741f4df09f 100644 --- a/packages/eslint-plugin/src/rules/unbound-method.ts +++ b/packages/eslint-plugin/src/rules/unbound-method.ts @@ -1,7 +1,10 @@ -import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; import * as tsutils from 'tsutils'; import * as ts from 'typescript'; + import * as util from '../util'; +import { getModifiers } from '../util'; //------------------------------------------------------------------------------ // Rule Definition @@ -142,6 +145,8 @@ export default util.createRule({ type: 'object', properties: { ignoreStatic: { + description: + 'Whether to skip checking whether `static` methods are correctly bound.', type: 'boolean', }, }, @@ -236,7 +241,7 @@ export default util.createRule({ } checkMethodAndReport( - node, + property.key, initTypes.getProperty(property.key.name), ); } @@ -283,7 +288,7 @@ function checkMethod( !( ignoreStatic && tsutils.hasModifier( - valueDeclaration.modifiers, + getModifiers(valueDeclaration), ts.SyntaxKind.StaticKeyword, ) ), diff --git a/packages/eslint-plugin/src/rules/unified-signatures.ts b/packages/eslint-plugin/src/rules/unified-signatures.ts index dc1f683ee35..3e5d8fefb07 100644 --- a/packages/eslint-plugin/src/rules/unified-signatures.ts +++ b/packages/eslint-plugin/src/rules/unified-signatures.ts @@ -1,4 +1,6 @@ -import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; + import * as util from '../util'; interface Failure { @@ -81,6 +83,8 @@ export default util.createRule({ additionalProperties: false, properties: { ignoreDifferentlyNamedParameters: { + description: + 'Whether two parameters with different names at the same index should be considered different even if their types are the same.', type: 'boolean', }, }, diff --git a/packages/eslint-plugin/src/util/astUtils.ts b/packages/eslint-plugin/src/util/astUtils.ts index e9ac5c51f34..9140443390c 100644 --- a/packages/eslint-plugin/src/util/astUtils.ts +++ b/packages/eslint-plugin/src/util/astUtils.ts @@ -1,7 +1,8 @@ import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; -import { escapeRegExp } from './escapeRegExp'; import * as ts from 'typescript'; +import { escapeRegExp } from './escapeRegExp'; + // deeply re-export, for convenience export * from '@typescript-eslint/utils/dist/ast-utils'; diff --git a/packages/eslint-plugin/src/util/collectUnusedVariables.ts b/packages/eslint-plugin/src/util/collectUnusedVariables.ts index 6fe14b0d272..ba3beb6861d 100644 --- a/packages/eslint-plugin/src/util/collectUnusedVariables.ts +++ b/packages/eslint-plugin/src/util/collectUnusedVariables.ts @@ -1,12 +1,12 @@ +import { ImplicitLibVariable } from '@typescript-eslint/scope-manager'; +import { Visitor } from '@typescript-eslint/scope-manager/dist/referencer/Visitor'; +import type { TSESTree } from '@typescript-eslint/utils'; import { AST_NODE_TYPES, - TSESLint, ASTUtils, - TSESTree, ESLintUtils, + TSESLint, } from '@typescript-eslint/utils'; -import { ImplicitLibVariable } from '@typescript-eslint/scope-manager'; -import { Visitor } from '@typescript-eslint/scope-manager/dist/referencer/Visitor'; class UnusedVarsVisitor< TMessageIds extends string, diff --git a/packages/eslint-plugin/src/util/explicitReturnTypeUtils.ts b/packages/eslint-plugin/src/util/explicitReturnTypeUtils.ts index 4d4ec6023a7..3ba5f4fac64 100644 --- a/packages/eslint-plugin/src/util/explicitReturnTypeUtils.ts +++ b/packages/eslint-plugin/src/util/explicitReturnTypeUtils.ts @@ -1,10 +1,7 @@ -import { - TSESTree, - AST_NODE_TYPES, - ESLintUtils, - TSESLint, -} from '@typescript-eslint/utils'; -import { isTypeAssertion, isConstructor, isSetter } from './astUtils'; +import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES, ESLintUtils } from '@typescript-eslint/utils'; + +import { isConstructor, isSetter, isTypeAssertion } from './astUtils'; import { getFunctionHeadLoc } from './getFunctionHeadLoc'; type FunctionExpression = diff --git a/packages/eslint-plugin/src/util/getESLintCoreRule.ts b/packages/eslint-plugin/src/util/getESLintCoreRule.ts index 5ba9ae36965..80962a677b0 100644 --- a/packages/eslint-plugin/src/util/getESLintCoreRule.ts +++ b/packages/eslint-plugin/src/util/getESLintCoreRule.ts @@ -5,12 +5,14 @@ import * as semver from 'semver'; const isESLintV8 = semver.major(version) >= 8; interface RuleMap { + /* eslint-disable @typescript-eslint/consistent-type-imports -- more concise to use inline imports */ 'arrow-parens': typeof import('eslint/lib/rules/arrow-parens'); 'brace-style': typeof import('eslint/lib/rules/brace-style'); 'comma-dangle': typeof import('eslint/lib/rules/comma-dangle'); 'dot-notation': typeof import('eslint/lib/rules/dot-notation'); indent: typeof import('eslint/lib/rules/indent'); 'init-declarations': typeof import('eslint/lib/rules/init-declarations'); + 'key-spacing': typeof import('eslint/lib/rules/key-spacing'); 'keyword-spacing': typeof import('eslint/lib/rules/keyword-spacing'); 'lines-between-class-members': typeof import('eslint/lib/rules/lines-between-class-members'); 'no-dupe-args': typeof import('eslint/lib/rules/no-dupe-args'); @@ -36,6 +38,7 @@ interface RuleMap { 'space-before-blocks': typeof import('eslint/lib/rules/space-before-blocks'); 'space-infix-ops': typeof import('eslint/lib/rules/space-infix-ops'); strict: typeof import('eslint/lib/rules/strict'); + /* eslint-enable @typescript-eslint/consistent-type-imports */ } type RuleId = keyof RuleMap; diff --git a/packages/eslint-plugin/src/util/getFunctionHeadLoc.ts b/packages/eslint-plugin/src/util/getFunctionHeadLoc.ts index a9d30838d2d..48c25b38f0d 100644 --- a/packages/eslint-plugin/src/util/getFunctionHeadLoc.ts +++ b/packages/eslint-plugin/src/util/getFunctionHeadLoc.ts @@ -1,9 +1,5 @@ -import { - AST_NODE_TYPES, - AST_TOKEN_TYPES, - TSESLint, - TSESTree, -} from '@typescript-eslint/utils'; +import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES, AST_TOKEN_TYPES } from '@typescript-eslint/utils'; type FunctionNode = | TSESTree.ArrowFunctionExpression diff --git a/packages/eslint-plugin/src/util/getStringLength.ts b/packages/eslint-plugin/src/util/getStringLength.ts new file mode 100644 index 00000000000..65a22551949 --- /dev/null +++ b/packages/eslint-plugin/src/util/getStringLength.ts @@ -0,0 +1,17 @@ +import GraphemeSplitter from 'grapheme-splitter'; + +let splitter: GraphemeSplitter; + +function isASCII(value: string): boolean { + return /^[\u0020-\u007f]*$/u.test(value); +} + +export function getStringLength(value: string): number { + if (isASCII(value)) { + return value.length; + } + + splitter ??= new GraphemeSplitter(); + + return splitter.countGraphemes(value); +} diff --git a/packages/eslint-plugin/src/util/getThisExpression.ts b/packages/eslint-plugin/src/util/getThisExpression.ts index 73405464b3f..7a5bcd6ebfd 100644 --- a/packages/eslint-plugin/src/util/getThisExpression.ts +++ b/packages/eslint-plugin/src/util/getThisExpression.ts @@ -1,4 +1,5 @@ -import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; export function getThisExpression( node: TSESTree.Node, diff --git a/packages/eslint-plugin/src/util/getWrappingFixer.ts b/packages/eslint-plugin/src/util/getWrappingFixer.ts index af7885efc41..0f867033b04 100644 --- a/packages/eslint-plugin/src/util/getWrappingFixer.ts +++ b/packages/eslint-plugin/src/util/getWrappingFixer.ts @@ -1,9 +1,5 @@ -import { - AST_NODE_TYPES, - TSESLint, - ASTUtils, - TSESTree, -} from '@typescript-eslint/utils'; +import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES, ASTUtils } from '@typescript-eslint/utils'; interface WrappingFixerParams { /** Source code. */ diff --git a/packages/eslint-plugin/src/util/index.ts b/packages/eslint-plugin/src/util/index.ts index 98ef1cf8707..53a19a96d36 100644 --- a/packages/eslint-plugin/src/util/index.ts +++ b/packages/eslint-plugin/src/util/index.ts @@ -5,13 +5,14 @@ export * from './collectUnusedVariables'; export * from './createRule'; export * from './getFunctionHeadLoc'; export * from './getOperatorPrecedence'; +export * from './getStringLength'; export * from './getThisExpression'; export * from './getWrappingFixer'; -export * from './misc'; -export * from './objectIterators'; +export * from './isNodeEqual'; export * from './isNullLiteral'; export * from './isUndefinedIdentifier'; -export * from './isNodeEqual'; +export * from './misc'; +export * from './objectIterators'; // this is done for convenience - saves migrating all of the old rules export * from '@typescript-eslint/type-utils'; diff --git a/packages/eslint-plugin/src/util/isNodeEqual.ts b/packages/eslint-plugin/src/util/isNodeEqual.ts index ef879163ee4..d783d818428 100644 --- a/packages/eslint-plugin/src/util/isNodeEqual.ts +++ b/packages/eslint-plugin/src/util/isNodeEqual.ts @@ -1,4 +1,5 @@ -import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; export function isNodeEqual(a: TSESTree.Node, b: TSESTree.Node): boolean { if (a.type !== b.type) { diff --git a/packages/eslint-plugin/src/util/isNullLiteral.ts b/packages/eslint-plugin/src/util/isNullLiteral.ts index e700e415f63..85bf4588212 100644 --- a/packages/eslint-plugin/src/util/isNullLiteral.ts +++ b/packages/eslint-plugin/src/util/isNullLiteral.ts @@ -1,5 +1,6 @@ -import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; export function isNullLiteral(i: TSESTree.Node): boolean { - return i.type === AST_NODE_TYPES.Literal && i.value === null; + return i.type === AST_NODE_TYPES.Literal && i.value == null; } diff --git a/packages/eslint-plugin/src/util/isUndefinedIdentifier.ts b/packages/eslint-plugin/src/util/isUndefinedIdentifier.ts index 91cae07aa81..75c301a1ea4 100644 --- a/packages/eslint-plugin/src/util/isUndefinedIdentifier.ts +++ b/packages/eslint-plugin/src/util/isUndefinedIdentifier.ts @@ -1,4 +1,5 @@ -import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; export function isUndefinedIdentifier(i: TSESTree.Node): boolean { return i.type === AST_NODE_TYPES.Identifier && i.name === 'undefined'; diff --git a/packages/eslint-plugin/src/util/misc.ts b/packages/eslint-plugin/src/util/misc.ts index 2a9046854a3..8362736bd62 100644 --- a/packages/eslint-plugin/src/util/misc.ts +++ b/packages/eslint-plugin/src/util/misc.ts @@ -2,8 +2,9 @@ * @fileoverview Really small utility functions that didn't deserve their own files */ -import { AST_NODE_TYPES, TSESLint, TSESTree } from '@typescript-eslint/utils'; import { requiresQuoting } from '@typescript-eslint/type-utils'; +import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; import * as ts from 'typescript'; const DEFINITION_EXTENSIONS = [ @@ -179,6 +180,42 @@ function formatWordList(words: string[]): string { return [words.slice(0, -1).join(', '), words.slice(-1)[0]].join(' and '); } +/** + * Iterates the array in reverse and returns the index of the first element it + * finds which passes the predicate function. + * + * @returns Returns the index of the element if it finds it or -1 otherwise. + */ +function findLastIndex( + members: T[], + predicate: (member: T) => boolean | undefined | null, +): number { + let idx = members.length - 1; + + while (idx >= 0) { + const valid = predicate(members[idx]); + if (valid) { + return idx; + } + idx--; + } + + return -1; +} + +function typeNodeRequiresParentheses( + node: TSESTree.TypeNode, + text: string, +): boolean { + return ( + node.type === AST_NODE_TYPES.TSFunctionType || + node.type === AST_NODE_TYPES.TSConstructorType || + node.type === AST_NODE_TYPES.TSConditionalType || + (node.type === AST_NODE_TYPES.TSUnionType && text.startsWith('|')) || + (node.type === AST_NODE_TYPES.TSIntersectionType && text.startsWith('&')) + ); +} + export { arrayGroupByToMap, arraysAreEqual, @@ -192,5 +229,7 @@ export { isDefinitionFile, MemberNameType, RequireKeys, + typeNodeRequiresParentheses, upperCaseFirst, + findLastIndex, }; diff --git a/packages/eslint-plugin/tests/RuleTester.ts b/packages/eslint-plugin/tests/RuleTester.ts index 7479d99f29a..7c46b9a12f5 100644 --- a/packages/eslint-plugin/tests/RuleTester.ts +++ b/packages/eslint-plugin/tests/RuleTester.ts @@ -6,5 +6,10 @@ function getFixturesRootDir(): string { } const { batchedSingleLineTests, RuleTester, noFormat } = ESLintUtils; +export { + RunTests, + ValidTestCase, + InvalidTestCase, +} from '@typescript-eslint/utils/dist/eslint-utils/rule-tester/RuleTester'; export { batchedSingleLineTests, getFixturesRootDir, noFormat, RuleTester }; diff --git a/packages/eslint-plugin/tests/configs.test.ts b/packages/eslint-plugin/tests/configs.test.ts index a7966573027..a52f1d93ace 100644 --- a/packages/eslint-plugin/tests/configs.test.ts +++ b/packages/eslint-plugin/tests/configs.test.ts @@ -1,5 +1,5 @@ -import rules from '../src/rules'; import plugin from '../src/index'; +import rules from '../src/rules'; const RULE_NAME_PREFIX = '@typescript-eslint/'; const EXTENSION_RULES = Object.entries(rules) diff --git a/packages/eslint-plugin/tests/docs.test.ts b/packages/eslint-plugin/tests/docs.test.ts index 7ab1095f4ad..e7872a962c9 100644 --- a/packages/eslint-plugin/tests/docs.test.ts +++ b/packages/eslint-plugin/tests/docs.test.ts @@ -1,10 +1,9 @@ import fs from 'fs'; -import { JSONSchema4 } from 'json-schema'; +import { marked } from 'marked'; import path from 'path'; +import { titleCase } from 'title-case'; -import { marked } from 'marked'; import rules from '../src/rules'; -import { titleCase } from 'title-case'; const docsRoot = path.resolve(__dirname, '../docs/rules'); const rulesData = Object.entries(rules); @@ -18,22 +17,8 @@ function parseMarkdownFile(filePath: string): marked.TokensList { }); } -function isEmptySchema(schema: JSONSchema4 | JSONSchema4[]): boolean { - return Array.isArray(schema) - ? schema.length === 0 - : Object.keys(schema).length === 0; -} - type TokenType = marked.Token['type']; -function tokenAs( - token: marked.Token, - type: Type, -): marked.Token & { type: Type } { - expect(token.type).toBe(type); - return token as marked.Token & { type: Type }; -} - function tokenIs( token: marked.Token, type: Type, @@ -41,8 +26,16 @@ function tokenIs( return token.type === type; } -function tokenIsH2(token: marked.Token): token is marked.Tokens.Heading { - return tokenIs(token, 'heading') && token.depth === 2; +function tokenIsHeading(token: marked.Token): token is marked.Tokens.Heading { + return tokenIs(token, 'heading'); +} + +function tokenIsH2( + token: marked.Token, +): token is marked.Tokens.Heading & { depth: 2 } { + return ( + tokenIsHeading(token) && token.depth === 2 && !/[a-z]+: /.test(token.text) + ); } describe('Validating rule docs', () => { @@ -64,13 +57,28 @@ describe('Validating rule docs', () => { }); for (const [ruleName, rule] of rulesData) { - describe(ruleName, () => { - const filePath = path.join(docsRoot, `${ruleName}.md`); + const { description } = rule.meta.docs!; - test(`${ruleName}.md must start with blockquote directing to website`, () => { - const tokens = parseMarkdownFile(filePath); + describe(`${ruleName}.md`, () => { + const filePath = path.join(docsRoot, `${ruleName}.md`); + const tokens = parseMarkdownFile(filePath); + test(`${ruleName}.md must start with frontmatter description`, () => { expect(tokens[0]).toMatchObject({ + raw: '---\n', + type: 'hr', + }); + expect(tokens[1]).toMatchObject({ + text: description.includes("'") + ? `description: "${description}."` + : `description: '${description}.'`, + depth: 2, + type: 'heading', + }); + }); + + test(`${ruleName}.md must next have a blockquote directing to website`, () => { + expect(tokens[2]).toMatchObject({ text: [ `🛑 This file is source code, not the primary documentation location! 🛑`, ``, @@ -81,9 +89,7 @@ describe('Validating rule docs', () => { }); }); - it(`Headers in ${ruleName}.md must be title-cased`, () => { - const tokens = parseMarkdownFile(filePath); - + test(`headers must be title-cased`, () => { // Get all H2 headers objects as the other levels are variable by design. const headers = tokens.filter(tokenIsH2); @@ -92,46 +98,21 @@ describe('Validating rule docs', () => { ); }); - it(`Options in ${ruleName}.md must match the rule meta`, () => { - // TODO(#4365): We don't yet enforce formatting for all rules. - if ( - !isEmptySchema(rule.meta.schema) || - !rule.meta.docs?.recommended || - rule.meta.docs.extendsBaseRule - ) { - return; - } + const importantHeadings = new Set([ + 'How to Use', + 'Options', + 'Related To', + 'When Not To Use It', + ]); - const tokens = parseMarkdownFile(filePath); + test('important headings must be h2s', () => { + const headers = tokens.filter(tokenIsHeading); - const optionsIndex = tokens.findIndex( - token => tokenIsH2(token) && token.text === 'Options', - ); - expect(optionsIndex).toBeGreaterThan(0); - - const codeBlock = tokenAs(tokens[optionsIndex + 1], 'code'); - tokenAs(tokens[optionsIndex + 2], 'space'); - const descriptionBlock = tokenAs(tokens[optionsIndex + 3], 'paragraph'); - - expect(codeBlock).toMatchObject({ - lang: 'jsonc', - text: ` -// .eslintrc.json -{ - "rules": { - "@typescript-eslint/${ruleName}": "${ - rule.meta.docs.recommended === 'strict' - ? 'warn' - : rule.meta.docs.recommended - }" - } -} - `.trim(), - type: 'code', - }); - expect(descriptionBlock).toMatchObject({ - text: 'This rule is not configurable.', - }); + for (const header of headers) { + if (importantHeadings.has(header.raw.replace(/#/g, '').trim())) { + expect(header.depth).toBe(2); + } + } }); }); } diff --git a/packages/eslint-plugin/tests/eslint-rules/arrow-parens.test.ts b/packages/eslint-plugin/tests/eslint-rules/arrow-parens.test.ts index 495bbe97e69..664392b0923 100644 --- a/packages/eslint-plugin/tests/eslint-rules/arrow-parens.test.ts +++ b/packages/eslint-plugin/tests/eslint-rules/arrow-parens.test.ts @@ -1,5 +1,5 @@ import { getESLintCoreRule } from '../../src/util/getESLintCoreRule'; -import { RuleTester, noFormat } from '../RuleTester'; +import { noFormat, RuleTester } from '../RuleTester'; const rule = getESLintCoreRule('arrow-parens'); diff --git a/packages/eslint-plugin/tests/rules/adjacent-overload-signatures.test.ts b/packages/eslint-plugin/tests/rules/adjacent-overload-signatures.test.ts index 12cf859a84a..9a20771b4af 100644 --- a/packages/eslint-plugin/tests/rules/adjacent-overload-signatures.test.ts +++ b/packages/eslint-plugin/tests/rules/adjacent-overload-signatures.test.ts @@ -250,12 +250,64 @@ class Test { '#private'(): void; '#private'(arg: number): void {} +} + `, + // block statement + ` +function wrap() { + function foo(s: string); + function foo(n: number); + function foo(sn: string | number) {} +} + `, + ` +if (true) { + function foo(s: string); + function foo(n: number); + function foo(sn: string | number) {} } `, ], invalid: [ { code: ` +function wrap() { + function foo(s: string); + function foo(n: number); + type bar = number; + function foo(sn: string | number) {} +} + `, + errors: [ + { + messageId: 'adjacentSignature', + data: { name: 'foo' }, + line: 6, + column: 3, + }, + ], + }, + { + code: ` +if (true) { + function foo(s: string); + function foo(n: number); + let a = 1; + function foo(sn: string | number) {} + foo(a); +} + `, + errors: [ + { + messageId: 'adjacentSignature', + data: { name: 'foo' }, + line: 6, + column: 3, + }, + ], + }, + { + code: ` export function foo(s: string); export function foo(n: number); export function bar(): void {} diff --git a/packages/eslint-plugin/tests/rules/array-type.test.ts b/packages/eslint-plugin/tests/rules/array-type.test.ts index b2c6a5d177d..04ab47d0b8a 100644 --- a/packages/eslint-plugin/tests/rules/array-type.test.ts +++ b/packages/eslint-plugin/tests/rules/array-type.test.ts @@ -1,6 +1,8 @@ -import { TSESLint } from '@typescript-eslint/utils'; import * as parser from '@typescript-eslint/parser'; -import rule, { OptionString } from '../../src/rules/array-type'; +import { TSESLint } from '@typescript-eslint/utils'; + +import type { OptionString } from '../../src/rules/array-type'; +import rule from '../../src/rules/array-type'; import { RuleTester } from '../RuleTester'; const ruleTester = new RuleTester({ @@ -1980,6 +1982,61 @@ class Foo extends Bar implements Baz { } `, ); + testOutput( + 'array', + ` +interface WorkingArray { + outerProperty: Array< + { innerPropertyOne: string } & { innerPropertyTwo: string } + >; +} + +interface BrokenArray { + outerProperty: Array< + ({ innerPropertyOne: string } & { innerPropertyTwo: string }) + >; +} + `, + ` +interface WorkingArray { + outerProperty: ({ innerPropertyOne: string } & { innerPropertyTwo: string })[]; +} + +interface BrokenArray { + outerProperty: ({ innerPropertyOne: string } & { innerPropertyTwo: string })[]; +} + `, + ); + testOutput( + 'array', + ` +type WorkingArray = { + outerProperty: Array< + { innerPropertyOne: string } & { innerPropertyTwo: string } + >; +} + +type BrokenArray = { + outerProperty: Array< + ({ innerPropertyOne: string } & { innerPropertyTwo: string }) + >; +} + `, + ` +type WorkingArray = { + outerProperty: ({ innerPropertyOne: string } & { innerPropertyTwo: string })[]; +} + +type BrokenArray = { + outerProperty: ({ innerPropertyOne: string } & { innerPropertyTwo: string })[]; +} + `, + ); + testOutput( + 'array', + 'const a: Array<(string|number)>;', + 'const a: (string|number)[];', + ); testOutput( 'array-simple', 'let xx: Array> = [[1, 2], [3]];', diff --git a/packages/eslint-plugin/tests/rules/await-thenable.test.ts b/packages/eslint-plugin/tests/rules/await-thenable.test.ts index ecaff147c5f..3dc786896c0 100644 --- a/packages/eslint-plugin/tests/rules/await-thenable.test.ts +++ b/packages/eslint-plugin/tests/rules/await-thenable.test.ts @@ -1,5 +1,5 @@ import rule from '../../src/rules/await-thenable'; -import { RuleTester, getFixturesRootDir } from '../RuleTester'; +import { getFixturesRootDir, RuleTester } from '../RuleTester'; const rootDir = getFixturesRootDir(); const messageId = 'await'; diff --git a/packages/eslint-plugin/tests/rules/ban-ts-comment.test.ts b/packages/eslint-plugin/tests/rules/ban-ts-comment.test.ts index 3843df63ef4..54855f19cf3 100644 --- a/packages/eslint-plugin/tests/rules/ban-ts-comment.test.ts +++ b/packages/eslint-plugin/tests/rules/ban-ts-comment.test.ts @@ -1,5 +1,5 @@ import rule from '../../src/rules/ban-ts-comment'; -import { RuleTester, noFormat } from '../RuleTester'; +import { noFormat, RuleTester } from '../RuleTester'; const ruleTester = new RuleTester({ parser: '@typescript-eslint/parser', @@ -45,6 +45,14 @@ ruleTester.run('ts-expect-error', rule, { }, ], }, + { + code: noFormat`// @ts-expect-error 👨‍👩‍👧‍👦👨‍👩‍👧‍👦👨‍👩‍👧‍👦`, + options: [ + { + 'ts-expect-error': 'allow-with-description', + }, + ], + }, ], invalid: [ { @@ -228,6 +236,22 @@ if (false) { }, ], }, + { + code: noFormat`// @ts-expect-error 👨‍👩‍👧‍👦`, + options: [ + { + 'ts-expect-error': 'allow-with-description', + }, + ], + errors: [ + { + data: { directive: 'expect-error', minimumDescriptionLength: 3 }, + messageId: 'tsDirectiveCommentRequiresDescription', + line: 1, + column: 1, + }, + ], + }, ], }); @@ -266,6 +290,14 @@ ruleTester.run('ts-ignore', rule, { }, ], }, + { + code: noFormat`// @ts-ignore 👨‍👩‍👧‍👦👨‍👩‍👧‍👦👨‍👩‍👧‍👦`, + options: [ + { + 'ts-ignore': 'allow-with-description', + }, + ], + }, ], invalid: [ { @@ -460,6 +492,22 @@ if (false) { }, ], }, + { + code: noFormat`// @ts-ignore 👨‍👩‍👧‍👦`, + options: [ + { + 'ts-ignore': 'allow-with-description', + }, + ], + errors: [ + { + data: { directive: 'ignore', minimumDescriptionLength: 3 }, + messageId: 'tsDirectiveCommentRequiresDescription', + line: 1, + column: 1, + }, + ], + }, ], }); @@ -498,6 +546,14 @@ ruleTester.run('ts-nocheck', rule, { }, ], }, + { + code: noFormat`// @ts-nocheck 👨‍👩‍👧‍👦👨‍👩‍👧‍👦👨‍👩‍👧‍👦`, + options: [ + { + 'ts-nocheck': 'allow-with-description', + }, + ], + }, ], invalid: [ { @@ -668,6 +724,22 @@ if (false) { }, ], }, + { + code: noFormat`// @ts-nocheck 👨‍👩‍👧‍👦`, + options: [ + { + 'ts-nocheck': 'allow-with-description', + }, + ], + errors: [ + { + data: { directive: 'nocheck', minimumDescriptionLength: 3 }, + messageId: 'tsDirectiveCommentRequiresDescription', + line: 1, + column: 1, + }, + ], + }, ], }); @@ -700,6 +772,14 @@ ruleTester.run('ts-check', rule, { }, ], }, + { + code: noFormat`// @ts-check 👨‍👩‍👧‍👦👨‍👩‍👧‍👦👨‍👩‍👧‍👦`, + options: [ + { + 'ts-check': 'allow-with-description', + }, + ], + }, ], invalid: [ { @@ -863,5 +943,21 @@ if (false) { }, ], }, + { + code: noFormat`// @ts-check 👨‍👩‍👧‍👦`, + options: [ + { + 'ts-check': 'allow-with-description', + }, + ], + errors: [ + { + data: { directive: 'check', minimumDescriptionLength: 3 }, + messageId: 'tsDirectiveCommentRequiresDescription', + line: 1, + column: 1, + }, + ], + }, ], }); diff --git a/packages/eslint-plugin/tests/rules/ban-types.test.ts b/packages/eslint-plugin/tests/rules/ban-types.test.ts index a200336e0aa..7883f0f45df 100644 --- a/packages/eslint-plugin/tests/rules/ban-types.test.ts +++ b/packages/eslint-plugin/tests/rules/ban-types.test.ts @@ -1,10 +1,8 @@ /* eslint-disable @typescript-eslint/internal/prefer-ast-types-enum */ -import { TSESLint } from '@typescript-eslint/utils'; -import rule, { - MessageIds, - Options, - TYPE_KEYWORDS, -} from '../../src/rules/ban-types'; +import type { TSESLint } from '@typescript-eslint/utils'; + +import type { MessageIds, Options } from '../../src/rules/ban-types'; +import rule, { TYPE_KEYWORDS } from '../../src/rules/ban-types'; import { objectReduceKey } from '../../src/util'; import { noFormat, RuleTester } from '../RuleTester'; @@ -469,7 +467,7 @@ let baz: object = {}; }, { code: noFormat`let a: Foo< F >;`, - output: noFormat`let a: Foo< T >;`, + output: `let a: Foo< T >;`, errors: [ { messageId: 'bannedTypeMessage', diff --git a/packages/eslint-plugin/tests/rules/class-literal-property-style.test.ts b/packages/eslint-plugin/tests/rules/class-literal-property-style.test.ts index 19d5fb183b5..af0aa203df7 100644 --- a/packages/eslint-plugin/tests/rules/class-literal-property-style.test.ts +++ b/packages/eslint-plugin/tests/rules/class-literal-property-style.test.ts @@ -1,5 +1,5 @@ import rule from '../../src/rules/class-literal-property-style'; -import { RuleTester, noFormat } from '../RuleTester'; +import { RuleTester } from '../RuleTester'; const ruleTester = new RuleTester({ parser: '@typescript-eslint/parser', @@ -311,7 +311,7 @@ class Mx { public readonly [myValue] = 'a literal value'; } `, - output: noFormat` + output: ` class Mx { public get [myValue]() { return 'a literal value'; } } @@ -331,7 +331,7 @@ class Mx { readonly p1 = 'hello world'; } `, - output: noFormat` + output: ` class Mx { get p1() { return 'hello world'; } } @@ -351,7 +351,7 @@ class Mx { readonly p1 = \`hello world\`; } `, - output: noFormat` + output: ` class Mx { get p1() { return \`hello world\`; } } @@ -371,7 +371,7 @@ class Mx { static readonly p1 = 'hello world'; } `, - output: noFormat` + output: ` class Mx { static get p1() { return 'hello world'; } } @@ -413,7 +413,7 @@ class Mx { protected readonly p1 = 'hello world'; } `, - output: noFormat` + output: ` class Mx { protected get p1() { return 'hello world'; } } @@ -454,7 +454,7 @@ class Mx { public static readonly p1 = 'hello world'; } `, - output: noFormat` + output: ` class Mx { public static get p1() { return 'hello world'; } } @@ -483,7 +483,7 @@ class Mx { } } `, - output: noFormat` + output: ` class Mx { public readonly myValue = gql\` { @@ -516,7 +516,7 @@ class Mx { \`; } `, - output: noFormat` + output: ` class Mx { public get myValue() { return gql\` { diff --git a/packages/eslint-plugin/tests/rules/consistent-generic-constructors.test.ts b/packages/eslint-plugin/tests/rules/consistent-generic-constructors.test.ts index bdfb68e2788..1ef61f7e55b 100644 --- a/packages/eslint-plugin/tests/rules/consistent-generic-constructors.test.ts +++ b/packages/eslint-plugin/tests/rules/consistent-generic-constructors.test.ts @@ -1,5 +1,5 @@ import rule from '../../src/rules/consistent-generic-constructors'; -import { RuleTester, noFormat } from '../RuleTester'; +import { noFormat, RuleTester } from '../RuleTester'; const ruleTester = new RuleTester({ parser: '@typescript-eslint/parser', @@ -100,7 +100,7 @@ class Foo { messageId: 'preferConstructor', }, ], - output: noFormat`const a = new Map();`, + output: `const a = new Map();`, }, { code: noFormat`const a: Map< string, number > = new Map();`, @@ -109,7 +109,7 @@ class Foo { messageId: 'preferConstructor', }, ], - output: noFormat`const a = new Map< string, number >();`, + output: `const a = new Map< string, number >();`, }, { code: noFormat`const a: Map = new Map ();`, @@ -118,7 +118,7 @@ class Foo { messageId: 'preferConstructor', }, ], - output: noFormat`const a = new Map ();`, + output: `const a = new Map ();`, }, { code: noFormat`const a: Foo = new Foo;`, @@ -127,7 +127,7 @@ class Foo { messageId: 'preferConstructor', }, ], - output: noFormat`const a = new Foo();`, + output: `const a = new Foo();`, }, { code: 'const a: /* comment */ Foo/* another */ = new Foo();', @@ -136,7 +136,7 @@ class Foo { messageId: 'preferConstructor', }, ], - output: noFormat`const a = new Foo/* comment *//* another */();`, + output: `const a = new Foo/* comment *//* another */();`, }, { code: 'const a: Foo/* comment */ = new Foo /* another */();', @@ -145,7 +145,7 @@ class Foo { messageId: 'preferConstructor', }, ], - output: noFormat`const a = new Foo/* comment */ /* another */();`, + output: `const a = new Foo/* comment */ /* another */();`, }, { code: noFormat`const a: Foo = new \n Foo \n ();`, @@ -154,7 +154,7 @@ class Foo { messageId: 'preferConstructor', }, ], - output: noFormat`const a = new \n Foo \n ();`, + output: `const a = new \n Foo \n ();`, }, { code: ` @@ -218,7 +218,7 @@ class Foo { messageId: 'preferTypeAnnotation', }, ], - output: noFormat`const a: Map = new Map ();`, + output: `const a: Map = new Map ();`, }, { code: noFormat`const a = new Map< string, number >();`, @@ -228,7 +228,7 @@ class Foo { messageId: 'preferTypeAnnotation', }, ], - output: noFormat`const a: Map< string, number > = new Map();`, + output: `const a: Map< string, number > = new Map();`, }, { code: noFormat`const a = new \n Foo \n ();`, @@ -238,7 +238,7 @@ class Foo { messageId: 'preferTypeAnnotation', }, ], - output: noFormat`const a: Foo = new \n Foo \n ();`, + output: `const a: Foo = new \n Foo \n ();`, }, { code: 'const a = new Foo/* comment */ /* another */();', @@ -248,7 +248,7 @@ class Foo { messageId: 'preferTypeAnnotation', }, ], - output: noFormat`const a: Foo = new Foo/* comment */ /* another */();`, + output: `const a: Foo = new Foo/* comment */ /* another */();`, }, { code: 'const a = new Foo();', @@ -258,7 +258,7 @@ class Foo { messageId: 'preferTypeAnnotation', }, ], - output: noFormat`const a: Foo = new Foo();`, + output: `const a: Foo = new Foo();`, }, { code: ` diff --git a/packages/eslint-plugin/tests/rules/consistent-indexed-object-style.test.ts b/packages/eslint-plugin/tests/rules/consistent-indexed-object-style.test.ts index b02fd3dfa2d..6bdc76362e0 100644 --- a/packages/eslint-plugin/tests/rules/consistent-indexed-object-style.test.ts +++ b/packages/eslint-plugin/tests/rules/consistent-indexed-object-style.test.ts @@ -39,7 +39,16 @@ interface Foo { [key: string]: Foo; } `, - + ` +interface Foo { + [key: string]: Foo; +} + `, + ` +interface Foo { + [key: string]: Foo | string; +} + `, // Type literal 'type Foo = {};', ` @@ -194,11 +203,7 @@ interface B extends A { [index: number]: unknown; } `, - output: ` -interface B extends A { - [index: number]: unknown; -} - `, + output: null, errors: [{ messageId: 'preferRecord', line: 2, column: 1 }], }, // Readonly interface with generic parameter @@ -332,6 +337,17 @@ type Foo = Readonly>; }, { code: ` +interface Foo { + [k: string]: T; +} + `, + output: ` +type Foo = Record; + `, + errors: [{ messageId: 'preferRecord', line: 2, column: 1 }], + }, + { + code: ` interface Foo { [k: string]: A.Foo; } diff --git a/packages/eslint-plugin/tests/rules/consistent-type-assertions.test.ts b/packages/eslint-plugin/tests/rules/consistent-type-assertions.test.ts index a1d8e47645a..98fcdc02605 100644 --- a/packages/eslint-plugin/tests/rules/consistent-type-assertions.test.ts +++ b/packages/eslint-plugin/tests/rules/consistent-type-assertions.test.ts @@ -1,5 +1,5 @@ import rule from '../../src/rules/consistent-type-assertions'; -import { RuleTester, batchedSingleLineTests } from '../RuleTester'; +import { batchedSingleLineTests, RuleTester } from '../RuleTester'; const ruleTester = new RuleTester({ parser: '@typescript-eslint/parser', @@ -69,7 +69,7 @@ ruleTester.run('consistent-type-assertions', rule, { ], }), ...batchedSingleLineTests({ - code: `${OBJECT_LITERAL_AS_CASTS.trimRight()}${OBJECT_LITERAL_ARGUMENT_AS_CASTS}`, + code: `${OBJECT_LITERAL_AS_CASTS.trimEnd()}${OBJECT_LITERAL_ARGUMENT_AS_CASTS}`, options: [ { assertionStyle: 'as', @@ -78,7 +78,7 @@ ruleTester.run('consistent-type-assertions', rule, { ], }), ...batchedSingleLineTests({ - code: `${OBJECT_LITERAL_ANGLE_BRACKET_CASTS.trimRight()}${OBJECT_LITERAL_ARGUMENT_ANGLE_BRACKET_CASTS}`, + code: `${OBJECT_LITERAL_ANGLE_BRACKET_CASTS.trimEnd()}${OBJECT_LITERAL_ARGUMENT_ANGLE_BRACKET_CASTS}`, options: [ { assertionStyle: 'angle-bracket', @@ -287,7 +287,7 @@ ruleTester.run('consistent-type-assertions', rule, { ], }), ...batchedSingleLineTests({ - code: `${OBJECT_LITERAL_AS_CASTS.trimRight()}${OBJECT_LITERAL_ARGUMENT_AS_CASTS}`, + code: `${OBJECT_LITERAL_AS_CASTS.trimEnd()}${OBJECT_LITERAL_ARGUMENT_AS_CASTS}`, options: [ { assertionStyle: 'as', @@ -330,7 +330,7 @@ ruleTester.run('consistent-type-assertions', rule, { ], }), ...batchedSingleLineTests({ - code: `${OBJECT_LITERAL_ANGLE_BRACKET_CASTS.trimRight()}${OBJECT_LITERAL_ARGUMENT_ANGLE_BRACKET_CASTS}`, + code: `${OBJECT_LITERAL_ANGLE_BRACKET_CASTS.trimEnd()}${OBJECT_LITERAL_ARGUMENT_ANGLE_BRACKET_CASTS}`, options: [ { assertionStyle: 'angle-bracket', diff --git a/packages/eslint-plugin/tests/rules/consistent-type-definitions.test.ts b/packages/eslint-plugin/tests/rules/consistent-type-definitions.test.ts index 9bcd9574986..356162dcb6f 100644 --- a/packages/eslint-plugin/tests/rules/consistent-type-definitions.test.ts +++ b/packages/eslint-plugin/tests/rules/consistent-type-definitions.test.ts @@ -63,7 +63,7 @@ export type W = { invalid: [ { code: noFormat`type T = { x: number; };`, - output: noFormat`interface T { x: number; }`, + output: `interface T { x: number; }`, options: ['interface'], errors: [ { @@ -75,7 +75,7 @@ export type W = { }, { code: noFormat`type T={ x: number; };`, - output: noFormat`interface T { x: number; }`, + output: `interface T { x: number; }`, options: ['interface'], errors: [ { @@ -87,7 +87,7 @@ export type W = { }, { code: noFormat`type T= { x: number; };`, - output: noFormat`interface T { x: number; }`, + output: `interface T { x: number; }`, options: ['interface'], errors: [ { @@ -119,7 +119,7 @@ export interface W { }, { code: noFormat`interface T { x: number; }`, - output: noFormat`type T = { x: number; }`, + output: `type T = { x: number; }`, options: ['type'], errors: [ { @@ -131,7 +131,7 @@ export interface W { }, { code: noFormat`interface T{ x: number; }`, - output: noFormat`type T = { x: number; }`, + output: `type T = { x: number; }`, options: ['type'], errors: [ { @@ -143,7 +143,7 @@ export interface W { }, { code: noFormat`interface T { x: number; }`, - output: noFormat`type T = { x: number; }`, + output: `type T = { x: number; }`, options: ['type'], errors: [ { @@ -155,7 +155,7 @@ export interface W { }, { code: noFormat`interface A extends B, C { x: number; };`, - output: noFormat`type A = { x: number; } & B & C;`, + output: `type A = { x: number; } & B & C;`, options: ['type'], errors: [ { @@ -167,7 +167,7 @@ export interface W { }, { code: noFormat`interface A extends B, C { x: number; };`, - output: noFormat`type A = { x: number; } & B & C;`, + output: `type A = { x: number; } & B & C;`, options: ['type'], errors: [ { @@ -183,7 +183,7 @@ export interface W { x: T; } `, - output: noFormat` + output: ` export type W = { x: T; } @@ -205,7 +205,7 @@ namespace JSX { } } `, - output: noFormat` + output: ` namespace JSX { type Array = { foo(x: (x: number) => T): T[]; @@ -229,7 +229,7 @@ global { } } `, - output: noFormat` + output: ` global { type Array = { foo(x: (x: number) => T): T[]; @@ -289,7 +289,7 @@ export default interface Test { foo(): number; } `, - output: noFormat` + output: ` type Test = { bar(): string; foo(): number; @@ -336,7 +336,7 @@ export declare interface Test { bar: string; } `, - output: noFormat` + output: ` export declare type Test = { foo: string; bar: string; 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 da5068753ca..e5f7bfbc2d3 100644 --- a/packages/eslint-plugin/tests/rules/consistent-type-exports.test.ts +++ b/packages/eslint-plugin/tests/rules/consistent-type-exports.test.ts @@ -1,5 +1,5 @@ import rule from '../../src/rules/consistent-type-exports'; -import { RuleTester, getFixturesRootDir, noFormat } from '../RuleTester'; +import { getFixturesRootDir, noFormat, RuleTester } from '../RuleTester'; const rootDir = getFixturesRootDir(); @@ -106,7 +106,7 @@ export { CatchScope, } from '@typescript-eslint/scope-manager'; `, - output: noFormat` + output: ` export type { AnalyzeOptions, Definition } from '@typescript-eslint/scope-manager'; export { BlockScope, CatchScope } from '@typescript-eslint/scope-manager'; `, @@ -157,7 +157,7 @@ export { CatchScope as CScope, } from '@typescript-eslint/scope-manager'; `, - output: noFormat` + output: ` export type { Definition as Foo } from '@typescript-eslint/scope-manager'; export { BlockScope as BScope, CatchScope as CScope } from '@typescript-eslint/scope-manager'; `, @@ -266,6 +266,9 @@ export { type T, T }; type T = 1; export type { T, T }; `, + dependencyConstraints: { + typescript: '4.5', + }, errors: [ { messageId: 'typeOverValue', @@ -279,10 +282,13 @@ export type { T, T }; type T = 1; export { type/* */T, type /* */T, T }; `, - output: noFormat` + output: ` type T = 1; export type { /* */T, /* */T, T }; `, + dependencyConstraints: { + typescript: '4.5', + }, errors: [ { messageId: 'typeOverValue', @@ -303,6 +309,9 @@ const x = 1; export type { T, T }; export { x }; `, + dependencyConstraints: { + typescript: '4.5', + }, errors: [ { messageId: 'singleExportIsType', @@ -322,6 +331,9 @@ type T = 1; const x = 1; export { type T, x }; `, + dependencyConstraints: { + typescript: '4.5', + }, options: [{ fixMixedExportsWithInlineTypeSpecifier: true }], errors: [ { @@ -340,6 +352,9 @@ export { type T, T }; type T = 1; export type { T, T }; `, + dependencyConstraints: { + typescript: '4.5', + }, options: [{ fixMixedExportsWithInlineTypeSpecifier: true }], errors: [ { @@ -358,10 +373,13 @@ export { CatchScope as CScope, } from '@typescript-eslint/scope-manager'; `, - output: noFormat` + output: ` export type { AnalyzeOptions, Definition as Foo, BlockScope as BScope } from '@typescript-eslint/scope-manager'; export { CatchScope as CScope } from '@typescript-eslint/scope-manager'; `, + dependencyConstraints: { + typescript: '4.5', + }, options: [{ fixMixedExportsWithInlineTypeSpecifier: false }], errors: [ { @@ -380,7 +398,7 @@ export { CatchScope as CScope, } from '@typescript-eslint/scope-manager'; `, - output: noFormat` + output: ` export { type AnalyzeOptions, type Definition as Foo, @@ -388,6 +406,9 @@ export { CatchScope as CScope, } from '@typescript-eslint/scope-manager'; `, + dependencyConstraints: { + typescript: '4.5', + }, options: [{ fixMixedExportsWithInlineTypeSpecifier: true }], errors: [ { diff --git a/packages/eslint-plugin/tests/rules/consistent-type-imports.test.ts b/packages/eslint-plugin/tests/rules/consistent-type-imports.test.ts index ec78a1afd50..2d41b0c3f98 100644 --- a/packages/eslint-plugin/tests/rules/consistent-type-imports.test.ts +++ b/packages/eslint-plugin/tests/rules/consistent-type-imports.test.ts @@ -1,5 +1,5 @@ import rule from '../../src/rules/consistent-type-imports'; -import { RuleTester, noFormat, getFixturesRootDir } from '../RuleTester'; +import { getFixturesRootDir, noFormat, RuleTester } from '../RuleTester'; const ruleTester = new RuleTester({ parser: '@typescript-eslint/parser', @@ -7,6 +7,10 @@ const ruleTester = new RuleTester({ ecmaVersion: 2020, sourceType: 'module', }, + // type-only imports were first added in TS3.8 + dependencyConstraints: { + typescript: '3.8', + }, }); const withMetaParserOptions = { @@ -118,11 +122,83 @@ ruleTester.run('consistent-type-imports', rule, { `, options: [{ prefer: 'no-type-imports' }], }, + ` + import { type A } from 'foo'; + type T = A; + `, ` import { type A, B } from 'foo'; type T = A; const b = B; `, + ` + import { type A, type B } from 'foo'; + type T = A; + type Z = B; + `, + ` + import { B } from 'foo'; + import { type A } from 'foo'; + type T = A; + const b = B; + `, + { + code: ` + import { B, type A } from 'foo'; + type T = A; + const b = B; + `, + options: [{ fixStyle: 'inline-type-imports' }], + }, + { + code: ` + import { B } from 'foo'; + import type A from 'baz'; + type T = A; + const b = B; + `, + options: [{ fixStyle: 'inline-type-imports' }], + }, + { + code: ` + import { type B } from 'foo'; + import type { A } from 'foo'; + type T = A; + const b = B; + `, + options: [{ fixStyle: 'inline-type-imports' }], + }, + { + code: ` + import { B, type C } from 'foo'; + import type A from 'baz'; + type T = A; + type Z = C; + const b = B; + `, + options: [{ prefer: 'type-imports', fixStyle: 'inline-type-imports' }], + }, + { + code: ` + import { B } from 'foo'; + import type { A } from 'foo'; + type T = A; + const b = B; + `, + options: [{ prefer: 'type-imports', fixStyle: 'inline-type-imports' }], + }, + { + code: ` + import { B } from 'foo'; + import { A } from 'foo'; + type T = A; + const b = B; + `, + options: [{ prefer: 'no-type-imports', fixStyle: 'inline-type-imports' }], + dependencyConstraints: { + typescript: '4.5', + }, + }, // exports ` import Type from 'foo'; @@ -512,6 +588,24 @@ export type Y = { }, ], }, + { + code: ` + import Foo from 'foo'; + let foo: Foo; + `, + output: ` + import type Foo from 'foo'; + let foo: Foo; + `, + options: [{ prefer: 'type-imports', fixStyle: 'inline-type-imports' }], + errors: [ + { + messageId: 'typeOverValue', + line: 2, + column: 9, + }, + ], + }, { code: ` import { A, B } from 'foo'; @@ -661,7 +755,7 @@ let bar: B; import { A, B } from 'foo'; const foo: A = B(); `, - output: noFormat` + output: ` import type { A} from 'foo'; import { B } from 'foo'; const foo: A = B(); @@ -769,7 +863,7 @@ type T = A; import type { Already2 } from 'bar'; type T = { b: B; c: C; d: D }; `, - output: noFormat` + output: ` import type Already1Def from 'foo'; import type { Already1 , B } from 'foo'; import A from 'foo'; @@ -817,7 +911,7 @@ import { A, B, C } from 'foo'; import { D, E, F, } from 'bar'; type T = A | D; `, - output: noFormat` + output: ` import type { A} from 'foo'; import { B, C } from 'foo'; import type { D} from 'bar'; @@ -845,7 +939,7 @@ import { A, B, C } from 'foo'; import { D, E, F, } from 'bar'; type T = B | E; `, - output: noFormat` + output: ` import type { B} from 'foo'; import { A, C } from 'foo'; import type { E} from 'bar'; @@ -873,7 +967,7 @@ import { A, B, C } from 'foo'; import { D, E, F, } from 'bar'; type T = C | F; `, - output: noFormat` + output: ` import type { C } from 'foo'; import { A, B } from 'foo'; import type { F} from 'bar'; @@ -944,7 +1038,7 @@ import Value3, { Type3 } from 'default_import2'; import Type4, { Type5, Value4 } from 'default_and_named_import'; type T = Type1 | Type2 | Type3 | Type4 | Type5; `, - output: noFormat` + output: ` import type { Type1 } from 'named_import'; import { Value1 } from 'named_import'; import type Type2 from 'default_import'; @@ -1324,7 +1418,7 @@ import type /*comment*/ { Type } from 'foo'; type T = { a: AllType; b: DefType; c: Type }; `, options: [{ prefer: 'no-type-imports' }], - output: noFormat` + output: ` import /*comment*/ * as AllType from 'foo'; import // comment DefType from 'foo'; @@ -1437,7 +1531,7 @@ import Default /*comment1*/, /*comment2*/ { Data } from 'module'; const a: Default = ''; `, options: [{ prefer: 'type-imports' }], - output: noFormat` + output: ` import type Default /*comment1*/ from 'module'; import /*comment2*/ { Data } from 'module'; const a: Default = ''; @@ -1481,7 +1575,7 @@ const a: Default = ''; constructor(foo: Foo) {} } `, - output: noFormat` + output: ` import Foo from 'foo'; @deco class A { @@ -1506,7 +1600,7 @@ const a: Default = ''; constructor(foo: Foo) {} } `, - output: noFormat` + output: ` import { Foo } from 'foo'; @deco class A { @@ -1533,7 +1627,7 @@ const a: Default = ''; } type T = Bar; `, - output: noFormat` + output: ` import type { Type , Bar } from 'foo'; import { Foo } from 'foo'; @deco @@ -1562,7 +1656,7 @@ const a: Default = ''; foo(@deco bar: Bar) {} } `, - output: noFormat` + output: ` import { V , Foo, Bar} from 'foo'; import type { T } from 'foo'; @deco @@ -1590,7 +1684,7 @@ const a: Default = ''; constructor(foo: Foo) {} } `, - output: noFormat` + output: ` import type { T } from 'foo'; import { V , Foo} from 'foo'; @deco @@ -1616,7 +1710,7 @@ const a: Default = ''; constructor(foo: Type.Foo) {} } `, - output: noFormat` + output: ` import * as Type from 'foo'; @deco class A { @@ -1641,7 +1735,7 @@ const a: Default = ''; constructor(foo: Foo) {} } `, - output: noFormat` + output: ` import Foo from 'foo'; @deco class A { @@ -1666,7 +1760,7 @@ const a: Default = ''; constructor(foo: Foo) {} } `, - output: noFormat` + output: ` import { Foo } from 'foo'; @deco class A { @@ -1693,7 +1787,7 @@ const a: Default = ''; } type T = Bar; `, - output: noFormat` + output: ` import type { Type , Bar } from 'foo'; import { Foo } from 'foo'; @deco @@ -1722,7 +1816,7 @@ const a: Default = ''; foo(@deco bar: Bar) {} } `, - output: noFormat` + output: ` import { V , Foo, Bar} from 'foo'; import type { T } from 'foo'; @deco @@ -1750,7 +1844,7 @@ const a: Default = ''; constructor(foo: Foo) {} } `, - output: noFormat` + output: ` import type { T } from 'foo'; import { V , Foo} from 'foo'; @deco @@ -1776,7 +1870,7 @@ const a: Default = ''; constructor(foo: Type.Foo) {} } `, - output: noFormat` + output: ` import * as Type from 'foo'; @deco class A { @@ -1804,6 +1898,9 @@ import { A, B } from 'foo'; type T = A; const b = B; `, + dependencyConstraints: { + typescript: '4.5', + }, options: [{ prefer: 'no-type-imports' }], errors: [ { @@ -1818,12 +1915,15 @@ import { A, B, type C } from 'foo'; type T = A | C; const b = B; `, - output: noFormat` + output: ` import type { A} from 'foo'; import { B, type C } from 'foo'; type T = A | C; const b = B; `, + dependencyConstraints: { + typescript: '4.5', + }, options: [{ prefer: 'type-imports' }], errors: [ { @@ -1833,5 +1933,277 @@ const b = B; }, ], }, + + // inline-type-imports + { + code: ` + import { A, B } from 'foo'; + let foo: A; + let bar: B; + `, + output: ` + import { type A, type B } from 'foo'; + let foo: A; + let bar: B; + `, + options: [{ prefer: 'type-imports', fixStyle: 'inline-type-imports' }], + errors: [ + { + messageId: 'typeOverValue', + line: 2, + column: 9, + }, + ], + }, + { + code: ` + import { A, B } from 'foo'; + + let foo: A; + B(); + `, + output: ` + import { type A, B } from 'foo'; + + let foo: A; + B(); + `, + options: [{ prefer: 'type-imports', fixStyle: 'inline-type-imports' }], + errors: [ + { + messageId: 'aImportIsOnlyTypes', + line: 2, + column: 9, + }, + ], + }, + { + code: ` + import { A, B } from 'foo'; + type T = A; + B(); + `, + output: ` + import { type A, B } from 'foo'; + type T = A; + B(); + `, + options: [{ prefer: 'type-imports', fixStyle: 'inline-type-imports' }], + errors: [ + { + messageId: 'aImportIsOnlyTypes', + line: 2, + column: 9, + }, + ], + }, + { + code: ` + import { A } from 'foo'; + import { B } from 'foo'; + type T = A; + type U = B; + `, + output: ` + import { type A } from 'foo'; + import { type B } from 'foo'; + type T = A; + type U = B; + `, + options: [{ prefer: 'type-imports', fixStyle: 'inline-type-imports' }], + errors: [ + { + messageId: 'typeOverValue', + line: 2, + column: 9, + }, + { + messageId: 'typeOverValue', + line: 3, + column: 9, + }, + ], + }, + { + code: ` + import { A } from 'foo'; + import B from 'foo'; + type T = A; + type U = B; + `, + output: ` + import { type A } from 'foo'; + import type B from 'foo'; + type T = A; + type U = B; + `, + options: [{ prefer: 'type-imports', fixStyle: 'inline-type-imports' }], + errors: [ + { + messageId: 'typeOverValue', + line: 2, + column: 9, + }, + { + messageId: 'typeOverValue', + line: 3, + column: 9, + }, + ], + }, + { + code: ` +import A, { B, C } from 'foo'; +type T = B; +type U = C; +A(); + `, + output: ` +import A, { type B, type C } from 'foo'; +type T = B; +type U = C; +A(); + `, + options: [{ prefer: 'type-imports', fixStyle: 'inline-type-imports' }], + errors: [ + { + messageId: 'someImportsAreOnlyTypes', + line: 2, + column: 1, + }, + ], + }, + { + code: ` +import A, { B, C } from 'foo'; +type T = B; +type U = C; +type V = A; + `, + output: ` +import {type B, type C} from 'foo'; +import type A from 'foo'; +type T = B; +type U = C; +type V = A; + `, + options: [{ prefer: 'type-imports', fixStyle: 'inline-type-imports' }], + errors: [ + { + messageId: 'typeOverValue', + line: 2, + column: 1, + }, + ], + }, + { + code: ` +import A, { B, C as D } from 'foo'; +type T = B; +type U = D; +type V = A; + `, + output: ` +import {type B, type C as D} from 'foo'; +import type A from 'foo'; +type T = B; +type U = D; +type V = A; + `, + options: [{ prefer: 'type-imports', fixStyle: 'inline-type-imports' }], + errors: [ + { + messageId: 'typeOverValue', + line: 2, + column: 1, + }, + ], + }, + { + code: ` + import { /* comment */ A, B } from 'foo'; + type T = A; + `, + output: ` + import { /* comment */ type A, B } from 'foo'; + type T = A; + `, + options: [{ prefer: 'type-imports', fixStyle: 'inline-type-imports' }], + errors: [ + { + messageId: 'aImportIsOnlyTypes', + line: 2, + column: 9, + }, + ], + }, + { + code: ` + import { B, /* comment */ A } from 'foo'; + type T = A; + `, + output: ` + import { B, /* comment */ type A } from 'foo'; + type T = A; + `, + options: [{ prefer: 'type-imports', fixStyle: 'inline-type-imports' }], + errors: [ + { + messageId: 'aImportIsOnlyTypes', + line: 2, + column: 9, + }, + ], + }, + { + code: ` +import { A, B, C } from 'foo'; +import type { D } from 'deez'; + +const foo: A = B(); +let bar: C; +let baz: D; + `, + output: ` +import { type A, B, type C } from 'foo'; +import type { D } from 'deez'; + +const foo: A = B(); +let bar: C; +let baz: D; + `, + options: [{ prefer: 'type-imports', fixStyle: 'inline-type-imports' }], + errors: [ + { + messageId: 'someImportsAreOnlyTypes', + line: 2, + column: 1, + }, + ], + }, + { + code: ` +import { A, B, type C } from 'foo'; +import type { D } from 'deez'; +const foo: A = B(); +let bar: C; +let baz: D; + `, + output: ` +import { type A, B, type C } from 'foo'; +import type { D } from 'deez'; +const foo: A = B(); +let bar: C; +let baz: D; + `, + options: [{ prefer: 'type-imports', fixStyle: 'inline-type-imports' }], + errors: [ + { + messageId: 'aImportIsOnlyTypes', + line: 2, + column: 1, + }, + ], + }, ], }); diff --git a/packages/eslint-plugin/tests/rules/dot-notation.test.ts b/packages/eslint-plugin/tests/rules/dot-notation.test.ts index fe25e4de1f1..9b6e2ba0fae 100644 --- a/packages/eslint-plugin/tests/rules/dot-notation.test.ts +++ b/packages/eslint-plugin/tests/rules/dot-notation.test.ts @@ -1,5 +1,5 @@ import rule from '../../src/rules/dot-notation'; -import { RuleTester, getFixturesRootDir } from '../RuleTester'; +import { getFixturesRootDir, RuleTester } from '../RuleTester'; const rootPath = getFixturesRootDir(); diff --git a/packages/eslint-plugin/tests/rules/explicit-member-accessibility.test.ts b/packages/eslint-plugin/tests/rules/explicit-member-accessibility.test.ts index 2c3a5a86eb7..04a6fa55842 100644 --- a/packages/eslint-plugin/tests/rules/explicit-member-accessibility.test.ts +++ b/packages/eslint-plugin/tests/rules/explicit-member-accessibility.test.ts @@ -366,13 +366,37 @@ export class XXXX { messageId: 'missingAccessibility', column: 22, line: 3, - }, - ], - output: ` + suggestions: [ + { + messageId: 'addExplicitAccessibility', + data: { type: 'public' }, + output: ` export class XXXX { - public constructor(readonly value: string) {} + public constructor(public readonly value: string) {} } `, + }, + { + messageId: 'addExplicitAccessibility', + data: { type: 'private' }, + output: ` +export class XXXX { + public constructor(private readonly value: string) {} +} + `, + }, + { + messageId: 'addExplicitAccessibility', + data: { type: 'protected' }, + output: ` +export class XXXX { + public constructor(protected readonly value: string) {} +} + `, + }, + ], + }, + ], }, { filename: 'test.ts', @@ -382,12 +406,40 @@ export class WithParameterProperty { } `, options: [{ accessibility: 'explicit' }], - errors: [{ messageId: 'missingAccessibility' }], - output: ` + errors: [ + { + messageId: 'missingAccessibility', + suggestions: [ + { + messageId: 'addExplicitAccessibility', + data: { type: 'public' }, + output: ` export class WithParameterProperty { - public constructor(readonly value: string) {} + public constructor(public readonly value: string) {} } `, + }, + { + messageId: 'addExplicitAccessibility', + data: { type: 'private' }, + output: ` +export class WithParameterProperty { + public constructor(private readonly value: string) {} +} + `, + }, + { + messageId: 'addExplicitAccessibility', + data: { type: 'protected' }, + output: ` +export class WithParameterProperty { + public constructor(protected readonly value: string) {} +} + `, + }, + ], + }, + ], }, { filename: 'test.ts', @@ -405,12 +457,40 @@ export class XXXX { }, }, ], - errors: [{ messageId: 'missingAccessibility' }], - output: ` + errors: [ + { + messageId: 'missingAccessibility', + suggestions: [ + { + messageId: 'addExplicitAccessibility', + data: { type: 'public' }, + output: ` export class XXXX { - public constructor(readonly samosa: string) {} + public constructor(public readonly samosa: string) {} +} + `, + }, + { + messageId: 'addExplicitAccessibility', + data: { type: 'private' }, + output: ` +export class XXXX { + public constructor(private readonly samosa: string) {} +} + `, + }, + { + messageId: 'addExplicitAccessibility', + data: { type: 'protected' }, + output: ` +export class XXXX { + public constructor(protected readonly samosa: string) {} } `, + }, + ], + }, + ], }, { filename: 'test.ts', @@ -425,12 +505,40 @@ class Test { overrides: { parameterProperties: 'explicit' }, }, ], - errors: [{ messageId: 'missingAccessibility' }], - output: ` + errors: [ + { + messageId: 'missingAccessibility', + suggestions: [ + { + messageId: 'addExplicitAccessibility', + data: { type: 'public' }, + output: ` class Test { - public constructor(readonly foo: string) {} + public constructor(public readonly foo: string) {} +} + `, + }, + { + messageId: 'addExplicitAccessibility', + data: { type: 'private' }, + output: ` +class Test { + public constructor(private readonly foo: string) {} } `, + }, + { + messageId: 'addExplicitAccessibility', + data: { type: 'protected' }, + output: ` +class Test { + public constructor(protected readonly foo: string) {} +} + `, + }, + ], + }, + ], }, { filename: 'test.ts', @@ -451,16 +559,49 @@ class Test { }, line: 3, column: 3, - }, - ], - output: ` + suggestions: [ + { + messageId: 'addExplicitAccessibility', + data: { type: 'public' }, + + output: ` class Test { - x: number; + public x: number; + public getX() { + return this.x; + } +} + `, + }, + { + messageId: 'addExplicitAccessibility', + data: { type: 'private' }, + + output: ` +class Test { + private x: number; + public getX() { + return this.x; + } +} + `, + }, + { + messageId: 'addExplicitAccessibility', + data: { type: 'protected' }, + + output: ` +class Test { + protected x: number; public getX() { return this.x; } } `, + }, + ], + }, + ], }, { filename: 'test.ts', @@ -481,16 +622,46 @@ class Test { }, line: 4, column: 3, - }, - ], - output: ` + suggestions: [ + { + messageId: 'addExplicitAccessibility', + data: { type: 'public' }, + output: ` class Test { private x: number; - getX() { + public getX() { return this.x; } } `, + }, + { + messageId: 'addExplicitAccessibility', + data: { type: 'private' }, + output: ` +class Test { + private x: number; + private getX() { + return this.x; + } +} + `, + }, + { + messageId: 'addExplicitAccessibility', + data: { type: 'protected' }, + output: ` +class Test { + private x: number; + protected getX() { + return this.x; + } +} + `, + }, + ], + }, + ], }, { filename: 'test.ts', @@ -511,6 +682,44 @@ class Test { }, line: 3, column: 3, + suggestions: [ + { + messageId: 'addExplicitAccessibility', + data: { type: 'public' }, + output: ` +class Test { + public x?: number; + getX?() { + return this.x; + } +} + `, + }, + { + messageId: 'addExplicitAccessibility', + data: { type: 'private' }, + output: ` +class Test { + private x?: number; + getX?() { + return this.x; + } +} + `, + }, + { + messageId: 'addExplicitAccessibility', + data: { type: 'protected' }, + output: ` +class Test { + protected x?: number; + getX?() { + return this.x; + } +} + `, + }, + ], }, { messageId: 'missingAccessibility', @@ -520,16 +729,46 @@ class Test { }, line: 4, column: 3, - }, - ], - output: ` + suggestions: [ + { + messageId: 'addExplicitAccessibility', + data: { type: 'public' }, + output: ` class Test { x?: number; - getX?() { + public getX?() { + return this.x; + } +} + `, + }, + { + messageId: 'addExplicitAccessibility', + data: { type: 'private' }, + output: ` +class Test { + x?: number; + private getX?() { + return this.x; + } +} + `, + }, + { + messageId: 'addExplicitAccessibility', + data: { type: 'protected' }, + output: ` +class Test { + x?: number; + protected getX?() { return this.x; } } `, + }, + ], + }, + ], }, { filename: 'test.ts', @@ -650,15 +889,72 @@ class Test { messageId: 'missingAccessibility', line: 7, column: 3, + suggestions: [ + { + messageId: 'addExplicitAccessibility', + data: { type: 'public' }, + output: ` +class Test { + private x: number; + constructor(x: number) { + this.x = x; + } + public get internalValue() { + return this.x; + } + set internalValue(value: number) { + this.x = value; + } +} + `, + }, + { + messageId: 'addExplicitAccessibility', + data: { type: 'private' }, + output: ` +class Test { + private x: number; + constructor(x: number) { + this.x = x; + } + private get internalValue() { + return this.x; + } + set internalValue(value: number) { + this.x = value; + } +} + `, + }, + { + messageId: 'addExplicitAccessibility', + data: { type: 'protected' }, + output: ` +class Test { + private x: number; + constructor(x: number) { + this.x = x; + } + protected get internalValue() { + return this.x; + } + set internalValue(value: number) { + this.x = value; + } +} + `, + }, + ], }, { messageId: 'missingAccessibility', line: 10, column: 3, - }, - ], - options: [{ overrides: { constructors: 'no-public' } }], - output: ` + suggestions: [ + { + messageId: 'addExplicitAccessibility', + data: { type: 'public' }, + output: ` class Test { private x: number; constructor(x: number) { @@ -667,11 +963,52 @@ class Test { get internalValue() { return this.x; } - set internalValue(value: number) { + public set internalValue(value: number) { this.x = value; } } `, + }, + { + messageId: 'addExplicitAccessibility', + data: { type: 'private' }, + output: ` +class Test { + private x: number; + constructor(x: number) { + this.x = x; + } + get internalValue() { + return this.x; + } + private set internalValue(value: number) { + this.x = value; + } +} + `, + }, + { + messageId: 'addExplicitAccessibility', + data: { type: 'protected' }, + output: ` +class Test { + private x: number; + constructor(x: number) { + this.x = x; + } + get internalValue() { + return this.x; + } + protected set internalValue(value: number) { + this.x = value; + } +} + `, + }, + ], + }, + ], + options: [{ overrides: { constructors: 'no-public' } }], }, { filename: 'test.ts', @@ -694,19 +1031,133 @@ class Test { messageId: 'missingAccessibility', line: 4, column: 3, + suggestions: [ + { + messageId: 'addExplicitAccessibility', + data: { type: 'public' }, + output: ` +class Test { + private x: number; + public constructor(x: number) { + this.x = x; + } + get internalValue() { + return this.x; + } + set internalValue(value: number) { + this.x = value; + } +} + `, + }, + { + messageId: 'addExplicitAccessibility', + data: { type: 'private' }, + output: ` +class Test { + private x: number; + private constructor(x: number) { + this.x = x; + } + get internalValue() { + return this.x; + } + set internalValue(value: number) { + this.x = value; + } +} + `, + }, + { + messageId: 'addExplicitAccessibility', + data: { type: 'protected' }, + output: ` +class Test { + private x: number; + protected constructor(x: number) { + this.x = x; + } + get internalValue() { + return this.x; + } + set internalValue(value: number) { + this.x = value; + } +} + `, + }, + ], }, { messageId: 'missingAccessibility', line: 7, column: 3, + suggestions: [ + { + messageId: 'addExplicitAccessibility', + data: { type: 'public' }, + output: ` +class Test { + private x: number; + constructor(x: number) { + this.x = x; + } + public get internalValue() { + return this.x; + } + set internalValue(value: number) { + this.x = value; + } +} + `, + }, + { + messageId: 'addExplicitAccessibility', + data: { type: 'private' }, + output: ` +class Test { + private x: number; + constructor(x: number) { + this.x = x; + } + private get internalValue() { + return this.x; + } + set internalValue(value: number) { + this.x = value; + } +} + `, + }, + { + messageId: 'addExplicitAccessibility', + data: { type: 'protected' }, + output: ` +class Test { + private x: number; + constructor(x: number) { + this.x = x; + } + protected get internalValue() { + return this.x; + } + set internalValue(value: number) { + this.x = value; + } +} + `, + }, + ], }, { messageId: 'missingAccessibility', line: 10, column: 3, - }, - ], - output: ` + suggestions: [ + { + messageId: 'addExplicitAccessibility', + data: { type: 'public' }, + output: ` class Test { private x: number; constructor(x: number) { @@ -715,11 +1166,51 @@ class Test { get internalValue() { return this.x; } - set internalValue(value: number) { + public set internalValue(value: number) { + this.x = value; + } +} + `, + }, + { + messageId: 'addExplicitAccessibility', + data: { type: 'private' }, + output: ` +class Test { + private x: number; + constructor(x: number) { + this.x = x; + } + get internalValue() { + return this.x; + } + private set internalValue(value: number) { + this.x = value; + } +} + `, + }, + { + messageId: 'addExplicitAccessibility', + data: { type: 'protected' }, + output: ` +class Test { + private x: number; + constructor(x: number) { + this.x = x; + } + get internalValue() { + return this.x; + } + protected set internalValue(value: number) { this.x = value; } } `, + }, + ], + }, + ], }, { filename: 'test.ts', @@ -736,6 +1227,44 @@ class Test { messageId: 'missingAccessibility', line: 3, column: 3, + suggestions: [ + { + messageId: 'addExplicitAccessibility', + data: { type: 'public' }, + output: ` +class Test { + public constructor(public x: number) {} + public foo(): string { + return 'foo'; + } +} + `, + }, + { + messageId: 'addExplicitAccessibility', + data: { type: 'private' }, + output: ` +class Test { + private constructor(public x: number) {} + public foo(): string { + return 'foo'; + } +} + `, + }, + { + messageId: 'addExplicitAccessibility', + data: { type: 'protected' }, + output: ` +class Test { + protected constructor(public x: number) {} + public foo(): string { + return 'foo'; + } +} + `, + }, + ], }, ], options: [ @@ -743,14 +1272,6 @@ class Test { overrides: { parameterProperties: 'no-public' }, }, ], - output: ` -class Test { - constructor(public x: number) {} - public foo(): string { - return 'foo'; - } -} - `, }, { filename: 'test.ts', @@ -764,13 +1285,37 @@ class Test { messageId: 'missingAccessibility', line: 3, column: 3, - }, - ], - output: ` + suggestions: [ + { + messageId: 'addExplicitAccessibility', + data: { type: 'public' }, + output: ` class Test { - constructor(public x: number) {} + public constructor(public x: number) {} +} + `, + }, + { + messageId: 'addExplicitAccessibility', + data: { type: 'private' }, + output: ` +class Test { + private constructor(public x: number) {} +} + `, + }, + { + messageId: 'addExplicitAccessibility', + data: { type: 'protected' }, + output: ` +class Test { + protected constructor(public x: number) {} } `, + }, + ], + }, + ], }, { filename: 'test.ts', @@ -816,13 +1361,37 @@ class Test { messageId: 'missingAccessibility', line: 3, column: 3, - }, - ], - output: ` + suggestions: [ + { + messageId: 'addExplicitAccessibility', + data: { type: 'public' }, + output: ` class Test { - x = 2; + public x = 2; +} + `, + }, + { + messageId: 'addExplicitAccessibility', + data: { type: 'private' }, + output: ` +class Test { + private x = 2; } `, + }, + { + messageId: 'addExplicitAccessibility', + data: { type: 'protected' }, + output: ` +class Test { + protected x = 2; +} + `, + }, + ], + }, + ], }, { filename: 'test.ts', @@ -864,13 +1433,37 @@ class Test { messageId: 'missingAccessibility', line: 3, column: 3, - }, - ], - output: ` + suggestions: [ + { + messageId: 'addExplicitAccessibility', + data: { type: 'public' }, + output: ` class Test { - constructor(public ...x: any[]) {} + public constructor(public ...x: any[]) {} +} + `, + }, + { + messageId: 'addExplicitAccessibility', + data: { type: 'private' }, + output: ` +class Test { + private constructor(public ...x: any[]) {} } `, + }, + { + messageId: 'addExplicitAccessibility', + data: { type: 'protected' }, + output: ` +class Test { + protected constructor(public ...x: any[]) {} +} + `, + }, + ], + }, + ], }, { filename: 'test.ts', @@ -892,7 +1485,7 @@ class Test { column: 3, }, ], - output: noFormat` + output: ` class Test { @public /*public*/constructor(private foo: string) {} @@ -1132,7 +1725,7 @@ class Test { column: 3, }, ], - output: noFormat` + output: ` class Test { 'foo' = 1; 'foo foo' = 2; @@ -1153,6 +1746,35 @@ abstract class SomeClass { messageId: 'missingAccessibility', line: 3, column: 3, + suggestions: [ + { + messageId: 'addExplicitAccessibility', + data: { type: 'public' }, + output: ` +abstract class SomeClass { + public abstract method(): string; +} + `, + }, + { + messageId: 'addExplicitAccessibility', + data: { type: 'private' }, + output: ` +abstract class SomeClass { + private abstract method(): string; +} + `, + }, + { + messageId: 'addExplicitAccessibility', + data: { type: 'protected' }, + output: ` +abstract class SomeClass { + protected abstract method(): string; +} + `, + }, + ], }, ], }, @@ -1194,6 +1816,35 @@ abstract class SomeClass { messageId: 'missingAccessibility', line: 3, column: 3, + suggestions: [ + { + messageId: 'addExplicitAccessibility', + data: { type: 'public' }, + output: ` +abstract class SomeClass { + public abstract x: string; +} + `, + }, + { + messageId: 'addExplicitAccessibility', + data: { type: 'private' }, + output: ` +abstract class SomeClass { + private abstract x: string; +} + `, + }, + { + messageId: 'addExplicitAccessibility', + data: { type: 'protected' }, + output: ` +abstract class SomeClass { + protected abstract x: string; +} + `, + }, + ], }, ], }, @@ -1222,5 +1873,446 @@ abstract class SomeClass { } `, }, + { + code: ` +class DecoratedClass { + constructor(@foo @bar() readonly arg: string) {} + @foo @bar() x: string; + @foo @bar() getX() { + return this.x; + } + @foo + @bar() + get y() { + return this.x; + } + @foo @bar() set y(@foo @bar() value: x) { + this.x = x; + } +} + `, + errors: [ + { + messageId: 'missingAccessibility', + line: 3, + column: 3, + suggestions: [ + { + messageId: 'addExplicitAccessibility', + data: { type: 'public' }, + output: ` +class DecoratedClass { + public constructor(@foo @bar() readonly arg: string) {} + @foo @bar() x: string; + @foo @bar() getX() { + return this.x; + } + @foo + @bar() + get y() { + return this.x; + } + @foo @bar() set y(@foo @bar() value: x) { + this.x = x; + } +} + `, + }, + { + messageId: 'addExplicitAccessibility', + data: { type: 'private' }, + output: ` +class DecoratedClass { + private constructor(@foo @bar() readonly arg: string) {} + @foo @bar() x: string; + @foo @bar() getX() { + return this.x; + } + @foo + @bar() + get y() { + return this.x; + } + @foo @bar() set y(@foo @bar() value: x) { + this.x = x; + } +} + `, + }, + { + messageId: 'addExplicitAccessibility', + data: { type: 'protected' }, + output: ` +class DecoratedClass { + protected constructor(@foo @bar() readonly arg: string) {} + @foo @bar() x: string; + @foo @bar() getX() { + return this.x; + } + @foo + @bar() + get y() { + return this.x; + } + @foo @bar() set y(@foo @bar() value: x) { + this.x = x; + } +} + `, + }, + ], + }, + { + messageId: 'missingAccessibility', + line: 3, + column: 15, + suggestions: [ + { + messageId: 'addExplicitAccessibility', + data: { type: 'public' }, + output: ` +class DecoratedClass { + constructor(@foo @bar() public readonly arg: string) {} + @foo @bar() x: string; + @foo @bar() getX() { + return this.x; + } + @foo + @bar() + get y() { + return this.x; + } + @foo @bar() set y(@foo @bar() value: x) { + this.x = x; + } +} + `, + }, + { + messageId: 'addExplicitAccessibility', + data: { type: 'private' }, + output: ` +class DecoratedClass { + constructor(@foo @bar() private readonly arg: string) {} + @foo @bar() x: string; + @foo @bar() getX() { + return this.x; + } + @foo + @bar() + get y() { + return this.x; + } + @foo @bar() set y(@foo @bar() value: x) { + this.x = x; + } +} + `, + }, + { + messageId: 'addExplicitAccessibility', + data: { type: 'protected' }, + output: ` +class DecoratedClass { + constructor(@foo @bar() protected readonly arg: string) {} + @foo @bar() x: string; + @foo @bar() getX() { + return this.x; + } + @foo + @bar() + get y() { + return this.x; + } + @foo @bar() set y(@foo @bar() value: x) { + this.x = x; + } +} + `, + }, + ], + }, + { + messageId: 'missingAccessibility', + line: 4, + column: 3, + suggestions: [ + { + messageId: 'addExplicitAccessibility', + data: { type: 'public' }, + output: ` +class DecoratedClass { + constructor(@foo @bar() readonly arg: string) {} + @foo @bar() public x: string; + @foo @bar() getX() { + return this.x; + } + @foo + @bar() + get y() { + return this.x; + } + @foo @bar() set y(@foo @bar() value: x) { + this.x = x; + } +} + `, + }, + { + messageId: 'addExplicitAccessibility', + data: { type: 'private' }, + output: ` +class DecoratedClass { + constructor(@foo @bar() readonly arg: string) {} + @foo @bar() private x: string; + @foo @bar() getX() { + return this.x; + } + @foo + @bar() + get y() { + return this.x; + } + @foo @bar() set y(@foo @bar() value: x) { + this.x = x; + } +} + `, + }, + { + messageId: 'addExplicitAccessibility', + data: { type: 'protected' }, + output: ` +class DecoratedClass { + constructor(@foo @bar() readonly arg: string) {} + @foo @bar() protected x: string; + @foo @bar() getX() { + return this.x; + } + @foo + @bar() + get y() { + return this.x; + } + @foo @bar() set y(@foo @bar() value: x) { + this.x = x; + } +} + `, + }, + ], + }, + { + messageId: 'missingAccessibility', + line: 5, + column: 3, + suggestions: [ + { + messageId: 'addExplicitAccessibility', + data: { type: 'public' }, + output: ` +class DecoratedClass { + constructor(@foo @bar() readonly arg: string) {} + @foo @bar() x: string; + @foo @bar() public getX() { + return this.x; + } + @foo + @bar() + get y() { + return this.x; + } + @foo @bar() set y(@foo @bar() value: x) { + this.x = x; + } +} + `, + }, + { + messageId: 'addExplicitAccessibility', + data: { type: 'private' }, + output: ` +class DecoratedClass { + constructor(@foo @bar() readonly arg: string) {} + @foo @bar() x: string; + @foo @bar() private getX() { + return this.x; + } + @foo + @bar() + get y() { + return this.x; + } + @foo @bar() set y(@foo @bar() value: x) { + this.x = x; + } +} + `, + }, + { + messageId: 'addExplicitAccessibility', + data: { type: 'protected' }, + output: ` +class DecoratedClass { + constructor(@foo @bar() readonly arg: string) {} + @foo @bar() x: string; + @foo @bar() protected getX() { + return this.x; + } + @foo + @bar() + get y() { + return this.x; + } + @foo @bar() set y(@foo @bar() value: x) { + this.x = x; + } +} + `, + }, + ], + }, + { + messageId: 'missingAccessibility', + line: 8, + column: 3, + suggestions: [ + { + messageId: 'addExplicitAccessibility', + data: { type: 'public' }, + output: ` +class DecoratedClass { + constructor(@foo @bar() readonly arg: string) {} + @foo @bar() x: string; + @foo @bar() getX() { + return this.x; + } + @foo + @bar() + public get y() { + return this.x; + } + @foo @bar() set y(@foo @bar() value: x) { + this.x = x; + } +} + `, + }, + { + messageId: 'addExplicitAccessibility', + data: { type: 'private' }, + output: ` +class DecoratedClass { + constructor(@foo @bar() readonly arg: string) {} + @foo @bar() x: string; + @foo @bar() getX() { + return this.x; + } + @foo + @bar() + private get y() { + return this.x; + } + @foo @bar() set y(@foo @bar() value: x) { + this.x = x; + } +} + `, + }, + { + messageId: 'addExplicitAccessibility', + data: { type: 'protected' }, + output: ` +class DecoratedClass { + constructor(@foo @bar() readonly arg: string) {} + @foo @bar() x: string; + @foo @bar() getX() { + return this.x; + } + @foo + @bar() + protected get y() { + return this.x; + } + @foo @bar() set y(@foo @bar() value: x) { + this.x = x; + } +} + `, + }, + ], + }, + { + messageId: 'missingAccessibility', + line: 13, + column: 3, + suggestions: [ + { + messageId: 'addExplicitAccessibility', + data: { type: 'public' }, + output: ` +class DecoratedClass { + constructor(@foo @bar() readonly arg: string) {} + @foo @bar() x: string; + @foo @bar() getX() { + return this.x; + } + @foo + @bar() + get y() { + return this.x; + } + @foo @bar() public set y(@foo @bar() value: x) { + this.x = x; + } +} + `, + }, + { + messageId: 'addExplicitAccessibility', + data: { type: 'private' }, + output: ` +class DecoratedClass { + constructor(@foo @bar() readonly arg: string) {} + @foo @bar() x: string; + @foo @bar() getX() { + return this.x; + } + @foo + @bar() + get y() { + return this.x; + } + @foo @bar() private set y(@foo @bar() value: x) { + this.x = x; + } +} + `, + }, + { + messageId: 'addExplicitAccessibility', + data: { type: 'protected' }, + output: ` +class DecoratedClass { + constructor(@foo @bar() readonly arg: string) {} + @foo @bar() x: string; + @foo @bar() getX() { + return this.x; + } + @foo + @bar() + get y() { + return this.x; + } + @foo @bar() protected set y(@foo @bar() value: x) { + this.x = x; + } +} + `, + }, + ], + }, + ], + }, ], }); diff --git a/packages/eslint-plugin/tests/rules/func-call-spacing.test.ts b/packages/eslint-plugin/tests/rules/func-call-spacing.test.ts index 11650e2b014..52d7a74ce47 100644 --- a/packages/eslint-plugin/tests/rules/func-call-spacing.test.ts +++ b/packages/eslint-plugin/tests/rules/func-call-spacing.test.ts @@ -3,8 +3,10 @@ /* eslint "@typescript-eslint/internal/plugin-test-formatting": ["error", { formatWithPrettier: false }] */ /* eslint-enable eslint-comments/no-use */ -import { TSESLint } from '@typescript-eslint/utils'; -import rule, { MessageIds, Options } from '../../src/rules/func-call-spacing'; +import type { TSESLint } from '@typescript-eslint/utils'; + +import type { MessageIds, Options } from '../../src/rules/func-call-spacing'; +import rule from '../../src/rules/func-call-spacing'; import { RuleTester } from '../RuleTester'; const ruleTester = new RuleTester({ diff --git a/packages/eslint-plugin/tests/rules/indent/indent-eslint.test.ts b/packages/eslint-plugin/tests/rules/indent/indent-eslint.test.ts deleted file mode 100644 index e6483ce5dee..00000000000 --- a/packages/eslint-plugin/tests/rules/indent/indent-eslint.test.ts +++ /dev/null @@ -1,9660 +0,0 @@ -// The following tests are adapted from the the tests in eslint. -// License: https://github.com/eslint/eslint/blob/48700fc8408f394887cdedd071b22b757700fdcb/LICENSE - -// NOTE - this test suite is intentionally kept in a separate file to our -// custom tests. This is to keep a clear boundary between the two. - -/* eslint-disable eslint-comments/no-use */ -// this rule tests the spacing, which prettier will want to fix and break the tests -/* eslint "@typescript-eslint/internal/plugin-test-formatting": ["error", { formatWithPrettier: false }] */ -/* eslint-enable eslint-comments/no-use */ - -import { AST_TOKEN_TYPES, AST_NODE_TYPES } from '@typescript-eslint/utils'; -import fs from 'fs'; -import path from 'path'; -import rule from '../../../src/rules/indent-new-do-not-use'; -import { RuleTester } from '../../RuleTester'; -import { expectedErrors, unIndent } from './utils'; - -const fixture = fs.readFileSync( - path.join(__dirname, '../../fixtures/indent/indent-invalid-fixture-1.js'), - 'utf8', -); -const fixedFixture = fs.readFileSync( - path.join(__dirname, '../../fixtures/indent/indent-valid-fixture-1.js'), - 'utf8', -); - -const ruleTester = new RuleTester({ - parserOptions: { - ecmaVersion: 6, - sourceType: 'module', - ecmaFeatures: { - jsx: true, - }, - }, - parser: '@typescript-eslint/parser', -}); - -ruleTester.run('indent', rule, { - valid: [ - { - code: unIndent` - bridge.callHandler( - 'getAppVersion', 'test23', function(responseData) { - window.ah.mobileAppVersion = responseData; - } - ); - `, - options: [2], - }, - { - code: unIndent` - bridge.callHandler( - 'getAppVersion', 'test23', function(responseData) { - window.ah.mobileAppVersion = responseData; - }); - `, - options: [2], - }, - { - code: unIndent` - bridge.callHandler( - 'getAppVersion', - null, - function responseCallback(responseData) { - window.ah.mobileAppVersion = responseData; - } - ); - `, - options: [2], - }, - { - code: unIndent` - bridge.callHandler( - 'getAppVersion', - null, - function responseCallback(responseData) { - window.ah.mobileAppVersion = responseData; - }); - `, - options: [2], - }, - { - code: unIndent` - function doStuff(keys) { - _.forEach( - keys, - key => { - doSomething(key); - } - ); - } - `, - options: [4], - }, - { - code: unIndent` - example( - function () { - console.log('example'); - } - ); - `, - options: [4], - }, - { - code: unIndent` - let foo = somethingList - .filter(x => { - return x; - }) - .map(x => { - return 100 * x; - }); - `, - options: [4], - }, - { - code: unIndent` - var x = 0 && - { - a: 1, - b: 2 - }; - `, - options: [4], - }, - { - code: unIndent` - var x = 0 && - \t{ - \t\ta: 1, - \t\tb: 2 - \t}; - `, - options: ['tab'], - }, - { - code: unIndent` - var x = 0 && - { - a: 1, - b: 2 - }|| - { - c: 3, - d: 4 - }; - `, - options: [4], - }, - { - code: unIndent` - var x = [ - 'a', - 'b', - 'c' - ]; - `, - options: [4], - }, - { - code: unIndent` - var x = ['a', - 'b', - 'c', - ]; - `, - options: [4], - }, - { - code: 'var x = 0 && 1;', - options: [4], - }, - { - code: 'var x = 0 && { a: 1, b: 2 };', - options: [4], - }, - { - code: unIndent` - var x = 0 && - ( - 1 - ); - `, - options: [4], - }, - { - code: unIndent` - require('http').request({hostname: 'localhost', - port: 80}, function(res) { - res.end(); - }); - `, - options: [2], - }, - { - code: unIndent` - function test() { - return client.signUp(email, PASSWORD, { preVerified: true }) - .then(function (result) { - // hi - }) - .then(function () { - return FunctionalHelpers.clearBrowserState(self, { - contentServer: true, - contentServer1: true - }); - }); - } - `, - options: [2], - }, - { - code: unIndent` - it('should... some lengthy test description that is forced to be' + - 'wrapped into two lines since the line length limit is set', () => { - expect(true).toBe(true); - }); - `, - options: [2], - }, - { - code: unIndent` - function test() { - return client.signUp(email, PASSWORD, { preVerified: true }) - .then(function (result) { - var x = 1; - var y = 1; - }, function(err){ - var o = 1 - 2; - var y = 1 - 2; - return true; - }) - } - `, - options: [4], - }, - { - // https://github.com/eslint/eslint/issues/11802 - code: unIndent` - import foo from "foo" - - ;(() => {})() - `, - options: [4], - parserOptions: { sourceType: 'module' }, - }, - { - code: unIndent` - function test() { - return client.signUp(email, PASSWORD, { preVerified: true }) - .then(function (result) { - var x = 1; - var y = 1; - }, function(err){ - var o = 1 - 2; - var y = 1 - 2; - return true; - }); - } - `, - options: [4, { MemberExpression: 0 }], - }, - - { - code: '// hi', - options: [2, { VariableDeclarator: 1, SwitchCase: 1 }], - }, - { - code: unIndent` - var Command = function() { - var fileList = [], - files = [] - - files.concat(fileList) - }; - `, - options: [2, { VariableDeclarator: { var: 2, let: 2, const: 3 } }], - }, - { - code: ' ', - options: [2, { VariableDeclarator: 1, SwitchCase: 1 }], - }, - { - code: unIndent` - if(data) { - console.log('hi'); - b = true;}; - `, - options: [2, { VariableDeclarator: 1, SwitchCase: 1 }], - }, - { - code: unIndent` - foo = () => { - console.log('hi'); - return true;}; - `, - options: [2, { VariableDeclarator: 1, SwitchCase: 1 }], - }, - { - code: unIndent` - function test(data) { - console.log('hi'); - return true;}; - `, - options: [2, { VariableDeclarator: 1, SwitchCase: 1 }], - }, - { - code: unIndent` - var test = function(data) { - console.log('hi'); - }; - `, - options: [2, { VariableDeclarator: 1, SwitchCase: 1 }], - }, - { - code: unIndent` - arr.forEach(function(data) { - otherdata.forEach(function(zero) { - console.log('hi'); - }) }); - `, - options: [2, { VariableDeclarator: 1, SwitchCase: 1 }], - }, - { - code: unIndent` - a = [ - ,3 - ] - `, - options: [4, { VariableDeclarator: 1, SwitchCase: 1 }], - }, - { - code: unIndent` - [ - ['gzip', AST_TOKEN_TYPES.gunzip], - ['gzip', AST_TOKEN_TYPES.unzip], - ['deflate', AST_TOKEN_TYPES.inflate], - ['deflateRaw', AST_TOKEN_TYPES.inflateRaw], - ].forEach(function(method) { - console.log(method); - }); - `, - options: [2, { SwitchCase: 1, VariableDeclarator: 2 }], - }, - { - code: unIndent` - test(123, { - bye: { - hi: [1, - { - b: 2 - } - ] - } - }); - `, - options: [4, { VariableDeclarator: 1, SwitchCase: 1 }], - }, - { - code: unIndent` - var xyz = 2, - lmn = [ - { - a: 1 - } - ]; - `, - options: [4, { VariableDeclarator: 1, SwitchCase: 1 }], - }, - { - code: unIndent` - lmnn = [{ - a: 1 - }, - { - b: 2 - }, { - x: 2 - }]; - `, - options: [4, { VariableDeclarator: 1, SwitchCase: 1 }], - }, - unIndent` - [{ - foo: 1 - }, { - foo: 2 - }, { - foo: 3 - }] - `, - unIndent` - foo([ - bar - ], [ - baz - ], [ - qux - ]); - `, - { - code: unIndent` - abc({ - test: [ - [ - c, - xyz, - 2 - ].join(',') - ] - }); - `, - options: [4, { VariableDeclarator: 1, SwitchCase: 1 }], - }, - { - code: unIndent` - abc = { - test: [ - [ - c, - xyz, - 2 - ] - ] - }; - `, - options: [2, { VariableDeclarator: 1, SwitchCase: 1 }], - }, - { - code: unIndent` - abc( - { - a: 1, - b: 2 - } - ); - `, - options: [2, { VariableDeclarator: 1, SwitchCase: 1 }], - }, - { - code: unIndent` - abc({ - a: 1, - b: 2 - }); - `, - options: [4, { VariableDeclarator: 1, SwitchCase: 1 }], - }, - { - code: unIndent` - var abc = - [ - c, - xyz, - { - a: 1, - b: 2 - } - ]; - `, - options: [2, { VariableDeclarator: 1, SwitchCase: 1 }], - }, - { - code: unIndent` - var abc = [ - c, - xyz, - { - a: 1, - b: 2 - } - ]; - `, - options: [2, { VariableDeclarator: 1, SwitchCase: 1 }], - }, - { - code: unIndent` - var abc = 5, - c = 2, - xyz = - { - a: 1, - b: 2 - }; - `, - options: [2, { VariableDeclarator: 2, SwitchCase: 1 }], - }, - unIndent` - var - x = { - a: 1, - }, - y = { - b: 2 - } - `, - unIndent` - const - x = { - a: 1, - }, - y = { - b: 2 - } - `, - unIndent` - let - x = { - a: 1, - }, - y = { - b: 2 - } - `, - unIndent` - var foo = { a: 1 }, bar = { - b: 2 - }; - `, - unIndent` - var foo = { a: 1 }, bar = { - b: 2 - }, - baz = { - c: 3 - } - `, - unIndent` - const { - foo - } = 1, - bar = 2 - `, - { - code: unIndent` - var foo = 1, - bar = - 2 - `, - options: [2, { VariableDeclarator: 1 }], - }, - { - code: unIndent` - var foo = 1, - bar - = 2 - `, - options: [2, { VariableDeclarator: 1 }], - }, - { - code: unIndent` - var foo - = 1, - bar - = 2 - `, - options: [2, { VariableDeclarator: 1 }], - }, - { - code: unIndent` - var foo - = - 1, - bar - = - 2 - `, - options: [2, { VariableDeclarator: 1 }], - }, - { - code: unIndent` - var foo - = (1), - bar - = (2) - `, - options: [2, { VariableDeclarator: 1 }], - }, - { - code: unIndent` - let foo = 'foo', - bar = bar; - const a = 'a', - b = 'b'; - `, - options: [2, { VariableDeclarator: 'first' }], - }, - { - code: unIndent` - let foo = 'foo', - bar = bar // <-- no semicolon here - const a = 'a', - b = 'b' // <-- no semicolon here - `, - options: [2, { VariableDeclarator: 'first' }], - }, - { - code: unIndent` - var foo = 1, - bar = 2, - baz = 3 - ; - `, - options: [2, { VariableDeclarator: { var: 2 } }], - }, - { - code: unIndent` - var foo = 1, - bar = 2, - baz = 3 - ; - `, - options: [2, { VariableDeclarator: { var: 2 } }], - }, - { - code: unIndent` - var foo = 'foo', - bar = bar; - `, - options: [2, { VariableDeclarator: { var: 'first' } }], - }, - { - code: unIndent` - var foo = 'foo', - bar = 'bar' // <-- no semicolon here - `, - options: [2, { VariableDeclarator: { var: 'first' } }], - }, - { - code: unIndent` - let foo = 1, - bar = 2, - baz - `, - options: [2, { VariableDeclarator: 'first' }], - }, - { - code: unIndent` - let - foo - `, - options: [4, { VariableDeclarator: 'first' }], - }, - { - code: unIndent` - let foo = 1, - bar = - 2 - `, - options: [2, { VariableDeclarator: 'first' }], - }, - { - code: unIndent` - var abc = - { - a: 1, - b: 2 - }; - `, - options: [2, { VariableDeclarator: 2, SwitchCase: 1 }], - }, - { - code: unIndent` - var a = new abc({ - a: 1, - b: 2 - }), - b = 2; - `, - options: [4, { VariableDeclarator: 1, SwitchCase: 1 }], - }, - { - code: unIndent` - var a = 2, - c = { - a: 1, - b: 2 - }, - b = 2; - `, - options: [2, { VariableDeclarator: 1, SwitchCase: 1 }], - }, - { - code: unIndent` - var x = 2, - y = { - a: 1, - b: 2 - }, - b = 2; - `, - options: [2, { VariableDeclarator: 2, SwitchCase: 1 }], - }, - { - code: unIndent` - var e = { - a: 1, - b: 2 - }, - b = 2; - `, - options: [2, { VariableDeclarator: 2, SwitchCase: 1 }], - }, - { - code: unIndent` - var a = { - a: 1, - b: 2 - }; - `, - options: [2, { VariableDeclarator: 2, SwitchCase: 1 }], - }, - { - code: unIndent` - function test() { - if (true || - false){ - console.log(val); - } - } - `, - options: [2, { VariableDeclarator: 2, SwitchCase: 1 }], - }, - unIndent` - var foo = bar || - !( - baz - ); - `, - unIndent` - for (var foo = 1; - foo < 10; - foo++) {} - `, - unIndent` - for ( - var foo = 1; - foo < 10; - foo++ - ) {} - `, - { - code: unIndent` - for (var val in obj) - if (true) - console.log(val); - `, - options: [2, { VariableDeclarator: 2, SwitchCase: 1 }], - }, - { - code: unIndent` - if(true) - if (true) - if (true) - console.log(val); - `, - options: [2, { VariableDeclarator: 2, SwitchCase: 1 }], - }, - { - code: unIndent` - function hi(){ var a = 1; - y++; x++; - } - `, - options: [2, { VariableDeclarator: 2, SwitchCase: 1 }], - }, - { - code: unIndent` - for(;length > index; index++)if(NO_HOLES || index in self){ - x++; - } - `, - options: [2, { VariableDeclarator: 2, SwitchCase: 1 }], - }, - { - code: unIndent` - function test(){ - switch(length){ - case 1: return function(a){ - return fn.call(that, a); - }; - } - } - `, - options: [2, { VariableDeclarator: 2, SwitchCase: 1 }], - }, - { - code: unIndent` - var geometry = 2, - rotate = 2; - `, - options: [2, { VariableDeclarator: 0 }], - }, - { - code: unIndent` - var geometry, - rotate; - `, - options: [4, { VariableDeclarator: 1 }], - }, - { - code: unIndent` - var geometry, - \trotate; - `, - options: ['tab', { VariableDeclarator: 1 }], - }, - { - code: unIndent` - var geometry, - rotate; - `, - options: [2, { VariableDeclarator: 1 }], - }, - { - code: unIndent` - var geometry, - rotate; - `, - options: [2, { VariableDeclarator: 2 }], - }, - { - code: unIndent` - let geometry, - rotate; - `, - options: [2, { VariableDeclarator: 2 }], - }, - { - code: unIndent` - const geometry = 2, - rotate = 3; - `, - options: [2, { VariableDeclarator: 2 }], - }, - { - code: unIndent` - var geometry, box, face1, face2, colorT, colorB, sprite, padding, maxWidth, - height, rotate; - `, - options: [2, { SwitchCase: 1 }], - }, - { - code: 'var geometry, box, face1, face2, colorT, colorB, sprite, padding, maxWidth;', - options: [2, { SwitchCase: 1 }], - }, - { - code: unIndent` - if (1 < 2){ - //hi sd - } - `, - options: [2], - }, - { - code: unIndent` - while (1 < 2){ - //hi sd - } - `, - options: [2], - }, - { - code: "while (1 < 2) console.log('hi');", - options: [2], - }, - - { - code: unIndent` - [a, boop, - c].forEach((index) => { - index; - }); - `, - options: [4], - }, - { - code: unIndent` - [a, b, - c].forEach(function(index){ - return index; - }); - `, - options: [4], - }, - { - code: unIndent` - [a, b, c].forEach((index) => { - index; - }); - `, - options: [4], - }, - { - code: unIndent` - [a, b, c].forEach(function(index){ - return index; - }); - `, - options: [4], - }, - { - code: unIndent` - (foo) - .bar([ - baz - ]); - `, - options: [4, { MemberExpression: 1 }], - }, - { - code: unIndent` - switch (x) { - case "foo": - a(); - break; - case "bar": - switch (y) { - case "1": - break; - case "2": - a = 6; - break; - } - case "test": - break; - } - `, - options: [4, { SwitchCase: 1 }], - }, - { - code: unIndent` - switch (x) { - case "foo": - a(); - break; - case "bar": - switch (y) { - case "1": - break; - case "2": - a = 6; - break; - } - case "test": - break; - } - `, - options: [4, { SwitchCase: 2 }], - }, - unIndent` - switch (a) { - case "foo": - a(); - break; - case "bar": - switch(x){ - case '1': - break; - case '2': - a = 6; - break; - } - } - `, - unIndent` - switch (a) { - case "foo": - a(); - break; - case "bar": - if(x){ - a = 2; - } - else{ - a = 6; - } - } - `, - unIndent` - switch (a) { - case "foo": - a(); - break; - case "bar": - if(x){ - a = 2; - } - else - a = 6; - } - `, - unIndent` - switch (a) { - case "foo": - a(); - break; - case "bar": - a(); break; - case "baz": - a(); break; - } - `, - unIndent` - switch (0) { - } - `, - unIndent` - function foo() { - var a = "a"; - switch(a) { - case "a": - return "A"; - case "b": - return "B"; - } - } - foo(); - `, - { - code: unIndent` - switch(value){ - case "1": - case "2": - a(); - break; - default: - a(); - break; - } - switch(value){ - case "1": - a(); - break; - case "2": - break; - default: - break; - } - `, - options: [4, { SwitchCase: 1 }], - }, - unIndent` - var obj = {foo: 1, bar: 2}; - with (obj) { - console.log(foo + bar); - } - `, - unIndent` - if (a) { - (1 + 2 + 3); // no error on this line - } - `, - 'switch(value){ default: a(); break; }', - { - code: unIndent` - import {addons} from 'react/addons' - import React from 'react' - `, - options: [2], - parserOptions: { sourceType: 'module' }, - }, - { - code: unIndent` - import { - foo, - bar, - baz - } from 'qux'; - `, - parserOptions: { sourceType: 'module' }, - }, - { - code: unIndent` - var foo = 0, bar = 0; baz = 0; - export { - foo, - bar, - baz - } from 'qux'; - `, - parserOptions: { sourceType: 'module' }, - }, - { - code: unIndent` - var a = 1, - b = 2, - c = 3; - `, - options: [4], - }, - { - code: unIndent` - var a = 1 - ,b = 2 - ,c = 3; - `, - options: [4], - }, - { - code: "while (1 < 2) console.log('hi')", - options: [2], - }, - { - code: unIndent` - function salutation () { - switch (1) { - case 0: return console.log('hi') - case 1: return console.log('hey') - } - } - `, - options: [2, { SwitchCase: 1 }], - }, - { - code: unIndent` - var items = [ - { - foo: 'bar' - } - ]; - `, - options: [2, { VariableDeclarator: 2 }], - }, - { - code: unIndent` - const a = 1, - b = 2; - const items1 = [ - { - foo: 'bar' - } - ]; - const items2 = Items( - { - foo: 'bar' - } - ); - `, - options: [2, { VariableDeclarator: 3 }], - }, - { - code: unIndent` - const geometry = 2, - rotate = 3; - var a = 1, - b = 2; - let light = true, - shadow = false; - `, - options: [2, { VariableDeclarator: { const: 3, let: 2 } }], - }, - { - code: unIndent` - const abc = 5, - c = 2, - xyz = - { - a: 1, - b: 2 - }; - let abc2 = 5, - c2 = 2, - xyz2 = - { - a: 1, - b: 2 - }; - var abc3 = 5, - c3 = 2, - xyz3 = - { - a: 1, - b: 2 - }; - `, - options: [2, { VariableDeclarator: { var: 2, const: 3 }, SwitchCase: 1 }], - }, - { - code: unIndent` - module.exports = { - 'Unit tests': - { - rootPath: './', - environment: 'node', - tests: - [ - 'test/test-*.js' - ], - sources: - [ - '*.js', - 'test/**.js' - ] - } - }; - `, - options: [2], - }, - { - code: unIndent` - foo = - bar; - `, - options: [2], - }, - { - code: unIndent` - foo = ( - bar - ); - `, - options: [2], - }, - { - code: unIndent` - var path = require('path') - , crypto = require('crypto') - ; - `, - options: [2], - }, - unIndent` - var a = 1 - ,b = 2 - ; - `, - { - code: unIndent` - export function create (some, - argument) { - return Object.create({ - a: some, - b: argument - }); - }; - `, - options: [2, { FunctionDeclaration: { parameters: 'first' } }], - parserOptions: { sourceType: 'module' }, - }, - { - code: unIndent` - export function create (id, xfilter, rawType, - width=defaultWidth, height=defaultHeight, - footerHeight=defaultFooterHeight, - padding=defaultPadding) { - // ... function body, indented two spaces - } - `, - options: [2, { FunctionDeclaration: { parameters: 'first' } }], - parserOptions: { sourceType: 'module' }, - }, - { - code: unIndent` - var obj = { - foo: function () { - return new p() - .then(function (ok) { - return ok; - }, function () { - // ignore things - }); - } - }; - `, - options: [2], - }, - { - code: unIndent` - a.b() - .c(function(){ - var a; - }).d.e; - `, - options: [2], - }, - { - code: unIndent` - const YO = 'bah', - TE = 'mah' - - var res, - a = 5, - b = 4 - `, - options: [2, { VariableDeclarator: { var: 2, let: 2, const: 3 } }], - }, - { - code: unIndent` - const YO = 'bah', - TE = 'mah' - - var res, - a = 5, - b = 4 - - if (YO) console.log(TE) - `, - options: [2, { VariableDeclarator: { var: 2, let: 2, const: 3 } }], - }, - { - code: unIndent` - var foo = 'foo', - bar = 'bar', - baz = function() { - - } - - function hello () { - - } - `, - options: [2], - }, - { - code: unIndent` - var obj = { - send: function () { - return P.resolve({ - type: 'POST' - }) - .then(function () { - return true; - }, function () { - return false; - }); - } - }; - `, - options: [2], - }, - { - code: unIndent` - var obj = { - send: function () { - return P.resolve({ - type: 'POST' - }) - .then(function () { - return true; - }, function () { - return false; - }); - } - }; - `, - options: [2, { MemberExpression: 0 }], - }, - unIndent` - const someOtherFunction = argument => { - console.log(argument); - }, - someOtherValue = 'someOtherValue'; - `, - { - code: unIndent` - [ - 'a', - 'b' - ].sort().should.deepEqual([ - 'x', - 'y' - ]); - `, - options: [2], - }, - { - code: unIndent` - var a = 1, - B = class { - constructor(){} - a(){} - get b(){} - }; - `, - options: [2, { VariableDeclarator: 2, SwitchCase: 1 }], - }, - { - code: unIndent` - var a = 1, - B = - class { - constructor(){} - a(){} - get b(){} - }, - c = 3; - `, - options: [2, { VariableDeclarator: 2, SwitchCase: 1 }], - }, - { - code: unIndent` - class A{ - constructor(){} - a(){} - get b(){} - } - `, - options: [4, { VariableDeclarator: 1, SwitchCase: 1 }], - }, - { - code: unIndent` - var A = class { - constructor(){} - a(){} - get b(){} - } - `, - options: [4, { VariableDeclarator: 1, SwitchCase: 1 }], - }, - { - code: unIndent` - var a = { - some: 1 - , name: 2 - }; - `, - options: [2], - }, - { - code: unIndent` - a.c = { - aa: function() { - 'test1'; - return 'aa'; - } - , bb: function() { - return this.bb(); - } - }; - `, - options: [4], - }, - { - code: unIndent` - var a = - { - actions: - [ - { - name: 'compile' - } - ] - }; - `, - options: [4, { VariableDeclarator: 0, SwitchCase: 1 }], - }, - { - code: unIndent` - var a = - [ - { - name: 'compile' - } - ]; - `, - options: [4, { VariableDeclarator: 0, SwitchCase: 1 }], - }, - unIndent` - [[ - ], function( - foo - ) {} - ] - `, - unIndent` - define([ - 'foo' - ], function( - bar - ) { - baz; - } - ) - `, - { - code: unIndent` - const func = function (opts) { - return Promise.resolve() - .then(() => { - [ - 'ONE', 'TWO' - ].forEach(command => { doSomething(); }); - }); - }; - `, - options: [4, { MemberExpression: 0 }], - }, - { - code: unIndent` - const func = function (opts) { - return Promise.resolve() - .then(() => { - [ - 'ONE', 'TWO' - ].forEach(command => { doSomething(); }); - }); - }; - `, - options: [4], - }, - { - code: unIndent` - var haveFun = function () { - SillyFunction( - { - value: true, - }, - { - _id: true, - } - ); - }; - `, - options: [4], - }, - { - code: unIndent` - var haveFun = function () { - new SillyFunction( - { - value: true, - }, - { - _id: true, - } - ); - }; - `, - options: [4], - }, - { - code: unIndent` - let object1 = { - doThing() { - return _.chain([]) - .map(v => ( - { - value: true, - } - )) - .value(); - } - }; - `, - options: [2], - }, - { - code: unIndent` - var foo = { - bar: 1, - baz: { - qux: 2 - } - }, - bar = 1; - `, - options: [2], - }, - { - code: unIndent` - class Foo - extends Bar { - baz() {} - } - `, - options: [2], - }, - { - code: unIndent` - class Foo extends - Bar { - baz() {} - } - `, - options: [2], - }, - { - code: unIndent` - class Foo extends - ( - Bar - ) { - baz() {} - } - `, - options: [2], - }, - { - code: unIndent` - fs.readdirSync(path.join(__dirname, '../rules')).forEach(name => { - files[name] = foo; - }); - `, - options: [2, { outerIIFEBody: 0 }], - }, - { - code: unIndent` - (function(){ - function foo(x) { - return x + 1; - } - })(); - `, - options: [2, { outerIIFEBody: 0 }], - }, - { - code: unIndent` - (function(){ - function foo(x) { - return x + 1; - } - })(); - `, - options: [4, { outerIIFEBody: 2 }], - }, - { - code: unIndent` - (function(x, y){ - function foo(x) { - return x + 1; - } - })(1, 2); - `, - options: [2, { outerIIFEBody: 0 }], - }, - { - code: unIndent` - (function(){ - function foo(x) { - return x + 1; - } - }()); - `, - options: [2, { outerIIFEBody: 0 }], - }, - { - code: unIndent` - !function(){ - function foo(x) { - return x + 1; - } - }(); - `, - options: [2, { outerIIFEBody: 0 }], - }, - { - code: unIndent` - !function(){ - \t\t\tfunction foo(x) { - \t\t\t\treturn x + 1; - \t\t\t} - }(); - `, - options: ['tab', { outerIIFEBody: 3 }], - }, - { - code: unIndent` - var out = function(){ - function fooVar(x) { - return x + 1; - } - }; - `, - options: [2, { outerIIFEBody: 0 }], - }, - { - code: unIndent` - var ns = function(){ - function fooVar(x) { - return x + 1; - } - }(); - `, - options: [2, { outerIIFEBody: 0 }], - }, - { - code: unIndent` - ns = function(){ - function fooVar(x) { - return x + 1; - } - }(); - `, - options: [2, { outerIIFEBody: 0 }], - }, - { - code: unIndent` - var ns = (function(){ - function fooVar(x) { - return x + 1; - } - }(x)); - `, - options: [2, { outerIIFEBody: 0 }], - }, - { - code: unIndent` - var ns = (function(){ - function fooVar(x) { - return x + 1; - } - }(x)); - `, - options: [4, { outerIIFEBody: 2 }], - }, - { - code: unIndent` - var obj = { - foo: function() { - return true; - } - }; - `, - options: [2, { outerIIFEBody: 0 }], - }, - { - code: unIndent` - while ( - function() { - return true; - }()) { - - x = x + 1; - }; - `, - options: [2, { outerIIFEBody: 20 }], - }, - { - code: unIndent` - (() => { - function foo(x) { - return x + 1; - } - })(); - `, - options: [2, { outerIIFEBody: 0 }], - }, - { - code: unIndent` - function foo() { - } - `, - options: ['tab', { outerIIFEBody: 0 }], - }, - { - code: unIndent` - ;(() => { - function foo(x) { - return x + 1; - } - })(); - `, - options: [2, { outerIIFEBody: 0 }], - }, - { - code: unIndent` - if(data) { - console.log('hi'); - } - `, - options: [2, { outerIIFEBody: 0 }], - }, - { - code: 'Buffer.length', - options: [4, { MemberExpression: 1 }], - }, - { - code: unIndent` - Buffer - .indexOf('a') - .toString() - `, - options: [4, { MemberExpression: 1 }], - }, - { - code: unIndent` - Buffer. - length - `, - options: [4, { MemberExpression: 1 }], - }, - { - code: unIndent` - Buffer - .foo - .bar - `, - options: [4, { MemberExpression: 1 }], - }, - { - code: unIndent` - Buffer - \t.foo - \t.bar - `, - options: ['tab', { MemberExpression: 1 }], - }, - { - code: unIndent` - Buffer - .foo - .bar - `, - options: [2, { MemberExpression: 2 }], - }, - unIndent` - ( - foo - .bar - ) - `, - unIndent` - ( - ( - foo - .bar - ) - ) - `, - unIndent` - ( - foo - ) - .bar - `, - unIndent` - ( - ( - foo - ) - .bar - ) - `, - unIndent` - ( - ( - foo - ) - [ - ( - bar - ) - ] - ) - `, - unIndent` - ( - foo[bar] - ) - .baz - `, - unIndent` - ( - (foo.bar) - ) - .baz - `, - { - code: unIndent` - MemberExpression - .can - .be - .turned - .off(); - `, - options: [4, { MemberExpression: 'off' }], - }, - { - code: unIndent` - foo = bar.baz() - .bip(); - `, - options: [4, { MemberExpression: 1 }], - }, - unIndent` - function foo() { - new - .target - } - `, - unIndent` - function foo() { - new. - target - } - `, - { - code: unIndent` - if (foo) { - bar(); - } else if (baz) { - foobar(); - } else if (qux) { - qux(); - } - `, - options: [2], - }, - { - code: unIndent` - function foo(aaa, - bbb, ccc, ddd) { - bar(); - } - `, - options: [2, { FunctionDeclaration: { parameters: 1, body: 2 } }], - }, - { - code: unIndent` - function foo(aaa, bbb, - ccc, ddd) { - bar(); - } - `, - options: [2, { FunctionDeclaration: { parameters: 3, body: 1 } }], - }, - { - code: unIndent` - function foo(aaa, - bbb, - ccc) { - bar(); - } - `, - options: [4, { FunctionDeclaration: { parameters: 1, body: 3 } }], - }, - { - code: unIndent` - function foo(aaa, - bbb, ccc, - ddd, eee, fff) { - bar(); - } - `, - options: [2, { FunctionDeclaration: { parameters: 'first', body: 1 } }], - }, - { - code: unIndent` - function foo(aaa, bbb) - { - bar(); - } - `, - options: [2, { FunctionDeclaration: { body: 3 } }], - }, - { - code: unIndent` - function foo( - aaa, - bbb) { - bar(); - } - `, - options: [2, { FunctionDeclaration: { parameters: 'first', body: 2 } }], - }, - { - code: unIndent` - var foo = function(aaa, - bbb, - ccc, - ddd) { - bar(); - } - `, - options: [2, { FunctionExpression: { parameters: 2, body: 0 } }], - }, - { - code: unIndent` - var foo = function(aaa, - bbb, - ccc) { - bar(); - } - `, - options: [2, { FunctionExpression: { parameters: 1, body: 10 } }], - }, - { - code: unIndent` - var foo = function(aaa, - bbb, ccc, ddd, - eee, fff) { - bar(); - } - `, - options: [4, { FunctionExpression: { parameters: 'first', body: 1 } }], - }, - { - code: unIndent` - var foo = function( - aaa, bbb, ccc, - ddd, eee) { - bar(); - } - `, - options: [2, { FunctionExpression: { parameters: 'first', body: 3 } }], - }, - { - code: unIndent` - foo.bar( - baz, qux, function() { - qux; - } - ); - `, - options: [ - 2, - { FunctionExpression: { body: 3 }, CallExpression: { arguments: 3 } }, - ], - }, - { - code: unIndent` - function foo() { - bar(); - \tbaz(); - \t \t\t\t \t\t\t \t \tqux(); - } - `, - options: [2], - }, - { - code: unIndent` - function foo() { - function bar() { - baz(); - } - } - `, - options: [2, { FunctionDeclaration: { body: 1 } }], - }, - { - code: unIndent` - function foo() { - bar(); - \t\t} - `, - options: [2], - }, - { - code: unIndent` - function foo() { - function bar(baz, - qux) { - foobar(); - } - } - `, - options: [2, { FunctionDeclaration: { body: 1, parameters: 2 } }], - }, - { - code: unIndent` - (( - foo - )) - `, - options: [4], - }, - - // ternary expressions (https://github.com/eslint/eslint/issues/7420) - { - code: unIndent` - foo - ? bar - : baz - `, - options: [2], - }, - { - code: unIndent` - foo = (bar ? - baz : - qux - ); - `, - options: [2], - }, - unIndent` - [ - foo ? - bar : - baz, - qux - ]; - `, - { - /* - * Checking comments: - * https://github.com/eslint/eslint/issues/3845, https://github.com/eslint/eslint/issues/6571 - */ - code: unIndent` - foo(); - // Line - /* multiline - Line */ - bar(); - // trailing comment - `, - options: [2], - }, - { - code: unIndent` - switch (foo) { - case bar: - baz(); - // call the baz function - } - `, - options: [2, { SwitchCase: 1 }], - }, - { - code: unIndent` - switch (foo) { - case bar: - baz(); - // no default - } - `, - options: [2, { SwitchCase: 1 }], - }, - unIndent` - [ - // no elements - ] - `, - { - /* - * Destructuring assignments: - * https://github.com/eslint/eslint/issues/6813 - */ - code: unIndent` - var { - foo, - bar, - baz: qux, - foobar: baz = foobar - } = qux; - `, - options: [2], - }, - { - code: unIndent` - var [ - foo, - bar, - baz, - foobar = baz - ] = qux; - `, - options: [2], - }, - { - code: unIndent` - const { - a - } - = - { - a: 1 - } - `, - options: [2], - }, - { - code: unIndent` - const { - a - } = { - a: 1 - } - `, - options: [2], - }, - { - code: unIndent` - const - { - a - } = { - a: 1 - }; - `, - options: [2], - }, - { - code: unIndent` - const - foo = { - bar: 1 - } - `, - options: [2], - }, - { - code: unIndent` - const [ - a - ] = [ - 1 - ] - `, - options: [2], - }, - { - // https://github.com/eslint/eslint/issues/7233 - code: unIndent` - var folder = filePath - .foo() - .bar; - `, - options: [2, { MemberExpression: 2 }], - }, - { - code: unIndent` - for (const foo of bar) - baz(); - `, - options: [2], - }, - { - code: unIndent` - var x = () => - 5; - `, - options: [2], - }, - unIndent` - ( - foo - )( - bar - ) - `, - unIndent` - (() => - foo - )( - bar - ) - `, - unIndent` - (() => { - foo(); - })( - bar - ) - `, - { - // Don't lint the indentation of the first token after a : - code: unIndent` - ({code: - "foo.bar();"}) - `, - options: [2], - }, - { - // Don't lint the indentation of the first token after a : - code: unIndent` - ({code: - "foo.bar();"}) - `, - options: [2], - }, - unIndent` - ({ - foo: - bar - }) - `, - unIndent` - ({ - [foo]: - bar - }) - `, - { - // Comments in switch cases - code: unIndent` - switch (foo) { - // comment - case study: - // comment - bar(); - case closed: - /* multiline comment - */ - } - `, - options: [2, { SwitchCase: 1 }], - }, - { - // Comments in switch cases - code: unIndent` - switch (foo) { - // comment - case study: - // the comment can also be here - case closed: - } - `, - options: [2, { SwitchCase: 1 }], - }, - { - // BinaryExpressions with parens - code: unIndent` - foo && ( - bar - ) - `, - options: [4], - }, - { - // BinaryExpressions with parens - code: unIndent` - foo && (( - bar - )) - `, - options: [4], - }, - { - code: unIndent` - foo && - ( - bar - ) - `, - options: [4], - }, - unIndent` - foo && - !bar( - ) - `, - unIndent` - foo && - ![].map(() => { - bar(); - }) - `, - { - code: unIndent` - foo = - bar; - `, - options: [4], - }, - { - code: unIndent` - function foo() { - var bar = function(baz, - qux) { - foobar(); - }; - } - `, - options: [2, { FunctionExpression: { parameters: 3 } }], - }, - unIndent` - function foo() { - return (bar === 1 || bar === 2 && - (/Function/.test(grandparent.type))) && - directives(parent).indexOf(node) >= 0; - } - `, - { - code: unIndent` - function foo() { - return (foo === bar || ( - baz === qux && ( - foo === foo || - bar === bar || - baz === baz - ) - )) - } - `, - options: [4], - }, - unIndent` - if ( - foo === 1 || - bar === 1 || - // comment - (baz === 1 && qux === 1) - ) {} - `, - { - code: unIndent` - foo = - (bar + baz); - `, - options: [2], - }, - { - code: unIndent` - function foo() { - return (bar === 1 || bar === 2) && - (z === 3 || z === 4); - } - `, - options: [2], - }, - { - code: unIndent` - /* comment */ if (foo) { - bar(); - } - `, - options: [2], - }, - { - // Comments at the end of if blocks that have `else` blocks can either refer to the lines above or below them - code: unIndent` - if (foo) { - bar(); - // Otherwise, if foo is false, do baz. - // baz is very important. - } else { - baz(); - } - `, - options: [2], - }, - { - code: unIndent` - function foo() { - return ((bar === 1 || bar === 2) && - (z === 3 || z === 4)); - } - `, - options: [2], - }, - { - code: unIndent` - foo( - bar, - baz, - qux - ); - `, - options: [2, { CallExpression: { arguments: 1 } }], - }, - { - code: unIndent` - foo( - \tbar, - \tbaz, - \tqux - ); - `, - options: ['tab', { CallExpression: { arguments: 1 } }], - }, - { - code: unIndent` - foo(bar, - baz, - qux); - `, - options: [4, { CallExpression: { arguments: 2 } }], - }, - { - code: unIndent` - foo( - bar, - baz, - qux - ); - `, - options: [2, { CallExpression: { arguments: 0 } }], - }, - { - code: unIndent` - foo(bar, - baz, - qux - ); - `, - options: [2, { CallExpression: { arguments: 'first' } }], - }, - { - code: unIndent` - foo(bar, baz, - qux, barbaz, - barqux, bazqux); - `, - options: [2, { CallExpression: { arguments: 'first' } }], - }, - { - code: unIndent` - foo(bar, - 1 + 2, - !baz, - new Car('!') - ); - `, - options: [2, { CallExpression: { arguments: 4 } }], - }, - unIndent` - foo( - (bar) - ); - `, - { - code: unIndent` - foo( - (bar) - ); - `, - options: [4, { CallExpression: { arguments: 1 } }], - }, - - // https://github.com/eslint/eslint/issues/7484 - { - code: unIndent` - var foo = function() { - return bar( - [{ - }].concat(baz) - ); - }; - `, - options: [2], - }, - - // https://github.com/eslint/eslint/issues/7573 - { - code: unIndent` - return ( - foo - ); - `, - parserOptions: { ecmaFeatures: { globalReturn: true } }, - }, - { - code: unIndent` - return ( - foo - ) - `, - parserOptions: { ecmaFeatures: { globalReturn: true } }, - }, - unIndent` - var foo = [ - bar, - baz - ] - `, - unIndent` - var foo = [bar, - baz, - qux - ] - `, - { - code: unIndent` - var foo = [bar, - baz, - qux - ] - `, - options: [2, { ArrayExpression: 0 }], - }, - { - code: unIndent` - var foo = [bar, - baz, - qux - ] - `, - options: [2, { ArrayExpression: 8 }], - }, - { - code: unIndent` - var foo = [bar, - baz, - qux - ] - `, - options: [2, { ArrayExpression: 'first' }], - }, - { - code: unIndent` - var foo = [bar, - baz, qux - ] - `, - options: [2, { ArrayExpression: 'first' }], - }, - { - code: unIndent` - var foo = [ - { bar: 1, - baz: 2 }, - { bar: 3, - baz: 4 } - ] - `, - options: [4, { ArrayExpression: 2, ObjectExpression: 'first' }], - }, - { - code: unIndent` - var foo = { - bar: 1, - baz: 2 - }; - `, - options: [2, { ObjectExpression: 0 }], - }, - { - code: unIndent` - var foo = { foo: 1, bar: 2, - baz: 3 } - `, - options: [2, { ObjectExpression: 'first' }], - }, - { - code: unIndent` - var foo = [ - { - foo: 1 - } - ] - `, - options: [4, { ArrayExpression: 2 }], - }, - { - code: unIndent` - function foo() { - [ - foo - ] - } - `, - options: [2, { ArrayExpression: 4 }], - }, - { - code: '[\n]', - options: [2, { ArrayExpression: 'first' }], - }, - { - code: '[\n]', - options: [2, { ArrayExpression: 1 }], - }, - { - code: '{\n}', - options: [2, { ObjectExpression: 'first' }], - }, - { - code: '{\n}', - options: [2, { ObjectExpression: 1 }], - }, - { - code: unIndent` - var foo = [ - [ - 1 - ] - ] - `, - options: [2, { ArrayExpression: 'first' }], - }, - { - code: unIndent` - var foo = [ 1, - [ - 2 - ] - ]; - `, - options: [2, { ArrayExpression: 'first' }], - }, - { - code: unIndent` - var foo = bar(1, - [ 2, - 3 - ] - ); - `, - options: [ - 4, - { ArrayExpression: 'first', CallExpression: { arguments: 'first' } }, - ], - }, - { - code: unIndent` - var foo = - [ - ]() - `, - options: [ - 4, - { CallExpression: { arguments: 'first' }, ArrayExpression: 'first' }, - ], - }, - - // https://github.com/eslint/eslint/issues/7732 - { - code: unIndent` - const lambda = foo => { - Object.assign({}, - filterName, - { - display - } - ); - } - `, - options: [2, { ObjectExpression: 1 }], - }, - { - code: unIndent` - const lambda = foo => { - Object.assign({}, - filterName, - { - display - } - ); - } - `, - options: [2, { ObjectExpression: 'first' }], - }, - - // https://github.com/eslint/eslint/issues/7733 - { - code: unIndent` - var foo = function() { - \twindow.foo('foo', - \t\t{ - \t\t\tfoo: 'bar', - \t\t\tbar: { - \t\t\t\tfoo: 'bar' - \t\t\t} - \t\t} - \t); - } - `, - options: ['tab'], - }, - { - code: unIndent` - echo = spawn('cmd.exe', - ['foo', 'bar', - 'baz']); - `, - options: [ - 2, - { ArrayExpression: 'first', CallExpression: { arguments: 'first' } }, - ], - }, - { - code: unIndent` - if (foo) - bar(); - // Otherwise, if foo is false, do baz. - // baz is very important. - else { - baz(); - } - `, - options: [2], - }, - { - code: unIndent` - if ( - foo && bar || - baz && qux // This line is ignored because BinaryExpressions are not checked. - ) { - qux(); - } - `, - options: [4], - }, - unIndent` - [ - ] || [ - ] - `, - unIndent` - ( - [ - ] || [ - ] - ) - `, - unIndent` - 1 - + ( - 1 - ) - `, - unIndent` - ( - foo && ( - bar || - baz - ) - ) - `, - unIndent` - foo - || ( - bar - ) - `, - unIndent` - foo - || ( - bar - ) - `, - { - code: unIndent` - var foo = - 1; - `, - options: [4, { VariableDeclarator: 2 }], - }, - { - code: unIndent` - var foo = 1, - bar = - 2; - `, - options: [4], - }, - { - code: unIndent` - switch (foo) { - case bar: - { - baz(); - } - } - `, - options: [2, { SwitchCase: 1 }], - }, - - // Template literals - { - code: unIndent` - \`foo\${ - bar}\` - `, - options: [2], - }, - { - code: unIndent` - \`foo\${ - \`bar\${ - baz}\`}\` - `, - options: [2], - }, - { - code: unIndent` - \`foo\${ - \`bar\${ - baz - }\` - }\` - `, - options: [2], - }, - { - code: unIndent` - \`foo\${ - ( - bar - ) - }\` - `, - options: [2], - }, - unIndent` - foo(\` - bar - \`, { - baz: 1 - }); - `, - unIndent` - function foo() { - \`foo\${bar}baz\${ - qux}foo\${ - bar}baz\` - } - `, - unIndent` - JSON - .stringify( - { - ok: true - } - ); - `, - - // Don't check AssignmentExpression assignments - unIndent` - foo = - bar = - baz; - `, - unIndent` - foo = - bar = - baz; - `, - unIndent` - function foo() { - const template = \`this indentation is not checked - because it's part of a template literal.\`; - } - `, - unIndent` - function foo() { - const template = \`the indentation of a \${ - node.type - } node is checked.\`; - } - `, - { - // https://github.com/eslint/eslint/issues/7320 - code: unIndent` - JSON - .stringify( - { - test: 'test' - } - ); - `, - options: [4, { CallExpression: { arguments: 1 } }], - }, - unIndent` - [ - foo, - // comment - // another comment - bar - ] - `, - unIndent` - if (foo) { - /* comment */ bar(); - } - `, - unIndent` - function foo() { - return ( - 1 - ); - } - `, - unIndent` - function foo() { - return ( - 1 - ) - } - `, - unIndent` - if ( - foo && - !( - bar - ) - ) {} - `, - { - // https://github.com/eslint/eslint/issues/6007 - code: unIndent` - var abc = [ - ( - '' - ), - def, - ] - `, - options: [2], - }, - { - code: unIndent` - var abc = [ - ( - '' - ), - ( - 'bar' - ) - ] - `, - options: [2], - }, - unIndent` - function f() { - return asyncCall() - .then( - 'some string', - [ - 1, - 2, - 3 - ] - ); - } - `, - { - // https://github.com/eslint/eslint/issues/6670 - code: unIndent` - function f() { - return asyncCall() - .then( - 'some string', - [ - 1, - 2, - 3 - ] - ); - } - `, - options: [4, { MemberExpression: 1 }], - }, - - // https://github.com/eslint/eslint/issues/7242 - unIndent` - var x = [ - [1], - [2] - ] - `, - unIndent` - var y = [ - {a: 1}, - {b: 2} - ] - `, - unIndent` - foo( - ) - `, - { - // https://github.com/eslint/eslint/issues/7616 - code: unIndent` - foo( - bar, - { - baz: 1 - } - ) - `, - options: [4, { CallExpression: { arguments: 'first' } }], - }, - 'new Foo', - 'new (Foo)', - unIndent` - if (Foo) { - new Foo - } - `, - { - code: unIndent` - var foo = 0, bar = 0, baz = 0; - export { - foo, - bar, - baz - } - `, - parserOptions: { sourceType: 'module' }, - }, - { - code: unIndent` - foo - ? bar - : baz - `, - options: [4, { flatTernaryExpressions: true }], - }, - { - code: unIndent` - foo ? - bar : - baz - `, - options: [4, { flatTernaryExpressions: true }], - }, - { - code: unIndent` - foo ? - bar - : baz - `, - options: [4, { flatTernaryExpressions: true }], - }, - { - code: unIndent` - foo - ? bar : - baz - `, - options: [4, { flatTernaryExpressions: true }], - }, - { - code: unIndent` - foo - ? bar - : baz - ? qux - : foobar - ? boop - : beep - `, - options: [4, { flatTernaryExpressions: true }], - }, - { - code: unIndent` - foo ? - bar : - baz ? - qux : - foobar ? - boop : - beep - `, - options: [4, { flatTernaryExpressions: true }], - }, - { - code: unIndent` - var a = - foo ? bar : - baz ? qux : - foobar ? boop : - /*else*/ beep - `, - options: [4, { flatTernaryExpressions: true }], - }, - { - code: unIndent` - var a = foo - ? bar - : baz - `, - options: [4, { flatTernaryExpressions: true }], - }, - { - code: unIndent` - var a = - foo - ? bar - : baz - `, - options: [4, { flatTernaryExpressions: true }], - }, - { - code: unIndent` - a = - foo ? bar : - baz ? qux : - foobar ? boop : - /*else*/ beep - `, - options: [4, { flatTernaryExpressions: true }], - }, - { - code: unIndent` - a = foo - ? bar - : baz - `, - options: [4, { flatTernaryExpressions: true }], - }, - { - code: unIndent` - a = - foo - ? bar - : baz - `, - options: [4, { flatTernaryExpressions: true }], - }, - { - code: unIndent` - foo( - foo ? bar : - baz ? qux : - foobar ? boop : - /*else*/ beep - ) - `, - options: [4, { flatTernaryExpressions: true }], - }, - { - code: unIndent` - function wrap() { - return ( - foo ? bar : - baz ? qux : - foobar ? boop : - /*else*/ beep - ) - } - `, - options: [4, { flatTernaryExpressions: true }], - }, - { - code: unIndent` - function wrap() { - return foo - ? bar - : baz - } - `, - options: [4, { flatTernaryExpressions: true }], - }, - { - code: unIndent` - function wrap() { - return ( - foo - ? bar - : baz - ) - } - `, - options: [4, { flatTernaryExpressions: true }], - }, - { - code: unIndent` - foo( - foo - ? bar - : baz - ) - `, - options: [4, { flatTernaryExpressions: true }], - }, - { - code: unIndent` - foo(foo - ? bar - : baz - ) - `, - options: [4, { flatTernaryExpressions: true }], - }, - { - code: unIndent` - foo - ? bar - : baz - ? qux - : foobar - ? boop - : beep - `, - options: [4, { flatTernaryExpressions: false }], - }, - { - code: unIndent` - foo ? - bar : - baz ? - qux : - foobar ? - boop : - beep - `, - options: [4, { flatTernaryExpressions: false }], - }, - { - code: '[,]', - options: [2, { ArrayExpression: 'first' }], - }, - { - code: '[,]', - options: [2, { ArrayExpression: 'off' }], - }, - { - code: unIndent` - [ - , - foo - ] - `, - options: [4, { ArrayExpression: 'first' }], - }, - { - code: '[sparse, , array];', - options: [2, { ArrayExpression: 'first' }], - }, - { - code: unIndent` - foo.bar('baz', function(err) { - qux; - }); - `, - options: [2, { CallExpression: { arguments: 'first' } }], - }, - { - code: unIndent` - foo.bar(function() { - cookies; - }).baz(function() { - cookies; - }); - `, - options: [2, { MemberExpression: 1 }], - }, - { - code: unIndent` - foo.bar().baz(function() { - cookies; - }).qux(function() { - cookies; - }); - `, - options: [2, { MemberExpression: 1 }], - }, - { - code: unIndent` - ( - { - foo: 1, - baz: 2 - } - ); - `, - options: [2, { ObjectExpression: 'first' }], - }, - { - code: unIndent` - foo(() => { - bar; - }, () => { - baz; - }) - `, - options: [4, { CallExpression: { arguments: 'first' } }], - }, - { - code: unIndent` - [ foo, - bar ].forEach(function() { - baz; - }) - `, - options: [2, { ArrayExpression: 'first', MemberExpression: 1 }], - }, - unIndent` - foo = bar[ - baz - ]; - `, - { - code: unIndent` - foo[ - bar - ]; - `, - options: [4, { MemberExpression: 1 }], - }, - { - code: unIndent` - foo[ - ( - bar - ) - ]; - `, - options: [4, { MemberExpression: 1 }], - }, - unIndent` - if (foo) - bar; - else if (baz) - qux; - `, - unIndent` - if (foo) bar() - - ; [1, 2, 3].map(baz) - `, - unIndent` - if (foo) - ; - `, - 'x => {}', - { - code: unIndent` - import {foo} - from 'bar'; - `, - parserOptions: { sourceType: 'module' }, - }, - { - code: "import 'foo'", - parserOptions: { sourceType: 'module' }, - }, - { - code: unIndent` - import { foo, - bar, - baz, - } from 'qux'; - `, - options: [4, { ImportDeclaration: 1 }], - parserOptions: { sourceType: 'module' }, - }, - { - code: unIndent` - import { - foo, - bar, - baz, - } from 'qux'; - `, - options: [4, { ImportDeclaration: 1 }], - parserOptions: { sourceType: 'module' }, - }, - { - code: unIndent` - import { apple as a, - banana as b } from 'fruits'; - import { cat } from 'animals'; - `, - options: [4, { ImportDeclaration: 'first' }], - parserOptions: { sourceType: 'module' }, - }, - { - code: unIndent` - import { declaration, - can, - be, - turned } from 'off'; - `, - options: [4, { ImportDeclaration: 'off' }], - parserOptions: { sourceType: 'module' }, - }, - - // https://github.com/eslint/eslint/issues/8455 - unIndent` - ( - a - ) => b => { - c - } - `, - unIndent` - ( - a - ) => b => c => d => { - e - } - `, - unIndent` - ( - a - ) => - ( - b - ) => { - c - } - `, - unIndent` - if ( - foo - ) bar( - baz - ); - `, - unIndent` - if (foo) - { - bar(); - } - `, - unIndent` - function foo(bar) - { - baz(); - } - `, - unIndent` - () => - ({}) - `, - unIndent` - () => - (({})) - `, - unIndent` - ( - () => - ({}) - ) - `, - unIndent` - var x = function foop(bar) - { - baz(); - } - `, - unIndent` - var x = (bar) => - { - baz(); - } - `, - unIndent` - class Foo - { - constructor() - { - foo(); - } - - bar() - { - baz(); - } - } - `, - unIndent` - class Foo - extends Bar - { - constructor() - { - foo(); - } - - bar() - { - baz(); - } - } - `, - unIndent` - ( - class Foo - { - constructor() - { - foo(); - } - - bar() - { - baz(); - } - } - ) - `, - { - code: unIndent` - switch (foo) - { - case 1: - bar(); - } - `, - options: [4, { SwitchCase: 1 }], - }, - unIndent` - foo - .bar(function() { - baz - }) - `, - { - code: unIndent` - foo - .bar(function() { - baz - }) - `, - options: [4, { MemberExpression: 2 }], - }, - unIndent` - foo - [bar](function() { - baz - }) - `, - unIndent` - foo. - bar. - baz - `, - { - code: unIndent` - foo - .bar(function() { - baz - }) - `, - options: [4, { MemberExpression: 'off' }], - }, - { - code: unIndent` - foo - .bar(function() { - baz - }) - `, - options: [4, { MemberExpression: 'off' }], - }, - { - code: unIndent` - foo - [bar](function() { - baz - }) - `, - options: [4, { MemberExpression: 'off' }], - }, - { - code: unIndent` - foo. - bar. - baz - `, - options: [4, { MemberExpression: 'off' }], - }, - { - code: unIndent` - foo = bar( - ).baz( - ) - `, - options: [4, { MemberExpression: 'off' }], - }, - { - code: unIndent` - foo[ - bar ? baz : - qux - ] - `, - options: [4, { flatTernaryExpressions: true }], - }, - { - code: unIndent` - function foo() { - return foo ? bar : - baz - } - `, - options: [4, { flatTernaryExpressions: true }], - }, - { - code: unIndent` - throw foo ? bar : - baz - `, - options: [4, { flatTernaryExpressions: true }], - }, - { - code: unIndent` - foo( - bar - ) ? baz : - qux - `, - options: [4, { flatTernaryExpressions: true }], - }, - unIndent` - foo - [ - bar - ] - .baz(function() { - quz(); - }) - `, - unIndent` - [ - foo - ][ - "map"](function() { - qux(); - }) - `, - unIndent` - ( - a.b(function() { - c; - }) - ) - `, - unIndent` - ( - foo - ).bar(function() { - baz(); - }) - `, - unIndent` - new Foo( - bar - .baz - .qux - ) - `, - unIndent` - const foo = a.b(), - longName = - (baz( - 'bar', - 'bar' - )); - `, - unIndent` - const foo = a.b(), - longName = - (baz( - 'bar', - 'bar' - )); - `, - unIndent` - const foo = a.b(), - longName = - baz( - 'bar', - 'bar' - ); - `, - unIndent` - const foo = a.b(), - longName = - baz( - 'bar', - 'bar' - ); - `, - unIndent` - const foo = a.b(), - longName - = baz( - 'bar', - 'bar' - ); - `, - unIndent` - const foo = a.b(), - longName - = baz( - 'bar', - 'bar' - ); - `, - unIndent` - const foo = a.b(), - longName = - ('fff'); - `, - unIndent` - const foo = a.b(), - longName = - ('fff'); - `, - unIndent` - const foo = a.b(), - longName - = ('fff'); - - `, - unIndent` - const foo = a.b(), - longName - = ('fff'); - - `, - unIndent` - const foo = a.b(), - longName = - ( - 'fff' - ); - `, - unIndent` - const foo = a.b(), - longName = - ( - 'fff' - ); - `, - unIndent` - const foo = a.b(), - longName - =( - 'fff' - ); - `, - unIndent` - const foo = a.b(), - longName - =( - 'fff' - ); - `, - - unIndent` - foo(\`foo - \`, { - ok: true - }, - { - ok: false - }) - `, - unIndent` - foo(tag\`foo - \`, { - ok: true - }, - { - ok: false - } - ) - `, - - // https://github.com/eslint/eslint/issues/8815 - unIndent` - async function test() { - const { - foo, - bar, - } = await doSomethingAsync( - 1, - 2, - 3, - ); - } - `, - unIndent` - function* test() { - const { - foo, - bar, - } = yield doSomethingAsync( - 1, - 2, - 3, - ); - } - `, - unIndent` - ({ - a: b - } = +foo( - bar - )); - `, - unIndent` - const { - foo, - bar, - } = typeof foo( - 1, - 2, - 3, - ); - `, - unIndent` - const { - foo, - bar, - } = +( - foo - ); - `, - - //---------------------------------------------------------------------- - // JSX tests - // https://github.com/eslint/eslint/issues/8425 - // Some of the following tests are adapted from the the tests in eslint-plugin-react. - // License: https://github.com/yannickcr/eslint-plugin-react/blob/7ca9841f22d599f447a27ef5b2a97def9229d6c8/LICENSE - //---------------------------------------------------------------------- - - ';', - unIndent` - ; - `, - 'var foo = ;', - unIndent` - var foo = ; - `, - unIndent` - var foo = (); - `, - unIndent` - var foo = ( - - ); - `, - unIndent` - < - Foo - a="b" - c="d" - />; - `, - unIndent` - ; - `, - unIndent` - < - Foo - a="b" - c="d"/>; - `, - 'bar;', - unIndent` - - bar - ; - `, - unIndent` - - bar - ; - `, - unIndent` - - bar - ; - `, - unIndent` - < - a - href="foo"> - bar - ; - `, - unIndent` - - bar - ; - `, - unIndent` - - bar - ; - `, - unIndent` - var foo = - baz - ; - `, - unIndent` - var foo = - baz - ; - `, - unIndent` - var foo = - baz - ; - `, - unIndent` - var foo = < - a - href="bar"> - baz - ; - `, - unIndent` - var foo = - baz - ; - `, - unIndent` - var foo = - baz - - `, - unIndent` - var foo = ( - baz - ); - `, - unIndent` - var foo = ( - baz - ); - `, - unIndent` - var foo = ( - - baz - - ); - `, - unIndent` - var foo = ( - - baz - - ); - `, - 'var foo = baz;', - unIndent` - - { - } - - `, - unIndent` - - { - foo - } - - `, - unIndent` - function foo() { - return ( - - { - b.forEach(() => { - // comment - a = c - .d() - .e(); - }) - } - - ); - } - `, - '', - unIndent` - - - `, - { - code: unIndent` - - - - `, - options: [2], - }, - { - code: unIndent` - - - - `, - options: [0], - }, - { - code: unIndent` - - \t - - `, - options: ['tab'], - }, - { - code: unIndent` - function App() { - return - - ; - } - `, - options: [2], - }, - { - code: unIndent` - function App() { - return ( - - ); - } - `, - options: [2], - }, - { - code: unIndent` - function App() { - return ( - - - - ); - } - `, - options: [2], - }, - { - code: unIndent` - it( - ( -
- -
- ) - ) - `, - options: [2], - }, - { - code: unIndent` - it( - (
- - - -
) - ) - `, - options: [2], - }, - { - code: unIndent` - ( -
- -
- ) - `, - options: [2], - }, - { - code: unIndent` - { - head.title && -

- {head.title} -

- } - `, - options: [2], - }, - { - code: unIndent` - { - head.title && -

- {head.title} -

- } - `, - options: [2], - }, - { - code: unIndent` - { - head.title && ( -

- {head.title} -

) - } - `, - options: [2], - }, - { - code: unIndent` - { - head.title && ( -

- {head.title} -

- ) - } - `, - options: [2], - }, - { - code: unIndent` - [ -
, -
- ] - `, - options: [2], - }, - unIndent` -
- { - [ - , - - ] - } -
- `, - unIndent` -
- {foo && - [ - , - - ] - } -
- `, - unIndent` -
- bar
- bar - bar {foo} - bar
-
- `, - unIndent` - foo ? - : - - `, - unIndent` - foo ? - - : - `, - unIndent` - foo ? - - : - - `, - unIndent` -
- {!foo ? - - : - - } -
- `, - { - code: unIndent` - - {condition ? - : - - } - - `, - options: [2], - }, - { - code: unIndent` - - {condition ? - : - - } - - `, - options: [2], - }, - { - code: unIndent` - function foo() { - - {condition ? - : - - } - - } - `, - options: [2], - }, - unIndent` - - `, - { - code: unIndent` - - `, - options: [2], - }, - { - code: unIndent` - - `, - options: [0], - }, - { - code: unIndent` - - `, - options: ['tab'], - }, - unIndent` - - `, - unIndent` - - `, - { - code: unIndent` - - `, - options: [2], - }, - { - code: unIndent` - - `, - options: [2], - }, - { - code: unIndent` - var x = function() { - return - } - `, - options: [2], - }, - { - code: unIndent` - var x = - `, - options: [2], - }, - { - code: unIndent` - - - - `, - options: [2], - }, - { - code: unIndent` - - {baz && } - - `, - options: [2], - }, - { - code: unIndent` - - `, - options: ['tab'], - }, - { - code: unIndent` - - `, - options: ['tab'], - }, - { - code: unIndent` - - `, - options: ['tab'], - }, - { - code: unIndent` - var x = - `, - options: ['tab'], - }, - unIndent` - - `, - unIndent` -
- unrelated{ - foo - } -
- `, - unIndent` -
unrelated{ - foo - } -
- `, - unIndent` - < - foo - .bar - .baz - > - foo - - `, - unIndent` - < - input - type= - "number" - /> - `, - unIndent` - < - input - type= - {'number'} - /> - `, - unIndent` - < - input - type - ="number" - /> - `, - unIndent` - foo ? ( - bar - ) : ( - baz - ) - `, - unIndent` - foo ? ( -
-
- ) : ( - - - ) - `, - unIndent` -
- { - /* foo */ - } -
- `, - - // https://github.com/eslint/eslint/issues/8832 - unIndent` -
- { - ( - 1 - ) - } -
- `, - unIndent` - function A() { - return ( -
- { - b && ( -
-
- ) - } -
- ); - } - `, - unIndent` -
foo -
bar
-
- `, - unIndent` - Foo bar  - baz qux. - - `, - { - code: unIndent` - a(b - , c - ) - `, - options: [2, { CallExpression: { arguments: 'off' } }], - }, - { - code: unIndent` - a( - new B({ - c, - }) - ); - `, - options: [2, { CallExpression: { arguments: 'off' } }], - }, - { - code: unIndent` - foo - ? bar - : baz - `, - options: [4, { ignoredNodes: [AST_NODE_TYPES.ConditionalExpression] }], - }, - { - code: unIndent` - class Foo { - foo() { - bar(); - } - } - `, - options: [4, { ignoredNodes: [AST_NODE_TYPES.ClassBody] }], - }, - { - code: unIndent` - class Foo { - foo() { - bar(); - } - } - `, - options: [ - 4, - { - ignoredNodes: [ - AST_NODE_TYPES.ClassBody, - AST_NODE_TYPES.BlockStatement, - ], - }, - ], - }, - { - code: unIndent` - foo({ - bar: 1 - }, - { - baz: 2 - }, - { - qux: 3 - }) - `, - options: [4, { ignoredNodes: ['CallExpression > ObjectExpression'] }], - }, - { - code: unIndent` - foo - .bar - `, - options: [4, { ignoredNodes: [AST_NODE_TYPES.MemberExpression] }], - }, - { - code: unIndent` - $(function() { - - foo(); - bar(); - - }); - `, - options: [ - 4, - { - ignoredNodes: [ - "Program > ExpressionStatement > CallExpression[callee.name='$'] > FunctionExpression > BlockStatement", - ], - }, - ], - }, - { - code: unIndent` - - `, - options: [4, { ignoredNodes: [AST_NODE_TYPES.JSXOpeningElement] }], - }, - { - code: unIndent` - foo && - - - `, - options: [ - 4, - { - ignoredNodes: [ - AST_NODE_TYPES.JSXElement, - AST_NODE_TYPES.JSXOpeningElement, - ], - }, - ], - }, - { - code: unIndent` - (function($) { - $(function() { - foo; - }); - }()) - `, - options: [ - 4, - { - ignoredNodes: [ - 'ExpressionStatement > CallExpression > FunctionExpression.callee > BlockStatement', - ], - }, - ], - }, - { - code: unIndent` - const value = ( - condition ? - valueIfTrue : - valueIfFalse - ); - `, - options: [4, { ignoredNodes: [AST_NODE_TYPES.ConditionalExpression] }], - }, - { - code: unIndent` - var a = 0, b = 0, c = 0; - export default foo( - a, - b, { - c - } - ) - `, - options: [ - 4, - { - ignoredNodes: [ - 'ExportDefaultDeclaration > CallExpression > ObjectExpression', - ], - }, - ], - parserOptions: { sourceType: 'module' }, - }, - { - code: unIndent` - foobar = baz - ? qux - : boop - `, - options: [4, { ignoredNodes: [AST_NODE_TYPES.ConditionalExpression] }], - }, - { - code: unIndent` - \` - SELECT - \${ - foo - } FROM THE_DATABASE - \` - `, - options: [4, { ignoredNodes: [AST_NODE_TYPES.TemplateLiteral] }], - }, - { - code: unIndent` - - Text - - `, - options: [4, { ignoredNodes: [AST_NODE_TYPES.JSXOpeningElement] }], - }, - { - code: unIndent` - { - \tvar x = 1, - \t y = 2; - } - `, - options: ['tab'], - }, - { - code: unIndent` - var x = 1, - y = 2; - var z; - `, - options: ['tab', { ignoredNodes: [AST_NODE_TYPES.VariableDeclarator] }], - }, - { - code: unIndent` - [ - foo(), - bar - ] - `, - options: [ - 'tab', - { - ArrayExpression: 'first', - ignoredNodes: [AST_NODE_TYPES.CallExpression], - }, - ], - }, - { - code: unIndent` - if (foo) { - doSomething(); - - // Intentionally unindented comment - doSomethingElse(); - } - `, - options: [4, { ignoreComments: true }], - }, - { - code: unIndent` - if (foo) { - doSomething(); - - /* Intentionally unindented comment */ - doSomethingElse(); - } - `, - options: [4, { ignoreComments: true }], - }, - unIndent` - const obj = { - foo () { - return condition ? // comment - 1 : - 2 - } - } - `, - - //---------------------------------------------------------------------- - // Comment alignment tests - //---------------------------------------------------------------------- - unIndent` - if (foo) { - // Comment can align with code immediately above even if "incorrect" alignment - doSomething(); - } - `, - unIndent` - if (foo) { - doSomething(); - // Comment can align with code immediately below even if "incorrect" alignment - } - `, - unIndent` - if (foo) { - // Comment can be in correct alignment even if not aligned with code above/below - } - `, - unIndent` - if (foo) { - - // Comment can be in correct alignment even if gaps between (and not aligned with) code above/below - - } - `, - unIndent` - [{ - foo - }, - - // Comment between nodes - - { - bar - }]; - `, - unIndent` - [{ - foo - }, - - // Comment between nodes - - { // comment - bar - }]; - `, - ], - - invalid: [ - { - code: unIndent` - var a = b; - if (a) { - b(); - } - `, - output: unIndent` - var a = b; - if (a) { - b(); - } - `, - options: [2], - errors: expectedErrors([[3, 2, 0, AST_TOKEN_TYPES.Identifier]]), - }, - { - code: unIndent` - require('http').request({hostname: 'localhost', - port: 80}, function(res) { - res.end(); - }); - `, - output: unIndent` - require('http').request({hostname: 'localhost', - port: 80}, function(res) { - res.end(); - }); - `, - options: [2], - errors: expectedErrors([ - [2, 2, 18, AST_TOKEN_TYPES.Identifier], - [3, 2, 4, AST_TOKEN_TYPES.Identifier], - [4, 0, 2, AST_TOKEN_TYPES.Punctuator], - ]), - }, - { - code: unIndent` - if (array.some(function(){ - return true; - })) { - a++; // -> - b++; - c++; // <- - } - `, - output: unIndent` - if (array.some(function(){ - return true; - })) { - a++; // -> - b++; - c++; // <- - } - `, - options: [2], - errors: expectedErrors([ - [4, 2, 0, AST_TOKEN_TYPES.Identifier], - [6, 2, 4, AST_TOKEN_TYPES.Identifier], - ]), - }, - { - code: unIndent` - if (a){ - \tb=c; - \t\tc=d; - e=f; - } - `, - output: unIndent` - if (a){ - \tb=c; - \tc=d; - \te=f; - } - `, - options: ['tab'], - errors: expectedErrors('tab', [ - [3, 1, 2, AST_TOKEN_TYPES.Identifier], - [4, 1, 0, AST_TOKEN_TYPES.Identifier], - ]), - }, - { - code: unIndent` - if (a){ - b=c; - c=d; - e=f; - } - `, - output: unIndent` - if (a){ - b=c; - c=d; - e=f; - } - `, - options: [4], - errors: expectedErrors([ - [3, 4, 6, AST_TOKEN_TYPES.Identifier], - [4, 4, 1, AST_TOKEN_TYPES.Identifier], - ]), - }, - { - code: fixture, - output: fixedFixture, - options: [ - 2, - { - SwitchCase: 1, - MemberExpression: 1, - CallExpression: { arguments: 'off' }, - }, - ], - errors: expectedErrors([ - [5, 2, 4, AST_TOKEN_TYPES.Keyword], - [6, 2, 0, AST_TOKEN_TYPES.Line], - [10, 4, 6, AST_TOKEN_TYPES.Punctuator], - [11, 2, 4, AST_TOKEN_TYPES.Punctuator], - - [15, 4, 2, AST_TOKEN_TYPES.Identifier], - [16, 2, 4, AST_TOKEN_TYPES.Punctuator], - [23, 2, 4, AST_TOKEN_TYPES.Punctuator], - [29, 2, 4, AST_TOKEN_TYPES.Keyword], - [30, 4, 6, AST_TOKEN_TYPES.Identifier], - [36, 4, 6, AST_TOKEN_TYPES.Identifier], - [38, 2, 4, AST_TOKEN_TYPES.Punctuator], - [39, 4, 2, AST_TOKEN_TYPES.Identifier], - [40, 2, 0, AST_TOKEN_TYPES.Punctuator], - [54, 2, 4, AST_TOKEN_TYPES.Punctuator], - [114, 4, 2, AST_TOKEN_TYPES.Keyword], - [120, 4, 6, AST_TOKEN_TYPES.Keyword], - [124, 4, 2, AST_TOKEN_TYPES.Keyword], - [134, 4, 6, AST_TOKEN_TYPES.Keyword], - [138, 2, 3, AST_TOKEN_TYPES.Punctuator], - [139, 2, 3, AST_TOKEN_TYPES.Punctuator], - [143, 4, 0, AST_TOKEN_TYPES.Identifier], - [144, 6, 2, AST_TOKEN_TYPES.Punctuator], - [145, 6, 2, AST_TOKEN_TYPES.Punctuator], - [151, 4, 6, AST_TOKEN_TYPES.Identifier], - [152, 6, 8, AST_TOKEN_TYPES.Punctuator], - [153, 6, 8, AST_TOKEN_TYPES.Punctuator], - [159, 4, 2, AST_TOKEN_TYPES.Identifier], - [161, 4, 6, AST_TOKEN_TYPES.Identifier], - [175, 2, 0, AST_TOKEN_TYPES.Identifier], - [177, 2, 4, AST_TOKEN_TYPES.Identifier], - [189, 2, 0, AST_TOKEN_TYPES.Keyword], - [192, 6, 18, AST_TOKEN_TYPES.Identifier], - [193, 6, 4, AST_TOKEN_TYPES.Identifier], - [195, 6, 8, AST_TOKEN_TYPES.Identifier], - [228, 5, 4, AST_TOKEN_TYPES.Identifier], - [231, 3, 2, AST_TOKEN_TYPES.Punctuator], - [245, 0, 2, AST_TOKEN_TYPES.Punctuator], - [248, 0, 2, AST_TOKEN_TYPES.Punctuator], - [304, 4, 6, AST_TOKEN_TYPES.Identifier], - [306, 4, 8, AST_TOKEN_TYPES.Identifier], - [307, 2, 4, AST_TOKEN_TYPES.Punctuator], - [308, 2, 4, AST_TOKEN_TYPES.Identifier], - [311, 4, 6, AST_TOKEN_TYPES.Identifier], - [312, 4, 6, AST_TOKEN_TYPES.Identifier], - [313, 4, 6, AST_TOKEN_TYPES.Identifier], - [314, 2, 4, AST_TOKEN_TYPES.Punctuator], - [315, 2, 4, AST_TOKEN_TYPES.Identifier], - [318, 4, 6, AST_TOKEN_TYPES.Identifier], - [319, 4, 6, AST_TOKEN_TYPES.Identifier], - [320, 4, 6, AST_TOKEN_TYPES.Identifier], - [321, 2, 4, AST_TOKEN_TYPES.Punctuator], - [322, 2, 4, AST_TOKEN_TYPES.Identifier], - [326, 2, 1, AST_TOKEN_TYPES.Numeric], - [327, 2, 1, AST_TOKEN_TYPES.Numeric], - [328, 2, 1, AST_TOKEN_TYPES.Numeric], - [329, 2, 1, AST_TOKEN_TYPES.Numeric], - [330, 2, 1, AST_TOKEN_TYPES.Numeric], - [331, 2, 1, AST_TOKEN_TYPES.Numeric], - [332, 2, 1, AST_TOKEN_TYPES.Numeric], - [333, 2, 1, AST_TOKEN_TYPES.Numeric], - [334, 2, 1, AST_TOKEN_TYPES.Numeric], - [335, 2, 1, AST_TOKEN_TYPES.Numeric], - [340, 2, 4, AST_TOKEN_TYPES.Identifier], - [341, 2, 0, AST_TOKEN_TYPES.Identifier], - [344, 2, 4, AST_TOKEN_TYPES.Identifier], - [345, 2, 0, AST_TOKEN_TYPES.Identifier], - [348, 2, 4, AST_TOKEN_TYPES.Identifier], - [349, 2, 0, AST_TOKEN_TYPES.Identifier], - [355, 2, 0, AST_TOKEN_TYPES.Identifier], - [357, 2, 4, AST_TOKEN_TYPES.Identifier], - [361, 4, 6, AST_TOKEN_TYPES.Identifier], - [362, 2, 4, AST_TOKEN_TYPES.Punctuator], - [363, 2, 4, AST_TOKEN_TYPES.Identifier], - [368, 2, 0, AST_TOKEN_TYPES.Keyword], - [370, 2, 4, AST_TOKEN_TYPES.Keyword], - [374, 4, 6, AST_TOKEN_TYPES.Keyword], - [376, 4, 2, AST_TOKEN_TYPES.Keyword], - [383, 2, 0, AST_TOKEN_TYPES.Identifier], - [385, 2, 4, AST_TOKEN_TYPES.Identifier], - [390, 2, 0, AST_TOKEN_TYPES.Identifier], - [392, 2, 4, AST_TOKEN_TYPES.Identifier], - [409, 2, 0, AST_TOKEN_TYPES.Identifier], - [410, 2, 4, AST_TOKEN_TYPES.Identifier], - [416, 2, 0, AST_TOKEN_TYPES.Identifier], - [417, 2, 4, AST_TOKEN_TYPES.Identifier], - [418, 0, 4, AST_TOKEN_TYPES.Punctuator], - [422, 2, 4, AST_TOKEN_TYPES.Identifier], - [423, 2, 0, AST_TOKEN_TYPES.Identifier], - [427, 2, 6, AST_TOKEN_TYPES.Identifier], - [428, 2, 8, AST_TOKEN_TYPES.Identifier], - [429, 2, 4, AST_TOKEN_TYPES.Identifier], - [430, 0, 4, AST_TOKEN_TYPES.Punctuator], - [433, 2, 4, AST_TOKEN_TYPES.Identifier], - [434, 0, 4, AST_TOKEN_TYPES.Punctuator], - [437, 2, 0, AST_TOKEN_TYPES.Identifier], - [438, 0, 4, AST_TOKEN_TYPES.Punctuator], - [442, 2, 4, AST_TOKEN_TYPES.Identifier], - [443, 2, 4, AST_TOKEN_TYPES.Identifier], - [444, 0, 2, AST_TOKEN_TYPES.Punctuator], - [451, 2, 0, AST_TOKEN_TYPES.Identifier], - [453, 2, 4, AST_TOKEN_TYPES.Identifier], - [499, 6, 8, AST_TOKEN_TYPES.Punctuator], - [500, 8, 6, AST_TOKEN_TYPES.Identifier], - [504, 4, 6, AST_TOKEN_TYPES.Punctuator], - [505, 6, 8, AST_TOKEN_TYPES.Identifier], - [506, 4, 8, AST_TOKEN_TYPES.Punctuator], - ]), - }, - { - code: unIndent` - switch(value){ - case "1": - a(); - break; - case "2": - a(); - break; - default: - a(); - break; - } - `, - output: unIndent` - switch(value){ - case "1": - a(); - break; - case "2": - a(); - break; - default: - a(); - break; - } - `, - options: [4, { SwitchCase: 1 }], - errors: expectedErrors([ - [4, 8, 4, AST_TOKEN_TYPES.Keyword], - [7, 8, 4, AST_TOKEN_TYPES.Keyword], - ]), - }, - { - code: unIndent` - var x = 0 && - { - a: 1, - b: 2 - }; - `, - output: unIndent` - var x = 0 && - { - a: 1, - b: 2 - }; - `, - options: [4], - errors: expectedErrors([ - [3, 8, 7, AST_TOKEN_TYPES.Identifier], - [4, 8, 10, AST_TOKEN_TYPES.Identifier], - ]), - }, - { - code: unIndent` - switch(value){ - case "1": - a(); - break; - case "2": - a(); - break; - default: - break; - } - `, - output: unIndent` - switch(value){ - case "1": - a(); - break; - case "2": - a(); - break; - default: - break; - } - `, - options: [4, { SwitchCase: 1 }], - errors: expectedErrors([9, 8, 4, AST_TOKEN_TYPES.Keyword]), - }, - { - code: unIndent` - switch(value){ - case "1": - case "2": - a(); - break; - default: - break; - } - switch(value){ - case "1": - break; - case "2": - a(); - break; - default: - a(); - break; - } - `, - output: unIndent` - switch(value){ - case "1": - case "2": - a(); - break; - default: - break; - } - switch(value){ - case "1": - break; - case "2": - a(); - break; - default: - a(); - break; - } - `, - options: [4, { SwitchCase: 1 }], - errors: expectedErrors([ - [11, 8, 4, AST_TOKEN_TYPES.Keyword], - [14, 8, 4, AST_TOKEN_TYPES.Keyword], - [17, 8, 4, AST_TOKEN_TYPES.Keyword], - ]), - }, - { - code: unIndent` - switch(value){ - case "1": - a(); - break; - case "2": - break; - default: - break; - } - `, - output: unIndent` - switch(value){ - case "1": - a(); - break; - case "2": - break; - default: - break; - } - `, - options: [4], - errors: expectedErrors([ - [2, 4, 0, AST_TOKEN_TYPES.Keyword], - [3, 8, 4, AST_TOKEN_TYPES.Identifier], - [4, 8, 4, AST_TOKEN_TYPES.Keyword], - [5, 4, 0, AST_TOKEN_TYPES.Keyword], - [6, 8, 4, AST_TOKEN_TYPES.Keyword], - [7, 4, 0, AST_TOKEN_TYPES.Keyword], - [8, 8, 4, AST_TOKEN_TYPES.Keyword], - ]), - }, - { - code: unIndent` - var obj = {foo: 1, bar: 2}; - with (obj) { - console.log(foo + bar); - } - `, - output: unIndent` - var obj = {foo: 1, bar: 2}; - with (obj) { - console.log(foo + bar); - } - `, - errors: expectedErrors([3, 4, 0, AST_TOKEN_TYPES.Identifier]), - }, - { - code: unIndent` - switch (a) { - case '1': - b(); - break; - default: - c(); - break; - } - `, - output: unIndent` - switch (a) { - case '1': - b(); - break; - default: - c(); - break; - } - `, - options: [4, { SwitchCase: 1 }], - errors: expectedErrors([ - [2, 4, 0, AST_TOKEN_TYPES.Keyword], - [3, 8, 0, AST_TOKEN_TYPES.Identifier], - [4, 8, 0, AST_TOKEN_TYPES.Keyword], - [5, 4, 0, AST_TOKEN_TYPES.Keyword], - [6, 8, 0, AST_TOKEN_TYPES.Identifier], - [7, 8, 0, AST_TOKEN_TYPES.Keyword], - ]), - }, - { - code: unIndent` - var foo = function(){ - foo - .bar - } - `, - output: unIndent` - var foo = function(){ - foo - .bar - } - `, - options: [4, { MemberExpression: 1 }], - errors: expectedErrors([3, 8, 10, AST_TOKEN_TYPES.Punctuator]), - }, - { - code: unIndent` - ( - foo - .bar - ) - `, - output: unIndent` - ( - foo - .bar - ) - `, - errors: expectedErrors([3, 8, 4, AST_TOKEN_TYPES.Punctuator]), - }, - { - code: unIndent` - var foo = function(){ - foo - .bar - } - `, - output: unIndent` - var foo = function(){ - foo - .bar - } - `, - options: [4, { MemberExpression: 2 }], - errors: expectedErrors([3, 12, 13, AST_TOKEN_TYPES.Punctuator]), - }, - { - code: unIndent` - var foo = () => { - foo - .bar - } - `, - output: unIndent` - var foo = () => { - foo - .bar - } - `, - options: [4, { MemberExpression: 2 }], - errors: expectedErrors([3, 12, 13, AST_TOKEN_TYPES.Punctuator]), - }, - { - code: unIndent` - TestClass.prototype.method = function () { - return Promise.resolve(3) - .then(function (x) { - return x; - }); - }; - `, - output: unIndent` - TestClass.prototype.method = function () { - return Promise.resolve(3) - .then(function (x) { - return x; - }); - }; - `, - options: [2, { MemberExpression: 1 }], - errors: expectedErrors([3, 4, 6, AST_TOKEN_TYPES.Punctuator]), - }, - { - code: unIndent` - while (a) - b(); - `, - output: unIndent` - while (a) - b(); - `, - options: [4], - errors: expectedErrors([[2, 4, 0, AST_TOKEN_TYPES.Identifier]]), - }, - { - code: unIndent` - lmn = [{ - a: 1 - }, - { - b: 2 - }, - { - x: 2 - }]; - `, - output: unIndent` - lmn = [{ - a: 1 - }, - { - b: 2 - }, - { - x: 2 - }]; - `, - errors: expectedErrors([ - [2, 4, 8, AST_TOKEN_TYPES.Identifier], - [3, 0, 4, AST_TOKEN_TYPES.Punctuator], - [4, 0, 4, AST_TOKEN_TYPES.Punctuator], - [5, 4, 8, AST_TOKEN_TYPES.Identifier], - [6, 0, 4, AST_TOKEN_TYPES.Punctuator], - [7, 0, 4, AST_TOKEN_TYPES.Punctuator], - [8, 4, 8, AST_TOKEN_TYPES.Identifier], - ]), - }, - { - code: unIndent` - for (var foo = 1; - foo < 10; - foo++) {} - `, - output: unIndent` - for (var foo = 1; - foo < 10; - foo++) {} - `, - errors: expectedErrors([ - [2, 4, 0, AST_TOKEN_TYPES.Identifier], - [3, 4, 0, AST_TOKEN_TYPES.Identifier], - ]), - }, - { - code: unIndent` - for ( - var foo = 1; - foo < 10; - foo++ - ) {} - `, - output: unIndent` - for ( - var foo = 1; - foo < 10; - foo++ - ) {} - `, - errors: expectedErrors([ - [2, 4, 0, AST_TOKEN_TYPES.Keyword], - [3, 4, 0, AST_TOKEN_TYPES.Identifier], - [4, 4, 0, AST_TOKEN_TYPES.Identifier], - [5, 0, 4, AST_TOKEN_TYPES.Punctuator], - ]), - }, - { - code: unIndent` - for (;;) - b(); - `, - output: unIndent` - for (;;) - b(); - `, - options: [4], - errors: expectedErrors([[2, 4, 0, AST_TOKEN_TYPES.Identifier]]), - }, - { - code: unIndent` - for (a in x) - b(); - `, - output: unIndent` - for (a in x) - b(); - `, - options: [4], - errors: expectedErrors([[2, 4, 0, AST_TOKEN_TYPES.Identifier]]), - }, - { - code: unIndent` - do - b(); - while(true) - `, - output: unIndent` - do - b(); - while(true) - `, - options: [4], - errors: expectedErrors([[2, 4, 0, AST_TOKEN_TYPES.Identifier]]), - }, - { - code: unIndent` - if(true) - b(); - `, - output: unIndent` - if(true) - b(); - `, - options: [4], - errors: expectedErrors([[2, 4, 0, AST_TOKEN_TYPES.Identifier]]), - }, - { - code: unIndent` - var test = { - a: 1, - b: 2 - }; - `, - output: unIndent` - var test = { - a: 1, - b: 2 - }; - `, - options: [2], - errors: expectedErrors([ - [2, 2, 6, AST_TOKEN_TYPES.Identifier], - [3, 2, 4, AST_TOKEN_TYPES.Identifier], - [4, 0, 4, AST_TOKEN_TYPES.Punctuator], - ]), - }, - { - code: unIndent` - var a = function() { - a++; - b++; - c++; - }, - b; - `, - output: unIndent` - var a = function() { - a++; - b++; - c++; - }, - b; - `, - options: [4], - errors: expectedErrors([ - [2, 8, 6, AST_TOKEN_TYPES.Identifier], - [3, 8, 4, AST_TOKEN_TYPES.Identifier], - [4, 8, 10, AST_TOKEN_TYPES.Identifier], - ]), - }, - { - code: unIndent` - var a = 1, - b = 2, - c = 3; - `, - output: unIndent` - var a = 1, - b = 2, - c = 3; - `, - options: [4], - errors: expectedErrors([ - [2, 4, 0, AST_TOKEN_TYPES.Identifier], - [3, 4, 0, AST_TOKEN_TYPES.Identifier], - ]), - }, - { - code: unIndent` - [a, b, - c].forEach((index) => { - index; - }); - `, - output: unIndent` - [a, b, - c].forEach((index) => { - index; - }); - `, - options: [4], - errors: expectedErrors([ - [3, 4, 8, AST_TOKEN_TYPES.Identifier], - [4, 0, 4, AST_TOKEN_TYPES.Punctuator], - ]), - }, - { - code: unIndent` - [a, b, - c].forEach(function(index){ - return index; - }); - `, - output: unIndent` - [a, b, - c].forEach(function(index){ - return index; - }); - `, - options: [4], - errors: expectedErrors([ - [2, 4, 0, AST_TOKEN_TYPES.Identifier], - [3, 4, 2, AST_TOKEN_TYPES.Keyword], - ]), - }, - { - code: unIndent` - [a, b, c].forEach(function(index){ - return index; - }); - `, - output: unIndent` - [a, b, c].forEach(function(index){ - return index; - }); - `, - options: [4], - errors: expectedErrors([[2, 4, 2, AST_TOKEN_TYPES.Keyword]]), - }, - { - code: unIndent` - (foo) - .bar([ - baz - ]); - `, - output: unIndent` - (foo) - .bar([ - baz - ]); - `, - options: [4, { MemberExpression: 1 }], - errors: expectedErrors([ - [3, 8, 4, AST_TOKEN_TYPES.Identifier], - [4, 4, 0, AST_TOKEN_TYPES.Punctuator], - ]), - }, - { - code: unIndent` - var x = ['a', - 'b', - 'c' - ]; - `, - output: unIndent` - var x = ['a', - 'b', - 'c' - ]; - `, - options: [4], - errors: expectedErrors([ - [2, 4, 9, AST_TOKEN_TYPES.String], - [3, 4, 9, AST_TOKEN_TYPES.String], - ]), - }, - { - code: unIndent` - var x = [ - 'a', - 'b', - 'c' - ]; - `, - output: unIndent` - var x = [ - 'a', - 'b', - 'c' - ]; - `, - options: [4], - errors: expectedErrors([ - [2, 4, 9, AST_TOKEN_TYPES.String], - [3, 4, 9, AST_TOKEN_TYPES.String], - [4, 4, 9, AST_TOKEN_TYPES.String], - ]), - }, - { - code: unIndent` - var x = [ - 'a', - 'b', - 'c', - 'd']; - `, - output: unIndent` - var x = [ - 'a', - 'b', - 'c', - 'd']; - `, - options: [4], - errors: expectedErrors([ - [2, 4, 9, AST_TOKEN_TYPES.String], - [3, 4, 9, AST_TOKEN_TYPES.String], - [4, 4, 9, AST_TOKEN_TYPES.String], - [5, 4, 0, AST_TOKEN_TYPES.String], - ]), - }, - { - code: unIndent` - var x = [ - 'a', - 'b', - 'c' - ]; - `, - output: unIndent` - var x = [ - 'a', - 'b', - 'c' - ]; - `, - options: [4], - errors: expectedErrors([ - [2, 4, 9, AST_TOKEN_TYPES.String], - [3, 4, 9, AST_TOKEN_TYPES.String], - [4, 4, 9, AST_TOKEN_TYPES.String], - [5, 0, 2, AST_TOKEN_TYPES.Punctuator], - ]), - }, - { - code: unIndent` - [[ - ], function( - foo - ) {} - ] - `, - output: unIndent` - [[ - ], function( - foo - ) {} - ] - `, - errors: expectedErrors([ - [3, 4, 8, AST_TOKEN_TYPES.Identifier], - [4, 0, 4, AST_TOKEN_TYPES.Punctuator], - ]), - }, - { - code: unIndent` - define([ - 'foo' - ], function( - bar - ) { - baz; - } - ) - `, - output: unIndent` - define([ - 'foo' - ], function( - bar - ) { - baz; - } - ) - `, - errors: expectedErrors([ - [4, 4, 8, AST_TOKEN_TYPES.Identifier], - [5, 0, 4, AST_TOKEN_TYPES.Punctuator], - ]), - }, - { - code: unIndent` - while (1 < 2) - console.log('foo') - console.log('bar') - `, - output: unIndent` - while (1 < 2) - console.log('foo') - console.log('bar') - `, - options: [2], - errors: expectedErrors([ - [2, 2, 0, AST_TOKEN_TYPES.Identifier], - [3, 0, 2, AST_TOKEN_TYPES.Identifier], - ]), - }, - { - code: unIndent` - function salutation () { - switch (1) { - case 0: return console.log('hi') - case 1: return console.log('hey') - } - } - `, - output: unIndent` - function salutation () { - switch (1) { - case 0: return console.log('hi') - case 1: return console.log('hey') - } - } - `, - options: [2, { SwitchCase: 1 }], - errors: expectedErrors([[3, 4, 2, AST_TOKEN_TYPES.Keyword]]), - }, - { - code: unIndent` - var geometry, box, face1, face2, colorT, colorB, sprite, padding, maxWidth, - height, rotate; - `, - output: unIndent` - var geometry, box, face1, face2, colorT, colorB, sprite, padding, maxWidth, - height, rotate; - `, - options: [2, { SwitchCase: 1 }], - errors: expectedErrors([[2, 2, 0, AST_TOKEN_TYPES.Identifier]]), - }, - { - code: unIndent` - switch (a) { - case '1': - b(); - break; - default: - c(); - break; - } - `, - output: unIndent` - switch (a) { - case '1': - b(); - break; - default: - c(); - break; - } - `, - options: [4, { SwitchCase: 2 }], - errors: expectedErrors([ - [2, 8, 0, AST_TOKEN_TYPES.Keyword], - [3, 12, 0, AST_TOKEN_TYPES.Identifier], - [4, 12, 0, AST_TOKEN_TYPES.Keyword], - [5, 8, 0, AST_TOKEN_TYPES.Keyword], - [6, 12, 0, AST_TOKEN_TYPES.Identifier], - [7, 12, 0, AST_TOKEN_TYPES.Keyword], - ]), - }, - { - code: unIndent` - var geometry, - rotate; - `, - output: unIndent` - var geometry, - rotate; - `, - options: [2, { VariableDeclarator: 1 }], - errors: expectedErrors([[2, 2, 0, AST_TOKEN_TYPES.Identifier]]), - }, - { - code: unIndent` - var geometry, - rotate; - `, - output: unIndent` - var geometry, - rotate; - `, - options: [2, { VariableDeclarator: 2 }], - errors: expectedErrors([[2, 4, 2, AST_TOKEN_TYPES.Identifier]]), - }, - { - code: unIndent` - var geometry, - \trotate; - `, - output: unIndent` - var geometry, - \t\trotate; - `, - options: ['tab', { VariableDeclarator: 2 }], - errors: expectedErrors('tab', [[2, 2, 1, AST_TOKEN_TYPES.Identifier]]), - }, - { - code: unIndent` - let geometry, - rotate; - `, - output: unIndent` - let geometry, - rotate; - `, - options: [2, { VariableDeclarator: 2 }], - errors: expectedErrors([[2, 4, 2, AST_TOKEN_TYPES.Identifier]]), - }, - { - code: unIndent` - let foo = 'foo', - bar = bar; - const a = 'a', - b = 'b'; - `, - output: unIndent` - let foo = 'foo', - bar = bar; - const a = 'a', - b = 'b'; - `, - options: [2, { VariableDeclarator: 'first' }], - errors: expectedErrors([ - [2, 4, 2, AST_TOKEN_TYPES.Identifier], - [4, 6, 2, AST_TOKEN_TYPES.Identifier], - ]), - }, - { - code: unIndent` - var foo = 'foo', - bar = bar; - `, - output: unIndent` - var foo = 'foo', - bar = bar; - `, - options: [2, { VariableDeclarator: { var: 'first' } }], - errors: expectedErrors([[2, 4, 2, AST_TOKEN_TYPES.Identifier]]), - }, - { - code: unIndent` - if(true) - if (true) - if (true) - console.log(val); - `, - output: unIndent` - if(true) - if (true) - if (true) - console.log(val); - `, - options: [2, { VariableDeclarator: 2, SwitchCase: 1 }], - errors: expectedErrors([[4, 6, 4, AST_TOKEN_TYPES.Identifier]]), - }, - { - code: unIndent` - var a = { - a: 1, - b: 2 - } - `, - output: unIndent` - var a = { - a: 1, - b: 2 - } - `, - options: [2, { VariableDeclarator: 2, SwitchCase: 1 }], - errors: expectedErrors([ - [2, 2, 4, AST_TOKEN_TYPES.Identifier], - [3, 2, 4, AST_TOKEN_TYPES.Identifier], - ]), - }, - { - code: unIndent` - var a = [ - a, - b - ] - `, - output: unIndent` - var a = [ - a, - b - ] - `, - options: [2, { VariableDeclarator: 2, SwitchCase: 1 }], - errors: expectedErrors([ - [2, 2, 4, AST_TOKEN_TYPES.Identifier], - [3, 2, 4, AST_TOKEN_TYPES.Identifier], - ]), - }, - { - code: unIndent` - let a = [ - a, - b - ] - `, - output: unIndent` - let a = [ - a, - b - ] - `, - options: [2, { VariableDeclarator: { let: 2 }, SwitchCase: 1 }], - errors: expectedErrors([ - [2, 2, 4, AST_TOKEN_TYPES.Identifier], - [3, 2, 4, AST_TOKEN_TYPES.Identifier], - ]), - }, - { - code: unIndent` - var a = new Test({ - a: 1 - }), - b = 4; - `, - output: unIndent` - var a = new Test({ - a: 1 - }), - b = 4; - `, - options: [4], - errors: expectedErrors([ - [2, 8, 6, AST_TOKEN_TYPES.Identifier], - [3, 4, 2, AST_TOKEN_TYPES.Punctuator], - ]), - }, - { - code: unIndent` - var a = new Test({ - a: 1 - }), - b = 4; - const c = new Test({ - a: 1 - }), - d = 4; - `, - output: unIndent` - var a = new Test({ - a: 1 - }), - b = 4; - const c = new Test({ - a: 1 - }), - d = 4; - `, - options: [2, { VariableDeclarator: { var: 2 } }], - errors: expectedErrors([ - [6, 4, 6, AST_TOKEN_TYPES.Identifier], - [7, 2, 4, AST_TOKEN_TYPES.Punctuator], - [8, 2, 4, AST_TOKEN_TYPES.Identifier], - ]), - }, - { - code: unIndent` - var abc = 5, - c = 2, - xyz = - { - a: 1, - b: 2 - }; - `, - output: unIndent` - var abc = 5, - c = 2, - xyz = - { - a: 1, - b: 2 - }; - `, - options: [2, { VariableDeclarator: 2, SwitchCase: 1 }], - errors: expectedErrors([6, 6, 7, AST_TOKEN_TYPES.Identifier]), - }, - { - code: unIndent` - var abc = - { - a: 1, - b: 2 - }; - `, - output: unIndent` - var abc = - { - a: 1, - b: 2 - }; - `, - options: [2, { VariableDeclarator: 2, SwitchCase: 1 }], - errors: expectedErrors([4, 7, 8, AST_TOKEN_TYPES.Identifier]), - }, - { - code: unIndent` - var foo = { - bar: 1, - baz: { - qux: 2 - } - }, - bar = 1; - `, - output: unIndent` - var foo = { - bar: 1, - baz: { - qux: 2 - } - }, - bar = 1; - `, - options: [2], - errors: expectedErrors([ - [4, 6, 8, AST_TOKEN_TYPES.Identifier], - [5, 4, 6, AST_TOKEN_TYPES.Punctuator], - ]), - }, - { - code: unIndent` - var path = require('path') - , crypto = require('crypto') - ; - `, - output: unIndent` - var path = require('path') - , crypto = require('crypto') - ; - `, - options: [2], - errors: expectedErrors([[2, 2, 1, AST_TOKEN_TYPES.Punctuator]]), - }, - { - code: unIndent` - var a = 1 - ,b = 2 - ; - `, - output: unIndent` - var a = 1 - ,b = 2 - ; - `, - errors: expectedErrors([[2, 4, 3, AST_TOKEN_TYPES.Punctuator]]), - }, - { - code: unIndent` - class A{ - constructor(){} - a(){} - get b(){} - } - `, - output: unIndent` - class A{ - constructor(){} - a(){} - get b(){} - } - `, - options: [4, { VariableDeclarator: 1, SwitchCase: 1 }], - errors: expectedErrors([[2, 4, 2, AST_TOKEN_TYPES.Identifier]]), - }, - { - code: unIndent` - var A = class { - constructor(){} - a(){} - get b(){} - }; - `, - output: unIndent` - var A = class { - constructor(){} - a(){} - get b(){} - }; - `, - options: [4, { VariableDeclarator: 1, SwitchCase: 1 }], - errors: expectedErrors([ - [2, 4, 2, AST_TOKEN_TYPES.Identifier], - [4, 4, 2, AST_TOKEN_TYPES.Identifier], - ]), - }, - { - code: unIndent` - var a = 1, - B = class { - constructor(){} - a(){} - get b(){} - }; - `, - output: unIndent` - var a = 1, - B = class { - constructor(){} - a(){} - get b(){} - }; - `, - options: [2, { VariableDeclarator: 2, SwitchCase: 1 }], - errors: expectedErrors([[3, 6, 4, AST_TOKEN_TYPES.Identifier]]), - }, - { - code: unIndent` - { - if(a){ - foo(); - } - else{ - bar(); - } - } - `, - output: unIndent` - { - if(a){ - foo(); - } - else{ - bar(); - } - } - `, - options: [4], - errors: expectedErrors([[5, 4, 2, AST_TOKEN_TYPES.Keyword]]), - }, - { - code: unIndent` - { - if(a){ - foo(); - } - else - bar(); - - } - `, - output: unIndent` - { - if(a){ - foo(); - } - else - bar(); - - } - `, - options: [4], - errors: expectedErrors([[5, 4, 2, AST_TOKEN_TYPES.Keyword]]), - }, - { - code: unIndent` - { - if(a) - foo(); - else - bar(); - } - `, - output: unIndent` - { - if(a) - foo(); - else - bar(); - } - `, - options: [4], - errors: expectedErrors([[4, 4, 2, AST_TOKEN_TYPES.Keyword]]), - }, - { - code: unIndent` - (function(){ - function foo(x) { - return x + 1; - } - })(); - `, - output: unIndent` - (function(){ - function foo(x) { - return x + 1; - } - })(); - `, - options: [2, { outerIIFEBody: 0 }], - errors: expectedErrors([ - [2, 0, 2, AST_TOKEN_TYPES.Keyword], - [3, 2, 4, AST_TOKEN_TYPES.Keyword], - [4, 0, 2, AST_TOKEN_TYPES.Punctuator], - ]), - }, - { - code: unIndent` - (function(){ - function foo(x) { - return x + 1; - } - })(); - `, - output: unIndent` - (function(){ - function foo(x) { - return x + 1; - } - })(); - `, - options: [4, { outerIIFEBody: 2 }], - errors: expectedErrors([ - [2, 8, 4, AST_TOKEN_TYPES.Keyword], - [3, 12, 8, AST_TOKEN_TYPES.Keyword], - [4, 8, 4, AST_TOKEN_TYPES.Punctuator], - ]), - }, - { - code: unIndent` - if(data) { - console.log('hi'); - } - `, - output: unIndent` - if(data) { - console.log('hi'); - } - `, - options: [2, { outerIIFEBody: 0 }], - errors: expectedErrors([[2, 2, 0, AST_TOKEN_TYPES.Identifier]]), - }, - { - code: unIndent` - var ns = function(){ - function fooVar(x) { - return x + 1; - } - }(x); - `, - output: unIndent` - var ns = function(){ - function fooVar(x) { - return x + 1; - } - }(x); - `, - options: [4, { outerIIFEBody: 2 }], - errors: expectedErrors([ - [2, 8, 4, AST_TOKEN_TYPES.Keyword], - [3, 12, 8, AST_TOKEN_TYPES.Keyword], - [4, 8, 4, AST_TOKEN_TYPES.Punctuator], - ]), - }, - { - code: unIndent` - var obj = { - foo: function() { - return true; - }() - }; - `, - output: unIndent` - var obj = { - foo: function() { - return true; - }() - }; - `, - options: [2, { outerIIFEBody: 0 }], - errors: expectedErrors([[3, 4, 2, AST_TOKEN_TYPES.Keyword]]), - }, - { - code: unIndent` - typeof function() { - function fooVar(x) { - return x + 1; - } - }(); - `, - output: unIndent` - typeof function() { - function fooVar(x) { - return x + 1; - } - }(); - `, - options: [2, { outerIIFEBody: 2 }], - errors: expectedErrors([ - [2, 2, 4, AST_TOKEN_TYPES.Keyword], - [3, 4, 6, AST_TOKEN_TYPES.Keyword], - [4, 2, 4, AST_TOKEN_TYPES.Punctuator], - ]), - }, - { - code: unIndent` - { - \t!function(x) { - \t\t\t\treturn x + 1; - \t}() - }; - `, - output: unIndent` - { - \t!function(x) { - \t\treturn x + 1; - \t}() - }; - `, - options: ['tab', { outerIIFEBody: 3 }], - errors: expectedErrors('tab', [[3, 2, 4, AST_TOKEN_TYPES.Keyword]]), - }, - { - code: unIndent` - Buffer - .toString() - `, - output: unIndent` - Buffer - .toString() - `, - options: [4, { MemberExpression: 1 }], - errors: expectedErrors([[2, 4, 0, AST_TOKEN_TYPES.Punctuator]]), - }, - { - code: unIndent` - Buffer - .indexOf('a') - .toString() - `, - output: unIndent` - Buffer - .indexOf('a') - .toString() - `, - options: [4, { MemberExpression: 1 }], - errors: expectedErrors([[3, 4, 0, AST_TOKEN_TYPES.Punctuator]]), - }, - { - code: unIndent` - Buffer. - length - `, - output: unIndent` - Buffer. - length - `, - options: [4, { MemberExpression: 1 }], - errors: expectedErrors([[2, 4, 0, AST_TOKEN_TYPES.Identifier]]), - }, - { - code: unIndent` - Buffer. - \t\tlength - `, - output: unIndent` - Buffer. - \tlength - `, - options: ['tab', { MemberExpression: 1 }], - errors: expectedErrors('tab', [[2, 1, 2, AST_TOKEN_TYPES.Identifier]]), - }, - { - code: unIndent` - Buffer - .foo - .bar - `, - output: unIndent` - Buffer - .foo - .bar - `, - options: [2, { MemberExpression: 2 }], - errors: expectedErrors([ - [2, 4, 2, AST_TOKEN_TYPES.Punctuator], - [3, 4, 2, AST_TOKEN_TYPES.Punctuator], - ]), - }, - { - code: unIndent` - function foo() { - new - .target - } - `, - output: unIndent` - function foo() { - new - .target - } - `, - errors: expectedErrors([3, 8, 4, AST_TOKEN_TYPES.Punctuator]), - }, - { - code: unIndent` - function foo() { - new. - target - } - `, - output: unIndent` - function foo() { - new. - target - } - `, - errors: expectedErrors([3, 8, 4, AST_TOKEN_TYPES.Identifier]), - }, - { - // Indentation with multiple else statements: https://github.com/eslint/eslint/issues/6956 - - code: unIndent` - if (foo) bar(); - else if (baz) foobar(); - else if (qux) qux(); - `, - output: unIndent` - if (foo) bar(); - else if (baz) foobar(); - else if (qux) qux(); - `, - options: [2], - errors: expectedErrors([3, 0, 2, AST_TOKEN_TYPES.Keyword]), - }, - { - code: unIndent` - if (foo) bar(); - else if (baz) foobar(); - else qux(); - `, - output: unIndent` - if (foo) bar(); - else if (baz) foobar(); - else qux(); - `, - options: [2], - errors: expectedErrors([3, 0, 2, AST_TOKEN_TYPES.Keyword]), - }, - { - code: unIndent` - foo(); - if (baz) foobar(); - else qux(); - `, - output: unIndent` - foo(); - if (baz) foobar(); - else qux(); - `, - options: [2], - errors: expectedErrors([ - [2, 0, 2, AST_TOKEN_TYPES.Keyword], - [3, 0, 2, AST_TOKEN_TYPES.Keyword], - ]), - }, - { - code: unIndent` - if (foo) bar(); - else if (baz) foobar(); - else if (bip) { - qux(); - } - `, - output: unIndent` - if (foo) bar(); - else if (baz) foobar(); - else if (bip) { - qux(); - } - `, - options: [2], - errors: expectedErrors([ - [3, 0, 5, AST_TOKEN_TYPES.Keyword], - [4, 2, 7, AST_TOKEN_TYPES.Identifier], - [5, 0, 5, AST_TOKEN_TYPES.Punctuator], - ]), - }, - { - code: unIndent` - if (foo) bar(); - else if (baz) { - foobar(); - } else if (boop) { - qux(); - } - `, - output: unIndent` - if (foo) bar(); - else if (baz) { - foobar(); - } else if (boop) { - qux(); - } - `, - options: [2], - errors: expectedErrors([ - [3, 2, 4, AST_TOKEN_TYPES.Identifier], - [4, 0, 5, AST_TOKEN_TYPES.Punctuator], - [5, 2, 7, AST_TOKEN_TYPES.Identifier], - [6, 0, 5, AST_TOKEN_TYPES.Punctuator], - ]), - }, - { - code: unIndent` - function foo(aaa, - bbb, ccc, ddd) { - bar(); - } - `, - output: unIndent` - function foo(aaa, - bbb, ccc, ddd) { - bar(); - } - `, - options: [2, { FunctionDeclaration: { parameters: 1, body: 2 } }], - errors: expectedErrors([ - [2, 2, 4, AST_TOKEN_TYPES.Identifier], - [3, 4, 6, AST_TOKEN_TYPES.Identifier], - ]), - }, - { - code: unIndent` - function foo(aaa, bbb, - ccc, ddd) { - bar(); - } - `, - output: unIndent` - function foo(aaa, bbb, - ccc, ddd) { - bar(); - } - `, - options: [2, { FunctionDeclaration: { parameters: 3, body: 1 } }], - errors: expectedErrors([ - [2, 6, 2, AST_TOKEN_TYPES.Identifier], - [3, 2, 0, AST_TOKEN_TYPES.Identifier], - ]), - }, - { - code: unIndent` - function foo(aaa, - bbb, - ccc) { - bar(); - } - `, - output: unIndent` - function foo(aaa, - bbb, - ccc) { - bar(); - } - `, - options: [4, { FunctionDeclaration: { parameters: 1, body: 3 } }], - errors: expectedErrors([ - [2, 4, 8, AST_TOKEN_TYPES.Identifier], - [3, 4, 2, AST_TOKEN_TYPES.Identifier], - [4, 12, 6, AST_TOKEN_TYPES.Identifier], - ]), - }, - { - code: unIndent` - function foo(aaa, - bbb, ccc, - ddd, eee, fff) { - bar(); - } - `, - output: unIndent` - function foo(aaa, - bbb, ccc, - ddd, eee, fff) { - bar(); - } - `, - options: [2, { FunctionDeclaration: { parameters: 'first', body: 1 } }], - errors: expectedErrors([ - [2, 13, 2, AST_TOKEN_TYPES.Identifier], - [3, 13, 19, AST_TOKEN_TYPES.Identifier], - [4, 2, 3, AST_TOKEN_TYPES.Identifier], - ]), - }, - { - code: unIndent` - function foo(aaa, bbb) - { - bar(); - } - `, - output: unIndent` - function foo(aaa, bbb) - { - bar(); - } - `, - options: [2, { FunctionDeclaration: { body: 3 } }], - errors: expectedErrors([3, 6, 0, AST_TOKEN_TYPES.Identifier]), - }, - { - code: unIndent` - function foo( - aaa, - bbb) { - bar(); - } - `, - output: unIndent` - function foo( - aaa, - bbb) { - bar(); - } - `, - options: [2, { FunctionDeclaration: { parameters: 'first', body: 2 } }], - errors: expectedErrors([ - [2, 2, 0, AST_TOKEN_TYPES.Identifier], - [3, 2, 4, AST_TOKEN_TYPES.Identifier], - [4, 4, 0, AST_TOKEN_TYPES.Identifier], - ]), - }, - { - code: unIndent` - var foo = function(aaa, - bbb, - ccc, - ddd) { - bar(); - } - `, - output: unIndent` - var foo = function(aaa, - bbb, - ccc, - ddd) { - bar(); - } - `, - options: [2, { FunctionExpression: { parameters: 2, body: 0 } }], - errors: expectedErrors([ - [2, 4, 2, AST_TOKEN_TYPES.Identifier], - [4, 4, 6, AST_TOKEN_TYPES.Identifier], - [5, 0, 2, AST_TOKEN_TYPES.Identifier], - ]), - }, - { - code: unIndent` - var foo = function(aaa, - bbb, - ccc) { - bar(); - } - `, - output: unIndent` - var foo = function(aaa, - bbb, - ccc) { - bar(); - } - `, - options: [2, { FunctionExpression: { parameters: 1, body: 10 } }], - errors: expectedErrors([ - [2, 2, 3, AST_TOKEN_TYPES.Identifier], - [3, 2, 1, AST_TOKEN_TYPES.Identifier], - [4, 20, 2, AST_TOKEN_TYPES.Identifier], - ]), - }, - { - code: unIndent` - var foo = function(aaa, - bbb, ccc, ddd, - eee, fff) { - bar(); - } - `, - output: unIndent` - var foo = function(aaa, - bbb, ccc, ddd, - eee, fff) { - bar(); - } - `, - options: [4, { FunctionExpression: { parameters: 'first', body: 1 } }], - errors: expectedErrors([ - [2, 19, 2, AST_TOKEN_TYPES.Identifier], - [3, 19, 24, AST_TOKEN_TYPES.Identifier], - [4, 4, 8, AST_TOKEN_TYPES.Identifier], - ]), - }, - { - code: unIndent` - var foo = function( - aaa, bbb, ccc, - ddd, eee) { - bar(); - } - `, - output: unIndent` - var foo = function( - aaa, bbb, ccc, - ddd, eee) { - bar(); - } - `, - options: [2, { FunctionExpression: { parameters: 'first', body: 3 } }], - errors: expectedErrors([ - [2, 2, 0, AST_TOKEN_TYPES.Identifier], - [3, 2, 4, AST_TOKEN_TYPES.Identifier], - [4, 6, 2, AST_TOKEN_TYPES.Identifier], - ]), - }, - { - code: unIndent` - var foo = bar; - \t\t\tvar baz = qux; - `, - output: unIndent` - var foo = bar; - var baz = qux; - `, - options: [2], - errors: expectedErrors([ - 2, - '0 spaces', - '3 tabs', - AST_TOKEN_TYPES.Keyword, - ]), - }, - { - code: unIndent` - function foo() { - \tbar(); - baz(); - qux(); - } - `, - output: unIndent` - function foo() { - \tbar(); - \tbaz(); - \tqux(); - } - `, - options: ['tab'], - errors: expectedErrors('tab', [ - [3, '1 tab', '2 spaces', AST_TOKEN_TYPES.Identifier], - [4, '1 tab', '14 spaces', AST_TOKEN_TYPES.Identifier], - ]), - }, - { - code: unIndent` - function foo() { - bar(); - \t\t} - `, - output: unIndent` - function foo() { - bar(); - } - `, - options: [2], - errors: expectedErrors([ - [3, '0 spaces', '2 tabs', AST_TOKEN_TYPES.Punctuator], - ]), - }, - { - code: unIndent` - function foo() { - function bar() { - baz(); - } - } - `, - output: unIndent` - function foo() { - function bar() { - baz(); - } - } - `, - options: [2, { FunctionDeclaration: { body: 1 } }], - errors: expectedErrors([3, 4, 8, AST_TOKEN_TYPES.Identifier]), - }, - { - code: unIndent` - function foo() { - function bar(baz, - qux) { - foobar(); - } - } - `, - output: unIndent` - function foo() { - function bar(baz, - qux) { - foobar(); - } - } - `, - options: [2, { FunctionDeclaration: { body: 1, parameters: 2 } }], - errors: expectedErrors([3, 6, 4, AST_TOKEN_TYPES.Identifier]), - }, - { - code: unIndent` - function foo() { - var bar = function(baz, - qux) { - foobar(); - }; - } - `, - output: unIndent` - function foo() { - var bar = function(baz, - qux) { - foobar(); - }; - } - `, - options: [2, { FunctionExpression: { parameters: 3 } }], - errors: expectedErrors([3, 8, 10, AST_TOKEN_TYPES.Identifier]), - }, - { - code: unIndent` - foo.bar( - baz, qux, function() { - qux; - } - ); - `, - output: unIndent` - foo.bar( - baz, qux, function() { - qux; - } - ); - `, - options: [ - 2, - { FunctionExpression: { body: 3 }, CallExpression: { arguments: 3 } }, - ], - errors: expectedErrors([3, 12, 8, AST_TOKEN_TYPES.Identifier]), - }, - { - code: unIndent` - { - try { - } - catch (err) { - } - finally { - } - } - `, - output: unIndent` - { - try { - } - catch (err) { - } - finally { - } - } - `, - errors: expectedErrors([ - [4, 4, 0, AST_TOKEN_TYPES.Keyword], - [6, 4, 0, AST_TOKEN_TYPES.Keyword], - ]), - }, - { - code: unIndent` - { - do { - } - while (true) - } - `, - output: unIndent` - { - do { - } - while (true) - } - `, - errors: expectedErrors([4, 4, 0, AST_TOKEN_TYPES.Keyword]), - }, - { - code: unIndent` - function foo() { - return ( - 1 - ) - } - `, - output: unIndent` - function foo() { - return ( - 1 - ) - } - `, - options: [2], - errors: expectedErrors([[4, 2, 4, AST_TOKEN_TYPES.Punctuator]]), - }, - { - code: unIndent` - function foo() { - return ( - 1 - ); - } - `, - output: unIndent` - function foo() { - return ( - 1 - ); - } - `, - options: [2], - errors: expectedErrors([[4, 2, 4, AST_TOKEN_TYPES.Punctuator]]), - }, - { - code: unIndent` - function test(){ - switch(length){ - case 1: return function(a){ - return fn.call(that, a); - }; - } - } - `, - output: unIndent` - function test(){ - switch(length){ - case 1: return function(a){ - return fn.call(that, a); - }; - } - } - `, - options: [2, { VariableDeclarator: 2, SwitchCase: 1 }], - errors: expectedErrors([[4, 6, 4, AST_TOKEN_TYPES.Keyword]]), - }, - { - code: unIndent` - function foo() { - return 1 - } - `, - output: unIndent` - function foo() { - return 1 - } - `, - options: [2], - errors: expectedErrors([[2, 2, 3, AST_TOKEN_TYPES.Keyword]]), - }, - { - code: unIndent` - foo( - bar, - baz, - qux); - `, - output: unIndent` - foo( - bar, - baz, - qux); - `, - options: [2, { CallExpression: { arguments: 1 } }], - errors: expectedErrors([ - [2, 2, 0, AST_TOKEN_TYPES.Identifier], - [4, 2, 4, AST_TOKEN_TYPES.Identifier], - ]), - }, - { - code: unIndent` - foo( - \tbar, - \tbaz); - `, - output: unIndent` - foo( - bar, - baz); - `, - options: [2, { CallExpression: { arguments: 2 } }], - errors: expectedErrors([ - [2, '4 spaces', '1 tab', AST_TOKEN_TYPES.Identifier], - [3, '4 spaces', '1 tab', AST_TOKEN_TYPES.Identifier], - ]), - }, - { - code: unIndent` - foo(bar, - \t\tbaz, - \t\tqux); - `, - output: unIndent` - foo(bar, - \tbaz, - \tqux); - `, - options: ['tab', { CallExpression: { arguments: 1 } }], - errors: expectedErrors('tab', [ - [2, 1, 2, AST_TOKEN_TYPES.Identifier], - [3, 1, 2, AST_TOKEN_TYPES.Identifier], - ]), - }, - { - code: unIndent` - foo(bar, baz, - qux); - `, - output: unIndent` - foo(bar, baz, - qux); - `, - options: [2, { CallExpression: { arguments: 'first' } }], - errors: expectedErrors([2, 4, 9, AST_TOKEN_TYPES.Identifier]), - }, - { - code: unIndent` - foo( - bar, - baz); - `, - output: unIndent` - foo( - bar, - baz); - `, - options: [2, { CallExpression: { arguments: 'first' } }], - errors: expectedErrors([ - [2, 2, 10, AST_TOKEN_TYPES.Identifier], - [3, 2, 4, AST_TOKEN_TYPES.Identifier], - ]), - }, - { - code: unIndent` - foo(bar, - 1 + 2, - !baz, - new Car('!') - ); - `, - output: unIndent` - foo(bar, - 1 + 2, - !baz, - new Car('!') - ); - `, - options: [2, { CallExpression: { arguments: 3 } }], - errors: expectedErrors([ - [2, 6, 2, AST_TOKEN_TYPES.Numeric], - [3, 6, 14, AST_TOKEN_TYPES.Punctuator], - [4, 6, 8, AST_TOKEN_TYPES.Keyword], - ]), - }, - - // https://github.com/eslint/eslint/issues/7573 - { - code: unIndent` - return ( - foo - ); - `, - output: unIndent` - return ( - foo - ); - `, - parserOptions: { ecmaFeatures: { globalReturn: true } }, - errors: expectedErrors([3, 0, 4, AST_TOKEN_TYPES.Punctuator]), - }, - { - code: unIndent` - return ( - foo - ) - `, - output: unIndent` - return ( - foo - ) - `, - parserOptions: { ecmaFeatures: { globalReturn: true } }, - errors: expectedErrors([3, 0, 4, AST_TOKEN_TYPES.Punctuator]), - }, - - // https://github.com/eslint/eslint/issues/7604 - { - code: unIndent` - if (foo) { - /* comment */bar(); - } - `, - output: unIndent` - if (foo) { - /* comment */bar(); - } - `, - errors: expectedErrors([2, 4, 8, AST_TOKEN_TYPES.Block]), - }, - { - code: unIndent` - foo('bar', - /** comment */{ - ok: true - }); - `, - output: unIndent` - foo('bar', - /** comment */{ - ok: true - }); - `, - errors: expectedErrors([2, 4, 8, AST_TOKEN_TYPES.Block]), - }, - { - code: unIndent` - foo( - (bar) - ); - `, - output: unIndent` - foo( - (bar) - ); - `, - options: [4, { CallExpression: { arguments: 1 } }], - errors: expectedErrors([2, 4, 0, AST_TOKEN_TYPES.Punctuator]), - }, - { - code: unIndent` - (( - foo - )) - `, - output: unIndent` - (( - foo - )) - `, - options: [4], - errors: expectedErrors([2, 4, 0, AST_TOKEN_TYPES.Identifier]), - }, - - // ternary expressions (https://github.com/eslint/eslint/issues/7420) - { - code: unIndent` - foo - ? bar - : baz - `, - output: unIndent` - foo - ? bar - : baz - `, - options: [2], - errors: expectedErrors([ - [2, 2, 0, AST_TOKEN_TYPES.Punctuator], - [3, 2, 4, AST_TOKEN_TYPES.Punctuator], - ]), - }, - { - code: unIndent` - [ - foo ? - bar : - baz, - qux - ] - `, - output: unIndent` - [ - foo ? - bar : - baz, - qux - ] - `, - errors: expectedErrors([5, 4, 8, AST_TOKEN_TYPES.Identifier]), - }, - { - /* - * Checking comments: - * https://github.com/eslint/eslint/issues/6571 - */ - code: unIndent` - foo(); - // comment - /* multiline - comment */ - bar(); - // trailing comment - `, - output: unIndent` - foo(); - // comment - /* multiline - comment */ - bar(); - // trailing comment - `, - options: [2], - errors: expectedErrors([ - [2, 0, 2, AST_TOKEN_TYPES.Line], - [3, 0, 4, AST_TOKEN_TYPES.Block], - [6, 0, 1, AST_TOKEN_TYPES.Line], - ]), - }, - { - code: ' // comment', - output: '// comment', - errors: expectedErrors([1, 0, 2, AST_TOKEN_TYPES.Line]), - }, - { - code: unIndent` - foo - // comment - `, - output: unIndent` - foo - // comment - `, - errors: expectedErrors([2, 0, 2, AST_TOKEN_TYPES.Line]), - }, - { - code: unIndent` - // comment - foo - `, - output: unIndent` - // comment - foo - `, - errors: expectedErrors([1, 0, 2, AST_TOKEN_TYPES.Line]), - }, - { - code: unIndent` - [ - // no elements - ] - `, - output: unIndent` - [ - // no elements - ] - `, - errors: expectedErrors([2, 4, 8, AST_TOKEN_TYPES.Line]), - }, - { - /* - * Destructuring assignments: - * https://github.com/eslint/eslint/issues/6813 - */ - code: unIndent` - var { - foo, - bar, - baz: qux, - foobar: baz = foobar - } = qux; - `, - output: unIndent` - var { - foo, - bar, - baz: qux, - foobar: baz = foobar - } = qux; - `, - options: [2], - errors: expectedErrors([ - [2, 2, 0, AST_TOKEN_TYPES.Identifier], - [4, 2, 4, AST_TOKEN_TYPES.Identifier], - [5, 2, 6, AST_TOKEN_TYPES.Identifier], - [6, 0, 2, AST_TOKEN_TYPES.Punctuator], - ]), - }, - { - code: unIndent` - const { - a - } = { - a: 1 - } - `, - output: unIndent` - const { - a - } = { - a: 1 - } - `, - options: [2], - errors: expectedErrors([ - [4, 2, 4, AST_TOKEN_TYPES.Identifier], - [5, 0, 2, AST_TOKEN_TYPES.Punctuator], - ]), - }, - { - code: unIndent` - var foo = [ - bar, - baz - ] - `, - output: unIndent` - var foo = [ - bar, - baz - ] - `, - errors: expectedErrors([ - [2, 4, 11, AST_TOKEN_TYPES.Identifier], - [3, 4, 2, AST_TOKEN_TYPES.Identifier], - [4, 0, 10, AST_TOKEN_TYPES.Punctuator], - ]), - }, - { - code: unIndent` - var foo = [bar, - baz, - qux - ] - `, - output: unIndent` - var foo = [bar, - baz, - qux - ] - `, - errors: expectedErrors([2, 4, 0, AST_TOKEN_TYPES.Identifier]), - }, - { - code: unIndent` - var foo = [bar, - baz, - qux - ] - `, - output: unIndent` - var foo = [bar, - baz, - qux - ] - `, - options: [2, { ArrayExpression: 0 }], - errors: expectedErrors([ - [2, 0, 2, AST_TOKEN_TYPES.Identifier], - [3, 0, 2, AST_TOKEN_TYPES.Identifier], - ]), - }, - { - code: unIndent` - var foo = [bar, - baz, - qux - ] - `, - output: unIndent` - var foo = [bar, - baz, - qux - ] - `, - options: [2, { ArrayExpression: 8 }], - errors: expectedErrors([ - [2, 16, 2, AST_TOKEN_TYPES.Identifier], - [3, 16, 2, AST_TOKEN_TYPES.Identifier], - ]), - }, - { - code: unIndent` - var foo = [bar, - baz, - qux - ] - `, - output: unIndent` - var foo = [bar, - baz, - qux - ] - `, - options: [2, { ArrayExpression: 'first' }], - errors: expectedErrors([ - [2, 11, 4, AST_TOKEN_TYPES.Identifier], - [3, 11, 4, AST_TOKEN_TYPES.Identifier], - ]), - }, - { - code: unIndent` - var foo = [bar, - baz, qux - ] - `, - output: unIndent` - var foo = [bar, - baz, qux - ] - `, - options: [2, { ArrayExpression: 'first' }], - errors: expectedErrors([2, 11, 4, AST_TOKEN_TYPES.Identifier]), - }, - { - code: unIndent` - var foo = [ - { bar: 1, - baz: 2 }, - { bar: 3, - qux: 4 } - ] - `, - output: unIndent` - var foo = [ - { bar: 1, - baz: 2 }, - { bar: 3, - qux: 4 } - ] - `, - options: [4, { ArrayExpression: 2, ObjectExpression: 'first' }], - errors: expectedErrors([ - [3, 10, 12, AST_TOKEN_TYPES.Identifier], - [5, 10, 12, AST_TOKEN_TYPES.Identifier], - ]), - }, - { - code: unIndent` - var foo = { - bar: 1, - baz: 2 - }; - `, - output: unIndent` - var foo = { - bar: 1, - baz: 2 - }; - `, - options: [2, { ObjectExpression: 0 }], - errors: expectedErrors([ - [2, 0, 2, AST_TOKEN_TYPES.Identifier], - [3, 0, 2, AST_TOKEN_TYPES.Identifier], - ]), - }, - { - code: unIndent` - var quux = { foo: 1, bar: 2, - baz: 3 } - `, - output: unIndent` - var quux = { foo: 1, bar: 2, - baz: 3 } - `, - options: [2, { ObjectExpression: 'first' }], - errors: expectedErrors([2, 13, 0, AST_TOKEN_TYPES.Identifier]), - }, - { - code: unIndent` - function foo() { - [ - foo - ] - } - `, - output: unIndent` - function foo() { - [ - foo - ] - } - `, - options: [2, { ArrayExpression: 4 }], - errors: expectedErrors([ - [2, 2, 4, AST_TOKEN_TYPES.Punctuator], - [3, 10, 12, AST_TOKEN_TYPES.Identifier], - [4, 2, 4, AST_TOKEN_TYPES.Punctuator], - ]), - }, - { - code: unIndent` - var [ - foo, - bar, - baz, - foobar = baz - ] = qux; - `, - output: unIndent` - var [ - foo, - bar, - baz, - foobar = baz - ] = qux; - `, - options: [2], - errors: expectedErrors([ - [2, 2, 0, AST_TOKEN_TYPES.Identifier], - [4, 2, 4, AST_TOKEN_TYPES.Identifier], - [5, 2, 6, AST_TOKEN_TYPES.Identifier], - [6, 0, 2, AST_TOKEN_TYPES.Punctuator], - ]), - }, - { - code: unIndent` - import { - foo, - bar, - baz - } from 'qux'; - `, - output: unIndent` - import { - foo, - bar, - baz - } from 'qux'; - `, - parserOptions: { sourceType: 'module' }, - errors: expectedErrors([ - [2, 4, 0, AST_TOKEN_TYPES.Identifier], - [3, 4, 2, AST_TOKEN_TYPES.Identifier], - ]), - }, - { - code: unIndent` - import { foo, - bar, - baz, - } from 'qux'; - `, - output: unIndent` - import { foo, - bar, - baz, - } from 'qux'; - `, - options: [4, { ImportDeclaration: 'first' }], - parserOptions: { sourceType: 'module' }, - errors: expectedErrors([[3, 9, 10, AST_TOKEN_TYPES.Identifier]]), - }, - { - code: unIndent` - import { foo, - bar, - baz, - } from 'qux'; - `, - output: unIndent` - import { foo, - bar, - baz, - } from 'qux'; - `, - options: [2, { ImportDeclaration: 2 }], - parserOptions: { sourceType: 'module' }, - errors: expectedErrors([[3, 4, 5, AST_TOKEN_TYPES.Identifier]]), - }, - { - code: unIndent` - var foo = 0, bar = 0, baz = 0; - export { - foo, - bar, - baz - }; - `, - output: unIndent` - var foo = 0, bar = 0, baz = 0; - export { - foo, - bar, - baz - }; - `, - parserOptions: { sourceType: 'module' }, - errors: expectedErrors([ - [3, 4, 0, AST_TOKEN_TYPES.Identifier], - [4, 4, 2, AST_TOKEN_TYPES.Identifier], - ]), - }, - { - code: unIndent` - var foo = 0, bar = 0, baz = 0; - export { - foo, - bar, - baz - } from 'qux'; - `, - output: unIndent` - var foo = 0, bar = 0, baz = 0; - export { - foo, - bar, - baz - } from 'qux'; - `, - parserOptions: { sourceType: 'module' }, - errors: expectedErrors([ - [3, 4, 0, AST_TOKEN_TYPES.Identifier], - [4, 4, 2, AST_TOKEN_TYPES.Identifier], - ]), - }, - { - // https://github.com/eslint/eslint/issues/7233 - code: unIndent` - var folder = filePath - .foo() - .bar; - `, - output: unIndent` - var folder = filePath - .foo() - .bar; - `, - options: [2, { MemberExpression: 2 }], - errors: expectedErrors([ - [2, 4, 2, AST_TOKEN_TYPES.Punctuator], - [3, 4, 6, AST_TOKEN_TYPES.Punctuator], - ]), - }, - { - code: unIndent` - for (const foo of bar) - baz(); - `, - output: unIndent` - for (const foo of bar) - baz(); - `, - options: [2], - errors: expectedErrors([2, 2, 4, AST_TOKEN_TYPES.Identifier]), - }, - { - code: unIndent` - var x = () => - 5; - `, - output: unIndent` - var x = () => - 5; - `, - options: [2], - errors: expectedErrors([2, 2, 4, AST_TOKEN_TYPES.Numeric]), - }, - { - // BinaryExpressions with parens - code: unIndent` - foo && ( - bar - ) - `, - output: unIndent` - foo && ( - bar - ) - `, - options: [4], - errors: expectedErrors([2, 4, 8, AST_TOKEN_TYPES.Identifier]), - }, - { - code: unIndent` - foo && - !bar( - ) - `, - output: unIndent` - foo && - !bar( - ) - `, - errors: expectedErrors([3, 4, 0, AST_TOKEN_TYPES.Punctuator]), - }, - { - code: unIndent` - foo && - ![].map(() => { - bar(); - }) - `, - output: unIndent` - foo && - ![].map(() => { - bar(); - }) - `, - errors: expectedErrors([ - [3, 8, 4, AST_TOKEN_TYPES.Identifier], - [4, 4, 0, AST_TOKEN_TYPES.Punctuator], - ]), - }, - { - code: unIndent` - [ - ] || [ - ] - `, - output: unIndent` - [ - ] || [ - ] - `, - errors: expectedErrors([3, 0, 4, AST_TOKEN_TYPES.Punctuator]), - }, - { - code: unIndent` - foo - || ( - bar - ) - `, - output: unIndent` - foo - || ( - bar - ) - `, - errors: expectedErrors([ - [3, 12, 16, AST_TOKEN_TYPES.Identifier], - [4, 8, 12, AST_TOKEN_TYPES.Punctuator], - ]), - }, - { - code: unIndent` - 1 - + ( - 1 - ) - `, - output: unIndent` - 1 - + ( - 1 - ) - `, - errors: expectedErrors([ - [3, 4, 8, AST_TOKEN_TYPES.Numeric], - [4, 0, 4, AST_TOKEN_TYPES.Punctuator], - ]), - }, - - // Template literals - { - code: unIndent` - \`foo\${ - bar}\` - `, - output: unIndent` - \`foo\${ - bar}\` - `, - options: [2], - errors: expectedErrors([2, 2, 0, AST_TOKEN_TYPES.Identifier]), - }, - { - code: unIndent` - \`foo\${ - \`bar\${ - baz}\`}\` - `, - output: unIndent` - \`foo\${ - \`bar\${ - baz}\`}\` - `, - options: [2], - errors: expectedErrors([ - [2, 2, 4, AST_TOKEN_TYPES.Template], - [3, 4, 0, AST_TOKEN_TYPES.Identifier], - ]), - }, - { - code: unIndent` - \`foo\${ - \`bar\${ - baz - }\` - }\` - `, - output: unIndent` - \`foo\${ - \`bar\${ - baz - }\` - }\` - `, - options: [2], - errors: expectedErrors([ - [2, 2, 4, AST_TOKEN_TYPES.Template], - [3, 4, 2, AST_TOKEN_TYPES.Identifier], - [4, 2, 4, AST_TOKEN_TYPES.Template], - [5, 0, 2, AST_TOKEN_TYPES.Template], - ]), - }, - { - code: unIndent` - \`foo\${ - ( - bar - ) - }\` - `, - output: unIndent` - \`foo\${ - ( - bar - ) - }\` - `, - options: [2], - errors: expectedErrors([ - [2, 2, 0, AST_TOKEN_TYPES.Punctuator], - [3, 4, 2, AST_TOKEN_TYPES.Identifier], - [4, 2, 0, AST_TOKEN_TYPES.Punctuator], - ]), - }, - { - code: unIndent` - function foo() { - \`foo\${bar}baz\${ - qux}foo\${ - bar}baz\` - } - `, - output: unIndent` - function foo() { - \`foo\${bar}baz\${ - qux}foo\${ - bar}baz\` - } - `, - errors: expectedErrors([ - [3, 8, 0, AST_TOKEN_TYPES.Identifier], - [4, 8, 2, AST_TOKEN_TYPES.Identifier], - ]), - }, - { - code: unIndent` - function foo() { - const template = \`the indentation of - a curly element in a \${ - node.type - } node is checked.\`; - } - `, - output: unIndent` - function foo() { - const template = \`the indentation of - a curly element in a \${ - node.type - } node is checked.\`; - } - `, - errors: expectedErrors([ - [4, 4, 8, AST_TOKEN_TYPES.Identifier], - [5, 0, 4, AST_TOKEN_TYPES.Template], - ]), - }, - { - code: unIndent` - function foo() { - const template = \`this time the - closing curly is at the end of the line \${ - foo} - so the spaces before this line aren't removed.\`; - } - `, - output: unIndent` - function foo() { - const template = \`this time the - closing curly is at the end of the line \${ - foo} - so the spaces before this line aren't removed.\`; - } - `, - errors: expectedErrors([4, 4, 12, AST_TOKEN_TYPES.Identifier]), - }, - { - /* - * https://github.com/eslint/eslint/issues/1801 - * Note: This issue also mentioned checking the indentation for the 2 below. However, - * this is intentionally ignored because everyone seems to have a different idea of how - * BinaryExpressions should be indented. - */ - code: unIndent` - if (true) { - a = ( - 1 + - 2); - } - `, - output: unIndent` - if (true) { - a = ( - 1 + - 2); - } - `, - errors: expectedErrors([3, 8, 0, AST_TOKEN_TYPES.Numeric]), - }, - { - // https://github.com/eslint/eslint/issues/3737 - code: unIndent` - if (true) { - for (;;) { - b(); - } - } - `, - output: unIndent` - if (true) { - for (;;) { - b(); - } - } - `, - options: [2], - errors: expectedErrors([ - [2, 2, 4, AST_TOKEN_TYPES.Keyword], - [3, 4, 6, AST_TOKEN_TYPES.Identifier], - ]), - }, - { - // https://github.com/eslint/eslint/issues/6670 - code: unIndent` - function f() { - return asyncCall() - .then( - 'some string', - [ - 1, - 2, - 3 - ] - ); - } - `, - output: unIndent` - function f() { - return asyncCall() - .then( - 'some string', - [ - 1, - 2, - 3 - ] - ); - } - `, - options: [4, { MemberExpression: 1, CallExpression: { arguments: 1 } }], - errors: expectedErrors([ - [3, 8, 4, AST_TOKEN_TYPES.Punctuator], - [4, 12, 15, AST_TOKEN_TYPES.String], - [5, 12, 14, AST_TOKEN_TYPES.Punctuator], - [6, 16, 14, AST_TOKEN_TYPES.Numeric], - [7, 16, 9, AST_TOKEN_TYPES.Numeric], - [8, 16, 35, AST_TOKEN_TYPES.Numeric], - [9, 12, 22, AST_TOKEN_TYPES.Punctuator], - [10, 8, 0, AST_TOKEN_TYPES.Punctuator], - [11, 0, 1, AST_TOKEN_TYPES.Punctuator], - ]), - }, - - // https://github.com/eslint/eslint/issues/7242 - { - code: unIndent` - var x = [ - [1], - [2] - ] - `, - output: unIndent` - var x = [ - [1], - [2] - ] - `, - errors: expectedErrors([ - [2, 4, 6, AST_TOKEN_TYPES.Punctuator], - [3, 4, 2, AST_TOKEN_TYPES.Punctuator], - ]), - }, - { - code: unIndent` - var y = [ - {a: 1}, - {b: 2} - ] - `, - output: unIndent` - var y = [ - {a: 1}, - {b: 2} - ] - `, - errors: expectedErrors([ - [2, 4, 6, AST_TOKEN_TYPES.Punctuator], - [3, 4, 2, AST_TOKEN_TYPES.Punctuator], - ]), - }, - { - code: unIndent` - echo = spawn('cmd.exe', - ['foo', 'bar', - 'baz']); - `, - output: unIndent` - echo = spawn('cmd.exe', - ['foo', 'bar', - 'baz']); - `, - options: [ - 2, - { ArrayExpression: 'first', CallExpression: { arguments: 'first' } }, - ], - errors: expectedErrors([ - [2, 13, 12, AST_TOKEN_TYPES.Punctuator], - [3, 14, 13, AST_TOKEN_TYPES.String], - ]), - }, - { - // https://github.com/eslint/eslint/issues/7522 - code: unIndent` - foo( - ) - `, - output: unIndent` - foo( - ) - `, - errors: expectedErrors([2, 0, 2, AST_TOKEN_TYPES.Punctuator]), - }, - { - // https://github.com/eslint/eslint/issues/7616 - code: unIndent` - foo( - bar, - { - baz: 1 - } - ) - `, - output: unIndent` - foo( - bar, - { - baz: 1 - } - ) - `, - options: [4, { CallExpression: { arguments: 'first' } }], - errors: expectedErrors([[2, 4, 8, AST_TOKEN_TYPES.Identifier]]), - }, - { - code: ' new Foo', - output: 'new Foo', - errors: expectedErrors([1, 0, 2, AST_TOKEN_TYPES.Keyword]), - }, - { - code: unIndent` - var foo = 0, bar = 0, baz = 0; - export { - foo, - bar, - baz - } - `, - output: unIndent` - var foo = 0, bar = 0, baz = 0; - export { - foo, - bar, - baz - } - `, - parserOptions: { sourceType: 'module' }, - errors: expectedErrors([ - [3, 4, 0, AST_TOKEN_TYPES.Identifier], - [4, 4, 8, AST_TOKEN_TYPES.Identifier], - [5, 4, 2, AST_TOKEN_TYPES.Identifier], - ]), - }, - { - code: unIndent` - foo - ? bar - : baz - `, - output: unIndent` - foo - ? bar - : baz - `, - options: [4, { flatTernaryExpressions: true }], - errors: expectedErrors([3, 4, 0, AST_TOKEN_TYPES.Punctuator]), - }, - { - code: unIndent` - foo ? - bar : - baz - `, - output: unIndent` - foo ? - bar : - baz - `, - options: [4, { flatTernaryExpressions: true }], - errors: expectedErrors([3, 4, 0, AST_TOKEN_TYPES.Identifier]), - }, - { - code: unIndent` - foo ? - bar - : baz - `, - output: unIndent` - foo ? - bar - : baz - `, - options: [4, { flatTernaryExpressions: true }], - errors: expectedErrors([3, 4, 2, AST_TOKEN_TYPES.Punctuator]), - }, - { - code: unIndent` - foo - ? bar : - baz - `, - output: unIndent` - foo - ? bar : - baz - `, - options: [4, { flatTernaryExpressions: true }], - errors: expectedErrors([3, 4, 0, AST_TOKEN_TYPES.Identifier]), - }, - { - code: unIndent` - foo ? bar - : baz ? qux - : foobar ? boop - : beep - `, - output: unIndent` - foo ? bar - : baz ? qux - : foobar ? boop - : beep - `, - options: [4, { flatTernaryExpressions: true }], - errors: expectedErrors([ - [3, 4, 8, AST_TOKEN_TYPES.Punctuator], - [4, 4, 12, AST_TOKEN_TYPES.Punctuator], - ]), - }, - { - code: unIndent` - foo ? bar : - baz ? qux : - foobar ? boop : - beep - `, - output: unIndent` - foo ? bar : - baz ? qux : - foobar ? boop : - beep - `, - options: [4, { flatTernaryExpressions: true }], - errors: expectedErrors([ - [3, 4, 8, AST_TOKEN_TYPES.Identifier], - [4, 4, 12, AST_TOKEN_TYPES.Identifier], - ]), - }, - { - code: unIndent` - var a = - foo ? bar : - baz ? qux : - foobar ? boop : - /*else*/ beep - `, - output: unIndent` - var a = - foo ? bar : - baz ? qux : - foobar ? boop : - /*else*/ beep - `, - options: [4, { flatTernaryExpressions: true }], - errors: expectedErrors([ - [3, 4, 6, AST_TOKEN_TYPES.Identifier], - [4, 4, 2, AST_TOKEN_TYPES.Identifier], - ]), - }, - { - code: unIndent` - var a = - foo - ? bar - : baz - `, - output: unIndent` - var a = - foo - ? bar - : baz - `, - options: [4, { flatTernaryExpressions: true }], - errors: expectedErrors([ - [3, 8, 4, AST_TOKEN_TYPES.Punctuator], - [4, 8, 4, AST_TOKEN_TYPES.Punctuator], - ]), - }, - { - code: unIndent` - foo ? bar - : baz ? qux - : foobar ? boop - : beep - `, - output: unIndent` - foo ? bar - : baz ? qux - : foobar ? boop - : beep - `, - options: [4, { flatTernaryExpressions: false }], - errors: expectedErrors([ - [3, 8, 4, AST_TOKEN_TYPES.Punctuator], - [4, 12, 4, AST_TOKEN_TYPES.Punctuator], - ]), - }, - { - code: unIndent` - foo ? bar : - baz ? qux : - foobar ? boop : - beep - `, - output: unIndent` - foo ? bar : - baz ? qux : - foobar ? boop : - beep - `, - options: [4, { flatTernaryExpressions: false }], - errors: expectedErrors([ - [3, 8, 4, AST_TOKEN_TYPES.Identifier], - [4, 12, 4, AST_TOKEN_TYPES.Identifier], - ]), - }, - { - code: unIndent` - foo - ? bar - : baz - ? qux - : foobar - ? boop - : beep - `, - output: unIndent` - foo - ? bar - : baz - ? qux - : foobar - ? boop - : beep - `, - options: [4, { flatTernaryExpressions: false }], - errors: expectedErrors([ - [4, 8, 4, AST_TOKEN_TYPES.Punctuator], - [5, 8, 4, AST_TOKEN_TYPES.Punctuator], - [6, 12, 4, AST_TOKEN_TYPES.Punctuator], - [7, 12, 4, AST_TOKEN_TYPES.Punctuator], - ]), - }, - { - code: unIndent` - foo ? - bar : - baz ? - qux : - foobar ? - boop : - beep - `, - output: unIndent` - foo ? - bar : - baz ? - qux : - foobar ? - boop : - beep - `, - options: [4, { flatTernaryExpressions: false }], - errors: expectedErrors([ - [4, 8, 4, AST_TOKEN_TYPES.Identifier], - [5, 8, 4, AST_TOKEN_TYPES.Identifier], - [6, 12, 4, AST_TOKEN_TYPES.Identifier], - [7, 12, 4, AST_TOKEN_TYPES.Identifier], - ]), - }, - { - code: unIndent` - foo.bar('baz', function(err) { - qux; - }); - `, - output: unIndent` - foo.bar('baz', function(err) { - qux; - }); - `, - options: [2, { CallExpression: { arguments: 'first' } }], - errors: expectedErrors([2, 2, 10, AST_TOKEN_TYPES.Identifier]), - }, - { - code: unIndent` - foo.bar(function() { - cookies; - }).baz(function() { - cookies; - }); - `, - output: unIndent` - foo.bar(function() { - cookies; - }).baz(function() { - cookies; - }); - `, - options: [2, { MemberExpression: 1 }], - errors: expectedErrors([ - [4, 2, 4, AST_TOKEN_TYPES.Identifier], - [5, 0, 2, AST_TOKEN_TYPES.Punctuator], - ]), - }, - { - code: unIndent` - foo.bar().baz(function() { - cookies; - }).qux(function() { - cookies; - }); - `, - output: unIndent` - foo.bar().baz(function() { - cookies; - }).qux(function() { - cookies; - }); - `, - options: [2, { MemberExpression: 1 }], - errors: expectedErrors([ - [4, 2, 4, AST_TOKEN_TYPES.Identifier], - [5, 0, 2, AST_TOKEN_TYPES.Punctuator], - ]), - }, - { - code: unIndent` - [ foo, - bar ].forEach(function() { - baz; - }) - `, - output: unIndent` - [ foo, - bar ].forEach(function() { - baz; - }) - `, - options: [2, { ArrayExpression: 'first', MemberExpression: 1 }], - errors: expectedErrors([ - [3, 2, 4, AST_TOKEN_TYPES.Identifier], - [4, 0, 2, AST_TOKEN_TYPES.Punctuator], - ]), - }, - { - code: unIndent` - foo[ - bar - ]; - `, - output: unIndent` - foo[ - bar - ]; - `, - options: [4, { MemberExpression: 1 }], - errors: expectedErrors([3, 0, 4, AST_TOKEN_TYPES.Punctuator]), - }, - { - code: unIndent` - foo({ - bar: 1, - baz: 2 - }) - `, - output: unIndent` - foo({ - bar: 1, - baz: 2 - }) - `, - options: [4, { ObjectExpression: 'first' }], - errors: expectedErrors([ - [2, 4, 0, AST_TOKEN_TYPES.Identifier], - [3, 4, 0, AST_TOKEN_TYPES.Identifier], - ]), - }, - { - code: unIndent` - foo( - bar, baz, - qux); - `, - output: unIndent` - foo( - bar, baz, - qux); - `, - options: [2, { CallExpression: { arguments: 'first' } }], - errors: expectedErrors([ - [2, 2, 24, AST_TOKEN_TYPES.Identifier], - [3, 2, 24, AST_TOKEN_TYPES.Identifier], - ]), - }, - { - code: unIndent` - if (foo) bar() - - ; [1, 2, 3].map(baz) - `, - output: unIndent` - if (foo) bar() - - ; [1, 2, 3].map(baz) - `, - errors: expectedErrors([3, 0, 4, AST_TOKEN_TYPES.Punctuator]), - }, - { - code: unIndent` - if (foo) - ; - `, - output: unIndent` - if (foo) - ; - `, - errors: expectedErrors([2, 4, 0, AST_TOKEN_TYPES.Punctuator]), - }, - { - code: unIndent` - import {foo} - from 'bar'; - `, - output: unIndent` - import {foo} - from 'bar'; - `, - parserOptions: { sourceType: 'module' }, - errors: expectedErrors([2, 4, 0, AST_TOKEN_TYPES.Identifier]), - }, - { - code: unIndent` - export {foo} - from 'bar'; - `, - output: unIndent` - export {foo} - from 'bar'; - `, - parserOptions: { sourceType: 'module' }, - errors: expectedErrors([2, 4, 0, AST_TOKEN_TYPES.Identifier]), - }, - { - code: unIndent` - ( - a - ) => b => { - c - } - `, - output: unIndent` - ( - a - ) => b => { - c - } - `, - errors: expectedErrors([ - [4, 4, 8, AST_TOKEN_TYPES.Identifier], - [5, 0, 4, AST_TOKEN_TYPES.Punctuator], - ]), - }, - { - code: unIndent` - ( - a - ) => b => c => d => { - e - } - `, - output: unIndent` - ( - a - ) => b => c => d => { - e - } - `, - errors: expectedErrors([ - [4, 4, 8, AST_TOKEN_TYPES.Identifier], - [5, 0, 4, AST_TOKEN_TYPES.Punctuator], - ]), - }, - { - code: unIndent` - if ( - foo - ) bar( - baz - ); - `, - output: unIndent` - if ( - foo - ) bar( - baz - ); - `, - errors: expectedErrors([ - [4, 4, 8, AST_TOKEN_TYPES.Identifier], - [5, 0, 4, AST_TOKEN_TYPES.Punctuator], - ]), - }, - { - code: unIndent` - ( - foo - )( - bar - ) - `, - output: unIndent` - ( - foo - )( - bar - ) - `, - errors: expectedErrors([ - [4, 4, 8, AST_TOKEN_TYPES.Identifier], - [5, 0, 4, AST_TOKEN_TYPES.Punctuator], - ]), - }, - { - code: unIndent` - (() => - foo - )( - bar - ) - `, - output: unIndent` - (() => - foo - )( - bar - ) - `, - errors: expectedErrors([ - [4, 4, 8, AST_TOKEN_TYPES.Identifier], - [5, 0, 4, AST_TOKEN_TYPES.Punctuator], - ]), - }, - { - code: unIndent` - (() => { - foo(); - })( - bar - ) - `, - output: unIndent` - (() => { - foo(); - })( - bar - ) - `, - errors: expectedErrors([ - [4, 4, 8, AST_TOKEN_TYPES.Identifier], - [5, 0, 4, AST_TOKEN_TYPES.Punctuator], - ]), - }, - { - code: unIndent` - foo. - bar. - baz - `, - output: unIndent` - foo. - bar. - baz - `, - errors: expectedErrors([ - [2, 4, 2, AST_TOKEN_TYPES.Identifier], - [3, 4, 6, AST_TOKEN_TYPES.Identifier], - ]), - }, - { - code: unIndent` - const foo = a.b(), - longName - = (baz( - 'bar', - 'bar' - )); - `, - output: unIndent` - const foo = a.b(), - longName - = (baz( - 'bar', - 'bar' - )); - `, - errors: expectedErrors([ - [4, 8, 12, AST_TOKEN_TYPES.String], - [5, 8, 12, AST_TOKEN_TYPES.String], - [6, 4, 8, AST_TOKEN_TYPES.Punctuator], - ]), - }, - { - code: unIndent` - const foo = a.b(), - longName = - (baz( - 'bar', - 'bar' - )); - `, - output: unIndent` - const foo = a.b(), - longName = - (baz( - 'bar', - 'bar' - )); - `, - errors: expectedErrors([ - [4, 8, 12, AST_TOKEN_TYPES.String], - [5, 8, 12, AST_TOKEN_TYPES.String], - [6, 4, 8, AST_TOKEN_TYPES.Punctuator], - ]), - }, - { - code: unIndent` - const foo = a.b(), - longName - =baz( - 'bar', - 'bar' - ); - `, - output: unIndent` - const foo = a.b(), - longName - =baz( - 'bar', - 'bar' - ); - `, - errors: expectedErrors([[6, 8, 4, AST_TOKEN_TYPES.Punctuator]]), - }, - { - code: unIndent` - const foo = a.b(), - longName - =( - 'fff' - ); - `, - output: unIndent` - const foo = a.b(), - longName - =( - 'fff' - ); - `, - errors: expectedErrors([[4, 12, 8, AST_TOKEN_TYPES.String]]), - }, - - //---------------------------------------------------------------------- - // JSX tests - // Some of the following tests are adapted from the the tests in eslint-plugin-react. - // License: https://github.com/yannickcr/eslint-plugin-react/blob/7ca9841f22d599f447a27ef5b2a97def9229d6c8/LICENSE - //---------------------------------------------------------------------- - - { - code: unIndent` - - - - `, - output: unIndent` - - - - `, - errors: expectedErrors([2, 4, 2, AST_TOKEN_TYPES.Punctuator]), - }, - { - code: unIndent` - - - - `, - output: unIndent` - - - - `, - options: [2], - errors: expectedErrors([2, 2, 4, AST_TOKEN_TYPES.Punctuator]), - }, - { - code: unIndent` - - - - `, - output: unIndent` - - \t - - `, - options: ['tab'], - errors: expectedErrors([ - 2, - '1 tab', - '4 spaces', - AST_TOKEN_TYPES.Punctuator, - ]), - }, - { - code: unIndent` - function App() { - return - - ; - } - `, - output: unIndent` - function App() { - return - - ; - } - `, - options: [2], - errors: expectedErrors([4, 2, 9, AST_TOKEN_TYPES.Punctuator]), - }, - { - code: unIndent` - function App() { - return ( - - ); - } - `, - output: unIndent` - function App() { - return ( - - ); - } - `, - options: [2], - errors: expectedErrors([4, 2, 4, AST_TOKEN_TYPES.Punctuator]), - }, - { - code: unIndent` - function App() { - return ( - - - - ); - } - `, - output: unIndent` - function App() { - return ( - - - - ); - } - `, - options: [2], - errors: expectedErrors([ - [3, 4, 0, AST_TOKEN_TYPES.Punctuator], - [4, 6, 2, AST_TOKEN_TYPES.Punctuator], - [5, 4, 0, AST_TOKEN_TYPES.Punctuator], - ]), - }, - { - code: unIndent` - - {test} - - `, - output: unIndent` - - {test} - - `, - errors: expectedErrors([2, 4, 1, AST_TOKEN_TYPES.Punctuator]), - }, - { - code: unIndent` - - {options.map((option, index) => ( - - ))} - - `, - output: unIndent` - - {options.map((option, index) => ( - - ))} - - `, - errors: expectedErrors([4, 12, 11, AST_TOKEN_TYPES.Punctuator]), - }, - { - code: unIndent` - [ -
, -
- ] - `, - output: unIndent` - [ -
, -
- ] - `, - options: [2], - errors: expectedErrors([3, 2, 4, AST_TOKEN_TYPES.Punctuator]), - }, - { - code: unIndent` - - - - - - `, - output: unIndent` - - - \t - - - `, - options: ['tab'], - errors: expectedErrors([ - 3, - '1 tab', - '1 space', - AST_TOKEN_TYPES.Punctuator, - ]), - }, - { - /* - * Multiline ternary - * (colon at the end of the first expression) - */ - code: unIndent` - foo ? - : - - `, - output: unIndent` - foo ? - : - - `, - errors: expectedErrors([3, 4, 0, AST_TOKEN_TYPES.Punctuator]), - }, - { - /* - * Multiline ternary - * (colon on its own line) - */ - code: unIndent` - foo ? - - : - - `, - output: unIndent` - foo ? - - : - - `, - errors: expectedErrors([ - [3, 4, 0, AST_TOKEN_TYPES.Punctuator], - [4, 4, 0, AST_TOKEN_TYPES.Punctuator], - ]), - }, - { - /* - * Multiline ternary - * (colon at the end of the first expression, parenthesized first expression) - */ - code: unIndent` - foo ? ( - - ) : - - `, - output: unIndent` - foo ? ( - - ) : - - `, - errors: expectedErrors([4, 4, 0, AST_TOKEN_TYPES.Punctuator]), - }, - { - code: unIndent` - - `, - output: unIndent` - - `, - errors: expectedErrors([2, 4, 2, AST_TOKEN_TYPES.JSXIdentifier]), - }, - { - code: unIndent` - - `, - output: unIndent` - - `, - options: [2], - errors: expectedErrors([3, 0, 2, AST_TOKEN_TYPES.Punctuator]), - }, - { - code: unIndent` - - `, - output: unIndent` - - `, - options: [2], - errors: expectedErrors([3, 0, 2, AST_TOKEN_TYPES.Punctuator]), - }, - { - code: unIndent` - const Button = function(props) { - return ( - - ); - }; - `, - output: unIndent` - const Button = function(props) { - return ( - - ); - }; - `, - options: [2], - errors: expectedErrors([6, 4, 36, AST_TOKEN_TYPES.Punctuator]), - }, - { - code: unIndent` - var x = function() { - return - } - `, - output: unIndent` - var x = function() { - return - } - `, - options: [2], - errors: expectedErrors([4, 2, 9, AST_TOKEN_TYPES.Punctuator]), - }, - { - code: unIndent` - var x = - `, - output: unIndent` - var x = - `, - options: [2], - errors: expectedErrors([3, 0, 8, AST_TOKEN_TYPES.Punctuator]), - }, - { - code: unIndent` - var x = ( - - ) - `, - output: unIndent` - var x = ( - - ) - `, - options: [2], - errors: expectedErrors([3, 2, 4, AST_TOKEN_TYPES.Punctuator]), - }, - { - code: unIndent` - - `, - output: unIndent` - - `, - options: ['tab'], - errors: expectedErrors('tab', [3, 0, 1, AST_TOKEN_TYPES.Punctuator]), - }, - { - code: unIndent` - - `, - output: unIndent` - - `, - options: ['tab'], - errors: expectedErrors('tab', [3, 0, 1, AST_TOKEN_TYPES.Punctuator]), - }, - { - code: unIndent` - < - foo - .bar - .baz - > - foo - - `, - output: unIndent` - < - foo - .bar - .baz - > - foo - - `, - errors: expectedErrors([ - [3, 8, 4, AST_TOKEN_TYPES.Punctuator], - [4, 8, 4, AST_TOKEN_TYPES.Punctuator], - [9, 8, 4, AST_TOKEN_TYPES.JSXIdentifier], - [10, 8, 4, AST_TOKEN_TYPES.JSXIdentifier], - ]), - }, - { - code: unIndent` - < - input - type= - "number" - /> - `, - output: unIndent` - < - input - type= - "number" - /> - `, - errors: expectedErrors([4, 8, 4, AST_TOKEN_TYPES.JSXText]), - }, - { - code: unIndent` - < - input - type= - {'number'} - /> - `, - output: unIndent` - < - input - type= - {'number'} - /> - `, - errors: expectedErrors([4, 8, 4, AST_TOKEN_TYPES.Punctuator]), - }, - { - code: unIndent` - < - input - type - ="number" - /> - `, - output: unIndent` - < - input - type - ="number" - /> - `, - errors: expectedErrors([4, 8, 4, AST_TOKEN_TYPES.Punctuator]), - }, - { - code: unIndent` - foo ? ( - bar - ) : ( - baz - ) - `, - output: unIndent` - foo ? ( - bar - ) : ( - baz - ) - `, - errors: expectedErrors([ - [4, 4, 8, AST_TOKEN_TYPES.Identifier], - [5, 0, 4, AST_TOKEN_TYPES.Punctuator], - ]), - }, - { - code: unIndent` - foo ? ( -
-
- ) : ( - - - ) - `, - output: unIndent` - foo ? ( -
-
- ) : ( - - - ) - `, - errors: expectedErrors([ - [5, 4, 8, AST_TOKEN_TYPES.Punctuator], - [6, 4, 8, AST_TOKEN_TYPES.Punctuator], - [7, 0, 4, AST_TOKEN_TYPES.Punctuator], - ]), - }, - { - code: unIndent` -
- { - ( - 1 - ) - } -
- `, - output: unIndent` -
- { - ( - 1 - ) - } -
- `, - errors: expectedErrors([ - [3, 8, 4, AST_TOKEN_TYPES.Punctuator], - [4, 12, 8, AST_TOKEN_TYPES.Numeric], - [5, 8, 4, AST_TOKEN_TYPES.Punctuator], - ]), - }, - { - code: unIndent` -
- { - /* foo */ - } -
- `, - output: unIndent` -
- { - /* foo */ - } -
- `, - errors: expectedErrors([3, 8, 6, AST_TOKEN_TYPES.Block]), - }, - { - code: unIndent` -
foo -
bar
-
- `, - output: unIndent` -
foo -
bar
-
- `, - errors: expectedErrors([2, 4, 0, AST_TOKEN_TYPES.Punctuator]), - }, - { - code: unIndent` - Foo bar  - baz qux. - - `, - output: unIndent` - Foo bar  - baz qux. - - `, - errors: expectedErrors([2, 4, 0, AST_TOKEN_TYPES.Punctuator]), - }, - { - code: unIndent` - ({ - foo - }: bar) => baz - `, - output: unIndent` - ({ - foo - }: bar) => baz - `, - errors: expectedErrors([3, 0, 4, AST_TOKEN_TYPES.Punctuator]), - }, - { - code: unIndent` - ([ - foo - ]: bar) => baz - `, - output: unIndent` - ([ - foo - ]: bar) => baz - `, - errors: expectedErrors([3, 0, 4, AST_TOKEN_TYPES.Punctuator]), - }, - { - code: unIndent` - ({ - foo - }: {}) => baz - `, - output: unIndent` - ({ - foo - }: {}) => baz - `, - errors: expectedErrors([3, 0, 4, AST_TOKEN_TYPES.Punctuator]), - }, - { - code: unIndent` - class Foo { - foo() { - bar(); - } - } - `, - output: unIndent` - class Foo { - foo() { - bar(); - } - } - `, - options: [4, { ignoredNodes: [AST_NODE_TYPES.ClassBody] }], - errors: expectedErrors([3, 4, 0, AST_TOKEN_TYPES.Identifier]), - }, - { - code: unIndent` - $(function() { - - foo(); - bar(); - - foo(function() { - baz(); - }); - - }); - `, - output: unIndent` - $(function() { - - foo(); - bar(); - - foo(function() { - baz(); - }); - - }); - `, - options: [ - 4, - { - ignoredNodes: [ - "ExpressionStatement > CallExpression[callee.name='$'] > FunctionExpression > BlockStatement", - ], - }, - ], - errors: expectedErrors([7, 4, 0, AST_TOKEN_TYPES.Identifier]), - }, - { - code: unIndent` - (function($) { - $(function() { - foo; - }); - })() - `, - output: unIndent` - (function($) { - $(function() { - foo; - }); - })() - `, - options: [ - 4, - { - ignoredNodes: [ - 'ExpressionStatement > CallExpression > FunctionExpression.callee > BlockStatement', - ], - }, - ], - errors: expectedErrors([3, 4, 0, AST_TOKEN_TYPES.Identifier]), - }, - { - code: unIndent` - if (foo) { - doSomething(); - - // Intentionally unindented comment - doSomethingElse(); - } - `, - output: unIndent` - if (foo) { - doSomething(); - - // Intentionally unindented comment - doSomethingElse(); - } - `, - options: [4, { ignoreComments: false }], - errors: expectedErrors([4, 4, 0, AST_TOKEN_TYPES.Line]), - }, - { - code: unIndent` - if (foo) { - doSomething(); - - /* Intentionally unindented comment */ - doSomethingElse(); - } - `, - output: unIndent` - if (foo) { - doSomething(); - - /* Intentionally unindented comment */ - doSomethingElse(); - } - `, - options: [4, { ignoreComments: false }], - errors: expectedErrors([4, 4, 0, AST_TOKEN_TYPES.Block]), - }, - { - code: unIndent` - const obj = { - foo () { - return condition ? // comment - 1 : - 2 - } - } - `, - output: unIndent` - const obj = { - foo () { - return condition ? // comment - 1 : - 2 - } - } - `, - errors: expectedErrors([4, 12, 8, AST_TOKEN_TYPES.Numeric]), - }, - - //---------------------------------------------------------------------- - // Comment alignment tests - //---------------------------------------------------------------------- - { - code: unIndent` - if (foo) { - - // Comment cannot align with code immediately above if there is a whitespace gap - doSomething(); - } - `, - output: unIndent` - if (foo) { - - // Comment cannot align with code immediately above if there is a whitespace gap - doSomething(); - } - `, - errors: expectedErrors([3, 4, 0, AST_TOKEN_TYPES.Line]), - }, - { - code: unIndent` - if (foo) { - foo( - bar); - // Comment cannot align with code immediately below if there is a whitespace gap - - } - `, - output: unIndent` - if (foo) { - foo( - bar); - // Comment cannot align with code immediately below if there is a whitespace gap - - } - `, - errors: expectedErrors([4, 4, 0, AST_TOKEN_TYPES.Line]), - }, - { - code: unIndent` - [{ - foo - }, - - // Comment between nodes - - { - bar - }]; - `, - output: unIndent` - [{ - foo - }, - - // Comment between nodes - - { - bar - }]; - `, - errors: expectedErrors([5, 0, 4, AST_TOKEN_TYPES.Line]), - }, - ], -}); diff --git a/packages/eslint-plugin/tests/rules/indent/indent.test.ts b/packages/eslint-plugin/tests/rules/indent/indent.test.ts index 32b1f91fae0..f9191d3ef10 100644 --- a/packages/eslint-plugin/tests/rules/indent/indent.test.ts +++ b/packages/eslint-plugin/tests/rules/indent/indent.test.ts @@ -3,13 +3,15 @@ /* eslint "@typescript-eslint/internal/plugin-test-formatting": ["error", { formatWithPrettier: false }] */ /* eslint-enable eslint-comments/no-use */ -import { AST_NODE_TYPES, TSESLint } from '@typescript-eslint/utils'; -import { RuleTester } from '../../RuleTester'; +import type { TSESLint } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; + import rule from '../../../src/rules/indent'; -import { +import type { InferMessageIdsTypeFromRule, InferOptionsTypeFromRule, } from '../../../src/util'; +import { RuleTester } from '../../RuleTester'; type MessageIds = InferMessageIdsTypeFromRule; type Options = InferOptionsTypeFromRule; @@ -636,7 +638,7 @@ type Foo = string | { }) .filter( (error): error is TSESLint.TestCaseError => - error !== null, + error != null, ), }; if (invalid.errors.length > 0) { diff --git a/packages/eslint-plugin/tests/rules/indent/utils.ts b/packages/eslint-plugin/tests/rules/indent/utils.ts index 628389a451e..70d5f7a93b8 100644 --- a/packages/eslint-plugin/tests/rules/indent/utils.ts +++ b/packages/eslint-plugin/tests/rules/indent/utils.ts @@ -1,13 +1,14 @@ // The following code is adapted from the the code in eslint. // License: https://github.com/eslint/eslint/blob/48700fc8408f394887cdedd071b22b757700fdcb/LICENSE -import { +import type { AST_NODE_TYPES, AST_TOKEN_TYPES, TSESLint, } from '@typescript-eslint/utils'; -import rule from '../../../src/rules/indent'; -import { InferMessageIdsTypeFromRule } from '../../../src/util'; + +import type rule from '../../../src/rules/indent'; +import type { InferMessageIdsTypeFromRule } from '../../../src/util'; type MessageIds = InferMessageIdsTypeFromRule; diff --git a/packages/eslint-plugin/tests/rules/init-declarations.test.ts b/packages/eslint-plugin/tests/rules/init-declarations.test.ts index 29e9025f734..953a7a6aced 100644 --- a/packages/eslint-plugin/tests/rules/init-declarations.test.ts +++ b/packages/eslint-plugin/tests/rules/init-declarations.test.ts @@ -1,4 +1,5 @@ import { AST_NODE_TYPES } from '@typescript-eslint/utils'; + import rule from '../../src/rules/init-declarations'; import { RuleTester } from '../RuleTester'; diff --git a/packages/eslint-plugin/tests/rules/key-spacing.test.ts b/packages/eslint-plugin/tests/rules/key-spacing.test.ts new file mode 100644 index 00000000000..40206258671 --- /dev/null +++ b/packages/eslint-plugin/tests/rules/key-spacing.test.ts @@ -0,0 +1,1278 @@ +/* eslint-disable eslint-comments/no-use */ +// this rule tests the new lines, which prettier will want to fix and break the tests +/* eslint "@typescript-eslint/internal/plugin-test-formatting": ["error", { formatWithPrettier: false }] */ +/* eslint-enable eslint-comments/no-use */ +import rule from '../../src/rules/key-spacing'; +import { RuleTester } from '../RuleTester'; + +const ruleTester = new RuleTester({ + parser: '@typescript-eslint/parser', +}); + +ruleTester.run('key-spacing', rule, { + valid: [ + // align: value + { + code: ` +interface X { + a: number; + abc: string +}; + `, + options: [{ align: 'value' }], + }, + { + code: ` +interface X { + "a:b": number; + abcde: string +}; + `, + options: [{ align: 'value' }], + }, + { + code: ` +let x: { + a: number; + abc: string +}; + `, + options: [{ align: 'value' }], + }, + { + code: ` +let x: { + a: number; + "𐌘": string; + [𐌘]: Date; + "🌷": "bar", // 2 code points + "🎁": "baz", // 2 code points + "🇮🇳": "qux", // 4 code points + "🏳️‍🌈": "xyz", // 6 code points +}; + `, + options: [{ align: 'value' }], + }, + { + code: ` +interface X { + a: number; + abc: string; c: number; +}; + `, + options: [{ align: 'value' }], + }, + { + code: ` +interface X { + a: number; + abc: string; c: number; de: boolean; + abcef: number; +}; + `, + options: [{ align: 'colon' }], + }, + { + code: ` +interface X { + a : number; + abc; + abcef: number; +}; + `, + options: [{ align: 'colon' }], + }, + { + code: ` +interface X { + a?: number; + abc: string +}; + `, + options: [{ align: 'value' }], + }, + { + code: ` +interface X { + a: number; + // Some comment + abc: string +}; + `, + options: [{ align: 'value' }], + }, + { + code: ` +interface X { + a: number; + // Some comment + // on multiple lines + abc: string +}; + `, + options: [{ align: 'value' }], + }, + { + code: ` +interface X { + a: number; + /** + * Some comment + * on multiple lines + */ + abc: string +}; + `, + options: [{ align: 'value' }], + }, + { + code: ` +interface X { + a: number; + /** + * Doc comment + */ + abc: string +}; + `, + options: [{ align: 'value' }], + }, + { + code: ` +interface X { + a: number; + + abc: string +}; + `, + options: [{ align: 'value' }], + }, + { + code: ` +class X { + a: number; + abc: string +}; + `, + options: [{ align: 'value' }], + }, + { + code: ` +class X { + a?: number; + abc: string +}; + `, + options: [{ align: 'value' }], + }, + { + code: ` +class X { + x: number; + z = 1; + xbcef: number; + } + `, + options: [{ align: 'value' }], + }, + { + code: ` +class X { + a: number; + + abc: string +}; + `, + options: [{ align: 'value' }], + }, + { + code: ` +type X = { + a: number; + abc: string +}; + `, + options: [{ align: 'value' }], + }, + { + code: ` +type X = { + a: number; + + abc: string +}; + `, + options: [{ align: 'value' }], + }, + { + code: ` +type X = { + a : number; + abc: string +}; + `, + options: [{ align: 'value', mode: 'minimum' }], + }, + { + code: ` +type X = { + a : number; + abc: string +}; + `, + options: [ + { + align: { + on: 'value', + mode: 'minimum', + beforeColon: false, + afterColon: true, + }, + }, + ], + }, + { + code: ` +interface X { + a: number; + prop: { + abc: number; + a: number; + }; + abc: string +} + `, + options: [{ align: 'value' }], + }, + { + code: ` +class X { + a: number; + prop: { + abc: number; + a: number; + }; + abc: string + x = 1; + d: number; + z: number = 1; + ef: string; +} + `, + options: [{ align: 'value' }], + }, + // align: colon + { + code: ` +interface X { + a : number; + abc: string +}; + `, + options: [{ align: 'colon' }], + }, + { + code: ` +interface X { + a :number; + abc:string +}; + `, + options: [{ align: 'colon', afterColon: false }], + }, + { + code: ` +interface X { + a : number; + abc: string +}; + `, + options: [{ align: 'colon', mode: 'minimum' }], + }, + // no align + { + code: ` +interface X { + a: number; + abc: string +}; + `, + options: [{}], + }, + { + code: ` +interface X { + a : number; + abc : string +}; + `, + options: [{ beforeColon: true }], + }, + // singleLine / multiLine + { + code: ` +interface X { + a : number; + abc : string +}; + `, + options: [ + { + singleLine: { beforeColon: false, afterColon: false }, + multiLine: { beforeColon: true, afterColon: true }, + }, + ], + }, + { + code: ` +interface X { + a : number; + abc : string +}; + `, + options: [ + { + align: { on: 'value', beforeColon: true, afterColon: true }, + singleLine: { beforeColon: false, afterColon: false }, + multiLine: { beforeColon: false, afterColon: false }, + }, + ], + }, + { + code: ` +interface X { + a : number; + abc : string +}; + `, + options: [ + { + align: { beforeColon: true, afterColon: true }, // defaults to 'colon' + singleLine: { beforeColon: false, afterColon: false }, + multiLine: { beforeColon: false, afterColon: false }, + }, + ], + }, + { + code: ` +interface X { + a : number; + abc : string +}; + `, + options: [ + { + singleLine: { beforeColon: false, afterColon: false }, + multiLine: { beforeColon: true, afterColon: true, align: 'value' }, + }, + ], + }, + { + code: ` +interface X { + a : number; + abc : string +}; + `, + options: [ + { + singleLine: { beforeColon: false, afterColon: false }, + multiLine: { + beforeColon: true, + afterColon: true, + align: { + on: 'colon', + mode: 'strict', + afterColon: true, + beforeColon: true, + }, + }, + }, + ], + }, + { + code: ` +interface X { + a : number; + abc : string +}; + `, + options: [ + { + singleLine: { beforeColon: false, afterColon: false }, + multiLine: { + beforeColon: true, + afterColon: true, + align: { + mode: 'strict', + afterColon: true, + beforeColon: true, + }, + }, + }, + ], + }, + { + code: ` +interface X { + a : number; + abc : string +}; + `, + options: [ + { + beforeColon: true, + afterColon: true, + align: { + on: 'colon', + mode: 'strict', + afterColon: true, + beforeColon: true, + }, + }, + ], + }, + { + code: ` +interface X { + a : number; + abc : string +}; + `, + options: [ + { + beforeColon: true, + afterColon: true, + align: { + mode: 'strict', + afterColon: true, + beforeColon: true, + }, + }, + ], + }, + { + code: ` +interface X { + a : number; + abc: string + + xadzd : number; +}; + `, + options: [ + { + singleLine: { beforeColon: false, afterColon: false }, + multiLine: { + beforeColon: true, + afterColon: true, + align: { + on: 'colon', + mode: 'strict', + afterColon: true, + beforeColon: false, + }, + }, + }, + ], + }, + { + code: ` +interface X { + a : number; + abc: string + + xadzd : number; +}; + `, + options: [ + { + singleLine: { beforeColon: false, afterColon: false }, + multiLine: { + beforeColon: true, + afterColon: true, + mode: 'strict', + align: { + on: 'colon', + afterColon: true, + beforeColon: false, + }, + }, + }, + ], + }, + { + code: ` +interface X { + a : number; + abc: string + + xadzd : number; +}; + `, + options: [ + { + singleLine: { beforeColon: false, afterColon: false }, + multiLine: { + beforeColon: true, + afterColon: true, + mode: 'minimum', + align: { + on: 'colon', + afterColon: true, + beforeColon: false, + }, + }, + }, + ], + }, + { + code: ` +interface X { a:number; abc:string; }; + `, + options: [ + { + singleLine: { beforeColon: false, afterColon: false }, + multiLine: { beforeColon: true, afterColon: true }, + }, + ], + }, + ], + invalid: [ + // align: value + { + code: ` +interface X { + a: number; + abc: string +}; + `, + output: ` +interface X { + a: number; + abc: string +}; + `, + options: [{ align: 'value' }], + errors: [{ messageId: 'missingValue' }], + }, + { + code: ` +interface X { + a: number; + "a:c": string +}; + `, + output: ` +interface X { + a: number; + "a:c": string +}; + `, + options: [{ align: 'value' }], + errors: [{ messageId: 'missingValue' }], + }, + { + code: ` +let x: { + a: number; + abc: string +}; + `, + output: ` +let x: { + a: number; + abc: string +}; + `, + options: [{ align: 'value' }], + errors: [{ messageId: 'missingValue' }], + }, + { + code: ` +let x: { + a: number; + abc: string +}; + `, + output: ` +let x: { + a: number; + abc: string +}; + `, + options: [{ align: { on: 'value' } }], + errors: [{ messageId: 'missingValue' }], + }, + { + code: ` +let x: { + a: number; + "🌷": "bar", // 2 code points + "🎁": "baz", // 2 code points + "🇮🇳": "qux", // 4 code points + "🏳️‍🌈": "xyz", // 6 code points + [𐌘]: string + "𐌘": string +}; + `, + output: ` +let x: { + a: number; + "🌷": "bar", // 2 code points + "🎁": "baz", // 2 code points + "🇮🇳": "qux", // 4 code points + "🏳️‍🌈": "xyz", // 6 code points + [𐌘]: string + "𐌘": string +}; + `, + options: [{ align: 'value' }], + errors: [{ messageId: 'missingValue' }], + }, + { + code: ` +class X { + a: number; + abc: string +}; + `, + output: ` +class X { + a: number; + abc: string +}; + `, + options: [{ align: 'value' }], + errors: [{ messageId: 'missingValue' }], + }, + { + code: ` +class X { + a: number; + abc: string +}; + `, + output: ` +class X { + a: number; + abc: string +}; + `, + options: [{ align: 'value', mode: 'minimum' }], + errors: [{ messageId: 'missingValue' }], + }, + { + code: ` +class X { + a: number; + b; + abc: string +}; + `, + output: ` +class X { + a: number; + b; + abc: string +}; + `, + options: [{ align: 'value', mode: 'minimum' }], + errors: [{ messageId: 'missingValue' }], + }, + { + code: ` +type X = { + a: number; + abc: string +}; + `, + output: ` +type X = { + a: number; + abc: string +}; + `, + options: [{ align: 'value' }], + errors: [{ messageId: 'missingValue' }], + }, + { + code: ` +interface X { + a: number; + abc: string +}; + `, + output: ` +interface X { + a: number; + abc: string +}; + `, + options: [{ align: 'value' }], + errors: [{ messageId: 'extraValue' }], + }, + { + code: ` +class X { + a: number; + abc: string +}; + `, + output: ` +class X { + a: number; + abc: string +}; + `, + options: [{ align: 'value' }], + errors: [{ messageId: 'extraValue' }], + }, + { + code: ` +class X { + x: number; + z = 1; + xbcef: number; + } + `, + output: ` +class X { + x: number; + z = 1; + xbcef: number; + } + `, + options: [{ align: 'value' }], + errors: [{ messageId: 'missingValue' }], + }, + { + code: ` +interface X { + a: number; + + abc : string +}; + `, + output: ` +interface X { + a: number; + + abc: string +}; + `, + options: [{ align: 'value' }], + errors: [{ messageId: 'extraValue' }, { messageId: 'extraKey' }], + }, + { + code: ` +class X { + a: number; + + abc : string +}; + `, + output: ` +class X { + a: number; + + abc: string +}; + `, + options: [{ align: 'value' }], + errors: [{ messageId: 'extraValue' }, { messageId: 'extraKey' }], + }, + { + code: ` +interface X { + a: number; + // Some comment + + // interrupted in the middle + abc: string +}; + `, + output: ` +interface X { + a: number; + // Some comment + + // interrupted in the middle + abc: string +}; + `, + options: [{ align: 'value' }], + errors: [{ messageId: 'extraValue' }], + }, + { + code: ` +interface X { + a: number; + /** + * Multiline comment + */ + + /** interrupted in the middle */ + abc: string +}; + `, + output: ` +interface X { + a: number; + /** + * Multiline comment + */ + + /** interrupted in the middle */ + abc: string +}; + `, + options: [{ align: 'value' }], + errors: [{ messageId: 'extraValue' }], + }, + { + code: ` +interface X { + a: number; + prop: { + abc: number; + a: number; + }, + abc: string +} + `, + output: ` +interface X { + a: number; + prop: { + abc: number; + a: number; + }, + abc: string +} + `, + options: [{ align: 'value' }], + errors: [{ messageId: 'missingValue' }], + }, + { + code: ` +interface X { + a: number; + prop: { + abc: number; + a: number; + }, + abc: string +} + `, + output: ` +interface X { + a: number; + prop: { + abc: number; + a: number; + }, + abc: string +} + `, + options: [{ align: 'value' }], + errors: [{ messageId: 'missingValue' }], + }, + { + code: ` +interface X { + a: number; + prop: { + abc: number; + a: number; + }, + abc: string +} + `, + output: ` +interface X { + a: number; + prop: { + abc: number; + a: number; + }, + abc: string +} + `, + options: [{ align: 'value' }], + errors: [{ messageId: 'extraValue' }], + }, + { + code: ` +class X { + a: number; + prop: { + abc: number; + a?: number; + }; + abc: string; + x = 1; + d: number; + z: number = 1; + ef: string; +} + `, + output: ` +class X { + a: number; + prop: { + abc: number; + a?: number; + }; + abc: string; + x = 1; + d: number; + z: number = 1; + ef: string; +} + `, + options: [{ align: 'value' }], + errors: [ + { messageId: 'extraValue' }, + { messageId: 'missingValue' }, + { messageId: 'missingValue' }, + { messageId: 'missingValue' }, + { messageId: 'missingValue' }, + ], + }, + // align: colon + { + code: ` +interface X { + a : number; + abc: string +}; + `, + output: ` +interface X { + a : number; + abc: string +}; + `, + options: [{ align: 'colon' }], + errors: [{ messageId: 'extraKey' }], + }, + { + code: ` +interface X { + a : number; + abc: string +}; + `, + output: ` +interface X { + a : number; + abc: string +}; + `, + options: [{ align: { on: 'colon' } }], + errors: [{ messageId: 'extraKey' }], + }, + { + code: ` +interface X { + a : number; + abc: string +}; + `, + output: ` +interface X { + a : number; + abc : string +}; + `, + options: [{ align: 'colon', beforeColon: true, afterColon: true }], + errors: [{ messageId: 'missingKey' }], + }, + // no align + { + code: ` +interface X { + [x: number]: string; +} + `, + output: ` +interface X { + [x: number]: string; +} + `, + errors: [{ messageId: 'extraValue' }], + }, + { + code: ` +interface X { + [x: number]:string; +} + `, + output: ` +interface X { + [x: number]: string; +} + `, + errors: [{ messageId: 'missingValue' }], + }, + // singleLine / multiLine + { + code: ` +interface X { + a:number; + abc:string +}; + `, + output: ` +interface X { + a : number; + abc : string +}; + `, + options: [ + { + singleLine: { beforeColon: false, afterColon: false }, + multiLine: { beforeColon: true, afterColon: true }, + }, + ], + errors: [ + { messageId: 'missingKey' }, + { messageId: 'missingValue' }, + { messageId: 'missingKey' }, + { messageId: 'missingValue' }, + ], + }, + { + code: ` +interface X { a : number; abc : string; }; + `, + output: ` +interface X { a:number; abc:string; }; + `, + options: [ + { + singleLine: { beforeColon: false, afterColon: false }, + multiLine: { beforeColon: true, afterColon: true }, + }, + ], + errors: [ + { messageId: 'extraKey' }, + { messageId: 'extraValue' }, + { messageId: 'extraKey' }, + { messageId: 'extraValue' }, + ], + }, + { + code: ` +interface X { a : number; abc : string; }; + `, + output: ` +interface X { a: number; abc: string; }; + `, + options: [ + { + singleLine: { beforeColon: false, afterColon: true }, + multiLine: { beforeColon: true, afterColon: true }, + }, + ], + errors: [{ messageId: 'extraKey' }, { messageId: 'extraKey' }], + }, + { + code: ` +interface X { a:number; abc:string; }; + `, + output: ` +interface X { a : number; abc : string; }; + `, + options: [ + { + singleLine: { beforeColon: true, afterColon: true, mode: 'strict' }, + multiLine: { beforeColon: true, afterColon: true }, + }, + ], + errors: [ + { messageId: 'missingKey' }, + { messageId: 'missingValue' }, + { messageId: 'missingKey' }, + { messageId: 'missingValue' }, + ], + }, + { + code: ` +interface X { a:number; abc: string; }; + `, + output: ` +interface X { a : number; abc : string; }; + `, + options: [ + { + singleLine: { beforeColon: true, afterColon: true, mode: 'minimum' }, + multiLine: { beforeColon: true, afterColon: true }, + }, + ], + errors: [ + { messageId: 'missingKey' }, + { messageId: 'missingValue' }, + { messageId: 'missingKey' }, + ], + }, + { + code: ` +interface X { a : number; abc : string; }; + `, + output: ` +interface X { a:number; abc:string; }; + `, + options: [ + { + beforeColon: false, + afterColon: false, + }, + ], + errors: [ + { messageId: 'extraKey' }, + { messageId: 'extraValue' }, + { messageId: 'extraKey' }, + { messageId: 'extraValue' }, + ], + }, + { + code: ` +interface X { a:number; abc:string; }; + `, + output: ` +interface X { a : number; abc : string; }; + `, + options: [ + { + beforeColon: true, + afterColon: true, + mode: 'strict', + }, + ], + errors: [ + { messageId: 'missingKey' }, + { messageId: 'missingValue' }, + { messageId: 'missingKey' }, + { messageId: 'missingValue' }, + ], + }, + { + code: ` +type Wacky = { + a: number; + b: string; + agc: number; + middle: Date | { + inner: { + a: boolean; + bc: boolean; + "🌷": "rose"; + } + [x: number]: string; + abc: boolean; + } +} & { + a: "string"; + abc: number; +} + `, + output: ` +type Wacky = { + a: number; + b: string; + agc: number; + middle: Date | { + inner: { + a: boolean; + bc: boolean; + "🌷": "rose"; + } + [x: number]: string; + abc: boolean; + } +} & { + a: "string"; + abc: number; +} + `, + options: [{ align: 'value' }], + errors: [ + { messageId: 'missingValue' }, + { messageId: 'missingValue' }, + { messageId: 'missingValue' }, + { messageId: 'missingValue' }, + { messageId: 'missingValue' }, + { messageId: 'missingValue' }, + { messageId: 'missingValue' }, + ], + }, + { + code: ` +class Wacky { + a: number; + b?: string; + public z: number; + abc = 10; + private override xy: number; + static x = "test"; + static abcdef: number = 1; + get fn(): number { return 0; }; + inter: number; + get fn2(): number { + return 1; + }; + agc: number; + middle: Date | { + inner: { + a: boolean; + bc: boolean; + "🌷": "rose"; + } + [x: number]: string; + abc: boolean; + } +} + `, + output: ` +class Wacky { + a: number; + b?: string; + public z: number; + abc = 10; + private override xy: number; + static x = "test"; + static abcdef: number = 1; + get fn(): number { return 0; }; + inter: number; + get fn2(): number { + return 1; + }; + agc: number; + middle: Date | { + inner: { + a: boolean; + bc: boolean; + "🌷": "rose"; + } + [x: number]: string; + abc: boolean; + } +} + `, + options: [{ align: 'value' }], + errors: [ + { messageId: 'missingValue' }, + { messageId: 'missingValue' }, + { messageId: 'missingValue' }, + { messageId: 'missingValue' }, + { messageId: 'missingValue' }, + { messageId: 'missingValue' }, + { messageId: 'missingValue' }, + { messageId: 'missingValue' }, + { messageId: 'missingValue' }, + ], + }, + ], +}); diff --git a/packages/eslint-plugin/tests/rules/keyword-spacing.test.ts b/packages/eslint-plugin/tests/rules/keyword-spacing.test.ts index a2a92ad42ae..58c740fbd5c 100644 --- a/packages/eslint-plugin/tests/rules/keyword-spacing.test.ts +++ b/packages/eslint-plugin/tests/rules/keyword-spacing.test.ts @@ -2,8 +2,10 @@ // this rule tests the spacing, which prettier will want to fix and break the tests /* eslint "@typescript-eslint/internal/plugin-test-formatting": ["error", { formatWithPrettier: false }] */ /* eslint-enable eslint-comments/no-use */ -import { TSESLint } from '@typescript-eslint/utils'; -import rule, { MessageIds, Options } from '../../src/rules/keyword-spacing'; +import type { TSESLint } from '@typescript-eslint/utils'; + +import type { MessageIds, Options } from '../../src/rules/keyword-spacing'; +import rule from '../../src/rules/keyword-spacing'; import { RuleTester } from '../RuleTester'; //------------------------------------------------------------------------------ @@ -112,6 +114,126 @@ ruleTester.run('keyword-spacing', rule, { options: [{ overrides: { as: {} } }], parserOptions: { ecmaVersion: 6, sourceType: 'module' }, }, + { + code: 'import type { foo } from "foo";', + options: [BOTH], + parserOptions: { ecmaVersion: 6, sourceType: 'module' }, + }, + { + code: "import type * as Foo from 'foo'", + options: [BOTH], + parserOptions: { ecmaVersion: 6, sourceType: 'module' }, + }, + { + code: 'import type { SavedQueries } from "./SavedQueries.js";', + options: [ + { + before: true, + after: false, + overrides: { + else: { after: true }, + return: { after: true }, + try: { after: true }, + catch: { after: false }, + case: { after: true }, + const: { after: true }, + throw: { after: true }, + let: { after: true }, + do: { after: true }, + of: { after: true }, + as: { after: true }, + finally: { after: true }, + from: { after: true }, + import: { after: true }, + export: { after: true }, + default: { after: true }, + // The new option: + type: { after: true }, + }, + }, + ], + parserOptions: { ecmaVersion: 6, sourceType: 'module' }, + }, + { + // Space after import is not configurable from option since it's invalid syntax with import type + code: 'import type { SavedQueries } from "./SavedQueries.js";', + options: [ + { + before: true, + after: true, + overrides: { + import: { after: false }, + }, + }, + ], + parserOptions: { ecmaVersion: 6, sourceType: 'module' }, + }, + { + code: "import type{SavedQueries} from './SavedQueries.js';", + options: [ + { + before: true, + after: false, + overrides: { + from: { after: true }, + }, + }, + ], + parserOptions: { ecmaVersion: 6, sourceType: 'module' }, + }, + { + code: "import type{SavedQueries} from'./SavedQueries.js';", + options: [ + { + before: true, + after: false, + }, + ], + parserOptions: { ecmaVersion: 6, sourceType: 'module' }, + }, + { + code: "import type http from 'node:http';", + options: [ + { + before: true, + after: false, + overrides: { + from: { after: true }, + }, + }, + ], + parserOptions: { ecmaVersion: 6, sourceType: 'module' }, + }, + { + code: "import type http from'node:http';", + options: [ + { + before: true, + after: false, + }, + ], + parserOptions: { ecmaVersion: 6, sourceType: 'module' }, + }, + { + code: 'import type {} from "foo";', + options: [BOTH], + parserOptions: { ecmaVersion: 6, sourceType: 'module' }, + }, + { + code: 'import type { foo1, foo2 } from "foo";', + options: [BOTH], + parserOptions: { ecmaVersion: 6, sourceType: 'module' }, + }, + { + code: 'import type { foo1 as _foo1, foo2 as _foo2 } from "foo";', + options: [BOTH], + parserOptions: { ecmaVersion: 6, sourceType: 'module' }, + }, + { + code: 'import type { foo as bar } from "foo";', + options: [BOTH], + parserOptions: { ecmaVersion: 6, sourceType: 'module' }, + }, ], invalid: [ //---------------------------------------------------------------------- @@ -150,5 +272,63 @@ ruleTester.run('keyword-spacing', rule, { parserOptions: { ecmaVersion: 6, sourceType: 'module' }, errors: expectedAfter('as'), }, + { + code: 'import type{ foo } from "foo";', + output: 'import type { foo } from "foo";', + options: [{ after: true, before: true }], + parserOptions: { ecmaVersion: 6, sourceType: 'module' }, + errors: expectedAfter('type'), + }, + { + code: 'import type { foo } from"foo";', + output: 'import type{ foo } from"foo";', + options: [{ after: false, before: true }], + parserOptions: { ecmaVersion: 6, sourceType: 'module' }, + errors: unexpectedAfter('type'), + }, + { + code: 'import type* as foo from "foo";', + output: 'import type * as foo from "foo";', + options: [{ after: true, before: true }], + parserOptions: { ecmaVersion: 6, sourceType: 'module' }, + errors: expectedAfter('type'), + }, + { + code: 'import type * as foo from"foo";', + output: 'import type* as foo from"foo";', + options: [{ after: false, before: true }], + parserOptions: { ecmaVersion: 6, sourceType: 'module' }, + errors: unexpectedAfter('type'), + }, + { + code: "import type {SavedQueries} from './SavedQueries.js';", + output: "import type{SavedQueries} from './SavedQueries.js';", + options: [ + { + before: true, + after: false, + overrides: { + from: { after: true }, + }, + }, + ], + parserOptions: { ecmaVersion: 6, sourceType: 'module' }, + errors: unexpectedAfter('type'), + }, + { + code: "import type {SavedQueries} from './SavedQueries.js';", + output: "import type{SavedQueries} from'./SavedQueries.js';", + options: [ + { + before: true, + after: false, + }, + ], + parserOptions: { ecmaVersion: 6, sourceType: 'module' }, + errors: [ + { messageId: 'unexpectedAfter', data: { value: 'type' } }, + { messageId: 'unexpectedAfter', data: { value: 'from' } }, + ], + }, ], }); diff --git a/packages/eslint-plugin/tests/rules/member-ordering.test.ts b/packages/eslint-plugin/tests/rules/member-ordering.test.ts index c21272ca510..3305bebfa8c 100644 --- a/packages/eslint-plugin/tests/rules/member-ordering.test.ts +++ b/packages/eslint-plugin/tests/rules/member-ordering.test.ts @@ -1,128 +1,132 @@ -import rule, { MessageIds, Options } from '../../src/rules/member-ordering'; +import type { MessageIds, Options } from '../../src/rules/member-ordering'; +import rule from '../../src/rules/member-ordering'; +import type { RunTests } from '../RuleTester'; import { RuleTester } from '../RuleTester'; -import { TSESLint } from '@typescript-eslint/utils'; const ruleTester = new RuleTester({ parser: '@typescript-eslint/parser', }); -const grouped: TSESLint.RunTests = { +const grouped: RunTests = { valid: [ ` // no accessibility === public interface Foo { - [Z: string]: any; - A: string; - B: string; - C: string; - D: string; - E: string; - F: string; - new(); - G(); - H(); - I(); - J(); - K(); - L(); -} - `, + [Z: string]: any; + A: string; + B: string; + C: string; + D: string; + E: string; + F: string; + new (); + G(); + H(); + I(); + J(); + K(); + L(); +} + `, { + dependencyConstraints: { + typescript: '4.5', + }, code: ` // no accessibility === public interface Foo { - A: string; - J(); - K(); - D: string; - E: string; - F: string; - new(); - G(); - H(); - [Z: string]: any; - B: string; - C: string; - I(); - L(); -} - `, + A: string; + J(); + K(); + D: string; + E: string; + F: string; + new (); + G(); + H(); + [Z: string]: any; + B: string; + C: string; + I(); + L(); +} + `, options: [{ default: 'never' }], }, { code: ` // no accessibility === public interface Foo { - [Z: string]: any; - A: string; - B: string; - C: string; - D: string; - E: string; - F: string; - new(); - G(); - H(); - I(); - J(); - K(); - L(); -} - `, + [Z: string]: any; + A: string; + B: string; + C: string; + D: string; + E: string; + F: string; + new (); + G(); + H(); + I(); + J(); + K(); + L(); +} + `, options: [{ default: ['signature', 'field', 'constructor', 'method'] }], }, { code: ` interface X { (): void; - a: unknown; + a: unknown; b(): void; } - `, + `, options: [{ default: ['call-signature', 'field', 'method'] }], }, { code: ` // no accessibility === public interface Foo { - A: string; - J(); - K(); - D: string; - [Z: string]: any; - E: string; - F: string; - new(); - G(); - B: string; - C: string; - H(); - I(); - L(); -} - `, + A: string; + J(); + K(); + D: string; + [Z: string]: any; + E: string; + F: string; + new (); + G(); + B: string; + C: string; + H(); + I(); + L(); +} + `, options: [{ interfaces: 'never' }], }, { code: ` // no accessibility === public interface Foo { - [Z: string]: any; - G(); - H(); - I(); - J(); - K(); - L(); - new(); - A: string; - B: string; - C: string; - D: string; - E: string; - F: string; -} - `, + [Z: string]: any; + G(); + H(); + I(); + J(); + K(); + L(); + new (); + A: string; + B: string; + C: string; + D: string; + E: string; + F: string; +} + `, options: [ { interfaces: ['signature', 'method', 'constructor', 'field'] }, ], @@ -131,22 +135,22 @@ interface Foo { code: ` // no accessibility === public interface Foo { - G(); - H(); - I(); - J(); - K(); - L(); - new(); - A: string; - B: string; - C: string; - D: string; - E: string; - F: string; - [Z: string]: any; -} - `, + G(); + H(); + I(); + J(); + K(); + L(); + new (); + A: string; + B: string; + C: string; + D: string; + E: string; + F: string; + [Z: string]: any; +} + `, options: [ { default: ['signature', 'field', 'constructor', 'method'], @@ -158,23 +162,23 @@ interface Foo { code: ` // no accessibility === public interface Foo { - G(); - H(); - I(); - new(); - [Z: string]: any; - D: string; - E: string; - F: string; - G?: string; - J(); - K(); - L(); - A: string; - B: string; - C: string; -} - `, + G(); + H(); + I(); + new (); + [Z: string]: any; + D: string; + E: string; + F: string; + G?: string; + J(); + K(); + L(); + A: string; + B: string; + C: string; +} + `, options: [ { default: [ @@ -189,22 +193,22 @@ interface Foo { code: ` // no accessibility === public interface Foo { - G(); - H(); - I(); - J(); - K(); - L(); - [Z: string]: any; - D: string; - E: string; - F: string; - new(); - A: string; - B: string; - C: string; -} - `, + G(); + H(); + I(); + J(); + K(); + L(); + [Z: string]: any; + D: string; + E: string; + F: string; + new (); + A: string; + B: string; + C: string; +} + `, options: [ { default: ['method', 'public-constructor', 'protected-static-field'], @@ -214,147 +218,147 @@ interface Foo { ` // no accessibility === public type Foo = { - [Z: string]: any; - A: string; - B: string; - C: string; - D: string; - E: string; - F: string; - new(); - G(); - H(); - I(); - J(); - K(); - L(); -} - `, + [Z: string]: any; + A: string; + B: string; + C: string; + D: string; + E: string; + F: string; + new (); + G(); + H(); + I(); + J(); + K(); + L(); +}; + `, { code: ` // no accessibility === public type Foo = { - A: string; - B: string; - C: string; - D: string; - E: string; - F: string; - [Z: string]: any; - G(); - H(); - I(); - J(); - K(); - L(); -} - `, + A: string; + B: string; + C: string; + D: string; + E: string; + F: string; + [Z: string]: any; + G(); + H(); + I(); + J(); + K(); + L(); +}; + `, options: [{ default: 'never' }], }, { code: ` // no accessibility === public type Foo = { - [Z: string]: any; - A: string; - B: string; - C: string; - D: string; - E: string; - F: string; - G(); - H(); - I(); - J(); - K(); - L(); -} - `, + [Z: string]: any; + A: string; + B: string; + C: string; + D: string; + E: string; + F: string; + G(); + H(); + I(); + J(); + K(); + L(); +}; + `, options: [{ default: ['signature', 'field', 'constructor', 'method'] }], }, { code: ` // no accessibility === public type Foo = { - [Z: string]: any; - new(); - A: string; - B: string; - C: string; - D: string; - E: string; - F: string; - G(); - H(); - I(); - J(); - K(); - L(); -} - `, + [Z: string]: any; + new (); + A: string; + B: string; + C: string; + D: string; + E: string; + F: string; + G(); + H(); + I(); + J(); + K(); + L(); +}; + `, options: [{ default: ['field', 'method'] }], }, { code: ` // no accessibility === public type Foo = { - G(); - H(); - [Z: string]: any; - K(); - L(); - A: string; - B: string; - I(); - J(); - C: string; - D: string; - E: string; - F: string; -} - `, + G(); + H(); + [Z: string]: any; + K(); + L(); + A: string; + B: string; + I(); + J(); + C: string; + D: string; + E: string; + F: string; +}; + `, options: [{ typeLiterals: 'never' }], }, { code: ` // no accessibility === public type Foo = { - G(); - H(); - I(); - J(); - K(); - L(); - A: string; - B: string; - C: string; - D: string; - E: string; - F: string; - [Z: string]: any; -} - `, + G(); + H(); + I(); + J(); + K(); + L(); + A: string; + B: string; + C: string; + D: string; + E: string; + F: string; + [Z: string]: any; +}; + `, options: [{ typeLiterals: ['method', 'field', 'signature'] }], }, { code: ` // no accessibility === public type Foo = { - G(); - H(); - I(); - J(); - K(); - L(); - A: string; - B: string; - C: string; - D: string; - E: string; - F: string; - [Z: string]: any; -} - `, + G(); + H(); + I(); + J(); + K(); + L(); + A: string; + B: string; + C: string; + D: string; + E: string; + F: string; + [Z: string]: any; +}; + `, options: [ { typeLiterals: ['method', 'constructor', 'field', 'signature'] }, ], @@ -363,21 +367,21 @@ type Foo = { code: ` // no accessibility === public type Foo = { - G(); - H(); - I(); - J(); - K(); - L(); - A: string; - B: string; - C: string; - D: string; - E: string; - F: string; - [Z: string]: any; -} - `, + G(); + H(); + I(); + J(); + K(); + L(); + A: string; + B: string; + C: string; + D: string; + E: string; + F: string; + [Z: string]: any; +}; + `, options: [ { default: ['signature', 'field', 'constructor', 'method'], @@ -389,21 +393,21 @@ type Foo = { code: ` // no accessibility === public type Foo = { - [Z: string]: any; - D: string; - E: string; - F: string; - A: string; - B: string; - C: string; - G(); - H(); - I(); - J(); - K(); - L(); -} - `, + [Z: string]: any; + D: string; + E: string; + F: string; + A: string; + B: string; + C: string; + G(); + H(); + I(); + J(); + K(); + L(); +}; + `, options: [ { default: [ @@ -417,182 +421,202 @@ type Foo = { }, ` class Foo { - [Z: string]: any; - public static A: string; - protected static B: string = ""; - private static C: string = ""; - public D: string = ""; - protected E: string = ""; - private F: string = ""; - constructor() {} - public static G() {} - protected static H() {} - private static I() {} - public J() {} - protected K() {} - private L() {} -} - `, - { - code: ` -class Foo { - [Z: string]: any; - public static A: string; - protected static B: string = ""; - private static C: string = ""; - public D: string = ""; - protected E: string = ""; - private F: string = ""; - constructor() {} - public static G() {} - protected static H() {} - private static I() {} - public J() {} - protected K() {} - private L() {} -} - `, + [Z: string]: any; + public static A: string; + protected static B: string = ''; + private static C: string = ''; + static #C: string = ''; + public D: string = ''; + protected E: string = ''; + private F: string = ''; + #F: string = ''; + constructor() {} + public static G() {} + protected static H() {} + private static I() {} + static #I() {} + public J() {} + protected K() {} + private L() {} + #L() {} +} + `, + { + code: ` +class Foo { + [Z: string]: any; + public static A: string; + protected static B: string = ''; + private static C: string = ''; + static #C: string = ''; + public D: string = ''; + protected E: string = ''; + private F: string = ''; + #F: string = ''; + constructor() {} + public static G() {} + protected static H() {} + private static I() {} + static #I() {} + public J() {} + protected K() {} + private L() {} + #L() {} +} + `, options: [{ default: 'never' }], }, { code: ` class Foo { - [Z: string]: any; - public static A: string; - protected static B: string = ""; - private static C: string = ""; - public D: string = ""; - protected E: string = ""; - private F: string = ""; - constructor() {} - public static G() {} - protected static H() {} - private static I() {} - public J() {} - protected K() {} - private L() {} + [Z: string]: any; + public static A: string; + protected static B: string = ''; + private static C: string = ''; + static #C: string = ''; + public D: string = ''; + protected E: string = ''; + private F: string = ''; + #F: string = ''; + constructor() {} + public static G() {} + protected static H() {} + private static I() {} + static #I() {} + public J() {} + protected K() {} + private L() {} + #L() {} } - `, + `, options: [{ default: ['signature', 'field', 'constructor', 'method'] }], }, { code: ` class Foo { - [Z: string]: any; - constructor() {} - public static A: string; - protected static B: string = ""; - private static C: string = ""; - public D: string = ""; - protected E: string = ""; - private F: string = ""; - public static G() {} - protected static H() {} - private static I() {} - public J() {} - protected K() {} - private L() {} + [Z: string]: any; + constructor() {} + public static A: string; + protected static B: string = ''; + private static C: string = ''; + static #C: string = ''; + public D: string = ''; + protected E: string = ''; + private F: string = ''; + #F: string = ''; + public static G() {} + protected static H() {} + private static I() {} + static #I() {} + public J() {} + protected K() {} + private L() {} + #L() {} } - `, + `, options: [{ default: ['field', 'method'] }], }, { code: ` class Foo { - public static G() {} - protected K() {} - private L() {} - private static I() {} - public J() {} - public D: string = ""; - [Z: string]: any; - protected static H() {} - public static A: string; - protected static B: string = ""; - constructor() {} - private static C: string = ""; - protected E: string = ""; - private F: string = ""; + public static G() {} + protected K() {} + private L() {} + private static I() {} + public J() {} + public D: string = ''; + [Z: string]: any; + protected static H() {} + public static A: string; + protected static B: string = ''; + constructor() {} + private static C: string = ''; + protected E: string = ''; + private F: string = ''; } - `, + `, options: [{ classes: 'never' }], }, { code: ` class Foo { - public static G() {} - protected static H() {} - private static I() {} - public J() {} - protected K() {} - private L() {} - [Z: string]: any; - public static A: string; - protected static B: string = ""; - private static C: string = ""; - public D: string = ""; - protected E: string = ""; - private F: string = ""; - constructor() {} + public static G() {} + protected static H() {} + private static I() {} + static #I() {} + public J() {} + protected K() {} + private L() {} + #L() {} + [Z: string]: any; + public static A: string; + protected static B: string = ''; + private static C: string = ''; + static #C: string = ''; + public D: string = ''; + protected E: string = ''; + private F: string = ''; + #F: string = ''; + constructor() {} } - `, + `, options: [{ classes: ['method', 'field'] }], }, { code: ` class Foo { - public static G() {} - protected static H() {} - private static I() {} - public J() {} - protected K() {} - private L() {} - constructor() {} - public static A: string; - protected static B: string = ""; - private static C: string = ""; - public D: string = ""; - protected E: string = ""; - private F: string = ""; - [Z: string]: any; + public static G() {} + protected static H() {} + private static I() {} + public J() {} + protected K() {} + private L() {} + constructor() {} + public static A: string; + protected static B: string = ''; + private static C: string = ''; + public D: string = ''; + protected E: string = ''; + private F: string = ''; + [Z: string]: any; } - `, + `, options: [{ classes: ['method', 'constructor', 'field', 'signature'] }], }, { code: ` class Foo { - private required: boolean; - private typeChecker: (data: any) => boolean; - constructor(validator: (data: any) => boolean) { - this.typeChecker = validator; - } - check(data: any): boolean { - return this.typeChecker(data); - } + private required: boolean; + private typeChecker: (data: any) => boolean; + constructor(validator: (data: any) => boolean) { + this.typeChecker = validator; + } + check(data: any): boolean { + return this.typeChecker(data); + } } - `, + `, options: [{ classes: ['field', 'constructor', 'method'] }], }, { code: ` class Foo { - public static G() {} - protected static H() {} - private static I() {} - public J() {} - protected K() {} - private L() {} - constructor() {} - public static A: string; - protected static B: string = ""; - private static C: string = ""; - public D: string = ""; - protected E: string = ""; - private F: string = ""; - [Z: string]: any; + public static G() {} + protected static H() {} + private static I() {} + public J() {} + protected K() {} + private L() {} + constructor() {} + public static A: string; + protected static B: string = ''; + private static C: string = ''; + public D: string = ''; + protected E: string = ''; + private F: string = ''; + [Z: string]: any; } - `, + `, options: [ { default: ['signature', 'field', 'constructor', 'method'], @@ -603,22 +627,24 @@ class Foo { { code: ` class Foo { - public J() {} - public static G() {} - protected static H() {} - private static I() {} - protected K() {} - private L() {} - [Z: string]: any; - constructor() {} - public D: string = ""; - public static A: string; - private static C: string = ""; - private F: string = ""; - protected static B: string = ""; - protected E: string = ""; + public J() {} + public static G() {} + protected static H() {} + private static I() {} + protected K() {} + private L() {} + [Z: string]: any; + constructor() {} + public D: string = ''; + public static A: string; + private static C: string = ''; + private F: string = ''; + static #M: string = ''; + #N: string = ''; + protected static B: string = ''; + protected E: string = ''; } - `, + `, options: [ { classes: [ @@ -627,6 +653,7 @@ class Foo { 'constructor', 'public-field', 'private-field', + '#private-field', 'protected-field', ], }, @@ -635,22 +662,23 @@ class Foo { { code: ` class Foo { - public static G() {} - private static I() {} - protected static H() {} - public J() {} - private L() {} - protected K() {} - [Z: string]: any; - constructor() {} - public D: string = ""; - public static A: string; - protected static B: string = ""; - protected E: string = ""; - private static C: string = ""; - private F: string = ""; + public static G() {} + private static I() {} + protected static H() {} + public J() {} + private L() {} + protected K() {} + [Z: string]: any; + constructor() {} + public D: string = ''; + public static A: string; + protected static B: string = ''; + protected E: string = ''; + private static C: string = ''; + private F: string = ''; + #M: string = ''; } - `, + `, options: [ { classes: [ @@ -663,6 +691,7 @@ class Foo { 'public-field', 'protected-field', 'private-field', + '#private-field', ], }, ], @@ -670,22 +699,26 @@ class Foo { { code: ` class Foo { - public J() {} - public static G() {} - public D: string = ""; - public static A: string = ""; - constructor() {} - protected K() {} - private L() {} - protected static H() {} - private static I() {} - protected static B: string = ""; - private static C: string = ""; - protected E: string = ""; - private F: string = ""; - [Z: string]: any; + public J() {} + public static G() {} + public D: string = ''; + public static A: string = ''; + constructor() {} + protected K() {} + private L() {} + #P() {} + protected static H() {} + private static I() {} + static #O() {} + protected static B: string = ''; + private static C: string = ''; + static #N: string = ''; + protected E: string = ''; + private F: string = ''; + #M: string = ''; + [Z: string]: any; } - `, + `, options: [ { default: [ @@ -702,30 +735,35 @@ class Foo { { code: ` class Foo { - public J() {} - public static G() {} - protected static H() {} - private static I() {} - protected K() {} - private L() {} - constructor() {} - [Z: string]: any; - public static A: string; - private F: string = ""; - protected static B: string = ""; - public D: string = ""; - private static C: string = ""; - protected E: string = ""; + public J() {} + public static G() {} + protected static H() {} + private static I() {} + static #I() {} + protected K() {} + private L() {} + #L() {} + constructor() {} + [Z: string]: any; + public static A: string; + private F: string = ''; + #F: string = ''; + protected static B: string = ''; + public D: string = ''; + private static C: string = ''; + static #C: string = ''; + protected E: string = ''; } - `, + `, options: [ { classes: [ 'public-method', 'protected-static-method', - 'private-static-method', + '#private-static-method', 'protected-instance-method', 'private-instance-method', + '#private-instance-method', 'constructor', 'signature', 'field', @@ -736,22 +774,47 @@ class Foo { { code: ` class Foo { - private L() {} - private static I() {} - protected static H() {} - protected static B: string = ""; - public static G() {} - public J() {} - protected K() {} - private static C: string = ""; - private F: string = ""; - protected E: string = ""; - public static A: string; - public D: string = ""; - constructor() {} - [Z: string]: any; + private L() {} + private static I() {} + protected static H() {} + protected static B: string = ''; + public static G() {} + public J() {} + protected K() {} + private static C: string = ''; + private F: string = ''; + protected E: string = ''; + public static A: string; + public D: string = ''; + constructor() {} + [Z: string]: any; +} + `, + options: [ + { + classes: ['private-instance-method', 'protected-static-field'], + }, + ], + }, + { + code: ` +class Foo { + private L() {} + private static I() {} + static #H() {} + static #B: string = ''; + public static G() {} + public J() {} + #K() {} + private static C: string = ''; + private F: string = ''; + #E: string = ''; + public static A: string; + public D: string = ''; + constructor() {} + [Z: string]: any; } - `, + `, options: [ { classes: ['private-instance-method', 'protected-static-field'], @@ -761,22 +824,22 @@ class Foo { { code: ` class Foo { - private L() {} - private static I() {} - protected static H() {} - public static G() {} - public J() {} - protected static B: string = ""; - protected K() {} - private static C: string = ""; - private F: string = ""; - protected E: string = ""; - public static A: string; - public D: string = ""; - constructor() {} - [Z: string]: any; + private L() {} + private static I() {} + protected static H() {} + public static G() {} + public J() {} + protected static B: string = ''; + protected K() {} + private static C: string = ''; + private F: string = ''; + protected E: string = ''; + public static A: string; + public D: string = ''; + constructor() {} + [Z: string]: any; } - `, + `, options: [ { default: ['public-instance-method', 'protected-static-field'], @@ -786,22 +849,22 @@ class Foo { { code: ` class Foo { - private L() {} - private static I() {} - protected static H() {} - public static G() {} - public J() {} - protected static B: string = ""; - protected K() {} - private static C: string = ""; - private F: string = ""; - protected E: string = ""; - public static A: string; - public D: string = ""; - constructor() {} - [Z: string]: any; + private L() {} + private static I() {} + protected static H() {} + public static G() {} + public J() {} + protected static B: string = ''; + protected K() {} + private static C: string = ''; + private F: string = ''; + protected E: string = ''; + public static A: string; + public D: string = ''; + constructor() {} + [Z: string]: any; } - `, + `, options: [ { classes: ['public-instance-method', 'protected-static-field'], @@ -811,22 +874,22 @@ class Foo { { code: ` class Foo { - [Z: string]: any; - public D: string = ""; - private L() {} - private static I() {} - protected static H() {} - public static G() {} - public J() {} - private constructor() {} - protected static B: string = ""; - protected K() {} - private static C: string = ""; - private F: string = ""; - protected E: string = ""; - public static A: string; + [Z: string]: any; + public D: string = ''; + private L() {} + private static I() {} + protected static H() {} + public static G() {} + public J() {} + private constructor() {} + protected static B: string = ''; + protected K() {} + private static C: string = ''; + private F: string = ''; + protected E: string = ''; + public static A: string; } - `, + `, options: [ { default: [ @@ -845,22 +908,22 @@ class Foo { { code: ` class Foo { - public constructor() {} - public D: string = ""; - private L() {} - private static I() {} - protected static H() {} - public static G() {} - public J() {} - [Z: string]: any; - protected static B: string = ""; - protected K() {} - private static C: string = ""; - private F: string = ""; - protected E: string = ""; - public static A: string; + public constructor() {} + public D: string = ''; + private L() {} + private static I() {} + protected static H() {} + public static G() {} + public J() {} + [Z: string]: any; + protected static B: string = ''; + protected K() {} + private static C: string = ''; + private F: string = ''; + protected E: string = ''; + public static A: string; } - `, + `, options: [ { default: [ @@ -878,146 +941,146 @@ class Foo { }, ` const foo = class Foo { - [Z: string]: any; - public static A: string; - protected static B: string = ""; - private static C: string = ""; - public D: string = ""; - protected E: string = ""; - private F: string = ""; - constructor() {} - public static G() {} - protected static H() {} - private static I() {} - public J() {} - protected K() {} - private L() {} -} - `, + [Z: string]: any; + public static A: string; + protected static B: string = ''; + private static C: string = ''; + public D: string = ''; + protected E: string = ''; + private F: string = ''; + constructor() {} + public static G() {} + protected static H() {} + private static I() {} + public J() {} + protected K() {} + private L() {} +}; + `, { code: ` const foo = class Foo { - constructor() {} - public static A: string; - protected static B: string = ""; - private static I() {} - public J() {} - private F: string = ""; - [Z: string]: any; - public static G() {} - private static C: string = ""; - public D: string = ""; - protected E: string = ""; - protected static H() {} - protected K() {} - private L() {} -} - `, + constructor() {} + public static A: string; + protected static B: string = ''; + private static I() {} + public J() {} + private F: string = ''; + [Z: string]: any; + public static G() {} + private static C: string = ''; + public D: string = ''; + protected E: string = ''; + protected static H() {} + protected K() {} + private L() {} +}; + `, options: [{ default: 'never' }], }, { code: ` const foo = class Foo { - [Z: string]: any; - public static A: string; - protected static B: string = ""; - private static C: string = ""; - public D: string = ""; - protected E: string = ""; - private F: string = ""; - constructor() {} - public static G() {} - protected static H() {} - private static I() {} - public J() {} - protected K() {} - private L() {} -} - `, + [Z: string]: any; + public static A: string; + protected static B: string = ''; + private static C: string = ''; + public D: string = ''; + protected E: string = ''; + private F: string = ''; + constructor() {} + public static G() {} + protected static H() {} + private static I() {} + public J() {} + protected K() {} + private L() {} +}; + `, options: [{ default: ['signature', 'field', 'constructor', 'method'] }], }, { code: ` const foo = class Foo { - constructor() {} - public static A: string; - protected static B: string = ""; - private static C: string = ""; - public D: string = ""; - protected E: string = ""; - private F: string = ""; - [Z: string]: any; - public static G() {} - protected static H() {} - private static I() {} - public J() {} - protected K() {} - private L() {} -} - `, + constructor() {} + public static A: string; + protected static B: string = ''; + private static C: string = ''; + public D: string = ''; + protected E: string = ''; + private F: string = ''; + [Z: string]: any; + public static G() {} + protected static H() {} + private static I() {} + public J() {} + protected K() {} + private L() {} +}; + `, options: [{ default: ['field', 'method'] }], }, { code: ` const foo = class Foo { - private L() {} - protected static H() {} - constructor() {} - private static I() {} - public J() {} - private static C: string = ""; - [Z: string]: any; - public D: string = ""; - protected K() {} - public static G() {} - public static A: string; - protected static B: string = ""; - protected E: string = ""; - private F: string = ""; -} - `, + private L() {} + protected static H() {} + constructor() {} + private static I() {} + public J() {} + private static C: string = ''; + [Z: string]: any; + public D: string = ''; + protected K() {} + public static G() {} + public static A: string; + protected static B: string = ''; + protected E: string = ''; + private F: string = ''; +}; + `, options: [{ classExpressions: 'never' }], }, { code: ` const foo = class Foo { - public static G() {} - protected static H() {} - private static I() {} - public J() {} - protected K() {} - private L() {} - public static A: string; - protected static B: string = ""; - private static C: string = ""; - public D: string = ""; - protected E: string = ""; - private F: string = ""; - constructor() {} - [Z: string]: any; -} - `, + public static G() {} + protected static H() {} + private static I() {} + public J() {} + protected K() {} + private L() {} + public static A: string; + protected static B: string = ''; + private static C: string = ''; + public D: string = ''; + protected E: string = ''; + private F: string = ''; + constructor() {} + [Z: string]: any; +}; + `, options: [{ classExpressions: ['method', 'field'] }], }, { code: ` const foo = class Foo { - public static G() {} - protected static H() {} - private static I() {} - public J() {} - protected K() {} - private L() {} - [Z: string]: any; - constructor() {} - public static A: string; - protected static B: string = ""; - private static C: string = ""; - public D: string = ""; - protected E: string = ""; - private F: string = ""; -} - `, + public static G() {} + protected static H() {} + private static I() {} + public J() {} + protected K() {} + private L() {} + [Z: string]: any; + constructor() {} + public static A: string; + protected static B: string = ''; + private static C: string = ''; + public D: string = ''; + protected E: string = ''; + private F: string = ''; +}; + `, options: [ { classExpressions: ['method', 'signature', 'constructor', 'field'] }, ], @@ -1025,22 +1088,22 @@ const foo = class Foo { { code: ` const foo = class Foo { - public static G() {} - protected static H() {} - private static I() {} - public J() {} - protected K() {} - private L() {} - [Z: string]: any; - constructor() {} - public static A: string; - protected static B: string = ""; - private static C: string = ""; - public D: string = ""; - protected E: string = ""; - private F: string = ""; -} - `, + public static G() {} + protected static H() {} + private static I() {} + public J() {} + protected K() {} + private L() {} + [Z: string]: any; + constructor() {} + public static A: string; + protected static B: string = ''; + private static C: string = ''; + public D: string = ''; + protected E: string = ''; + private F: string = ''; +}; + `, options: [ { default: ['field', 'constructor', 'method'], @@ -1051,23 +1114,22 @@ const foo = class Foo { { code: ` const foo = class Foo { - [Z: string]: any; - private L() {} - private static I() {} - protected static H() {} - protected static B: string = ""; - public static G() {} - public J() {} - protected K() {} - private static C: string = ""; - private F: string = ""; - protected E: string = ""; - public static A: string; - public D: string = ""; - constructor() {} - -} - `, + [Z: string]: any; + private L() {} + private static I() {} + protected static H() {} + protected static B: string = ''; + public static G() {} + public J() {} + protected K() {} + private static C: string = ''; + private F: string = ''; + protected E: string = ''; + public static A: string; + public D: string = ''; + constructor() {} +}; + `, options: [ { classExpressions: [ @@ -1080,23 +1142,22 @@ const foo = class Foo { { code: ` const foo = class Foo { - private L() {} - private static I() {} - protected static H() {} - public static G() {} - public J() {} - [Z: string]: any; - protected static B: string = ""; - protected K() {} - private static C: string = ""; - private F: string = ""; - protected E: string = ""; - public static A: string; - public D: string = ""; - constructor() {} - -} - `, + private L() {} + private static I() {} + protected static H() {} + public static G() {} + public J() {} + [Z: string]: any; + protected static B: string = ''; + protected K() {} + private static C: string = ''; + private F: string = ''; + protected E: string = ''; + public static A: string; + public D: string = ''; + constructor() {} +}; + `, options: [ { default: ['public-instance-method', 'protected-static-field'], @@ -1106,23 +1167,22 @@ const foo = class Foo { { code: ` const foo = class Foo { - private L() {} - private static I() {} - protected static H() {} - public static G() {} - public J() {} - [Z: string]: any; - protected static B: string = ""; - protected K() {} - private static C: string = ""; - private F: string = ""; - protected E: string = ""; - public static A: string; - public D: string = ""; - constructor() {} - -} - `, + private L() {} + private static I() {} + protected static H() {} + public static G() {} + public J() {} + [Z: string]: any; + protected static B: string = ''; + protected K() {} + private static C: string = ''; + private F: string = ''; + protected E: string = ''; + public static A: string; + public D: string = ''; + constructor() {} +}; + `, options: [ { classExpressions: [ @@ -1135,22 +1195,22 @@ const foo = class Foo { { code: ` const foo = class Foo { - public D: string = ""; - private L() {} - private static I() {} - protected static H() {} - public static G() {} - public J() {} - [Z: string]: any; - private constructor() {} - protected static B: string = ""; - protected K() {} - private static C: string = ""; - private F: string = ""; - protected E: string = ""; - public static A: string; -} - `, + public D: string = ''; + private L() {} + private static I() {} + protected static H() {} + public static G() {} + public J() {} + [Z: string]: any; + private constructor() {} + protected static B: string = ''; + protected K() {} + private static C: string = ''; + private F: string = ''; + protected E: string = ''; + public static A: string; +}; + `, options: [ { default: [ @@ -1174,22 +1234,22 @@ const foo = class Foo { { code: ` const foo = class Foo { - public constructor() {} - public D: string = ""; - private L() {} - private static I() {} - protected static H() {} - public static G() {} - public J() {} - protected static B: string = ""; - protected K() {} - [Z: string]: any; - private static C: string = ""; - private F: string = ""; - protected E: string = ""; - public static A: string; -} - `, + public constructor() {} + public D: string = ''; + private L() {} + private static I() {} + protected static H() {} + public static G() {} + public J() {} + protected static B: string = ''; + protected K() {} + [Z: string]: any; + private static C: string = ''; + private F: string = ''; + protected E: string = ''; + public static A: string; +}; + `, options: [ { default: [ @@ -1212,137 +1272,178 @@ const foo = class Foo { }, ` class Foo { - [Z: string]: any; - A: string; - constructor () {} - J() {} - K = () => {} + [Z: string]: any; + A: string; + constructor() {} + J() {} + K = () => {}; } - `, + `, { code: ` class Foo { - J() {} - K = () => {} - constructor () {} - A: string; - [Z: string]: any; + J() {} + K = () => {}; + constructor() {} + A: string; + [Z: string]: any; } - `, + `, options: [{ default: ['method', 'constructor', 'field', 'signature'] }], }, { code: ` class Foo { - J() {} - K = () => {} - constructor () {} - [Z: string]: any; - A: string; - L: () => {} + J() {} + K = () => {}; + constructor() {} + [Z: string]: any; + A: string; + L: () => {}; } - `, + `, options: [{ default: ['method', 'constructor', 'signature', 'field'] }], }, + { + code: ` +class Foo { + static {} + m() {} + f = 1; +} + `, + dependencyConstraints: { + typescript: '4.4', + }, + options: [{ default: ['static-initialization', 'method', 'field'] }], + }, + { + code: ` +class Foo { + m() {} + f = 1; + static {} +} + `, + dependencyConstraints: { + typescript: '4.4', + }, + options: [{ default: ['method', 'field', 'static-initialization'] }], + }, + { + code: ` +class Foo { + f = 1; + static {} + m() {} +} + `, + dependencyConstraints: { + typescript: '4.4', + }, + options: [{ default: ['field', 'static-initialization', 'method'] }], + }, ` interface Foo { - [Z: string]: any; - A: string; - K: () => {}; - J(); + [Z: string]: any; + A: string; + K: () => {}; + J(); } - `, + `, { code: ` interface Foo { - [Z: string]: any; - J(); - K: () => {} - A: string; + [Z: string]: any; + J(); + K: () => {}; + A: string; } - `, + `, options: [{ default: ['signature', 'method', 'constructor', 'field'] }], }, ` type Foo = { - [Z: string]: any; - A: string; - K: () => {} - J(); -} - `, + [Z: string]: any; + A: string; + K: () => {}; + J(); +}; + `, { code: ` type Foo = { - J(); - [Z: string]: any; - K: () => {} - A: string; -} - `, + J(); + [Z: string]: any; + K: () => {}; + A: string; +}; + `, options: [{ default: ['method', 'constructor', 'signature', 'field'] }], }, { code: ` abstract class Foo { - B: string; - abstract A: () => {} + B: string; + abstract A: () => {}; } - `, + `, }, { code: ` interface Foo { - [A:string]: number; - public B: string; + [A: string]: number; + B: string; } - `, + `, }, { code: ` abstract class Foo { - [Z: string]: any; - private static C: string; - B: string; - private D: string; - protected static F(): {}; - public E(): {}; - public abstract A(): void; - protected abstract G(): void; + [Z: string]: any; + private static C: string; + B: string; + private D: string; + protected static F(): {}; + public E(): {}; + public abstract A(): void; + protected abstract G(): void; } - `, + `, }, { code: ` abstract class Foo { - protected typeChecker: (data: any) => boolean; - public abstract required: boolean; - abstract verify(): void; + protected typeChecker: (data: any) => boolean; + public abstract required: boolean; + abstract verify(): void; } - `, + `, options: [{ classes: ['signature', 'field', 'constructor', 'method'] }], }, { code: ` class Foo { - @Dec() B: string; - @Dec() A: string; - constructor() {} - D: string; - C: string; - E(): void; - F(): void; -} `, + @Dec() B: string; + @Dec() A: string; + constructor() {} + D: string; + C: string; + E(): void; + F(): void; +} + `, options: [{ default: ['decorated-field', 'field'] }], }, { code: ` class Foo { - A: string; - B: string; - @Dec() private C: string; - private D: string; -} `, + A: string; + B: string; + @Dec() private C: string; + private D: string; +} + `, options: [ { default: ['public-field', 'private-decorated-field', 'private-field'], @@ -1352,12 +1453,13 @@ class Foo { { code: ` class Foo { - constructor() {} - @Dec() public A(): void; - @Dec() private B: string; - private C(): void; - private D: string; -} `, + constructor() {} + @Dec() public A(): void; + @Dec() private B: string; + private C(): void; + private D: string; +} + `, options: [ { default: [ @@ -1371,12 +1473,13 @@ class Foo { { code: ` class Foo { - @Dec() private A(): void; - @Dec() private B: string; - constructor() {} - private C(): void; - private D: string; -} `, + @Dec() private A(): void; + @Dec() private B: string; + constructor() {} + private C(): void; + private D: string; +} + `, options: [ { default: [ @@ -1391,9 +1494,10 @@ class Foo { { code: ` class Foo { - public A: string; - @Dec() private B: string; -} `, + public A: string; + @Dec() private B: string; +} + `, options: [ { default: ['private-decorated-field', 'public-instance-field'], @@ -1405,12 +1509,13 @@ class Foo { { code: ` class Foo { - public A(): string; - @Dec() public B(): string; - public C(): string; + public A(): string; + @Dec() public B(): string; + public C(): string; - d: string; -} `, + d: string; +} + `, options: [ { default: ['public-method', 'field'], @@ -1420,14 +1525,15 @@ class Foo { { code: ` class Foo { - A: string; - constructor() {} - get B() {} - set B() {} - get C() {} - set C() {} - D(): void; -} `, + A: string; + constructor() {} + get B() {} + set B() {} + get C() {} + set C() {} + D(): void; +} + `, options: [ { default: ['field', 'constructor', ['get', 'set'], 'method'], @@ -1437,10 +1543,11 @@ class Foo { { code: ` class Foo { - A: string; - constructor() {} - B(): void; -} `, + A: string; + constructor() {} + B(): void; +} + `, options: [ { default: ['field', 'constructor', [], 'method'], @@ -1450,13 +1557,14 @@ class Foo { { code: ` class Foo { - A: string; - constructor() {} - @Dec() private B: string; - private C(): void; - set D() {} - E(): void; -} `, + A: string; + constructor() {} + @Dec() private B: string; + private C(): void; + set D() {} + E(): void; +} + `, options: [ { default: [ @@ -1471,42 +1579,97 @@ class Foo { { code: ` class Foo { - A: string; - constructor() {} - get B() {} - get C() {} - set B() {} - set C() {} - D(): void; -} `, + A: string; + constructor() {} + get B() {} + get C() {} + set B() {} + set C() {} + D(): void; +} + `, options: [ { default: ['field', 'constructor', ['get'], ['set'], 'method'], }, ], }, + { + name: 'with private identifier', + code: ` +// no accessibility === public +class Foo { + imPublic() {} + #imPrivate() {} +} + `, + options: [ + { + default: { + memberTypes: ['public-method', '#private-method'], + order: 'alphabetically-case-insensitive', + }, + }, + ], + }, + { + name: 'private and #private member order', + code: ` +// no accessibility === public +class Foo { + private imPrivate() {} + #imPrivate() {} +} + `, + options: [ + { + default: { + memberTypes: ['private-method', '#private-method'], + order: 'alphabetically-case-insensitive', + }, + }, + ], + }, + { + name: '#private and private member order', + code: ` +// no accessibility === public +class Foo { + #imPrivate() {} + private imPrivate() {} +} + `, + options: [ + { + default: { + memberTypes: ['#private-method', 'private-method'], + order: 'alphabetically-case-insensitive', + }, + }, + ], + }, ], invalid: [ { code: ` // no accessibility === public interface Foo { - [Z: string]: any; - A: string; - B: string; - C: string; - D: string; - E: string; - F: string; - G(); - H(); - I(); - J(); - K(); - L(); - new(); -} - `, + [Z: string]: any; + A: string; + B: string; + C: string; + D: string; + E: string; + F: string; + G(); + H(); + I(); + J(); + K(); + L(); + new (); +} + `, errors: [ { messageId: 'incorrectGroupOrder', @@ -1515,18 +1678,18 @@ interface Foo { rank: 'method', }, line: 17, - column: 5, + column: 3, }, ], }, { code: ` interface X { - a: unknown; + a: unknown; (): void; b(): void; } - `, + `, options: [{ default: ['call-signature', 'field', 'method'] }], errors: [ { @@ -1544,22 +1707,22 @@ interface X { code: ` // no accessibility === public interface Foo { - A: string; - B: string; - C: string; - D: string; - E: string; - F: string; - G(); - H(); - I(); - J(); - K(); - L(); - new(); - [Z: string]: any; -} - `, + A: string; + B: string; + C: string; + D: string; + E: string; + F: string; + G(); + H(); + I(); + J(); + K(); + L(); + new (); + [Z: string]: any; +} + `, options: [{ default: ['signature', 'method', 'constructor', 'field'] }], errors: [ { @@ -1569,7 +1732,7 @@ interface Foo { rank: 'field', }, line: 10, - column: 5, + column: 3, }, { messageId: 'incorrectGroupOrder', @@ -1578,7 +1741,7 @@ interface Foo { rank: 'field', }, line: 11, - column: 5, + column: 3, }, { messageId: 'incorrectGroupOrder', @@ -1587,7 +1750,7 @@ interface Foo { rank: 'field', }, line: 12, - column: 5, + column: 3, }, { messageId: 'incorrectGroupOrder', @@ -1596,7 +1759,7 @@ interface Foo { rank: 'field', }, line: 13, - column: 5, + column: 3, }, { messageId: 'incorrectGroupOrder', @@ -1605,7 +1768,7 @@ interface Foo { rank: 'field', }, line: 14, - column: 5, + column: 3, }, { messageId: 'incorrectGroupOrder', @@ -1614,7 +1777,7 @@ interface Foo { rank: 'field', }, line: 15, - column: 5, + column: 3, }, { messageId: 'incorrectGroupOrder', @@ -1623,7 +1786,7 @@ interface Foo { rank: 'field', }, line: 16, - column: 5, + column: 3, }, { messageId: 'incorrectGroupOrder', @@ -1632,7 +1795,7 @@ interface Foo { rank: 'field', }, line: 17, - column: 5, + column: 3, }, ], }, @@ -1640,22 +1803,22 @@ interface Foo { code: ` // no accessibility === public interface Foo { - A: string; - B: string; - C: string; - D: string; - E: string; - F: string; - G(); - H(); - I(); - J(); - K(); - L(); - new(); - [Z: string]: any; -} - `, + A: string; + B: string; + C: string; + D: string; + E: string; + F: string; + G(); + H(); + I(); + J(); + K(); + L(); + new (); + [Z: string]: any; +} + `, options: [ { interfaces: ['method', 'signature', 'constructor', 'field'] }, ], @@ -1667,7 +1830,7 @@ interface Foo { rank: 'field', }, line: 10, - column: 5, + column: 3, }, { messageId: 'incorrectGroupOrder', @@ -1676,7 +1839,7 @@ interface Foo { rank: 'field', }, line: 11, - column: 5, + column: 3, }, { messageId: 'incorrectGroupOrder', @@ -1685,7 +1848,7 @@ interface Foo { rank: 'field', }, line: 12, - column: 5, + column: 3, }, { messageId: 'incorrectGroupOrder', @@ -1694,7 +1857,7 @@ interface Foo { rank: 'field', }, line: 13, - column: 5, + column: 3, }, { messageId: 'incorrectGroupOrder', @@ -1703,7 +1866,7 @@ interface Foo { rank: 'field', }, line: 14, - column: 5, + column: 3, }, { messageId: 'incorrectGroupOrder', @@ -1712,7 +1875,7 @@ interface Foo { rank: 'field', }, line: 15, - column: 5, + column: 3, }, { messageId: 'incorrectGroupOrder', @@ -1721,7 +1884,7 @@ interface Foo { rank: 'field', }, line: 16, - column: 5, + column: 3, }, { messageId: 'incorrectGroupOrder', @@ -1730,7 +1893,7 @@ interface Foo { rank: 'field', }, line: 17, - column: 5, + column: 3, }, ], }, @@ -1738,22 +1901,22 @@ interface Foo { code: ` // no accessibility === public interface Foo { - A: string; - B: string; - C: string; - D: string; - E: string; - F: string; - G(); - H(); - I(); - J(); - K(); - L(); - new(); - [Z: string]: any; -} - `, + A: string; + B: string; + C: string; + D: string; + E: string; + F: string; + G(); + H(); + I(); + J(); + K(); + L(); + new (); + [Z: string]: any; +} + `, options: [ { default: ['field', 'method', 'constructor', 'signature'], @@ -1768,7 +1931,7 @@ interface Foo { rank: 'field', }, line: 10, - column: 5, + column: 3, }, { messageId: 'incorrectGroupOrder', @@ -1777,7 +1940,7 @@ interface Foo { rank: 'field', }, line: 11, - column: 5, + column: 3, }, { messageId: 'incorrectGroupOrder', @@ -1786,7 +1949,7 @@ interface Foo { rank: 'field', }, line: 12, - column: 5, + column: 3, }, { messageId: 'incorrectGroupOrder', @@ -1795,7 +1958,7 @@ interface Foo { rank: 'field', }, line: 13, - column: 5, + column: 3, }, { messageId: 'incorrectGroupOrder', @@ -1804,7 +1967,7 @@ interface Foo { rank: 'field', }, line: 14, - column: 5, + column: 3, }, { messageId: 'incorrectGroupOrder', @@ -1813,7 +1976,7 @@ interface Foo { rank: 'field', }, line: 15, - column: 5, + column: 3, }, { messageId: 'incorrectGroupOrder', @@ -1822,7 +1985,7 @@ interface Foo { rank: 'field', }, line: 16, - column: 5, + column: 3, }, { messageId: 'incorrectGroupOrder', @@ -1831,7 +1994,7 @@ interface Foo { rank: 'field', }, line: 17, - column: 5, + column: 3, }, ], }, @@ -1839,22 +2002,22 @@ interface Foo { code: ` // no accessibility === public interface Foo { - [Z: string]: any; - new(); - A: string; - G(); - B: string; - H(); - C: string; - I(); - D: string; - J(); - E: string; - K(); - F: string; - L(); -} - `, + [Z: string]: any; + new (); + A: string; + G(); + B: string; + H(); + C: string; + I(); + D: string; + J(); + E: string; + K(); + F: string; + L(); +} + `, options: [ { interfaces: ['signature', 'constructor', 'field', 'method'], @@ -1868,7 +2031,7 @@ interface Foo { rank: 'method', }, line: 8, - column: 5, + column: 3, }, { messageId: 'incorrectGroupOrder', @@ -1877,7 +2040,7 @@ interface Foo { rank: 'method', }, line: 10, - column: 5, + column: 3, }, { messageId: 'incorrectGroupOrder', @@ -1886,7 +2049,7 @@ interface Foo { rank: 'method', }, line: 12, - column: 5, + column: 3, }, { messageId: 'incorrectGroupOrder', @@ -1895,7 +2058,7 @@ interface Foo { rank: 'method', }, line: 14, - column: 5, + column: 3, }, { messageId: 'incorrectGroupOrder', @@ -1904,7 +2067,7 @@ interface Foo { rank: 'method', }, line: 16, - column: 5, + column: 3, }, ], }, @@ -1912,22 +2075,22 @@ interface Foo { code: ` // no accessibility === public type Foo = { - [Z: string]: any; - A: string; - B: string; - C: string; - D: string; - E: string; - F: string; - G(); - H(); - I(); - J(); - K(); - L(); - new(); -} - `, + [Z: string]: any; + A: string; + B: string; + C: string; + D: string; + E: string; + F: string; + G(); + H(); + I(); + J(); + K(); + L(); + new (); +}; + `, errors: [ { messageId: 'incorrectGroupOrder', @@ -1936,7 +2099,7 @@ type Foo = { rank: 'method', }, line: 17, - column: 5, + column: 3, }, ], }, @@ -1944,22 +2107,22 @@ type Foo = { code: ` // no accessibility === public type Foo = { - A: string; - B: string; - C: string; - D: string; - E: string; - F: string; - G(); - H(); - I(); - J(); - K(); - L(); - [Z: string]: any; - new(); -} - `, + A: string; + B: string; + C: string; + D: string; + E: string; + F: string; + G(); + H(); + I(); + J(); + K(); + L(); + [Z: string]: any; + new (); +}; + `, options: [{ default: ['method', 'constructor', 'signature', 'field'] }], errors: [ { @@ -1969,7 +2132,7 @@ type Foo = { rank: 'field', }, line: 10, - column: 5, + column: 3, }, { messageId: 'incorrectGroupOrder', @@ -1978,7 +2141,7 @@ type Foo = { rank: 'field', }, line: 11, - column: 5, + column: 3, }, { messageId: 'incorrectGroupOrder', @@ -1987,7 +2150,7 @@ type Foo = { rank: 'field', }, line: 12, - column: 5, + column: 3, }, { messageId: 'incorrectGroupOrder', @@ -1996,7 +2159,7 @@ type Foo = { rank: 'field', }, line: 13, - column: 5, + column: 3, }, { messageId: 'incorrectGroupOrder', @@ -2005,7 +2168,7 @@ type Foo = { rank: 'field', }, line: 14, - column: 5, + column: 3, }, { messageId: 'incorrectGroupOrder', @@ -2014,7 +2177,7 @@ type Foo = { rank: 'field', }, line: 15, - column: 5, + column: 3, }, { messageId: 'incorrectGroupOrder', @@ -2023,7 +2186,7 @@ type Foo = { rank: 'field', }, line: 16, - column: 5, + column: 3, }, { messageId: 'incorrectGroupOrder', @@ -2032,7 +2195,7 @@ type Foo = { rank: 'field', }, line: 17, - column: 5, + column: 3, }, ], }, @@ -2040,22 +2203,22 @@ type Foo = { code: ` // no accessibility === public type Foo = { - [Z: string]: any; - A: string; - B: string; - C: string; - D: string; - E: string; - F: string; - G(); - H(); - I(); - J(); - K(); - L(); - new(); -} - `, + [Z: string]: any; + A: string; + B: string; + C: string; + D: string; + E: string; + F: string; + G(); + H(); + I(); + J(); + K(); + L(); + new (); +}; + `, options: [ { typeLiterals: ['method', 'constructor', 'signature', 'field'] }, ], @@ -2067,7 +2230,7 @@ type Foo = { rank: 'signature', }, line: 11, - column: 5, + column: 3, }, { messageId: 'incorrectGroupOrder', @@ -2076,7 +2239,7 @@ type Foo = { rank: 'signature', }, line: 12, - column: 5, + column: 3, }, { messageId: 'incorrectGroupOrder', @@ -2085,7 +2248,7 @@ type Foo = { rank: 'signature', }, line: 13, - column: 5, + column: 3, }, { messageId: 'incorrectGroupOrder', @@ -2094,7 +2257,7 @@ type Foo = { rank: 'signature', }, line: 14, - column: 5, + column: 3, }, { messageId: 'incorrectGroupOrder', @@ -2103,7 +2266,7 @@ type Foo = { rank: 'signature', }, line: 15, - column: 5, + column: 3, }, { messageId: 'incorrectGroupOrder', @@ -2112,7 +2275,7 @@ type Foo = { rank: 'signature', }, line: 16, - column: 5, + column: 3, }, { messageId: 'incorrectGroupOrder', @@ -2121,7 +2284,7 @@ type Foo = { rank: 'signature', }, line: 17, - column: 5, + column: 3, }, ], }, @@ -2129,22 +2292,22 @@ type Foo = { code: ` // no accessibility === public type Foo = { - A: string; - B: string; - C: string; - D: string; - E: string; - F: string; - G(); - H(); - I(); - J(); - K(); - L(); - new(); - [Z: string]: any; -} - `, + A: string; + B: string; + C: string; + D: string; + E: string; + F: string; + G(); + H(); + I(); + J(); + K(); + L(); + new (); + [Z: string]: any; +}; + `, options: [ { default: ['field', 'method', 'constructor', 'signature'], @@ -2159,7 +2322,7 @@ type Foo = { rank: 'field', }, line: 10, - column: 5, + column: 3, }, { messageId: 'incorrectGroupOrder', @@ -2168,7 +2331,7 @@ type Foo = { rank: 'field', }, line: 11, - column: 5, + column: 3, }, { messageId: 'incorrectGroupOrder', @@ -2177,7 +2340,7 @@ type Foo = { rank: 'field', }, line: 12, - column: 5, + column: 3, }, { messageId: 'incorrectGroupOrder', @@ -2186,7 +2349,7 @@ type Foo = { rank: 'field', }, line: 13, - column: 5, + column: 3, }, { messageId: 'incorrectGroupOrder', @@ -2195,7 +2358,7 @@ type Foo = { rank: 'field', }, line: 14, - column: 5, + column: 3, }, { messageId: 'incorrectGroupOrder', @@ -2204,7 +2367,7 @@ type Foo = { rank: 'field', }, line: 15, - column: 5, + column: 3, }, { messageId: 'incorrectGroupOrder', @@ -2213,7 +2376,7 @@ type Foo = { rank: 'field', }, line: 16, - column: 5, + column: 3, }, { messageId: 'incorrectGroupOrder', @@ -2222,7 +2385,7 @@ type Foo = { rank: 'field', }, line: 17, - column: 5, + column: 3, }, ], }, @@ -2230,22 +2393,22 @@ type Foo = { code: ` // no accessibility === public type Foo = { - new(); - [Z: string]: any; - A: string; - G(); - B: string; - H(); - C: string; - I(); - D: string; - J(); - E: string; - K(); - F: string; - L(); -} - `, + new (); + [Z: string]: any; + A: string; + G(); + B: string; + H(); + C: string; + I(); + D: string; + J(); + E: string; + K(); + F: string; + L(); +}; + `, options: [ { typeLiterals: ['constructor', 'signature', 'field', 'method'], @@ -2259,7 +2422,7 @@ type Foo = { rank: 'method', }, line: 8, - column: 5, + column: 3, }, { messageId: 'incorrectGroupOrder', @@ -2268,7 +2431,7 @@ type Foo = { rank: 'method', }, line: 10, - column: 5, + column: 3, }, { messageId: 'incorrectGroupOrder', @@ -2277,7 +2440,7 @@ type Foo = { rank: 'method', }, line: 12, - column: 5, + column: 3, }, { messageId: 'incorrectGroupOrder', @@ -2286,7 +2449,7 @@ type Foo = { rank: 'method', }, line: 14, - column: 5, + column: 3, }, { messageId: 'incorrectGroupOrder', @@ -2295,29 +2458,33 @@ type Foo = { rank: 'method', }, line: 16, - column: 5, + column: 3, }, ], }, { code: ` class Foo { - [Z: string]: any; - public static A: string = ""; - protected static B: string = ""; - private static C: string = ""; - public D: string = ""; - protected E: string = ""; - private F: string = ""; - constructor() {} - public J() {} - protected K() {} - private L() {} - public static G() {} - protected static H() {} - private static I() {} + [Z: string]: any; + public static A: string = ''; + protected static B: string = ''; + private static C: string = ''; + static #C: string = ''; + public D: string = ''; + protected E: string = ''; + private F: string = ''; + #F: string = ''; + constructor() {} + public J() {} + protected K() {} + private L() {} + #L() {} + public static G() {} + protected static H() {} + private static I() {} + static #I() {} } - `, + `, errors: [ { messageId: 'incorrectGroupOrder', @@ -2325,8 +2492,8 @@ class Foo { name: 'G', rank: 'public instance method', }, - line: 14, - column: 5, + line: 17, + column: 3, }, { messageId: 'incorrectGroupOrder', @@ -2334,8 +2501,8 @@ class Foo { name: 'H', rank: 'public instance method', }, - line: 15, - column: 5, + line: 18, + column: 3, }, { messageId: 'incorrectGroupOrder', @@ -2343,30 +2510,43 @@ class Foo { name: 'I', rank: 'public instance method', }, - line: 16, - column: 5, + line: 19, + column: 3, + }, + { + messageId: 'incorrectGroupOrder', + data: { + name: 'I', + rank: 'public instance method', + }, + line: 20, + column: 3, }, ], }, { code: ` class Foo { - constructor() {} - public static A: string = ""; - protected static B: string = ""; - private static C: string = ""; - public D: string = ""; - protected E: string = ""; - private F: string = ""; - public J() {} - protected K() {} - private L() {} - public static G() {} - protected static H() {} - private static I() {} - [Z: string]: any; + constructor() {} + public static A: string = ''; + protected static B: string = ''; + private static C: string = ''; + static #C: string = ''; + public D: string = ''; + protected E: string = ''; + private F: string = ''; + #F: string = ''; + public J() {} + protected K() {} + private L() {} + #L() {} + public static G() {} + protected static H() {} + private static I() {} + static #I() {} + [Z: string]: any; } - `, + `, options: [{ default: ['field', 'constructor', 'method', 'signature'] }], errors: [ { @@ -2376,7 +2556,7 @@ class Foo { rank: 'constructor', }, line: 4, - column: 5, + column: 3, }, { messageId: 'incorrectGroupOrder', @@ -2385,7 +2565,7 @@ class Foo { rank: 'constructor', }, line: 5, - column: 5, + column: 3, }, { messageId: 'incorrectGroupOrder', @@ -2394,55 +2574,73 @@ class Foo { rank: 'constructor', }, line: 6, - column: 5, + column: 3, }, { messageId: 'incorrectGroupOrder', data: { - name: 'D', + name: 'C', rank: 'constructor', }, line: 7, - column: 5, + column: 3, }, { messageId: 'incorrectGroupOrder', data: { - name: 'E', + name: 'D', rank: 'constructor', }, line: 8, - column: 5, + column: 3, }, { messageId: 'incorrectGroupOrder', data: { - name: 'F', + name: 'E', rank: 'constructor', }, line: 9, - column: 5, + column: 3, + }, + { + messageId: 'incorrectGroupOrder', + data: { + name: 'F', + rank: 'constructor', + }, + line: 10, + column: 3, + }, + { + messageId: 'incorrectGroupOrder', + data: { + name: 'F', + rank: 'constructor', + }, + line: 11, + column: 3, }, ], }, { code: ` class Foo { - constructor() {} - protected static B: string = ""; - private static C: string = ""; - public D: string = ""; - protected E: string = ""; - private F: string = ""; - public static G() {} - public static A: string; - protected static H() {} - private static I() {} - public J() {} - protected K() {} - private L() {} + constructor() {} + protected static B: string = ''; + private static C: string = ''; + public D: string = ''; + protected E: string = ''; + private F: string = ''; + public static G() {} + public static A: string; + protected static H() {} + private static I() {} + public J() {} + protected K() {} + private L() {} } - `, + `, options: [{ default: ['field', 'method'] }], errors: [ { @@ -2452,28 +2650,28 @@ class Foo { rank: 'method', }, line: 10, - column: 5, + column: 3, }, ], }, { code: ` class Foo { - protected static H() {} - private static I() {} - public J() {} - protected K() {} - private L() {} - public static A: string; - public static G() {} - protected static B: string = ""; - private static C: string = ""; - public D: string = ""; - protected E: string = ""; - private F: string = ""; - constructor() {} + protected static H() {} + private static I() {} + public J() {} + protected K() {} + private L() {} + public static A: string; + public static G() {} + protected static B: string = ''; + private static C: string = ''; + public D: string = ''; + protected E: string = ''; + private F: string = ''; + constructor() {} } - `, + `, options: [{ default: ['method', 'field'] }], errors: [ { @@ -2483,28 +2681,28 @@ class Foo { rank: 'field', }, line: 9, - column: 5, + column: 3, }, ], }, { code: ` class Foo { - public static G() {} - protected static H() {} - protected static B: string = ""; - private static I() {} - public J() {} - protected K() {} - private L() {} - public static A: string; - constructor() {} - private static C: string = ""; - public D: string = ""; - protected E: string = ""; - private F: string = ""; + public static G() {} + protected static H() {} + protected static B: string = ''; + private static I() {} + public J() {} + protected K() {} + private L() {} + public static A: string; + constructor() {} + private static C: string = ''; + public D: string = ''; + protected E: string = ''; + private F: string = ''; } - `, + `, options: [{ classes: ['method', 'constructor', 'field'] }], errors: [ { @@ -2514,7 +2712,7 @@ class Foo { rank: 'field', }, line: 6, - column: 5, + column: 3, }, { messageId: 'incorrectGroupOrder', @@ -2523,7 +2721,7 @@ class Foo { rank: 'field', }, line: 7, - column: 5, + column: 3, }, { messageId: 'incorrectGroupOrder', @@ -2532,7 +2730,7 @@ class Foo { rank: 'field', }, line: 8, - column: 5, + column: 3, }, { messageId: 'incorrectGroupOrder', @@ -2541,7 +2739,7 @@ class Foo { rank: 'field', }, line: 9, - column: 5, + column: 3, }, { messageId: 'incorrectGroupOrder', @@ -2550,28 +2748,28 @@ class Foo { rank: 'field', }, line: 11, - column: 5, + column: 3, }, ], }, { code: ` class Foo { - public static A: string; - public static G() {} - protected static H() {} - private static I() {} - public J() {} - protected K() {} - private L() {} - constructor() {} - protected static B: string = ""; - private static C: string = ""; - public D: string = ""; - protected E: string = ""; - private F: string = ""; + public static A: string; + public static G() {} + protected static H() {} + private static I() {} + public J() {} + protected K() {} + private L() {} + constructor() {} + protected static B: string = ''; + private static C: string = ''; + public D: string = ''; + protected E: string = ''; + private F: string = ''; } - `, + `, options: [ { default: ['field', 'constructor', 'method'], @@ -2586,7 +2784,7 @@ class Foo { rank: 'field', }, line: 4, - column: 5, + column: 3, }, { messageId: 'incorrectGroupOrder', @@ -2595,7 +2793,7 @@ class Foo { rank: 'field', }, line: 5, - column: 5, + column: 3, }, { messageId: 'incorrectGroupOrder', @@ -2604,7 +2802,7 @@ class Foo { rank: 'field', }, line: 6, - column: 5, + column: 3, }, { messageId: 'incorrectGroupOrder', @@ -2613,7 +2811,7 @@ class Foo { rank: 'field', }, line: 7, - column: 5, + column: 3, }, { messageId: 'incorrectGroupOrder', @@ -2622,7 +2820,7 @@ class Foo { rank: 'field', }, line: 8, - column: 5, + column: 3, }, { messageId: 'incorrectGroupOrder', @@ -2631,7 +2829,7 @@ class Foo { rank: 'field', }, line: 9, - column: 5, + column: 3, }, { messageId: 'incorrectGroupOrder', @@ -2640,30 +2838,30 @@ class Foo { rank: 'field', }, line: 10, - column: 5, + column: 3, }, ], }, { code: ` class Foo { - private L() {} - public J() {} - public static G() {} - protected static H() {} - private static I() {} - protected K() {} - constructor() {} - public D: string = ""; - private static C: string = ""; - public static A: string; - private static C: string = ""; - protected static B: string = ""; - private F: string = ""; - protected static B: string = ""; - protected E: string = ""; + private L() {} + public J() {} + public static G() {} + protected static H() {} + private static I() {} + protected K() {} + constructor() {} + public D: string = ''; + private static C: string = ''; + public static A: string; + private static C: string = ''; + protected static B: string = ''; + private F: string = ''; + protected static B: string = ''; + protected E: string = ''; } - `, + `, options: [ { classes: [ @@ -2683,7 +2881,7 @@ class Foo { rank: 'private field', }, line: 12, - column: 5, + column: 3, }, { messageId: 'incorrectGroupOrder', @@ -2692,28 +2890,28 @@ class Foo { rank: 'protected field', }, line: 15, - column: 5, + column: 3, }, ], }, { code: ` class Foo { - public static G() {} - private static I() {} - public J() {} - protected static H() {} - private L() {} - protected K() {} - public D: string = ""; - constructor() {} - public static A: string; - protected static B: string = ""; - protected E: string = ""; - private static C: string = ""; - private F: string = ""; + public static G() {} + private static I() {} + public J() {} + protected static H() {} + private L() {} + protected K() {} + public D: string = ''; + constructor() {} + public static A: string; + protected static B: string = ''; + protected E: string = ''; + private static C: string = ''; + private F: string = ''; } - `, + `, options: [ { classes: [ @@ -2736,7 +2934,7 @@ class Foo { rank: 'public instance method', }, line: 6, - column: 5, + column: 3, }, { messageId: 'incorrectGroupOrder', @@ -2745,28 +2943,28 @@ class Foo { rank: 'public field', }, line: 10, - column: 5, + column: 3, }, ], }, { code: ` class Foo { - public J() {} - public static G() {} - public D: string = ""; - public static A: string = ""; - private L() {} - constructor() {} - protected K() {} - protected static H() {} - private static I() {} - protected static B: string = ""; - private static C: string = ""; - protected E: string = ""; - private F: string = ""; + public J() {} + public static G() {} + public D: string = ''; + public static A: string = ''; + private L() {} + constructor() {} + protected K() {} + protected static H() {} + private static I() {} + protected static B: string = ''; + private static C: string = ''; + protected E: string = ''; + private F: string = ''; } - `, + `, options: [ { default: [ @@ -2786,28 +2984,28 @@ class Foo { rank: 'method', }, line: 8, - column: 5, + column: 3, }, ], }, { code: ` class Foo { - public J() {} - private static I() {} - public static G() {} - protected static H() {} - protected K() {} - private L() {} - constructor() {} - public static A: string; - private F: string = ""; - protected static B: string = ""; - public D: string = ""; - private static C: string = ""; - protected E: string = ""; + public J() {} + private static I() {} + public static G() {} + protected static H() {} + protected K() {} + private L() {} + constructor() {} + public static A: string; + private F: string = ''; + protected static B: string = ''; + public D: string = ''; + private static C: string = ''; + protected E: string = ''; } - `, + `, options: [ { classes: [ @@ -2829,7 +3027,7 @@ class Foo { rank: 'private static method', }, line: 5, - column: 5, + column: 3, }, { messageId: 'incorrectGroupOrder', @@ -2838,28 +3036,28 @@ class Foo { rank: 'private static method', }, line: 6, - column: 5, + column: 3, }, ], }, { code: ` class Foo { - private static I() {} - protected static H() {} - protected static B: string = ""; - public static G() {} - public J() {} - protected K() {} - private static C: string = ""; - private L() {} - private F: string = ""; - protected E: string = ""; - public static A: string; - public D: string = ""; - constructor() {} + private static I() {} + protected static H() {} + protected static B: string = ''; + public static G() {} + public J() {} + protected K() {} + private static C: string = ''; + private L() {} + private F: string = ''; + protected E: string = ''; + public static A: string; + public D: string = ''; + constructor() {} } - `, + `, options: [ { classes: ['private-instance-method', 'protected-static-field'], @@ -2873,29 +3071,28 @@ class Foo { rank: 'protected static field', }, line: 10, - column: 5, + column: 3, }, ], }, { code: ` class Foo { - private L() {} - private static I() {} - protected static H() {} - public static G() {} - protected static B: string = ""; - public J() {} - protected K() {} - private static C: string = ""; - private F: string = ""; - protected E: string = ""; - public static A: string; - public D: string = ""; - constructor() {} - + private L() {} + private static I() {} + protected static H() {} + public static G() {} + protected static B: string = ''; + public J() {} + protected K() {} + private static C: string = ''; + private F: string = ''; + protected E: string = ''; + public static A: string; + public D: string = ''; + constructor() {} } - `, + `, options: [ { default: ['public-instance-method', 'protected-static-field'], @@ -2909,28 +3106,28 @@ class Foo { rank: 'protected static field', }, line: 8, - column: 5, + column: 3, }, ], }, { code: ` const foo = class Foo { - public static A: string = ""; - protected static B: string = ""; - private static C: string = ""; - public D: string = ""; - protected E: string = ""; - private F: string = ""; - constructor() {} - public J() {} - protected K() {} - private L() {} - public static G() {} - protected static H() {} - private static I() {} -} - `, + public static A: string = ''; + protected static B: string = ''; + private static C: string = ''; + public D: string = ''; + protected E: string = ''; + private F: string = ''; + constructor() {} + public J() {} + protected K() {} + private L() {} + public static G() {} + protected static H() {} + private static I() {} +}; + `, errors: [ { messageId: 'incorrectGroupOrder', @@ -2939,7 +3136,7 @@ const foo = class Foo { rank: 'public instance method', }, line: 13, - column: 5, + column: 3, }, { messageId: 'incorrectGroupOrder', @@ -2948,7 +3145,7 @@ const foo = class Foo { rank: 'public instance method', }, line: 14, - column: 5, + column: 3, }, { messageId: 'incorrectGroupOrder', @@ -2957,29 +3154,29 @@ const foo = class Foo { rank: 'public instance method', }, line: 15, - column: 5, + column: 3, }, ], }, { code: ` const foo = class { - [Z: string]: any; - constructor() {} - public static A: string = ""; - protected static B: string = ""; - private static C: string = ""; - public D: string = ""; - protected E: string = ""; - private F: string = ""; - public J() {} - protected K() {} - private L() {} - public static G() {} - protected static H() {} - private static I() {} -} - `, + [Z: string]: any; + constructor() {} + public static A: string = ''; + protected static B: string = ''; + private static C: string = ''; + public D: string = ''; + protected E: string = ''; + private F: string = ''; + public J() {} + protected K() {} + private L() {} + public static G() {} + protected static H() {} + private static I() {} +}; + `, options: [{ default: ['signature', 'field', 'constructor', 'method'] }], errors: [ { @@ -2989,7 +3186,7 @@ const foo = class { rank: 'constructor', }, line: 5, - column: 5, + column: 3, }, { messageId: 'incorrectGroupOrder', @@ -2998,7 +3195,7 @@ const foo = class { rank: 'constructor', }, line: 6, - column: 5, + column: 3, }, { messageId: 'incorrectGroupOrder', @@ -3007,7 +3204,7 @@ const foo = class { rank: 'constructor', }, line: 7, - column: 5, + column: 3, }, { messageId: 'incorrectGroupOrder', @@ -3016,7 +3213,7 @@ const foo = class { rank: 'constructor', }, line: 8, - column: 5, + column: 3, }, { messageId: 'incorrectGroupOrder', @@ -3025,7 +3222,7 @@ const foo = class { rank: 'constructor', }, line: 9, - column: 5, + column: 3, }, { messageId: 'incorrectGroupOrder', @@ -3034,29 +3231,29 @@ const foo = class { rank: 'constructor', }, line: 10, - column: 5, + column: 3, }, ], }, { code: ` const foo = class { - constructor() {} - protected static B: string = ""; - private static C: string = ""; - public D: string = ""; - protected E: string = ""; - private F: string = ""; - [Z: string]: any; - public static G() {} - public static A: string; - protected static H() {} - private static I() {} - public J() {} - protected K() {} - private L() {} -} - `, + constructor() {} + protected static B: string = ''; + private static C: string = ''; + public D: string = ''; + protected E: string = ''; + private F: string = ''; + [Z: string]: any; + public static G() {} + public static A: string; + protected static H() {} + private static I() {} + public J() {} + protected K() {} + private L() {} +}; + `, options: [{ default: ['field', 'method'] }], errors: [ { @@ -3066,28 +3263,28 @@ const foo = class { rank: 'method', }, line: 11, - column: 5, + column: 3, }, ], }, { code: ` const foo = class { - protected static H() {} - private static I() {} - public J() {} - protected K() {} - private L() {} - public static A: string; - public static G() {} - protected static B: string = ""; - private static C: string = ""; - public D: string = ""; - protected E: string = ""; - private F: string = ""; - constructor() {} -} - `, + protected static H() {} + private static I() {} + public J() {} + protected K() {} + private L() {} + public static A: string; + public static G() {} + protected static B: string = ''; + private static C: string = ''; + public D: string = ''; + protected E: string = ''; + private F: string = ''; + constructor() {} +}; + `, options: [{ default: ['method', 'field'] }], errors: [ { @@ -3097,29 +3294,29 @@ const foo = class { rank: 'field', }, line: 9, - column: 5, + column: 3, }, ], }, { code: ` const foo = class { - public static G() {} - protected static H() {} - protected static B: string = ""; - private static I() {} - public J() {} - protected K() {} - private L() {} - public static A: string; - constructor() {} - [Z: string]: any; - private static C: string = ""; - public D: string = ""; - protected E: string = ""; - private F: string = ""; -} - `, + public static G() {} + protected static H() {} + protected static B: string = ''; + private static I() {} + public J() {} + protected K() {} + private L() {} + public static A: string; + constructor() {} + [Z: string]: any; + private static C: string = ''; + public D: string = ''; + protected E: string = ''; + private F: string = ''; +}; + `, options: [{ classExpressions: ['method', 'constructor', 'field'] }], errors: [ { @@ -3129,7 +3326,7 @@ const foo = class { rank: 'field', }, line: 6, - column: 5, + column: 3, }, { messageId: 'incorrectGroupOrder', @@ -3138,7 +3335,7 @@ const foo = class { rank: 'field', }, line: 7, - column: 5, + column: 3, }, { messageId: 'incorrectGroupOrder', @@ -3147,7 +3344,7 @@ const foo = class { rank: 'field', }, line: 8, - column: 5, + column: 3, }, { messageId: 'incorrectGroupOrder', @@ -3156,7 +3353,7 @@ const foo = class { rank: 'field', }, line: 9, - column: 5, + column: 3, }, { messageId: 'incorrectGroupOrder', @@ -3165,28 +3362,28 @@ const foo = class { rank: 'field', }, line: 11, - column: 5, + column: 3, }, ], }, { code: ` const foo = class { - public static A: string; - public static G() {} - protected static H() {} - private static I() {} - public J() {} - protected K() {} - private L() {} - constructor() {} - protected static B: string = ""; - private static C: string = ""; - public D: string = ""; - protected E: string = ""; - private F: string = ""; -} - `, + public static A: string; + public static G() {} + protected static H() {} + private static I() {} + public J() {} + protected K() {} + private L() {} + constructor() {} + protected static B: string = ''; + private static C: string = ''; + public D: string = ''; + protected E: string = ''; + private F: string = ''; +}; + `, options: [ { default: ['field', 'constructor', 'method'], @@ -3201,7 +3398,7 @@ const foo = class { rank: 'field', }, line: 4, - column: 5, + column: 3, }, { messageId: 'incorrectGroupOrder', @@ -3210,7 +3407,7 @@ const foo = class { rank: 'field', }, line: 5, - column: 5, + column: 3, }, { messageId: 'incorrectGroupOrder', @@ -3219,7 +3416,7 @@ const foo = class { rank: 'field', }, line: 6, - column: 5, + column: 3, }, { messageId: 'incorrectGroupOrder', @@ -3228,7 +3425,7 @@ const foo = class { rank: 'field', }, line: 7, - column: 5, + column: 3, }, { messageId: 'incorrectGroupOrder', @@ -3237,7 +3434,7 @@ const foo = class { rank: 'field', }, line: 8, - column: 5, + column: 3, }, { messageId: 'incorrectGroupOrder', @@ -3246,7 +3443,7 @@ const foo = class { rank: 'field', }, line: 9, - column: 5, + column: 3, }, { messageId: 'incorrectGroupOrder', @@ -3255,30 +3452,30 @@ const foo = class { rank: 'field', }, line: 10, - column: 5, + column: 3, }, ], }, { code: ` const foo = class { - private L() {} - public J() {} - public static G() {} - protected static H() {} - private static I() {} - protected K() {} - constructor() {} - public D: string = ""; - private static C: string = ""; - public static A: string; - private static C: string = ""; - protected static B: string = ""; - private F: string = ""; - protected static B: string = ""; - protected E: string = ""; -} - `, + private L() {} + public J() {} + public static G() {} + protected static H() {} + private static I() {} + protected K() {} + constructor() {} + public D: string = ''; + private static C: string = ''; + public static A: string; + private static C: string = ''; + protected static B: string = ''; + private F: string = ''; + protected static B: string = ''; + protected E: string = ''; +}; + `, options: [ { classExpressions: [ @@ -3298,7 +3495,7 @@ const foo = class { rank: 'private field', }, line: 12, - column: 5, + column: 3, }, { messageId: 'incorrectGroupOrder', @@ -3307,28 +3504,28 @@ const foo = class { rank: 'protected field', }, line: 15, - column: 5, + column: 3, }, ], }, { code: ` const foo = class { - public static G() {} - private static I() {} - public J() {} - protected static H() {} - private L() {} - protected K() {} - public D: string = ""; - constructor() {} - public static A: string; - protected static B: string = ""; - protected E: string = ""; - private static C: string = ""; - private F: string = ""; -} - `, + public static G() {} + private static I() {} + public J() {} + protected static H() {} + private L() {} + protected K() {} + public D: string = ''; + constructor() {} + public static A: string; + protected static B: string = ''; + protected E: string = ''; + private static C: string = ''; + private F: string = ''; +}; + `, options: [ { classExpressions: [ @@ -3351,7 +3548,7 @@ const foo = class { rank: 'public instance method', }, line: 6, - column: 5, + column: 3, }, { messageId: 'incorrectGroupOrder', @@ -3360,28 +3557,28 @@ const foo = class { rank: 'public field', }, line: 10, - column: 5, + column: 3, }, ], }, { code: ` const foo = class { - public J() {} - public static G() {} - public D: string = ""; - public static A: string = ""; - private L() {} - constructor() {} - protected K() {} - protected static H() {} - private static I() {} - protected static B: string = ""; - private static C: string = ""; - protected E: string = ""; - private F: string = ""; -} - `, + public J() {} + public static G() {} + public D: string = ''; + public static A: string = ''; + private L() {} + constructor() {} + protected K() {} + protected static H() {} + private static I() {} + protected static B: string = ''; + private static C: string = ''; + protected E: string = ''; + private F: string = ''; +}; + `, options: [ { default: [ @@ -3401,28 +3598,28 @@ const foo = class { rank: 'method', }, line: 8, - column: 5, + column: 3, }, ], }, { code: ` const foo = class { - public J() {} - private static I() {} - public static G() {} - protected static H() {} - protected K() {} - private L() {} - constructor() {} - public static A: string; - private F: string = ""; - protected static B: string = ""; - public D: string = ""; - private static C: string = ""; - protected E: string = ""; -} - `, + public J() {} + private static I() {} + public static G() {} + protected static H() {} + protected K() {} + private L() {} + constructor() {} + public static A: string; + private F: string = ''; + protected static B: string = ''; + public D: string = ''; + private static C: string = ''; + protected E: string = ''; +}; + `, options: [ { classExpressions: [ @@ -3444,7 +3641,7 @@ const foo = class { rank: 'private static method', }, line: 5, - column: 5, + column: 3, }, { messageId: 'incorrectGroupOrder', @@ -3453,29 +3650,28 @@ const foo = class { rank: 'private static method', }, line: 6, - column: 5, + column: 3, }, ], }, { code: ` const foo = class { - private static I() {} - protected static H() {} - protected static B: string = ""; - public static G() {} - public J() {} - protected K() {} - private static C: string = ""; - private L() {} - private F: string = ""; - protected E: string = ""; - public static A: string; - public D: string = ""; - constructor() {} - -} - `, + private static I() {} + protected static H() {} + protected static B: string = ''; + public static G() {} + public J() {} + protected K() {} + private static C: string = ''; + private L() {} + private F: string = ''; + protected E: string = ''; + public static A: string; + public D: string = ''; + constructor() {} +}; + `, options: [ { classExpressions: [ @@ -3492,29 +3688,28 @@ const foo = class { rank: 'protected static field', }, line: 10, - column: 5, + column: 3, }, ], }, { code: ` const foo = class { - private L() {} - private static I() {} - protected static H() {} - public static G() {} - protected static B: string = ""; - public J() {} - protected K() {} - private static C: string = ""; - private F: string = ""; - protected E: string = ""; - public static A: string; - public D: string = ""; - constructor() {} - -} - `, + private L() {} + private static I() {} + protected static H() {} + public static G() {} + protected static B: string = ''; + public J() {} + protected K() {} + private static C: string = ''; + private F: string = ''; + protected E: string = ''; + public static A: string; + public D: string = ''; + constructor() {} +}; + `, options: [ { default: ['public-instance-method', 'protected-static-field'], @@ -3528,20 +3723,20 @@ const foo = class { rank: 'protected static field', }, line: 8, - column: 5, + column: 3, }, ], }, { code: ` class Foo { - K = () => {} - A: string; - constructor () {} - [Z: string]: any; - J() {} + K = () => {}; + A: string; + constructor() {} + [Z: string]: any; + J() {} } - `, + `, errors: [ { messageId: 'incorrectGroupOrder', @@ -3550,7 +3745,7 @@ class Foo { rank: 'public instance method', }, line: 4, - column: 5, + column: 3, }, { messageId: 'incorrectGroupOrder', @@ -3559,7 +3754,7 @@ class Foo { rank: 'public instance method', }, line: 5, - column: 5, + column: 3, }, { messageId: 'incorrectGroupOrder', @@ -3568,20 +3763,20 @@ class Foo { rank: 'public instance method', }, line: 6, - column: 5, + column: 3, }, ], }, { code: ` class Foo { - J() {} - constructor () {} - K = () => {} - A: string; - [Z: string]: any; + J() {} + constructor() {} + K = () => {}; + A: string; + [Z: string]: any; } - `, + `, options: [{ default: ['method', 'constructor', 'field', 'signature'] }], errors: [ { @@ -3591,20 +3786,20 @@ class Foo { rank: 'constructor', }, line: 5, - column: 5, + column: 3, }, ], }, { code: ` class Foo { - J() {} - constructor () {} - K = () => {} - L: () => {} - A: string; + J() {} + constructor() {} + K = () => {}; + L: () => {}; + A: string; } - `, + `, options: [{ default: ['method', 'constructor', 'field'] }], errors: [ { @@ -3614,18 +3809,18 @@ class Foo { rank: 'constructor', }, line: 5, - column: 5, + column: 3, }, ], }, { code: ` interface Foo { - K: () => {} - J(); - A: string; + K: () => {}; + J(); + A: string; } - `, + `, errors: [ { messageId: 'incorrectGroupOrder', @@ -3634,18 +3829,18 @@ interface Foo { rank: 'method', }, line: 5, - column: 5, + column: 3, }, ], }, { code: ` type Foo = { - K: () => {} - J(); - A: string; -} - `, + K: () => {}; + J(); + A: string; +}; + `, errors: [ { messageId: 'incorrectGroupOrder', @@ -3654,18 +3849,18 @@ type Foo = { rank: 'method', }, line: 5, - column: 5, + column: 3, }, ], }, { code: ` type Foo = { - A: string; - K: () => {} - J(); -} - `, + A: string; + K: () => {}; + J(); +}; + `, options: [{ default: ['method', 'constructor', 'field'] }], errors: [ { @@ -3675,17 +3870,17 @@ type Foo = { rank: 'field', }, line: 5, - column: 5, + column: 3, }, ], }, { code: ` abstract class Foo { - abstract A(): void; - B: string; + abstract A(): void; + B: string; } - `, + `, errors: [ { messageId: 'incorrectGroupOrder', @@ -3694,17 +3889,17 @@ abstract class Foo { rank: 'public abstract method', }, line: 4, - column: 5, + column: 3, }, ], }, { code: ` abstract class Foo { - abstract A: () => {}; - B: string; + abstract A: () => {}; + B: string; } - `, + `, errors: [ { messageId: 'incorrectGroupOrder', @@ -3713,20 +3908,20 @@ abstract class Foo { rank: 'public abstract field', }, line: 4, - column: 5, + column: 3, }, ], }, { code: ` abstract class Foo { - abstract A: () => {}; - B: string; - public C() {}; - private D() {}; - abstract E() {}; + abstract A: () => {}; + B: string; + public C() {} + private D() {} + abstract E() {} } - `, + `, errors: [ { messageId: 'incorrectGroupOrder', @@ -3735,19 +3930,19 @@ abstract class Foo { rank: 'public abstract field', }, line: 4, - column: 5, + column: 3, }, ], }, { code: ` class Foo { - C: number; - [A:string]: number; - public static D(): {}; - private static [B:string]: number; + C: number; + [A: string]: number; + public static D(): {}; + private static [B: string]: number; } - `, + `, options: [ { default: [ @@ -3767,18 +3962,18 @@ class Foo { rank: 'signature', }, line: 5, - column: 5, + column: 3, }, ], }, { code: ` abstract class Foo { - abstract B: string; - abstract A(): void; - public C(): {}; + abstract B: string; + abstract A(): void; + public C(): {}; } - `, + `, options: [{ default: ['method', 'constructor', 'field'] }], errors: [ { @@ -3788,7 +3983,7 @@ abstract class Foo { rank: 'field', }, line: 4, - column: 5, + column: 3, }, { messageId: 'incorrectGroupOrder', @@ -3797,7 +3992,7 @@ abstract class Foo { rank: 'field', }, line: 5, - column: 5, + column: 3, }, ], }, @@ -3805,13 +4000,14 @@ abstract class Foo { code: ` // no accessibility === public class Foo { - B: string; - @Dec() A: string = ""; - C: string = ""; - constructor() {} - D() {} - E() {} -} `, + B: string; + @Dec() A: string = ''; + C: string = ''; + constructor() {} + D() {} + E() {} +} + `, options: [{ default: ['decorated-field', 'field'] }], errors: [ { @@ -3821,18 +4017,19 @@ class Foo { rank: 'field', }, line: 5, - column: 5, + column: 3, }, ], }, { code: ` class Foo { - A() {} + A() {} - @Decorator() - B() {} -} `, + @Decorator() + B() {} +} + `, options: [{ default: ['decorated-method', 'method'] }], errors: [ { @@ -3842,16 +4039,17 @@ class Foo { rank: 'method', }, line: 5, // Symbol starts at the line with decorator - column: 5, + column: 3, }, ], }, { code: ` class Foo { - @Decorator() C() {} - A() {} -} `, + @Decorator() C() {} + A() {} +} + `, options: [{ default: ['public-method', 'decorated-method'] }], errors: [ { @@ -3861,19 +4059,20 @@ class Foo { rank: 'decorated method', }, line: 4, - column: 5, + column: 3, }, ], }, { code: ` class Foo { - A(): void; - B(): void; - private C() {} - constructor() {} - @Dec() private D() {} -} `, + A(): void; + B(): void; + private C() {} + constructor() {} + @Dec() private D() {} +} + `, options: [ { classes: ['public-method', 'decorated-method', 'private-method'], @@ -3887,21 +4086,22 @@ class Foo { rank: 'private method', }, line: 7, - column: 5, + column: 3, }, ], }, { code: ` class Foo { - A: string; - get B() {} - constructor() {} - set B() {} - get C() {} - set C() {} - D(): void; -} `, + A: string; + get B() {} + constructor() {} + set B() {} + get C() {} + set C() {} + D(): void; +} + `, options: [ { default: ['field', 'constructor', ['get', 'set'], 'method'], @@ -3915,20 +4115,21 @@ class Foo { rank: 'get, set', }, line: 5, - column: 5, + column: 3, }, ], }, { code: ` class Foo { - A: string; - private C(): void; - constructor() {} - @Dec() private B: string; - set D() {} - E(): void; -} `, + A: string; + private C(): void; + constructor() {} + @Dec() private B: string; + set D() {} + E(): void; +} + `, options: [ { default: [ @@ -3947,21 +4148,22 @@ class Foo { rank: 'private decorated field, public set, private method', }, line: 5, - column: 5, + column: 3, }, ], }, { code: ` class Foo { - A: string; - constructor() {} - get B() {} - set B() {} - get C() {} - set C() {} - D(): void; -} `, + A: string; + constructor() {} + get B() {} + set B() {} + get C() {} + set C() {} + D(): void; +} + `, options: [ { default: ['field', 'constructor', 'get', ['set'], 'method'], @@ -3975,7 +4177,236 @@ class Foo { rank: 'set', }, line: 7, - column: 5, + column: 3, + }, + ], + }, + { + code: ` +class Foo { + static {} + m() {} + f = 1; +} + `, + dependencyConstraints: { + typescript: '4.4', + }, + options: [{ default: ['method', 'field', 'static-initialization'] }], + errors: [ + { + messageId: 'incorrectGroupOrder', + data: { + name: 'm', + rank: 'static initialization', + }, + line: 4, + column: 3, + }, + { + messageId: 'incorrectGroupOrder', + data: { + name: 'f', + rank: 'static initialization', + }, + line: 5, + column: 3, + }, + ], + }, + { + code: ` +class Foo { + m() {} + f = 1; + static {} +} + `, + dependencyConstraints: { + typescript: '4.4', + }, + options: [{ default: ['static-initialization', 'method', 'field'] }], + errors: [ + { + messageId: 'incorrectGroupOrder', + data: { + name: 'static block', + rank: 'method', + }, + line: 5, + column: 3, + }, + ], + }, + { + code: ` +class Foo { + f = 1; + static {} + m() {} +} + `, + dependencyConstraints: { + typescript: '4.4', + }, + options: [{ default: ['static-initialization', 'field', 'method'] }], + errors: [ + { + messageId: 'incorrectGroupOrder', + data: { + name: 'static block', + rank: 'field', + }, + line: 4, + column: 3, + }, + ], + }, + { + code: ` +class Foo { + static {} + f = 1; + m() {} +} + `, + dependencyConstraints: { + typescript: '4.4', + }, + options: [{ default: ['field', 'static-initialization', 'method'] }], + errors: [ + { + messageId: 'incorrectGroupOrder', + data: { + name: 'f', + rank: 'static initialization', + }, + line: 4, + column: 3, + }, + ], + }, + { + code: ` +class Foo { + private mp() {} + static {} + public m() {} + @dec + md() {} +} + `, + dependencyConstraints: { + typescript: '4.4', + }, + options: [ + { default: ['decorated-method', 'static-initialization', 'method'] }, + ], + errors: [ + { + messageId: 'incorrectGroupOrder', + data: { + name: 'static block', + rank: 'method', + }, + line: 4, + column: 3, + }, + { + messageId: 'incorrectGroupOrder', + data: { + name: 'md', + rank: 'method', + }, + line: 6, + column: 3, + }, + ], + }, + { + name: 'with private identifier', + code: ` +// no accessibility === public +class Foo { + #imPrivate() {} + imPublic() {} +} + `, + options: [ + { + default: { + memberTypes: ['public-method', '#private-method'], + order: 'alphabetically-case-insensitive', + }, + }, + ], + errors: [ + { + messageId: 'incorrectGroupOrder', + data: { + name: 'imPublic', + rank: '#private method', + }, + line: 5, + column: 3, + }, + ], + }, + { + name: 'private and #private member order', + code: ` +// no accessibility === public +class Foo { + #imPrivate() {} + private imPrivate() {} +} + `, + options: [ + { + default: { + memberTypes: ['private-method', '#private-method'], + order: 'alphabetically-case-insensitive', + }, + }, + ], + errors: [ + { + messageId: 'incorrectGroupOrder', + data: { + name: 'imPrivate', + rank: '#private method', + }, + line: 5, + column: 3, + }, + ], + }, + { + name: '#private and private member order', + code: ` +// no accessibility === public +class Foo { + private imPrivate() {} + #imPrivate() {} +} + `, + options: [ + { + default: { + memberTypes: ['#private-method', 'private-method'], + order: 'alphabetically-case-insensitive', + }, + }, + ], + errors: [ + { + messageId: 'incorrectGroupOrder', + data: { + name: 'imPrivate', + rank: 'private method', + }, + line: 5, + column: 3, }, ], }, diff --git a/packages/eslint-plugin/tests/rules/member-ordering-alphabetically-case-insensitive-order.test.ts b/packages/eslint-plugin/tests/rules/member-ordering/member-ordering-alphabetically-case-insensitive-order.test.ts similarity index 76% rename from packages/eslint-plugin/tests/rules/member-ordering-alphabetically-case-insensitive-order.test.ts rename to packages/eslint-plugin/tests/rules/member-ordering/member-ordering-alphabetically-case-insensitive-order.test.ts index 24907a8d8f4..fd10c55fe91 100644 --- a/packages/eslint-plugin/tests/rules/member-ordering-alphabetically-case-insensitive-order.test.ts +++ b/packages/eslint-plugin/tests/rules/member-ordering/member-ordering-alphabetically-case-insensitive-order.test.ts @@ -1,25 +1,22 @@ -import rule, { - defaultOrder, - MessageIds, - Options, -} from '../../src/rules/member-ordering'; -import { RuleTester } from '../RuleTester'; -import { TSESLint } from '@typescript-eslint/utils'; +import type { MessageIds, Options } from '../../../src/rules/member-ordering'; +import rule, { defaultOrder } from '../../../src/rules/member-ordering'; +import type { RunTests } from '../../RuleTester'; +import { RuleTester } from '../../RuleTester'; const ruleTester = new RuleTester({ parser: '@typescript-eslint/parser', }); -const sortedCiWithoutGrouping: TSESLint.RunTests = { +const sortedCiWithoutGrouping: RunTests = { valid: [ // default option + interface + lower/upper case { code: ` interface Foo { - a : b; - B : b; + a: b; + B: b; } - `, + `, options: [ { default: { @@ -34,10 +31,10 @@ interface Foo { { code: ` type Foo = { - a : b; - B : b; -} - `, + a: b; + B: b; +}; + `, options: [ { default: { @@ -52,10 +49,10 @@ type Foo = { { code: ` class Foo { - public static a : string; - public static B : string; + public static a: string; + public static B: string; } - `, + `, options: [ { default: { @@ -70,10 +67,10 @@ class Foo { { code: ` const foo = class Foo { - public static a : string; - public static B : string; -} - `, + public static a: string; + public static B: string; +}; + `, options: [ { default: { @@ -88,11 +85,11 @@ const foo = class Foo { { code: ` class Foo { - public static a : string; - @Dec() static B : string; - public static c : string; + public static a: string; + @Dec() static B: string; + public static c: string; } - `, + `, options: [ { default: { @@ -108,11 +105,11 @@ class Foo { { code: ` interface Foo { - c : string; - B : string; - a : string; + c: string; + B: string; + a: string; } - `, + `, options: [ { default: { @@ -143,10 +140,10 @@ interface Foo { { code: ` interface Foo { - B : b; - a : b; + B: b; + a: b; } - `, + `, options: [ { default: { @@ -170,10 +167,10 @@ interface Foo { { code: ` type Foo = { - B : b; - a : b; -} - `, + B: b; + a: b; +}; + `, options: [ { default: { @@ -197,10 +194,10 @@ type Foo = { { code: ` class Foo { - public static B : string; - public static a : string; + public static B: string; + public static a: string; } - `, + `, options: [ { default: { @@ -224,10 +221,10 @@ class Foo { { code: ` const foo = class Foo { - public static B : string; - public static a : string; -} - `, + public static B: string; + public static a: string; +}; + `, options: [ { default: { @@ -249,27 +246,27 @@ const foo = class Foo { ], }; -const sortedCiWithGrouping: TSESLint.RunTests = { +const sortedCiWithGrouping: RunTests = { valid: [ // default option + interface + default order + alphabetically { code: ` interface Foo { - [a: string] : number; + [a: string]: number; - () : Baz; + (): Baz; - a : x; - B : x; - c : x; + a: x; + B: x; + c: x; - new () : Bar; + new (): Bar; - a() : void; - B() : void; - c() : void; + a(): void; + B(): void; + c(): void; } - `, + `, options: [ { default: { @@ -284,20 +281,20 @@ interface Foo { { code: ` interface Foo { - new () : Bar; + new (): Bar; - a() : void; - B() : void; - c() : void; + a(): void; + B(): void; + c(): void; - a : x; - B : x; - c : x; + a: x; + B: x; + c: x; - [a: string] : number; - () : Baz; + [a: string]: number; + (): Baz; } - `, + `, options: [ { default: { @@ -312,21 +309,21 @@ interface Foo { { code: ` type Foo = { - [a: string] : number; + [a: string]: number; - () : Baz; + (): Baz; - a : x; - B : x; - c : x; + a: x; + B: x; + c: x; - new () : Bar; + new (): Bar; - a() : void; - B() : void; - c() : void; -} - `, + a(): void; + B(): void; + c(): void; +}; + `, options: [ { default: { @@ -341,21 +338,21 @@ type Foo = { { code: ` type Foo = { - [a: string] : number; + [a: string]: number; - new () : Bar; + new (): Bar; - a() : void; - B() : void; - c() : void; + a(): void; + B(): void; + c(): void; - a : x; - B : x; - c : x; + a: x; + B: x; + c: x; - () : Baz; -} - `, + (): Baz; +}; + `, options: [ { default: { @@ -371,16 +368,16 @@ type Foo = { code: ` class Foo { public static a: string; - protected static b: string = ""; - private static c: string = ""; + protected static b: string = ''; + private static c: string = ''; - public d: string = ""; - protected E: string = ""; - private f: string = ""; + public d: string = ''; + protected E: string = ''; + private f: string = ''; constructor() {} } - `, + `, options: [ { default: { @@ -395,20 +392,20 @@ class Foo { code: ` class Foo { public static a: string; - protected static b: string = ""; - private static c: string = ""; + protected static b: string = ''; + private static c: string = ''; @Dec() public d: string; @Dec() protected E: string; @Dec() private f: string; - public g: string = ""; - protected h: string = ""; - private i: string = ""; + public g: string = ''; + protected h: string = ''; + private i: string = ''; constructor() {} } - `, + `, options: [ { default: { @@ -425,15 +422,15 @@ class Foo { class Foo { constructor() {} - public d: string = ""; - protected E: string = ""; - private f: string = ""; + public d: string = ''; + protected E: string = ''; + private f: string = ''; public static a: string; - protected static b: string = ""; - private static c: string = ""; + protected static b: string = ''; + private static c: string = ''; } - `, + `, options: [ { default: { @@ -449,16 +446,16 @@ class Foo { code: ` const foo = class Foo { public static a: string; - protected static b: string = ""; - private static c: string = ""; + protected static b: string = ''; + private static c: string = ''; - public d: string = ""; - protected E: string = ""; - private f: string = ""; + public d: string = ''; + protected E: string = ''; + private f: string = ''; constructor() {} -} - `, +}; + `, options: [ { default: { @@ -475,15 +472,15 @@ const foo = class Foo { const foo = class Foo { constructor() {} - public d: string = ""; - protected E: string = ""; - private f: string = ""; + public d: string = ''; + protected E: string = ''; + private f: string = ''; public static a: string; - protected static b: string = ""; - private static c: string = ""; -} - `, + protected static b: string = ''; + private static c: string = ''; +}; + `, options: [ { default: { @@ -493,27 +490,48 @@ const foo = class Foo { }, ], }, + + // default option + static blocks; should always be valid + { + code: ` +class Foo { + static {} + static {} +} + `, + dependencyConstraints: { + typescript: '4.4', + }, + options: [ + { + default: { + memberTypes: 'never', + order: 'alphabetically-case-insensitive', + }, + }, + ], + }, ], invalid: [ // default option + interface + wrong order within group and wrong group order + alphabetically { code: ` interface Foo { - [a: string] : number; + [a: string]: number; - a : x; - B : x; - c : x; + a: x; + B: x; + c: x; - c() : void; - B() : void; - a() : void; + c(): void; + B(): void; + a(): void; - () : Baz; + (): Baz; - new () : Bar; + new (): Bar; } - `, + `, options: [ { default: { @@ -544,21 +562,21 @@ interface Foo { { code: ` type Foo = { - [a: string] : number; + [a: string]: number; - a : x; - B : x; - c : x; + a: x; + B: x; + c: x; - c() : void; - B() : void; - a() : void; + c(): void; + B(): void; + a(): void; - () : Baz; + (): Baz; - new () : Bar; -} - `, + new (): Bar; +}; + `, options: [ { default: { @@ -589,15 +607,15 @@ type Foo = { { code: ` class Foo { - public static c: string = ""; - public static B: string = ""; + public static c: string = ''; + public static B: string = ''; public static a: string; constructor() {} - public d: string = ""; + public d: string = ''; } - `, + `, options: [ { default: { @@ -621,15 +639,15 @@ class Foo { { code: ` const foo = class Foo { - public static c: string = ""; - public static B: string = ""; + public static c: string = ''; + public static B: string = ''; public static a: string; constructor() {} - public d: string = ""; -} - `, + public d: string = ''; +}; + `, options: [ { default: { diff --git a/packages/eslint-plugin/tests/rules/member-ordering-alphabetically-order.test.ts b/packages/eslint-plugin/tests/rules/member-ordering/member-ordering-alphabetically-order.test.ts similarity index 60% rename from packages/eslint-plugin/tests/rules/member-ordering-alphabetically-order.test.ts rename to packages/eslint-plugin/tests/rules/member-ordering/member-ordering-alphabetically-order.test.ts index dfd5f0de83c..338b3a50ee9 100644 --- a/packages/eslint-plugin/tests/rules/member-ordering-alphabetically-order.test.ts +++ b/packages/eslint-plugin/tests/rules/member-ordering/member-ordering-alphabetically-order.test.ts @@ -1,18 +1,12 @@ -import rule, { - defaultOrder, - MessageIds, - Options, -} from '../../src/rules/member-ordering'; -import { RuleTester } from '../RuleTester'; -import { TSESLint } from '@typescript-eslint/utils'; +import type { MessageIds, Options } from '../../../src/rules/member-ordering'; +import rule, { defaultOrder } from '../../../src/rules/member-ordering'; +import type { RunTests } from '../../RuleTester'; +import { RuleTester } from '../../RuleTester'; const ruleTester = new RuleTester({ parser: '@typescript-eslint/parser', }); -const sortedWithoutGroupingDefaultOption: TSESLint.RunTests< - MessageIds, - Options -> = { +const sortedWithoutGroupingDefaultOption: RunTests = { valid: [ // default option + interface + multiple types { @@ -22,7 +16,7 @@ interface Foo { a(): Foo; b(): Foo; } - `, + `, options: [ { default: { memberTypes: defaultOrder, order: 'alphabetically' } }, ], @@ -32,10 +26,10 @@ interface Foo { { code: ` interface Foo { - A : b; - a : b; + A: b; + a: b; } - `, + `, options: [{ default: { memberTypes: 'never', order: 'alphabetically' } }], }, @@ -43,10 +37,10 @@ interface Foo { { code: ` interface Foo { - a1 : b; - aa : b; + a1: b; + aa: b; } - `, + `, options: [{ default: { memberTypes: 'never', order: 'alphabetically' } }], }, @@ -54,11 +48,11 @@ interface Foo { { code: ` interface Foo { - a : Foo; - 'b.c' : Foo; - "b.d" : Foo; + a: Foo; + 'b.c': Foo; + 'b.d': Foo; } - `, + `, options: [{ default: { order: 'alphabetically' } }], }, @@ -66,13 +60,13 @@ interface Foo { { code: ` type Foo = { - a : b; - [a: string] : number; - b() : void; - () : Baz; - new () : Bar; -} - `, + a: b; + [a: string]: number; + b(): void; + (): Baz; + new (): Bar; +}; + `, options: [{ default: { memberTypes: 'never', order: 'alphabetically' } }], }, @@ -80,10 +74,10 @@ type Foo = { { code: ` type Foo = { - A : b; - a : b; -} - `, + A: b; + a: b; +}; + `, options: [{ default: { memberTypes: 'never', order: 'alphabetically' } }], }, @@ -91,10 +85,10 @@ type Foo = { { code: ` type Foo = { - a1 : b; - aa : b; -} - `, + a1: b; + aa: b; +}; + `, options: [{ default: { memberTypes: 'never', order: 'alphabetically' } }], }, @@ -102,11 +96,11 @@ type Foo = { { code: ` type Foo = { - a : Foo; - 'b.c' : Foo; - "b.d" : Foo; -} - `, + a: Foo; + 'b.c': Foo; + 'b.d': Foo; +}; + `, options: [{ default: { order: 'alphabetically' } }], }, @@ -114,17 +108,17 @@ type Foo = { { code: ` class Foo { - public static a : string; - protected static b : string = ""; - private static c : string = ""; + public static a: string; + protected static b: string = ''; + private static c: string = ''; constructor() {} @Dec() d: string; - public e : string = ""; - @Dec() f : string = ""; - protected g : string = ""; - private h : string = ""; + public e: string = ''; + @Dec() f: string = ''; + protected g: string = ''; + private h: string = ''; } - `, + `, options: [{ default: { memberTypes: 'never', order: 'alphabetically' } }], }, @@ -132,10 +126,10 @@ class Foo { { code: ` class Foo { - public static A : string; - public static a : string; + public static A: string; + public static a: string; } - `, + `, options: [{ default: { memberTypes: 'never', order: 'alphabetically' } }], }, @@ -143,10 +137,10 @@ class Foo { { code: ` class Foo { - public static a1 : string; - public static aa : string; + public static a1: string; + public static aa: string; } - `, + `, options: [{ default: { memberTypes: 'never', order: 'alphabetically' } }], }, @@ -154,15 +148,15 @@ class Foo { { code: ` const foo = class Foo { - public static a : string; - protected static b : string = ""; - private static c : string = ""; + public static a: string; + protected static b: string = ''; + private static c: string = ''; constructor() {} - public d : string = ""; - protected e : string = ""; - private f : string = ""; -} - `, + public d: string = ''; + protected e: string = ''; + private f: string = ''; +}; + `, options: [{ default: { memberTypes: 'never', order: 'alphabetically' } }], }, @@ -170,10 +164,10 @@ const foo = class Foo { { code: ` const foo = class Foo { - public static A : string; - public static a : string; -} - `, + public static A: string; + public static a: string; +}; + `, options: [{ default: { memberTypes: 'never', order: 'alphabetically' } }], }, @@ -181,10 +175,10 @@ const foo = class Foo { { code: ` const foo = class Foo { - public static a1 : string; - public static aa : string; -} - `, + public static a1: string; + public static aa: string; +}; + `, options: [{ default: { memberTypes: 'never', order: 'alphabetically' } }], }, @@ -192,11 +186,11 @@ const foo = class Foo { { code: ` class Foo { - public static a : string; - @Dec() static b : string; - public static c : string; + public static a: string; + @Dec() static b: string; + public static c: string; } - `, + `, options: [{ default: { memberTypes: 'never', order: 'alphabetically' } }], }, @@ -219,13 +213,13 @@ class Foo { { code: ` interface Foo { - b() : void; - a : b; - [a: string] : number; - new () : Bar; - () : Baz; + b(): void; + a: b; + [a: string]: number; + new (): Bar; + (): Baz; } - `, + `, options: [{ default: { memberTypes: 'never', order: 'alphabetically' } }], errors: [ { @@ -249,11 +243,11 @@ interface Foo { { code: ` interface Foo { - "b.d" : Foo; - 'b.c' : Foo; - a : Foo; + 'b.d': Foo; + 'b.c': Foo; + a: Foo; } - `, + `, options: [{ default: { order: 'alphabetically' } }], errors: [ { @@ -277,11 +271,11 @@ interface Foo { { code: ` interface Foo { - c : string; - b : string; - a : string; + c: string; + b: string; + a: string; } - `, + `, options: [{ default: { memberTypes: 'never', order: 'alphabetically' } }], errors: [ { @@ -305,13 +299,13 @@ interface Foo { { code: ` type Foo = { - b() : void; - a : b; - [a: string] : number; - new () : Bar; - () : Baz; -} - `, + b(): void; + a: b; + [a: string]: number; + new (): Bar; + (): Baz; +}; + `, options: [{ default: { memberTypes: 'never', order: 'alphabetically' } }], errors: [ { @@ -335,11 +329,11 @@ type Foo = { { code: ` type Foo = { - "b.d" : Foo; - 'b.c' : Foo; - a : Foo; -} - `, + 'b.d': Foo; + 'b.c': Foo; + a: Foo; +}; + `, options: [{ default: { order: 'alphabetically' } }], errors: [ { @@ -363,11 +357,11 @@ type Foo = { { code: ` type Foo = { - c : string; - b : string; - a : string; -} - `, + c: string; + b: string; + a: string; +}; + `, options: [{ default: { memberTypes: 'never', order: 'alphabetically' } }], errors: [ { @@ -391,15 +385,15 @@ type Foo = { { code: ` class Foo { - protected static b : string = ""; - public static a : string; - private static c : string = ""; + protected static b: string = ''; + public static a: string; + private static c: string = ''; constructor() {} - public d : string = ""; - protected e : string = ""; - private f : string = ""; + public d: string = ''; + protected e: string = ''; + private f: string = ''; } - `, + `, options: [{ default: { memberTypes: 'never', order: 'alphabetically' } }], errors: [ { @@ -420,7 +414,7 @@ class Foo { public static b: string; public static a: string; } - `, + `, options: [{ default: { memberTypes: 'never', order: 'alphabetically' } }], errors: [ { @@ -444,15 +438,15 @@ class Foo { { code: ` const foo = class Foo { - protected static b : string = ""; - public static a : string; - private static c : string = ""; + protected static b: string = ''; + public static a: string; + private static c: string = ''; constructor() {} - public d : string = ""; - protected e : string = ""; - private f : string = ""; -} - `, + public d: string = ''; + protected e: string = ''; + private f: string = ''; +}; + `, options: [{ default: { memberTypes: 'never', order: 'alphabetically' } }], errors: [ { @@ -472,8 +466,8 @@ const foo = class Foo { public static c: string; public static b: string; public static a: string; -} - `, +}; + `, options: [{ default: { memberTypes: 'never', order: 'alphabetically' } }], errors: [ { @@ -495,22 +489,19 @@ const foo = class Foo { ], }; -const sortedWithoutGroupingClassesOption: TSESLint.RunTests< - MessageIds, - Options -> = { +const sortedWithoutGroupingClassesOption: RunTests = { valid: [ // classes option + interface + multiple types --> Only member group order is checked (default config) { code: ` interface Foo { - [a: string] : number; - () : Baz; - c : b; - new () : Bar; - b() : void; + [a: string]: number; + (): Baz; + c: b; + new (): Bar; + b(): void; } - `, + `, options: [{ classes: { memberTypes: 'never', order: 'alphabetically' } }], }, @@ -518,10 +509,10 @@ interface Foo { { code: ` interface Foo { - a : b; - A : b; + a: b; + A: b; } - `, + `, options: [{ classes: { memberTypes: 'never', order: 'alphabetically' } }], }, @@ -529,10 +520,10 @@ interface Foo { { code: ` interface Foo { - aa : b; - a1 : b; + aa: b; + a1: b; } - `, + `, options: [{ classes: { memberTypes: 'never', order: 'alphabetically' } }], }, @@ -540,13 +531,13 @@ interface Foo { { code: ` type Foo = { - [a: string] : number; - () : Baz; - c : b; - new () : Bar; - b() : void; -} - `, + [a: string]: number; + (): Baz; + c: b; + new (): Bar; + b(): void; +}; + `, options: [{ classes: { memberTypes: 'never', order: 'alphabetically' } }], }, @@ -554,10 +545,10 @@ type Foo = { { code: ` type Foo = { - a : b; - A : b; -} - `, + a: b; + A: b; +}; + `, options: [{ classes: { memberTypes: 'never', order: 'alphabetically' } }], }, @@ -565,10 +556,10 @@ type Foo = { { code: ` type Foo = { - aa : b; - a1 : b; -} - `, + aa: b; + a1: b; +}; + `, options: [{ classes: { memberTypes: 'never', order: 'alphabetically' } }], }, @@ -576,16 +567,16 @@ type Foo = { { code: ` class Foo { - public static a : string; - protected static b : string = ""; - @Dec() private static c : string = ""; + public static a: string; + protected static b: string = ''; + @Dec() private static c: string = ''; constructor() {} - public d : string = ""; - protected e : string = ""; + public d: string = ''; + protected e: string = ''; @Dec() - private f : string = ""; + private f: string = ''; } - `, + `, options: [{ classes: { memberTypes: 'never', order: 'alphabetically' } }], }, @@ -593,10 +584,10 @@ class Foo { { code: ` class Foo { - public static A : string; - public static a : string; + public static A: string; + public static a: string; } - `, + `, options: [{ classes: { memberTypes: 'never', order: 'alphabetically' } }], }, @@ -604,10 +595,10 @@ class Foo { { code: ` class Foo { - public static a1 : string; - public static aa : string; + public static a1: string; + public static aa: string; } - `, + `, options: [{ classes: { memberTypes: 'never', order: 'alphabetically' } }], }, @@ -615,15 +606,15 @@ class Foo { { code: ` const foo = class Foo { - public static a : string; - protected static b : string = ""; - private static c : string = ""; - public d : string = ""; - protected e : string = ""; - private f : string = ""; + public static a: string; + protected static b: string = ''; + private static c: string = ''; + public d: string = ''; + protected e: string = ''; + private f: string = ''; constructor() {} -} - `, +}; + `, options: [{ classes: { memberTypes: 'never', order: 'alphabetically' } }], }, @@ -631,10 +622,10 @@ const foo = class Foo { { code: ` const foo = class Foo { - public static a : string; - public static A : string; -} - `, + public static a: string; + public static A: string; +}; + `, options: [{ classes: { memberTypes: 'never', order: 'alphabetically' } }], }, @@ -642,10 +633,10 @@ const foo = class Foo { { code: ` const foo = class Foo { - public static aa : string; - public static a1 : string; -} - `, + public static aa: string; + public static a1: string; +}; + `, options: [{ classes: { memberTypes: 'never', order: 'alphabetically' } }], }, ], @@ -654,15 +645,15 @@ const foo = class Foo { { code: ` class Foo { - protected static b : string = ""; - public static a : string; - private static c : string = ""; + protected static b: string = ''; + public static a: string; + private static c: string = ''; constructor() {} - public d : string = ""; - protected e : string = ""; - private f : string = ""; + public d: string = ''; + protected e: string = ''; + private f: string = ''; } - `, + `, options: [{ classes: { memberTypes: 'never', order: 'alphabetically' } }], errors: [ { @@ -683,7 +674,7 @@ class Foo { public static b: string; public static a: string; } - `, + `, options: [{ classes: { memberTypes: 'never', order: 'alphabetically' } }], errors: [ { @@ -705,7 +696,7 @@ class Foo { ], }; -const sortedWithoutGroupingClassExpressionsOption: TSESLint.RunTests< +const sortedWithoutGroupingClassExpressionsOption: RunTests< MessageIds, Options > = { @@ -714,13 +705,13 @@ const sortedWithoutGroupingClassExpressionsOption: TSESLint.RunTests< { code: ` interface Foo { - [a: string] : number; - () : Baz; - c : b; - new () : Bar; - b() : void; + [a: string]: number; + (): Baz; + c: b; + new (): Bar; + b(): void; } - `, + `, options: [ { classExpressions: { memberTypes: 'never', order: 'alphabetically' } }, ], @@ -730,10 +721,10 @@ interface Foo { { code: ` interface Foo { - a : b; - A : b; + a: b; + A: b; } - `, + `, options: [ { classExpressions: { memberTypes: 'never', order: 'alphabetically' } }, ], @@ -743,10 +734,10 @@ interface Foo { { code: ` interface Foo { - aa : b; - a1 : b; + aa: b; + a1: b; } - `, + `, options: [ { classExpressions: { memberTypes: 'never', order: 'alphabetically' } }, ], @@ -756,13 +747,13 @@ interface Foo { { code: ` type Foo = { - [a: string] : number; - () : Baz; - c : b; - new () : Bar; - b() : void; -} - `, + [a: string]: number; + (): Baz; + c: b; + new (): Bar; + b(): void; +}; + `, options: [ { classExpressions: { memberTypes: 'never', order: 'alphabetically' } }, ], @@ -772,10 +763,10 @@ type Foo = { { code: ` type Foo = { - a : b; - A : b; -} - `, + a: b; + A: b; +}; + `, options: [ { classExpressions: { memberTypes: 'never', order: 'alphabetically' } }, ], @@ -785,10 +776,10 @@ type Foo = { { code: ` type Foo = { - aa : b; - a1 : b; -} - `, + aa: b; + a1: b; +}; + `, options: [ { classExpressions: { memberTypes: 'never', order: 'alphabetically' } }, ], @@ -798,15 +789,15 @@ type Foo = { { code: ` class Foo { - public static a : string; - protected static b : string = ""; - private static c : string = ""; - public d : string = ""; - protected e : string = ""; - private f : string = ""; + public static a: string; + protected static b: string = ''; + private static c: string = ''; + public d: string = ''; + protected e: string = ''; + private f: string = ''; constructor() {} } - `, + `, options: [ { classExpressions: { memberTypes: 'never', order: 'alphabetically' } }, ], @@ -816,10 +807,10 @@ class Foo { { code: ` class Foo { - public static a : string; - public static A : string; + public static a: string; + public static A: string; } - `, + `, options: [ { classExpressions: { memberTypes: 'never', order: 'alphabetically' } }, ], @@ -829,10 +820,10 @@ class Foo { { code: ` class Foo { - public static aa : string; - public static a1 : string; + public static aa: string; + public static a1: string; } - `, + `, options: [ { classExpressions: { memberTypes: 'never', order: 'alphabetically' } }, ], @@ -842,15 +833,15 @@ class Foo { { code: ` const foo = class Foo { - public static a : string; - protected static b : string = ""; - private static c : string = ""; + public static a: string; + protected static b: string = ''; + private static c: string = ''; constructor() {} - public d : string = ""; - protected e : string = ""; - private f : string = ""; -} - `, + public d: string = ''; + protected e: string = ''; + private f: string = ''; +}; + `, options: [ { classExpressions: { memberTypes: 'never', order: 'alphabetically' } }, ], @@ -860,10 +851,10 @@ const foo = class Foo { { code: ` const foo = class Foo { - public static A : string; - public static a : string; -} - `, + public static A: string; + public static a: string; +}; + `, options: [ { classExpressions: { memberTypes: 'never', order: 'alphabetically' } }, ], @@ -873,10 +864,10 @@ const foo = class Foo { { code: ` const foo = class Foo { - public static a1 : string; - public static aa : string; -} - `, + public static a1: string; + public static aa: string; +}; + `, options: [ { classExpressions: { memberTypes: 'never', order: 'alphabetically' } }, ], @@ -887,15 +878,15 @@ const foo = class Foo { { code: ` const foo = class Foo { - protected static b : string = ""; - public static a : string; - private static c : string = ""; + protected static b: string = ''; + public static a: string; + private static c: string = ''; constructor() {} - public d : string = ""; - protected e : string = ""; - private f : string = ""; -} - `, + public d: string = ''; + protected e: string = ''; + private f: string = ''; +}; + `, options: [ { classExpressions: { memberTypes: 'never', order: 'alphabetically' } }, ], @@ -917,8 +908,8 @@ const foo = class Foo { public static c: string; public static b: string; public static a: string; -} - `, +}; + `, options: [ { classExpressions: { memberTypes: 'never', order: 'alphabetically' } }, ], @@ -942,22 +933,19 @@ const foo = class Foo { ], }; -const sortedWithoutGroupingInterfacesOption: TSESLint.RunTests< - MessageIds, - Options -> = { +const sortedWithoutGroupingInterfacesOption: RunTests = { valid: [ // interfaces option + interface + multiple types { code: ` interface Foo { - [a: string] : number; - a : b; - b() : void; - () : Baz; - new () : Bar; + [a: string]: number; + a: b; + b(): void; + (): Baz; + new (): Bar; } - `, + `, options: [ { interfaces: { memberTypes: 'never', order: 'alphabetically' } }, ], @@ -967,10 +955,10 @@ interface Foo { { code: ` interface Foo { - A : b; - a : b; + A: b; + a: b; } - `, + `, options: [ { interfaces: { memberTypes: 'never', order: 'alphabetically' } }, ], @@ -980,10 +968,10 @@ interface Foo { { code: ` interface Foo { - a1 : b; - aa : b; + a1: b; + aa: b; } - `, + `, options: [ { interfaces: { memberTypes: 'never', order: 'alphabetically' } }, ], @@ -993,13 +981,13 @@ interface Foo { { code: ` type Foo = { - [a: string] : number; - () : Baz; - c : b; - new () : Bar; - b() : void; -} - `, + [a: string]: number; + (): Baz; + c: b; + new (): Bar; + b(): void; +}; + `, options: [ { interfaces: { memberTypes: 'never', order: 'alphabetically' } }, ], @@ -1009,10 +997,10 @@ type Foo = { { code: ` type Foo = { - a : b; - A : b; -} - `, + a: b; + A: b; +}; + `, options: [ { interfaces: { memberTypes: 'never', order: 'alphabetically' } }, ], @@ -1022,10 +1010,10 @@ type Foo = { { code: ` type Foo = { - aa : b; - a1 : b; -} - `, + aa: b; + a1: b; +}; + `, options: [ { interfaces: { memberTypes: 'never', order: 'alphabetically' } }, ], @@ -1035,15 +1023,15 @@ type Foo = { { code: ` class Foo { - public static a : string; - protected static b : string = ""; - private static c : string = ""; - public d : string = ""; - protected e : string = ""; - private f : string = ""; + public static a: string; + protected static b: string = ''; + private static c: string = ''; + public d: string = ''; + protected e: string = ''; + private f: string = ''; constructor() {} } - `, + `, options: [ { interfaces: { memberTypes: 'never', order: 'alphabetically' } }, ], @@ -1053,10 +1041,10 @@ class Foo { { code: ` class Foo { - public static a : string; - public static A : string; + public static a: string; + public static A: string; } - `, + `, options: [ { interfaces: { memberTypes: 'never', order: 'alphabetically' } }, ], @@ -1066,10 +1054,10 @@ class Foo { { code: ` class Foo { - public static aa : string; - public static a1 : string; + public static aa: string; + public static a1: string; } - `, + `, options: [ { interfaces: { memberTypes: 'never', order: 'alphabetically' } }, ], @@ -1079,15 +1067,15 @@ class Foo { { code: ` const foo = class Foo { - public static a : string; - protected static b : string = ""; - private static c : string = ""; - public d : string = ""; - protected e : string = ""; - private f : string = ""; + public static a: string; + protected static b: string = ''; + private static c: string = ''; + public d: string = ''; + protected e: string = ''; + private f: string = ''; constructor() {} -} - `, +}; + `, options: [ { interfaces: { memberTypes: 'never', order: 'alphabetically' } }, ], @@ -1097,10 +1085,10 @@ const foo = class Foo { { code: ` const foo = class Foo { - public static a : string; - public static A : string; -} - `, + public static a: string; + public static A: string; +}; + `, options: [ { interfaces: { memberTypes: 'never', order: 'alphabetically' } }, ], @@ -1110,10 +1098,10 @@ const foo = class Foo { { code: ` const foo = class Foo { - public static aa : string; - public static a1 : string; -} - `, + public static aa: string; + public static a1: string; +}; + `, options: [ { interfaces: { memberTypes: 'never', order: 'alphabetically' } }, ], @@ -1124,13 +1112,13 @@ const foo = class Foo { { code: ` interface Foo { - b() : void; - a : b; - [a: string] : number; - new () : Bar; - () : Baz; + b(): void; + a: b; + [a: string]: number; + new (): Bar; + (): Baz; } - `, + `, options: [ { interfaces: { memberTypes: 'never', order: 'alphabetically' } }, ], @@ -1156,11 +1144,11 @@ interface Foo { { code: ` interface Foo { - c : string; - b : string; - a : string; + c: string; + b: string; + a: string; } - `, + `, options: [ { interfaces: { memberTypes: 'never', order: 'alphabetically' } }, ], @@ -1184,22 +1172,19 @@ interface Foo { ], }; -const sortedWithoutGroupingTypeLiteralsOption: TSESLint.RunTests< - MessageIds, - Options -> = { +const sortedWithoutGroupingTypeLiteralsOption: RunTests = { valid: [ // typeLiterals option + interface + multiple types --> Only member group order is checked (default config) { code: ` interface Foo { - [a: string] : number; - () : Baz; - c : b; - new () : Bar; - b() : void; + [a: string]: number; + (): Baz; + c: b; + new (): Bar; + b(): void; } - `, + `, options: [ { typeLiterals: { memberTypes: 'never', order: 'alphabetically' } }, ], @@ -1209,10 +1194,10 @@ interface Foo { { code: ` interface Foo { - a : b; - A : b; + a: b; + A: b; } - `, + `, options: [ { typeLiterals: { memberTypes: 'never', order: 'alphabetically' } }, ], @@ -1222,10 +1207,10 @@ interface Foo { { code: ` interface Foo { - aa : b; - a1 : b; + aa: b; + a1: b; } - `, + `, options: [ { typeLiterals: { memberTypes: 'never', order: 'alphabetically' } }, ], @@ -1235,13 +1220,13 @@ interface Foo { { code: ` type Foo = { - [a: string] : number; - a : b; - b() : void; - () : Baz; - new () : Bar; -} - `, + [a: string]: number; + a: b; + b(): void; + (): Baz; + new (): Bar; +}; + `, options: [ { typeLiterals: { memberTypes: 'never', order: 'alphabetically' } }, ], @@ -1251,10 +1236,10 @@ type Foo = { { code: ` type Foo = { - A : b; - a : b; -} - `, + A: b; + a: b; +}; + `, options: [ { typeLiterals: { memberTypes: 'never', order: 'alphabetically' } }, ], @@ -1264,10 +1249,10 @@ type Foo = { { code: ` type Foo = { - a1 : b; - aa : b; -} - `, + a1: b; + aa: b; +}; + `, options: [ { typeLiterals: { memberTypes: 'never', order: 'alphabetically' } }, ], @@ -1277,15 +1262,15 @@ type Foo = { { code: ` class Foo { - public static a : string; - protected static b : string = ""; - private static c : string = ""; - public d : string = ""; - protected e : string = ""; - private f : string = ""; + public static a: string; + protected static b: string = ''; + private static c: string = ''; + public d: string = ''; + protected e: string = ''; + private f: string = ''; constructor() {} } - `, + `, options: [ { typeLiterals: { memberTypes: 'never', order: 'alphabetically' } }, ], @@ -1295,10 +1280,10 @@ class Foo { { code: ` class Foo { - public static a : string; - public static A : string; + public static a: string; + public static A: string; } - `, + `, options: [ { typeLiterals: { memberTypes: 'never', order: 'alphabetically' } }, ], @@ -1308,10 +1293,10 @@ class Foo { { code: ` class Foo { - public static aa : string; - public static a1 : string; + public static aa: string; + public static a1: string; } - `, + `, options: [ { typeLiterals: { memberTypes: 'never', order: 'alphabetically' } }, ], @@ -1321,15 +1306,15 @@ class Foo { { code: ` const foo = class Foo { - public static a : string; - protected static b : string = ""; - private static c : string = ""; - public d : string = ""; - protected e : string = ""; - private f : string = ""; + public static a: string; + protected static b: string = ''; + private static c: string = ''; + public d: string = ''; + protected e: string = ''; + private f: string = ''; constructor() {} -} - `, +}; + `, options: [ { typeLiterals: { memberTypes: 'never', order: 'alphabetically' } }, ], @@ -1339,10 +1324,10 @@ const foo = class Foo { { code: ` const foo = class Foo { - public static a : string; - public static A : string; -} - `, + public static a: string; + public static A: string; +}; + `, options: [ { typeLiterals: { memberTypes: 'never', order: 'alphabetically' } }, ], @@ -1352,10 +1337,10 @@ const foo = class Foo { { code: ` const foo = class Foo { - public static aa : string; - public static a1 : string; -} - `, + public static aa: string; + public static a1: string; +}; + `, options: [ { typeLiterals: { memberTypes: 'never', order: 'alphabetically' } }, ], @@ -1366,13 +1351,13 @@ const foo = class Foo { { code: ` type Foo = { - b() : void; - a : b; - [a: string] : number; - new () : Bar; - () : Baz; -} - `, + b(): void; + a: b; + [a: string]: number; + new (): Bar; + (): Baz; +}; + `, options: [ { typeLiterals: { memberTypes: 'never', order: 'alphabetically' } }, ], @@ -1398,11 +1383,11 @@ type Foo = { { code: ` type Foo = { - c : string; - b : string; - a : string; -} - `, + c: string; + b: string; + a: string; +}; + `, options: [ { typeLiterals: { memberTypes: 'never', order: 'alphabetically' } }, ], @@ -1426,145 +1411,144 @@ type Foo = { ], }; -const sortedWithGroupingDefaultOption: TSESLint.RunTests = - { - valid: [ - // default option + interface + default order + alphabetically - { - code: ` +const sortedWithGroupingDefaultOption: RunTests = { + valid: [ + // default option + interface + default order + alphabetically + { + code: ` interface Foo { - [a: string] : number; + [a: string]: number; - () : Baz; + (): Baz; - a : x; - b : x; - c : x; + a: x; + b: x; + c: x; - new () : Bar; + new (): Bar; - a() : void; - b() : void; - c() : void; + a(): void; + b(): void; + c(): void; } - `, - options: [ - { default: { memberTypes: defaultOrder, order: 'alphabetically' } }, - ], - }, + `, + options: [ + { default: { memberTypes: defaultOrder, order: 'alphabetically' } }, + ], + }, - // default option + interface + custom order + alphabetically - { - code: ` + // default option + interface + custom order + alphabetically + { + code: ` interface Foo { - new () : Bar; + new (): Bar; - a() : void; - b() : void; - c() : void; + a(): void; + b(): void; + c(): void; - a : x; - b : x; - c : x; + a: x; + b: x; + c: x; - [a: string] : number; - () : Baz; + [a: string]: number; + (): Baz; } - `, - options: [ - { - default: { - memberTypes: ['constructor', 'method', 'field'], - order: 'alphabetically', - }, + `, + options: [ + { + default: { + memberTypes: ['constructor', 'method', 'field'], + order: 'alphabetically', }, - ], - }, + }, + ], + }, - // default option + type literal + default order + alphabetically - { - code: ` + // default option + type literal + default order + alphabetically + { + code: ` type Foo = { - [a: string] : number; + [a: string]: number; - () : Baz; + (): Baz; - a : x; - b : x; - c : x; + a: x; + b: x; + c: x; - new () : Bar; + new (): Bar; - a() : void; - b() : void; - c() : void; -} - `, - options: [ - { default: { memberTypes: defaultOrder, order: 'alphabetically' } }, - ], - }, + a(): void; + b(): void; + c(): void; +}; + `, + options: [ + { default: { memberTypes: defaultOrder, order: 'alphabetically' } }, + ], + }, - // default option + type literal + custom order + alphabetically - { - code: ` + // default option + type literal + custom order + alphabetically + { + code: ` type Foo = { - [a: string] : number; + [a: string]: number; - new () : Bar; + new (): Bar; - a() : void; - b() : void; - c() : void; + a(): void; + b(): void; + c(): void; - a : x; - b : x; - c : x; + a: x; + b: x; + c: x; - () : Baz; -} - `, - options: [ - { - default: { - memberTypes: ['constructor', 'method', 'field'], - order: 'alphabetically', - }, + (): Baz; +}; + `, + options: [ + { + default: { + memberTypes: ['constructor', 'method', 'field'], + order: 'alphabetically', }, - ], - }, + }, + ], + }, - // default option + class + default order + alphabetically - { - code: ` + // default option + class + default order + alphabetically + { + code: ` class Foo { public static a: string; - protected static b: string = ""; - private static c: string = ""; + protected static b: string = ''; + private static c: string = ''; - public d: string = ""; - protected e: string = ""; - private f: string = ""; + public d: string = ''; + protected e: string = ''; + private f: string = ''; constructor() {} } - `, - options: [ - { default: { memberTypes: defaultOrder, order: 'alphabetically' } }, - ], - }, + `, + options: [ + { default: { memberTypes: defaultOrder, order: 'alphabetically' } }, + ], + }, - // default option + class + defaultOrder + alphabetically - { - code: ` + // default option + class + defaultOrder + alphabetically + { + code: ` class Foo { public static a: string; - protected static b: string = ""; - private static c: string = ""; + protected static b: string = ''; + private static c: string = ''; - public d: string = ""; - protected e: string = ""; - private f: string = ""; + public d: string = ''; + protected e: string = ''; + private f: string = ''; constructor() {} @@ -1572,20 +1556,20 @@ class Foo { set g() {} } - `, - options: [ - { - default: { - memberTypes: defaultOrder, - order: 'alphabetically', - }, + `, + options: [ + { + default: { + memberTypes: defaultOrder, + order: 'alphabetically', }, - ], - }, + }, + ], + }, - // default option + class + custom + alphabetically - { - code: ` + // default option + class + custom + alphabetically + { + code: ` class Foo { get a() {} @@ -1597,123 +1581,144 @@ class Foo { @Bar set d() {} } - `, - options: [ - { - default: { - memberTypes: ['get', 'decorated-get', 'set', 'decorated-set'], - order: 'alphabetically', - }, + `, + options: [ + { + default: { + memberTypes: ['get', 'decorated-get', 'set', 'decorated-set'], + order: 'alphabetically', }, - ], - }, + }, + ], + }, - // default option + class + decorators + default order + alphabetically - { - code: ` + // default option + class + decorators + default order + alphabetically + { + code: ` class Foo { public static a: string; - protected static b: string = ""; - private static c: string = ""; + protected static b: string = ''; + private static c: string = ''; @Dec() public d: string; @Dec() protected e: string; @Dec() private f: string; - public g: string = ""; - protected h: string = ""; - private i: string = ""; + public g: string = ''; + protected h: string = ''; + private i: string = ''; constructor() {} } - `, - options: [ - { default: { memberTypes: defaultOrder, order: 'alphabetically' } }, - ], - }, + `, + options: [ + { default: { memberTypes: defaultOrder, order: 'alphabetically' } }, + ], + }, - // default option + class + custom order + alphabetically - { - code: ` + // default option + class + custom order + alphabetically + { + code: ` class Foo { constructor() {} - public d: string = ""; - protected e: string = ""; - private f: string = ""; + public d: string = ''; + protected e: string = ''; + private f: string = ''; public static a: string; - protected static b: string = ""; - private static c: string = ""; + protected static b: string = ''; + private static c: string = ''; } - `, - options: [ - { - default: { - memberTypes: ['constructor', 'instance-field', 'static-field'], - order: 'alphabetically', - }, + `, + options: [ + { + default: { + memberTypes: ['constructor', 'instance-field', 'static-field'], + order: 'alphabetically', }, - ], - }, + }, + ], + }, - // default option + class expression + default order + alphabetically - { - code: ` + // default option + class expression + default order + alphabetically + { + code: ` const foo = class Foo { public static a: string; - protected static b: string = ""; - private static c: string = ""; + protected static b: string = ''; + private static c: string = ''; - public d: string = ""; - protected e: string = ""; - private f: string = ""; + public d: string = ''; + protected e: string = ''; + private f: string = ''; constructor() {} -} - `, - options: [ - { default: { memberTypes: defaultOrder, order: 'alphabetically' } }, - ], - }, +}; + `, + options: [ + { default: { memberTypes: defaultOrder, order: 'alphabetically' } }, + ], + }, - // default option + class expression + custom order + alphabetically - { - code: ` + // default option + class expression + custom order + alphabetically + { + code: ` const foo = class Foo { constructor() {} - public d: string = ""; - protected e: string = ""; - private f: string = ""; + public d: string = ''; + protected e: string = ''; + private f: string = ''; public static a: string; - protected static b: string = ""; - private static c: string = ""; -} - `, - options: [ - { - default: { - memberTypes: ['constructor', 'instance-field', 'static-field'], - order: 'alphabetically', - }, + protected static b: string = ''; + private static c: string = ''; +}; + `, + options: [ + { + default: { + memberTypes: ['constructor', 'instance-field', 'static-field'], + order: 'alphabetically', }, - ], + }, + ], + }, + + // default option + static blocks; should always be valid + { + code: ` +class Foo { + static {} + static {} +} + `, + dependencyConstraints: { + typescript: '4.4', }, - ], - invalid: [ - // default option + class + wrong order within group and wrong group order + alphabetically - { - code: ` + options: [ + { + default: { + memberTypes: 'never', + order: 'alphabetically', + }, + }, + ], + }, + ], + invalid: [ + // default option + class + wrong order within group and wrong group order + alphabetically + { + code: ` class FooTestGetter { public static a: string; - protected static b: string = ""; - private static c: string = ""; + protected static b: string = ''; + private static c: string = ''; - public d: string = ""; - protected e: string = ""; - private f: string = ""; + public d: string = ''; + protected e: string = ''; + private f: string = ''; get h() {} @@ -1721,29 +1726,29 @@ class FooTestGetter { constructor() {} } - `, - options: [ - { - default: { - memberTypes: defaultOrder, - order: 'alphabetically', - }, + `, + options: [ + { + default: { + memberTypes: defaultOrder, + order: 'alphabetically', }, - ], - errors: [ - { - messageId: 'incorrectGroupOrder', - data: { - name: 'constructor', - rank: 'public instance get', - }, + }, + ], + errors: [ + { + messageId: 'incorrectGroupOrder', + data: { + name: 'constructor', + rank: 'public instance get', }, - ], - }, + }, + ], + }, - // default option + class + custom + alphabetically - { - code: ` + // default option + class + custom + alphabetically + { + code: ` class Foo { @Bar get a() {} @@ -1755,44 +1760,44 @@ class Foo { set d() {} } - `, - options: [ - { - default: { - memberTypes: ['get', 'decorated-get', 'set', 'decorated-set'], - order: 'alphabetically', - }, + `, + options: [ + { + default: { + memberTypes: ['get', 'decorated-get', 'set', 'decorated-set'], + order: 'alphabetically', }, - ], - errors: [ - { - messageId: 'incorrectGroupOrder', - data: { - name: 'b', - rank: 'decorated get', - }, + }, + ], + errors: [ + { + messageId: 'incorrectGroupOrder', + data: { + name: 'b', + rank: 'decorated get', }, - { - messageId: 'incorrectGroupOrder', - data: { - name: 'd', - rank: 'decorated set', - }, + }, + { + messageId: 'incorrectGroupOrder', + data: { + name: 'd', + rank: 'decorated set', }, - ], - }, + }, + ], + }, - // default option + class + wrong order within group and wrong group order + alphabetically - { - code: ` + // default option + class + wrong order within group and wrong group order + alphabetically + { + code: ` class FooTestGetter { public static a: string; - protected static b: string = ""; - private static c: string = ""; + protected static b: string = ''; + private static c: string = ''; - public d: string = ""; - protected e: string = ""; - private f: string = ""; + public d: string = ''; + protected e: string = ''; + private f: string = ''; set g() {} @@ -1800,489 +1805,341 @@ class FooTestGetter { get h() {} } - `, - options: [ - { - default: { - memberTypes: defaultOrder, - order: 'alphabetically', - }, + `, + options: [ + { + default: { + memberTypes: defaultOrder, + order: 'alphabetically', }, - ], - errors: [ - { - messageId: 'incorrectGroupOrder', - data: { - name: 'constructor', - rank: 'public instance set', - }, + }, + ], + errors: [ + { + messageId: 'incorrectGroupOrder', + data: { + name: 'constructor', + rank: 'public instance set', }, - { - messageId: 'incorrectGroupOrder', - data: { - name: 'h', - rank: 'public instance set', - }, + }, + { + messageId: 'incorrectGroupOrder', + data: { + name: 'h', + rank: 'public instance set', }, - ], - }, + }, + ], + }, - // default option + interface + wrong order within group and wrong group order + alphabetically - { - code: ` + // default option + interface + wrong order within group and wrong group order + alphabetically + { + code: ` interface Foo { - [a: string] : number; + [a: string]: number; - a : x; - b : x; - c : x; + a: x; + b: x; + c: x; - c() : void; - b() : void; - a() : void; + c(): void; + b(): void; + a(): void; - () : Baz; + (): Baz; - new () : Bar; + new (): Bar; } - `, - options: [ - { default: { memberTypes: defaultOrder, order: 'alphabetically' } }, - ], - errors: [ - { - messageId: 'incorrectGroupOrder', - data: { - name: 'call', - rank: 'field', - }, + `, + options: [ + { default: { memberTypes: defaultOrder, order: 'alphabetically' } }, + ], + errors: [ + { + messageId: 'incorrectGroupOrder', + data: { + name: 'call', + rank: 'field', }, - { - messageId: 'incorrectGroupOrder', - data: { - name: 'new', - rank: 'method', - }, + }, + { + messageId: 'incorrectGroupOrder', + data: { + name: 'new', + rank: 'method', }, - ], - }, + }, + ], + }, - // default option + type literal + wrong order within group and wrong group order + alphabetically - { - code: ` + // default option + type literal + wrong order within group and wrong group order + alphabetically + { + code: ` type Foo = { - [a: string] : number; - - a : x; - b : x; - c : x; - - c() : void; - b() : void; - a() : void; - - () : Baz; - - new () : Bar; -} - `, - options: [ - { default: { memberTypes: defaultOrder, order: 'alphabetically' } }, - ], - errors: [ - { - messageId: 'incorrectGroupOrder', - data: { - name: 'call', - rank: 'field', - }, - }, - { - messageId: 'incorrectGroupOrder', - data: { - name: 'new', - rank: 'method', - }, - }, - ], - }, - - // default option + class + wrong order within group and wrong group order + alphabetically - { - code: ` -class Foo { - public static c: string = ""; - public static b: string = ""; - public static a: string; - - constructor() {} - - public d: string = ""; -} - `, - options: [ - { default: { memberTypes: defaultOrder, order: 'alphabetically' } }, - ], - errors: [ - { - messageId: 'incorrectGroupOrder', - data: { - name: 'd', - rank: 'public constructor', - }, - }, - ], - }, + [a: string]: number; - // default option + class expression + wrong order within group and wrong group order + alphabetically - { - code: ` -const foo = class Foo { - public static c: string = ""; - public static b: string = ""; - public static a: string; + a: x; + b: x; + c: x; - constructor() {} + c(): void; + b(): void; + a(): void; - public d: string = ""; -} - `, - options: [ - { default: { memberTypes: defaultOrder, order: 'alphabetically' } }, - ], - errors: [ - { - messageId: 'incorrectGroupOrder', - data: { - name: 'd', - rank: 'public constructor', - }, - }, - ], - }, - // default option + class + decorators + custom order + wrong order within group and wrong group order + alphabetically - { - code: ` -class Foo { - @Dec() a1: string; - @Dec() - a3: string; - @Dec() - a2: string; + (): Baz; - constructor() {} - - b1: string; - b2: string; - - public c(): void; - @Dec() d(): void -} - `, - options: [ - { - default: { - memberTypes: [ - 'decorated-field', - 'field', - 'constructor', - 'decorated-method', - ], - order: 'alphabetically', - }, - }, - ], - errors: [ - { - messageId: 'incorrectGroupOrder', - data: { - name: 'b1', - rank: 'constructor', - }, + new (): Bar; +}; + `, + options: [ + { default: { memberTypes: defaultOrder, order: 'alphabetically' } }, + ], + errors: [ + { + messageId: 'incorrectGroupOrder', + data: { + name: 'call', + rank: 'field', }, - { - messageId: 'incorrectGroupOrder', - data: { - name: 'b2', - rank: 'constructor', - }, + }, + { + messageId: 'incorrectGroupOrder', + data: { + name: 'new', + rank: 'method', }, - ], - }, - ], - }; - -const sortedWithGroupingClassesOption: TSESLint.RunTests = - { - valid: [ - // classes option + interface + alphabetically --> Default order applies - { - code: ` -interface Foo { - [a: string] : number; - - () : Baz; - - c : x; - b : x; - a : x; - - new () : Bar; - - c() : void; - b() : void; - a() : void; -} - `, - options: [{ classes: { order: 'alphabetically' } }], - }, - - // classes option + type literal + alphabetically --> Default order applies - { - code: ` -type Foo = { - [a: string] : number; - - () : Baz; - - c : x; - b : x; - a : x; - - new () : Bar; - - c() : void; - b() : void; - a() : void; -} - `, - options: [{ classes: { order: 'alphabetically' } }], - }, + }, + ], + }, - // classes option + class + default order + alphabetically - { - code: ` + // default option + class + wrong order within group and wrong group order + alphabetically + { + code: ` class Foo { + public static c: string = ''; + public static b: string = ''; public static a: string; - protected static b: string = ""; - private static c: string = ""; - - public d: string = ""; - protected e: string = ""; - private f: string = ""; - - constructor() {} -} - `, - options: [ - { classes: { memberTypes: defaultOrder, order: 'alphabetically' } }, - ], - }, - - // classes option + class + custom order + alphabetically - { - code: ` -class Foo { - constructor() {} - public d: string = ""; - protected e: string = ""; - private f: string = ""; + constructor() {} - public static a: string; - protected static b: string = ""; - private static c: string = ""; + public d: string = ''; } - `, - options: [ - { - classes: { - memberTypes: ['constructor', 'instance-field', 'static-field'], - order: 'alphabetically', - }, + `, + options: [ + { default: { memberTypes: defaultOrder, order: 'alphabetically' } }, + ], + errors: [ + { + messageId: 'incorrectGroupOrder', + data: { + name: 'd', + rank: 'public constructor', }, - ], - }, + }, + ], + }, - // classes option + class expression + alphabetically --> Default order applies - { - code: ` + // default option + class expression + wrong order within group and wrong group order + alphabetically + { + code: ` const foo = class Foo { + public static c: string = ''; + public static b: string = ''; public static a: string; - protected static b: string = ""; - private static c: string = ""; - - public d: string = ""; - protected e: string = ""; - private f: string = ""; constructor() {} -} - `, - options: [{ classes: { order: 'alphabetically' } }], - }, - ], - invalid: [ - // default option + class + wrong order within group and wrong group order + alphabetically - { - code: ` + + public d: string = ''; +}; + `, + options: [ + { default: { memberTypes: defaultOrder, order: 'alphabetically' } }, + ], + errors: [ + { + messageId: 'incorrectGroupOrder', + data: { + name: 'd', + rank: 'public constructor', + }, + }, + ], + }, + // default option + class + decorators + custom order + wrong order within group and wrong group order + alphabetically + { + code: ` class Foo { - public static c: string = ""; - public static b: string = ""; - public static a: string; + @Dec() a1: string; + @Dec() + a3: string; + @Dec() + a2: string; constructor() {} - public d: string = ""; + b1: string; + b2: string; + + public c(): void; + @Dec() d(): void; } - `, - options: [ - { default: { memberTypes: defaultOrder, order: 'alphabetically' } }, - ], - errors: [ - { - messageId: 'incorrectGroupOrder', - data: { - name: 'd', - rank: 'public constructor', - }, + `, + options: [ + { + default: { + memberTypes: [ + 'decorated-field', + 'field', + 'constructor', + 'decorated-method', + ], + order: 'alphabetically', }, - ], - }, - ], - }; + }, + ], + errors: [ + { + messageId: 'incorrectGroupOrder', + data: { + name: 'b1', + rank: 'constructor', + }, + }, + { + messageId: 'incorrectGroupOrder', + data: { + name: 'b2', + rank: 'constructor', + }, + }, + ], + }, + ], +}; -const sortedWithGroupingClassExpressionsOption: TSESLint.RunTests< - MessageIds, - Options -> = { +const sortedWithGroupingClassesOption: RunTests = { valid: [ - // classExpressions option + interface + alphabetically --> Default order applies + // classes option + interface + alphabetically --> Default order applies { code: ` interface Foo { - [a: string] : number; + [a: string]: number; - () : Baz; + (): Baz; - c : x; - b : x; - a : x; + c: x; + b: x; + a: x; - new () : Bar; + new (): Bar; - c() : void; - b() : void; - a() : void; + c(): void; + b(): void; + a(): void; } - `, - options: [{ classExpressions: { order: 'alphabetically' } }], + `, + options: [{ classes: { order: 'alphabetically' } }], }, - // classExpressions option + type literal + alphabetically --> Default order applies + // classes option + type literal + alphabetically --> Default order applies { code: ` type Foo = { - [a: string] : number; + [a: string]: number; - () : Baz; + (): Baz; - c : x; - b : x; - a : x; + c: x; + b: x; + a: x; - new () : Bar; + new (): Bar; - c() : void; - b() : void; - a() : void; -} - `, - options: [{ classExpressions: { order: 'alphabetically' } }], + c(): void; + b(): void; + a(): void; +}; + `, + options: [{ classes: { order: 'alphabetically' } }], }, - // classExpressions option + class + alphabetically --> Default order applies + // classes option + class + default order + alphabetically { code: ` class Foo { public static a: string; - protected static b: string = ""; - private static c: string = ""; + protected static b: string = ''; + private static c: string = ''; - public d: string = ""; - protected e: string = ""; - private f: string = ""; + public d: string = ''; + protected e: string = ''; + private f: string = ''; constructor() {} } - `, - options: [{ classExpressions: { order: 'alphabetically' } }], + `, + options: [ + { classes: { memberTypes: defaultOrder, order: 'alphabetically' } }, + ], }, - // classExpressions option + class expression + default order + alphabetically + // classes option + class + custom order + alphabetically { code: ` -const foo = class Foo { - public static a: string; - protected static b: string = ""; - private static c: string = ""; +class Foo { + constructor() {} - public d: string = ""; - protected e: string = ""; - private f: string = ""; + public d: string = ''; + protected e: string = ''; + private f: string = ''; - constructor() {} + public static a: string; + protected static b: string = ''; + private static c: string = ''; } - `, + `, options: [ { - classExpressions: { - memberTypes: defaultOrder, + classes: { + memberTypes: ['constructor', 'instance-field', 'static-field'], order: 'alphabetically', }, }, ], }, - // classExpressions option + class expression + custom order + alphabetically + // classes option + class expression + alphabetically --> Default order applies { code: ` const foo = class Foo { - constructor() {} + public static a: string; + protected static b: string = ''; + private static c: string = ''; - public d: string = ""; - protected e: string = ""; - private f: string = ""; + public d: string = ''; + protected e: string = ''; + private f: string = ''; - public static a: string; - protected static b: string = ""; - private static c: string = ""; -} - `, - options: [ - { - classExpressions: { - memberTypes: ['constructor', 'instance-field', 'static-field'], - order: 'alphabetically', - }, - }, - ], + constructor() {} +}; + `, + options: [{ classes: { order: 'alphabetically' } }], }, ], invalid: [ - // default option + class expression + wrong order within group and wrong group order + alphabetically + // default option + class + wrong order within group and wrong group order + alphabetically { code: ` -const foo = class Foo { - public static c: string = ""; - public static b: string = ""; +class Foo { + public static c: string = ''; + public static b: string = ''; public static a: string; constructor() {} - public d: string = ""; + public d: string = ''; } - `, + `, options: [ { default: { memberTypes: defaultOrder, order: 'alphabetically' } }, ], @@ -2299,30 +2156,172 @@ const foo = class Foo { ], }; -const sortedWithGroupingInterfacesOption: TSESLint.RunTests< - MessageIds, - Options -> = { +const sortedWithGroupingClassExpressionsOption: RunTests = + { + valid: [ + // classExpressions option + interface + alphabetically --> Default order applies + { + code: ` +interface Foo { + [a: string]: number; + + (): Baz; + + c: x; + b: x; + a: x; + + new (): Bar; + + c(): void; + b(): void; + a(): void; +} + `, + options: [{ classExpressions: { order: 'alphabetically' } }], + }, + + // classExpressions option + type literal + alphabetically --> Default order applies + { + code: ` +type Foo = { + [a: string]: number; + + (): Baz; + + c: x; + b: x; + a: x; + + new (): Bar; + + c(): void; + b(): void; + a(): void; +}; + `, + options: [{ classExpressions: { order: 'alphabetically' } }], + }, + + // classExpressions option + class + alphabetically --> Default order applies + { + code: ` +class Foo { + public static a: string; + protected static b: string = ''; + private static c: string = ''; + + public d: string = ''; + protected e: string = ''; + private f: string = ''; + + constructor() {} +} + `, + options: [{ classExpressions: { order: 'alphabetically' } }], + }, + + // classExpressions option + class expression + default order + alphabetically + { + code: ` +const foo = class Foo { + public static a: string; + protected static b: string = ''; + private static c: string = ''; + + public d: string = ''; + protected e: string = ''; + private f: string = ''; + + constructor() {} +}; + `, + options: [ + { + classExpressions: { + memberTypes: defaultOrder, + order: 'alphabetically', + }, + }, + ], + }, + + // classExpressions option + class expression + custom order + alphabetically + { + code: ` +const foo = class Foo { + constructor() {} + + public d: string = ''; + protected e: string = ''; + private f: string = ''; + + public static a: string; + protected static b: string = ''; + private static c: string = ''; +}; + `, + options: [ + { + classExpressions: { + memberTypes: ['constructor', 'instance-field', 'static-field'], + order: 'alphabetically', + }, + }, + ], + }, + ], + invalid: [ + // default option + class expression + wrong order within group and wrong group order + alphabetically + { + code: ` +const foo = class Foo { + public static c: string = ''; + public static b: string = ''; + public static a: string; + + constructor() {} + + public d: string = ''; +}; + `, + options: [ + { default: { memberTypes: defaultOrder, order: 'alphabetically' } }, + ], + errors: [ + { + messageId: 'incorrectGroupOrder', + data: { + name: 'd', + rank: 'public constructor', + }, + }, + ], + }, + ], + }; + +const sortedWithGroupingInterfacesOption: RunTests = { valid: [ // interfaces option + interface + default order + alphabetically { code: ` interface Foo { - [a: string] : number; + [a: string]: number; - a : x; - b : x; - c : x; + a: x; + b: x; + c: x; - a() : void; - b() : void; - c() : void; + a(): void; + b(): void; + c(): void; - new () : Bar; + new (): Bar; - () : Baz; + (): Baz; } - `, + `, options: [ { interfaces: { @@ -2337,20 +2336,20 @@ interface Foo { { code: ` interface Foo { - new () : Bar; + new (): Bar; - a() : void; - b() : void; - c() : void; + a(): void; + b(): void; + c(): void; - a : x; - b : x; - c : x; + a: x; + b: x; + c: x; - [a: string] : number; - () : Baz; + [a: string]: number; + (): Baz; } - `, + `, options: [ { interfaces: { @@ -2365,21 +2364,21 @@ interface Foo { { code: ` type Foo = { - [a: string] : number; + [a: string]: number; - () : Baz; + (): Baz; - c : x; - b : x; - a : x; + c: x; + b: x; + a: x; - new () : Bar; + new (): Bar; - c() : void; - b() : void; - a() : void; -} - `, + c(): void; + b(): void; + a(): void; +}; + `, options: [{ interfaces: { order: 'alphabetically' } }], }, @@ -2388,16 +2387,16 @@ type Foo = { code: ` class Foo { public static a: string; - protected static b: string = ""; - private static c: string = ""; + protected static b: string = ''; + private static c: string = ''; - public d: string = ""; - protected e: string = ""; - private f: string = ""; + public d: string = ''; + protected e: string = ''; + private f: string = ''; constructor() {} } - `, + `, options: [{ interfaces: { order: 'alphabetically' } }], }, @@ -2406,16 +2405,16 @@ class Foo { code: ` const foo = class Foo { public static a: string; - protected static b: string = ""; - private static c: string = ""; + protected static b: string = ''; + private static c: string = ''; - public d: string = ""; - protected e: string = ""; - private f: string = ""; + public d: string = ''; + protected e: string = ''; + private f: string = ''; constructor() {} -} - `, +}; + `, options: [{ interfaces: { order: 'alphabetically' } }], }, ], @@ -2424,21 +2423,21 @@ const foo = class Foo { { code: ` interface Foo { - [a: string] : number; + [a: string]: number; - a : x; - b : x; - c : x; + a: x; + b: x; + c: x; - c() : void; - b() : void; - a() : void; + c(): void; + b(): void; + a(): void; - () : Baz; + (): Baz; - new () : Bar; + new (): Bar; } - `, + `, options: [ { default: { memberTypes: defaultOrder, order: 'alphabetically' } }, ], @@ -2462,30 +2461,27 @@ interface Foo { ], }; -const sortedWithGroupingTypeLiteralsOption: TSESLint.RunTests< - MessageIds, - Options -> = { +const sortedWithGroupingTypeLiteralsOption: RunTests = { valid: [ // typeLiterals option + interface + alphabetically --> Default order applies { code: ` interface Foo { - [a: string] : number; + [a: string]: number; - () : Baz; + (): Baz; - c : x; - b : x; - a : x; + c: x; + b: x; + a: x; - new () : Bar; + new (): Bar; - c() : void; - b() : void; - a() : void; + c(): void; + b(): void; + a(): void; } - `, + `, options: [{ typeLiterals: { order: 'alphabetically' } }], }, @@ -2493,21 +2489,21 @@ interface Foo { { code: ` type Foo = { - [a: string] : number; + [a: string]: number; - a : x; - b : x; - c : x; + a: x; + b: x; + c: x; - a() : void; - b() : void; - c() : void; + a(): void; + b(): void; + c(): void; - new () : Bar; + new (): Bar; - () : Baz; -} - `, + (): Baz; +}; + `, options: [ { typeLiterals: { @@ -2522,20 +2518,20 @@ type Foo = { { code: ` type Foo = { - new () : Bar; + new (): Bar; - a() : void; - b() : void; - c() : void; + a(): void; + b(): void; + c(): void; - a : x; - b : x; - c : x; + a: x; + b: x; + c: x; - [a: string] : number; - () : Baz; -} - `, + [a: string]: number; + (): Baz; +}; + `, options: [ { typeLiterals: { @@ -2551,16 +2547,16 @@ type Foo = { code: ` class Foo { public static a: string; - protected static b: string = ""; - private static c: string = ""; + protected static b: string = ''; + private static c: string = ''; - public d: string = ""; - protected e: string = ""; - private f: string = ""; + public d: string = ''; + protected e: string = ''; + private f: string = ''; constructor() {} } - `, + `, options: [{ typeLiterals: { order: 'alphabetically' } }], }, @@ -2569,16 +2565,16 @@ class Foo { code: ` const foo = class Foo { public static a: string; - protected static b: string = ""; - private static c: string = ""; + protected static b: string = ''; + private static c: string = ''; - public d: string = ""; - protected e: string = ""; - private f: string = ""; + public d: string = ''; + protected e: string = ''; + private f: string = ''; constructor() {} -} - `, +}; + `, options: [{ typeLiterals: { order: 'alphabetically' } }], }, ], @@ -2587,21 +2583,21 @@ const foo = class Foo { { code: ` type Foo = { - [a: string] : number; + [a: string]: number; - a : x; - b : x; - c : x; + a: x; + b: x; + c: x; - c() : void; - b() : void; - a() : void; + c(): void; + b(): void; + a(): void; - () : Baz; + (): Baz; - new () : Bar; -} - `, + new (): Bar; +}; + `, options: [ { default: { memberTypes: defaultOrder, order: 'alphabetically' } }, ], @@ -2651,7 +2647,7 @@ class Foo { ], }; -const sortedWithoutGrouping = { +const sortedWithoutGrouping: RunTests = { valid: [ ...sortedWithoutGroupingDefaultOption.valid, ...sortedWithoutGroupingClassesOption.valid, @@ -2668,7 +2664,7 @@ const sortedWithoutGrouping = { ], }; -const sortedWithGrouping = { +const sortedWithGrouping: RunTests = { valid: [ ...sortedWithGroupingDefaultOption.valid, ...sortedWithGroupingClassesOption.valid, diff --git a/packages/eslint-plugin/tests/rules/member-ordering/member-ordering-natural-case-insensitive-order.test.ts b/packages/eslint-plugin/tests/rules/member-ordering/member-ordering-natural-case-insensitive-order.test.ts new file mode 100644 index 00000000000..782fee826d5 --- /dev/null +++ b/packages/eslint-plugin/tests/rules/member-ordering/member-ordering-natural-case-insensitive-order.test.ts @@ -0,0 +1,135 @@ +import rule from '../../../src/rules/member-ordering'; +import { RuleTester } from '../../RuleTester'; + +const ruleTester = new RuleTester({ + parser: '@typescript-eslint/parser', +}); + +ruleTester.run('member-ordering-natural-order', rule, { + valid: [ + { + code: ` +interface Example { + 1: number; + 5: number; + 10: number; +} + `, + options: [ + { + default: { + order: 'natural-case-insensitive', + }, + }, + ], + }, + { + code: ` +interface Example { + new (): unknown; + + a1(): void; + a5(): void; + a10(): void; + B1(): void; + B5(): void; + B10(): void; + + a1: number; + a5: number; + a10: number; + B1: number; + B5: number; + B10: number; +} + `, + options: [ + { + default: { + memberTypes: ['constructor', 'method', 'field'], + order: 'natural-case-insensitive', + }, + }, + ], + }, + ], + invalid: [ + { + code: ` +interface Example { + 1: number; + 10: number; + 5: number; +} + `, + errors: [ + { + messageId: 'incorrectOrder', + data: { + beforeMember: 10, + member: 5, + }, + line: 5, + column: 3, + }, + ], + options: [ + { + default: { + order: 'natural-case-insensitive', + }, + }, + ], + }, + + { + code: ` +interface Example { + new (): unknown; + + a1(): void; + a10(): void; + a5(): void; + B5(): void; + B10(): void; + B1(): void; + + a5: number; + a10: number; + B1: number; + a1: number; + B5: number; + B10: number; +} + `, + errors: [ + { + column: 3, + data: { + beforeMember: 'a10', + member: 'a5', + }, + line: 7, + messageId: 'incorrectOrder', + }, + { + column: 3, + data: { + beforeMember: 'B10', + member: 'B1', + }, + line: 10, + messageId: 'incorrectOrder', + }, + ], + options: [ + { + default: { + memberTypes: ['constructor', 'method', 'field'], + order: 'natural-case-insensitive', + }, + }, + ], + }, + ], +}); diff --git a/packages/eslint-plugin/tests/rules/member-ordering/member-ordering-natural-order.test.ts b/packages/eslint-plugin/tests/rules/member-ordering/member-ordering-natural-order.test.ts new file mode 100644 index 00000000000..c34677a81c7 --- /dev/null +++ b/packages/eslint-plugin/tests/rules/member-ordering/member-ordering-natural-order.test.ts @@ -0,0 +1,144 @@ +import rule from '../../../src/rules/member-ordering'; +import { RuleTester } from '../../RuleTester'; + +const ruleTester = new RuleTester({ + parser: '@typescript-eslint/parser', +}); + +ruleTester.run('member-ordering-natural-order', rule, { + valid: [ + { + code: ` +interface Example { + 1: number; + 5: number; + 10: number; +} + `, + options: [ + { + default: { + order: 'natural', + }, + }, + ], + }, + { + code: ` +interface Example { + new (): unknown; + + B1(): void; + B5(): void; + B10(): void; + a1(): void; + a5(): void; + a10(): void; + + B1: number; + B5: number; + B10: number; + a1: number; + a5: number; + a10: number; +} + `, + options: [ + { + default: { + memberTypes: ['constructor', 'method', 'field'], + order: 'natural', + }, + }, + ], + }, + ], + invalid: [ + { + code: ` +interface Example { + 1: number; + 10: number; + 5: number; +} + `, + errors: [ + { + messageId: 'incorrectOrder', + data: { + beforeMember: 10, + member: 5, + }, + line: 5, + column: 3, + }, + ], + options: [ + { + default: { + order: 'natural', + }, + }, + ], + }, + + { + code: ` +interface Example { + new (): unknown; + + a1(): void; + a10(): void; + a5(): void; + B5(): void; + B10(): void; + B1(): void; + + a5: number; + a10: number; + B1: number; + a1: number; + B5: number; + B10: number; +} + `, + errors: [ + { + column: 3, + data: { + beforeMember: 'a10', + member: 'a5', + }, + line: 7, + messageId: 'incorrectOrder', + }, + { + column: 3, + data: { + beforeMember: 'a5', + member: 'B5', + }, + line: 8, + messageId: 'incorrectOrder', + }, + { + column: 3, + data: { + beforeMember: 'B10', + member: 'B1', + }, + line: 10, + messageId: 'incorrectOrder', + }, + ], + options: [ + { + default: { + memberTypes: ['constructor', 'method', 'field'], + order: 'natural', + }, + }, + ], + }, + ], +}); diff --git a/packages/eslint-plugin/tests/rules/member-ordering/member-ordering-optionalMembers.test.ts b/packages/eslint-plugin/tests/rules/member-ordering/member-ordering-optionalMembers.test.ts new file mode 100644 index 00000000000..4f7d789798d --- /dev/null +++ b/packages/eslint-plugin/tests/rules/member-ordering/member-ordering-optionalMembers.test.ts @@ -0,0 +1,462 @@ +import type { TSESLint } from '@typescript-eslint/utils'; + +import type { MessageIds, Options } from '../../../src/rules/member-ordering'; +import rule from '../../../src/rules/member-ordering'; +import { RuleTester } from '../../RuleTester'; + +const ruleTester = new RuleTester({ + parser: '@typescript-eslint/parser', +}); + +const grouped: TSESLint.RunTests = { + valid: [ + // optionalityOrder - required-first + { + code: ` +interface X { + c: string; + b?: string; + d?: string; +} + `, + options: [ + { + default: { + memberTypes: 'never', + order: 'alphabetically', + optionalityOrder: 'required-first', + }, + }, + ], + }, + { + code: ` +interface X { + b?: string; + c?: string; + d?: string; +} + `, + options: [ + { + default: { + memberTypes: 'never', + order: 'as-written', + optionalityOrder: 'required-first', + }, + }, + ], + }, + { + code: ` +interface X { + b: string; + c: string; + d: string; +} + `, + options: [ + { + default: { + memberTypes: 'never', + order: 'as-written', + optionalityOrder: 'required-first', + }, + }, + ], + }, + { + code: ` +class X { + c: string; + d: string; + ['a']?: string; +} + `, + options: [ + { + default: { + memberTypes: 'never', + order: 'alphabetically', + optionalityOrder: 'required-first', + }, + }, + ], + }, + { + code: ` +class X { + c: string; + public static d: string; + public static ['a']?: string; +} + `, + options: [ + { + default: { + memberTypes: 'never', + order: 'alphabetically', + optionalityOrder: 'required-first', + }, + }, + ], + }, + { + code: ` +class X { + a: string; + static {} + b: string; +} + `, + options: [ + { + default: { + memberTypes: 'never', + order: 'alphabetically', + optionalityOrder: 'required-first', + }, + }, + ], + }, + { + code: ` +class X { + a: string; + [i: number]: string; + b?: string; +} + `, + options: [ + { + default: { + memberTypes: 'never', + order: 'alphabetically', + optionalityOrder: 'required-first', + }, + }, + ], + }, + { + code: ` +interface X { + a: string; + [i?: number]: string; + b?: string; +} + `, + options: [ + { + default: { + memberTypes: 'never', + order: 'alphabetically', + optionalityOrder: 'required-first', + }, + }, + ], + }, + { + code: ` +interface X { + a: string; + (a: number): string; + new (i: number): string; + b?: string; +} + `, + options: [ + { + default: { + memberTypes: 'never', + order: 'alphabetically', + optionalityOrder: 'required-first', + }, + }, + ], + }, + // optionalityOrder - optional-first + { + code: ` +interface X { + b?: string; + d?: string; + c: string; +} + `, + options: [ + { + default: { + memberTypes: 'never', + order: 'alphabetically', + optionalityOrder: 'optional-first', + }, + }, + ], + }, + { + code: ` +interface X { + b?: string; + c?: string; + d?: string; +} + `, + options: [ + { + default: { + memberTypes: 'never', + order: 'as-written', + optionalityOrder: 'optional-first', + }, + }, + ], + }, + { + code: ` +interface X { + b: string; + c: string; + d: string; +} + `, + options: [ + { + default: { + memberTypes: 'never', + order: 'as-written', + optionalityOrder: 'optional-first', + }, + }, + ], + }, + { + code: ` +class X { + ['c']?: string; + a: string; + b: string; +} + `, + options: [ + { + default: { + memberTypes: 'never', + order: 'alphabetically', + optionalityOrder: 'optional-first', + }, + }, + ], + }, + ], + // optionalityOrder - required-first + invalid: [ + { + code: ` +interface X { + m: string; + d?: string; + b?: string; +} + `, + options: [ + { + default: { + memberTypes: 'never', + order: 'alphabetically', + optionalityOrder: 'required-first', + }, + }, + ], + errors: [ + { + data: { + member: 'b', + beforeMember: 'd', + }, + messageId: 'incorrectOrder', + line: 5, + column: 3, + }, + ], + }, + { + code: ` +interface X { + a: string; + b?: string; + c: string; +} + `, + options: [ + { + default: { + memberTypes: ['call-signature', 'field', 'method'], + order: 'as-written', + optionalityOrder: 'required-first', + }, + }, + ], + errors: [ + { + messageId: 'incorrectRequiredMembersOrder', + line: 4, + column: 3, + data: { + member: 'b', + optionalOrRequired: 'required', + }, + }, + ], + }, + { + code: ` +class X { + a?: string; + static {} + b?: string; +} + `, + options: [ + { + default: { + memberTypes: 'never', + order: 'as-written', + optionalityOrder: 'required-first', + }, + }, + ], + errors: [ + { + messageId: 'incorrectRequiredMembersOrder', + line: 3, + column: 3, + data: { + member: 'a', + optionalOrRequired: 'required', + }, + }, + ], + }, + // optionalityOrder - optional-first + { + code: ` +interface X { + d?: string; + b?: string; + m: string; +} + `, + options: [ + { + default: { + memberTypes: 'never', + order: 'alphabetically', + optionalityOrder: 'optional-first', + }, + }, + ], + errors: [ + { + messageId: 'incorrectOrder', + line: 4, + column: 3, + }, + ], + }, + { + code: ` +interface X { + a?: string; + b: string; + c?: string; +} + `, + options: [ + { + default: { + memberTypes: ['call-signature', 'field', 'method'], + order: 'as-written', + optionalityOrder: 'optional-first', + }, + }, + ], + errors: [ + { + messageId: 'incorrectRequiredMembersOrder', + line: 4, + column: 3, + data: { + member: 'b', + optionalOrRequired: 'optional', + }, + }, + ], + }, + { + code: ` +class Test { + a?: string; + b?: string; + f: string; + c?: string; + d?: string; + g: string; + h: string; +} + `, + options: [ + { + default: { + memberTypes: 'never', + order: 'as-written', + optionalityOrder: 'optional-first', + }, + }, + ], + errors: [ + { + messageId: 'incorrectRequiredMembersOrder', + line: 5, + column: 3, + data: { + member: 'f', + optionalOrRequired: 'optional', + }, + }, + ], + }, + { + code: ` +class Test { + a: string; + b: string; + f?: string; + c?: string; + d?: string; +} + `, + options: [ + { + default: { + memberTypes: 'never', + order: 'as-written', + optionalityOrder: 'optional-first', + }, + }, + ], + errors: [ + { + messageId: 'incorrectRequiredMembersOrder', + line: 3, + column: 3, + data: { + member: 'a', + optionalOrRequired: 'optional', + }, + }, + ], + }, + ], +}; + +ruleTester.run('member-ordering-required', rule, grouped); diff --git a/packages/eslint-plugin/tests/rules/method-signature-style.test.ts b/packages/eslint-plugin/tests/rules/method-signature-style.test.ts index 065d15c6180..d9db8f5d6eb 100644 --- a/packages/eslint-plugin/tests/rules/method-signature-style.test.ts +++ b/packages/eslint-plugin/tests/rules/method-signature-style.test.ts @@ -32,22 +32,42 @@ interface Test { 'f!': (/* b */ x: any /* c */) => void; } `, - ` + { + code: ` interface Test { get f(): number; } - `, - ` + `, + dependencyConstraints: { + typescript: '4.3', + }, + }, + { + code: ` interface Test { set f(value: number): void; } - `, + `, + dependencyConstraints: { + typescript: '4.3', + }, + }, 'type Test = { readonly f: (a: string) => number };', "type Test = { ['f']?: (a: boolean) => void };", 'type Test = { readonly f?: (a?: T) => T };', "type Test = { readonly ['f']?: (a: T, b: T) => T };", - 'type Test = { get f(): number };', - 'type Test = { set f(value: number): void };', + { + code: 'type Test = { get f(): number };', + dependencyConstraints: { + typescript: '4.3', + }, + }, + { + code: 'type Test = { set f(value: number): void };', + dependencyConstraints: { + typescript: '4.3', + }, + }, ...batchedSingleLineTests({ options: ['method'], code: noFormat` @@ -56,15 +76,23 @@ interface Test { interface Test { f(a: T): T } interface Test { ['f'](a: T, b: T): T } interface Test { 'f!'(/* b */ x: any /* c */): void } - interface Test { get f(): number } - interface Test { set f(value: number): void } type Test = { readonly f(a: string): number } type Test = { ['f']?(a: boolean): void } type Test = { readonly f?(a?: T): T } type Test = { readonly ['f']?(a: T, b: T): T } + `, + }), + ...batchedSingleLineTests({ + options: ['method'], + code: noFormat` + interface Test { get f(): number } + interface Test { set f(value: number): void } type Test = { get f(): number } type Test = { set f(value: number): void } `, + dependencyConstraints: { + typescript: '4.3', + }, }), ], invalid: [ @@ -91,7 +119,7 @@ interface Test { { messageId: 'errorMethod', line: 9 }, { messageId: 'errorMethod', line: 10 }, ], - output: noFormat` + output: ` interface Test { f: (a: string) => number } interface Test { ['f']: (a: boolean) => void } interface Test { f: (a: T) => T } @@ -127,7 +155,7 @@ interface Test { { messageId: 'errorProperty', line: 9 }, { messageId: 'errorProperty', line: 10 }, ], - output: noFormat` + output: ` interface Test { f(a: string): number } interface Test { ['f'](a: boolean): void } interface Test { f(a: T): T } @@ -147,7 +175,7 @@ interface Foo { none(arg: string): void } `, - output: noFormat` + output: ` interface Foo { semi: (arg: string) => void; comma: (arg: string) => void, @@ -177,7 +205,7 @@ interface Foo { none: (arg: string) => void } `, - output: noFormat` + output: ` interface Foo { semi(arg: string): void; comma(arg: string): void, @@ -216,7 +244,7 @@ interface Foo { ): void; } `, - output: noFormat` + output: ` interface Foo { x: ( args: Pick< @@ -249,7 +277,7 @@ interface Foo { foo(): three; } `, - output: noFormat` + output: ` interface Foo { foo: (() => one) & (() => two) & (() => three); } @@ -277,7 +305,7 @@ interface Foo { foo(): three; } `, - output: noFormat` + output: ` interface Foo { foo: ((bar: string) => one) & ((bar: number, baz: string) => two) & (() => three); } @@ -305,7 +333,7 @@ interface Foo { [foo](): three; } `, - output: noFormat` + output: ` interface Foo { [foo]: ((bar: string) => one) & ((bar: number, baz: string) => two) & (() => three); } @@ -335,7 +363,7 @@ interface Foo { bar(baz: number): Foo; } `, - output: noFormat` + output: ` interface Foo { [foo]: ((bar: string) => one) & ((bar: number, baz: string) => two) & (() => three); bar: ((arg: string) => void) & ((baz: number) => Foo); @@ -395,7 +423,7 @@ type Foo = { foo(): three; } `, - output: noFormat` + output: ` type Foo = { foo: (() => one) & (() => two) & (() => three); } @@ -423,7 +451,7 @@ declare const Foo: { foo(): three; } `, - output: noFormat` + output: ` declare const Foo: { foo: (() => one) & (() => two) & (() => three); } diff --git a/packages/eslint-plugin/tests/rules/naming-convention/cases/createTestCases.ts b/packages/eslint-plugin/tests/rules/naming-convention/cases/createTestCases.ts index 9d2abfa1338..20f357b8a9c 100644 --- a/packages/eslint-plugin/tests/rules/naming-convention/cases/createTestCases.ts +++ b/packages/eslint-plugin/tests/rules/naming-convention/cases/createTestCases.ts @@ -1,13 +1,15 @@ -import { TSESLint } from '@typescript-eslint/utils'; -import rule, { +import type { TSESLint } from '@typescript-eslint/utils'; + +import type { MessageIds, Options, } from '../../../../src/rules/naming-convention'; -import { +import rule from '../../../../src/rules/naming-convention'; +import type { PredefinedFormatsString, Selector, - selectorTypeToMessageString, } from '../../../../src/rules/naming-convention-utils'; +import { selectorTypeToMessageString } from '../../../../src/rules/naming-convention-utils'; import { RuleTester } from '../../../RuleTester'; export const formatTestNames: Readonly< 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 4c496b6c127..b55ce321f00 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 @@ -768,6 +768,128 @@ ruleTester.run('naming-convention', rule, { }, ], }, + { + code: ` + const obj = { + Bar() { + return 42; + }, + async async_bar() { + return 42; + }, + }; + class foo { + public Bar() { + return 42; + } + public async async_bar() { + return 42; + } + } + abstract class foo { + public abstract Bar() { + return 42; + } + public abstract async async_bar() { + return 42; + } + } + `, + parserOptions, + options: [ + { + selector: 'memberLike', + format: ['camelCase'], + }, + { + selector: ['method', 'objectLiteralMethod'], + format: ['snake_case'], + modifiers: ['async'], + }, + { + selector: 'method', + format: ['PascalCase'], + }, + ], + }, + { + code: ` + const async_bar1 = async () => {}; + async function async_bar2() {} + const async_bar3 = async function async_bar4() {}; + `, + parserOptions, + options: [ + { + selector: 'memberLike', + format: ['camelCase'], + }, + { + selector: 'method', + format: ['PascalCase'], + }, + { + selector: ['variable'], + format: ['snake_case'], + modifiers: ['async'], + }, + ], + }, + { + code: ` + class foo extends bar { + public someAttribute = 1; + public override some_attribute_override = 1; + public someMethod() { + return 42; + } + public override some_method_override2() { + return 42; + } + } + abstract class foo extends bar { + public abstract someAttribute: string; + public abstract override some_attribute_override: string; + public abstract someMethod(): string; + public abstract override some_method_override2(): string; + } + `, + parserOptions, + options: [ + { + selector: 'memberLike', + format: ['camelCase'], + }, + { + selector: ['memberLike'], + modifiers: ['override'], + format: ['snake_case'], + }, + ], + }, + { + code: ` + class foo { + private someAttribute = 1; + #some_attribute = 1; + + private someMethod() {} + #some_method() {} + } + `, + parserOptions, + options: [ + { + selector: 'memberLike', + format: ['camelCase'], + }, + { + selector: ['memberLike'], + modifiers: ['#private'], + format: ['snake_case'], + }, + ], + }, ], invalid: [ { @@ -1526,5 +1648,436 @@ ruleTester.run('naming-convention', rule, { // 6, not 7 because 'foo' is valid errors: Array(6).fill({ messageId: 'doesNotMatchFormat' }), }, + { + code: ` + class foo { + public Bar() { + return 42; + } + public async async_bar() { + return 42; + } + // ❌ error + public async asyncBar() { + return 42; + } + // ❌ error + public AsyncBar2 = async () => { + return 42; + }; + // ❌ error + public AsyncBar3 = async function () { + return 42; + }; + } + abstract class foo { + public abstract Bar(): number; + public abstract async async_bar(): number; + // ❌ error + public abstract async ASYNC_BAR(): number; + } + `, + parserOptions, + options: [ + { + selector: 'memberLike', + format: ['camelCase'], + }, + { + selector: 'method', + format: ['PascalCase'], + }, + { + selector: ['method', 'objectLiteralMethod'], + format: ['snake_case'], + modifiers: ['async'], + }, + ], + errors: [ + { + messageId: 'doesNotMatchFormat', + data: { + type: 'Class Method', + name: 'asyncBar', + formats: 'snake_case', + }, + }, + { + messageId: 'doesNotMatchFormat', + data: { + type: 'Class Method', + name: 'AsyncBar2', + formats: 'snake_case', + }, + }, + { + messageId: 'doesNotMatchFormat', + data: { + type: 'Class Method', + name: 'AsyncBar3', + formats: 'snake_case', + }, + }, + { + messageId: 'doesNotMatchFormat', + data: { + type: 'Class Method', + name: 'ASYNC_BAR', + formats: 'snake_case', + }, + }, + ], + }, + { + code: ` + const obj = { + Bar() { + return 42; + }, + async async_bar() { + return 42; + }, + // ❌ error + async AsyncBar() { + return 42; + }, + // ❌ error + AsyncBar2: async () => { + return 42; + }, + // ❌ error + AsyncBar3: async function () { + return 42; + }, + }; + `, + parserOptions, + options: [ + { + selector: 'memberLike', + format: ['camelCase'], + }, + { + selector: 'method', + format: ['PascalCase'], + }, + { + selector: ['method', 'objectLiteralMethod'], + format: ['snake_case'], + modifiers: ['async'], + }, + ], + errors: [ + { + messageId: 'doesNotMatchFormat', + data: { + type: 'Object Literal Method', + name: 'AsyncBar', + formats: 'snake_case', + }, + }, + { + messageId: 'doesNotMatchFormat', + data: { + type: 'Object Literal Method', + name: 'AsyncBar2', + formats: 'snake_case', + }, + }, + { + messageId: 'doesNotMatchFormat', + data: { + type: 'Object Literal Method', + name: 'AsyncBar3', + formats: 'snake_case', + }, + }, + ], + }, + { + code: ` + const syncbar1 = () => {}; + function syncBar2() {} + const syncBar3 = function syncBar4() {}; + + // ❌ error + const AsyncBar1 = async () => {}; + const async_bar1 = async () => {}; + const async_bar3 = async function async_bar4() {}; + async function async_bar2() {} + // ❌ error + const asyncBar5 = async function async_bar6() {}; + `, + parserOptions, + options: [ + { + selector: 'variableLike', + format: ['camelCase'], + }, + { + selector: ['variableLike'], + modifiers: ['async'], + format: ['snake_case'], + }, + ], + errors: [ + { + messageId: 'doesNotMatchFormat', + data: { + type: 'Variable', + name: 'AsyncBar1', + formats: 'snake_case', + }, + }, + { + messageId: 'doesNotMatchFormat', + data: { + type: 'Variable', + name: 'asyncBar5', + formats: 'snake_case', + }, + }, + ], + }, + { + code: ` + const syncbar1 = () => {}; + function syncBar2() {} + const syncBar3 = function syncBar4() {}; + + const async_bar1 = async () => {}; + // ❌ error + async function asyncBar2() {} + const async_bar3 = async function async_bar4() {}; + async function async_bar2() {} + // ❌ error + const async_bar3 = async function ASYNC_BAR4() {}; + `, + parserOptions, + options: [ + { + selector: 'variableLike', + format: ['camelCase'], + }, + { + selector: ['variableLike'], + modifiers: ['async'], + format: ['snake_case'], + }, + ], + errors: [ + { + messageId: 'doesNotMatchFormat', + data: { + type: 'Function', + name: 'asyncBar2', + formats: 'snake_case', + }, + }, + { + messageId: 'doesNotMatchFormat', + data: { + type: 'Function', + name: 'ASYNC_BAR4', + formats: 'snake_case', + }, + }, + ], + }, + { + code: ` + class foo extends bar { + public someAttribute = 1; + public override some_attribute_override = 1; + // ❌ error + public override someAttributeOverride = 1; + } + `, + parserOptions, + options: [ + { + selector: 'memberLike', + format: ['camelCase'], + }, + { + selector: ['memberLike'], + modifiers: ['override'], + format: ['snake_case'], + }, + ], + errors: [ + { + messageId: 'doesNotMatchFormat', + data: { + type: 'Class Property', + name: 'someAttributeOverride', + formats: 'snake_case', + }, + }, + ], + }, + { + code: ` + class foo extends bar { + public override some_method_override() { + return 42; + } + // ❌ error + public override someMethodOverride() { + return 42; + } + } + `, + parserOptions, + options: [ + { + selector: 'memberLike', + format: ['camelCase'], + }, + { + selector: ['memberLike'], + modifiers: ['override'], + format: ['snake_case'], + }, + ], + errors: [ + { + messageId: 'doesNotMatchFormat', + data: { + type: 'Class Method', + name: 'someMethodOverride', + formats: 'snake_case', + }, + }, + ], + }, + { + code: ` + class foo extends bar { + public get someGetter(): string; + public override get some_getter_override(): string; + // ❌ error + public override get someGetterOverride(): string; + public set someSetter(val: string); + public override set some_setter_override(val: string); + // ❌ error + public override set someSetterOverride(val: string); + } + `, + parserOptions, + options: [ + { + selector: 'memberLike', + format: ['camelCase'], + }, + { + selector: ['memberLike'], + modifiers: ['override'], + format: ['snake_case'], + }, + ], + errors: [ + { + messageId: 'doesNotMatchFormat', + data: { + type: 'Accessor', + name: 'someGetterOverride', + formats: 'snake_case', + }, + }, + { + messageId: 'doesNotMatchFormat', + data: { + type: 'Accessor', + name: 'someSetterOverride', + formats: 'snake_case', + }, + }, + ], + }, + { + code: ` + class foo { + private firstPrivateField = 1; + // ❌ error + private first_private_field = 1; + // ❌ error + #secondPrivateField = 1; + #second_private_field = 1; + } + `, + parserOptions, + options: [ + { + selector: 'memberLike', + format: ['camelCase'], + }, + { + selector: ['memberLike'], + modifiers: ['#private'], + format: ['snake_case'], + }, + ], + errors: [ + { + messageId: 'doesNotMatchFormat', + data: { + type: 'Class Property', + name: 'first_private_field', + formats: 'camelCase', + }, + }, + { + messageId: 'doesNotMatchFormat', + data: { + type: 'Class Property', + name: 'secondPrivateField', + formats: 'snake_case', + }, + }, + ], + }, + { + code: ` + class foo { + private firstPrivateMethod() {} + // ❌ error + private first_private_method() {} + // ❌ error + #secondPrivateMethod() {} + #second_private_method() {} + } + `, + parserOptions, + options: [ + { + selector: 'memberLike', + format: ['camelCase'], + }, + { + selector: ['memberLike'], + modifiers: ['#private'], + format: ['snake_case'], + }, + ], + errors: [ + { + messageId: 'doesNotMatchFormat', + data: { + type: 'Class Method', + name: 'first_private_method', + formats: 'camelCase', + }, + }, + { + messageId: 'doesNotMatchFormat', + data: { + type: 'Class Method', + name: 'secondPrivateMethod', + formats: 'snake_case', + }, + }, + ], + }, ], }); diff --git a/packages/eslint-plugin/tests/rules/no-array-constructor.test.ts b/packages/eslint-plugin/tests/rules/no-array-constructor.test.ts index 439cd85731c..a50d2c08f83 100644 --- a/packages/eslint-plugin/tests/rules/no-array-constructor.test.ts +++ b/packages/eslint-plugin/tests/rules/no-array-constructor.test.ts @@ -1,4 +1,5 @@ import { AST_NODE_TYPES } from '@typescript-eslint/utils'; + import rule from '../../src/rules/no-array-constructor'; import { RuleTester } from '../RuleTester'; diff --git a/packages/eslint-plugin/tests/rules/no-base-to-string.test.ts b/packages/eslint-plugin/tests/rules/no-base-to-string.test.ts index 542097aa9cb..c8af0c48ad8 100644 --- a/packages/eslint-plugin/tests/rules/no-base-to-string.test.ts +++ b/packages/eslint-plugin/tests/rules/no-base-to-string.test.ts @@ -1,5 +1,5 @@ import rule from '../../src/rules/no-base-to-string'; -import { RuleTester, getFixturesRootDir } from '../RuleTester'; +import { getFixturesRootDir, RuleTester } from '../RuleTester'; const rootDir = getFixturesRootDir(); const ruleTester = new RuleTester({ @@ -113,6 +113,9 @@ tag\`\${{}}\`; return \`\${v}\`; } `, + "'' += new Error();", + "'' += new URL();", + "'' += new URLSearchParams();", ], invalid: [ { diff --git a/packages/eslint-plugin/tests/rules/no-confusing-void-expression.test.ts b/packages/eslint-plugin/tests/rules/no-confusing-void-expression.test.ts index e0bdd183a0e..ce79ce4966e 100644 --- a/packages/eslint-plugin/tests/rules/no-confusing-void-expression.test.ts +++ b/packages/eslint-plugin/tests/rules/no-confusing-void-expression.test.ts @@ -1,7 +1,8 @@ -import rule, { +import type { MessageId, Options, } from '../../src/rules/no-confusing-void-expression'; +import rule from '../../src/rules/no-confusing-void-expression'; import { batchedSingleLineTests, getFixturesRootDir, @@ -89,17 +90,17 @@ ruleTester.run('no-confusing-void-expression', rule, { { code: "() => console.log('foo');", errors: [{ line: 1, column: 7, messageId: 'invalidVoidExprArrow' }], - output: noFormat`() => { console.log('foo'); };`, + output: `() => { console.log('foo'); };`, }, { code: 'foo => foo && console.log(foo);', errors: [{ line: 1, column: 15, messageId: 'invalidVoidExprArrow' }], - output: noFormat`foo => { foo && console.log(foo); };`, + output: `foo => { foo && console.log(foo); };`, }, { code: 'foo => foo || console.log(foo);', errors: [{ line: 1, column: 15, messageId: 'invalidVoidExprArrow' }], - output: noFormat`foo => { foo || console.log(foo); };`, + output: `foo => { foo || console.log(foo); };`, }, { code: 'foo => (foo ? console.log(true) : console.log(false));', @@ -107,7 +108,7 @@ ruleTester.run('no-confusing-void-expression', rule, { { line: 1, column: 15, messageId: 'invalidVoidExprArrow' }, { line: 1, column: 35, messageId: 'invalidVoidExprArrow' }, ], - output: noFormat`foo => { foo ? console.log(true) : console.log(false); };`, + output: `foo => { foo ? console.log(true) : console.log(false); };`, }, { code: ` @@ -117,7 +118,7 @@ ruleTester.run('no-confusing-void-expression', rule, { } `, errors: [{ line: 3, column: 18, messageId: 'invalidVoidExprReturn' }], - output: noFormat` + output: ` function f() { console.log('foo'); return; console.log('bar'); @@ -133,7 +134,7 @@ ruleTester.run('no-confusing-void-expression', rule, { } `, errors: [{ line: 4, column: 18, messageId: 'invalidVoidExprReturn' }], - output: noFormat` + output: ` function f() { console.log('foo') ;['bar', 'baz'].forEach(console.log); return; @@ -164,7 +165,7 @@ ruleTester.run('no-confusing-void-expression', rule, { } `, errors: [{ line: 4, column: 18, messageId: 'invalidVoidExprReturnLast' }], - output: noFormat` + output: ` function f() { console.log('foo') ;['bar', 'baz'].forEach(console.log); @@ -181,7 +182,7 @@ ruleTester.run('no-confusing-void-expression', rule, { }; `, errors: [{ line: 4, column: 20, messageId: 'invalidVoidExprReturn' }], - output: noFormat` + output: ` const f = () => { if (cond) { console.error('foo'); return; @@ -198,7 +199,7 @@ ruleTester.run('no-confusing-void-expression', rule, { }; `, errors: [{ line: 3, column: 28, messageId: 'invalidVoidExprReturn' }], - output: noFormat` + output: ` const f = function () { if (cond) { console.error('foo'); return; } console.log('bar'); diff --git a/packages/eslint-plugin/tests/rules/no-dupe-class-members.test.ts b/packages/eslint-plugin/tests/rules/no-dupe-class-members.test.ts index 5cfbc5e3128..fe99fba8631 100644 --- a/packages/eslint-plugin/tests/rules/no-dupe-class-members.test.ts +++ b/packages/eslint-plugin/tests/rules/no-dupe-class-members.test.ts @@ -1,5 +1,5 @@ import rule from '../../src/rules/no-dupe-class-members'; -import { RuleTester, noFormat } from '../RuleTester'; +import { noFormat, RuleTester } from '../RuleTester'; const ruleTester = new RuleTester({ parser: '@typescript-eslint/parser', diff --git a/packages/eslint-plugin/tests/rules/no-dynamic-delete.test.ts b/packages/eslint-plugin/tests/rules/no-dynamic-delete.test.ts index 798971e90f1..40aece28bc5 100644 --- a/packages/eslint-plugin/tests/rules/no-dynamic-delete.test.ts +++ b/packages/eslint-plugin/tests/rules/no-dynamic-delete.test.ts @@ -1,5 +1,5 @@ import rule from '../../src/rules/no-dynamic-delete'; -import { RuleTester, getFixturesRootDir } from '../RuleTester'; +import { getFixturesRootDir, RuleTester } from '../RuleTester'; const rootPath = getFixturesRootDir(); @@ -68,10 +68,7 @@ const container: { [i: string]: 0 } = {}; delete container['aa' + 'b']; `, errors: [{ messageId: 'dynamicDelete' }], - output: ` -const container: { [i: string]: 0 } = {}; -delete container['aa' + 'b']; - `, + output: null, }, { code: ` @@ -90,10 +87,7 @@ const container: { [i: string]: 0 } = {}; delete container[-Infinity]; `, errors: [{ messageId: 'dynamicDelete' }], - output: ` -const container: { [i: string]: 0 } = {}; -delete container[-Infinity]; - `, + output: null, }, { code: ` @@ -101,10 +95,7 @@ const container: { [i: string]: 0 } = {}; delete container[+Infinity]; `, errors: [{ messageId: 'dynamicDelete' }], - output: ` -const container: { [i: string]: 0 } = {}; -delete container[+Infinity]; - `, + output: null, }, { code: ` @@ -112,10 +103,7 @@ const container: { [i: string]: 0 } = {}; delete container[NaN]; `, errors: [{ messageId: 'dynamicDelete' }], - output: ` -const container: { [i: string]: 0 } = {}; -delete container[NaN]; - `, + output: null, }, { code: ` @@ -135,11 +123,7 @@ const name = 'name'; delete container[name]; `, errors: [{ messageId: 'dynamicDelete' }], - output: ` -const container: { [i: string]: 0 } = {}; -const name = 'name'; -delete container[name]; - `, + output: null, }, { code: ` @@ -147,11 +131,7 @@ const container: { [i: string]: 0 } = {}; const getName = () => 'aaa'; delete container[getName()]; `, - output: ` -const container: { [i: string]: 0 } = {}; -const getName = () => 'aaa'; -delete container[getName()]; - `, + output: null, errors: [{ messageId: 'dynamicDelete' }], }, { @@ -160,11 +140,7 @@ const container: { [i: string]: 0 } = {}; const name = { foo: { bar: 'bar' } }; delete container[name.foo.bar]; `, - output: ` -const container: { [i: string]: 0 } = {}; -const name = { foo: { bar: 'bar' } }; -delete container[name.foo.bar]; - `, + output: null, errors: [{ messageId: 'dynamicDelete' }], }, ], diff --git a/packages/eslint-plugin/tests/rules/no-empty-function.test.ts b/packages/eslint-plugin/tests/rules/no-empty-function.test.ts index 7d29b0fa5a2..7f35c79852c 100644 --- a/packages/eslint-plugin/tests/rules/no-empty-function.test.ts +++ b/packages/eslint-plugin/tests/rules/no-empty-function.test.ts @@ -78,6 +78,9 @@ class Foo extends Base { override foo() {} } `, + dependencyConstraints: { + typescript: '4.3', + }, options: [{ allow: ['overrideMethods'] }], }, ], @@ -206,6 +209,9 @@ class Foo extends Base { override foo() {} } `, + dependencyConstraints: { + typescript: '4.3', + }, errors: [ { messageId: 'unexpected', diff --git a/packages/eslint-plugin/tests/rules/no-empty-interface.test.ts b/packages/eslint-plugin/tests/rules/no-empty-interface.test.ts index f974af09c18..893deaf01d6 100644 --- a/packages/eslint-plugin/tests/rules/no-empty-interface.test.ts +++ b/packages/eslint-plugin/tests/rules/no-empty-interface.test.ts @@ -1,5 +1,5 @@ import rule from '../../src/rules/no-empty-interface'; -import { RuleTester, noFormat } from '../RuleTester'; +import { noFormat, RuleTester } from '../RuleTester'; const ruleTester = new RuleTester({ parser: '@typescript-eslint/parser', @@ -34,6 +34,18 @@ interface Bar extends Foo {} `, options: [{ allowSingleExtends: true }], }, + { + code: ` +interface Foo { + props: string; +} + +interface Bar extends Foo {} + +class Bar {} + `, + options: [{ allowSingleExtends: true }], + }, ], invalid: [ { @@ -58,13 +70,89 @@ interface Bar extends Foo {} }, { code: ` +interface Foo { + props: string; +} + +interface Bar extends Foo {} + +class Baz {} + `, + output: ` +interface Foo { + props: string; +} + +type Bar = Foo + +class Baz {} + `, + options: [{ allowSingleExtends: false }], + errors: [ + { + messageId: 'noEmptyWithSuper', + line: 6, + column: 11, + }, + ], + }, + { + code: ` +interface Foo { + props: string; +} + +interface Bar extends Foo {} + +class Bar {} + `, + options: [{ allowSingleExtends: false }], + errors: [ + { + messageId: 'noEmptyWithSuper', + line: 6, + column: 11, + }, + ], + output: null, + }, + { + code: ` +interface Foo { + props: string; +} + +interface Bar extends Foo {} + +const bar = class Bar {}; + `, + output: ` +interface Foo { + props: string; +} + +type Bar = Foo + +const bar = class Bar {}; + `, + options: [{ allowSingleExtends: false }], + errors: [ + { + messageId: 'noEmptyWithSuper', + line: 6, + column: 11, + }, + ], + }, + { + code: ` interface Foo { name: string; } interface Bar extends Foo {} `, - output: noFormat` + output: ` interface Foo { name: string; } @@ -82,7 +170,7 @@ type Bar = Foo }, { code: 'interface Foo extends Array {}', - output: noFormat`type Foo = Array`, + output: `type Foo = Array`, errors: [ { messageId: 'noEmptyWithSuper', @@ -93,7 +181,7 @@ type Bar = Foo }, { code: 'interface Foo extends Array {}', - output: noFormat`type Foo = Array`, + output: `type Foo = Array`, errors: [ { messageId: 'noEmptyWithSuper', @@ -109,7 +197,7 @@ interface Bar { } interface Foo extends Array {} `, - output: noFormat` + output: ` interface Bar { bar: string; } @@ -128,7 +216,7 @@ type Foo = Array type R = Record; interface Foo extends R {} `, - output: noFormat` + output: ` type R = Record; type Foo = R `, @@ -144,7 +232,7 @@ type Foo = R code: ` interface Foo extends Bar {} `, - output: noFormat` + output: ` type Foo = Bar `, errors: [ @@ -162,7 +250,7 @@ declare module FooBar { type Baz = typeof baz; export interface Bar extends Baz {} } - `.trimRight(), + `, errors: [ { messageId: 'noEmptyWithSuper', @@ -173,23 +261,18 @@ declare module FooBar { suggestions: [ { messageId: 'noEmptyWithSuper', - output: noFormat` + output: ` declare module FooBar { type Baz = typeof baz; export type Bar = Baz } - `.trimRight(), + `, }, ], }, ], // output matches input because a suggestion was made - output: ` -declare module FooBar { - type Baz = typeof baz; - export interface Bar extends Baz {} -} - `.trimRight(), + output: null, }, ], }); diff --git a/packages/eslint-plugin/tests/rules/no-explicit-any.test.ts b/packages/eslint-plugin/tests/rules/no-explicit-any.test.ts index 37d6b99b29f..01d894d1802 100644 --- a/packages/eslint-plugin/tests/rules/no-explicit-any.test.ts +++ b/packages/eslint-plugin/tests/rules/no-explicit-any.test.ts @@ -1,6 +1,8 @@ -import rule, { MessageIds, Options } from '../../src/rules/no-explicit-any'; +import type { TSESLint } from '@typescript-eslint/utils'; + +import type { MessageIds, Options } from '../../src/rules/no-explicit-any'; +import rule from '../../src/rules/no-explicit-any'; import { RuleTester } from '../RuleTester'; -import { TSESLint } from '@typescript-eslint/utils'; type InvalidTestCase = TSESLint.InvalidTestCase; type SuggestionOutput = TSESLint.SuggestionOutput; @@ -1001,7 +1003,7 @@ type obj = { code: ` function test>() {} const test = >() => {}; - `.trimRight(), + `, errors: [ { messageId: 'unexpectedAny', @@ -1013,14 +1015,14 @@ const test = >() => {}; output: ` function test>() {} const test = >() => {}; - `.trimRight(), + `, }, { messageId: 'suggestNever', output: ` function test>() {} const test = >() => {}; - `.trimRight(), + `, }, ], }, @@ -1034,14 +1036,14 @@ const test = >() => {}; output: ` function test>() {} const test = >() => {}; - `.trimRight(), + `, }, { messageId: 'suggestNever', output: ` function test>() {} const test = >() => {}; - `.trimRight(), + `, }, ], }, diff --git a/packages/eslint-plugin/tests/rules/no-extra-non-null-assertion.test.ts b/packages/eslint-plugin/tests/rules/no-extra-non-null-assertion.test.ts index 39ad4da3ebf..3deb4bfaec2 100644 --- a/packages/eslint-plugin/tests/rules/no-extra-non-null-assertion.test.ts +++ b/packages/eslint-plugin/tests/rules/no-extra-non-null-assertion.test.ts @@ -1,5 +1,5 @@ import rule from '../../src/rules/no-extra-non-null-assertion'; -import { RuleTester, noFormat } from '../RuleTester'; +import { noFormat, RuleTester } from '../RuleTester'; const ruleTester = new RuleTester({ parser: '@typescript-eslint/parser', @@ -128,7 +128,7 @@ function foo(bar?: { n: number }) { const foo: { bar: number } | null = null; const bar = (foo!)!.bar; `, - output: noFormat` + output: ` const foo: { bar: number } | null = null; const bar = (foo)!.bar; `, @@ -147,7 +147,7 @@ function foo(bar?: { n: number }) { return (bar!)?.n; } `, - output: noFormat` + output: ` function foo(bar?: { n: number }) { return (bar)?.n; } @@ -167,7 +167,7 @@ function foo(bar?: { n: number }) { return (bar)!?.n; } `, - output: noFormat` + output: ` function foo(bar?: { n: number }) { return (bar)?.n; } @@ -187,7 +187,7 @@ function foo(bar?: { n: number }) { return (bar!)?.(); } `, - output: noFormat` + output: ` function foo(bar?: { n: number }) { return (bar)?.(); } diff --git a/packages/eslint-plugin/tests/rules/no-extra-parens.test.ts b/packages/eslint-plugin/tests/rules/no-extra-parens.test.ts index 5f5dc37896f..369f55101f2 100644 --- a/packages/eslint-plugin/tests/rules/no-extra-parens.test.ts +++ b/packages/eslint-plugin/tests/rules/no-extra-parens.test.ts @@ -4,7 +4,7 @@ /* eslint-enable eslint-comments/no-use */ import rule from '../../src/rules/no-extra-parens'; -import { RuleTester, batchedSingleLineTests } from '../RuleTester'; +import { batchedSingleLineTests, RuleTester } from '../RuleTester'; const ruleTester = new RuleTester({ parserOptions: { @@ -19,6 +19,8 @@ ruleTester.run('no-extra-parens', rule, { valid: [ ...batchedSingleLineTests({ code: ` +async function f(arg: any) { await (arg as Promise); } +async function f(arg: Promise) { await arg; } (0).toString(); (function(){}) ? a() : b(); (/^a$/).test(x); @@ -139,6 +141,10 @@ t.true((me.get as SinonStub).calledWithExactly('/foo', other)); t.true((me.get).calledWithExactly('/foo', other)); (requestInit.headers as Headers).get('Cookie'); ( requestInit.headers).get('Cookie'); +class Foo {} +class Foo extends (Bar as any) {} +const foo = class {}; +const foo = class extends (Bar as any) {} `, parserOptions: { ecmaFeatures: { @@ -225,6 +231,17 @@ switch (foo) { case 1: case (<2>2): break; default: break; } }, ], }), + ...batchedSingleLineTests({ + code: ` +declare const f: (x: T) => any +f<(number | string)[]>(['a', 1]) + `, + parserOptions: { + ecmaFeatures: { + jsx: true, + }, + }, + }), ], invalid: [ @@ -238,6 +255,13 @@ for (a of (b)); typeof (a); a((1)); new a((1)); +a<(A)>((1)); +async function f(arg: Promise) { await (arg); } +async function f(arg: any) { await ((arg as Promise)); } +class Foo extends ((Bar as any)) {} +class Foo extends (Bar) {} +const foo = class extends ((Bar as any)) {} +const foo = class extends (Bar) {} `, output: ` a = b * c; @@ -248,7 +272,13 @@ for (a of b); typeof a; a(1); new a(1); -a<(A)>((1)); +a<(A)>(1); +async function f(arg: Promise) { await arg; } +async function f(arg: any) { await (arg as Promise); } +class Foo extends (Bar as any) {} +class Foo extends Bar {} +const foo = class extends (Bar as any) {} +const foo = class extends Bar {} `, errors: [ { @@ -296,6 +326,36 @@ a<(A)>((1)); line: 10, column: 8, }, + { + messageId: 'unexpected', + line: 11, + column: 45, + }, + { + messageId: 'unexpected', + line: 12, + column: 37, + }, + { + messageId: 'unexpected', + line: 13, + column: 20, + }, + { + messageId: 'unexpected', + line: 14, + column: 19, + }, + { + messageId: 'unexpected', + line: 15, + column: 28, + }, + { + messageId: 'unexpected', + line: 16, + column: 27, + }, ], }), ...batchedSingleLineTests({ diff --git a/packages/eslint-plugin/tests/rules/no-extraneous-class.test.ts b/packages/eslint-plugin/tests/rules/no-extraneous-class.test.ts index 799410971f2..ca8cad2b4d1 100644 --- a/packages/eslint-plugin/tests/rules/no-extraneous-class.test.ts +++ b/packages/eslint-plugin/tests/rules/no-extraneous-class.test.ts @@ -1,4 +1,5 @@ import { AST_NODE_TYPES } from '@typescript-eslint/utils'; + import rule from '../../src/rules/no-extraneous-class'; import { RuleTester } from '../RuleTester'; diff --git a/packages/eslint-plugin/tests/rules/no-floating-promises.test.ts b/packages/eslint-plugin/tests/rules/no-floating-promises.test.ts index e9a63df2b5d..070cef91e9a 100644 --- a/packages/eslint-plugin/tests/rules/no-floating-promises.test.ts +++ b/packages/eslint-plugin/tests/rules/no-floating-promises.test.ts @@ -1,5 +1,5 @@ import rule from '../../src/rules/no-floating-promises'; -import { RuleTester, getFixturesRootDir } from '../RuleTester'; +import { getFixturesRootDir, RuleTester } from '../RuleTester'; const rootDir = getFixturesRootDir(); @@ -405,6 +405,57 @@ void doSomething(); `, options: [{ ignoreIIFE: true }], }, + { + code: ` +async function foo() { + const myPromise = async () => void 0; + const condition = true; + void (condition && myPromise()); +} + `, + }, + { + code: ` +async function foo() { + const myPromise = async () => void 0; + const condition = true; + await (condition && myPromise()); +} + `, + options: [{ ignoreVoid: false }], + }, + { + code: ` +async function foo() { + const myPromise = async () => void 0; + const condition = true; + condition && void myPromise(); +} + `, + }, + { + code: ` +async function foo() { + const myPromise = async () => void 0; + const condition = true; + condition && (await myPromise()); +} + `, + options: [{ ignoreVoid: false }], + }, + { + code: ` +async function foo() { + const myPromise = async () => void 0; + let condition = false; + condition && myPromise(); + condition = true; + condition || myPromise(); + condition ?? myPromise(); +} + `, + options: [{ ignoreVoid: false }], + }, ], invalid: [ @@ -500,7 +551,7 @@ doSomething(); async function test() { Promise.resolve('value'); } - `.trimRight(), + `, errors: [ { line: 3, @@ -512,7 +563,7 @@ async function test() { async function test() { void Promise.resolve('value'); } - `.trimRight(), + `, }, ], }, @@ -656,6 +707,147 @@ async function test() { { line: 3, messageId: 'floating', + suggestions: [ + { + messageId: 'floatingFixAwait', + output: ` +async function test() { + await Promise.resolve(); +} + `, + }, + ], + }, + ], + }, + { + code: ` +async function test() { + const promise = new Promise((resolve, reject) => resolve('value')); + promise; +} + `, + options: [{ ignoreVoid: false }], + errors: [ + { + line: 4, + messageId: 'floating', + suggestions: [ + { + messageId: 'floatingFixAwait', + output: ` +async function test() { + const promise = new Promise((resolve, reject) => resolve('value')); + await promise; +} + `, + }, + ], + }, + ], + }, + { + code: ` +async function returnsPromise() { + return 'value'; +} +void returnsPromise(); + `, + options: [{ ignoreVoid: false }], + errors: [ + { + line: 5, + messageId: 'floating', + suggestions: [ + { + messageId: 'floatingFixAwait', + output: ` +async function returnsPromise() { + return 'value'; +} +await returnsPromise(); + `, + }, + ], + }, + ], + }, + { + // eslint-disable-next-line @typescript-eslint/internal/plugin-test-formatting + code: ` +async function returnsPromise() { + return 'value'; +} +void /* ... */ returnsPromise(); + `, + options: [{ ignoreVoid: false }], + errors: [ + { + line: 5, + messageId: 'floating', + suggestions: [ + { + messageId: 'floatingFixAwait', + output: ` +async function returnsPromise() { + return 'value'; +} +await /* ... */ returnsPromise(); + `, + }, + ], + }, + ], + }, + { + code: ` +async function returnsPromise() { + return 'value'; +} +1, returnsPromise(); + `, + options: [{ ignoreVoid: false }], + errors: [ + { + line: 5, + messageId: 'floating', + suggestions: [ + { + messageId: 'floatingFixAwait', + output: ` +async function returnsPromise() { + return 'value'; +} +await (1, returnsPromise()); + `, + }, + ], + }, + ], + }, + { + code: ` +async function returnsPromise() { + return 'value'; +} +bool ? returnsPromise() : null; + `, + options: [{ ignoreVoid: false }], + errors: [ + { + line: 5, + messageId: 'floating', + suggestions: [ + { + messageId: 'floatingFixAwait', + output: ` +async function returnsPromise() { + return 'value'; +} +await (bool ? returnsPromise() : null); + `, + }, + ], }, ], }, @@ -976,5 +1168,264 @@ async function test() { }, ], }, + { + code: ` +async function foo() { + const myPromise = async () => void 0; + const condition = true; + + void condition || myPromise(); +} + `, + errors: [ + { + line: 6, + messageId: 'floatingVoid', + suggestions: [ + { + messageId: 'floatingFixVoid', + output: ` +async function foo() { + const myPromise = async () => void 0; + const condition = true; + + void (void condition || myPromise()); +} + `, + }, + ], + }, + ], + }, + { + code: ` +async function foo() { + const myPromise = async () => void 0; + const condition = true; + + (await condition) && myPromise(); +} + `, + options: [{ ignoreVoid: false }], + errors: [ + { + line: 6, + messageId: 'floating', + suggestions: [ + { + messageId: 'floatingFixAwait', + output: ` +async function foo() { + const myPromise = async () => void 0; + const condition = true; + + await ((await condition) && myPromise()); +} + `, + }, + ], + }, + ], + }, + { + code: ` +async function foo() { + const myPromise = async () => void 0; + const condition = true; + + condition && myPromise(); +} + `, + errors: [ + { + line: 6, + messageId: 'floatingVoid', + suggestions: [ + { + messageId: 'floatingFixVoid', + output: ` +async function foo() { + const myPromise = async () => void 0; + const condition = true; + + void (condition && myPromise()); +} + `, + }, + ], + }, + ], + }, + { + code: ` +async function foo() { + const myPromise = async () => void 0; + const condition = false; + + condition || myPromise(); +} + `, + errors: [ + { + line: 6, + messageId: 'floatingVoid', + suggestions: [ + { + messageId: 'floatingFixVoid', + output: ` +async function foo() { + const myPromise = async () => void 0; + const condition = false; + + void (condition || myPromise()); +} + `, + }, + ], + }, + ], + }, + { + code: ` +async function foo() { + const myPromise = async () => void 0; + const condition = null; + + condition ?? myPromise(); +} + `, + errors: [ + { + line: 6, + messageId: 'floatingVoid', + suggestions: [ + { + messageId: 'floatingFixVoid', + output: ` +async function foo() { + const myPromise = async () => void 0; + const condition = null; + + void (condition ?? myPromise()); +} + `, + }, + ], + }, + ], + }, + { + code: ` +async function foo() { + const myPromise = Promise.resolve(true); + let condition = true; + condition && myPromise; +} + `, + options: [{ ignoreVoid: false }], + errors: [ + { + line: 5, + messageId: 'floating', + suggestions: [ + { + messageId: 'floatingFixAwait', + output: ` +async function foo() { + const myPromise = Promise.resolve(true); + let condition = true; + await (condition && myPromise); +} + `, + }, + ], + }, + ], + }, + { + code: ` +async function foo() { + const myPromise = Promise.resolve(true); + let condition = false; + condition || myPromise; +} + `, + options: [{ ignoreVoid: false }], + errors: [ + { + line: 5, + messageId: 'floating', + suggestions: [ + { + messageId: 'floatingFixAwait', + output: ` +async function foo() { + const myPromise = Promise.resolve(true); + let condition = false; + await (condition || myPromise); +} + `, + }, + ], + }, + ], + }, + { + code: ` +async function foo() { + const myPromise = Promise.resolve(true); + let condition = null; + condition ?? myPromise; +} + `, + options: [{ ignoreVoid: false }], + errors: [ + { + line: 5, + messageId: 'floating', + suggestions: [ + { + messageId: 'floatingFixAwait', + output: ` +async function foo() { + const myPromise = Promise.resolve(true); + let condition = null; + await (condition ?? myPromise); +} + `, + }, + ], + }, + ], + }, + { + code: ` +async function foo() { + const myPromise = async () => void 0; + const condition = false; + + condition || condition || myPromise(); +} + `, + errors: [ + { + line: 6, + messageId: 'floatingVoid', + suggestions: [ + { + messageId: 'floatingFixVoid', + output: ` +async function foo() { + const myPromise = async () => void 0; + const condition = false; + + void (condition || condition || myPromise()); +} + `, + }, + ], + }, + ], + }, ], }); diff --git a/packages/eslint-plugin/tests/rules/no-for-in-array.test.ts b/packages/eslint-plugin/tests/rules/no-for-in-array.test.ts index 0fd7679a650..396a12d36f9 100644 --- a/packages/eslint-plugin/tests/rules/no-for-in-array.test.ts +++ b/packages/eslint-plugin/tests/rules/no-for-in-array.test.ts @@ -1,6 +1,7 @@ import { AST_NODE_TYPES } from '@typescript-eslint/utils'; + import rule from '../../src/rules/no-for-in-array'; -import { RuleTester, getFixturesRootDir } from '../RuleTester'; +import { getFixturesRootDir, RuleTester } from '../RuleTester'; const rootDir = getFixturesRootDir(); const ruleTester = new RuleTester({ diff --git a/packages/eslint-plugin/tests/rules/no-implicit-any-catch.test.ts b/packages/eslint-plugin/tests/rules/no-implicit-any-catch.test.ts index f8113555086..e04b03889ca 100644 --- a/packages/eslint-plugin/tests/rules/no-implicit-any-catch.test.ts +++ b/packages/eslint-plugin/tests/rules/no-implicit-any-catch.test.ts @@ -29,13 +29,13 @@ try { code: ` try { } catch (e3) {} - `.trim(), + `, errors: [ { - line: 2, + line: 3, column: 3, messageId: 'implicitAnyInCatch', - endLine: 2, + endLine: 3, endColumn: 16, suggestions: [ { @@ -43,7 +43,7 @@ try { output: ` try { } catch (e3: unknown) {} - `.trim(), + `, }, ], }, @@ -53,14 +53,14 @@ try { code: ` try { } catch (e4: any) {} - `.trim(), + `, options: [{ allowExplicitAny: false }], errors: [ { - line: 2, + line: 3, column: 3, messageId: 'explicitAnyInCatch', - endLine: 2, + endLine: 3, endColumn: 21, suggestions: [ { @@ -68,7 +68,7 @@ try { output: ` try { } catch (e4: unknown) {} - `.trim(), + `, }, ], }, diff --git a/packages/eslint-plugin/tests/rules/no-implied-eval.test.ts b/packages/eslint-plugin/tests/rules/no-implied-eval.test.ts index f9c5bd137d6..af15aa75851 100644 --- a/packages/eslint-plugin/tests/rules/no-implied-eval.test.ts +++ b/packages/eslint-plugin/tests/rules/no-implied-eval.test.ts @@ -1,5 +1,5 @@ import rule from '../../src/rules/no-implied-eval'; -import { RuleTester, getFixturesRootDir } from '../RuleTester'; +import { getFixturesRootDir, RuleTester } from '../RuleTester'; const rootDir = getFixturesRootDir(); const ruleTester = new RuleTester({ diff --git a/packages/eslint-plugin/tests/rules/no-import-type-side-effects.test.ts b/packages/eslint-plugin/tests/rules/no-import-type-side-effects.test.ts new file mode 100644 index 00000000000..9dade06a943 --- /dev/null +++ b/packages/eslint-plugin/tests/rules/no-import-type-side-effects.test.ts @@ -0,0 +1,44 @@ +import rule from '../../src/rules/no-import-type-side-effects'; +import { RuleTester } from '../RuleTester'; + +const ruleTester = new RuleTester({ + parser: '@typescript-eslint/parser', +}); + +ruleTester.run('no-import-type-side-effects', rule, { + valid: [ + "import T from 'mod';", + "import * as T from 'mod';", + "import { T } from 'mod';", + "import type { T } from 'mod';", + "import type { T, U } from 'mod';", + "import { type T, U } from 'mod';", + "import { T, type U } from 'mod';", + "import type T from 'mod';", + "import type T, { U } from 'mod';", + "import T, { type U } from 'mod';", + "import type * as T from 'mod';", + ], + invalid: [ + { + code: "import { type A } from 'mod';", + output: "import type { A } from 'mod';", + errors: [{ messageId: 'useTopLevelQualifier' }], + }, + { + code: "import { type A as AA } from 'mod';", + output: "import type { A as AA } from 'mod';", + errors: [{ messageId: 'useTopLevelQualifier' }], + }, + { + code: "import { type A, type B } from 'mod';", + output: "import type { A, B } from 'mod';", + errors: [{ messageId: 'useTopLevelQualifier' }], + }, + { + code: "import { type A as AA, type B as BB } from 'mod';", + output: "import type { A as AA, B as BB } from 'mod';", + errors: [{ messageId: 'useTopLevelQualifier' }], + }, + ], +}); diff --git a/packages/eslint-plugin/tests/rules/no-inferrable-types.test.ts b/packages/eslint-plugin/tests/rules/no-inferrable-types.test.ts index cfea578b9f6..5a085044685 100644 --- a/packages/eslint-plugin/tests/rules/no-inferrable-types.test.ts +++ b/packages/eslint-plugin/tests/rules/no-inferrable-types.test.ts @@ -1,10 +1,11 @@ -import { TSESLint } from '@typescript-eslint/utils'; +import type { TSESLint } from '@typescript-eslint/utils'; + import rule from '../../src/rules/no-inferrable-types'; -import { RuleTester } from '../RuleTester'; -import { +import type { InferMessageIdsTypeFromRule, InferOptionsTypeFromRule, } from '../../src/util'; +import { RuleTester } from '../RuleTester'; type MessageIds = InferMessageIdsTypeFromRule; type Options = InferOptionsTypeFromRule; diff --git a/packages/eslint-plugin/tests/rules/no-invalid-void-type.test.ts b/packages/eslint-plugin/tests/rules/no-invalid-void-type.test.ts index 0141da093b5..1a972b665be 100644 --- a/packages/eslint-plugin/tests/rules/no-invalid-void-type.test.ts +++ b/packages/eslint-plugin/tests/rules/no-invalid-void-type.test.ts @@ -119,6 +119,8 @@ ruleTester.run('allowInGenericTypeArguments: true', rule, { 'type Generic = [T];', 'type voidPromiseUnion = void | Promise;', 'type promiseNeverUnion = Promise | never;', + 'const arrowGeneric1 = (arg: T) => {};', + 'declare function functionDeclaration1(arg: T): void;', ], invalid: [ { @@ -141,16 +143,6 @@ ruleTester.run('allowInGenericTypeArguments: true', rule, { }, ], }, - { - code: 'const arrowGeneric1 = (arg: T) => {};', - errors: [ - { - messageId: 'invalidVoidNotReturnOrGeneric', - line: 1, - column: 28, - }, - ], - }, { code: 'const arrowGeneric2 = (arg: T) => {};', errors: [ @@ -159,11 +151,6 @@ ruleTester.run('allowInGenericTypeArguments: true', rule, { line: 1, column: 34, }, - { - messageId: 'invalidVoidNotReturnOrGeneric', - line: 1, - column: 41, - }, ], }, { @@ -176,16 +163,6 @@ ruleTester.run('allowInGenericTypeArguments: true', rule, { }, ], }, - { - code: 'function functionGeneric1(arg: T) {}', - errors: [ - { - messageId: 'invalidVoidNotReturnOrGeneric', - line: 1, - column: 31, - }, - ], - }, { code: 'function functionGeneric2(arg: T) {}', errors: [ @@ -194,11 +171,6 @@ ruleTester.run('allowInGenericTypeArguments: true', rule, { line: 1, column: 37, }, - { - messageId: 'invalidVoidNotReturnOrGeneric', - line: 1, - column: 44, - }, ], }, { @@ -211,16 +183,6 @@ ruleTester.run('allowInGenericTypeArguments: true', rule, { }, ], }, - { - code: 'declare function functionDeclaration1(arg: T): void;', - errors: [ - { - messageId: 'invalidVoidNotReturnOrGeneric', - line: 1, - column: 43, - }, - ], - }, { code: 'declare function functionDeclaration2(arg: T): void;', errors: [ @@ -229,11 +191,6 @@ ruleTester.run('allowInGenericTypeArguments: true', rule, { line: 1, column: 49, }, - { - messageId: 'invalidVoidNotReturnOrGeneric', - line: 1, - column: 56, - }, ], }, { @@ -359,7 +316,7 @@ ruleTester.run('allowInGenericTypeArguments: true', rule, { code: 'type UnionType2 = string | number | void;', errors: [ { - messageId: 'invalidVoidNotReturnOrGeneric', + messageId: 'invalidVoidUnionConstituent', line: 1, column: 37, }, @@ -369,12 +326,32 @@ ruleTester.run('allowInGenericTypeArguments: true', rule, { code: 'type UnionType3 = string | ((number & any) | (string | void));', errors: [ { - messageId: 'invalidVoidNotReturnOrGeneric', + messageId: 'invalidVoidUnionConstituent', line: 1, column: 56, }, ], }, + { + code: 'declare function test(): number | void;', + errors: [ + { + messageId: 'invalidVoidUnionConstituent', + line: 1, + column: 35, + }, + ], + }, + { + code: 'declare function test(): T;', + errors: [ + { + messageId: 'invalidVoidUnionConstituent', + line: 1, + column: 42, + }, + ], + }, { code: 'type IntersectionType = string & number & void;', errors: [ @@ -437,7 +414,7 @@ ruleTester.run('allowInGenericTypeArguments: true', rule, { code: 'type invalidVoidUnion = void | Map;', errors: [ { - messageId: 'invalidVoidNotReturnOrGeneric', + messageId: 'invalidVoidUnionConstituent', line: 1, column: 25, }, diff --git a/packages/eslint-plugin/tests/rules/no-loop-func.test.ts b/packages/eslint-plugin/tests/rules/no-loop-func.test.ts index 4ad0153cc20..37be3ec45d6 100644 --- a/packages/eslint-plugin/tests/rules/no-loop-func.test.ts +++ b/packages/eslint-plugin/tests/rules/no-loop-func.test.ts @@ -1,4 +1,5 @@ import { AST_NODE_TYPES } from '@typescript-eslint/utils'; + import rule from '../../src/rules/no-loop-func'; import { RuleTester } from '../RuleTester'; diff --git a/packages/eslint-plugin/tests/rules/no-magic-numbers.test.ts b/packages/eslint-plugin/tests/rules/no-magic-numbers.test.ts index 3be7590742a..d6aa21a799e 100644 --- a/packages/eslint-plugin/tests/rules/no-magic-numbers.test.ts +++ b/packages/eslint-plugin/tests/rules/no-magic-numbers.test.ts @@ -536,6 +536,9 @@ type Foo = { [K in keyof Other]: \`\${K & number}\`; }; `, + dependencyConstraints: { + typescript: '4.1', + }, options: [{ ignoreTypeIndexes: true }], errors: [ { diff --git a/packages/eslint-plugin/tests/rules/no-meaningless-void-operator.test.ts b/packages/eslint-plugin/tests/rules/no-meaningless-void-operator.test.ts index 5e034f2904b..0cd71da26cb 100644 --- a/packages/eslint-plugin/tests/rules/no-meaningless-void-operator.test.ts +++ b/packages/eslint-plugin/tests/rules/no-meaningless-void-operator.test.ts @@ -1,5 +1,5 @@ import rule from '../../src/rules/no-meaningless-void-operator'; -import { RuleTester, getFixturesRootDir } from '../RuleTester'; +import { getFixturesRootDir, RuleTester } from '../RuleTester'; const rootDir = getFixturesRootDir(); @@ -67,7 +67,7 @@ foo(); function bar(x: never) { void x; } - `.trimRight(), + `, errors: [ { messageId: 'meaninglessVoidOperator', @@ -80,7 +80,7 @@ function bar(x: never) { function bar(x: never) { x; } - `.trimRight(), + `, }, ], }, diff --git a/packages/eslint-plugin/tests/rules/no-misused-promises.test.ts b/packages/eslint-plugin/tests/rules/no-misused-promises.test.ts index 1551cfbfcf3..c962761717d 100644 --- a/packages/eslint-plugin/tests/rules/no-misused-promises.test.ts +++ b/packages/eslint-plugin/tests/rules/no-misused-promises.test.ts @@ -1,5 +1,5 @@ import rule from '../../src/rules/no-misused-promises'; -import { RuleTester, getFixturesRootDir } from '../RuleTester'; +import { getFixturesRootDir, RuleTester } from '../RuleTester'; const rootDir = getFixturesRootDir(); @@ -373,6 +373,60 @@ console.log([...Promise.resolve(42)]); `, options: [{ checksSpreads: false }], }, + ` +function spreadAny(..._args: any): void {} + +spreadAny( + true, + () => Promise.resolve(1), + () => Promise.resolve(false), +); + `, + ` +function spreadArrayAny(..._args: Array): void {} + +spreadArrayAny( + true, + () => Promise.resolve(1), + () => Promise.resolve(false), +); + `, + ` +function spreadArrayUnknown(..._args: Array): void {} + +spreadArrayUnknown(() => Promise.resolve(true), 1, 2); + +function spreadArrayFuncPromise( + ..._args: Array<() => Promise> +): void {} + +spreadArrayFuncPromise( + () => Promise.resolve(undefined), + () => Promise.resolve(undefined), +); + `, + // Prettier adds a () but this tests arguments being undefined, not [] + // eslint-disable-next-line @typescript-eslint/internal/plugin-test-formatting + ` +class TakeCallbacks { + constructor(...callbacks: Array<() => void>) {} +} + +new TakeCallbacks; +new TakeCallbacks(); +new TakeCallbacks( + () => 1, + () => true, +); + `, + ` +function restTuple(...args: []): void; +function restTuple(...args: [string]): void; +function restTuple(..._args: string[]): void {} + +restTuple(); +restTuple('Hello'); + `, ], invalid: [ @@ -970,5 +1024,99 @@ console.log({ ...(condition ? Promise.resolve({ key: 42 }) : {}) }); { line: 7, messageId: 'spread' }, ], }, + { + code: ` +function restPromises(first: Boolean, ...callbacks: Array<() => void>): void {} + +restPromises( + true, + () => Promise.resolve(true), + () => Promise.resolve(null), + () => true, + () => Promise.resolve('Hello'), +); + `, + errors: [ + { line: 6, messageId: 'voidReturnArgument' }, + { line: 7, messageId: 'voidReturnArgument' }, + { line: 9, messageId: 'voidReturnArgument' }, + ], + }, + { + code: ` +type MyUnion = (() => void) | boolean; + +function restUnion(first: string, ...callbacks: Array): void {} +restUnion('Testing', false, () => Promise.resolve(true)); + `, + errors: [{ line: 5, messageId: 'voidReturnArgument' }], + }, + { + code: ` +function restTupleOne(first: string, ...callbacks: [() => void]): void {} +restTupleOne('My string', () => Promise.resolve(1)); + `, + errors: [{ line: 3, messageId: 'voidReturnArgument' }], + }, + { + code: ` +function restTupleTwo( + first: boolean, + ...callbacks: [undefined, () => void, undefined] +): void {} + +restTupleTwo(true, undefined, () => Promise.resolve(true), undefined); + `, + errors: [{ line: 7, messageId: 'voidReturnArgument' }], + }, + { + code: ` +function restTupleFour( + first: number, + ...callbacks: [() => void, boolean, () => void, () => void] +): void; + +restTupleFour( + 1, + () => Promise.resolve(true), + false, + () => {}, + () => Promise.resolve(1), +); + `, + errors: [ + { line: 9, messageId: 'voidReturnArgument' }, + { line: 12, messageId: 'voidReturnArgument' }, + ], + }, + { + // Prettier adds a () but this tests arguments being undefined, not [] + // eslint-disable-next-line @typescript-eslint/internal/plugin-test-formatting + code: ` +class TakesVoidCb { + constructor(first: string, ...args: Array<() => void>); +} + +new TakesVoidCb; +new TakesVoidCb(); +new TakesVoidCb( + 'Testing', + () => {}, + () => Promise.resolve(true), +); + `, + errors: [{ line: 11, messageId: 'voidReturnArgument' }], + }, + { + code: ` +function restTuple(...args: []): void; +function restTuple(...args: [boolean, () => void]): void; +function restTuple(..._args: any[]): void {} + +restTuple(); +restTuple(true, () => Promise.resolve(1)); + `, + errors: [{ line: 7, messageId: 'voidReturnArgument' }], + }, ], }); diff --git a/packages/eslint-plugin/tests/rules/no-non-null-asserted-nullish-coalescing.test.ts b/packages/eslint-plugin/tests/rules/no-non-null-asserted-nullish-coalescing.test.ts index 3b47a3c2bf0..f197593f59d 100644 --- a/packages/eslint-plugin/tests/rules/no-non-null-asserted-nullish-coalescing.test.ts +++ b/packages/eslint-plugin/tests/rules/no-non-null-asserted-nullish-coalescing.test.ts @@ -1,5 +1,5 @@ import rule from '../../src/rules/no-non-null-asserted-nullish-coalescing'; -import { RuleTester, noFormat } from '../RuleTester'; +import { noFormat, RuleTester } from '../RuleTester'; const ruleTester = new RuleTester({ parser: '@typescript-eslint/parser', @@ -178,7 +178,7 @@ ruleTester.run('no-non-null-asserted-nullish-coalescing', rule, { code: ` let x!: string; x! ?? ''; - `.trimRight(), + `, errors: [ { messageId: 'noNonNullAssertedNullishCoalescing', @@ -188,7 +188,7 @@ x! ?? ''; output: ` let x!: string; x ?? ''; - `.trimRight(), + `, }, ], }, @@ -199,7 +199,7 @@ x ?? ''; let x: string; x = foo(); x! ?? ''; - `.trimRight(), + `, errors: [ { messageId: 'noNonNullAssertedNullishCoalescing', @@ -210,7 +210,7 @@ x! ?? ''; let x: string; x = foo(); x ?? ''; - `.trimRight(), + `, }, ], }, @@ -222,7 +222,7 @@ let x: string; x = foo(); x! ?? ''; x = foo(); - `.trimRight(), + `, errors: [ { messageId: 'noNonNullAssertedNullishCoalescing', @@ -234,7 +234,7 @@ let x: string; x = foo(); x ?? ''; x = foo(); - `.trimRight(), + `, }, ], }, @@ -244,7 +244,7 @@ x = foo(); code: ` let x = foo(); x! ?? ''; - `.trimRight(), + `, errors: [ { messageId: 'noNonNullAssertedNullishCoalescing', @@ -254,7 +254,7 @@ x! ?? ''; output: ` let x = foo(); x ?? ''; - `.trimRight(), + `, }, ], }, @@ -266,7 +266,7 @@ function foo() { let x!: string; return x! ?? ''; } - `.trimRight(), + `, errors: [ { messageId: 'noNonNullAssertedNullishCoalescing', @@ -278,7 +278,7 @@ function foo() { let x!: string; return x ?? ''; } - `.trimRight(), + `, }, ], }, @@ -290,7 +290,7 @@ let x!: string; function foo() { return x! ?? ''; } - `.trimRight(), + `, errors: [ { messageId: 'noNonNullAssertedNullishCoalescing', @@ -302,7 +302,7 @@ let x!: string; function foo() { return x ?? ''; } - `.trimRight(), + `, }, ], }, @@ -312,17 +312,17 @@ function foo() { code: noFormat` let x = foo(); x ! ?? ''; - `.trimRight(), + `, errors: [ { messageId: 'noNonNullAssertedNullishCoalescing', suggestions: [ { messageId: 'suggestRemovingNonNull', - output: noFormat` + output: ` let x = foo(); x ?? ''; - `.trimRight(), + `, }, ], }, diff --git a/packages/eslint-plugin/tests/rules/no-non-null-asserted-optional-chain.test.ts b/packages/eslint-plugin/tests/rules/no-non-null-asserted-optional-chain.test.ts index 12406d1dc41..5f7caabc5b0 100644 --- a/packages/eslint-plugin/tests/rules/no-non-null-asserted-optional-chain.test.ts +++ b/packages/eslint-plugin/tests/rules/no-non-null-asserted-optional-chain.test.ts @@ -1,5 +1,5 @@ import rule from '../../src/rules/no-non-null-asserted-optional-chain'; -import { RuleTester, noFormat } from '../RuleTester'; +import { noFormat, RuleTester } from '../RuleTester'; const ruleTester = new RuleTester({ parser: '@typescript-eslint/parser', @@ -87,7 +87,7 @@ ruleTester.run('no-non-null-asserted-optional-chain', rule, { suggestions: [ { messageId: 'suggestRemovingNonNull', - output: noFormat`(foo?.bar).baz`, + output: `(foo?.bar).baz`, }, ], }, @@ -101,7 +101,7 @@ ruleTester.run('no-non-null-asserted-optional-chain', rule, { suggestions: [ { messageId: 'suggestRemovingNonNull', - output: noFormat`(foo?.bar)().baz`, + output: `(foo?.bar)().baz`, }, ], }, @@ -115,7 +115,7 @@ ruleTester.run('no-non-null-asserted-optional-chain', rule, { suggestions: [ { messageId: 'suggestRemovingNonNull', - output: noFormat`(foo?.bar)`, + output: `(foo?.bar)`, }, ], }, @@ -129,7 +129,7 @@ ruleTester.run('no-non-null-asserted-optional-chain', rule, { suggestions: [ { messageId: 'suggestRemovingNonNull', - output: noFormat`(foo?.bar)()`, + output: `(foo?.bar)()`, }, ], }, @@ -143,7 +143,7 @@ ruleTester.run('no-non-null-asserted-optional-chain', rule, { suggestions: [ { messageId: 'suggestRemovingNonNull', - output: noFormat`(foo?.bar)`, + output: `(foo?.bar)`, }, ], }, @@ -157,7 +157,7 @@ ruleTester.run('no-non-null-asserted-optional-chain', rule, { suggestions: [ { messageId: 'suggestRemovingNonNull', - output: noFormat`(foo?.bar)()`, + output: `(foo?.bar)()`, }, ], }, diff --git a/packages/eslint-plugin/tests/rules/no-redeclare.test.ts b/packages/eslint-plugin/tests/rules/no-redeclare.test.ts index bd3384b3631..fcaf99e409d 100644 --- a/packages/eslint-plugin/tests/rules/no-redeclare.test.ts +++ b/packages/eslint-plugin/tests/rules/no-redeclare.test.ts @@ -1,6 +1,7 @@ import { AST_NODE_TYPES, AST_TOKEN_TYPES } from '@typescript-eslint/utils'; -import { RuleTester } from '../RuleTester'; + import rule from '../../src/rules/no-redeclare'; +import { RuleTester } from '../RuleTester'; const ruleTester = new RuleTester({ parserOptions: { diff --git a/packages/eslint-plugin/tests/rules/no-redundant-type-constituents.test.ts b/packages/eslint-plugin/tests/rules/no-redundant-type-constituents.test.ts index 4994459278f..29259f4b3f0 100644 --- a/packages/eslint-plugin/tests/rules/no-redundant-type-constituents.test.ts +++ b/packages/eslint-plugin/tests/rules/no-redundant-type-constituents.test.ts @@ -1,5 +1,5 @@ import rule from '../../src/rules/no-redundant-type-constituents'; -import { RuleTester, getFixturesRootDir } from '../RuleTester'; +import { getFixturesRootDir, RuleTester } from '../RuleTester'; const rootDir = getFixturesRootDir(); const ruleTester = new RuleTester({ @@ -154,11 +154,21 @@ ruleTester.run('no-redundant-type-constituents', rule, { type B = string; type T = B & null; `, - 'type T = `${string}` & null;', - ` - type B = \`\${string}\`; - type T = B & null; - `, + { + code: 'type T = `${string}` & null;', + dependencyConstraints: { + typescript: '4.1', + }, + }, + { + code: ` + type B = \`\${string}\`; + type T = B & null; + `, + dependencyConstraints: { + typescript: '4.1', + }, + }, ], invalid: [ @@ -442,6 +452,9 @@ ruleTester.run('no-redundant-type-constituents', rule, { }, { code: 'type T = `a${number}c` | string;', + dependencyConstraints: { + typescript: '4.1', + }, errors: [ { column: 10, @@ -458,6 +471,9 @@ ruleTester.run('no-redundant-type-constituents', rule, { type B = \`a\${number}c\`; type T = B | string; `, + dependencyConstraints: { + typescript: '4.1', + }, errors: [ { column: 18, @@ -471,6 +487,9 @@ ruleTester.run('no-redundant-type-constituents', rule, { }, { code: 'type T = `${number}` | string;', + dependencyConstraints: { + typescript: '4.1', + }, errors: [ { column: 10, diff --git a/packages/eslint-plugin/tests/rules/no-restricted-imports.test.ts b/packages/eslint-plugin/tests/rules/no-restricted-imports.test.ts index 64f9c91fe7c..b93c8d7e41b 100644 --- a/packages/eslint-plugin/tests/rules/no-restricted-imports.test.ts +++ b/packages/eslint-plugin/tests/rules/no-restricted-imports.test.ts @@ -1,4 +1,5 @@ import { AST_NODE_TYPES } from '@typescript-eslint/utils'; + import rule from '../../src/rules/no-restricted-imports'; import { RuleTester } from '../RuleTester'; diff --git a/packages/eslint-plugin/tests/rules/no-shadow/no-shadow-eslint.test.ts b/packages/eslint-plugin/tests/rules/no-shadow/no-shadow-eslint.test.ts index 3191e0d9fbf..bd4f9bfdee6 100644 --- a/packages/eslint-plugin/tests/rules/no-shadow/no-shadow-eslint.test.ts +++ b/packages/eslint-plugin/tests/rules/no-shadow/no-shadow-eslint.test.ts @@ -5,6 +5,7 @@ 'use strict'; import { AST_NODE_TYPES } from '@typescript-eslint/utils'; + import rule from '../../../src/rules/no-shadow'; import { RuleTester } from '../../RuleTester'; diff --git a/packages/eslint-plugin/tests/rules/no-shadow/no-shadow.test.ts b/packages/eslint-plugin/tests/rules/no-shadow/no-shadow.test.ts index a09eae00932..854154ff096 100644 --- a/packages/eslint-plugin/tests/rules/no-shadow/no-shadow.test.ts +++ b/packages/eslint-plugin/tests/rules/no-shadow/no-shadow.test.ts @@ -1,4 +1,5 @@ import { AST_NODE_TYPES } from '@typescript-eslint/utils'; + import rule from '../../../src/rules/no-shadow'; import { RuleTester } from '../../RuleTester'; @@ -11,6 +12,25 @@ const ruleTester = new RuleTester({ ruleTester.run('no-shadow TS tests', rule, { valid: [ + 'function foo any>(arg: T) {}', + 'function foo any>(arg: T) {}', + 'function foo any>(arg: T) {}', + 'function foo any>(fn: T, args: any[]) {}', + 'function foo any>(fn: T, args: any[]) {}', + 'function foo any>(fn: T, ...args: any[]) {}', + 'function foo any>(fn: T, args: any[]) {}', + 'function foo any>(fn: T, args: any[]) {}', + 'function foo any>(fn: T, args: any) {}', + ` +function foo any>( + fn: T, + ...args: any[] +) {} + `, + ` +type Args = 1; +function foo void>(arg: T) {} + `, // nested conditional types ` export type ArrayInput = Func extends (arg0: Array) => any @@ -125,6 +145,27 @@ type Fn = (Foo: string) => typeof Foo; Foo: 'writable', }, }, + // https://github.com/typescript-eslint/typescript-eslint/issues/6098 + { + code: ` +const arg = 0; + +interface Test { + (arg: string): typeof arg; +} + `, + options: [{ ignoreFunctionTypeParameterNameValueShadow: true }], + }, + { + code: ` +const arg = 0; + +interface Test { + p1(arg: string): typeof arg; +} + `, + options: [{ ignoreFunctionTypeParameterNameValueShadow: true }], + }, // https://github.com/typescript-eslint/typescript-eslint/issues/2724 { code: ` @@ -200,6 +241,9 @@ import { type foo } from './foo'; // 'foo' is already declared in the upper scope function doThing(foo: number) {} `, + dependencyConstraints: { + typescript: '4.5', + }, options: [{ ignoreTypeValueShadow: true }], }, { @@ -374,6 +418,22 @@ type T = 1; }, { code: ` +type T = 1; +function foo(arg: T) {} + `, + errors: [ + { + messageId: 'noShadow', + data: { + name: 'T', + shadowedLine: 2, + shadowedColumn: 6, + }, + }, + ], + }, + { + code: ` function foo() { return function () {}; } @@ -391,6 +451,22 @@ function foo() { }, { code: ` +type T = string; +function foo void>(arg: T) {} + `, + errors: [ + { + messageId: 'noShadow', + data: { + name: 'T', + shadowedLine: 2, + shadowedColumn: 6, + }, + }, + ], + }, + { + code: ` const x = 1; { type x = string; @@ -470,6 +546,48 @@ type Fn = (Foo: string) => typeof Foo; }, ], }, + + // https://github.com/typescript-eslint/typescript-eslint/issues/6098 + { + code: ` +const arg = 0; + +interface Test { + (arg: string): typeof arg; +} + `, + options: [{ ignoreFunctionTypeParameterNameValueShadow: false }], + errors: [ + { + messageId: 'noShadow', + data: { + name: 'arg', + shadowedLine: 2, + shadowedColumn: 7, + }, + }, + ], + }, + { + code: ` +const arg = 0; + +interface Test { + p1(arg: string): typeof arg; +} + `, + options: [{ ignoreFunctionTypeParameterNameValueShadow: false }], + errors: [ + { + messageId: 'noShadow', + data: { + name: 'arg', + shadowedLine: 2, + shadowedColumn: 7, + }, + }, + ], + }, { code: ` import type { foo } from './foo'; @@ -493,6 +611,9 @@ function doThing(foo: number) {} import { type foo } from './foo'; function doThing(foo: number) {} `, + dependencyConstraints: { + typescript: '4.5', + }, options: [{ ignoreTypeValueShadow: false }], errors: [ { @@ -620,6 +741,9 @@ declare module 'baz' { } } `, + dependencyConstraints: { + typescript: '4.5', + }, errors: [ { messageId: 'noShadow', @@ -640,6 +764,9 @@ declare module 'bar' { export type Foo = string; } `, + dependencyConstraints: { + typescript: '4.5', + }, errors: [ { messageId: 'noShadow', @@ -662,6 +789,9 @@ declare module 'bar' { } } `, + dependencyConstraints: { + typescript: '4.5', + }, errors: [ { messageId: 'noShadow', @@ -702,5 +832,29 @@ let y; }, ], }, + { + code: ` +function foo any>(fn: T, args: any[]) {} + `, + options: [ + { + ignoreTypeValueShadow: false, + builtinGlobals: true, + }, + ], + globals: { + args: 'writable', + }, + errors: [ + { + messageId: 'noShadowGlobal', + data: { + name: 'args', + shadowedLine: 2, + shadowedColumn: 5, + }, + }, + ], + }, ], }); diff --git a/packages/eslint-plugin/tests/rules/no-this-alias.test.ts b/packages/eslint-plugin/tests/rules/no-this-alias.test.ts index 0d2832ec2ef..942fcf810ff 100644 --- a/packages/eslint-plugin/tests/rules/no-this-alias.test.ts +++ b/packages/eslint-plugin/tests/rules/no-this-alias.test.ts @@ -1,4 +1,5 @@ import { AST_NODE_TYPES } from '@typescript-eslint/utils'; + import rule from '../../src/rules/no-this-alias'; import { RuleTester } from '../RuleTester'; diff --git a/packages/eslint-plugin/tests/rules/no-throw-literal.test.ts b/packages/eslint-plugin/tests/rules/no-throw-literal.test.ts index 30cd30c1f5a..a85614327cf 100644 --- a/packages/eslint-plugin/tests/rules/no-throw-literal.test.ts +++ b/packages/eslint-plugin/tests/rules/no-throw-literal.test.ts @@ -1,5 +1,5 @@ import rule from '../../src/rules/no-throw-literal'; -import { RuleTester, getFixturesRootDir } from '../RuleTester'; +import { getFixturesRootDir, RuleTester } from '../RuleTester'; const ruleTester = new RuleTester({ parserOptions: { diff --git a/packages/eslint-plugin/tests/rules/no-type-alias.test.ts b/packages/eslint-plugin/tests/rules/no-type-alias.test.ts index 6a307454f51..ed2c00c9991 100644 --- a/packages/eslint-plugin/tests/rules/no-type-alias.test.ts +++ b/packages/eslint-plugin/tests/rules/no-type-alias.test.ts @@ -133,62 +133,107 @@ ruleTester.run('no-type-alias', rule, { }, { code: 'type Foo = `a-${number}`;', + dependencyConstraints: { + typescript: '4.1', + }, options: [{ allowAliases: 'always' }], }, { code: 'type Foo = `a-${number}` | `b-${number}`;', + dependencyConstraints: { + typescript: '4.1', + }, options: [{ allowAliases: 'always' }], }, { code: 'type Foo = `a-${number}` | `b-${number}`;', + dependencyConstraints: { + typescript: '4.1', + }, options: [{ allowAliases: 'in-unions-and-intersections' }], }, { code: 'type Foo = `a-${number}` | `b-${number}`;', + dependencyConstraints: { + typescript: '4.1', + }, options: [{ allowAliases: 'in-unions' }], }, { code: 'type Foo = `a-${number}` | `b-${number}` | `c-${number}`;', + dependencyConstraints: { + typescript: '4.1', + }, options: [{ allowAliases: 'always' }], }, { code: 'type Foo = `a-${number}` | `b-${number}` | `c-${number}`;', + dependencyConstraints: { + typescript: '4.1', + }, options: [{ allowAliases: 'in-unions-and-intersections' }], }, { code: 'type Foo = `a-${number}` | `b-${number}` | `c-${number}`;', + dependencyConstraints: { + typescript: '4.1', + }, options: [{ allowAliases: 'in-unions' }], }, { code: 'type Foo = `a-${number}` & `b-${number}`;', + dependencyConstraints: { + typescript: '4.1', + }, options: [{ allowAliases: 'always' }], }, { code: 'type Foo = `a-${number}` & `b-${number}`;', + dependencyConstraints: { + typescript: '4.1', + }, options: [{ allowAliases: 'in-unions-and-intersections' }], }, { code: 'type Foo = `a-${number}` & `b-${number}`;', + dependencyConstraints: { + typescript: '4.1', + }, options: [{ allowAliases: 'in-intersections' }], }, { code: 'type Foo = `a-${number}` & `b-${number}` & `c-${number}`;', + dependencyConstraints: { + typescript: '4.1', + }, options: [{ allowAliases: 'always' }], }, { code: 'type Foo = `a-${number}` & `b-${number}` & `c-${number}`;', + dependencyConstraints: { + typescript: '4.1', + }, options: [{ allowAliases: 'in-unions-and-intersections' }], }, { code: 'type Foo = `a-${number}` & `b-${number}` & `c-${number}`;', + dependencyConstraints: { + typescript: '4.1', + }, options: [{ allowAliases: 'in-intersections' }], }, { code: 'type Foo = `a-${number}` | (`b-${number}` & `c-${number}`);', + dependencyConstraints: { + typescript: '4.1', + }, options: [{ allowAliases: 'always' }], }, { code: 'type Foo = `a-${number}` | (`b-${number}` & `c-${number}`);', + dependencyConstraints: { + typescript: '4.1', + }, options: [{ allowAliases: 'in-unions-and-intersections' }], }, { @@ -3402,6 +3447,9 @@ type Foo = { }, { code: 'type Foo = `foo-${number}`;', + dependencyConstraints: { + typescript: '4.1', + }, errors: [ { messageId: 'noTypeAlias', @@ -3415,6 +3463,9 @@ type Foo = { }, { code: 'type Foo = `a-${number}` | `b-${number}`;', + dependencyConstraints: { + typescript: '4.1', + }, options: [{ allowAliases: 'never' }], errors: [ { @@ -3439,6 +3490,9 @@ type Foo = { }, { code: 'type Foo = `a-${number}` & `b-${number}`;', + dependencyConstraints: { + typescript: '4.1', + }, options: [{ allowAliases: 'never' }], errors: [ { diff --git a/packages/eslint-plugin/tests/rules/no-unnecessary-boolean-literal-compare.test.ts b/packages/eslint-plugin/tests/rules/no-unnecessary-boolean-literal-compare.test.ts index 7896fe00de8..a519e5f11a0 100644 --- a/packages/eslint-plugin/tests/rules/no-unnecessary-boolean-literal-compare.test.ts +++ b/packages/eslint-plugin/tests/rules/no-unnecessary-boolean-literal-compare.test.ts @@ -1,5 +1,5 @@ import rule from '../../src/rules/no-unnecessary-boolean-literal-compare'; -import { RuleTester, getFixturesRootDir } from '../RuleTester'; +import { getFixturesRootDir, RuleTester } from '../RuleTester'; const rootDir = getFixturesRootDir(); const ruleTester = new RuleTester({ diff --git a/packages/eslint-plugin/tests/rules/no-unnecessary-condition.test.ts b/packages/eslint-plugin/tests/rules/no-unnecessary-condition.test.ts index 3e86749956c..af8b189f899 100644 --- a/packages/eslint-plugin/tests/rules/no-unnecessary-condition.test.ts +++ b/packages/eslint-plugin/tests/rules/no-unnecessary-condition.test.ts @@ -1,13 +1,15 @@ -import { - TestCaseError, +import type { InvalidTestCase, + TestCaseError, } from '@typescript-eslint/utils/dist/ts-eslint'; import * as path from 'path'; -import rule, { - Options, + +import type { MessageId, + Options, } from '../../src/rules/no-unnecessary-condition'; -import { RuleTester, getFixturesRootDir, noFormat } from '../RuleTester'; +import rule from '../../src/rules/no-unnecessary-condition'; +import { getFixturesRootDir, noFormat, RuleTester } from '../RuleTester'; const rootPath = getFixturesRootDir(); @@ -43,7 +45,7 @@ const unnecessaryConditionTest = ( errors: [ruleError(4, 12, messageId)], }); -ruleTester.run('no-unnecessary-conditionals', rule, { +ruleTester.run('no-unnecessary-condition', rule, { valid: [ ` declare const b1: boolean; @@ -65,6 +67,11 @@ for (let i = 0; b1 && b2; i++) { } const t1 = b1 && b2 ? 'yes' : 'no'; for (;;) {} + `, + ` +declare function foo(): number | void; +const result1 = foo() === undefined; +const result2 = foo() == null; `, necessaryConditionTest('false | 5'), // Truthy literal and falsy literal necessaryConditionTest('boolean | "foo"'), // boolean and truthy literal @@ -520,6 +527,24 @@ if (x) { tsconfigRootDir: path.join(rootPath, 'unstrict'), }, }, + ` +interface Foo { + [key: string]: [string] | undefined; +} + +type OptionalFoo = Foo | undefined; +declare const foo: OptionalFoo; +foo?.test?.length; + `, + ` +interface Foo { + [key: number]: [string] | undefined; +} + +type OptionalFoo = Foo | undefined; +declare const foo: OptionalFoo; +foo?.[1]?.length; + `, ], invalid: [ // Ensure that it's checking in all the right places @@ -914,7 +939,7 @@ foo ?. foo ?. bar; `, - output: noFormat` + output: ` let foo = { bar: true }; foo.bar; foo . bar; @@ -1541,5 +1566,36 @@ if (x) { tsconfigRootDir: path.join(rootPath, 'unstrict'), }, }, + { + code: ` +interface Foo { + test: string; + [key: string]: [string] | undefined; +} + +type OptionalFoo = Foo | undefined; +declare const foo: OptionalFoo; +foo?.test?.length; + `, + output: ` +interface Foo { + test: string; + [key: string]: [string] | undefined; +} + +type OptionalFoo = Foo | undefined; +declare const foo: OptionalFoo; +foo?.test.length; + `, + errors: [ + { + messageId: 'neverOptionalChain', + line: 9, + endLine: 9, + column: 10, + endColumn: 12, + }, + ], + }, ], }); diff --git a/packages/eslint-plugin/tests/rules/no-unnecessary-qualifier.test.ts b/packages/eslint-plugin/tests/rules/no-unnecessary-qualifier.test.ts index 7dd7fd2747d..391f84ac5da 100644 --- a/packages/eslint-plugin/tests/rules/no-unnecessary-qualifier.test.ts +++ b/packages/eslint-plugin/tests/rules/no-unnecessary-qualifier.test.ts @@ -1,6 +1,7 @@ import { AST_NODE_TYPES } from '@typescript-eslint/utils'; + import rule from '../../src/rules/no-unnecessary-qualifier'; -import { RuleTester, getFixturesRootDir } from '../RuleTester'; +import { getFixturesRootDir, RuleTester } from '../RuleTester'; const rootPath = getFixturesRootDir(); diff --git a/packages/eslint-plugin/tests/rules/no-unnecessary-type-arguments.test.ts b/packages/eslint-plugin/tests/rules/no-unnecessary-type-arguments.test.ts index 4005f7a54e0..abedc24d274 100644 --- a/packages/eslint-plugin/tests/rules/no-unnecessary-type-arguments.test.ts +++ b/packages/eslint-plugin/tests/rules/no-unnecessary-type-arguments.test.ts @@ -1,5 +1,5 @@ import rule from '../../src/rules/no-unnecessary-type-arguments'; -import { RuleTester, getFixturesRootDir } from '../RuleTester'; +import { getFixturesRootDir, RuleTester } from '../RuleTester'; const rootPath = getFixturesRootDir(); @@ -127,11 +127,17 @@ class Foo extends Bar {} interface Bar {} class Foo implements Bar {} `, - ` + { + code: ` import { F } from './missing'; function bar() {} bar>(); - `, + `, + dependencyConstraints: { + // TS 4.5 improved type resolution for unresolved generics + typescript: '4.5', + }, + }, ` type A = T; type B = A; diff --git a/packages/eslint-plugin/tests/rules/no-unnecessary-type-assertion.test.ts b/packages/eslint-plugin/tests/rules/no-unnecessary-type-assertion.test.ts index 3b6c8168ce8..8b5bec5f592 100644 --- a/packages/eslint-plugin/tests/rules/no-unnecessary-type-assertion.test.ts +++ b/packages/eslint-plugin/tests/rules/no-unnecessary-type-assertion.test.ts @@ -1,6 +1,7 @@ import path from 'path'; + import rule from '../../src/rules/no-unnecessary-type-assertion'; -import { RuleTester, noFormat } from '../RuleTester'; +import { RuleTester } from '../RuleTester'; const rootDir = path.resolve(__dirname, '../fixtures/'); const ruleTester = new RuleTester({ @@ -232,7 +233,7 @@ const bar = foo; code: ` const foo = (3 + 5) as number; `, - output: noFormat` + output: ` const foo = (3 + 5); `, errors: [ @@ -247,7 +248,7 @@ const foo = (3 + 5); code: ` const foo = (3 + 5); `, - output: noFormat` + output: ` const foo = (3 + 5); `, errors: [ @@ -263,7 +264,7 @@ const foo = (3 + 5); type Foo = number; const foo = (3 + 5) as Foo; `, - output: noFormat` + output: ` type Foo = number; const foo = (3 + 5); `, @@ -280,7 +281,7 @@ const foo = (3 + 5); type Foo = number; const foo = (3 + 5); `, - output: noFormat` + output: ` type Foo = number; const foo = (3 + 5); `, diff --git a/packages/eslint-plugin/tests/rules/no-unnecessary-type-constraint.test.ts b/packages/eslint-plugin/tests/rules/no-unnecessary-type-constraint.test.ts index 91798c8b059..72bde5788ca 100644 --- a/packages/eslint-plugin/tests/rules/no-unnecessary-type-constraint.test.ts +++ b/packages/eslint-plugin/tests/rules/no-unnecessary-type-constraint.test.ts @@ -1,5 +1,5 @@ import rule from '../../src/rules/no-unnecessary-type-constraint'; -import { RuleTester, noFormat } from '../RuleTester'; +import { noFormat, RuleTester } from '../RuleTester'; const ruleTester = new RuleTester({ parserOptions: { @@ -39,6 +39,7 @@ function data() {} suggestions: [ { messageId: 'removeUnnecessaryConstraint', + data: { constraint: 'any' }, output: 'function data() {}', }, ], @@ -57,6 +58,7 @@ function data() {} suggestions: [ { messageId: 'removeUnnecessaryConstraint', + data: { constraint: 'any' }, output: 'function data() {}', }, ], @@ -75,6 +77,7 @@ function data() {} suggestions: [ { messageId: 'removeUnnecessaryConstraint', + data: { constraint: 'any' }, output: 'function data() {}', }, ], @@ -93,6 +96,7 @@ function data() {} suggestions: [ { messageId: 'removeUnnecessaryConstraint', + data: { constraint: 'any' }, output: 'function data() {}', }, ], @@ -111,7 +115,8 @@ function data() {} suggestions: [ { messageId: 'removeUnnecessaryConstraint', - output: noFormat`const data = () => {};`, + data: { constraint: 'any' }, + output: `const data = () => {};`, }, ], }, @@ -130,7 +135,8 @@ function data() {} suggestions: [ { messageId: 'removeUnnecessaryConstraint', - output: noFormat`const data = () => {};`, + data: { constraint: 'any' }, + output: `const data = () => {};`, }, ], }, @@ -149,7 +155,8 @@ function data() {} suggestions: [ { messageId: 'removeUnnecessaryConstraint', - output: noFormat`const data = () => {};`, + data: { constraint: 'any' }, + output: `const data = () => {};`, }, ], }, @@ -168,7 +175,8 @@ function data() {} suggestions: [ { messageId: 'removeUnnecessaryConstraint', - output: noFormat`const data = () => {};`, + data: { constraint: 'any' }, + output: `const data = () => {};`, }, ], }, @@ -187,7 +195,8 @@ function data() {} suggestions: [ { messageId: 'removeUnnecessaryConstraint', - output: noFormat`const data = () => {};`, + data: { constraint: 'any' }, + output: `const data = () => {};`, }, ], }, @@ -206,6 +215,7 @@ function data() {} suggestions: [ { messageId: 'removeUnnecessaryConstraint', + data: { constraint: 'any' }, output: 'const data = () => {};', }, ], @@ -225,7 +235,8 @@ function data() {} suggestions: [ { messageId: 'removeUnnecessaryConstraint', - output: noFormat`const data = () => {};`, + data: { constraint: 'any' }, + output: `const data = () => {};`, }, ], }, @@ -238,7 +249,8 @@ function data() {} suggestions: [ { messageId: 'removeUnnecessaryConstraint', - output: noFormat`const data = () => {};`, + data: { constraint: 'any' }, + output: `const data = () => {};`, }, ], }, @@ -257,6 +269,7 @@ function data() {} suggestions: [ { messageId: 'removeUnnecessaryConstraint', + data: { constraint: 'unknown' }, output: 'function data() {}', }, ], @@ -275,6 +288,7 @@ function data() {} suggestions: [ { messageId: 'removeUnnecessaryConstraint', + data: { constraint: 'any' }, output: 'const data = () => {};', }, ], @@ -293,6 +307,7 @@ function data() {} suggestions: [ { messageId: 'removeUnnecessaryConstraint', + data: { constraint: 'unknown' }, output: 'const data = () => {};', }, ], @@ -311,6 +326,7 @@ function data() {} suggestions: [ { messageId: 'removeUnnecessaryConstraint', + data: { constraint: 'unknown' }, output: 'class Data {}', }, ], @@ -329,6 +345,7 @@ function data() {} suggestions: [ { messageId: 'removeUnnecessaryConstraint', + data: { constraint: 'unknown' }, output: 'const Data = class {};', }, ], @@ -340,7 +357,7 @@ function data() {} class Data { member() {} } - `.trimEnd(), + `, errors: [ { data: { constraint: 'unknown', name: 'T' }, @@ -351,11 +368,12 @@ class Data { suggestions: [ { messageId: 'removeUnnecessaryConstraint', + data: { constraint: 'unknown' }, output: ` class Data { member() {} } - `.trimEnd(), + `, }, ], }, @@ -366,7 +384,7 @@ class Data { const Data = class { member() {} }; - `.trimEnd(), + `, errors: [ { data: { constraint: 'unknown', name: 'T' }, @@ -377,11 +395,12 @@ const Data = class { suggestions: [ { messageId: 'removeUnnecessaryConstraint', + data: { constraint: 'unknown' }, output: ` const Data = class { member() {} }; - `.trimEnd(), + `, }, ], }, @@ -399,6 +418,7 @@ const Data = class { suggestions: [ { messageId: 'removeUnnecessaryConstraint', + data: { constraint: 'unknown' }, output: 'interface Data {}', }, ], @@ -417,6 +437,7 @@ const Data = class { suggestions: [ { messageId: 'removeUnnecessaryConstraint', + data: { constraint: 'unknown' }, output: 'type Data = {};', }, ], diff --git a/packages/eslint-plugin/tests/rules/no-unsafe-argument.test.ts b/packages/eslint-plugin/tests/rules/no-unsafe-argument.test.ts index 6205a371a14..77058a563a9 100644 --- a/packages/eslint-plugin/tests/rules/no-unsafe-argument.test.ts +++ b/packages/eslint-plugin/tests/rules/no-unsafe-argument.test.ts @@ -1,5 +1,5 @@ import rule from '../../src/rules/no-unsafe-argument'; -import { RuleTester, getFixturesRootDir } from '../RuleTester'; +import { getFixturesRootDir, RuleTester } from '../RuleTester'; const ruleTester = new RuleTester({ parser: '@typescript-eslint/parser', diff --git a/packages/eslint-plugin/tests/rules/no-unsafe-assignment.test.ts b/packages/eslint-plugin/tests/rules/no-unsafe-assignment.test.ts index 78ef7e78b38..8b08ec79ff9 100644 --- a/packages/eslint-plugin/tests/rules/no-unsafe-assignment.test.ts +++ b/packages/eslint-plugin/tests/rules/no-unsafe-assignment.test.ts @@ -1,15 +1,16 @@ -import { TSESLint } from '@typescript-eslint/utils'; +import type { TSESLint } from '@typescript-eslint/utils'; + import rule from '../../src/rules/no-unsafe-assignment'; +import type { + InferMessageIdsTypeFromRule, + InferOptionsTypeFromRule, +} from '../../src/util'; import { - RuleTester, batchedSingleLineTests, getFixturesRootDir, noFormat, + RuleTester, } from '../RuleTester'; -import { - InferMessageIdsTypeFromRule, - InferOptionsTypeFromRule, -} from '../../src/util'; type Options = InferOptionsTypeFromRule; type MessageIds = InferMessageIdsTypeFromRule; @@ -112,7 +113,7 @@ class Foo { 'const x = new Set();', 'const x = { y: 1 };', 'const x = { y = 1 };', - 'const x = { y(); };', + noFormat`const x = { y(); };`, 'const x: { y: number } = { y: 1 };', 'const x = [...[1, 2, 3]];', 'const [{ [`x${1}`]: x }] = [{ [`x`]: 1 }] as [{ [`x`]: any }];', diff --git a/packages/eslint-plugin/tests/rules/no-unsafe-call.test.ts b/packages/eslint-plugin/tests/rules/no-unsafe-call.test.ts index 1f70c30e248..db71189a697 100644 --- a/packages/eslint-plugin/tests/rules/no-unsafe-call.test.ts +++ b/packages/eslint-plugin/tests/rules/no-unsafe-call.test.ts @@ -1,9 +1,9 @@ import rule from '../../src/rules/no-unsafe-call'; import { - RuleTester, batchedSingleLineTests, getFixturesRootDir, noFormat, + RuleTester, } from '../RuleTester'; const ruleTester = new RuleTester({ diff --git a/packages/eslint-plugin/tests/rules/no-unsafe-declaration-merging.test.ts b/packages/eslint-plugin/tests/rules/no-unsafe-declaration-merging.test.ts new file mode 100644 index 00000000000..1feabbe8158 --- /dev/null +++ b/packages/eslint-plugin/tests/rules/no-unsafe-declaration-merging.test.ts @@ -0,0 +1,120 @@ +import rule from '../../src/rules/no-unsafe-declaration-merging'; +import { getFixturesRootDir, RuleTester } from '../RuleTester'; + +const rootPath = getFixturesRootDir(); + +const ruleTester = new RuleTester({ + parser: '@typescript-eslint/parser', + parserOptions: { + sourceType: 'module', + tsconfigRootDir: rootPath, + project: './tsconfig.json', + }, +}); + +ruleTester.run('no-unsafe-declaration-merging', rule, { + valid: [ + ` +interface Foo {} +class Bar implements Foo {} + `, + ` +namespace Foo {} +namespace Foo {} + `, + ` +enum Foo {} +namespace Foo {} + `, + ` +namespace Fooo {} +function Foo() {} + `, + ` +const Foo = class {}; + `, + ` +interface Foo { + props: string; +} + +function bar() { + return class Foo {}; +} + `, + ` +interface Foo { + props: string; +} + +(function bar() { + class Foo {} +})(); + `, + ` +declare global { + interface Foo {} +} + +class Foo {} + `, + ], + invalid: [ + { + code: ` +interface Foo {} +class Foo {} + `, + errors: [ + { + messageId: 'unsafeMerging', + line: 2, + column: 11, + }, + { + messageId: 'unsafeMerging', + line: 3, + column: 7, + }, + ], + }, + { + code: ` +class Foo {} +interface Foo {} + `, + errors: [ + { + messageId: 'unsafeMerging', + line: 2, + column: 7, + }, + { + messageId: 'unsafeMerging', + line: 3, + column: 11, + }, + ], + }, + { + code: ` +declare global { + interface Foo {} + class Foo {} +} + `, + errors: [ + { + messageId: 'unsafeMerging', + line: 3, + column: 13, + }, + { + messageId: 'unsafeMerging', + line: 4, + column: 9, + }, + ], + }, + ], +}); diff --git a/packages/eslint-plugin/tests/rules/no-unsafe-member-access.test.ts b/packages/eslint-plugin/tests/rules/no-unsafe-member-access.test.ts index 491d5e97d9f..5ab598c3a5a 100644 --- a/packages/eslint-plugin/tests/rules/no-unsafe-member-access.test.ts +++ b/packages/eslint-plugin/tests/rules/no-unsafe-member-access.test.ts @@ -1,9 +1,9 @@ import rule from '../../src/rules/no-unsafe-member-access'; import { - RuleTester, batchedSingleLineTests, getFixturesRootDir, noFormat, + RuleTester, } from '../RuleTester'; const ruleTester = new RuleTester({ diff --git a/packages/eslint-plugin/tests/rules/no-unsafe-return.test.ts b/packages/eslint-plugin/tests/rules/no-unsafe-return.test.ts index 2bbdfdd5ffa..47ec9701a77 100644 --- a/packages/eslint-plugin/tests/rules/no-unsafe-return.test.ts +++ b/packages/eslint-plugin/tests/rules/no-unsafe-return.test.ts @@ -1,9 +1,9 @@ import rule from '../../src/rules/no-unsafe-return'; import { - RuleTester, batchedSingleLineTests, getFixturesRootDir, noFormat, + RuleTester, } from '../RuleTester'; const ruleTester = new RuleTester({ diff --git a/packages/eslint-plugin/tests/rules/no-unused-expressions.test.ts b/packages/eslint-plugin/tests/rules/no-unused-expressions.test.ts index cf9082af764..36a0adda0dc 100644 --- a/packages/eslint-plugin/tests/rules/no-unused-expressions.test.ts +++ b/packages/eslint-plugin/tests/rules/no-unused-expressions.test.ts @@ -1,4 +1,5 @@ -import { TSESLint } from '@typescript-eslint/utils'; +import type { TSESLint } from '@typescript-eslint/utils'; + import rule from '../../src/rules/no-unused-expressions'; import { noFormat, RuleTester } from '../RuleTester'; diff --git a/packages/eslint-plugin/tests/rules/no-unused-vars/no-unused-vars-eslint.test.ts b/packages/eslint-plugin/tests/rules/no-unused-vars/no-unused-vars-eslint.test.ts index 44ffd089377..38438bceb6f 100644 --- a/packages/eslint-plugin/tests/rules/no-unused-vars/no-unused-vars-eslint.test.ts +++ b/packages/eslint-plugin/tests/rules/no-unused-vars/no-unused-vars-eslint.test.ts @@ -4,8 +4,11 @@ 'use strict'; -import { AST_NODE_TYPES, TSESLint } from '@typescript-eslint/utils'; -import rule, { MessageIds } from '../../../src/rules/no-unused-vars'; +import type { TSESLint } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; + +import type { MessageIds } from '../../../src/rules/no-unused-vars'; +import rule from '../../../src/rules/no-unused-vars'; import { RuleTester } from '../../RuleTester'; const ruleTester = new RuleTester({ diff --git a/packages/eslint-plugin/tests/rules/no-unused-vars/no-unused-vars.test.ts b/packages/eslint-plugin/tests/rules/no-unused-vars/no-unused-vars.test.ts index 5fac3eeed71..ee2191a3f4c 100644 --- a/packages/eslint-plugin/tests/rules/no-unused-vars/no-unused-vars.test.ts +++ b/packages/eslint-plugin/tests/rules/no-unused-vars/no-unused-vars.test.ts @@ -402,7 +402,8 @@ export const map: { [name in Foo]: Bar } = { }; `, // 4.1 remapped mapped type - noFormat` + { + code: noFormat` type Foo = 'a' | 'b' | 'c'; type Bar = number; @@ -411,7 +412,11 @@ export const map: { [name in Foo as string]: Bar } = { b: 2, c: 3, }; - `, + `, + dependencyConstraints: { + typescript: '4.1', + }, + }, ` import { Nullable } from 'nullable'; class A { @@ -747,6 +752,9 @@ function foo(value: T): T { } export type Foo = typeof foo; `, + dependencyConstraints: { + typescript: '4.7', + }, }, // https://github.com/typescript-eslint/typescript-eslint/issues/2331 { @@ -922,7 +930,8 @@ export declare namespace Foo { } } `, - noFormat` + { + code: noFormat` class Foo { value: T; } @@ -930,7 +939,11 @@ class Bar { foo = Foo; } new Bar(); - `, + `, + dependencyConstraints: { + typescript: '4.7', + }, + }, { code: ` declare namespace A { @@ -946,21 +959,36 @@ declare function A(A: string): string; filename: 'foo.d.ts', }, // 4.1 template literal types - noFormat` + { + code: noFormat` type Color = 'red' | 'blue'; type Quantity = 'one' | 'two'; export type SeussFish = \`\${Quantity | Color} fish\`; - `, - noFormat` + `, + dependencyConstraints: { + typescript: '4.1', + }, + }, + { + code: noFormat` type VerticalAlignment = "top" | "middle" | "bottom"; type HorizontalAlignment = "left" | "center" | "right"; export declare function setAlignment(value: \`\${VerticalAlignment}-\${HorizontalAlignment}\`): void; - `, - noFormat` + `, + dependencyConstraints: { + typescript: '4.1', + }, + }, + { + code: noFormat` type EnthusiasticGreeting = \`\${Uppercase} - \${Lowercase} - \${Capitalize} - \${Uncapitalize}\`; export type HELLO = EnthusiasticGreeting<"heLLo">; - `, + `, + dependencyConstraints: { + typescript: '4.1', + }, + }, // https://github.com/typescript-eslint/typescript-eslint/issues/2714 { code: ` @@ -1018,6 +1046,32 @@ export class TestClass { `, parserOptions: withMetaParserOptions, }, + // https://github.com/typescript-eslint/typescript-eslint/issues/5577 + ` +function foo() {} + +export class Foo { + constructor() { + foo(); + } +} + `, + { + code: ` +function foo() {} + +export class Foo { + static {} + + constructor() { + foo(); + } +} + `, + dependencyConstraints: { + typescript: '4.4', + }, + }, ], invalid: [ diff --git a/packages/eslint-plugin/tests/rules/no-use-before-define.test.ts b/packages/eslint-plugin/tests/rules/no-use-before-define.test.ts index 32924973a5c..465cf69168e 100644 --- a/packages/eslint-plugin/tests/rules/no-use-before-define.test.ts +++ b/packages/eslint-plugin/tests/rules/no-use-before-define.test.ts @@ -1,6 +1,7 @@ +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; + import rule from '../../src/rules/no-use-before-define'; import { RuleTester } from '../RuleTester'; -import { AST_NODE_TYPES } from '@typescript-eslint/utils'; const ruleTester = new RuleTester({ parser: '@typescript-eslint/parser', @@ -326,6 +327,92 @@ enum Foo { `, options: [{ enums: false }], }, + + // "allowNamedExports" option + { + code: ` +export { a }; +const a = 1; + `, + options: [{ allowNamedExports: true }], + parserOptions, + }, + { + code: ` +export { a as b }; +const a = 1; + `, + options: [{ allowNamedExports: true }], + parserOptions, + }, + { + code: ` +export { a, b }; +let a, b; + `, + options: [{ allowNamedExports: true }], + parserOptions, + }, + { + code: ` +export { a }; +var a; + `, + options: [{ allowNamedExports: true }], + parserOptions, + }, + { + code: ` +export { f }; +function f() {} + `, + options: [{ allowNamedExports: true }], + parserOptions, + }, + { + code: ` +export { C }; +class C {} + `, + options: [{ allowNamedExports: true }], + parserOptions, + }, + { + code: ` +export { Foo }; + +enum Foo { + BAR, +} + `, + options: [{ allowNamedExports: true }], + parserOptions, + }, + { + code: ` +export { Foo }; + +namespace Foo { + export let bar = () => console.log('bar'); +} + `, + options: [{ allowNamedExports: true }], + parserOptions, + }, + { + code: ` +export { Foo, baz }; + +enum Foo { + BAR, +} + +let baz: Enum; +enum Enum {} + `, + options: [{ allowNamedExports: true }], + parserOptions, + }, // https://github.com/typescript-eslint/typescript-eslint/issues/2502 { code: ` @@ -1094,6 +1181,237 @@ enum Foo { }, ], }, + // "allowNamedExports" option + { + code: ` +export { a }; +const a = 1; + `, + parserOptions, + errors: [ + { + messageId: 'noUseBeforeDefine', + data: { name: 'a' }, + }, + ], + }, + { + code: ` +export { a }; +const a = 1; + `, + options: [{}], + parserOptions, + errors: [ + { + messageId: 'noUseBeforeDefine', + data: { name: 'a' }, + }, + ], + }, + { + code: ` +export { a }; +const a = 1; + `, + options: [{ allowNamedExports: false }], + parserOptions, + errors: [ + { + messageId: 'noUseBeforeDefine', + data: { name: 'a' }, + }, + ], + }, + { + code: ` +export { a }; +const a = 1; + `, + options: ['nofunc'], + parserOptions, + errors: [ + { + messageId: 'noUseBeforeDefine', + data: { name: 'a' }, + }, + ], + }, + { + code: ` +export { a as b }; +const a = 1; + `, + parserOptions, + errors: [ + { + messageId: 'noUseBeforeDefine', + data: { name: 'a' }, + }, + ], + }, + { + code: ` +export { a, b }; +let a, b; + `, + parserOptions, + errors: [ + { + messageId: 'noUseBeforeDefine', + data: { name: 'a' }, + }, + { + messageId: 'noUseBeforeDefine', + data: { name: 'b' }, + }, + ], + }, + { + code: ` +export { a }; +var a; + `, + parserOptions, + errors: [ + { + messageId: 'noUseBeforeDefine', + data: { name: 'a' }, + }, + ], + }, + { + code: ` +export { f }; +function f() {} + `, + parserOptions, + errors: [ + { + messageId: 'noUseBeforeDefine', + data: { name: 'f' }, + }, + ], + }, + { + code: ` +export { C }; +class C {} + `, + parserOptions, + errors: [ + { + messageId: 'noUseBeforeDefine', + data: { name: 'C' }, + }, + ], + }, + { + code: ` +export const foo = a; +const a = 1; + `, + options: [{ allowNamedExports: true }], + parserOptions, + errors: [ + { + messageId: 'noUseBeforeDefine', + data: { name: 'a' }, + }, + ], + }, + { + code: ` +export function foo() { + return a; +} +const a = 1; + `, + options: [{ allowNamedExports: true }], + parserOptions, + + errors: [ + { + messageId: 'noUseBeforeDefine', + data: { name: 'a' }, + }, + ], + }, + { + code: ` +export class C { + foo() { + return a; + } +} +const a = 1; + `, + options: [{ allowNamedExports: true }], + parserOptions, + + errors: [ + { + messageId: 'noUseBeforeDefine', + data: { name: 'a' }, + }, + ], + }, + { + code: ` +export { Foo }; + +enum Foo { + BAR, +} + `, + parserOptions, + errors: [ + { + messageId: 'noUseBeforeDefine', + data: { name: 'Foo' }, + }, + ], + }, + { + code: ` +export { Foo }; + +namespace Foo { + export let bar = () => console.log('bar'); +} + `, + parserOptions, + errors: [ + { + messageId: 'noUseBeforeDefine', + data: { name: 'Foo' }, + }, + ], + }, + { + code: ` +export { Foo, baz }; + +enum Foo { + BAR, +} + +let baz: Enum; +enum Enum {} + `, + options: [{ ignoreTypeReferences: true, allowNamedExports: false }], + parserOptions, + errors: [ + { + messageId: 'noUseBeforeDefine', + data: { name: 'Foo' }, + }, + { + messageId: 'noUseBeforeDefine', + data: { name: 'baz' }, + }, + ], + }, { code: ` f(); diff --git a/packages/eslint-plugin/tests/rules/no-useless-constructor.test.ts b/packages/eslint-plugin/tests/rules/no-useless-constructor.test.ts index 7cedb9151e3..a8b0dd92e03 100644 --- a/packages/eslint-plugin/tests/rules/no-useless-constructor.test.ts +++ b/packages/eslint-plugin/tests/rules/no-useless-constructor.test.ts @@ -1,4 +1,5 @@ import { AST_NODE_TYPES } from '@typescript-eslint/utils'; + import rule from '../../src/rules/no-useless-constructor'; import { RuleTester } from '../RuleTester'; @@ -206,6 +207,20 @@ class A extends B { ` class A { constructor(foo); +} + `, + ` +class A extends Object { + constructor(@Foo foo: string) { + super(foo); + } +} + `, + ` +class A extends Object { + constructor(foo: string, @Bar() bar) { + super(foo, bar); + } } `, ], diff --git a/packages/eslint-plugin/tests/rules/non-nullable-type-assertion-style.test.ts b/packages/eslint-plugin/tests/rules/non-nullable-type-assertion-style.test.ts index 9bfa209168d..6826230b4fd 100644 --- a/packages/eslint-plugin/tests/rules/non-nullable-type-assertion-style.test.ts +++ b/packages/eslint-plugin/tests/rules/non-nullable-type-assertion-style.test.ts @@ -1,13 +1,11 @@ -import path from 'path'; import rule from '../../src/rules/non-nullable-type-assertion-style'; -import { RuleTester } from '../RuleTester'; +import { getFixturesRootDir, RuleTester } from '../RuleTester'; -const rootDir = path.resolve(__dirname, '../fixtures/'); const ruleTester = new RuleTester({ parserOptions: { sourceType: 'module', - tsconfigRootDir: rootDir, - project: './tsconfig.noUncheckedIndexedAccess.json', + tsconfigRootDir: getFixturesRootDir(), + project: './tsconfig.json', }, parser: '@typescript-eslint/parser', }); @@ -61,35 +59,6 @@ const x = 1 as 1; declare function foo(): T; const bar = foo() as number; `, - ` -function first(array: ArrayLike): T | null { - return array.length > 0 ? (array[0] as T) : null; -} - `, - ` -function first(array: ArrayLike): T | null { - return array.length > 0 ? (array[0] as T) : null; -} - `, - ` -function first(array: ArrayLike): T | null { - return array.length > 0 ? (array[0] as T) : null; -} - `, - ` -function first( - array: ArrayLike, -): T | null { - return array.length > 0 ? (array[0] as T) : null; -} - `, - ` -type A = 'a' | 'A'; -type B = 'b' | 'B'; -function first(array: ArrayLike): T | null { - return array.length > 0 ? (array[0] as T) : null; -} - `, ], invalid: [ @@ -228,26 +197,76 @@ declare const x: T; const y = x!; `, }, - { - code: ` -function first(array: ArrayLike): T | null { + ], +}); + +const ruleTesterWithNoUncheckedIndexAccess = new RuleTester({ + parserOptions: { + sourceType: 'module', + tsconfigRootDir: getFixturesRootDir(), + project: './tsconfig.noUncheckedIndexedAccess.json', + }, + parser: '@typescript-eslint/parser', + dependencyConstraints: { + typescript: '4.1', + }, +}); + +ruleTesterWithNoUncheckedIndexAccess.run( + 'non-nullable-type-assertion-style - noUncheckedIndexedAccess', + rule, + { + valid: [ + ` +function first(array: ArrayLike): T | null { return array.length > 0 ? (array[0] as T) : null; } `, - errors: [ - { - column: 30, - line: 3, - messageId: 'preferNonNullAssertion', - }, - ], - // Output is not expected to match required formatting due to excess parentheses - // eslint-disable-next-line @typescript-eslint/internal/plugin-test-formatting - output: ` + ` +function first(array: ArrayLike): T | null { + return array.length > 0 ? (array[0] as T) : null; +} + `, + ` +function first(array: ArrayLike): T | null { + return array.length > 0 ? (array[0] as T) : null; +} + `, + ` +function first( + array: ArrayLike, +): T | null { + return array.length > 0 ? (array[0] as T) : null; +} + `, + ` +type A = 'a' | 'A'; +type B = 'b' | 'B'; +function first(array: ArrayLike): T | null { + return array.length > 0 ? (array[0] as T) : null; +} + `, + ], + invalid: [ + { + code: ` +function first(array: ArrayLike): T | null { + return array.length > 0 ? (array[0] as T) : null; +} + `, + errors: [ + { + column: 30, + line: 3, + messageId: 'preferNonNullAssertion', + }, + ], + output: ` function first(array: ArrayLike): T | null { return array.length > 0 ? (array[0]!) : null; } - `, - }, - ], -}); + `, + }, + ], + }, +); diff --git a/packages/eslint-plugin/tests/rules/object-curly-spacing.test.ts b/packages/eslint-plugin/tests/rules/object-curly-spacing.test.ts index c64a7e17b9a..49861e5229a 100644 --- a/packages/eslint-plugin/tests/rules/object-curly-spacing.test.ts +++ b/packages/eslint-plugin/tests/rules/object-curly-spacing.test.ts @@ -4,6 +4,7 @@ /* eslint-enable eslint-comments/no-use */ import { AST_NODE_TYPES } from '@typescript-eslint/utils'; + import rule from '../../src/rules/object-curly-spacing'; import { RuleTester } from '../RuleTester'; diff --git a/packages/eslint-plugin/tests/rules/prefer-as-const.test.ts b/packages/eslint-plugin/tests/rules/prefer-as-const.test.ts index d5c15474f69..f4e2f46d998 100644 --- a/packages/eslint-plugin/tests/rules/prefer-as-const.test.ts +++ b/packages/eslint-plugin/tests/rules/prefer-as-const.test.ts @@ -23,19 +23,71 @@ ruleTester.run('prefer-as-const', rule, { 'let foo: number = 1;', "let foo: 'bar' = baz;", "let foo = 'bar';", + "let foo: 'bar';", + 'let foo = { bar };', + "let foo: 'baz' = 'baz' as const;", ` class foo { - bar: 'baz' = 'baz'; + bar = 'baz'; } `, ` class foo { - bar = 'baz'; + bar: 'baz'; + } + `, + ` + class foo { + bar; + } + `, + ` + class foo { + bar = 'baz'; + } + `, + ` + class foo { + bar: string = 'baz'; + } + `, + ` + class foo { + bar: number = 1; + } + `, + ` + class foo { + bar = 'baz' as const; + } + `, + ` + class foo { + bar = 2 as const; + } + `, + ` + class foo { + get bar(): 'bar' {} + set bar(bar: 'bar') {} + } + `, + ` + class foo { + bar = () => 'bar' as const; + } + `, + ` + type BazFunction = () => 'baz'; + class foo { + bar: BazFunction = () => 'bar'; + } + `, + ` + class foo { + bar(): void {} } `, - "let foo: 'bar';", - 'let foo = { bar };', - "let foo: 'baz' = 'baz' as const;", ], invalid: [ { @@ -62,7 +114,7 @@ ruleTester.run('prefer-as-const', rule, { }, { code: "let []: 'bar' = 'bar';", - output: "let []: 'bar' = 'bar';", + output: null, errors: [ { messageId: 'variableConstAssertion', @@ -73,7 +125,7 @@ ruleTester.run('prefer-as-const', rule, { }, { code: "let foo: 'bar' = 'bar';", - output: "let foo: 'bar' = 'bar';", + output: null, errors: [ { messageId: 'variableConstAssertion', @@ -90,7 +142,7 @@ ruleTester.run('prefer-as-const', rule, { }, { code: 'let foo: 2 = 2;', - output: 'let foo: 2 = 2;', + output: null, errors: [ { messageId: 'variableConstAssertion', @@ -160,5 +212,112 @@ ruleTester.run('prefer-as-const', rule, { }, ], }, + { + code: ` +class foo { + bar: 'baz' = 'baz'; +} + `, + output: null, + errors: [ + { + messageId: 'variableConstAssertion', + line: 3, + column: 8, + suggestions: [ + { + messageId: 'variableSuggest', + output: ` +class foo { + bar = 'baz' as const; +} + `, + }, + ], + }, + ], + }, + { + code: ` +class foo { + bar: 2 = 2; +} + `, + output: null, + errors: [ + { + messageId: 'variableConstAssertion', + line: 3, + column: 8, + suggestions: [ + { + messageId: 'variableSuggest', + output: ` +class foo { + bar = 2 as const; +} + `, + }, + ], + }, + ], + }, + { + code: ` +class foo { + foo = <'bar'>'bar'; +} + `, + output: ` +class foo { + foo = 'bar'; +} + `, + errors: [ + { + messageId: 'preferConstAssertion', + line: 3, + column: 10, + }, + ], + }, + { + code: ` +class foo { + foo = 'bar' as 'bar'; +} + `, + output: ` +class foo { + foo = 'bar' as const; +} + `, + errors: [ + { + messageId: 'preferConstAssertion', + line: 3, + column: 18, + }, + ], + }, + { + code: ` +class foo { + foo = 5 as 5; +} + `, + output: ` +class foo { + foo = 5 as const; +} + `, + errors: [ + { + messageId: 'preferConstAssertion', + line: 3, + column: 14, + }, + ], + }, ], }); diff --git a/packages/eslint-plugin/tests/rules/prefer-enum-initializers.test.ts b/packages/eslint-plugin/tests/rules/prefer-enum-initializers.test.ts index 0a49c52d945..adfdd065bb8 100644 --- a/packages/eslint-plugin/tests/rules/prefer-enum-initializers.test.ts +++ b/packages/eslint-plugin/tests/rules/prefer-enum-initializers.test.ts @@ -36,7 +36,7 @@ enum Direction { enum Direction { Up, } - `.trimRight(), + `, errors: [ { messageId: 'defineInitializer', @@ -49,7 +49,7 @@ enum Direction { enum Direction { Up = 0, } - `.trimRight(), + `, }, { messageId: 'defineInitializerSuggestion', @@ -57,7 +57,7 @@ enum Direction { enum Direction { Up = 1, } - `.trimRight(), + `, }, { messageId: 'defineInitializerSuggestion', @@ -65,7 +65,7 @@ enum Direction { enum Direction { Up = 'Up', } - `.trimRight(), + `, }, ], }, @@ -77,7 +77,7 @@ enum Direction { Up, Down, } - `.trimRight(), + `, errors: [ { messageId: 'defineInitializer', @@ -91,7 +91,7 @@ enum Direction { Up = 0, Down, } - `.trimRight(), + `, }, { messageId: 'defineInitializerSuggestion', @@ -100,7 +100,7 @@ enum Direction { Up = 1, Down, } - `.trimRight(), + `, }, { messageId: 'defineInitializerSuggestion', @@ -109,7 +109,7 @@ enum Direction { Up = 'Up', Down, } - `.trimRight(), + `, }, ], }, @@ -125,7 +125,7 @@ enum Direction { Up, Down = 1, } - `.trimRight(), + `, }, { messageId: 'defineInitializerSuggestion', @@ -134,7 +134,7 @@ enum Direction { Up, Down = 2, } - `.trimRight(), + `, }, { messageId: 'defineInitializerSuggestion', @@ -143,7 +143,7 @@ enum Direction { Up, Down = 'Down', } - `.trimRight(), + `, }, ], }, @@ -155,7 +155,7 @@ enum Direction { Up = 'Up', Down, } - `.trimRight(), + `, errors: [ { messageId: 'defineInitializer', @@ -169,7 +169,7 @@ enum Direction { Up = 'Up', Down = 1, } - `.trimRight(), + `, }, { messageId: 'defineInitializerSuggestion', @@ -178,7 +178,7 @@ enum Direction { Up = 'Up', Down = 2, } - `.trimRight(), + `, }, { messageId: 'defineInitializerSuggestion', @@ -187,7 +187,7 @@ enum Direction { Up = 'Up', Down = 'Down', } - `.trimRight(), + `, }, ], }, @@ -199,7 +199,7 @@ enum Direction { Up, Down = 'Down', } - `.trimRight(), + `, errors: [ { messageId: 'defineInitializer', @@ -213,7 +213,7 @@ enum Direction { Up = 0, Down = 'Down', } - `.trimRight(), + `, }, { messageId: 'defineInitializerSuggestion', @@ -222,7 +222,7 @@ enum Direction { Up = 1, Down = 'Down', } - `.trimRight(), + `, }, { messageId: 'defineInitializerSuggestion', @@ -231,7 +231,7 @@ enum Direction { Up = 'Up', Down = 'Down', } - `.trimRight(), + `, }, ], }, diff --git a/packages/eslint-plugin/tests/rules/prefer-for-of.test.ts b/packages/eslint-plugin/tests/rules/prefer-for-of.test.ts index 02c7d6478f0..8e59de6bce9 100644 --- a/packages/eslint-plugin/tests/rules/prefer-for-of.test.ts +++ b/packages/eslint-plugin/tests/rules/prefer-for-of.test.ts @@ -1,5 +1,5 @@ import rule from '../../src/rules/prefer-for-of'; -import { RuleTester, noFormat } from '../RuleTester'; +import { noFormat, RuleTester } from '../RuleTester'; const ruleTester = new RuleTester({ parser: '@typescript-eslint/parser', diff --git a/packages/eslint-plugin/tests/rules/prefer-function-type.test.ts b/packages/eslint-plugin/tests/rules/prefer-function-type.test.ts index 50fb8370b18..5c65dfc4d2b 100644 --- a/packages/eslint-plugin/tests/rules/prefer-function-type.test.ts +++ b/packages/eslint-plugin/tests/rules/prefer-function-type.test.ts @@ -1,4 +1,5 @@ import { AST_NODE_TYPES } from '@typescript-eslint/utils'; + import rule, { phrases } from '../../src/rules/prefer-function-type'; import { noFormat, RuleTester } from '../RuleTester'; @@ -82,12 +83,7 @@ export default interface Foo { }, }, ], - output: ` -export default interface Foo { - /** comment */ - (): string; -} - `, + output: null, }, { code: ` @@ -364,7 +360,7 @@ interface Foo { }, }, ], - output: noFormat` + output: ` // isn't actually valid ts but want to not give message saying it refers to Foo. type Foo = () => { a: { @@ -390,7 +386,7 @@ type X = {} | { (): void; } }, }, ], - output: noFormat` + output: ` type X = {} | (() => void) `, }, @@ -407,7 +403,7 @@ type X = {} & { (): void; }; }, }, ], - output: noFormat` + output: ` type X = {} & (() => void); `, }, diff --git a/packages/eslint-plugin/tests/rules/prefer-includes.test.ts b/packages/eslint-plugin/tests/rules/prefer-includes.test.ts index ceda607df49..6b37be5c59f 100644 --- a/packages/eslint-plugin/tests/rules/prefer-includes.test.ts +++ b/packages/eslint-plugin/tests/rules/prefer-includes.test.ts @@ -1,5 +1,5 @@ import rule from '../../src/rules/prefer-includes'; -import { RuleTester, getFixturesRootDir } from '../RuleTester'; +import { getFixturesRootDir, RuleTester } from '../RuleTester'; const rootPath = getFixturesRootDir(); diff --git a/packages/eslint-plugin/tests/rules/prefer-literal-enum-member.test.ts b/packages/eslint-plugin/tests/rules/prefer-literal-enum-member.test.ts index 5ec7af3c9db..c0e3aec4e8e 100644 --- a/packages/eslint-plugin/tests/rules/prefer-literal-enum-member.test.ts +++ b/packages/eslint-plugin/tests/rules/prefer-literal-enum-member.test.ts @@ -1,5 +1,5 @@ import rule from '../../src/rules/prefer-literal-enum-member'; -import { RuleTester, noFormat } from '../RuleTester'; +import { noFormat, RuleTester } from '../RuleTester'; const ruleTester = new RuleTester({ parser: '@typescript-eslint/parser', diff --git a/packages/eslint-plugin/tests/rules/prefer-nullish-coalescing.test.ts b/packages/eslint-plugin/tests/rules/prefer-nullish-coalescing.test.ts index 55fb4452973..49e50e741a8 100644 --- a/packages/eslint-plugin/tests/rules/prefer-nullish-coalescing.test.ts +++ b/packages/eslint-plugin/tests/rules/prefer-nullish-coalescing.test.ts @@ -1,9 +1,12 @@ -import { TSESLint } from '@typescript-eslint/utils'; -import rule, { +import type { TSESLint } from '@typescript-eslint/utils'; +import * as path from 'path'; + +import type { MessageIds, Options, } from '../../src/rules/prefer-nullish-coalescing'; -import { RuleTester, getFixturesRootDir } from '../RuleTester'; +import rule from '../../src/rules/prefer-nullish-coalescing'; +import { getFixturesRootDir, RuleTester } from '../RuleTester'; const rootPath = getFixturesRootDir(); @@ -209,7 +212,7 @@ a && b || c || d; code: ` declare const x: ${type} | ${nullish}; x || 'foo'; - `.trimRight(), + `, output: null, errors: [ { @@ -224,7 +227,7 @@ x || 'foo'; output: ` declare const x: ${type} | ${nullish}; x ?? 'foo'; - `.trimRight(), + `, }, ], }, @@ -330,35 +333,35 @@ x ?? 'foo'; ` declare const x: string | undefined; x !== undefined ? x : y; - `.trim(), + `, ` declare const x: string | undefined; undefined !== x ? x : y; - `.trim(), + `, ` declare const x: string | undefined; undefined === x ? y : x; - `.trim(), + `, ` declare const x: string | undefined; undefined === x ? y : x; - `.trim(), + `, ` declare const x: string | null; x !== null ? x : y; - `.trim(), + `, ` declare const x: string | null; null !== x ? x : y; - `.trim(), + `, ` declare const x: string | null; null === x ? y : x; - `.trim(), + `, ` declare const x: string | null; null === x ? y : x; - `.trim(), + `, ].map(code => ({ code, output: null, @@ -366,29 +369,48 @@ null === x ? y : x; errors: [ { messageId: 'preferNullishOverTernary' as const, - line: 2, + line: 3, column: 1, - endLine: 2, - endColumn: code.split('\n')[1].length, + endLine: 3, + endColumn: code.split('\n')[2].length, suggestions: [ { messageId: 'suggestNullish' as const, output: ` -${code.split('\n')[0]} +${code.split('\n')[1]} x ?? y; - `.trim(), + `, }, ], }, ], })), + // noStrictNullCheck + { + code: ` +declare const x: string[] | null; +if (x) { +} + `, + errors: [ + { + messageId: 'noStrictNullCheck', + line: 0, + column: 1, + }, + ], + parserOptions: { + tsconfigRootDir: path.join(rootPath, 'unstrict'), + }, + }, + // ignoreConditionalTests ...nullishTypeInvalidTest((nullish, type) => ({ code: ` declare const x: ${type} | ${nullish}; x || 'foo' ? null : null; - `.trimRight(), + `, output: null, options: [{ ignoreConditionalTests: false }], errors: [ @@ -404,7 +426,7 @@ x || 'foo' ? null : null; output: ` declare const x: ${type} | ${nullish}; x ?? 'foo' ? null : null; - `.trimRight(), + `, }, ], }, @@ -414,7 +436,7 @@ x ?? 'foo' ? null : null; code: ` declare const x: ${type} | ${nullish}; if (x || 'foo') {} - `.trimRight(), + `, output: null, options: [{ ignoreConditionalTests: false }], errors: [ @@ -430,7 +452,7 @@ if (x || 'foo') {} output: ` declare const x: ${type} | ${nullish}; if (x ?? 'foo') {} - `.trimRight(), + `, }, ], }, @@ -440,7 +462,7 @@ if (x ?? 'foo') {} code: ` declare const x: ${type} | ${nullish}; do {} while (x || 'foo') - `.trimRight(), + `, output: null, options: [{ ignoreConditionalTests: false }], errors: [ @@ -456,7 +478,7 @@ do {} while (x || 'foo') output: ` declare const x: ${type} | ${nullish}; do {} while (x ?? 'foo') - `.trimRight(), + `, }, ], }, @@ -466,7 +488,7 @@ do {} while (x ?? 'foo') code: ` declare const x: ${type} | ${nullish}; for (;x || 'foo';) {} - `.trimRight(), + `, output: null, options: [{ ignoreConditionalTests: false }], errors: [ @@ -482,7 +504,7 @@ for (;x || 'foo';) {} output: ` declare const x: ${type} | ${nullish}; for (;x ?? 'foo';) {} - `.trimRight(), + `, }, ], }, @@ -492,7 +514,7 @@ for (;x ?? 'foo';) {} code: ` declare const x: ${type} | ${nullish}; while (x || 'foo') {} - `.trimRight(), + `, output: null, options: [{ ignoreConditionalTests: false }], errors: [ @@ -508,7 +530,7 @@ while (x || 'foo') {} output: ` declare const x: ${type} | ${nullish}; while (x ?? 'foo') {} - `.trimRight(), + `, }, ], }, @@ -522,7 +544,7 @@ declare const a: ${type} | ${nullish}; declare const b: ${type} | ${nullish}; declare const c: ${type} | ${nullish}; a || b && c; - `.trimRight(), + `, options: [{ ignoreMixedLogicalExpressions: false }], errors: [ { @@ -539,7 +561,7 @@ declare const a: ${type} | ${nullish}; declare const b: ${type} | ${nullish}; declare const c: ${type} | ${nullish}; a ?? b && c; - `.trimRight(), + `, }, ], }, @@ -552,7 +574,7 @@ declare const b: ${type} | ${nullish}; declare const c: ${type} | ${nullish}; declare const d: ${type} | ${nullish}; a || b || c && d; - `.trimRight(), + `, options: [{ ignoreMixedLogicalExpressions: false }], errors: [ { @@ -570,7 +592,7 @@ declare const b: ${type} | ${nullish}; declare const c: ${type} | ${nullish}; declare const d: ${type} | ${nullish}; (a ?? b) || c && d; - `.trimRight(), + `, }, ], }, @@ -589,7 +611,7 @@ declare const b: ${type} | ${nullish}; declare const c: ${type} | ${nullish}; declare const d: ${type} | ${nullish}; a || b ?? c && d; - `.trimRight(), + `, }, ], }, @@ -602,7 +624,7 @@ declare const b: ${type} | ${nullish}; declare const c: ${type} | ${nullish}; declare const d: ${type} | ${nullish}; a && b || c || d; - `.trimRight(), + `, options: [{ ignoreMixedLogicalExpressions: false }], errors: [ { @@ -620,7 +642,7 @@ declare const b: ${type} | ${nullish}; declare const c: ${type} | ${nullish}; declare const d: ${type} | ${nullish}; a && (b ?? c) || d; - `.trimRight(), + `, }, ], }, @@ -639,7 +661,7 @@ declare const b: ${type} | ${nullish}; declare const c: ${type} | ${nullish}; declare const d: ${type} | ${nullish}; a && b || c ?? d; - `.trimRight(), + `, }, ], }, @@ -651,7 +673,7 @@ a && b || c ?? d; code: ` declare const x: ${type} | ${nullish}; if (() => x || 'foo') {} - `.trimRight(), + `, output: null, options: [{ ignoreConditionalTests: true }], errors: [ @@ -667,7 +689,7 @@ if (() => x || 'foo') {} output: ` declare const x: ${type} | ${nullish}; if (() => x ?? 'foo') {} - `.trimRight(), + `, }, ], }, @@ -677,7 +699,7 @@ if (() => x ?? 'foo') {} code: ` declare const x: ${type} | ${nullish}; if (function werid() { return x || 'foo' }) {} - `.trimRight(), + `, output: null, options: [{ ignoreConditionalTests: true }], errors: [ @@ -693,7 +715,7 @@ if (function werid() { return x || 'foo' }) {} output: ` declare const x: ${type} | ${nullish}; if (function werid() { return x ?? 'foo' }) {} - `.trimRight(), + `, }, ], }, @@ -706,7 +728,7 @@ declare const a: ${type} | ${nullish}; declare const b: ${type}; declare const c: ${type}; a || b || c; - `.trimRight(), + `, output: null, errors: [ { @@ -723,7 +745,7 @@ declare const a: ${type} | ${nullish}; declare const b: ${type}; declare const c: ${type}; (a ?? b) || c; - `.trimRight(), + `, }, ], }, diff --git a/packages/eslint-plugin/tests/rules/prefer-optional-chain/base-cases.ts b/packages/eslint-plugin/tests/rules/prefer-optional-chain/base-cases.ts new file mode 100644 index 00000000000..99cfe6b0ff9 --- /dev/null +++ b/packages/eslint-plugin/tests/rules/prefer-optional-chain/base-cases.ts @@ -0,0 +1,228 @@ +import type { TSESLint } from '@typescript-eslint/utils'; + +import type rule from '../../../src/rules/prefer-optional-chain'; +import type { + InferMessageIdsTypeFromRule, + InferOptionsTypeFromRule, +} from '../../../src/util'; + +type InvalidTestCase = TSESLint.InvalidTestCase< + InferMessageIdsTypeFromRule, + InferOptionsTypeFromRule +>; + +interface BaseCase { + canReplaceAndWithOr: boolean; + output: string; + code: string; +} + +const mapper = (c: BaseCase): InvalidTestCase => ({ + code: c.code.trim(), + output: null, + errors: [ + { + messageId: 'preferOptionalChain', + suggestions: [ + { + messageId: 'optionalChainSuggest', + output: c.output.trim(), + }, + ], + }, + ], +}); + +const baseCases: Array = [ + // chained members + { + code: 'foo && foo.bar', + output: 'foo?.bar', + canReplaceAndWithOr: true, + }, + { + code: 'foo.bar && foo.bar.baz', + output: 'foo.bar?.baz', + canReplaceAndWithOr: true, + }, + { + code: 'foo && foo()', + output: 'foo?.()', + canReplaceAndWithOr: true, + }, + { + code: 'foo.bar && foo.bar()', + output: 'foo.bar?.()', + canReplaceAndWithOr: true, + }, + { + code: 'foo && foo.bar && foo.bar.baz && foo.bar.baz.buzz', + output: 'foo?.bar?.baz?.buzz', + canReplaceAndWithOr: true, + }, + { + code: 'foo.bar && foo.bar.baz && foo.bar.baz.buzz', + output: 'foo.bar?.baz?.buzz', + canReplaceAndWithOr: true, + }, + // case with a jump (i.e. a non-nullish prop) + { + code: 'foo && foo.bar && foo.bar.baz.buzz', + output: 'foo?.bar?.baz.buzz', + canReplaceAndWithOr: true, + }, + { + code: 'foo.bar && foo.bar.baz.buzz', + output: 'foo.bar?.baz.buzz', + canReplaceAndWithOr: true, + }, + // case where for some reason there is a doubled up expression + { + code: 'foo && foo.bar && foo.bar.baz && foo.bar.baz && foo.bar.baz.buzz', + output: 'foo?.bar?.baz?.buzz', + canReplaceAndWithOr: true, + }, + { + code: 'foo.bar && foo.bar.baz && foo.bar.baz && foo.bar.baz.buzz', + output: 'foo.bar?.baz?.buzz', + canReplaceAndWithOr: true, + }, + // chained members with element access + { + code: 'foo && foo[bar] && foo[bar].baz && foo[bar].baz.buzz', + output: 'foo?.[bar]?.baz?.buzz', + canReplaceAndWithOr: true, + }, + { + // case with a jump (i.e. a non-nullish prop) + code: 'foo && foo[bar].baz && foo[bar].baz.buzz', + output: 'foo?.[bar].baz?.buzz', + canReplaceAndWithOr: true, + }, + // case with a property access in computed property + { + code: 'foo && foo[bar.baz] && foo[bar.baz].buzz', + output: 'foo?.[bar.baz]?.buzz', + canReplaceAndWithOr: true, + }, + // case with this keyword + { + code: 'foo[this.bar] && foo[this.bar].baz', + output: 'foo[this.bar]?.baz', + canReplaceAndWithOr: true, + }, + // chained calls + { + code: 'foo && foo.bar && foo.bar.baz && foo.bar.baz.buzz()', + output: 'foo?.bar?.baz?.buzz()', + canReplaceAndWithOr: true, + }, + { + code: 'foo && foo.bar && foo.bar.baz && foo.bar.baz.buzz && foo.bar.baz.buzz()', + output: 'foo?.bar?.baz?.buzz?.()', + canReplaceAndWithOr: true, + }, + { + code: 'foo.bar && foo.bar.baz && foo.bar.baz.buzz && foo.bar.baz.buzz()', + output: 'foo.bar?.baz?.buzz?.()', + canReplaceAndWithOr: true, + }, + // case with a jump (i.e. a non-nullish prop) + { + code: 'foo && foo.bar && foo.bar.baz.buzz()', + output: 'foo?.bar?.baz.buzz()', + canReplaceAndWithOr: true, + }, + { + code: 'foo.bar && foo.bar.baz.buzz()', + output: 'foo.bar?.baz.buzz()', + canReplaceAndWithOr: true, + }, + { + // case with a jump (i.e. a non-nullish prop) + code: 'foo && foo.bar && foo.bar.baz.buzz && foo.bar.baz.buzz()', + output: 'foo?.bar?.baz.buzz?.()', + canReplaceAndWithOr: true, + }, + { + // case with a call expr inside the chain for some inefficient reason + code: 'foo && foo.bar() && foo.bar().baz && foo.bar().baz.buzz && foo.bar().baz.buzz()', + output: 'foo?.bar()?.baz?.buzz?.()', + canReplaceAndWithOr: true, + }, + // chained calls with element access + { + code: 'foo && foo.bar && foo.bar.baz && foo.bar.baz[buzz]()', + output: 'foo?.bar?.baz?.[buzz]()', + canReplaceAndWithOr: true, + }, + { + code: 'foo && foo.bar && foo.bar.baz && foo.bar.baz[buzz] && foo.bar.baz[buzz]()', + output: 'foo?.bar?.baz?.[buzz]?.()', + canReplaceAndWithOr: true, + }, + // (partially) pre-optional chained + { + code: 'foo && foo?.bar && foo?.bar.baz && foo?.bar.baz[buzz] && foo?.bar.baz[buzz]()', + output: 'foo?.bar?.baz?.[buzz]?.()', + canReplaceAndWithOr: true, + }, + { + code: 'foo && foo?.bar.baz && foo?.bar.baz[buzz]', + output: 'foo?.bar.baz?.[buzz]', + canReplaceAndWithOr: true, + }, + { + code: 'foo && foo?.() && foo?.().bar', + output: 'foo?.()?.bar', + canReplaceAndWithOr: true, + }, + { + code: 'foo.bar && foo.bar?.() && foo.bar?.().baz', + output: 'foo.bar?.()?.baz', + canReplaceAndWithOr: true, + }, + { + code: 'foo !== null && foo.bar !== null', + output: 'foo?.bar != null', + canReplaceAndWithOr: false, + }, + { + code: 'foo != null && foo.bar != null', + output: 'foo?.bar != null', + canReplaceAndWithOr: false, + }, + { + code: 'foo != null && foo.bar !== null', + output: 'foo?.bar != null', + canReplaceAndWithOr: false, + }, + { + code: 'foo !== null && foo.bar != null', + output: 'foo?.bar != null', + canReplaceAndWithOr: false, + }, +]; + +interface Selector { + all(): Array; + select>( + key: K, + value: BaseCase[K], + ): Selector; +} + +const selector = (cases: Array): Selector => ({ + all: () => cases.map(mapper), + select: >( + key: K, + value: BaseCase[K], + ): Selector => { + const selectedCases = baseCases.filter(c => c[key] === value); + return selector(selectedCases); + }, +}); + +const { all, select } = selector(baseCases); + +export { all, select }; diff --git a/packages/eslint-plugin/tests/rules/prefer-optional-chain.test.ts b/packages/eslint-plugin/tests/rules/prefer-optional-chain/prefer-optional-chain.test.ts similarity index 75% rename from packages/eslint-plugin/tests/rules/prefer-optional-chain.test.ts rename to packages/eslint-plugin/tests/rules/prefer-optional-chain/prefer-optional-chain.test.ts index 2b004e9d7a9..a18de12bf7b 100644 --- a/packages/eslint-plugin/tests/rules/prefer-optional-chain.test.ts +++ b/packages/eslint-plugin/tests/rules/prefer-optional-chain/prefer-optional-chain.test.ts @@ -1,151 +1,21 @@ -import rule from '../../src/rules/prefer-optional-chain'; -import { RuleTester, noFormat } from '../RuleTester'; -import { TSESLint } from '@typescript-eslint/utils'; -import { - InferMessageIdsTypeFromRule, - InferOptionsTypeFromRule, -} from '../../src/util'; +import rule from '../../../src/rules/prefer-optional-chain'; +import { noFormat, RuleTester } from '../../RuleTester'; +import * as BaseCases from './base-cases'; const ruleTester = new RuleTester({ parser: '@typescript-eslint/parser', }); -const baseCases = [ - // chained members - { - code: 'foo && foo.bar', - output: 'foo?.bar', - }, - { - code: 'foo.bar && foo.bar.baz', - output: 'foo.bar?.baz', - }, - { - code: 'foo && foo()', - output: 'foo?.()', - }, - { - code: 'foo.bar && foo.bar()', - output: 'foo.bar?.()', - }, - { - code: 'foo && foo.bar && foo.bar.baz && foo.bar.baz.buzz', - output: 'foo?.bar?.baz?.buzz', - }, - { - code: 'foo.bar && foo.bar.baz && foo.bar.baz.buzz', - output: 'foo.bar?.baz?.buzz', - }, - // case with a jump (i.e. a non-nullish prop) - { - code: 'foo && foo.bar && foo.bar.baz.buzz', - output: 'foo?.bar?.baz.buzz', - }, - { - code: 'foo.bar && foo.bar.baz.buzz', - output: 'foo.bar?.baz.buzz', - }, - // case where for some reason there is a doubled up expression - { - code: 'foo && foo.bar && foo.bar.baz && foo.bar.baz && foo.bar.baz.buzz', - output: 'foo?.bar?.baz?.buzz', - }, - { - code: 'foo.bar && foo.bar.baz && foo.bar.baz && foo.bar.baz.buzz', - output: 'foo.bar?.baz?.buzz', - }, - // chained members with element access - { - code: 'foo && foo[bar] && foo[bar].baz && foo[bar].baz.buzz', - output: 'foo?.[bar]?.baz?.buzz', - }, - { - // case with a jump (i.e. a non-nullish prop) - code: 'foo && foo[bar].baz && foo[bar].baz.buzz', - output: 'foo?.[bar].baz?.buzz', - }, - // chained calls - { - code: 'foo && foo.bar && foo.bar.baz && foo.bar.baz.buzz()', - output: 'foo?.bar?.baz?.buzz()', - }, - { - code: 'foo && foo.bar && foo.bar.baz && foo.bar.baz.buzz && foo.bar.baz.buzz()', - output: 'foo?.bar?.baz?.buzz?.()', - }, - { - code: 'foo.bar && foo.bar.baz && foo.bar.baz.buzz && foo.bar.baz.buzz()', - output: 'foo.bar?.baz?.buzz?.()', - }, - // case with a jump (i.e. a non-nullish prop) - { - code: 'foo && foo.bar && foo.bar.baz.buzz()', - output: 'foo?.bar?.baz.buzz()', - }, - { - code: 'foo.bar && foo.bar.baz.buzz()', - output: 'foo.bar?.baz.buzz()', - }, - { - // case with a jump (i.e. a non-nullish prop) - code: 'foo && foo.bar && foo.bar.baz.buzz && foo.bar.baz.buzz()', - output: 'foo?.bar?.baz.buzz?.()', - }, - { - // case with a call expr inside the chain for some inefficient reason - code: 'foo && foo.bar() && foo.bar().baz && foo.bar().baz.buzz && foo.bar().baz.buzz()', - output: 'foo?.bar()?.baz?.buzz?.()', - }, - // chained calls with element access - { - code: 'foo && foo.bar && foo.bar.baz && foo.bar.baz[buzz]()', - output: 'foo?.bar?.baz?.[buzz]()', - }, - { - code: 'foo && foo.bar && foo.bar.baz && foo.bar.baz[buzz] && foo.bar.baz[buzz]()', - output: 'foo?.bar?.baz?.[buzz]?.()', - }, - // (partially) pre-optional chained - { - code: 'foo && foo?.bar && foo?.bar.baz && foo?.bar.baz[buzz] && foo?.bar.baz[buzz]()', - output: 'foo?.bar?.baz?.[buzz]?.()', - }, - { - code: 'foo && foo?.bar.baz && foo?.bar.baz[buzz]', - output: 'foo?.bar.baz?.[buzz]', - }, - { - code: 'foo && foo?.() && foo?.().bar', - output: 'foo?.()?.bar', - }, - { - code: 'foo.bar && foo.bar?.() && foo.bar?.().baz', - output: 'foo.bar?.()?.baz', - }, -].map( - c => - ({ - code: c.code.trim(), - output: null, - errors: [ - { - messageId: 'preferOptionalChain', - suggestions: [ - { - messageId: 'optionalChainSuggest', - output: c.output.trim(), - }, - ], - }, - ], - } as TSESLint.InvalidTestCase< - InferMessageIdsTypeFromRule, - InferOptionsTypeFromRule - >), -); - ruleTester.run('prefer-optional-chain', rule, { valid: [ + '!a || !b;', + '!a || a.b;', + '!a && a.b;', + '!a && !a.b;', + '!a.b || a.b?.();', + '!a.b || a.b();', + '!foo() || !foo().bar;', + 'foo || {};', 'foo || ({} as any);', '(foo || {})?.bar;', @@ -175,24 +45,57 @@ ruleTester.run('prefer-optional-chain', rule, { 'match && match$1 !== undefined;', 'foo !== null && foo !== undefined;', "x['y'] !== undefined && x['y'] !== null;", + // private properties + 'this.#a && this.#b;', + '!this.#a || !this.#b;', + 'a.#foo?.bar;', + '!a.#foo?.bar;', + '!foo().#a || a;', + '!a.b.#a || a;', + '!new A().#b || a;', + '!(await a).#b || a;', + "!(foo as any).bar || 'anything';", // currently do not handle complex computed properties 'foo && foo[bar as string] && foo[bar as string].baz;', 'foo && foo[1 + 2] && foo[1 + 2].baz;', 'foo && foo[typeof bar] && foo[typeof bar].baz;', + '!foo[1 + 1] || !foo[1 + 2];', + '!foo[1 + 1] || !foo[1 + 1].foo;', + '!foo || !foo[bar as string] || !foo[bar as string].baz;', + '!foo || !foo[1 + 2] || !foo[1 + 2].baz;', + '!foo || !foo[typeof bar] || !foo[typeof bar].baz;', + // currently do not handle 'this' as the first part of a chain + 'this && this.foo;', + '!this || !this.foo;', + // intentionally do not handle mixed TSNonNullExpression in properties + '!entity.__helper!.__initialized || options.refresh;', + '!foo!.bar || !foo!.bar.baz;', + '!foo!.bar!.baz || !foo!.bar!.baz!.paz;', + '!foo.bar!.baz || !foo.bar!.baz!.paz;', + 'import.meta || true;', + 'import.meta || import.meta.foo;', + '!import.meta && false;', + '!import.meta && !import.meta.foo;', + 'new.target || new.target.length;', + '!new.target || true;', + // Do not handle direct optional chaining on private properties because of a typescript bug (https://github.com/microsoft/TypeScript/issues/42734) + // We still allow in computed properties + 'foo && foo.#bar;', + '!foo || !foo.#bar;', ], invalid: [ - ...baseCases, + ...BaseCases.all(), // it should ignore whitespace in the expressions - ...baseCases.map(c => ({ + ...BaseCases.all().map(c => ({ ...c, code: c.code.replace(/\./g, '. '), })), - ...baseCases.map(c => ({ + ...BaseCases.all().map(c => ({ ...c, code: c.code.replace(/\./g, '.\n'), })), // it should ignore parts of the expression that aren't part of the expression chain - ...baseCases.map(c => ({ + ...BaseCases.all().map(c => ({ ...c, code: `${c.code} && bing`, errors: [ @@ -207,7 +110,7 @@ ruleTester.run('prefer-optional-chain', rule, { }, ], })), - ...baseCases.map(c => ({ + ...BaseCases.all().map(c => ({ ...c, code: `${c.code} && bing.bong`, errors: [ @@ -223,22 +126,42 @@ ruleTester.run('prefer-optional-chain', rule, { ], })), // strict nullish equality checks x !== null && x.y !== null - ...baseCases.map(c => ({ + ...BaseCases.all().map(c => ({ ...c, code: c.code.replace(/&&/g, '!== null &&'), })), - ...baseCases.map(c => ({ + ...BaseCases.all().map(c => ({ ...c, code: c.code.replace(/&&/g, '!= null &&'), })), - ...baseCases.map(c => ({ + ...BaseCases.all().map(c => ({ ...c, code: c.code.replace(/&&/g, '!== undefined &&'), })), - ...baseCases.map(c => ({ + ...BaseCases.all().map(c => ({ ...c, code: c.code.replace(/&&/g, '!= undefined &&'), })), + + // replace && with ||: foo && foo.bar -> !foo || !foo.bar + ...BaseCases.select('canReplaceAndWithOr', true) + .all() + .map(c => ({ + ...c, + code: c.code.replace(/(^|\s)foo/g, '$1!foo').replace(/&&/g, '||'), + errors: [ + { + ...c.errors[0], + suggestions: [ + { + ...c.errors[0].suggestions![0], + output: `!${c.errors[0].suggestions![0].output}`, + }, + ], + }, + ], + })), + // two errors { code: noFormat`foo && foo.bar && foo.bar.baz || baz && baz.bar && baz.bar.foo`, @@ -249,7 +172,7 @@ ruleTester.run('prefer-optional-chain', rule, { suggestions: [ { messageId: 'optionalChainSuggest', - output: noFormat`foo?.bar?.baz || baz && baz.bar && baz.bar.foo`, + output: `foo?.bar?.baz || baz && baz.bar && baz.bar.foo`, }, ], }, @@ -258,7 +181,7 @@ ruleTester.run('prefer-optional-chain', rule, { suggestions: [ { messageId: 'optionalChainSuggest', - output: noFormat`foo && foo.bar && foo.bar.baz || baz?.bar?.foo`, + output: `foo && foo.bar && foo.bar.baz || baz?.bar?.foo`, }, ], }, @@ -340,7 +263,7 @@ ruleTester.run('prefer-optional-chain', rule, { suggestions: [ { messageId: 'optionalChainSuggest', - output: noFormat`foo?.["some long string"]?.baz`, + output: `foo?.["some long string"]?.baz`, }, ], }, @@ -355,7 +278,7 @@ ruleTester.run('prefer-optional-chain', rule, { suggestions: [ { messageId: 'optionalChainSuggest', - output: noFormat`foo?.[\`some long string\`]?.baz`, + output: `foo?.[\`some long string\`]?.baz`, }, ], }, @@ -382,7 +305,7 @@ ruleTester.run('prefer-optional-chain', rule, { foo && foo.bar(/* comment */a, // comment2 b, ); - `.trimRight(), + `, output: null, errors: [ { @@ -390,11 +313,11 @@ foo && foo.bar(/* comment */a, suggestions: [ { messageId: 'optionalChainSuggest', - output: noFormat` + output: ` foo?.bar(/* comment */a, // comment2 b, ); - `.trimRight(), + `, }, ], }, @@ -446,6 +369,22 @@ foo?.bar(/* comment */a, }, ], }, + // case with this keyword at the start of expression + { + code: 'this.bar && this.bar.baz;', + output: null, + errors: [ + { + messageId: 'preferOptionalChain', + suggestions: [ + { + messageId: 'optionalChainSuggest', + output: 'this.bar?.baz;', + }, + ], + }, + ], + }, // other weird cases { code: 'foo && foo?.();', @@ -712,7 +651,7 @@ foo?.bar(/* comment */a, suggestions: [ { messageId: 'optionalChainSuggest', - output: noFormat`if (foo) { foo?.bar; }`, + output: `if (foo) { foo?.bar; }`, }, ], }, @@ -728,7 +667,7 @@ foo?.bar(/* comment */a, suggestions: [ { messageId: 'optionalChainSuggest', - output: noFormat`if (foo?.bar) { foo.bar; }`, + output: `if (foo?.bar) { foo.bar; }`, }, ], }, @@ -945,7 +884,7 @@ foo?.bar(/* comment */a, suggestions: [ { messageId: 'optionalChainSuggest', - output: noFormat`if (foo) { foo?.bar; }`, + output: `if (foo) { foo?.bar; }`, }, ], }, @@ -961,7 +900,7 @@ foo?.bar(/* comment */a, suggestions: [ { messageId: 'optionalChainSuggest', - output: noFormat`if (foo?.bar) { foo.bar; }`, + output: `if (foo?.bar) { foo.bar; }`, }, ], }, @@ -1009,7 +948,7 @@ foo?.bar(/* comment */a, suggestions: [ { messageId: 'optionalChainSuggest', - output: noFormat`((typeof x) as string)?.bar;`, + output: `((typeof x) as string)?.bar;`, }, ], }, @@ -1143,5 +1082,192 @@ foo?.bar(/* comment */a, }, ], }, + { + code: '(this || {}).foo;', + errors: [ + { + messageId: 'optionalChainSuggest', + suggestions: [ + { + messageId: 'optionalChainSuggest', + output: 'this?.foo;', + }, + ], + }, + ], + }, + // case with this keyword at the start of expression + { + code: '!this.bar || !this.bar.baz;', + output: null, + errors: [ + { + messageId: 'preferOptionalChain', + suggestions: [ + { + messageId: 'optionalChainSuggest', + output: '!this.bar?.baz;', + }, + ], + }, + ], + }, + { + code: '!a.b || !a.b();', + output: null, + errors: [ + { + messageId: 'preferOptionalChain', + suggestions: [ + { + messageId: 'optionalChainSuggest', + output: '!a.b?.();', + }, + ], + }, + ], + }, + { + code: '!foo.bar || !foo.bar.baz;', + output: null, + errors: [ + { + messageId: 'preferOptionalChain', + suggestions: [ + { + messageId: 'optionalChainSuggest', + output: '!foo.bar?.baz;', + }, + ], + }, + ], + }, + { + code: '!foo[bar] || !foo[bar]?.[baz];', + output: null, + errors: [ + { + messageId: 'preferOptionalChain', + suggestions: [ + { + messageId: 'optionalChainSuggest', + output: '!foo[bar]?.[baz];', + }, + ], + }, + ], + }, + { + code: '!foo || !foo?.bar.baz;', + output: null, + errors: [ + { + messageId: 'preferOptionalChain', + suggestions: [ + { + messageId: 'optionalChainSuggest', + output: '!foo?.bar.baz;', + }, + ], + }, + ], + }, + // two errors + { + code: noFormat`(!foo || !foo.bar || !foo.bar.baz) && (!baz || !baz.bar || !baz.bar.foo);`, + output: null, + errors: [ + { + messageId: 'preferOptionalChain', + suggestions: [ + { + messageId: 'optionalChainSuggest', + output: noFormat`(!foo?.bar?.baz) && (!baz || !baz.bar || !baz.bar.foo);`, + }, + ], + }, + { + messageId: 'preferOptionalChain', + suggestions: [ + { + messageId: 'optionalChainSuggest', + output: noFormat`(!foo || !foo.bar || !foo.bar.baz) && (!baz?.bar?.foo);`, + }, + ], + }, + ], + }, + { + code: ` + class Foo { + constructor() { + new.target && new.target.length; + } + } + `, + output: null, + errors: [ + { + messageId: 'preferOptionalChain', + suggestions: [ + { + messageId: 'optionalChainSuggest', + output: ` + class Foo { + constructor() { + new.target?.length; + } + } + `, + }, + ], + }, + ], + }, + { + code: noFormat`import.meta && import.meta?.baz;`, + output: null, + errors: [ + { + messageId: 'preferOptionalChain', + suggestions: [ + { + messageId: 'optionalChainSuggest', + output: noFormat`import.meta?.baz;`, + }, + ], + }, + ], + }, + { + code: noFormat`!import.meta || !import.meta?.baz;`, + output: null, + errors: [ + { + messageId: 'preferOptionalChain', + suggestions: [ + { + messageId: 'optionalChainSuggest', + output: noFormat`!import.meta?.baz;`, + }, + ], + }, + ], + }, + { + code: noFormat`import.meta && import.meta?.() && import.meta?.().baz;`, + output: null, + errors: [ + { + messageId: 'preferOptionalChain', + suggestions: [ + { + messageId: 'optionalChainSuggest', + output: noFormat`import.meta?.()?.baz;`, + }, + ], + }, + ], + }, ], }); diff --git a/packages/eslint-plugin/tests/rules/prefer-readonly-parameter-types.test.ts b/packages/eslint-plugin/tests/rules/prefer-readonly-parameter-types.test.ts index eadd526ca09..7cd0527b2cf 100644 --- a/packages/eslint-plugin/tests/rules/prefer-readonly-parameter-types.test.ts +++ b/packages/eslint-plugin/tests/rules/prefer-readonly-parameter-types.test.ts @@ -1,10 +1,12 @@ -import { TSESLint } from '@typescript-eslint/utils'; -import { RuleTester, getFixturesRootDir } from '../RuleTester'; +import type { TSESLint } from '@typescript-eslint/utils'; + import rule from '../../src/rules/prefer-readonly-parameter-types'; -import { +import type { InferMessageIdsTypeFromRule, InferOptionsTypeFromRule, } from '../../src/util'; +import { readonlynessOptionsDefaults } from '../../src/util'; +import { getFixturesRootDir, noFormat, RuleTester } from '../RuleTester'; type MessageIds = InferMessageIdsTypeFromRule; type Options = InferOptionsTypeFromRule; @@ -288,7 +290,7 @@ ruleTester.run('prefer-readonly-parameter-types', rule, { new (arg: readonly string[]): void; } `, // TSConstructSignatureDeclaration - 'const x = { foo(arg: readonly string[]): void; };', // TSEmptyBodyFunctionExpression + noFormat`const x = { foo(arg: readonly string[]): void; };`, // TSEmptyBodyFunctionExpression 'function foo(arg: readonly string[]);', // TSDeclareFunction 'type Foo = (arg: readonly string[]) => void;', // TSFunctionType ` @@ -361,6 +363,44 @@ ruleTester.run('prefer-readonly-parameter-types', rule, { }, ], }, + { + name: 'circular readonly types (Bug: #4476)', + code: ` + interface Obj { + readonly [K: string]: Obj; + } + + function foo(event: Obj): void {} + `, + options: [ + { + checkParameterProperties: true, + ignoreInferredTypes: false, + ...readonlynessOptionsDefaults, + }, + ], + }, + { + name: 'circular readonly types (Bug: #5875)', + code: ` + interface Obj1 { + readonly [K: string]: Obj2; + } + + interface Obj2 { + readonly [K: string]: Obj1; + } + + function foo(event: Obj1): void {} + `, + options: [ + { + checkParameterProperties: true, + ignoreInferredTypes: false, + ...readonlynessOptionsDefaults, + }, + ], + }, ], invalid: [ // arrays @@ -627,7 +667,7 @@ ruleTester.run('prefer-readonly-parameter-types', rule, { }, { // TSEmptyBodyFunctionExpression - code: 'const x = { foo(arg: string[]): void; };', + code: noFormat`const x = { foo(arg: string[]): void; };`, errors: [ { messageId: 'shouldBeReadonly', diff --git a/packages/eslint-plugin/tests/rules/prefer-readonly.test.ts b/packages/eslint-plugin/tests/rules/prefer-readonly.test.ts index 91e8213da57..10f2e3d1e07 100644 --- a/packages/eslint-plugin/tests/rules/prefer-readonly.test.ts +++ b/packages/eslint-plugin/tests/rules/prefer-readonly.test.ts @@ -1,5 +1,5 @@ import rule from '../../src/rules/prefer-readonly'; -import { RuleTester, getFixturesRootDir } from '../RuleTester'; +import { getFixturesRootDir, RuleTester } from '../RuleTester'; const rootDir = getFixturesRootDir(); const ruleTester = new RuleTester({ @@ -339,6 +339,34 @@ class Foo { } `, }, + { + code: ` + class Test { + private testObj = { + prop: '', + }; + + public test(): void { + this.testObj = ''; + } + } + `, + }, + { + code: ` + class TestObject { + public prop: number; + } + + class Test { + private testObj = new TestObject(); + + public test(): void { + this.testObj = new TestObject(); + } + } + `, + }, ], invalid: [ { @@ -742,5 +770,322 @@ function ClassWithName {}>(Base: TBase) { }, ], }, + { + code: ` + class Test { + private testObj = { + prop: '', + }; + + public test(): void { + this.testObj.prop = ''; + } + } + `, + output: ` + class Test { + private readonly testObj = { + prop: '', + }; + + public test(): void { + this.testObj.prop = ''; + } + } + `, + errors: [ + { + data: { + name: 'testObj', + }, + line: 3, + messageId: 'preferReadonly', + }, + ], + }, + { + code: ` + class TestObject { + public prop: number; + } + + class Test { + private testObj = new TestObject(); + + public test(): void { + this.testObj.prop = 10; + } + } + `, + output: ` + class TestObject { + public prop: number; + } + + class Test { + private readonly testObj = new TestObject(); + + public test(): void { + this.testObj.prop = 10; + } + } + `, + errors: [ + { + data: { + name: 'testObj', + }, + line: 7, + messageId: 'preferReadonly', + }, + ], + }, + { + code: ` + class Test { + private testObj = { + prop: '', + }; + public test(): void { + this.testObj.prop; + } + } + `, + output: ` + class Test { + private readonly testObj = { + prop: '', + }; + public test(): void { + this.testObj.prop; + } + } + `, + errors: [ + { + data: { + name: 'testObj', + }, + line: 3, + messageId: 'preferReadonly', + }, + ], + }, + { + code: ` + class Test { + private testObj = {}; + public test(): void { + this.testObj?.prop; + } + } + `, + output: ` + class Test { + private readonly testObj = {}; + public test(): void { + this.testObj?.prop; + } + } + `, + errors: [ + { + data: { + name: 'testObj', + }, + line: 3, + messageId: 'preferReadonly', + }, + ], + }, + { + code: ` + class Test { + private testObj = {}; + public test(): void { + this.testObj!.prop; + } + } + `, + output: ` + class Test { + private readonly testObj = {}; + public test(): void { + this.testObj!.prop; + } + } + `, + errors: [ + { + data: { + name: 'testObj', + }, + line: 3, + messageId: 'preferReadonly', + }, + ], + }, + { + code: ` + class Test { + private testObj = {}; + public test(): void { + this.testObj.prop.prop = ''; + } + } + `, + output: ` + class Test { + private readonly testObj = {}; + public test(): void { + this.testObj.prop.prop = ''; + } + } + `, + errors: [ + { + data: { + name: 'testObj', + }, + line: 3, + messageId: 'preferReadonly', + }, + ], + }, + { + code: ` + class Test { + private testObj = {}; + public test(): void { + this.testObj.prop.doesSomething(); + } + } + `, + output: ` + class Test { + private readonly testObj = {}; + public test(): void { + this.testObj.prop.doesSomething(); + } + } + `, + errors: [ + { + data: { + name: 'testObj', + }, + line: 3, + messageId: 'preferReadonly', + }, + ], + }, + { + code: ` + class Test { + private testObj = {}; + public test(): void { + this.testObj?.prop.prop; + } + } + `, + output: ` + class Test { + private readonly testObj = {}; + public test(): void { + this.testObj?.prop.prop; + } + } + `, + errors: [ + { + data: { + name: 'testObj', + }, + line: 3, + messageId: 'preferReadonly', + }, + ], + }, + { + code: ` + class Test { + private testObj = {}; + public test(): void { + this.testObj?.prop?.prop; + } + } + `, + output: ` + class Test { + private readonly testObj = {}; + public test(): void { + this.testObj?.prop?.prop; + } + } + `, + errors: [ + { + data: { + name: 'testObj', + }, + line: 3, + messageId: 'preferReadonly', + }, + ], + }, + { + code: ` + class Test { + private testObj = {}; + public test(): void { + this.testObj.prop?.prop; + } + } + `, + output: ` + class Test { + private readonly testObj = {}; + public test(): void { + this.testObj.prop?.prop; + } + } + `, + errors: [ + { + data: { + name: 'testObj', + }, + line: 3, + messageId: 'preferReadonly', + }, + ], + }, + { + code: ` + class Test { + private testObj = {}; + public test(): void { + this.testObj!.prop?.prop; + } + } + `, + output: ` + class Test { + private readonly testObj = {}; + public test(): void { + this.testObj!.prop?.prop; + } + } + `, + errors: [ + { + data: { + name: 'testObj', + }, + line: 3, + messageId: 'preferReadonly', + }, + ], + }, ], }); diff --git a/packages/eslint-plugin/tests/rules/prefer-reduce-type-parameter.test.ts b/packages/eslint-plugin/tests/rules/prefer-reduce-type-parameter.test.ts index 06613b260f7..5e7fae0bfea 100644 --- a/packages/eslint-plugin/tests/rules/prefer-reduce-type-parameter.test.ts +++ b/packages/eslint-plugin/tests/rules/prefer-reduce-type-parameter.test.ts @@ -1,5 +1,5 @@ import rule from '../../src/rules/prefer-reduce-type-parameter'; -import { RuleTester, getFixturesRootDir } from '../RuleTester'; +import { getFixturesRootDir, RuleTester } from '../RuleTester'; const rootPath = getFixturesRootDir(); diff --git a/packages/eslint-plugin/tests/rules/prefer-string-starts-ends-with.test.ts b/packages/eslint-plugin/tests/rules/prefer-string-starts-ends-with.test.ts index d1e76250d57..c9fe331c99d 100644 --- a/packages/eslint-plugin/tests/rules/prefer-string-starts-ends-with.test.ts +++ b/packages/eslint-plugin/tests/rules/prefer-string-starts-ends-with.test.ts @@ -1,6 +1,7 @@ -import { TSESLint } from '@typescript-eslint/utils'; +import type { TSESLint } from '@typescript-eslint/utils'; + import rule from '../../src/rules/prefer-string-starts-ends-with'; -import { RuleTester, getFixturesRootDir } from '../RuleTester'; +import { getFixturesRootDir, RuleTester } from '../RuleTester'; const rootPath = getFixturesRootDir(); @@ -1082,7 +1083,7 @@ function addOptional< function makeOptional(code: string): string; function makeOptional(code: string | null | undefined): string | null; function makeOptional(code: string | null | undefined): string | null { - if (code === null || code === undefined) { + if (code == null) { return null; } return ( diff --git a/packages/eslint-plugin/tests/rules/promise-function-async.test.ts b/packages/eslint-plugin/tests/rules/promise-function-async.test.ts index 53ba5cb81a0..ccf99b6afcb 100644 --- a/packages/eslint-plugin/tests/rules/promise-function-async.test.ts +++ b/packages/eslint-plugin/tests/rules/promise-function-async.test.ts @@ -1,4 +1,5 @@ import { noFormat } from '@typescript-eslint/utils/src/eslint-utils'; + import rule from '../../src/rules/promise-function-async'; import { getFixturesRootDir, RuleTester } from '../RuleTester'; @@ -101,6 +102,13 @@ const invalidAsyncModifiers = { constructor() {} } `, + ` +class Foo { + async catch(arg: Promise) { + return arg; + } +} + `, { code: ` function returnsAny(): any { @@ -654,7 +662,7 @@ class Test { { line: 7, column: 3, messageId }, { line: 10, column: 3, messageId }, ], - output: noFormat` + output: ` class Test { @decorator(async () => {}) static protected async [(1)]() { @@ -669,5 +677,80 @@ class Test { } `, }, + // https://github.com/typescript-eslint/typescript-eslint/issues/5729 + { + code: ` +class Foo { + catch() { + return Promise.resolve(1); + } + + public default() { + return Promise.resolve(2); + } + + @decorator + private case() { + return Promise.resolve(3); + } +} + `, + output: ` +class Foo { + async catch() { + return Promise.resolve(1); + } + + public async default() { + return Promise.resolve(2); + } + + @decorator + private async case() { + return Promise.resolve(3); + } +} + `, + errors: [ + { + line: 3, + column: 3, + messageId, + }, + { + line: 7, + column: 3, + messageId, + }, + { + line: 12, + column: 3, + messageId, + }, + ], + }, + { + code: ` +const foo = { + catch() { + return Promise.resolve(1); + }, +}; + `, + output: ` +const foo = { + async catch() { + return Promise.resolve(1); + }, +}; + `, + errors: [ + { + line: 3, + column: 3, + messageId, + }, + ], + }, ], }); diff --git a/packages/eslint-plugin/tests/rules/require-array-sort-compare.test.ts b/packages/eslint-plugin/tests/rules/require-array-sort-compare.test.ts index e0da4276d09..672ff4e7c10 100644 --- a/packages/eslint-plugin/tests/rules/require-array-sort-compare.test.ts +++ b/packages/eslint-plugin/tests/rules/require-array-sort-compare.test.ts @@ -1,5 +1,5 @@ import rule from '../../src/rules/require-array-sort-compare'; -import { RuleTester, getFixturesRootDir } from '../RuleTester'; +import { getFixturesRootDir, RuleTester } from '../RuleTester'; const rootPath = getFixturesRootDir(); diff --git a/packages/eslint-plugin/tests/rules/require-await.test.ts b/packages/eslint-plugin/tests/rules/require-await.test.ts index f385bc8402a..c31dab5a0d7 100644 --- a/packages/eslint-plugin/tests/rules/require-await.test.ts +++ b/packages/eslint-plugin/tests/rules/require-await.test.ts @@ -1,5 +1,5 @@ import rule from '../../src/rules/require-await'; -import { RuleTester, getFixturesRootDir } from '../RuleTester'; +import { getFixturesRootDir, RuleTester } from '../RuleTester'; const rootDir = getFixturesRootDir(); diff --git a/packages/eslint-plugin/tests/rules/restrict-plus-operands.test.ts b/packages/eslint-plugin/tests/rules/restrict-plus-operands.test.ts index 72621ad0efa..59215883758 100644 --- a/packages/eslint-plugin/tests/rules/restrict-plus-operands.test.ts +++ b/packages/eslint-plugin/tests/rules/restrict-plus-operands.test.ts @@ -1,5 +1,5 @@ import rule from '../../src/rules/restrict-plus-operands'; -import { RuleTester, getFixturesRootDir } from '../RuleTester'; +import { getFixturesRootDir, RuleTester } from '../RuleTester'; const rootPath = getFixturesRootDir(); diff --git a/packages/eslint-plugin/tests/rules/restrict-template-expressions.test.ts b/packages/eslint-plugin/tests/rules/restrict-template-expressions.test.ts index be300242e3d..7e80bdbdf5d 100644 --- a/packages/eslint-plugin/tests/rules/restrict-template-expressions.test.ts +++ b/packages/eslint-plugin/tests/rules/restrict-template-expressions.test.ts @@ -1,5 +1,5 @@ import rule from '../../src/rules/restrict-template-expressions'; -import { RuleTester, getFixturesRootDir } from '../RuleTester'; +import { getFixturesRootDir, RuleTester } from '../RuleTester'; const rootPath = getFixturesRootDir(); @@ -358,6 +358,11 @@ ruleTester.run('restrict-template-expressions', rule, { return \`arg = \${arg}\`; } `, + dependencyConstraints: { + // TS 4.5 improved type printing to print the type T as `T` + // before that it was printed as `any` + typescript: '4.5', + }, errors: [ { messageId: 'invalidType', diff --git a/packages/eslint-plugin/tests/rules/return-await.test.ts b/packages/eslint-plugin/tests/rules/return-await.test.ts index 43db87ef819..6a19ba3c223 100644 --- a/packages/eslint-plugin/tests/rules/return-await.test.ts +++ b/packages/eslint-plugin/tests/rules/return-await.test.ts @@ -15,6 +15,7 @@ const ruleTester = new RuleTester({ // default rule is in-try-catch ruleTester.run('return-await', rule, { valid: [ + 'return;', // No function in scope, so behave like return in a commonjs module ` function test() { return; @@ -333,7 +334,7 @@ const fn = (): any => null; async function test() { return await fn(); } - `.trimRight(), + `, errors: [ { line: 4, @@ -346,7 +347,7 @@ const fn = (): any => null; async function test() { return fn(); } - `.trimRight(), + `, }, ], }, @@ -358,7 +359,7 @@ const fn = (): unknown => null; async function test() { return await fn(); } - `.trimRight(), + `, errors: [ { line: 4, @@ -371,7 +372,7 @@ const fn = (): unknown => null; async function test() { return fn(); } - `.trimRight(), + `, }, ], }, @@ -702,7 +703,7 @@ async function buzz() { return (await foo()) ? bar() : baz(); } `, - output: noFormat` + output: ` async function foo() {} async function bar() {} async function baz() {} @@ -736,7 +737,7 @@ async function buzz() { ) : baz ? baz() : bar(); } `, - output: noFormat` + output: ` async function foo() {} async function bar() {} async function baz() {} diff --git a/packages/eslint-plugin/tests/rules/semi.test.ts b/packages/eslint-plugin/tests/rules/semi.test.ts index b5d88f77a93..f0a856d68dd 100644 --- a/packages/eslint-plugin/tests/rules/semi.test.ts +++ b/packages/eslint-plugin/tests/rules/semi.test.ts @@ -3,8 +3,10 @@ /* eslint "@typescript-eslint/internal/plugin-test-formatting": ["error", { formatWithPrettier: false }] */ /* eslint-enable eslint-comments/no-use */ -import { TSESLint } from '@typescript-eslint/utils'; -import rule, { MessageIds, Options } from '../../src/rules/semi'; +import type { TSESLint } from '@typescript-eslint/utils'; + +import type { MessageIds, Options } from '../../src/rules/semi'; +import rule from '../../src/rules/semi'; import { RuleTester } from '../RuleTester'; const ruleTester = new RuleTester({ diff --git a/packages/eslint-plugin/tests/rules/sort-type-constituents.test.ts b/packages/eslint-plugin/tests/rules/sort-type-constituents.test.ts new file mode 100644 index 00000000000..42f9ab8153a --- /dev/null +++ b/packages/eslint-plugin/tests/rules/sort-type-constituents.test.ts @@ -0,0 +1,394 @@ +import type { TSESLint } from '@typescript-eslint/utils'; + +import type { + MessageIds, + Options, +} from '../../src/rules/sort-type-constituents'; +import rule from '../../src/rules/sort-type-constituents'; +import { noFormat, RuleTester } from '../RuleTester'; + +const ruleTester = new RuleTester({ + parser: '@typescript-eslint/parser', +}); + +const valid = (operator: '|' | '&'): TSESLint.ValidTestCase[] => [ + { + code: `type T = A ${operator} B;`, + }, + { + code: `type T = A ${operator} /* comment */ B;`, + }, + { + code: `type T = 'A' ${operator} 'B';`, + }, + { + code: `type T = 1 ${operator} 2;`, + }, + { + code: noFormat`type T = (A) ${operator} (B);`, + }, + { + code: `type T = { a: string } ${operator} { b: string };`, + }, + { + code: `type T = [1, 2, 3] ${operator} [1, 2, 4];`, + }, + { + code: `type T = (() => string) ${operator} (() => void);`, + }, + { + code: `type T = () => string ${operator} void;`, + }, + { + // testing the default ordering + code: noFormat` +type T = + ${operator} A + ${operator} B + ${operator} C.D + ${operator} D.E + ${operator} intrinsic + ${operator} number[] + ${operator} string[] + ${operator} any + ${operator} string + ${operator} symbol + ${operator} this + ${operator} readonly number[] + ${operator} readonly string[] + ${operator} 'a' + ${operator} 'b' + ${operator} "a" + ${operator} "b" + ${operator} (() => string) + ${operator} (() => void) + ${operator} (new () => string) + ${operator} (new () => void) + ${operator} import('bar') + ${operator} import('foo') + ${operator} (number extends string ? unknown : never) + ${operator} (string extends string ? unknown : never) + ${operator} { [a in string]: string } + ${operator} { [a: string]: string } + ${operator} { [b in string]: string } + ${operator} { [b: string]: string } + ${operator} { a: string } + ${operator} { b: string } + ${operator} [1, 2, 3] + ${operator} [1, 2, 4] + ${operator} (A & B) + ${operator} (B & C) + ${operator} (A | B) + ${operator} (B | C) + ${operator} null + ${operator} undefined + `, + }, +]; +const invalid = ( + operator: '|' | '&', +): TSESLint.InvalidTestCase[] => { + const type = operator === '|' ? 'Union' : 'Intersection'; + return [ + { + code: `type T = B ${operator} A;`, + output: `type T = A ${operator} B;`, + errors: [ + { + messageId: 'notSortedNamed', + data: { + type, + name: 'T', + }, + }, + ], + }, + { + code: `type T = 'B' ${operator} 'A';`, + output: `type T = 'A' ${operator} 'B';`, + errors: [ + { + messageId: 'notSortedNamed', + data: { + type, + name: 'T', + }, + }, + ], + }, + { + code: `type T = 2 ${operator} 1;`, + output: `type T = 1 ${operator} 2;`, + errors: [ + { + messageId: 'notSortedNamed', + data: { + type, + name: 'T', + }, + }, + ], + }, + { + code: noFormat`type T = (B) ${operator} (A);`, + output: `type T = A ${operator} B;`, + errors: [ + { + messageId: 'notSortedNamed', + data: { + type, + name: 'T', + }, + }, + ], + }, + { + code: `type T = { b: string } ${operator} { a: string };`, + output: `type T = { a: string } ${operator} { b: string };`, + errors: [ + { + messageId: 'notSortedNamed', + data: { + type, + name: 'T', + }, + }, + ], + }, + { + code: `type T = [1, 2, 4] ${operator} [1, 2, 3];`, + output: `type T = [1, 2, 3] ${operator} [1, 2, 4];`, + errors: [ + { + messageId: 'notSortedNamed', + data: { + type, + name: 'T', + }, + }, + ], + }, + { + code: `type T = (() => void) ${operator} (() => string);`, + output: `type T = (() => string) ${operator} (() => void);`, + errors: [ + { + messageId: 'notSortedNamed', + data: { + type, + name: 'T', + }, + }, + ], + }, + { + code: `type T = () => void ${operator} string;`, + output: `type T = () => string ${operator} void;`, + errors: [ + { + messageId: 'notSorted', + data: { + type, + }, + }, + ], + }, + { + code: `type T = () => undefined ${operator} null;`, + output: `type T = () => null ${operator} undefined;`, + errors: [ + { + messageId: 'notSorted', + data: { + type, + }, + }, + ], + }, + { + code: noFormat` +type T = + ${operator} [1, 2, 4] + ${operator} [1, 2, 3] + ${operator} { b: string } + ${operator} { a: string } + ${operator} (() => void) + ${operator} (() => string) + ${operator} "b" + ${operator} "a" + ${operator} 'b' + ${operator} 'a' + ${operator} readonly string[] + ${operator} readonly number[] + ${operator} string[] + ${operator} number[] + ${operator} D.E + ${operator} C.D + ${operator} B + ${operator} A + ${operator} undefined + ${operator} null + ${operator} string + ${operator} any; + `, + output: ` +type T = + A ${operator} B ${operator} C.D ${operator} D.E ${operator} number[] ${operator} string[] ${operator} any ${operator} string ${operator} readonly number[] ${operator} readonly string[] ${operator} 'a' ${operator} 'b' ${operator} "a" ${operator} "b" ${operator} (() => string) ${operator} (() => void) ${operator} { a: string } ${operator} { b: string } ${operator} [1, 2, 3] ${operator} [1, 2, 4] ${operator} null ${operator} undefined; + `, + errors: [ + { + messageId: 'notSortedNamed', + data: { + type, + name: 'T', + }, + }, + ], + }, + { + code: `type T = B ${operator} /* comment */ A;`, + output: null, + errors: [ + { + messageId: 'notSortedNamed', + data: { + type, + name: 'T', + }, + suggestions: [ + { + messageId: 'suggestFix', + output: `type T = A ${operator} B;`, + }, + ], + }, + ], + }, + { + code: `type T = (() => /* comment */ A) ${operator} B;`, + output: `type T = B ${operator} (() => /* comment */ A);`, + errors: [ + { + messageId: 'notSortedNamed', + data: { + type, + name: 'T', + }, + suggestions: null, + }, + ], + }, + { + code: `type Expected = (new (x: number) => boolean) ${operator} string;`, + output: `type Expected = string ${operator} (new (x: number) => boolean);`, + errors: [ + { + messageId: 'notSortedNamed', + }, + ], + }, + { + code: `type T = (| A) ${operator} B;`, + output: `type T = B ${operator} (| A);`, + errors: [ + { + messageId: 'notSortedNamed', + data: { + type, + name: 'T', + }, + }, + ], + }, + { + code: `type T = (& A) ${operator} B;`, + output: `type T = B ${operator} (& A);`, + errors: [ + { + messageId: 'notSortedNamed', + data: { + type, + name: 'T', + }, + }, + ], + }, + ]; +}; + +ruleTester.run('sort-type-constituents', rule, { + valid: [ + ...valid('|'), + { + code: 'type T = B | A;', + options: [ + { + checkUnions: false, + }, + ], + }, + + ...valid('&'), + { + code: 'type T = B & A;', + options: [ + { + checkIntersections: false, + }, + ], + }, + + { + code: noFormat` +type T = [1] | 'a' | 'b' | "b" | 1 | 2 | {}; + `, + options: [ + { + groupOrder: ['tuple', 'literal', 'object'], + }, + ], + }, + { + // if not specified - groups should be placed last + code: ` +type T = 1 | string | {} | A; + `, + options: [ + { + groupOrder: ['literal', 'keyword'], + }, + ], + }, + "type A = string | (T extends number ? 'hi' : 'there');", + ], + invalid: [ + ...invalid('|'), + ...invalid('&'), + { + code: 'type T = (B | C) & A;', + output: `type T = A & (B | C);`, + errors: [ + { + messageId: 'notSortedNamed', + data: { + type: 'Intersection', + name: 'T', + }, + }, + ], + }, + { + output: "type A = string | (T extends number ? 'hi' : 'there');", + code: "type A = (T extends number ? 'hi' : 'there') | string;", + errors: [ + { + messageId: 'notSortedNamed', + data: { + type: 'Union', + name: 'A', + }, + }, + ], + }, + ], +}); diff --git a/packages/eslint-plugin/tests/rules/sort-type-union-intersection-members.test.ts b/packages/eslint-plugin/tests/rules/sort-type-union-intersection-members.test.ts index 1d29a45ce61..6242d140634 100644 --- a/packages/eslint-plugin/tests/rules/sort-type-union-intersection-members.test.ts +++ b/packages/eslint-plugin/tests/rules/sort-type-union-intersection-members.test.ts @@ -1,8 +1,10 @@ -import { TSESLint } from '@typescript-eslint/utils'; -import rule, { +import type { TSESLint } from '@typescript-eslint/utils'; + +import type { MessageIds, Options, } from '../../src/rules/sort-type-union-intersection-members'; +import rule from '../../src/rules/sort-type-union-intersection-members'; import { noFormat, RuleTester } from '../RuleTester'; const ruleTester = new RuleTester({ @@ -43,6 +45,8 @@ const valid = (operator: '|' | '&'): TSESLint.ValidTestCase[] => [ type T = ${operator} A ${operator} B + ${operator} C.D + ${operator} D.E ${operator} intrinsic ${operator} number[] ${operator} string[] @@ -127,7 +131,7 @@ const invalid = ( }, { code: noFormat`type T = (B) ${operator} (A);`, - output: noFormat`type T = A ${operator} B;`, + output: `type T = A ${operator} B;`, errors: [ { messageId: 'notSortedNamed', @@ -218,6 +222,8 @@ type T = ${operator} readonly number[] ${operator} string[] ${operator} number[] + ${operator} D.E + ${operator} C.D ${operator} B ${operator} A ${operator} undefined @@ -225,9 +231,9 @@ type T = ${operator} string ${operator} any; `, - output: noFormat` + output: ` type T = - A ${operator} B ${operator} number[] ${operator} string[] ${operator} any ${operator} string ${operator} readonly number[] ${operator} readonly string[] ${operator} 'a' ${operator} 'b' ${operator} "a" ${operator} "b" ${operator} (() => string) ${operator} (() => void) ${operator} { a: string } ${operator} { b: string } ${operator} [1, 2, 3] ${operator} [1, 2, 4] ${operator} null ${operator} undefined; + A ${operator} B ${operator} C.D ${operator} D.E ${operator} number[] ${operator} string[] ${operator} any ${operator} string ${operator} readonly number[] ${operator} readonly string[] ${operator} 'a' ${operator} 'b' ${operator} "a" ${operator} "b" ${operator} (() => string) ${operator} (() => void) ${operator} { a: string } ${operator} { b: string } ${operator} [1, 2, 3] ${operator} [1, 2, 4] ${operator} null ${operator} undefined; `, errors: [ { @@ -281,6 +287,32 @@ type T = }, ], }, + { + code: `type T = (| A) ${operator} B;`, + output: `type T = B ${operator} (| A);`, + errors: [ + { + messageId: 'notSortedNamed', + data: { + type, + name: 'T', + }, + }, + ], + }, + { + code: `type T = (& A) ${operator} B;`, + output: `type T = B ${operator} (& A);`, + errors: [ + { + messageId: 'notSortedNamed', + data: { + type, + name: 'T', + }, + }, + ], + }, ]; }; @@ -328,5 +360,21 @@ type T = 1 | string | {} | A; ], }, ], - invalid: [...invalid('|'), ...invalid('&')], + invalid: [ + ...invalid('|'), + ...invalid('&'), + { + code: 'type T = (B | C) & A;', + output: `type T = A & (B | C);`, + errors: [ + { + messageId: 'notSortedNamed', + data: { + type: 'Intersection', + name: 'T', + }, + }, + ], + }, + ], }); diff --git a/packages/eslint-plugin/tests/rules/space-before-function-paren.test.ts b/packages/eslint-plugin/tests/rules/space-before-function-paren.test.ts index 72405cf35d6..065b36b0c09 100644 --- a/packages/eslint-plugin/tests/rules/space-before-function-paren.test.ts +++ b/packages/eslint-plugin/tests/rules/space-before-function-paren.test.ts @@ -4,6 +4,7 @@ /* eslint-enable eslint-comments/no-use */ import { AST_NODE_TYPES } from '@typescript-eslint/utils'; + import rule from '../../src/rules/space-before-function-paren'; import { RuleTester } from '../RuleTester'; diff --git a/packages/eslint-plugin/tests/rules/strict-boolean-expressions.test.ts b/packages/eslint-plugin/tests/rules/strict-boolean-expressions.test.ts index 335c2c71346..9261acda41b 100644 --- a/packages/eslint-plugin/tests/rules/strict-boolean-expressions.test.ts +++ b/packages/eslint-plugin/tests/rules/strict-boolean-expressions.test.ts @@ -1,8 +1,10 @@ import * as path from 'path'; -import rule, { + +import type { MessageId, Options, } from '../../src/rules/strict-boolean-expressions'; +import rule from '../../src/rules/strict-boolean-expressions'; import { batchedSingleLineTests, getFixturesRootDir, @@ -117,6 +119,20 @@ ruleTester.run('strict-boolean-expressions', rule, { (x: T) => x ? 1 : 0; `, }), + + // logical operator + ...batchedSingleLineTests({ + options: [{ allowString: true, allowNumber: true }], + code: ` + 1 && true && 'x' && {}; + let x = 0 || false || '' || null; + if (1 && true && 'x') void 0; + if (0 || false || '') void 0; + 1 && true && 'x' ? {} : null; + 0 || false || '' ? null : {}; + `, + }), + { code: ` declare const x: string[] | null; @@ -268,15 +284,15 @@ if (y) { suggestions: [ { messageId: 'conditionFixCompareStringLength', - output: noFormat`if (((''.length > 0) && {}) || (0 && void 0)) { }`, + output: `if (((''.length > 0) && {}) || (0 && void 0)) { }`, }, { messageId: 'conditionFixCompareEmptyString', - output: noFormat`if ((('' !== "") && {}) || (0 && void 0)) { }`, + output: `if ((('' !== "") && {}) || (0 && void 0)) { }`, }, { messageId: 'conditionFixCastBoolean', - output: noFormat`if (((Boolean('')) && {}) || (0 && void 0)) { }`, + output: `if (((Boolean('')) && {}) || (0 && void 0)) { }`, }, ], }, @@ -288,15 +304,15 @@ if (y) { suggestions: [ { messageId: 'conditionFixCompareZero', - output: noFormat`if (('' && {}) || ((0 !== 0) && void 0)) { }`, + output: `if (('' && {}) || ((0 !== 0) && void 0)) { }`, }, { messageId: 'conditionFixCompareNaN', - output: noFormat`if (('' && {}) || ((!Number.isNaN(0)) && void 0)) { }`, + output: `if (('' && {}) || ((!Number.isNaN(0)) && void 0)) { }`, }, { messageId: 'conditionFixCastBoolean', - output: noFormat`if (('' && {}) || ((Boolean(0)) && void 0)) { }`, + output: `if (('' && {}) || ((Boolean(0)) && void 0)) { }`, }, ], }, @@ -304,6 +320,89 @@ if (y) { ], }, + // shouldn't check last logical operand when used for control flow + { + options: [{ allowString: false, allowNumber: false }], + code: "'asd' && 123 && [] && null;", + errors: [ + { messageId: 'conditionErrorString', line: 1, column: 1 }, + { messageId: 'conditionErrorNumber', line: 1, column: 10 }, + { messageId: 'conditionErrorObject', line: 1, column: 17 }, + ], + }, + { + options: [{ allowString: false, allowNumber: false }], + code: "'asd' || 123 || [] || null;", + errors: [ + { messageId: 'conditionErrorString', line: 1, column: 1 }, + { messageId: 'conditionErrorNumber', line: 1, column: 10 }, + { messageId: 'conditionErrorObject', line: 1, column: 17 }, + ], + }, + { + options: [{ allowString: false, allowNumber: false }], + code: "let x = (1 && 'a' && null) || 0 || '' || {};", + errors: [ + { messageId: 'conditionErrorNumber', line: 1, column: 10 }, + { messageId: 'conditionErrorString', line: 1, column: 15 }, + { messageId: 'conditionErrorNullish', line: 1, column: 22 }, + { messageId: 'conditionErrorNumber', line: 1, column: 31 }, + { messageId: 'conditionErrorString', line: 1, column: 36 }, + ], + }, + { + options: [{ allowString: false, allowNumber: false }], + code: "return (1 || 'a' || null) && 0 && '' && {};", + errors: [ + { messageId: 'conditionErrorNumber', line: 1, column: 9 }, + { messageId: 'conditionErrorString', line: 1, column: 14 }, + { messageId: 'conditionErrorNullish', line: 1, column: 21 }, + { messageId: 'conditionErrorNumber', line: 1, column: 30 }, + { messageId: 'conditionErrorString', line: 1, column: 35 }, + ], + }, + { + options: [{ allowString: false, allowNumber: false }], + code: "console.log((1 && []) || ('a' && {}));", + errors: [ + { messageId: 'conditionErrorNumber', line: 1, column: 14 }, + { messageId: 'conditionErrorObject', line: 1, column: 19 }, + { messageId: 'conditionErrorString', line: 1, column: 27 }, + ], + }, + + // should check all logical operands when used in a condition + { + options: [{ allowString: false, allowNumber: false }], + code: "if ((1 && []) || ('a' && {})) void 0;", + errors: [ + { messageId: 'conditionErrorNumber', line: 1, column: 6 }, + { messageId: 'conditionErrorObject', line: 1, column: 11 }, + { messageId: 'conditionErrorString', line: 1, column: 19 }, + { messageId: 'conditionErrorObject', line: 1, column: 26 }, + ], + }, + { + options: [{ allowString: false, allowNumber: false }], + code: "let x = null || 0 || 'a' || [] ? {} : undefined;", + errors: [ + { messageId: 'conditionErrorNullish', line: 1, column: 9 }, + { messageId: 'conditionErrorNumber', line: 1, column: 17 }, + { messageId: 'conditionErrorString', line: 1, column: 22 }, + { messageId: 'conditionErrorObject', line: 1, column: 29 }, + ], + }, + { + options: [{ allowString: false, allowNumber: false }], + code: "return !(null || 0 || 'a' || []);", + errors: [ + { messageId: 'conditionErrorNullish', line: 1, column: 10 }, + { messageId: 'conditionErrorNumber', line: 1, column: 18 }, + { messageId: 'conditionErrorString', line: 1, column: 23 }, + { messageId: 'conditionErrorObject', line: 1, column: 30 }, + ], + }, + // nullish in boolean context ...batchedSingleLineTests({ code: noFormat` @@ -625,7 +724,7 @@ if (y) { { messageId: 'conditionErrorNumber', line: 3, column: 26 }, { messageId: 'conditionErrorNumber', line: 4, column: 43 }, ], - output: noFormat` + output: ` if ([].length === 0) {} (a: number[]) => (a.length > 0) && "..." (...a: T) => (a.length > 0) || "empty"; @@ -717,7 +816,7 @@ if (y) { { messageId: 'conditionErrorNullableObject', line: 3, column: 33 }, { messageId: 'conditionErrorNullableObject', line: 4, column: 52 }, ], - output: noFormat` + output: ` declare const x: object | null; if (x != null) {} (x?: { a: number }) => x == null; (x: T) => (x != null) ? 1 : 0; @@ -962,7 +1061,7 @@ if (x) { { messageId: 'conditionErrorNullableObject', line: 5, column: 9 }, { messageId: 'conditionErrorNullableObject', line: 6, column: 9 }, ], - output: noFormat` + output: ` declare const obj: { x: number } | null; (obj == null) ? 1 : 0 obj == null diff --git a/packages/eslint-plugin/tests/rules/switch-exhaustiveness-check.test.ts b/packages/eslint-plugin/tests/rules/switch-exhaustiveness-check.test.ts index 415afc20fc1..747323bd486 100644 --- a/packages/eslint-plugin/tests/rules/switch-exhaustiveness-check.test.ts +++ b/packages/eslint-plugin/tests/rules/switch-exhaustiveness-check.test.ts @@ -1,6 +1,7 @@ import path from 'path'; + import switchExhaustivenessCheck from '../../src/rules/switch-exhaustiveness-check'; -import { RuleTester, noFormat } from '../RuleTester'; +import { RuleTester } from '../RuleTester'; const rootPath = path.join(process.cwd(), 'tests/fixtures/'); @@ -436,14 +437,14 @@ function test(value: T): number { return 1; } } - `.trimRight(), + `, errors: [ { messageId: 'switchIsNotExhaustive', suggestions: [ { messageId: 'addMissingCases', - output: noFormat` + output: ` type T = 1 | 2; function test(value: T): number { @@ -453,7 +454,7 @@ function test(value: T): number { case 2: { throw new Error('Not implemented yet: 2 case') } } } - `.trimRight(), + `, }, ], }, @@ -468,14 +469,14 @@ function test(value: T): number { switch (value) { } } - `.trimRight(), + `, errors: [ { messageId: 'switchIsNotExhaustive', suggestions: [ { messageId: 'addMissingCases', - output: noFormat` + output: ` type T = 1 | 2; function test(value: T): number { @@ -484,7 +485,7 @@ function test(value: T): number { case 2: { throw new Error('Not implemented yet: 2 case') } } } - `.trimRight(), + `, }, ], }, @@ -502,14 +503,14 @@ function test(arg: Enum): string { switch (arg) { } } - `.trimRight(), + `, errors: [ { messageId: 'switchIsNotExhaustive', suggestions: [ { messageId: 'addMissingCases', - output: noFormat` + output: ` export enum Enum { 'test-test' = 'test-test', 'test' = 'test', @@ -521,7 +522,7 @@ function test(arg: Enum): string { case Enum.test: { throw new Error('Not implemented yet: Enum.test case') } } } - `.trimRight(), + `, }, ], }, @@ -539,14 +540,14 @@ function test(arg: Enum): string { switch (arg) { } } - `.trimRight(), + `, errors: [ { messageId: 'switchIsNotExhaustive', suggestions: [ { messageId: 'addMissingCases', - output: noFormat` + output: ` export enum Enum { '' = 'test-test', 'test' = 'test', @@ -558,7 +559,7 @@ function test(arg: Enum): string { case Enum.test: { throw new Error('Not implemented yet: Enum.test case') } } } - `.trimRight(), + `, }, ], }, @@ -576,14 +577,14 @@ function test(arg: Enum): string { switch (arg) { } } - `.trimRight(), + `, errors: [ { messageId: 'switchIsNotExhaustive', suggestions: [ { messageId: 'addMissingCases', - output: noFormat` + output: ` export enum Enum { '9test' = 'test-test', 'test' = 'test', @@ -595,7 +596,7 @@ function test(arg: Enum): string { case Enum.test: { throw new Error('Not implemented yet: Enum.test case') } } } - `.trimRight(), + `, }, ], }, diff --git a/packages/eslint-plugin/tests/rules/type-annotation-spacing.test.ts b/packages/eslint-plugin/tests/rules/type-annotation-spacing.test.ts index 17ae884c72f..17fb23c7771 100644 --- a/packages/eslint-plugin/tests/rules/type-annotation-spacing.test.ts +++ b/packages/eslint-plugin/tests/rules/type-annotation-spacing.test.ts @@ -3,13 +3,14 @@ /* eslint "@typescript-eslint/internal/plugin-test-formatting": ["error", { formatWithPrettier: false }] */ /* eslint-enable eslint-comments/no-use */ -import { TSESLint } from '@typescript-eslint/utils'; -import { RuleTester } from '../RuleTester'; +import type { TSESLint } from '@typescript-eslint/utils'; + import rule from '../../src/rules/type-annotation-spacing'; -import { +import type { InferMessageIdsTypeFromRule, InferOptionsTypeFromRule, } from '../../src/util'; +import { RuleTester } from '../RuleTester'; type MessageIds = InferMessageIdsTypeFromRule; type Options = InferOptionsTypeFromRule; diff --git a/packages/eslint-plugin/tests/rules/typedef.test.ts b/packages/eslint-plugin/tests/rules/typedef.test.ts index d6f724bfd0b..3a58eb1387a 100644 --- a/packages/eslint-plugin/tests/rules/typedef.test.ts +++ b/packages/eslint-plugin/tests/rules/typedef.test.ts @@ -1,5 +1,5 @@ import rule from '../../src/rules/typedef'; -import { RuleTester, getFixturesRootDir, noFormat } from '../RuleTester'; +import { getFixturesRootDir, noFormat, RuleTester } from '../RuleTester'; const rootDir = getFixturesRootDir(); const ruleTester = new RuleTester({ diff --git a/packages/eslint-plugin/tests/rules/unbound-method.test.ts b/packages/eslint-plugin/tests/rules/unbound-method.test.ts index 524f64a47a4..49b06a4ac50 100644 --- a/packages/eslint-plugin/tests/rules/unbound-method.test.ts +++ b/packages/eslint-plugin/tests/rules/unbound-method.test.ts @@ -1,6 +1,8 @@ -import { TSESLint } from '@typescript-eslint/utils'; -import rule, { MessageIds, Options } from '../../src/rules/unbound-method'; -import { RuleTester, getFixturesRootDir } from '../RuleTester'; +import type { TSESLint } from '@typescript-eslint/utils'; + +import type { MessageIds, Options } from '../../src/rules/unbound-method'; +import rule from '../../src/rules/unbound-method'; +import { getFixturesRootDir, RuleTester } from '../RuleTester'; const rootPath = getFixturesRootDir(); @@ -588,5 +590,59 @@ class OtherClass extends BaseClass { }, ], }, + { + code: ` +const values = { + a() {}, + b: () => {}, +}; + +const { a, b } = values; + `, + errors: [ + { + line: 7, + column: 9, + endColumn: 10, + messageId: 'unboundWithoutThisAnnotation', + }, + ], + }, + { + code: ` +const values = { + a() {}, + b: () => {}, +}; + +const { a: c } = values; + `, + errors: [ + { + line: 7, + column: 9, + endColumn: 10, + messageId: 'unboundWithoutThisAnnotation', + }, + ], + }, + { + code: ` +const values = { + a() {}, + b: () => {}, +}; + +const { b, a } = values; + `, + errors: [ + { + line: 7, + column: 12, + endColumn: 13, + messageId: 'unboundWithoutThisAnnotation', + }, + ], + }, ], }); diff --git a/packages/eslint-plugin/tests/util/getWrappingFixer.test.ts b/packages/eslint-plugin/tests/util/getWrappingFixer.test.ts index 8e2b48e4bed..2c7b7977ffb 100644 --- a/packages/eslint-plugin/tests/util/getWrappingFixer.test.ts +++ b/packages/eslint-plugin/tests/util/getWrappingFixer.test.ts @@ -1,6 +1,7 @@ -import { TSESTree } from '@typescript-eslint/utils'; -import { getFixturesRootDir, RuleTester } from '../RuleTester'; +import type { TSESTree } from '@typescript-eslint/utils'; + import { createRule, getWrappingFixer } from '../../src/util'; +import { getFixturesRootDir, RuleTester } from '../RuleTester'; const rule = createRule({ name: 'void-everything', diff --git a/packages/eslint-plugin/tests/util/isNodeEqual.test.ts b/packages/eslint-plugin/tests/util/isNodeEqual.test.ts index 76da9eabdb4..f087ddbddcd 100644 --- a/packages/eslint-plugin/tests/util/isNodeEqual.test.ts +++ b/packages/eslint-plugin/tests/util/isNodeEqual.test.ts @@ -1,6 +1,7 @@ -import { TSESTree, TSESLint } from '@typescript-eslint/utils'; -import { getFixturesRootDir, RuleTester } from '../RuleTester'; +import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; + import { createRule, isNodeEqual } from '../../src/util'; +import { getFixturesRootDir, RuleTester } from '../RuleTester'; const rule = createRule({ name: 'no-useless-expression', diff --git a/packages/eslint-plugin/tests/util/misc.test.ts b/packages/eslint-plugin/tests/util/misc.test.ts index c4291f00d9f..6eae810eb62 100644 --- a/packages/eslint-plugin/tests/util/misc.test.ts +++ b/packages/eslint-plugin/tests/util/misc.test.ts @@ -23,3 +23,17 @@ describe('formatWordList', () => { ); }); }); + +describe('findLastIndex', () => { + it('returns -1 if there are no elements to iterate over', () => { + expect(misc.findLastIndex([], () => true)).toBe(-1); + }); + + it('returns the index of the last element if predicate just returns true for all values', () => { + expect(misc.findLastIndex([1, 2, 3], () => true)).toBe(2); + }); + + it('returns the index of the last occurance of a duplicate element', () => { + expect(misc.findLastIndex([1, 2, 3, 3, 5], n => n === 3)).toBe(3); + }); +}); diff --git a/packages/eslint-plugin/tools/generate-breaking-changes.ts b/packages/eslint-plugin/tools/generate-breaking-changes.ts new file mode 100644 index 00000000000..0b7da717287 --- /dev/null +++ b/packages/eslint-plugin/tools/generate-breaking-changes.ts @@ -0,0 +1,156 @@ +// eslint-disable-next-line @typescript-eslint/consistent-type-imports +type RulesFile = typeof import('../src/rules'); + +interface RulesObject { + default: RulesFile; +} + +async function main(): Promise { + const { + default: { default: rules }, + } = + // @ts-expect-error -- We don't support ESM imports of local code yet. + (await import('../dist/rules/index.js')) as RulesObject; + const { markdownTable } = await import('markdown-table'); + const { fetch } = await import('cross-fetch'); + + const newRuleNames = await getNewRulesAsOfMajorVersion('5.0.0'); + + console.log(`## Table Key + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ColumnDescriptionEmojis
StatusBeing added, deprecated, or removed +
    +
  • 🆕 = newly added to typescript-eslint
  • +
  • 🙅 = deprecated in the next major
  • +
  • ➖️ = to be removed from the plugin in the next version
  • +
+
ExtExtension rule? +
    +
  • ☑️ = yes
  • +
+
RRecommended +
    +
  • ➕ = add to recommended this version
  • +
  • ⚠️ = recommended as warning
  • +
  • 🛑 = recommended as an error
  • +
  • ➖️ = remove from recommended this version
  • +
+
RWTRecommended-requiring-type-checking +
    +
  • ➕ = add to recommended-with-typechecking this version
  • +
  • ⚠️ = recommended as warning
  • +
  • 🛑 = recommended as an error
  • +
  • ➖️ = remove from recommended this version
  • +
+
StrictStrict +
    +
  • ➕ = add to strict this version
  • +
  • ⚠️ = recommended as warning
  • +
  • ➖️ = remove from strict this version
  • +
+
+ +## Recommendations Table + +> Hint: search for 🆕 to find newly added rules, and ➕ or ➖ to see config changes. +`); + + console.log( + markdownTable([ + ['Rule', 'Status', 'Ext', 'R', 'RWT', 'Strict', 'Comment'], + ...Object.entries(rules).map(([ruleName, { meta }]) => { + const { deprecated } = meta; + const { extendsBaseRule, recommended, requiresTypeChecking } = + meta.docs!; + + return [ + `[\`${ruleName}\`](https://typescript-eslint.io/rules/${ruleName})`, + newRuleNames.has(ruleName) ? '🆕' : deprecated ? '🙅' : '', + extendsBaseRule ? '☑️' : '', + recommended && + ['error', 'warn'].includes(recommended) && + !requiresTypeChecking + ? '🛑' + : '', + recommended && + ['error', 'warn'].includes(recommended) && + requiresTypeChecking + ? '🛑' + : '', + recommended === 'strict' ? '⚠️' : '', + meta.type === 'layout' ? 'layout 💩' : '(todo)', + ]; + }), + ]), + ); + + // Annotate which rules are new since version 5.0.0 + async function getNewRulesAsOfMajorVersion( + oldVersion: string, + ): Promise> { + // 1. Get the current list of rules (already done) + const newRuleNames = Object.keys(rules); + + // 2. Use some CDN thing for the 5.X version of typescript-eslint + const oldUrl = `https://unpkg.com/@typescript-eslint/eslint-plugin@${oldVersion}/dist/configs/all.js`; + const oldFileText = await (await fetch(oldUrl)).text(); + const oldObjectText = oldFileText.substring( + oldFileText.indexOf('{'), + oldFileText.lastIndexOf('}') + 1, + ); + // Normally we wouldn't condone using the 'eval' API... + // But this is an internal-only script and it's the easiest way to convert + // the JS raw text into a runtime object. 🤷 + let oldRulesObject!: { rules: RulesFile }; + eval('oldRulesObject = ' + oldObjectText); + const oldRuleNames = new Set(Object.keys(oldRulesObject.rules)); + + // 3. Get the keys that exist in (1) (new version) and not (2) (old version) + return new Set( + newRuleNames.filter( + newRuleName => !oldRuleNames.has(`@typescript-eslint/${newRuleName}`), + ), + ); + } + + await getNewRulesAsOfMajorVersion('5.0.0'); +} + +main().catch(error => { + console.error(error); +}); diff --git a/packages/eslint-plugin/tools/generate-configs.ts b/packages/eslint-plugin/tools/generate-configs.ts index 6d1a3dc6ba7..30132f9b0f0 100644 --- a/packages/eslint-plugin/tools/generate-configs.ts +++ b/packages/eslint-plugin/tools/generate-configs.ts @@ -1,8 +1,9 @@ -import { TSESLint } from '@typescript-eslint/utils'; +import type { TSESLint } from '@typescript-eslint/utils'; import chalk from 'chalk'; import fs from 'fs'; import path from 'path'; import { format, resolveConfig } from 'prettier'; + import rules from '../src/rules'; function addAutoGeneratedComment(code: string): string { diff --git a/packages/eslint-plugin/tools/generate-rules-lists.ts b/packages/eslint-plugin/tools/generate-rules-lists.ts deleted file mode 100644 index 85110db9ab3..00000000000 --- a/packages/eslint-plugin/tools/generate-rules-lists.ts +++ /dev/null @@ -1,148 +0,0 @@ -#!/usr/bin/env ts-node - -import fs from 'fs'; -import path from 'path'; - -import rules from '../src/rules'; - -import prettier from 'prettier'; -import { TSESLint } from '@typescript-eslint/utils'; - -interface RuleDetails { - name: string; - description: string; - recommended: TSESLint.RuleRecommendation; - fixable: boolean; - requiresTypeChecking: boolean; - extendsBaseRule: boolean; -} - -type RuleColumn = [ - string, - string, - ':lock:' | ':white_check_mark:' | '', - ':wrench:' | '', - ':thought_balloon:' | '', -]; - -const emojiKey = { - recommended: ':white_check_mark:', - strict: ':lock:', - fixable: ':wrench:', - requiresTypeChecking: ':thought_balloon:', -} as const; - -const staticElements = { - rulesListKey: [ - `**Key**: ${emojiKey.recommended} = recommended`, - `${emojiKey.strict} = strict`, - `${emojiKey.fixable} = fixable`, - `${emojiKey.requiresTypeChecking} = requires type information`, - ].join(', '), - listHeaderRow: [ - 'Name', - 'Description', - `${emojiKey.recommended}${emojiKey.strict}`, - emojiKey.fixable, - emojiKey.requiresTypeChecking, - ], - listSpacerRow: Array(5).fill('-'), -}; - -const returnEmojiIfTrue = ( - key: TKey, - obj: { [K in TKey]?: unknown }, -): typeof emojiKey[TKey] | '' => (obj[key] ? emojiKey[key] : ''); - -const createRuleLink = (ruleName: string, basePath: string): string => - `[\`@typescript-eslint/${ruleName}\`](${basePath}${ruleName}.md)`; - -const buildRuleRow = (rule: RuleDetails, basePath: string): RuleColumn => [ - createRuleLink(rule.name, basePath), - rule.description, - rule.recommended === 'strict' - ? emojiKey.strict - : returnEmojiIfTrue('recommended', rule), - returnEmojiIfTrue('fixable', rule), - returnEmojiIfTrue('requiresTypeChecking', rule), -]; - -const buildRulesTable = ( - rules: RuleDetails[], - basePath: string, -): string[][] => [ - staticElements.listHeaderRow, - staticElements.listSpacerRow, - ...rules - .sort(({ name: ruleNameA }, { name: ruleNameB }) => - ruleNameA.localeCompare(ruleNameB), - ) - .map(item => buildRuleRow(item, basePath)), -]; - -const generateRulesListMarkdown = ( - rules: RuleDetails[], - basePath: string, -): string => - [ - '', - staticElements.rulesListKey, - '', - ...buildRulesTable(rules, basePath).map(column => - [...column, ' '].join('|'), - ), - '', - ].join('\n'); - -const updateRulesList = ( - listName: 'base' | 'extension', - rules: RuleDetails[], - markdown: string, - basePath: string, -): string => { - const listBeginMarker = ``; - const listEndMarker = ``; - - const listStartIndex = markdown.indexOf(listBeginMarker); - const listEndIndex = markdown.indexOf(listEndMarker); - - if (listStartIndex === -1 || listEndIndex === -1) { - throw new Error(`cannot find start or end of ${listName} list`); - } - - return [ - markdown.substring(0, listStartIndex - 1), - listBeginMarker, - '', - generateRulesListMarkdown(rules, basePath), // - markdown.substring(listEndIndex), - ].join('\n'); -}; - -const rulesDetails: RuleDetails[] = Object.entries(rules) - .filter(([, rule]) => rule.meta.deprecated !== true) - .map(([name, rule]) => ({ - name, - description: rule.meta.docs?.description ?? '', - recommended: rule.meta.docs?.recommended ?? false, - fixable: !!rule.meta.fixable, - requiresTypeChecking: rule.meta.docs?.requiresTypeChecking ?? false, - extendsBaseRule: !!rule.meta.docs?.extendsBaseRule ?? false, - })); - -const baseRules = rulesDetails.filter(rule => !rule.extendsBaseRule); -const extensionRules = rulesDetails.filter(rule => rule.extendsBaseRule); - -function updateFile(file: string, basePath: string): void { - let readme = fs.readFileSync(file, 'utf8'); - - readme = updateRulesList('base', baseRules, readme, basePath); - readme = updateRulesList('extension', extensionRules, readme, basePath); - - readme = prettier.format(readme, { parser: 'markdown' }); - - fs.writeFileSync(file, readme, 'utf8'); -} - -updateFile(path.resolve(__dirname, '../README.md'), './docs/rules/'); -updateFile(path.resolve(__dirname, '../docs/rules/README.md'), './'); diff --git a/packages/eslint-plugin/typings/eslint-rules.d.ts b/packages/eslint-plugin/typings/eslint-rules.d.ts index 08f17271735..38682f60c5b 100644 --- a/packages/eslint-plugin/typings/eslint-rules.d.ts +++ b/packages/eslint-plugin/typings/eslint-rules.d.ts @@ -5,7 +5,7 @@ // } declare module 'eslint/lib/rules/arrow-parens' { - import { TSESLint, TSESTree } from '@typescript-eslint/utils'; + import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; const rule: TSESLint.RuleModule< | 'unexpectedParens' @@ -26,7 +26,7 @@ declare module 'eslint/lib/rules/arrow-parens' { } declare module 'eslint/lib/rules/camelcase' { - import { TSESLint, TSESTree } from '@typescript-eslint/utils'; + import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; const rule: TSESLint.RuleModule< 'notCamelCase', @@ -46,7 +46,7 @@ declare module 'eslint/lib/rules/camelcase' { } declare module 'eslint/lib/rules/indent' { - import { TSESLint, TSESTree } from '@typescript-eslint/utils'; + import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; type ElementList = number | 'first' | 'off'; const rule: TSESLint.RuleModule< @@ -141,9 +141,61 @@ declare module 'eslint/lib/rules/indent' { export = rule; } +declare module 'eslint/lib/rules/key-spacing' { + import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; + import type { RuleFunction } from '@typescript-eslint/utils/dist/ts-eslint'; + + type Options = [ + { + beforeColon?: boolean; + afterColon?: boolean; + mode?: 'strict' | 'minimum'; + align?: + | 'value' + | 'colon' + | { + on?: 'value' | 'colon'; + beforeColon?: boolean; + afterColon?: boolean; + mode?: 'strict' | 'minimum'; + }; + singleLine?: { + beforeColon?: boolean; + afterColon?: boolean; + mode?: 'strict' | 'minimum'; + }; + multiLine?: { + beforeColon?: boolean; + afterColon?: boolean; + mode?: 'strict' | 'minimum'; + align?: + | 'value' + | 'colon' + | { + on?: 'value' | 'colon'; + beforeColon?: boolean; + afterColon?: boolean; + mode?: 'strict' | 'minimum'; + }; + }; + }, + ]; + type MessageIds = 'extraKey' | 'extraValue' | 'missingKey' | 'missingValue'; + + const rule: TSESLint.RuleModule< + MessageIds, + Options, + { + ObjectExpression: RuleFunction; + Property: RuleFunction; + } + >; + export = rule; +} + declare module 'eslint/lib/rules/keyword-spacing' { - import { TSESLint, TSESTree } from '@typescript-eslint/utils'; - import { RuleFunction } from '@typescript-eslint/utils/dist/ts-eslint'; + import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; + import type { RuleFunction } from '@typescript-eslint/utils/dist/ts-eslint'; type Options = [ { @@ -221,7 +273,7 @@ declare module 'eslint/lib/rules/keyword-spacing' { } declare module 'eslint/lib/rules/no-dupe-class-members' { - import { TSESLint, TSESTree } from '@typescript-eslint/utils'; + import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; const rule: TSESLint.RuleModule< 'unexpected', @@ -242,7 +294,7 @@ declare module 'eslint/lib/rules/no-dupe-class-members' { } declare module 'eslint/lib/rules/no-dupe-args' { - import { TSESLint, TSESTree } from '@typescript-eslint/utils'; + import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; const rule: TSESLint.RuleModule< 'unexpected', @@ -256,7 +308,7 @@ declare module 'eslint/lib/rules/no-dupe-args' { } declare module 'eslint/lib/rules/no-empty-function' { - import { TSESLint, TSESTree } from '@typescript-eslint/utils'; + import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; const rule: TSESLint.RuleModule< 'unexpected', @@ -274,7 +326,7 @@ declare module 'eslint/lib/rules/no-empty-function' { } declare module 'eslint/lib/rules/no-implicit-globals' { - import { TSESLint, TSESTree } from '@typescript-eslint/utils'; + import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; const rule: TSESLint.RuleModule< | 'globalNonLexicalBinding' @@ -291,7 +343,7 @@ declare module 'eslint/lib/rules/no-implicit-globals' { } declare module 'eslint/lib/rules/no-loop-func' { - import { TSESLint, TSESTree } from '@typescript-eslint/utils'; + import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; const rule: TSESLint.RuleModule< 'unsafeRefs', @@ -306,7 +358,7 @@ declare module 'eslint/lib/rules/no-loop-func' { } declare module 'eslint/lib/rules/no-magic-numbers' { - import { TSESLint, TSESTree } from '@typescript-eslint/utils'; + import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; const rule: TSESLint.RuleModule< 'noMagic', @@ -330,7 +382,7 @@ declare module 'eslint/lib/rules/no-magic-numbers' { } declare module 'eslint/lib/rules/no-redeclare' { - import { TSESLint, TSESTree } from '@typescript-eslint/utils'; + import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; const rule: TSESLint.RuleModule< 'redeclared' | 'redeclaredAsBuiltin' | 'redeclaredBySyntax', @@ -347,7 +399,7 @@ declare module 'eslint/lib/rules/no-redeclare' { } declare module 'eslint/lib/rules/no-restricted-globals' { - import { TSESLint, TSESTree } from '@typescript-eslint/utils'; + import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; const rule: TSESLint.RuleModule< 'defaultMessage' | 'customMessage', @@ -366,7 +418,7 @@ declare module 'eslint/lib/rules/no-restricted-globals' { } declare module 'eslint/lib/rules/no-shadow' { - import { TSESLint, TSESTree } from '@typescript-eslint/utils'; + import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; const rule: TSESLint.RuleModule< 'noShadow', @@ -386,7 +438,7 @@ declare module 'eslint/lib/rules/no-shadow' { } declare module 'eslint/lib/rules/no-undef' { - import { TSESLint, TSESTree } from '@typescript-eslint/utils'; + import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; const rule: TSESLint.RuleModule< 'undef', @@ -403,7 +455,7 @@ declare module 'eslint/lib/rules/no-undef' { } declare module 'eslint/lib/rules/no-unused-vars' { - import { TSESLint, TSESTree } from '@typescript-eslint/utils'; + import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; const rule: TSESLint.RuleModule< 'unusedVar', @@ -429,7 +481,7 @@ declare module 'eslint/lib/rules/no-unused-vars' { } declare module 'eslint/lib/rules/no-unused-expressions' { - import { TSESLint, TSESTree } from '@typescript-eslint/utils'; + import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; const rule: TSESLint.RuleModule< 'expected', @@ -448,7 +500,7 @@ declare module 'eslint/lib/rules/no-unused-expressions' { } declare module 'eslint/lib/rules/no-use-before-define' { - import { TSESLint, TSESTree } from '@typescript-eslint/utils'; + import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; const rule: TSESLint.RuleModule< 'usedBeforeDefine', @@ -468,7 +520,7 @@ declare module 'eslint/lib/rules/no-use-before-define' { } declare module 'eslint/lib/rules/strict' { - import { TSESLint, TSESTree } from '@typescript-eslint/utils'; + import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; const rule: TSESLint.RuleModule< | 'function' @@ -490,7 +542,7 @@ declare module 'eslint/lib/rules/strict' { } declare module 'eslint/lib/rules/no-useless-constructor' { - import { TSESLint, TSESTree } from '@typescript-eslint/utils'; + import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; const rule: TSESLint.RuleModule< 'noUselessConstructor', @@ -503,7 +555,7 @@ declare module 'eslint/lib/rules/no-useless-constructor' { } declare module 'eslint/lib/rules/no-extra-parens' { - import { TSESLint, TSESTree } from '@typescript-eslint/utils'; + import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; const rule: TSESLint.RuleModule< 'unexpected', @@ -560,7 +612,7 @@ declare module 'eslint/lib/rules/no-extra-parens' { } declare module 'eslint/lib/rules/semi' { - import { TSESLint, TSESTree } from '@typescript-eslint/utils'; + import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; const rule: TSESLint.RuleModule< 'missingSemi' | 'extraSemi', @@ -590,7 +642,7 @@ declare module 'eslint/lib/rules/semi' { } declare module 'eslint/lib/rules/quotes' { - import { TSESLint, TSESTree } from '@typescript-eslint/utils'; + import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; const rule: TSESLint.RuleModule< 'wrongQuotes', @@ -610,7 +662,7 @@ declare module 'eslint/lib/rules/quotes' { } declare module 'eslint/lib/rules/brace-style' { - import { TSESLint, TSESTree } from '@typescript-eslint/utils'; + import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; const rule: TSESLint.RuleModule< | 'nextLineOpen' @@ -637,7 +689,7 @@ declare module 'eslint/lib/rules/brace-style' { } declare module 'eslint/lib/rules/no-extra-semi' { - import { TSESLint, TSESTree } from '@typescript-eslint/utils'; + import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; const rule: TSESLint.RuleModule< 'unexpected', @@ -664,7 +716,7 @@ declare module 'eslint/lib/rules/no-extra-semi' { } declare module 'eslint/lib/rules/lines-between-class-members' { - import { TSESLint, TSESTree } from '@typescript-eslint/utils'; + import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; const rule: TSESLint.RuleModule< 'always' | 'never', @@ -683,7 +735,7 @@ declare module 'eslint/lib/rules/lines-between-class-members' { } declare module 'eslint/lib/rules/init-declarations' { - import { TSESLint, TSESTree } from '@typescript-eslint/utils'; + import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; const rule: TSESLint.RuleModule< 'initialized' | 'notInitialized', @@ -701,7 +753,7 @@ declare module 'eslint/lib/rules/init-declarations' { } declare module 'eslint/lib/rules/no-invalid-this' { - import { TSESLint, TSESTree } from '@typescript-eslint/utils'; + import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; const rule: TSESLint.RuleModule< 'unexpectedThis', @@ -731,7 +783,7 @@ declare module 'eslint/lib/rules/no-invalid-this' { export = rule; } declare module 'eslint/lib/rules/dot-notation' { - import { TSESLint, TSESTree } from '@typescript-eslint/utils'; + import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; const rule: TSESLint.RuleModule< 'useDot' | 'useBrackets', @@ -752,7 +804,7 @@ declare module 'eslint/lib/rules/dot-notation' { } declare module 'eslint/lib/rules/no-loss-of-precision' { - import { TSESLint, TSESTree } from '@typescript-eslint/utils'; + import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; const rule: TSESLint.RuleModule< 'noLossOfPrecision', @@ -765,7 +817,7 @@ declare module 'eslint/lib/rules/no-loss-of-precision' { } declare module 'eslint/lib/rules/comma-dangle' { - import { TSESLint, TSESTree } from '@typescript-eslint/utils'; + import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; type StringOptions = | 'always-multiline' @@ -798,7 +850,7 @@ declare module 'eslint/lib/rules/comma-dangle' { } declare module 'eslint/lib/rules/no-duplicate-imports' { - import { TSESLint, TSESTree } from '@typescript-eslint/utils'; + import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; const rule: TSESLint.RuleModule< | 'import' @@ -824,7 +876,7 @@ declare module 'eslint/lib/rules/no-duplicate-imports' { } declare module 'eslint/lib/rules/space-infix-ops' { - import { TSESLint, TSESTree } from '@typescript-eslint/utils'; + import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; const rule: TSESLint.RuleModule< 'missingSpace', @@ -846,7 +898,7 @@ declare module 'eslint/lib/rules/space-infix-ops' { } declare module 'eslint/lib/rules/space-before-blocks' { - import { TSESLint, TSESTree } from '@typescript-eslint/utils'; + import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; const rule: TSESLint.RuleModule< 'missingSpace' | 'unexpectedSpace', @@ -869,7 +921,7 @@ declare module 'eslint/lib/rules/space-before-blocks' { } declare module 'eslint/lib/rules/prefer-const' { - import { TSESLint, TSESTree } from '@typescript-eslint/utils'; + import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; const rule: TSESLint.RuleModule< 'useConst', @@ -888,7 +940,7 @@ declare module 'eslint/lib/rules/prefer-const' { } declare module 'eslint/lib/rules/object-curly-spacing' { - import { TSESLint, TSESTree } from '@typescript-eslint/utils'; + import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; const rule: TSESLint.RuleModule< | 'requireSpaceBefore' @@ -913,7 +965,7 @@ declare module 'eslint/lib/rules/object-curly-spacing' { } declare module 'eslint/lib/rules/no-restricted-imports' { - import { TSESLint, TSESTree } from '@typescript-eslint/utils'; + import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; namespace rule { export type ArrayOfStringOrObject = ( diff --git a/packages/eslint-plugin/typings/functional-red-black-tree.d.ts b/packages/eslint-plugin/typings/functional-red-black-tree.d.ts deleted file mode 100644 index 7066de81fb3..00000000000 --- a/packages/eslint-plugin/typings/functional-red-black-tree.d.ts +++ /dev/null @@ -1,55 +0,0 @@ -declare module 'functional-red-black-tree' { - class RBNode { - public readonly key: TKey; - public readonly left: RBNode; - public readonly right: RBNode; - public readonly value: TValue; - } - - class RedBlackTreeIterator { - public readonly hasNext: boolean; - public readonly hasPrev: boolean; - public readonly index: number; - public readonly key: TKey; - public readonly node: RBNode | null; - public readonly tree: RBTree; - public readonly valid: boolean; - public readonly value: TValue; - - public clone(): RedBlackTreeIterator; - public remove(): RBTree; - public update(value: TValue): RBTree; - public next(): void; - public prev(): void; - } - - class RBTree { - public begin: RedBlackTreeIterator; - public end: RedBlackTreeIterator; - public readonly keys: TKey[]; - public readonly length: number; - public root: RBNode | null; - public readonly values: TValue[]; - - public get(key: TKey): TValue; - public insert(key: TKey, value: TValue): RBTree; - public remove(key: TKey): this; - public find(key: TKey): RedBlackTreeIterator; - public forEach( - visitor: (key: TKey, value: TValue) => void, - low: TKey, - high: TKey, - ): void; - - public ge(key: TKey): RedBlackTreeIterator; - public gt(key: TKey): RedBlackTreeIterator; - public le(key: TKey): RedBlackTreeIterator; - public lt(key: TKey): RedBlackTreeIterator; - public at(position: number): RedBlackTreeIterator; - } - - function createRBTree( - compare?: (a: TKey, b: TKey) => number, - ): RBTree; - export = createRBTree; -} diff --git a/packages/experimental-utils/CHANGELOG.md b/packages/experimental-utils/CHANGELOG.md index bcbfe2782b0..a11333dc15c 100644 --- a/packages/experimental-utils/CHANGELOG.md +++ b/packages/experimental-utils/CHANGELOG.md @@ -3,7 +3,7 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. -# [5.31.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.7...v5.31.0) (2022-07-25) +# [5.50.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.49.0...v5.50.0) (2023-01-31) **Note:** Version bump only for package @typescript-eslint/experimental-utils @@ -11,7 +11,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline -## [5.30.7](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.6...v5.30.7) (2022-07-18) +# [5.49.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.48.2...v5.49.0) (2023-01-23) **Note:** Version bump only for package @typescript-eslint/experimental-utils @@ -19,7 +19,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline -## [5.30.6](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.5...v5.30.6) (2022-07-11) +## [5.48.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.48.1...v5.48.2) (2023-01-16) **Note:** Version bump only for package @typescript-eslint/experimental-utils @@ -27,7 +27,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline -## [5.30.5](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.4...v5.30.5) (2022-07-04) +## [5.48.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.48.0...v5.48.1) (2023-01-09) **Note:** Version bump only for package @typescript-eslint/experimental-utils @@ -35,1082 +35,703 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline -## [5.30.4](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.3...v5.30.4) (2022-07-03) +# [5.48.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.47.1...v5.48.0) (2023-01-02) **Note:** Version bump only for package @typescript-eslint/experimental-utils +## [5.47.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.47.0...v5.47.1) (2022-12-26) +**Note:** Version bump only for package @typescript-eslint/experimental-utils +# [5.47.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.46.1...v5.47.0) (2022-12-19) +**Note:** Version bump only for package @typescript-eslint/experimental-utils -## [5.30.3](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.2...v5.30.3) (2022-07-01) +## [5.46.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.46.0...v5.46.1) (2022-12-12) **Note:** Version bump only for package @typescript-eslint/experimental-utils +# [5.46.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.45.1...v5.46.0) (2022-12-08) +**Note:** Version bump only for package @typescript-eslint/experimental-utils +## [5.45.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.45.0...v5.45.1) (2022-12-05) +**Note:** Version bump only for package @typescript-eslint/experimental-utils -## [5.30.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.1...v5.30.2) (2022-07-01) +# [5.45.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.44.0...v5.45.0) (2022-11-28) **Note:** Version bump only for package @typescript-eslint/experimental-utils +# [5.44.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.43.0...v5.44.0) (2022-11-21) +**Note:** Version bump only for package @typescript-eslint/experimental-utils +# [5.43.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.42.1...v5.43.0) (2022-11-14) +**Note:** Version bump only for package @typescript-eslint/experimental-utils -## 5.30.1 (2022-07-01) +## [5.42.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.42.0...v5.42.1) (2022-11-07) **Note:** Version bump only for package @typescript-eslint/experimental-utils +# [5.42.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.41.0...v5.42.0) (2022-10-31) +**Note:** Version bump only for package @typescript-eslint/experimental-utils +# [5.41.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.40.1...v5.41.0) (2022-10-24) +**Note:** Version bump only for package @typescript-eslint/experimental-utils -# [5.30.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.29.0...v5.30.0) (2022-06-27) +## [5.40.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.40.0...v5.40.1) (2022-10-17) **Note:** Version bump only for package @typescript-eslint/experimental-utils +# [5.40.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.39.0...v5.40.0) (2022-10-10) +**Note:** Version bump only for package @typescript-eslint/experimental-utils +# [5.39.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.38.1...v5.39.0) (2022-10-03) +**Note:** Version bump only for package @typescript-eslint/experimental-utils -# [5.29.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.28.0...v5.29.0) (2022-06-20) +## [5.38.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.38.0...v5.38.1) (2022-09-26) **Note:** Version bump only for package @typescript-eslint/experimental-utils +# [5.38.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.37.0...v5.38.0) (2022-09-19) +**Note:** Version bump only for package @typescript-eslint/experimental-utils +# [5.37.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.36.2...v5.37.0) (2022-09-12) +**Note:** Version bump only for package @typescript-eslint/experimental-utils -# [5.28.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.27.1...v5.28.0) (2022-06-13) +## [5.36.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.36.1...v5.36.2) (2022-09-05) **Note:** Version bump only for package @typescript-eslint/experimental-utils +## [5.36.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.36.0...v5.36.1) (2022-08-30) +**Note:** Version bump only for package @typescript-eslint/experimental-utils +# [5.36.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.35.1...v5.36.0) (2022-08-30) +**Note:** Version bump only for package @typescript-eslint/experimental-utils -## [5.27.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.27.0...v5.27.1) (2022-06-06) +## [5.35.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.35.0...v5.35.1) (2022-08-24) **Note:** Version bump only for package @typescript-eslint/experimental-utils +# [5.35.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.34.0...v5.35.0) (2022-08-24) +**Note:** Version bump only for package @typescript-eslint/experimental-utils +# [5.34.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.33.1...v5.34.0) (2022-08-22) +**Note:** Version bump only for package @typescript-eslint/experimental-utils -# [5.27.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.26.0...v5.27.0) (2022-05-30) +## [5.33.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.33.0...v5.33.1) (2022-08-15) +**Note:** Version bump only for package @typescript-eslint/experimental-utils -### Features +# [5.33.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.32.0...v5.33.0) (2022-08-08) -* [4.7] support new extensions ([#5027](https://github.com/typescript-eslint/typescript-eslint/issues/5027)) ([efc147b](https://github.com/typescript-eslint/typescript-eslint/commit/efc147b04dce52ab17415b6a4ae4076b944b9036)) +**Note:** Version bump only for package @typescript-eslint/experimental-utils +# [5.32.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.31.0...v5.32.0) (2022-08-01) +**Note:** Version bump only for package @typescript-eslint/experimental-utils +# [5.31.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.7...v5.31.0) (2022-07-25) +**Note:** Version bump only for package @typescript-eslint/experimental-utils -# [5.26.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.25.0...v5.26.0) (2022-05-23) +## [5.30.7](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.6...v5.30.7) (2022-07-18) **Note:** Version bump only for package @typescript-eslint/experimental-utils +## [5.30.6](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.5...v5.30.6) (2022-07-11) +**Note:** Version bump only for package @typescript-eslint/experimental-utils +## [5.30.5](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.4...v5.30.5) (2022-07-04) +**Note:** Version bump only for package @typescript-eslint/experimental-utils -# [5.25.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.24.0...v5.25.0) (2022-05-17) +## [5.30.4](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.3...v5.30.4) (2022-07-03) **Note:** Version bump only for package @typescript-eslint/experimental-utils +## [5.30.3](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.2...v5.30.3) (2022-07-01) +**Note:** Version bump only for package @typescript-eslint/experimental-utils +## [5.30.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.1...v5.30.2) (2022-07-01) +**Note:** Version bump only for package @typescript-eslint/experimental-utils -# [5.24.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.23.0...v5.24.0) (2022-05-16) +## 5.30.1 (2022-07-01) **Note:** Version bump only for package @typescript-eslint/experimental-utils +# [5.30.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.29.0...v5.30.0) (2022-06-27) +**Note:** Version bump only for package @typescript-eslint/experimental-utils +# [5.29.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.28.0...v5.29.0) (2022-06-20) +**Note:** Version bump only for package @typescript-eslint/experimental-utils -# [5.23.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.22.0...v5.23.0) (2022-05-09) +# [5.28.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.27.1...v5.28.0) (2022-06-13) **Note:** Version bump only for package @typescript-eslint/experimental-utils +## [5.27.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.27.0...v5.27.1) (2022-06-06) + +**Note:** Version bump only for package @typescript-eslint/experimental-utils +# [5.27.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.26.0...v5.27.0) (2022-05-30) +### Features +- [4.7] support new extensions ([#5027](https://github.com/typescript-eslint/typescript-eslint/issues/5027)) ([efc147b](https://github.com/typescript-eslint/typescript-eslint/commit/efc147b04dce52ab17415b6a4ae4076b944b9036)) -# [5.22.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.21.0...v5.22.0) (2022-05-02) +# [5.26.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.25.0...v5.26.0) (2022-05-23) **Note:** Version bump only for package @typescript-eslint/experimental-utils +# [5.25.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.24.0...v5.25.0) (2022-05-17) +**Note:** Version bump only for package @typescript-eslint/experimental-utils +# [5.24.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.23.0...v5.24.0) (2022-05-16) +**Note:** Version bump only for package @typescript-eslint/experimental-utils -# [5.21.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.20.0...v5.21.0) (2022-04-25) +# [5.23.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.22.0...v5.23.0) (2022-05-09) **Note:** Version bump only for package @typescript-eslint/experimental-utils +# [5.22.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.21.0...v5.22.0) (2022-05-02) +**Note:** Version bump only for package @typescript-eslint/experimental-utils +# [5.21.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.20.0...v5.21.0) (2022-04-25) +**Note:** Version bump only for package @typescript-eslint/experimental-utils # [5.20.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.19.0...v5.20.0) (2022-04-18) **Note:** Version bump only for package @typescript-eslint/experimental-utils - - - - # [5.19.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.18.0...v5.19.0) (2022-04-11) **Note:** Version bump only for package @typescript-eslint/experimental-utils - - - - # [5.18.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.17.0...v5.18.0) (2022-04-04) **Note:** Version bump only for package @typescript-eslint/experimental-utils - - - - # [5.17.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.16.0...v5.17.0) (2022-03-28) **Note:** Version bump only for package @typescript-eslint/experimental-utils - - - - # [5.16.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.15.0...v5.16.0) (2022-03-21) **Note:** Version bump only for package @typescript-eslint/experimental-utils - - - - # [5.15.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.14.0...v5.15.0) (2022-03-14) **Note:** Version bump only for package @typescript-eslint/experimental-utils - - - - # [5.14.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.13.0...v5.14.0) (2022-03-07) **Note:** Version bump only for package @typescript-eslint/experimental-utils - - - - # [5.13.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.12.1...v5.13.0) (2022-02-28) **Note:** Version bump only for package @typescript-eslint/experimental-utils - - - - ## [5.12.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.12.0...v5.12.1) (2022-02-21) **Note:** Version bump only for package @typescript-eslint/experimental-utils - - - - # [5.12.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.11.0...v5.12.0) (2022-02-14) **Note:** Version bump only for package @typescript-eslint/experimental-utils - - - - # [5.11.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.10.2...v5.11.0) (2022-02-07) **Note:** Version bump only for package @typescript-eslint/experimental-utils - - - - ## [5.10.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.10.1...v5.10.2) (2022-01-31) **Note:** Version bump only for package @typescript-eslint/experimental-utils - - - - ## [5.10.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.10.0...v5.10.1) (2022-01-24) **Note:** Version bump only for package @typescript-eslint/experimental-utils - - - - # [5.10.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.9.1...v5.10.0) (2022-01-17) - ### Features -* rename `experimental-utils` to `utils` and make `experimental-utils` an alias to the new package ([#4172](https://github.com/typescript-eslint/typescript-eslint/issues/4172)) ([1d55a75](https://github.com/typescript-eslint/typescript-eslint/commit/1d55a7511b38d8e2b2eabe59f639e0a865e6c93f)) - - - - +- rename `experimental-utils` to `utils` and make `experimental-utils` an alias to the new package ([#4172](https://github.com/typescript-eslint/typescript-eslint/issues/4172)) ([1d55a75](https://github.com/typescript-eslint/typescript-eslint/commit/1d55a7511b38d8e2b2eabe59f639e0a865e6c93f)) ## [5.9.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.9.0...v5.9.1) (2022-01-10) **Note:** Version bump only for package @typescript-eslint/experimental-utils - - - - # [5.9.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.8.1...v5.9.0) (2022-01-03) - ### Features -* **experimental-utils:** move isTypeReadonly from eslint-plugin to experimental-utils ([#3658](https://github.com/typescript-eslint/typescript-eslint/issues/3658)) ([a9eb0b9](https://github.com/typescript-eslint/typescript-eslint/commit/a9eb0b9eb2db291ea36065ec34f84bf5c5504b43)) - - - - +- **experimental-utils:** move isTypeReadonly from eslint-plugin to experimental-utils ([#3658](https://github.com/typescript-eslint/typescript-eslint/issues/3658)) ([a9eb0b9](https://github.com/typescript-eslint/typescript-eslint/commit/a9eb0b9eb2db291ea36065ec34f84bf5c5504b43)) ## [5.8.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.8.0...v5.8.1) (2021-12-27) **Note:** Version bump only for package @typescript-eslint/experimental-utils - - - - # [5.8.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.7.0...v5.8.0) (2021-12-20) - ### Bug Fixes -* **experimental-utils:** support immutable members ([#3844](https://github.com/typescript-eslint/typescript-eslint/issues/3844)) ([3d33a77](https://github.com/typescript-eslint/typescript-eslint/commit/3d33a77c57e5b752edf6f35ed152038bdb230b79)) - - - - +- **experimental-utils:** support immutable members ([#3844](https://github.com/typescript-eslint/typescript-eslint/issues/3844)) ([3d33a77](https://github.com/typescript-eslint/typescript-eslint/commit/3d33a77c57e5b752edf6f35ed152038bdb230b79)) # [5.7.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.6.0...v5.7.0) (2021-12-13) **Note:** Version bump only for package @typescript-eslint/experimental-utils - - - - # [5.6.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.5.0...v5.6.0) (2021-12-06) **Note:** Version bump only for package @typescript-eslint/experimental-utils - - - - # [5.5.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.4.0...v5.5.0) (2021-11-29) - ### Bug Fixes -* **experimental-utils:** export RuleCreator interfaces ([#4199](https://github.com/typescript-eslint/typescript-eslint/issues/4199)) ([7821e4c](https://github.com/typescript-eslint/typescript-eslint/commit/7821e4c515ca2f11a14dcfa94dc77370da0287c5)) -* **experimental-utils:** fix types for eslint-utils ([#4173](https://github.com/typescript-eslint/typescript-eslint/issues/4173)) ([7079de2](https://github.com/typescript-eslint/typescript-eslint/commit/7079de26877a2313a7019845d4c33d0fc4d4b4a9)) - - - - +- **experimental-utils:** export RuleCreator interfaces ([#4199](https://github.com/typescript-eslint/typescript-eslint/issues/4199)) ([7821e4c](https://github.com/typescript-eslint/typescript-eslint/commit/7821e4c515ca2f11a14dcfa94dc77370da0287c5)) +- **experimental-utils:** fix types for eslint-utils ([#4173](https://github.com/typescript-eslint/typescript-eslint/issues/4173)) ([7079de2](https://github.com/typescript-eslint/typescript-eslint/commit/7079de26877a2313a7019845d4c33d0fc4d4b4a9)) # [5.4.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.3.1...v5.4.0) (2021-11-15) - ### Features -* add RuleCreator.withoutDocs ([#4136](https://github.com/typescript-eslint/typescript-eslint/issues/4136)) ([87cfc6a](https://github.com/typescript-eslint/typescript-eslint/commit/87cfc6ad3e3312d7b6f98a592fb37e69d5d6880a)) -* **experimental-utils:** add default [] for RuleModule TOptions generic ([#4135](https://github.com/typescript-eslint/typescript-eslint/issues/4135)) ([62b8098](https://github.com/typescript-eslint/typescript-eslint/commit/62b8098fa7d361954c170ee6c190e47e95194b13)) - - - - +- add RuleCreator.withoutDocs ([#4136](https://github.com/typescript-eslint/typescript-eslint/issues/4136)) ([87cfc6a](https://github.com/typescript-eslint/typescript-eslint/commit/87cfc6ad3e3312d7b6f98a592fb37e69d5d6880a)) +- **experimental-utils:** add default [] for RuleModule TOptions generic ([#4135](https://github.com/typescript-eslint/typescript-eslint/issues/4135)) ([62b8098](https://github.com/typescript-eslint/typescript-eslint/commit/62b8098fa7d361954c170ee6c190e47e95194b13)) ## [5.3.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.3.0...v5.3.1) (2021-11-08) **Note:** Version bump only for package @typescript-eslint/experimental-utils - - - - # [5.3.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.2.0...v5.3.0) (2021-11-01) - ### Bug Fixes -* **experimental-utils:** add `name` property to test case interface ([#4067](https://github.com/typescript-eslint/typescript-eslint/issues/4067)) ([f3021c9](https://github.com/typescript-eslint/typescript-eslint/commit/f3021c94460e8d06e4169335bcc1a23854531f2a)) - +- **experimental-utils:** add `name` property to test case interface ([#4067](https://github.com/typescript-eslint/typescript-eslint/issues/4067)) ([f3021c9](https://github.com/typescript-eslint/typescript-eslint/commit/f3021c94460e8d06e4169335bcc1a23854531f2a)) ### Features -* **experimental-utils:** extract `isTokenOfTypeWithConditions` out of `ast-utils`' `predicates` ([#3977](https://github.com/typescript-eslint/typescript-eslint/issues/3977)) ([5229597](https://github.com/typescript-eslint/typescript-eslint/commit/5229597d9bfc998852c4b4fb421859e8f3d3d688)) - - - - +- **experimental-utils:** extract `isTokenOfTypeWithConditions` out of `ast-utils`' `predicates` ([#3977](https://github.com/typescript-eslint/typescript-eslint/issues/3977)) ([5229597](https://github.com/typescript-eslint/typescript-eslint/commit/5229597d9bfc998852c4b4fb421859e8f3d3d688)) # [5.2.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.1.0...v5.2.0) (2021-10-25) **Note:** Version bump only for package @typescript-eslint/experimental-utils +# [5.1.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.0.0...v5.1.0) (2021-10-18) +### Features +- **experimental-utils:** extract `ast-utils`' `predicates`' helpers ([#3976](https://github.com/typescript-eslint/typescript-eslint/issues/3976)) ([154ec9a](https://github.com/typescript-eslint/typescript-eslint/commit/154ec9aea8e81732cafe36af97c4822f1591b077)) +# [5.0.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.33.0...v5.0.0) (2021-10-11) -# [5.1.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.0.0...v5.1.0) (2021-10-18) +### Bug Fixes +- **experimental-utils:** fix `isSetter`'s return type ([#3975](https://github.com/typescript-eslint/typescript-eslint/issues/3975)) ([d256856](https://github.com/typescript-eslint/typescript-eslint/commit/d2568561d0417fdfbdfd964ad942f9d00434af73)) ### Features -* **experimental-utils:** extract `ast-utils`' `predicates`' helpers ([#3976](https://github.com/typescript-eslint/typescript-eslint/issues/3976)) ([154ec9a](https://github.com/typescript-eslint/typescript-eslint/commit/154ec9aea8e81732cafe36af97c4822f1591b077)) +- **ast-spec:** bring `Node` objects in line with ESTree ([#3771](https://github.com/typescript-eslint/typescript-eslint/issues/3771)) ([dd14064](https://github.com/typescript-eslint/typescript-eslint/commit/dd140643b457aa515cc21fcda2b3cd4acc2a1c5c)) +- align class property representation with ESTree ([#3806](https://github.com/typescript-eslint/typescript-eslint/issues/3806)) ([22fa5c0](https://github.com/typescript-eslint/typescript-eslint/commit/22fa5c0c4705ed2898f00b7cacc5dd642d859275)), closes [#3430](https://github.com/typescript-eslint/typescript-eslint/issues/3430) [#3077](https://github.com/typescript-eslint/typescript-eslint/issues/3077) +- remove `meta.docs.category` from rules ([#3800](https://github.com/typescript-eslint/typescript-eslint/issues/3800)) ([71c9370](https://github.com/typescript-eslint/typescript-eslint/commit/71c93706e55f5f92a1285102b93c6ab1950c6df4)) +- remove `TSParenthesizedType` ([#3340](https://github.com/typescript-eslint/typescript-eslint/issues/3340)) ([c8ee432](https://github.com/typescript-eslint/typescript-eslint/commit/c8ee43269faea4c04ec02eaa2b81a0aa6eec5d3e)), closes [#3136](https://github.com/typescript-eslint/typescript-eslint/issues/3136) +- support ESLint v8 ([#3737](https://github.com/typescript-eslint/typescript-eslint/issues/3737)) ([4ca62ae](https://github.com/typescript-eslint/typescript-eslint/commit/4ca62aee6681d706e762a8db727541ca204364f2)) +- **experimental-utils:** extract `isNodeOfTypes` out of `ast-utils`' `predicates` ([#3836](https://github.com/typescript-eslint/typescript-eslint/issues/3836)) ([0cc509b](https://github.com/typescript-eslint/typescript-eslint/commit/0cc509b61df248cfb4b42fe64ec800f3cac69c69)) +- **experimental-utils:** remove `getComments` from `ESLint` `SourceCode` types ([#3766](https://github.com/typescript-eslint/typescript-eslint/issues/3766)) ([165a507](https://github.com/typescript-eslint/typescript-eslint/commit/165a507970d8e4a0ed12abdd5f0d892f7de83ffe)) +# [4.33.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.32.0...v4.33.0) (2021-10-04) +### Bug Fixes +- **experimental-utils:** add `getPhysicalFilename()` to `RuleContext` ([#3934](https://github.com/typescript-eslint/typescript-eslint/issues/3934)) ([ee5dfd4](https://github.com/typescript-eslint/typescript-eslint/commit/ee5dfd4989ab465d65ba3424e36b7f0964558191)) +- **experimental-utils:** require fix in suggestions ([#3949](https://github.com/typescript-eslint/typescript-eslint/issues/3949)) ([f022fb1](https://github.com/typescript-eslint/typescript-eslint/commit/f022fb14c71dad25be2314252eb751964f34fcb8)) +### Features -# [5.0.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.33.0...v5.0.0) (2021-10-11) +- **experimental-utils:** extract `isNodeOfTypeWithConditions` out of `ast-utils`' `predicates` ([#3837](https://github.com/typescript-eslint/typescript-eslint/issues/3837)) ([214f898](https://github.com/typescript-eslint/typescript-eslint/commit/214f898178ba593146d06a444487d32ec3363854)) +# [4.32.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.31.2...v4.32.0) (2021-09-27) ### Bug Fixes -* **experimental-utils:** fix `isSetter`'s return type ([#3975](https://github.com/typescript-eslint/typescript-eslint/issues/3975)) ([d256856](https://github.com/typescript-eslint/typescript-eslint/commit/d2568561d0417fdfbdfd964ad942f9d00434af73)) - - -### Features +- **experimental-utils:** add missing signature for `isParenthesized` ([#3887](https://github.com/typescript-eslint/typescript-eslint/issues/3887)) ([806eaac](https://github.com/typescript-eslint/typescript-eslint/commit/806eaac6af5325664634690e9ebd7ffaed276549)) -* **ast-spec:** bring `Node` objects in line with ESTree ([#3771](https://github.com/typescript-eslint/typescript-eslint/issues/3771)) ([dd14064](https://github.com/typescript-eslint/typescript-eslint/commit/dd140643b457aa515cc21fcda2b3cd4acc2a1c5c)) -* align class property representation with ESTree ([#3806](https://github.com/typescript-eslint/typescript-eslint/issues/3806)) ([22fa5c0](https://github.com/typescript-eslint/typescript-eslint/commit/22fa5c0c4705ed2898f00b7cacc5dd642d859275)), closes [#3430](https://github.com/typescript-eslint/typescript-eslint/issues/3430) [#3077](https://github.com/typescript-eslint/typescript-eslint/issues/3077) -* remove `meta.docs.category` from rules ([#3800](https://github.com/typescript-eslint/typescript-eslint/issues/3800)) ([71c9370](https://github.com/typescript-eslint/typescript-eslint/commit/71c93706e55f5f92a1285102b93c6ab1950c6df4)) -* remove `TSParenthesizedType` ([#3340](https://github.com/typescript-eslint/typescript-eslint/issues/3340)) ([c8ee432](https://github.com/typescript-eslint/typescript-eslint/commit/c8ee43269faea4c04ec02eaa2b81a0aa6eec5d3e)), closes [#3136](https://github.com/typescript-eslint/typescript-eslint/issues/3136) -* support ESLint v8 ([#3737](https://github.com/typescript-eslint/typescript-eslint/issues/3737)) ([4ca62ae](https://github.com/typescript-eslint/typescript-eslint/commit/4ca62aee6681d706e762a8db727541ca204364f2)) -* **experimental-utils:** extract `isNodeOfTypes` out of `ast-utils`' `predicates` ([#3836](https://github.com/typescript-eslint/typescript-eslint/issues/3836)) ([0cc509b](https://github.com/typescript-eslint/typescript-eslint/commit/0cc509b61df248cfb4b42fe64ec800f3cac69c69)) -* **experimental-utils:** remove `getComments` from `ESLint` `SourceCode` types ([#3766](https://github.com/typescript-eslint/typescript-eslint/issues/3766)) ([165a507](https://github.com/typescript-eslint/typescript-eslint/commit/165a507970d8e4a0ed12abdd5f0d892f7de83ffe)) +## [4.31.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.31.1...v4.31.2) (2021-09-20) +**Note:** Version bump only for package @typescript-eslint/experimental-utils +## [4.31.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.31.0...v4.31.1) (2021-09-13) +**Note:** Version bump only for package @typescript-eslint/experimental-utils +# [4.31.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.30.0...v4.31.0) (2021-09-06) -# [4.33.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.32.0...v4.33.0) (2021-10-04) +### Bug Fixes +- **utils:** support immutable arrays in `ReportFixFunction` ([#3830](https://github.com/typescript-eslint/typescript-eslint/issues/3830)) ([8218055](https://github.com/typescript-eslint/typescript-eslint/commit/8218055d6dfd94c9e6c8645848f981d9d51ce08c)) -### Bug Fixes +### Features -* **experimental-utils:** add `getPhysicalFilename()` to `RuleContext` ([#3934](https://github.com/typescript-eslint/typescript-eslint/issues/3934)) ([ee5dfd4](https://github.com/typescript-eslint/typescript-eslint/commit/ee5dfd4989ab465d65ba3424e36b7f0964558191)) -* **experimental-utils:** require fix in suggestions ([#3949](https://github.com/typescript-eslint/typescript-eslint/issues/3949)) ([f022fb1](https://github.com/typescript-eslint/typescript-eslint/commit/f022fb14c71dad25be2314252eb751964f34fcb8)) +- **experimental-utils:** extract `isNodeOfType` out of `ast-utils`' `predicates` ([#3677](https://github.com/typescript-eslint/typescript-eslint/issues/3677)) ([4bfa437](https://github.com/typescript-eslint/typescript-eslint/commit/4bfa4375aff8f65057d4aa116e435803cbc6b464)) +# [4.30.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.29.3...v4.30.0) (2021-08-30) ### Features -* **experimental-utils:** extract `isNodeOfTypeWithConditions` out of `ast-utils`' `predicates` ([#3837](https://github.com/typescript-eslint/typescript-eslint/issues/3837)) ([214f898](https://github.com/typescript-eslint/typescript-eslint/commit/214f898178ba593146d06a444487d32ec3363854)) +- **experimental-utils:** add literal types to `global` option ([#3634](https://github.com/typescript-eslint/typescript-eslint/issues/3634)) ([820965c](https://github.com/typescript-eslint/typescript-eslint/commit/820965c41c58be918770ff6bbae313c0cfc75d3c)) + +## [4.29.3](https://github.com/typescript-eslint/typescript-eslint/compare/v4.29.2...v4.29.3) (2021-08-23) +**Note:** Version bump only for package @typescript-eslint/experimental-utils +## [4.29.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.29.1...v4.29.2) (2021-08-16) +**Note:** Version bump only for package @typescript-eslint/experimental-utils +## [4.29.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.29.0...v4.29.1) (2021-08-09) -# [4.32.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.31.2...v4.32.0) (2021-09-27) +**Note:** Version bump only for package @typescript-eslint/experimental-utils +# [4.29.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.5...v4.29.0) (2021-08-02) ### Bug Fixes -* **experimental-utils:** add missing signature for `isParenthesized` ([#3887](https://github.com/typescript-eslint/typescript-eslint/issues/3887)) ([806eaac](https://github.com/typescript-eslint/typescript-eslint/commit/806eaac6af5325664634690e9ebd7ffaed276549)) +- **experimental-utils:** simplify `eslint-utils`' `findVariable`'s signature in `ast-utils` ([#3574](https://github.com/typescript-eslint/typescript-eslint/issues/3574)) ([3ef5267](https://github.com/typescript-eslint/typescript-eslint/commit/3ef5267b850e1ffb7115e263e89a98c455fd2532)) +### Features +- **ast-spec:** make `BaseNode` & `BaseToken` more type-safe ([#3560](https://github.com/typescript-eslint/typescript-eslint/issues/3560)) ([a6c5604](https://github.com/typescript-eslint/typescript-eslint/commit/a6c5604b65b6330d047aa016fc46b8a597a6ae58)) +## [4.28.5](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.4...v4.28.5) (2021-07-26) +**Note:** Version bump only for package @typescript-eslint/experimental-utils -## [4.31.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.31.1...v4.31.2) (2021-09-20) +## [4.28.4](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.3...v4.28.4) (2021-07-19) **Note:** Version bump only for package @typescript-eslint/experimental-utils +## [4.28.3](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.2...v4.28.3) (2021-07-12) +**Note:** Version bump only for package @typescript-eslint/experimental-utils +## [4.28.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.1...v4.28.2) (2021-07-05) +**Note:** Version bump only for package @typescript-eslint/experimental-utils -## [4.31.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.31.0...v4.31.1) (2021-09-13) +## [4.28.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.0...v4.28.1) (2021-06-28) **Note:** Version bump only for package @typescript-eslint/experimental-utils +# [4.28.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.27.0...v4.28.0) (2021-06-21) +### Bug Fixes +- **experimental-utils:** expand `RuleTester` config properties ([#3557](https://github.com/typescript-eslint/typescript-eslint/issues/3557)) ([ffbb3cf](https://github.com/typescript-eslint/typescript-eslint/commit/ffbb3cff18bc78467e70e794f9b1f0e79be4aff7)) +- **experimental-utils:** fix `eslint-utils`' negative predicates' return types ([#3462](https://github.com/typescript-eslint/typescript-eslint/issues/3462)) ([1e6016b](https://github.com/typescript-eslint/typescript-eslint/commit/1e6016b356ae40e4636a3cbe41fa02b6a61403ee)) +- **experimental-utils:** fix `eslint-utils`' negative predicates' return types in `ast-utils` ([#3461](https://github.com/typescript-eslint/typescript-eslint/issues/3461)) ([614b0a3](https://github.com/typescript-eslint/typescript-eslint/commit/614b0a38b4163eb4667cce7a415d534222d15dd3)) +- **experimental-utils:** make keys for `ReferenceTracker` options optional ([#3531](https://github.com/typescript-eslint/typescript-eslint/issues/3531)) ([a7fd7bb](https://github.com/typescript-eslint/typescript-eslint/commit/a7fd7bb25584cb3f72f0339025dc76efa6cccceb)) +### Features -# [4.31.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.30.0...v4.31.0) (2021-09-06) +- **experimental-utils:** add `only` property to `RuleTester` types ([#3555](https://github.com/typescript-eslint/typescript-eslint/issues/3555)) ([2a36e3e](https://github.com/typescript-eslint/typescript-eslint/commit/2a36e3e737f935cc6b967befb022d10a83c8bc9b)) +- **experimental-utils:** expose ReferenceTracker.ESM ([#3532](https://github.com/typescript-eslint/typescript-eslint/issues/3532)) ([4ac67c4](https://github.com/typescript-eslint/typescript-eslint/commit/4ac67c4c9401c5ce0e947a6409efbc11afe1eb3b)) +- **experimental-utils:** use mergable interface for `settings` property ([#3556](https://github.com/typescript-eslint/typescript-eslint/issues/3556)) ([abfc19b](https://github.com/typescript-eslint/typescript-eslint/commit/abfc19bf9364d881bdf594ee166a1deb23240630)) +# [4.27.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.26.1...v4.27.0) (2021-06-14) ### Bug Fixes -* **utils:** support immutable arrays in `ReportFixFunction` ([#3830](https://github.com/typescript-eslint/typescript-eslint/issues/3830)) ([8218055](https://github.com/typescript-eslint/typescript-eslint/commit/8218055d6dfd94c9e6c8645848f981d9d51ce08c)) +- **typescript-estree:** allow providing more one than one existing program in config ([#3508](https://github.com/typescript-eslint/typescript-eslint/issues/3508)) ([4f1806e](https://github.com/typescript-eslint/typescript-eslint/commit/4f1806e548affb7265da360d1fc8d033e25de325)) + +## [4.26.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.26.0...v4.26.1) (2021-06-07) +**Note:** Version bump only for package @typescript-eslint/experimental-utils -### Features +# [4.26.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.25.0...v4.26.0) (2021-05-31) -* **experimental-utils:** extract `isNodeOfType` out of `ast-utils`' `predicates` ([#3677](https://github.com/typescript-eslint/typescript-eslint/issues/3677)) ([4bfa437](https://github.com/typescript-eslint/typescript-eslint/commit/4bfa4375aff8f65057d4aa116e435803cbc6b464)) +**Note:** Version bump only for package @typescript-eslint/experimental-utils +# [4.25.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.24.0...v4.25.0) (2021-05-24) +### Bug Fixes +- **experimental-utils:** fix `isAwaitKeyword` predicate in ast-utils ([#3290](https://github.com/typescript-eslint/typescript-eslint/issues/3290)) ([c15da67](https://github.com/typescript-eslint/typescript-eslint/commit/c15da67b939b615ed063291cde12c55c0d6d236e)) +# [4.24.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.23.0...v4.24.0) (2021-05-17) -# [4.30.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.29.3...v4.30.0) (2021-08-30) +**Note:** Version bump only for package @typescript-eslint/experimental-utils +# [4.23.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.22.1...v4.23.0) (2021-05-10) ### Features -* **experimental-utils:** add literal types to `global` option ([#3634](https://github.com/typescript-eslint/typescript-eslint/issues/3634)) ([820965c](https://github.com/typescript-eslint/typescript-eslint/commit/820965c41c58be918770ff6bbae313c0cfc75d3c)) +- **experimental-utils:** Include `getCwd()` in `RuleContext` type ([#3308](https://github.com/typescript-eslint/typescript-eslint/issues/3308)) ([2b75c11](https://github.com/typescript-eslint/typescript-eslint/commit/2b75c11d69bee88ca0cb77d7efd32b8d0387e6b3)) +- refactor to split AST specification out as its own module ([#2911](https://github.com/typescript-eslint/typescript-eslint/issues/2911)) ([25ea953](https://github.com/typescript-eslint/typescript-eslint/commit/25ea953cc60b118bd385c71e0a9b61c286c26fcf)) +## [4.22.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.22.0...v4.22.1) (2021-05-04) +**Note:** Version bump only for package @typescript-eslint/experimental-utils +# [4.22.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.21.0...v4.22.0) (2021-04-12) +**Note:** Version bump only for package @typescript-eslint/experimental-utils -## [4.29.3](https://github.com/typescript-eslint/typescript-eslint/compare/v4.29.2...v4.29.3) (2021-08-23) +# [4.21.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.20.0...v4.21.0) (2021-04-05) **Note:** Version bump only for package @typescript-eslint/experimental-utils +# [4.20.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.19.0...v4.20.0) (2021-03-29) +**Note:** Version bump only for package @typescript-eslint/experimental-utils +# [4.19.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.18.0...v4.19.0) (2021-03-22) +**Note:** Version bump only for package @typescript-eslint/experimental-utils -## [4.29.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.29.1...v4.29.2) (2021-08-16) +# [4.18.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.17.0...v4.18.0) (2021-03-15) **Note:** Version bump only for package @typescript-eslint/experimental-utils +# [4.17.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.16.1...v4.17.0) (2021-03-08) +**Note:** Version bump only for package @typescript-eslint/experimental-utils +## [4.16.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.16.0...v4.16.1) (2021-03-01) +**Note:** Version bump only for package @typescript-eslint/experimental-utils -## [4.29.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.29.0...v4.29.1) (2021-08-09) +# [4.16.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.15.2...v4.16.0) (2021-03-01) **Note:** Version bump only for package @typescript-eslint/experimental-utils +## [4.15.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.15.1...v4.15.2) (2021-02-22) +**Note:** Version bump only for package @typescript-eslint/experimental-utils - - -# [4.29.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.5...v4.29.0) (2021-08-02) - - -### Bug Fixes - -* **experimental-utils:** simplify `eslint-utils`' `findVariable`'s signature in `ast-utils` ([#3574](https://github.com/typescript-eslint/typescript-eslint/issues/3574)) ([3ef5267](https://github.com/typescript-eslint/typescript-eslint/commit/3ef5267b850e1ffb7115e263e89a98c455fd2532)) - - -### Features - -* **ast-spec:** make `BaseNode` & `BaseToken` more type-safe ([#3560](https://github.com/typescript-eslint/typescript-eslint/issues/3560)) ([a6c5604](https://github.com/typescript-eslint/typescript-eslint/commit/a6c5604b65b6330d047aa016fc46b8a597a6ae58)) - - - - - -## [4.28.5](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.4...v4.28.5) (2021-07-26) - -**Note:** Version bump only for package @typescript-eslint/experimental-utils - - - - - -## [4.28.4](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.3...v4.28.4) (2021-07-19) - -**Note:** Version bump only for package @typescript-eslint/experimental-utils - - - - - -## [4.28.3](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.2...v4.28.3) (2021-07-12) - -**Note:** Version bump only for package @typescript-eslint/experimental-utils - - - - - -## [4.28.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.1...v4.28.2) (2021-07-05) - -**Note:** Version bump only for package @typescript-eslint/experimental-utils - - - - - -## [4.28.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.0...v4.28.1) (2021-06-28) - -**Note:** Version bump only for package @typescript-eslint/experimental-utils - - - - - -# [4.28.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.27.0...v4.28.0) (2021-06-21) - - -### Bug Fixes - -* **experimental-utils:** expand `RuleTester` config properties ([#3557](https://github.com/typescript-eslint/typescript-eslint/issues/3557)) ([ffbb3cf](https://github.com/typescript-eslint/typescript-eslint/commit/ffbb3cff18bc78467e70e794f9b1f0e79be4aff7)) -* **experimental-utils:** fix `eslint-utils`' negative predicates' return types ([#3462](https://github.com/typescript-eslint/typescript-eslint/issues/3462)) ([1e6016b](https://github.com/typescript-eslint/typescript-eslint/commit/1e6016b356ae40e4636a3cbe41fa02b6a61403ee)) -* **experimental-utils:** fix `eslint-utils`' negative predicates' return types in `ast-utils` ([#3461](https://github.com/typescript-eslint/typescript-eslint/issues/3461)) ([614b0a3](https://github.com/typescript-eslint/typescript-eslint/commit/614b0a38b4163eb4667cce7a415d534222d15dd3)) -* **experimental-utils:** make keys for `ReferenceTracker` options optional ([#3531](https://github.com/typescript-eslint/typescript-eslint/issues/3531)) ([a7fd7bb](https://github.com/typescript-eslint/typescript-eslint/commit/a7fd7bb25584cb3f72f0339025dc76efa6cccceb)) - - -### Features - -* **experimental-utils:** add `only` property to `RuleTester` types ([#3555](https://github.com/typescript-eslint/typescript-eslint/issues/3555)) ([2a36e3e](https://github.com/typescript-eslint/typescript-eslint/commit/2a36e3e737f935cc6b967befb022d10a83c8bc9b)) -* **experimental-utils:** expose ReferenceTracker.ESM ([#3532](https://github.com/typescript-eslint/typescript-eslint/issues/3532)) ([4ac67c4](https://github.com/typescript-eslint/typescript-eslint/commit/4ac67c4c9401c5ce0e947a6409efbc11afe1eb3b)) -* **experimental-utils:** use mergable interface for `settings` property ([#3556](https://github.com/typescript-eslint/typescript-eslint/issues/3556)) ([abfc19b](https://github.com/typescript-eslint/typescript-eslint/commit/abfc19bf9364d881bdf594ee166a1deb23240630)) - - - - - -# [4.27.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.26.1...v4.27.0) (2021-06-14) - - -### Bug Fixes - -* **typescript-estree:** allow providing more one than one existing program in config ([#3508](https://github.com/typescript-eslint/typescript-eslint/issues/3508)) ([4f1806e](https://github.com/typescript-eslint/typescript-eslint/commit/4f1806e548affb7265da360d1fc8d033e25de325)) - - - - - -## [4.26.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.26.0...v4.26.1) (2021-06-07) - -**Note:** Version bump only for package @typescript-eslint/experimental-utils - - - - - -# [4.26.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.25.0...v4.26.0) (2021-05-31) - -**Note:** Version bump only for package @typescript-eslint/experimental-utils - - - - - -# [4.25.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.24.0...v4.25.0) (2021-05-24) - - -### Bug Fixes - -* **experimental-utils:** fix `isAwaitKeyword` predicate in ast-utils ([#3290](https://github.com/typescript-eslint/typescript-eslint/issues/3290)) ([c15da67](https://github.com/typescript-eslint/typescript-eslint/commit/c15da67b939b615ed063291cde12c55c0d6d236e)) - - - - - -# [4.24.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.23.0...v4.24.0) (2021-05-17) - -**Note:** Version bump only for package @typescript-eslint/experimental-utils - - - - - -# [4.23.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.22.1...v4.23.0) (2021-05-10) - - -### Features - -* **experimental-utils:** Include `getCwd()` in `RuleContext` type ([#3308](https://github.com/typescript-eslint/typescript-eslint/issues/3308)) ([2b75c11](https://github.com/typescript-eslint/typescript-eslint/commit/2b75c11d69bee88ca0cb77d7efd32b8d0387e6b3)) -* refactor to split AST specification out as its own module ([#2911](https://github.com/typescript-eslint/typescript-eslint/issues/2911)) ([25ea953](https://github.com/typescript-eslint/typescript-eslint/commit/25ea953cc60b118bd385c71e0a9b61c286c26fcf)) - - - - - -## [4.22.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.22.0...v4.22.1) (2021-05-04) - -**Note:** Version bump only for package @typescript-eslint/experimental-utils - - - - - -# [4.22.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.21.0...v4.22.0) (2021-04-12) - -**Note:** Version bump only for package @typescript-eslint/experimental-utils - - - - - -# [4.21.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.20.0...v4.21.0) (2021-04-05) - -**Note:** Version bump only for package @typescript-eslint/experimental-utils - - - - - -# [4.20.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.19.0...v4.20.0) (2021-03-29) - -**Note:** Version bump only for package @typescript-eslint/experimental-utils - - - - - -# [4.19.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.18.0...v4.19.0) (2021-03-22) - -**Note:** Version bump only for package @typescript-eslint/experimental-utils - - - - - -# [4.18.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.17.0...v4.18.0) (2021-03-15) - -**Note:** Version bump only for package @typescript-eslint/experimental-utils - - - - - -# [4.17.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.16.1...v4.17.0) (2021-03-08) - -**Note:** Version bump only for package @typescript-eslint/experimental-utils - - - - - -## [4.16.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.16.0...v4.16.1) (2021-03-01) - -**Note:** Version bump only for package @typescript-eslint/experimental-utils - - - - - -# [4.16.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.15.2...v4.16.0) (2021-03-01) - -**Note:** Version bump only for package @typescript-eslint/experimental-utils - - - - - -## [4.15.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.15.1...v4.15.2) (2021-02-22) +## [4.15.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.15.0...v4.15.1) (2021-02-15) **Note:** Version bump only for package @typescript-eslint/experimental-utils - - - - -## [4.15.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.15.0...v4.15.1) (2021-02-15) - -**Note:** Version bump only for package @typescript-eslint/experimental-utils - - - - - # [4.15.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.14.2...v4.15.0) (2021-02-08) **Note:** Version bump only for package @typescript-eslint/experimental-utils - - - - ## [4.14.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.14.1...v4.14.2) (2021-02-01) **Note:** Version bump only for package @typescript-eslint/experimental-utils - - - - ## [4.14.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.14.0...v4.14.1) (2021-01-25) **Note:** Version bump only for package @typescript-eslint/experimental-utils - - - - # [4.14.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.13.0...v4.14.0) (2021-01-18) **Note:** Version bump only for package @typescript-eslint/experimental-utils - - - - # [4.13.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.12.0...v4.13.0) (2021-01-11) **Note:** Version bump only for package @typescript-eslint/experimental-utils - - - - # [4.12.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.11.1...v4.12.0) (2021-01-04) **Note:** Version bump only for package @typescript-eslint/experimental-utils - - - - ## [4.11.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.11.0...v4.11.1) (2020-12-28) **Note:** Version bump only for package @typescript-eslint/experimental-utils - - - - # [4.11.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.10.0...v4.11.0) (2020-12-21) **Note:** Version bump only for package @typescript-eslint/experimental-utils - - - - # [4.10.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.9.1...v4.10.0) (2020-12-14) **Note:** Version bump only for package @typescript-eslint/experimental-utils - - - - ## [4.9.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.9.0...v4.9.1) (2020-12-07) **Note:** Version bump only for package @typescript-eslint/experimental-utils - - - - # [4.9.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.8.2...v4.9.0) (2020-11-30) - ### Features -* **eslint-plugin:** [no-unused-vars] fork the base rule ([#2768](https://github.com/typescript-eslint/typescript-eslint/issues/2768)) ([a8227a6](https://github.com/typescript-eslint/typescript-eslint/commit/a8227a6185dd24de4bfc7d766931643871155021)), closes [#2782](https://github.com/typescript-eslint/typescript-eslint/issues/2782) [#2714](https://github.com/typescript-eslint/typescript-eslint/issues/2714) [#2648](https://github.com/typescript-eslint/typescript-eslint/issues/2648) - - - - +- **eslint-plugin:** [no-unused-vars] fork the base rule ([#2768](https://github.com/typescript-eslint/typescript-eslint/issues/2768)) ([a8227a6](https://github.com/typescript-eslint/typescript-eslint/commit/a8227a6185dd24de4bfc7d766931643871155021)), closes [#2782](https://github.com/typescript-eslint/typescript-eslint/issues/2782) [#2714](https://github.com/typescript-eslint/typescript-eslint/issues/2714) [#2648](https://github.com/typescript-eslint/typescript-eslint/issues/2648) ## [4.8.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.8.1...v4.8.2) (2020-11-23) **Note:** Version bump only for package @typescript-eslint/experimental-utils - - - - ## [4.8.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.8.0...v4.8.1) (2020-11-17) **Note:** Version bump only for package @typescript-eslint/experimental-utils - - - - # [4.8.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.7.0...v4.8.0) (2020-11-16) **Note:** Version bump only for package @typescript-eslint/experimental-utils - - - - # [4.7.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.6.1...v4.7.0) (2020-11-09) **Note:** Version bump only for package @typescript-eslint/experimental-utils - - - - ## [4.6.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.6.0...v4.6.1) (2020-11-02) **Note:** Version bump only for package @typescript-eslint/experimental-utils - - - - # [4.6.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.5.0...v4.6.0) (2020-10-26) **Note:** Version bump only for package @typescript-eslint/experimental-utils - - - - # [4.5.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.4.1...v4.5.0) (2020-10-19) - ### Features -* **typescript-estree:** add flag EXPERIMENTAL_useSourceOfProjectReferenceRedirect ([#2669](https://github.com/typescript-eslint/typescript-eslint/issues/2669)) ([90a5878](https://github.com/typescript-eslint/typescript-eslint/commit/90a587845088da1b205e4d7d77dbc3f9447b1c5a)) - - - - +- **typescript-estree:** add flag EXPERIMENTAL_useSourceOfProjectReferenceRedirect ([#2669](https://github.com/typescript-eslint/typescript-eslint/issues/2669)) ([90a5878](https://github.com/typescript-eslint/typescript-eslint/commit/90a587845088da1b205e4d7d77dbc3f9447b1c5a)) ## [4.4.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.4.0...v4.4.1) (2020-10-12) **Note:** Version bump only for package @typescript-eslint/experimental-utils - - - - # [4.4.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.3.0...v4.4.0) (2020-10-05) **Note:** Version bump only for package @typescript-eslint/experimental-utils - - - - # [4.3.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.2.0...v4.3.0) (2020-09-28) - ### Bug Fixes -* **experimental-utils:** treat RuleTester arrays as readonly ([#2601](https://github.com/typescript-eslint/typescript-eslint/issues/2601)) ([8025777](https://github.com/typescript-eslint/typescript-eslint/commit/80257776b78bd2b2b4389d6bd530b009a75fb520)) - - - - +- **experimental-utils:** treat RuleTester arrays as readonly ([#2601](https://github.com/typescript-eslint/typescript-eslint/issues/2601)) ([8025777](https://github.com/typescript-eslint/typescript-eslint/commit/80257776b78bd2b2b4389d6bd530b009a75fb520)) # [4.2.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.1.1...v4.2.0) (2020-09-21) **Note:** Version bump only for package @typescript-eslint/experimental-utils +## [4.1.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.1.0...v4.1.1) (2020-09-14) +### Bug Fixes +- **eslint-plugin:** [no-use-before-define] false positive for function type arguments ([#2554](https://github.com/typescript-eslint/typescript-eslint/issues/2554)) ([189162d](https://github.com/typescript-eslint/typescript-eslint/commit/189162d46ecb116c420232937a7f86df913f4e79)), closes [#2527](https://github.com/typescript-eslint/typescript-eslint/issues/2527) +# [4.1.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.0.1...v4.1.0) (2020-09-07) -## [4.1.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.1.0...v4.1.1) (2020-09-14) - - -### Bug Fixes - -* **eslint-plugin:** [no-use-before-define] false positive for function type arguments ([#2554](https://github.com/typescript-eslint/typescript-eslint/issues/2554)) ([189162d](https://github.com/typescript-eslint/typescript-eslint/commit/189162d46ecb116c420232937a7f86df913f4e79)), closes [#2527](https://github.com/typescript-eslint/typescript-eslint/issues/2527) - - - - - -# [4.1.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.0.1...v4.1.0) (2020-09-07) - -**Note:** Version bump only for package @typescript-eslint/experimental-utils - - - - - -## [4.0.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.0.0...v4.0.1) (2020-08-31) - -**Note:** Version bump only for package @typescript-eslint/experimental-utils - - - - - -# [4.0.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.10.1...v4.0.0) (2020-08-31) - -## [Please see the release notes for v4.0.0](https://github.com/typescript-eslint/typescript-eslint/releases/tag/v4.0.0) - -### Features - -* consume new scope analysis package ([#2039](https://github.com/typescript-eslint/typescript-eslint/issues/2039)) ([3be125d](https://github.com/typescript-eslint/typescript-eslint/commit/3be125d9bdbee1984ac6037874edf619213bd3d0)) -* support ESTree optional chaining representation ([#2308](https://github.com/typescript-eslint/typescript-eslint/issues/2308)) ([e9d2ab6](https://github.com/typescript-eslint/typescript-eslint/commit/e9d2ab638b6767700b52797e74b814ea059beaae)) - - - - - -## [3.10.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.10.0...v3.10.1) (2020-08-25) - -**Note:** Version bump only for package @typescript-eslint/experimental-utils - - - - - -# [3.10.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.9.1...v3.10.0) (2020-08-24) - -**Note:** Version bump only for package @typescript-eslint/experimental-utils - - - - - -## [3.9.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.9.0...v3.9.1) (2020-08-17) - -**Note:** Version bump only for package @typescript-eslint/experimental-utils - - - - - -# [3.9.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.8.0...v3.9.0) (2020-08-10) - -**Note:** Version bump only for package @typescript-eslint/experimental-utils - - - - - -# [3.8.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.7.1...v3.8.0) (2020-08-03) - -**Note:** Version bump only for package @typescript-eslint/experimental-utils - - - - - -## [3.7.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.7.0...v3.7.1) (2020-07-27) - -**Note:** Version bump only for package @typescript-eslint/experimental-utils - - - - - -# [3.7.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.6.1...v3.7.0) (2020-07-20) - -**Note:** Version bump only for package @typescript-eslint/experimental-utils - - - - - -## [3.6.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.6.0...v3.6.1) (2020-07-13) - -**Note:** Version bump only for package @typescript-eslint/experimental-utils - - - - - -# [3.6.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.5.0...v3.6.0) (2020-07-06) - -**Note:** Version bump only for package @typescript-eslint/experimental-utils - - - - - -# [3.5.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.4.0...v3.5.0) (2020-06-29) - - -### Features - -* add package scope-manager ([#1939](https://github.com/typescript-eslint/typescript-eslint/issues/1939)) ([682eb7e](https://github.com/typescript-eslint/typescript-eslint/commit/682eb7e009c3f22a542882dfd3602196a60d2a1e)) -* split types into their own package ([#2229](https://github.com/typescript-eslint/typescript-eslint/issues/2229)) ([5f45918](https://github.com/typescript-eslint/typescript-eslint/commit/5f4591886f3438329fbf2229b03ac66174334a24)) - - - - - -# [3.4.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.3.0...v3.4.0) (2020-06-22) - +**Note:** Version bump only for package @typescript-eslint/experimental-utils -### Bug Fixes +## [4.0.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.0.0...v4.0.1) (2020-08-31) -* **experimental-utils:** correct types for TS versions older than 3.8 ([#2217](https://github.com/typescript-eslint/typescript-eslint/issues/2217)) ([5e4dda2](https://github.com/typescript-eslint/typescript-eslint/commit/5e4dda264a7d6a6a1626848e7599faea1ac34922)) -* **experimental-utils:** getParserServices takes a readonly context ([#2235](https://github.com/typescript-eslint/typescript-eslint/issues/2235)) ([26da8de](https://github.com/typescript-eslint/typescript-eslint/commit/26da8de7fcde9eddec63212d79af781c4bb22991)) +**Note:** Version bump only for package @typescript-eslint/experimental-utils +# [4.0.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.10.1...v4.0.0) (2020-08-31) +## [Please see the release notes for v4.0.0](https://github.com/typescript-eslint/typescript-eslint/releases/tag/v4.0.0) +### Features +- consume new scope analysis package ([#2039](https://github.com/typescript-eslint/typescript-eslint/issues/2039)) ([3be125d](https://github.com/typescript-eslint/typescript-eslint/commit/3be125d9bdbee1984ac6037874edf619213bd3d0)) +- support ESTree optional chaining representation ([#2308](https://github.com/typescript-eslint/typescript-eslint/issues/2308)) ([e9d2ab6](https://github.com/typescript-eslint/typescript-eslint/commit/e9d2ab638b6767700b52797e74b814ea059beaae)) -# [3.3.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.2.0...v3.3.0) (2020-06-15) +## [3.10.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.10.0...v3.10.1) (2020-08-25) **Note:** Version bump only for package @typescript-eslint/experimental-utils +# [3.10.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.9.1...v3.10.0) (2020-08-24) +**Note:** Version bump only for package @typescript-eslint/experimental-utils +## [3.9.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.9.0...v3.9.1) (2020-08-17) +**Note:** Version bump only for package @typescript-eslint/experimental-utils -# [3.2.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.1.0...v3.2.0) (2020-06-08) +# [3.9.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.8.0...v3.9.0) (2020-08-10) +**Note:** Version bump only for package @typescript-eslint/experimental-utils -### Bug Fixes +# [3.8.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.7.1...v3.8.0) (2020-08-03) -* **eslint-plugin:** [prefer-optional-chain] handling first member expression ([#2156](https://github.com/typescript-eslint/typescript-eslint/issues/2156)) ([de18660](https://github.com/typescript-eslint/typescript-eslint/commit/de18660a8cf8f7033798646d8c5b0938d1accb12)) +**Note:** Version bump only for package @typescript-eslint/experimental-utils +## [3.7.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.7.0...v3.7.1) (2020-07-27) +**Note:** Version bump only for package @typescript-eslint/experimental-utils +# [3.7.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.6.1...v3.7.0) (2020-07-20) +**Note:** Version bump only for package @typescript-eslint/experimental-utils -# [3.1.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.0.2...v3.1.0) (2020-06-01) +## [3.6.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.6.0...v3.6.1) (2020-07-13) +**Note:** Version bump only for package @typescript-eslint/experimental-utils -### Bug Fixes +# [3.6.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.5.0...v3.6.0) (2020-07-06) -* **experimental-utils:** downlevel type declarations for versions older than 3.8 ([#2133](https://github.com/typescript-eslint/typescript-eslint/issues/2133)) ([7925823](https://github.com/typescript-eslint/typescript-eslint/commit/792582326a8065270b69a0ffcaad5a7b4b103ff3)) +**Note:** Version bump only for package @typescript-eslint/experimental-utils +# [3.5.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.4.0...v3.5.0) (2020-06-29) ### Features -* **eslint-plugin:** [explicit-module-boundary-types] improve accuracy and coverage ([#2135](https://github.com/typescript-eslint/typescript-eslint/issues/2135)) ([caaa859](https://github.com/typescript-eslint/typescript-eslint/commit/caaa8599284d02ab3341e282cad35a52d0fb86c7)) +- add package scope-manager ([#1939](https://github.com/typescript-eslint/typescript-eslint/issues/1939)) ([682eb7e](https://github.com/typescript-eslint/typescript-eslint/commit/682eb7e009c3f22a542882dfd3602196a60d2a1e)) +- split types into their own package ([#2229](https://github.com/typescript-eslint/typescript-eslint/issues/2229)) ([5f45918](https://github.com/typescript-eslint/typescript-eslint/commit/5f4591886f3438329fbf2229b03ac66174334a24)) +# [3.4.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.3.0...v3.4.0) (2020-06-22) +### Bug Fixes +- **experimental-utils:** correct types for TS versions older than 3.8 ([#2217](https://github.com/typescript-eslint/typescript-eslint/issues/2217)) ([5e4dda2](https://github.com/typescript-eslint/typescript-eslint/commit/5e4dda264a7d6a6a1626848e7599faea1ac34922)) +- **experimental-utils:** getParserServices takes a readonly context ([#2235](https://github.com/typescript-eslint/typescript-eslint/issues/2235)) ([26da8de](https://github.com/typescript-eslint/typescript-eslint/commit/26da8de7fcde9eddec63212d79af781c4bb22991)) +# [3.3.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.2.0...v3.3.0) (2020-06-15) -## [3.0.2](https://github.com/typescript-eslint/typescript-eslint/compare/v3.0.1...v3.0.2) (2020-05-27) +**Note:** Version bump only for package @typescript-eslint/experimental-utils +# [3.2.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.1.0...v3.2.0) (2020-06-08) ### Bug Fixes -* regression for eslint v6 ([#2105](https://github.com/typescript-eslint/typescript-eslint/issues/2105)) ([31fc503](https://github.com/typescript-eslint/typescript-eslint/commit/31fc5039ed919e1515fda673c186d5c83eb5beb3)) +- **eslint-plugin:** [prefer-optional-chain] handling first member expression ([#2156](https://github.com/typescript-eslint/typescript-eslint/issues/2156)) ([de18660](https://github.com/typescript-eslint/typescript-eslint/commit/de18660a8cf8f7033798646d8c5b0938d1accb12)) +# [3.1.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.0.2...v3.1.0) (2020-06-01) +### Bug Fixes +- **experimental-utils:** downlevel type declarations for versions older than 3.8 ([#2133](https://github.com/typescript-eslint/typescript-eslint/issues/2133)) ([7925823](https://github.com/typescript-eslint/typescript-eslint/commit/792582326a8065270b69a0ffcaad5a7b4b103ff3)) +### Features -## [3.0.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.0.0...v3.0.1) (2020-05-25) +- **eslint-plugin:** [explicit-module-boundary-types] improve accuracy and coverage ([#2135](https://github.com/typescript-eslint/typescript-eslint/issues/2135)) ([caaa859](https://github.com/typescript-eslint/typescript-eslint/commit/caaa8599284d02ab3341e282cad35a52d0fb86c7)) +## [3.0.2](https://github.com/typescript-eslint/typescript-eslint/compare/v3.0.1...v3.0.2) (2020-05-27) ### Bug Fixes -* **experimental-utils:** export `CLIEngine` & `ESLint` ([#2083](https://github.com/typescript-eslint/typescript-eslint/issues/2083)) ([014341b](https://github.com/typescript-eslint/typescript-eslint/commit/014341bb23261f609fc2a6fe7fece191466a084a)) - +- regression for eslint v6 ([#2105](https://github.com/typescript-eslint/typescript-eslint/issues/2105)) ([31fc503](https://github.com/typescript-eslint/typescript-eslint/commit/31fc5039ed919e1515fda673c186d5c83eb5beb3)) +## [3.0.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.0.0...v3.0.1) (2020-05-25) +### Bug Fixes +- **experimental-utils:** export `CLIEngine` & `ESLint` ([#2083](https://github.com/typescript-eslint/typescript-eslint/issues/2083)) ([014341b](https://github.com/typescript-eslint/typescript-eslint/commit/014341bb23261f609fc2a6fe7fece191466a084a)) # [3.0.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.34.0...v3.0.0) (2020-05-21) @@ -1118,481 +739,273 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline ### Bug Fixes -* **experimental-utils:** add back SourceCode.isSpaceBetweenTokens ([ae82ea4](https://github.com/typescript-eslint/typescript-eslint/commit/ae82ea4a85a4ca332ebe6104e96c59dba30411be)) -* **typescript-estree:** remove now defunct `Import` node type ([f199cbd](https://github.com/typescript-eslint/typescript-eslint/commit/f199cbdbbd892b5ba03bfff66f463f3d9c92ee9b)) - +- **experimental-utils:** add back SourceCode.isSpaceBetweenTokens ([ae82ea4](https://github.com/typescript-eslint/typescript-eslint/commit/ae82ea4a85a4ca332ebe6104e96c59dba30411be)) +- **typescript-estree:** remove now defunct `Import` node type ([f199cbd](https://github.com/typescript-eslint/typescript-eslint/commit/f199cbdbbd892b5ba03bfff66f463f3d9c92ee9b)) ### Features -* **experimental-utils:** upgrade eslint types for v7 ([#2023](https://github.com/typescript-eslint/typescript-eslint/issues/2023)) ([06869c9](https://github.com/typescript-eslint/typescript-eslint/commit/06869c9656fa37936126666845aee40aad546ebd)) -* drop support for node v8 ([#1997](https://github.com/typescript-eslint/typescript-eslint/issues/1997)) ([b6c3b7b](https://github.com/typescript-eslint/typescript-eslint/commit/b6c3b7b84b8d199fa75a46432febd4a364a63217)) -* upgrade to ESLint v7 ([#2022](https://github.com/typescript-eslint/typescript-eslint/issues/2022)) ([208de71](https://github.com/typescript-eslint/typescript-eslint/commit/208de71059746bf38e94bd460346ffb2698a3e12)) -* **eslint-plugin:** [ban-types] rework default options ([#848](https://github.com/typescript-eslint/typescript-eslint/issues/848)) ([8e31d5d](https://github.com/typescript-eslint/typescript-eslint/commit/8e31d5dbe9fe5227fdbefcecfd50ce5dd51360c3)) -* **typescript-estree:** always return parserServices ([#716](https://github.com/typescript-eslint/typescript-eslint/issues/716)) ([5b23443](https://github.com/typescript-eslint/typescript-eslint/commit/5b23443c48f3f62424db3e742243f3568080b946)) - - - - +- **experimental-utils:** upgrade eslint types for v7 ([#2023](https://github.com/typescript-eslint/typescript-eslint/issues/2023)) ([06869c9](https://github.com/typescript-eslint/typescript-eslint/commit/06869c9656fa37936126666845aee40aad546ebd)) +- drop support for node v8 ([#1997](https://github.com/typescript-eslint/typescript-eslint/issues/1997)) ([b6c3b7b](https://github.com/typescript-eslint/typescript-eslint/commit/b6c3b7b84b8d199fa75a46432febd4a364a63217)) +- upgrade to ESLint v7 ([#2022](https://github.com/typescript-eslint/typescript-eslint/issues/2022)) ([208de71](https://github.com/typescript-eslint/typescript-eslint/commit/208de71059746bf38e94bd460346ffb2698a3e12)) +- **eslint-plugin:** [ban-types] rework default options ([#848](https://github.com/typescript-eslint/typescript-eslint/issues/848)) ([8e31d5d](https://github.com/typescript-eslint/typescript-eslint/commit/8e31d5dbe9fe5227fdbefcecfd50ce5dd51360c3)) +- **typescript-estree:** always return parserServices ([#716](https://github.com/typescript-eslint/typescript-eslint/issues/716)) ([5b23443](https://github.com/typescript-eslint/typescript-eslint/commit/5b23443c48f3f62424db3e742243f3568080b946)) # [2.34.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.33.0...v2.34.0) (2020-05-18) - ### Features -* **experimental-utils:** add `suggestion` property for rule modules ([#2033](https://github.com/typescript-eslint/typescript-eslint/issues/2033)) ([f42a5b0](https://github.com/typescript-eslint/typescript-eslint/commit/f42a5b09ebfa173f418a99c552b0cbe221567194)) - - - - +- **experimental-utils:** add `suggestion` property for rule modules ([#2033](https://github.com/typescript-eslint/typescript-eslint/issues/2033)) ([f42a5b0](https://github.com/typescript-eslint/typescript-eslint/commit/f42a5b09ebfa173f418a99c552b0cbe221567194)) # [2.33.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.32.0...v2.33.0) (2020-05-12) - ### Bug Fixes -* **experimental-utils:** remove accidental dep on json-schema ([#2010](https://github.com/typescript-eslint/typescript-eslint/issues/2010)) ([1875fba](https://github.com/typescript-eslint/typescript-eslint/commit/1875fbad41f2a3dda8f610f5dcd180c6205b73d3)) - - - - +- **experimental-utils:** remove accidental dep on json-schema ([#2010](https://github.com/typescript-eslint/typescript-eslint/issues/2010)) ([1875fba](https://github.com/typescript-eslint/typescript-eslint/commit/1875fbad41f2a3dda8f610f5dcd180c6205b73d3)) # [2.32.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.31.0...v2.32.0) (2020-05-11) - ### Features -* bump dependencies and align AST ([#2007](https://github.com/typescript-eslint/typescript-eslint/issues/2007)) ([18668b7](https://github.com/typescript-eslint/typescript-eslint/commit/18668b78fd7d1e5281af7fc26c76e0ca53297f69)) - - - - +- bump dependencies and align AST ([#2007](https://github.com/typescript-eslint/typescript-eslint/issues/2007)) ([18668b7](https://github.com/typescript-eslint/typescript-eslint/commit/18668b78fd7d1e5281af7fc26c76e0ca53297f69)) # [2.31.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.30.0...v2.31.0) (2020-05-04) - ### Features -* **experimental-utils:** expose our RuleTester extension ([#1948](https://github.com/typescript-eslint/typescript-eslint/issues/1948)) ([2dd1638](https://github.com/typescript-eslint/typescript-eslint/commit/2dd1638aaa2658ba99b2341861146b586f489121)) - - - - +- **experimental-utils:** expose our RuleTester extension ([#1948](https://github.com/typescript-eslint/typescript-eslint/issues/1948)) ([2dd1638](https://github.com/typescript-eslint/typescript-eslint/commit/2dd1638aaa2658ba99b2341861146b586f489121)) # [2.30.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.29.0...v2.30.0) (2020-04-27) - ### Features -* **experimental-utils:** allow rule options to be a readonly tuple ([#1924](https://github.com/typescript-eslint/typescript-eslint/issues/1924)) ([4ef6788](https://github.com/typescript-eslint/typescript-eslint/commit/4ef67884962b6aac61cc895aaa3ba16aa892ecf4)) - - - - +- **experimental-utils:** allow rule options to be a readonly tuple ([#1924](https://github.com/typescript-eslint/typescript-eslint/issues/1924)) ([4ef6788](https://github.com/typescript-eslint/typescript-eslint/commit/4ef67884962b6aac61cc895aaa3ba16aa892ecf4)) # [2.29.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.28.0...v2.29.0) (2020-04-20) **Note:** Version bump only for package @typescript-eslint/experimental-utils - - - - # [2.28.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.27.0...v2.28.0) (2020-04-13) - ### Features -* **eslint-plugin:** add rule `prefer-reduce-type-parameter` ([#1707](https://github.com/typescript-eslint/typescript-eslint/issues/1707)) ([c92d240](https://github.com/typescript-eslint/typescript-eslint/commit/c92d240e49113779053eac32038382b282812afc)) - - - - +- **eslint-plugin:** add rule `prefer-reduce-type-parameter` ([#1707](https://github.com/typescript-eslint/typescript-eslint/issues/1707)) ([c92d240](https://github.com/typescript-eslint/typescript-eslint/commit/c92d240e49113779053eac32038382b282812afc)) # [2.27.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.26.0...v2.27.0) (2020-04-06) - ### Features -* **experimental-utils:** add types for suggestions from CLIEngine ([#1844](https://github.com/typescript-eslint/typescript-eslint/issues/1844)) ([7c11bd6](https://github.com/typescript-eslint/typescript-eslint/commit/7c11bd66f2d0e5ea9d3943e6b8c66e6ddff50862)) -* **experimental-utils:** update eslint types to match v6.8 ([#1846](https://github.com/typescript-eslint/typescript-eslint/issues/1846)) ([16ce74d](https://github.com/typescript-eslint/typescript-eslint/commit/16ce74d247781ac890dc0baa30c384f97e581b6b)) - - - - +- **experimental-utils:** add types for suggestions from CLIEngine ([#1844](https://github.com/typescript-eslint/typescript-eslint/issues/1844)) ([7c11bd6](https://github.com/typescript-eslint/typescript-eslint/commit/7c11bd66f2d0e5ea9d3943e6b8c66e6ddff50862)) +- **experimental-utils:** update eslint types to match v6.8 ([#1846](https://github.com/typescript-eslint/typescript-eslint/issues/1846)) ([16ce74d](https://github.com/typescript-eslint/typescript-eslint/commit/16ce74d247781ac890dc0baa30c384f97e581b6b)) # [2.26.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.25.0...v2.26.0) (2020-03-30) - ### Features -* **typescript-estree:** add option to ignore certain folders from glob resolution ([#1802](https://github.com/typescript-eslint/typescript-eslint/issues/1802)) ([1e29e69](https://github.com/typescript-eslint/typescript-eslint/commit/1e29e69b289d61107a7de67592beae331ba50222)) - - - - +- **typescript-estree:** add option to ignore certain folders from glob resolution ([#1802](https://github.com/typescript-eslint/typescript-eslint/issues/1802)) ([1e29e69](https://github.com/typescript-eslint/typescript-eslint/commit/1e29e69b289d61107a7de67592beae331ba50222)) # [2.25.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.24.0...v2.25.0) (2020-03-23) - ### Features -* **experimental-utils:** expose ast utility functions ([#1670](https://github.com/typescript-eslint/typescript-eslint/issues/1670)) ([3eb5d45](https://github.com/typescript-eslint/typescript-eslint/commit/3eb5d4525e95c8ab990f55588b8d830a02ce5a9c)) - - - - +- **experimental-utils:** expose ast utility functions ([#1670](https://github.com/typescript-eslint/typescript-eslint/issues/1670)) ([3eb5d45](https://github.com/typescript-eslint/typescript-eslint/commit/3eb5d4525e95c8ab990f55588b8d830a02ce5a9c)) # [2.24.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.23.0...v2.24.0) (2020-03-16) **Note:** Version bump only for package @typescript-eslint/experimental-utils - - - - # [2.23.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.22.0...v2.23.0) (2020-03-09) **Note:** Version bump only for package @typescript-eslint/experimental-utils - - - - # [2.22.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.21.0...v2.22.0) (2020-03-02) **Note:** Version bump only for package @typescript-eslint/experimental-utils - - - - # [2.21.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.20.0...v2.21.0) (2020-02-24) **Note:** Version bump only for package @typescript-eslint/experimental-utils - - - - # [2.20.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.19.2...v2.20.0) (2020-02-17) **Note:** Version bump only for package @typescript-eslint/experimental-utils - - - - ## [2.19.2](https://github.com/typescript-eslint/typescript-eslint/compare/v2.19.1...v2.19.2) (2020-02-10) **Note:** Version bump only for package @typescript-eslint/experimental-utils - - - - ## [2.19.1](https://github.com/typescript-eslint/typescript-eslint/compare/v2.19.0...v2.19.1) (2020-02-10) **Note:** Version bump only for package @typescript-eslint/experimental-utils - - - - # [2.19.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.18.0...v2.19.0) (2020-02-03) **Note:** Version bump only for package @typescript-eslint/experimental-utils - - - - # [2.18.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.17.0...v2.18.0) (2020-01-27) - ### Bug Fixes -* improve token types and add missing type guards ([#1497](https://github.com/typescript-eslint/typescript-eslint/issues/1497)) ([ce41d7d](https://github.com/typescript-eslint/typescript-eslint/commit/ce41d7de33bcb7ccf96c03ac1438304c5a49ff54)) -* **experimental-utils:** widen type of `settings` property ([#1527](https://github.com/typescript-eslint/typescript-eslint/issues/1527)) ([b515e47](https://github.com/typescript-eslint/typescript-eslint/commit/b515e47af2bc914c7ebcfa4be813409dcd86b1c3)) - +- improve token types and add missing type guards ([#1497](https://github.com/typescript-eslint/typescript-eslint/issues/1497)) ([ce41d7d](https://github.com/typescript-eslint/typescript-eslint/commit/ce41d7de33bcb7ccf96c03ac1438304c5a49ff54)) +- **experimental-utils:** widen type of `settings` property ([#1527](https://github.com/typescript-eslint/typescript-eslint/issues/1527)) ([b515e47](https://github.com/typescript-eslint/typescript-eslint/commit/b515e47af2bc914c7ebcfa4be813409dcd86b1c3)) ### Features -* **experimental-utils:** make RuleMetaData.docs optional ([#1462](https://github.com/typescript-eslint/typescript-eslint/issues/1462)) ([cde97ac](https://github.com/typescript-eslint/typescript-eslint/commit/cde97aca24df5a0f28f37006ed130ebc217fb2ad)) -* **parser:** clean up scope-analysis types ([#1481](https://github.com/typescript-eslint/typescript-eslint/issues/1481)) ([4a727fa](https://github.com/typescript-eslint/typescript-eslint/commit/4a727fa083d749dba9eaf39322856f5f69c28cd8)) - - - - +- **experimental-utils:** make RuleMetaData.docs optional ([#1462](https://github.com/typescript-eslint/typescript-eslint/issues/1462)) ([cde97ac](https://github.com/typescript-eslint/typescript-eslint/commit/cde97aca24df5a0f28f37006ed130ebc217fb2ad)) +- **parser:** clean up scope-analysis types ([#1481](https://github.com/typescript-eslint/typescript-eslint/issues/1481)) ([4a727fa](https://github.com/typescript-eslint/typescript-eslint/commit/4a727fa083d749dba9eaf39322856f5f69c28cd8)) # [2.17.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.16.0...v2.17.0) (2020-01-20) - ### Features -* **experimental-utils:** expose getParserServices from utils ([#1448](https://github.com/typescript-eslint/typescript-eslint/issues/1448)) ([982c8bc](https://github.com/typescript-eslint/typescript-eslint/commit/982c8bc)) - - - - +- **experimental-utils:** expose getParserServices from utils ([#1448](https://github.com/typescript-eslint/typescript-eslint/issues/1448)) ([982c8bc](https://github.com/typescript-eslint/typescript-eslint/commit/982c8bc)) # [2.16.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.15.0...v2.16.0) (2020-01-13) - ### Features -* **typescript-estree:** add parserOption to turn on debug logs ([#1413](https://github.com/typescript-eslint/typescript-eslint/issues/1413)) ([25092fd](https://github.com/typescript-eslint/typescript-eslint/commit/25092fd)) -* **typescript-estree:** add strict type mapping to esTreeNodeToTSNodeMap ([#1382](https://github.com/typescript-eslint/typescript-eslint/issues/1382)) ([d3d70a3](https://github.com/typescript-eslint/typescript-eslint/commit/d3d70a3)) - - - - +- **typescript-estree:** add parserOption to turn on debug logs ([#1413](https://github.com/typescript-eslint/typescript-eslint/issues/1413)) ([25092fd](https://github.com/typescript-eslint/typescript-eslint/commit/25092fd)) +- **typescript-estree:** add strict type mapping to esTreeNodeToTSNodeMap ([#1382](https://github.com/typescript-eslint/typescript-eslint/issues/1382)) ([d3d70a3](https://github.com/typescript-eslint/typescript-eslint/commit/d3d70a3)) # [2.15.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.14.0...v2.15.0) (2020-01-06) **Note:** Version bump only for package @typescript-eslint/experimental-utils - - - - # [2.14.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.13.0...v2.14.0) (2019-12-30) - ### Features -* add internal eslint plugin for repo-specific lint rules ([#1373](https://github.com/typescript-eslint/typescript-eslint/issues/1373)) ([3a15413](https://github.com/typescript-eslint/typescript-eslint/commit/3a15413)) - - - - +- add internal eslint plugin for repo-specific lint rules ([#1373](https://github.com/typescript-eslint/typescript-eslint/issues/1373)) ([3a15413](https://github.com/typescript-eslint/typescript-eslint/commit/3a15413)) # [2.13.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.12.0...v2.13.0) (2019-12-23) **Note:** Version bump only for package @typescript-eslint/experimental-utils - - - - # [2.12.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.11.0...v2.12.0) (2019-12-16) **Note:** Version bump only for package @typescript-eslint/experimental-utils - - - - # [2.11.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.10.0...v2.11.0) (2019-12-09) **Note:** Version bump only for package @typescript-eslint/experimental-utils - - - - # [2.10.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.9.0...v2.10.0) (2019-12-02) - ### Features -* **eslint-plugin:** [no-non-null-assert] add suggestion fixer ([#1260](https://github.com/typescript-eslint/typescript-eslint/issues/1260)) ([e350a21](https://github.com/typescript-eslint/typescript-eslint/commit/e350a21)) -* **experimental-utils:** add isSpaceBetween declaration to Sou… ([#1268](https://github.com/typescript-eslint/typescript-eslint/issues/1268)) ([f83f04b](https://github.com/typescript-eslint/typescript-eslint/commit/f83f04b)) - - - - +- **eslint-plugin:** [no-non-null-assert] add suggestion fixer ([#1260](https://github.com/typescript-eslint/typescript-eslint/issues/1260)) ([e350a21](https://github.com/typescript-eslint/typescript-eslint/commit/e350a21)) +- **experimental-utils:** add isSpaceBetween declaration to Sou… ([#1268](https://github.com/typescript-eslint/typescript-eslint/issues/1268)) ([f83f04b](https://github.com/typescript-eslint/typescript-eslint/commit/f83f04b)) # [2.9.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.8.0...v2.9.0) (2019-11-25) - ### Features -* suggestion types, suggestions for no-explicit-any ([#1250](https://github.com/typescript-eslint/typescript-eslint/issues/1250)) ([b16a4b6](https://github.com/typescript-eslint/typescript-eslint/commit/b16a4b6)) -* **eslint-plugin:** add prefer-nullish-coalescing ([#1069](https://github.com/typescript-eslint/typescript-eslint/issues/1069)) ([a9cd399](https://github.com/typescript-eslint/typescript-eslint/commit/a9cd399)) -* **eslint-plugin:** add rule prefer-optional-chain ([#1213](https://github.com/typescript-eslint/typescript-eslint/issues/1213)) ([ad7e1a7](https://github.com/typescript-eslint/typescript-eslint/commit/ad7e1a7)) - - - - +- suggestion types, suggestions for no-explicit-any ([#1250](https://github.com/typescript-eslint/typescript-eslint/issues/1250)) ([b16a4b6](https://github.com/typescript-eslint/typescript-eslint/commit/b16a4b6)) +- **eslint-plugin:** add prefer-nullish-coalescing ([#1069](https://github.com/typescript-eslint/typescript-eslint/issues/1069)) ([a9cd399](https://github.com/typescript-eslint/typescript-eslint/commit/a9cd399)) +- **eslint-plugin:** add rule prefer-optional-chain ([#1213](https://github.com/typescript-eslint/typescript-eslint/issues/1213)) ([ad7e1a7](https://github.com/typescript-eslint/typescript-eslint/commit/ad7e1a7)) # [2.8.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.7.0...v2.8.0) (2019-11-18) **Note:** Version bump only for package @typescript-eslint/experimental-utils - - - - # [2.7.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.6.1...v2.7.0) (2019-11-11) **Note:** Version bump only for package @typescript-eslint/experimental-utils - - - - ## [2.6.1](https://github.com/typescript-eslint/typescript-eslint/compare/v2.6.0...v2.6.1) (2019-11-04) **Note:** Version bump only for package @typescript-eslint/experimental-utils - - - - # [2.6.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.5.0...v2.6.0) (2019-10-28) **Note:** Version bump only for package @typescript-eslint/experimental-utils - - - - # [2.5.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.4.0...v2.5.0) (2019-10-21) **Note:** Version bump only for package @typescript-eslint/experimental-utils - - - - # [2.4.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.3.3...v2.4.0) (2019-10-14) - ### Bug Fixes -* support long running "watch" lint sessions ([#973](https://github.com/typescript-eslint/typescript-eslint/issues/973)) ([854620e](https://github.com/typescript-eslint/typescript-eslint/commit/854620e)) - +- support long running "watch" lint sessions ([#973](https://github.com/typescript-eslint/typescript-eslint/issues/973)) ([854620e](https://github.com/typescript-eslint/typescript-eslint/commit/854620e)) ### Features -* **typescript-estree:** support for parsing 3.7 features ([#1045](https://github.com/typescript-eslint/typescript-eslint/issues/1045)) ([623febf](https://github.com/typescript-eslint/typescript-eslint/commit/623febf)) - - - - +- **typescript-estree:** support for parsing 3.7 features ([#1045](https://github.com/typescript-eslint/typescript-eslint/issues/1045)) ([623febf](https://github.com/typescript-eslint/typescript-eslint/commit/623febf)) ## [2.3.3](https://github.com/typescript-eslint/typescript-eslint/compare/v2.3.2...v2.3.3) (2019-10-07) - ### Bug Fixes -* **experimental-utils:** remove Rule.meta.extraDescription ([#1036](https://github.com/typescript-eslint/typescript-eslint/issues/1036)) ([192e23d](https://github.com/typescript-eslint/typescript-eslint/commit/192e23d)) - - - - +- **experimental-utils:** remove Rule.meta.extraDescription ([#1036](https://github.com/typescript-eslint/typescript-eslint/issues/1036)) ([192e23d](https://github.com/typescript-eslint/typescript-eslint/commit/192e23d)) ## [2.3.2](https://github.com/typescript-eslint/typescript-eslint/compare/v2.3.1...v2.3.2) (2019-09-30) **Note:** Version bump only for package @typescript-eslint/experimental-utils - - - - ## [2.3.1](https://github.com/typescript-eslint/typescript-eslint/compare/v2.3.0...v2.3.1) (2019-09-23) **Note:** Version bump only for package @typescript-eslint/experimental-utils - - - - # [2.3.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.2.0...v2.3.0) (2019-09-16) **Note:** Version bump only for package @typescript-eslint/experimental-utils - - - - # [2.2.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.1.0...v2.2.0) (2019-09-09) **Note:** Version bump only for package @typescript-eslint/experimental-utils - - - - # [2.1.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.0.0...v2.1.0) (2019-09-02) **Note:** Version bump only for package @typescript-eslint/experimental-utils - - - - # [2.0.0](https://github.com/typescript-eslint/typescript-eslint/compare/v1.13.0...v2.0.0) (2019-08-13) - ### Bug Fixes -* **eslint-plugin:** add `Literal` to `RuleListener` types ([#824](https://github.com/typescript-eslint/typescript-eslint/issues/824)) ([3c902a1](https://github.com/typescript-eslint/typescript-eslint/commit/3c902a1)) -* **utils:** add ES2019 as valid `ecmaVersion` ([#746](https://github.com/typescript-eslint/typescript-eslint/issues/746)) ([d11fbbe](https://github.com/typescript-eslint/typescript-eslint/commit/d11fbbe)) - +- **eslint-plugin:** add `Literal` to `RuleListener` types ([#824](https://github.com/typescript-eslint/typescript-eslint/issues/824)) ([3c902a1](https://github.com/typescript-eslint/typescript-eslint/commit/3c902a1)) +- **utils:** add ES2019 as valid `ecmaVersion` ([#746](https://github.com/typescript-eslint/typescript-eslint/issues/746)) ([d11fbbe](https://github.com/typescript-eslint/typescript-eslint/commit/d11fbbe)) ### Features -* explicitly support eslint v6 ([#645](https://github.com/typescript-eslint/typescript-eslint/issues/645)) ([34a7cf6](https://github.com/typescript-eslint/typescript-eslint/commit/34a7cf6)) - - -* feat(eslint-plugin)!: recommended-requiring-type-checking config (#846) ([d3470c9](https://github.com/typescript-eslint/typescript-eslint/commit/d3470c9)), closes [#846](https://github.com/typescript-eslint/typescript-eslint/issues/846) -* feat(eslint-plugin)!: change recommended config (#729) ([428567d](https://github.com/typescript-eslint/typescript-eslint/commit/428567d)), closes [#729](https://github.com/typescript-eslint/typescript-eslint/issues/729) -* feat(eslint-plugin)!: add rule `consistent-type-assertions` (#731) ([92e98de](https://github.com/typescript-eslint/typescript-eslint/commit/92e98de)), closes [#731](https://github.com/typescript-eslint/typescript-eslint/issues/731) +- explicitly support eslint v6 ([#645](https://github.com/typescript-eslint/typescript-eslint/issues/645)) ([34a7cf6](https://github.com/typescript-eslint/typescript-eslint/commit/34a7cf6)) +- feat(eslint-plugin)!: recommended-requiring-type-checking config (#846) ([d3470c9](https://github.com/typescript-eslint/typescript-eslint/commit/d3470c9)), closes [#846](https://github.com/typescript-eslint/typescript-eslint/issues/846) +- feat(eslint-plugin)!: change recommended config (#729) ([428567d](https://github.com/typescript-eslint/typescript-eslint/commit/428567d)), closes [#729](https://github.com/typescript-eslint/typescript-eslint/issues/729) +- feat(eslint-plugin)!: add rule `consistent-type-assertions` (#731) ([92e98de](https://github.com/typescript-eslint/typescript-eslint/commit/92e98de)), closes [#731](https://github.com/typescript-eslint/typescript-eslint/issues/731) ### BREAKING CHANGES -* removed some rules from recommended config -* recommended config changes are considered breaking -* Merges both no-angle-bracket-type-assertion and no-object-literal-type-assertion into one rule -* Node 6 is no longer supported - - - - +- removed some rules from recommended config +- recommended config changes are considered breaking +- Merges both no-angle-bracket-type-assertion and no-object-literal-type-assertion into one rule +- Node 6 is no longer supported # [1.13.0](https://github.com/typescript-eslint/typescript-eslint/compare/v1.12.0...v1.13.0) (2019-07-21) - ### Bug Fixes -* Correct `@types/json-schema` dependency ([#675](https://github.com/typescript-eslint/typescript-eslint/issues/675)) ([a5398ce](https://github.com/typescript-eslint/typescript-eslint/commit/a5398ce)) -* **utils:** move `typescript` from peer dep to dev dep ([#712](https://github.com/typescript-eslint/typescript-eslint/issues/712)) ([f949355](https://github.com/typescript-eslint/typescript-eslint/commit/f949355)) -* **utils:** RuleTester should not require a parser ([#713](https://github.com/typescript-eslint/typescript-eslint/issues/713)) ([158a417](https://github.com/typescript-eslint/typescript-eslint/commit/158a417)) - +- Correct `@types/json-schema` dependency ([#675](https://github.com/typescript-eslint/typescript-eslint/issues/675)) ([a5398ce](https://github.com/typescript-eslint/typescript-eslint/commit/a5398ce)) +- **utils:** move `typescript` from peer dep to dev dep ([#712](https://github.com/typescript-eslint/typescript-eslint/issues/712)) ([f949355](https://github.com/typescript-eslint/typescript-eslint/commit/f949355)) +- **utils:** RuleTester should not require a parser ([#713](https://github.com/typescript-eslint/typescript-eslint/issues/713)) ([158a417](https://github.com/typescript-eslint/typescript-eslint/commit/158a417)) ### Features -* **eslint-plugin:** add new rule no-misused-promises ([#612](https://github.com/typescript-eslint/typescript-eslint/issues/612)) ([28a131d](https://github.com/typescript-eslint/typescript-eslint/commit/28a131d)) - - - - +- **eslint-plugin:** add new rule no-misused-promises ([#612](https://github.com/typescript-eslint/typescript-eslint/issues/612)) ([28a131d](https://github.com/typescript-eslint/typescript-eslint/commit/28a131d)) # [1.12.0](https://github.com/typescript-eslint/typescript-eslint/compare/v1.11.0...v1.12.0) (2019-07-12) **Note:** Version bump only for package @typescript-eslint/experimental-utils - - - - # [1.11.0](https://github.com/typescript-eslint/typescript-eslint/compare/v1.10.2...v1.11.0) (2019-06-23) - ### Bug Fixes -* **eslint-plugin:** Remove duplicated code ([#611](https://github.com/typescript-eslint/typescript-eslint/issues/611)) ([c4df4ff](https://github.com/typescript-eslint/typescript-eslint/commit/c4df4ff)) - +- **eslint-plugin:** Remove duplicated code ([#611](https://github.com/typescript-eslint/typescript-eslint/issues/611)) ([c4df4ff](https://github.com/typescript-eslint/typescript-eslint/commit/c4df4ff)) ### Features -* **eslint-plugin:** add `consistent-type-definitions` rule ([#463](https://github.com/typescript-eslint/typescript-eslint/issues/463)) ([ec87d06](https://github.com/typescript-eslint/typescript-eslint/commit/ec87d06)) - - - - +- **eslint-plugin:** add `consistent-type-definitions` rule ([#463](https://github.com/typescript-eslint/typescript-eslint/issues/463)) ([ec87d06](https://github.com/typescript-eslint/typescript-eslint/commit/ec87d06)) ## [1.10.2](https://github.com/typescript-eslint/typescript-eslint/compare/v1.10.1...v1.10.2) (2019-06-10) diff --git a/packages/experimental-utils/LICENSE b/packages/experimental-utils/LICENSE index 7e7370143b2..a1164108d4d 100644 --- a/packages/experimental-utils/LICENSE +++ b/packages/experimental-utils/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2019 TypeScript ESLint and other contributors +Copyright (c) 2019 typescript-eslint and other contributors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/packages/experimental-utils/README.md b/packages/experimental-utils/README.md index 3073308c16b..a285229f638 100644 --- a/packages/experimental-utils/README.md +++ b/packages/experimental-utils/README.md @@ -1,12 +1,9 @@ -

Utils for ESLint Plugins

+# `@typescript-eslint/experimental-utils` -

Utilities for working with TypeScript + ESLint together.

+Utilities for working with TypeScript + ESLint together. -

- CI - NPM Version - NPM Downloads -

+[![NPM Version](https://img.shields.io/npm/v/@typescript-eslint/experimental-utils.svg?style=flat-square)](https://www.npmjs.com/package/@typescript-eslint/experimental-utils) +[![NPM Downloads](https://img.shields.io/npm/dm/@typescript-eslint/experimental-utils.svg?style=flat-square)](https://www.npmjs.com/package/@typescript-eslint/experimental-utils) ## Note @@ -22,4 +19,4 @@ You should switch to importing from that non-experimental package instead. ## Contributing -[See the contributing guide here](../../CONTRIBUTING.md) +[See the contributing guide here](https://typescript-eslint.io). diff --git a/packages/experimental-utils/package.json b/packages/experimental-utils/package.json index b7d3d70cda7..e3d44a14dfe 100644 --- a/packages/experimental-utils/package.json +++ b/packages/experimental-utils/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/experimental-utils", - "version": "5.31.0", + "version": "5.50.0", "description": "(Experimental) Utilities for working with TypeScript + ESLint together", "keywords": [ "eslint", @@ -34,11 +34,11 @@ "clean": "tsc -b tsconfig.build.json --clean", "postclean": "rimraf dist && rimraf _ts3.4 && rimraf coverage", "format": "prettier --write \"./**/*.{ts,mts,cts,tsx,js,mjs,cjs,jsx,json,md,css}\" --ignore-path ../../.prettierignore", - "lint": "eslint . --ignore-path='../../.eslintignore'", + "lint": "nx lint", "typecheck": "tsc -p tsconfig.json --noEmit" }, "dependencies": { - "@typescript-eslint/utils": "5.31.0" + "@typescript-eslint/utils": "5.50.0" }, "peerDependencies": { "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" diff --git a/packages/experimental-utils/project.json b/packages/experimental-utils/project.json index f8bd9117eea..74410fed05a 100644 --- a/packages/experimental-utils/project.json +++ b/packages/experimental-utils/project.json @@ -1,5 +1,15 @@ { - "root": "packages/experimental-utils", + "name": "experimental-utils", + "$schema": "../../node_modules/nx/schemas/project-schema.json", "type": "library", - "implicitDependencies": [] + "implicitDependencies": [], + "targets": { + "lint": { + "executor": "@nrwl/linter:eslint", + "outputs": ["{options.outputFile}"], + "options": { + "lintFilePatterns": ["packages/experimental-utils/**/*.ts"] + } + } + } } diff --git a/packages/parser/CHANGELOG.md b/packages/parser/CHANGELOG.md index 1827897fa5f..8dd79a4e7d1 100644 --- a/packages/parser/CHANGELOG.md +++ b/packages/parser/CHANGELOG.md @@ -3,7 +3,7 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. -# [5.31.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.7...v5.31.0) (2022-07-25) +# [5.50.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.49.0...v5.50.0) (2023-01-31) **Note:** Version bump only for package @typescript-eslint/parser @@ -11,18 +11,15 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline -## [5.30.7](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.6...v5.30.7) (2022-07-18) - - -### Bug Fixes +# [5.49.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.48.2...v5.49.0) (2023-01-23) -* expose types supporting old versions of typescript ([#5339](https://github.com/typescript-eslint/typescript-eslint/issues/5339)) ([4ba9bdb](https://github.com/typescript-eslint/typescript-eslint/commit/4ba9bdb93f87e6bc370f13aa1de48f435abe3f88)) +**Note:** Version bump only for package @typescript-eslint/parser -## [5.30.6](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.5...v5.30.6) (2022-07-11) +## [5.48.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.48.1...v5.48.2) (2023-01-16) **Note:** Version bump only for package @typescript-eslint/parser @@ -30,7 +27,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline -## [5.30.5](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.4...v5.30.5) (2022-07-04) +## [5.48.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.48.0...v5.48.1) (2023-01-09) **Note:** Version bump only for package @typescript-eslint/parser @@ -38,1023 +35,667 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline -## [5.30.4](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.3...v5.30.4) (2022-07-03) +# [5.48.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.47.1...v5.48.0) (2023-01-02) **Note:** Version bump only for package @typescript-eslint/parser +## [5.47.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.47.0...v5.47.1) (2022-12-26) +**Note:** Version bump only for package @typescript-eslint/parser +# [5.47.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.46.1...v5.47.0) (2022-12-19) +**Note:** Version bump only for package @typescript-eslint/parser -## [5.30.3](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.2...v5.30.3) (2022-07-01) +## [5.46.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.46.0...v5.46.1) (2022-12-12) **Note:** Version bump only for package @typescript-eslint/parser +# [5.46.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.45.1...v5.46.0) (2022-12-08) +**Note:** Version bump only for package @typescript-eslint/parser + +## [5.45.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.45.0...v5.45.1) (2022-12-05) +### Bug Fixes +- **parser:** remove the jsx option requirement for automatic jsx pragma resolution ([#6134](https://github.com/typescript-eslint/typescript-eslint/issues/6134)) ([e777f5e](https://github.com/typescript-eslint/typescript-eslint/commit/e777f5e225b9ddfb6bb1eaa74cbc5171a17ac017)) -## [5.30.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.1...v5.30.2) (2022-07-01) +# [5.45.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.44.0...v5.45.0) (2022-11-28) **Note:** Version bump only for package @typescript-eslint/parser +# [5.44.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.43.0...v5.44.0) (2022-11-21) +**Note:** Version bump only for package @typescript-eslint/parser +# [5.43.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.42.1...v5.43.0) (2022-11-14) +**Note:** Version bump only for package @typescript-eslint/parser -## 5.30.1 (2022-07-01) +## [5.42.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.42.0...v5.42.1) (2022-11-07) **Note:** Version bump only for package @typescript-eslint/parser +# [5.42.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.41.0...v5.42.0) (2022-10-31) + +### Features +- **scope-manager:** ignore ECMA version ([#5881](https://github.com/typescript-eslint/typescript-eslint/issues/5881)) ([3b8d449](https://github.com/typescript-eslint/typescript-eslint/commit/3b8d449696c319690536a18a48ef32749dc2f559)) +### Reverts +- Revert "feat(scope-manager): ignore ECMA version" (#5888) ([2ee81df](https://github.com/typescript-eslint/typescript-eslint/commit/2ee81df5a365d82ef4b3dfc124d4ec39c7bcb725)), closes [#5888](https://github.com/typescript-eslint/typescript-eslint/issues/5888) [#5881](https://github.com/typescript-eslint/typescript-eslint/issues/5881) -# [5.30.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.29.0...v5.30.0) (2022-06-27) +# [5.41.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.40.1...v5.41.0) (2022-10-24) **Note:** Version bump only for package @typescript-eslint/parser +## [5.40.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.40.0...v5.40.1) (2022-10-17) +**Note:** Version bump only for package @typescript-eslint/parser +# [5.40.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.39.0...v5.40.0) (2022-10-10) +**Note:** Version bump only for package @typescript-eslint/parser -# [5.29.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.28.0...v5.29.0) (2022-06-20) +# [5.39.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.38.1...v5.39.0) (2022-10-03) **Note:** Version bump only for package @typescript-eslint/parser +## [5.38.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.38.0...v5.38.1) (2022-09-26) +**Note:** Version bump only for package @typescript-eslint/parser +# [5.38.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.37.0...v5.38.0) (2022-09-19) +**Note:** Version bump only for package @typescript-eslint/parser -# [5.28.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.27.1...v5.28.0) (2022-06-13) +# [5.37.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.36.2...v5.37.0) (2022-09-12) **Note:** Version bump only for package @typescript-eslint/parser +## [5.36.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.36.1...v5.36.2) (2022-09-05) +**Note:** Version bump only for package @typescript-eslint/parser +## [5.36.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.36.0...v5.36.1) (2022-08-30) +**Note:** Version bump only for package @typescript-eslint/parser -## [5.27.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.27.0...v5.27.1) (2022-06-06) +# [5.36.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.35.1...v5.36.0) (2022-08-30) **Note:** Version bump only for package @typescript-eslint/parser +## [5.35.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.35.0...v5.35.1) (2022-08-24) +**Note:** Version bump only for package @typescript-eslint/parser +# [5.35.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.34.0...v5.35.0) (2022-08-24) +**Note:** Version bump only for package @typescript-eslint/parser -# [5.27.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.26.0...v5.27.0) (2022-05-30) +# [5.34.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.33.1...v5.34.0) (2022-08-22) +**Note:** Version bump only for package @typescript-eslint/parser -### Bug Fixes +## [5.33.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.33.0...v5.33.1) (2022-08-15) -* **types:** remove leftovers from removal of useJSXTextNode ([#5091](https://github.com/typescript-eslint/typescript-eslint/issues/5091)) ([f9c3647](https://github.com/typescript-eslint/typescript-eslint/commit/f9c3647cb637c8d1ee461b471da9d817ccbde77c)) +**Note:** Version bump only for package @typescript-eslint/parser +# [5.33.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.32.0...v5.33.0) (2022-08-08) -### Features +**Note:** Version bump only for package @typescript-eslint/parser -* [4.7] support new extensions ([#5027](https://github.com/typescript-eslint/typescript-eslint/issues/5027)) ([efc147b](https://github.com/typescript-eslint/typescript-eslint/commit/efc147b04dce52ab17415b6a4ae4076b944b9036)) +# [5.32.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.31.0...v5.32.0) (2022-08-01) +**Note:** Version bump only for package @typescript-eslint/parser +# [5.31.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.7...v5.31.0) (2022-07-25) +**Note:** Version bump only for package @typescript-eslint/parser +## [5.30.7](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.6...v5.30.7) (2022-07-18) -# [5.26.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.25.0...v5.26.0) (2022-05-23) +### Bug Fixes -**Note:** Version bump only for package @typescript-eslint/parser +- expose types supporting old versions of typescript ([#5339](https://github.com/typescript-eslint/typescript-eslint/issues/5339)) ([4ba9bdb](https://github.com/typescript-eslint/typescript-eslint/commit/4ba9bdb93f87e6bc370f13aa1de48f435abe3f88)) +## [5.30.6](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.5...v5.30.6) (2022-07-11) +**Note:** Version bump only for package @typescript-eslint/parser +## [5.30.5](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.4...v5.30.5) (2022-07-04) +**Note:** Version bump only for package @typescript-eslint/parser -# [5.25.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.24.0...v5.25.0) (2022-05-17) +## [5.30.4](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.3...v5.30.4) (2022-07-03) **Note:** Version bump only for package @typescript-eslint/parser +## [5.30.3](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.2...v5.30.3) (2022-07-01) +**Note:** Version bump only for package @typescript-eslint/parser +## [5.30.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.1...v5.30.2) (2022-07-01) +**Note:** Version bump only for package @typescript-eslint/parser -# [5.24.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.23.0...v5.24.0) (2022-05-16) +## 5.30.1 (2022-07-01) **Note:** Version bump only for package @typescript-eslint/parser +# [5.30.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.29.0...v5.30.0) (2022-06-27) +**Note:** Version bump only for package @typescript-eslint/parser +# [5.29.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.28.0...v5.29.0) (2022-06-20) +**Note:** Version bump only for package @typescript-eslint/parser -# [5.23.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.22.0...v5.23.0) (2022-05-09) +# [5.28.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.27.1...v5.28.0) (2022-06-13) **Note:** Version bump only for package @typescript-eslint/parser +## [5.27.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.27.0...v5.27.1) (2022-06-06) +**Note:** Version bump only for package @typescript-eslint/parser +# [5.27.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.26.0...v5.27.0) (2022-05-30) +### Bug Fixes -# [5.22.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.21.0...v5.22.0) (2022-05-02) - -**Note:** Version bump only for package @typescript-eslint/parser +- **types:** remove leftovers from removal of useJSXTextNode ([#5091](https://github.com/typescript-eslint/typescript-eslint/issues/5091)) ([f9c3647](https://github.com/typescript-eslint/typescript-eslint/commit/f9c3647cb637c8d1ee461b471da9d817ccbde77c)) +### Features +- [4.7] support new extensions ([#5027](https://github.com/typescript-eslint/typescript-eslint/issues/5027)) ([efc147b](https://github.com/typescript-eslint/typescript-eslint/commit/efc147b04dce52ab17415b6a4ae4076b944b9036)) +# [5.26.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.25.0...v5.26.0) (2022-05-23) +**Note:** Version bump only for package @typescript-eslint/parser -# [5.21.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.20.0...v5.21.0) (2022-04-25) +# [5.25.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.24.0...v5.25.0) (2022-05-17) **Note:** Version bump only for package @typescript-eslint/parser +# [5.24.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.23.0...v5.24.0) (2022-05-16) +**Note:** Version bump only for package @typescript-eslint/parser +# [5.23.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.22.0...v5.23.0) (2022-05-09) +**Note:** Version bump only for package @typescript-eslint/parser -# [5.20.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.19.0...v5.20.0) (2022-04-18) +# [5.22.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.21.0...v5.22.0) (2022-05-02) **Note:** Version bump only for package @typescript-eslint/parser +# [5.21.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.20.0...v5.21.0) (2022-04-25) +**Note:** Version bump only for package @typescript-eslint/parser +# [5.20.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.19.0...v5.20.0) (2022-04-18) +**Note:** Version bump only for package @typescript-eslint/parser # [5.19.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.18.0...v5.19.0) (2022-04-11) **Note:** Version bump only for package @typescript-eslint/parser +# [5.18.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.17.0...v5.18.0) (2022-04-04) +**Note:** Version bump only for package @typescript-eslint/parser +# [5.17.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.16.0...v5.17.0) (2022-03-28) +**Note:** Version bump only for package @typescript-eslint/parser -# [5.18.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.17.0...v5.18.0) (2022-04-04) +# [5.16.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.15.0...v5.16.0) (2022-03-21) **Note:** Version bump only for package @typescript-eslint/parser +# [5.15.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.14.0...v5.15.0) (2022-03-14) +### Features +- **parser:** add `parserOptions.emitDecoratorMetadata` ([#4646](https://github.com/typescript-eslint/typescript-eslint/issues/4646)) ([e3dd343](https://github.com/typescript-eslint/typescript-eslint/commit/e3dd343e51e3b7772e825a609735a04c921c1ec5)) - -# [5.17.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.16.0...v5.17.0) (2022-03-28) +# [5.14.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.13.0...v5.14.0) (2022-03-07) **Note:** Version bump only for package @typescript-eslint/parser +# [5.13.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.12.1...v5.13.0) (2022-02-28) +**Note:** Version bump only for package @typescript-eslint/parser +## [5.12.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.12.0...v5.12.1) (2022-02-21) +**Note:** Version bump only for package @typescript-eslint/parser -# [5.16.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.15.0...v5.16.0) (2022-03-21) +# [5.12.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.11.0...v5.12.0) (2022-02-14) **Note:** Version bump only for package @typescript-eslint/parser +# [5.11.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.10.2...v5.11.0) (2022-02-07) + +**Note:** Version bump only for package @typescript-eslint/parser +## [5.10.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.10.1...v5.10.2) (2022-01-31) +**Note:** Version bump only for package @typescript-eslint/parser +## [5.10.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.10.0...v5.10.1) (2022-01-24) -# [5.15.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.14.0...v5.15.0) (2022-03-14) +**Note:** Version bump only for package @typescript-eslint/parser +# [5.10.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.9.1...v5.10.0) (2022-01-17) ### Features -* **parser:** add `parserOptions.emitDecoratorMetadata` ([#4646](https://github.com/typescript-eslint/typescript-eslint/issues/4646)) ([e3dd343](https://github.com/typescript-eslint/typescript-eslint/commit/e3dd343e51e3b7772e825a609735a04c921c1ec5)) +- rename `experimental-utils` to `utils` and make `experimental-utils` an alias to the new package ([#4172](https://github.com/typescript-eslint/typescript-eslint/issues/4172)) ([1d55a75](https://github.com/typescript-eslint/typescript-eslint/commit/1d55a7511b38d8e2b2eabe59f639e0a865e6c93f)) +## [5.9.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.9.0...v5.9.1) (2022-01-10) +**Note:** Version bump only for package @typescript-eslint/parser +# [5.9.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.8.1...v5.9.0) (2022-01-03) +**Note:** Version bump only for package @typescript-eslint/parser -# [5.14.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.13.0...v5.14.0) (2022-03-07) +## [5.8.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.8.0...v5.8.1) (2021-12-27) **Note:** Version bump only for package @typescript-eslint/parser +# [5.8.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.7.0...v5.8.0) (2021-12-20) +**Note:** Version bump only for package @typescript-eslint/parser +# [5.7.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.6.0...v5.7.0) (2021-12-13) +**Note:** Version bump only for package @typescript-eslint/parser -# [5.13.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.12.1...v5.13.0) (2022-02-28) +# [5.6.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.5.0...v5.6.0) (2021-12-06) **Note:** Version bump only for package @typescript-eslint/parser +# [5.5.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.4.0...v5.5.0) (2021-11-29) +**Note:** Version bump only for package @typescript-eslint/parser +# [5.4.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.3.1...v5.4.0) (2021-11-15) +**Note:** Version bump only for package @typescript-eslint/parser -## [5.12.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.12.0...v5.12.1) (2022-02-21) +## [5.3.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.3.0...v5.3.1) (2021-11-08) **Note:** Version bump only for package @typescript-eslint/parser +# [5.3.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.2.0...v5.3.0) (2021-11-01) +**Note:** Version bump only for package @typescript-eslint/parser +# [5.2.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.1.0...v5.2.0) (2021-10-25) +**Note:** Version bump only for package @typescript-eslint/parser -# [5.12.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.11.0...v5.12.0) (2022-02-14) +# [5.1.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.0.0...v5.1.0) (2021-10-18) **Note:** Version bump only for package @typescript-eslint/parser +# [5.0.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.33.0...v5.0.0) (2021-10-11) +### Features +- support ESLint v8 ([#3737](https://github.com/typescript-eslint/typescript-eslint/issues/3737)) ([4ca62ae](https://github.com/typescript-eslint/typescript-eslint/commit/4ca62aee6681d706e762a8db727541ca204364f2)) - -# [5.11.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.10.2...v5.11.0) (2022-02-07) +# [4.33.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.32.0...v4.33.0) (2021-10-04) **Note:** Version bump only for package @typescript-eslint/parser +# [4.32.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.31.2...v4.32.0) (2021-09-27) +### Features +- Support `'latest'` as `ecmaVersion` ([#3873](https://github.com/typescript-eslint/typescript-eslint/issues/3873)) ([25a42c0](https://github.com/typescript-eslint/typescript-eslint/commit/25a42c0bbe92d1ecbc2e8ff9ef3a3ef413f728b0)) - -## [5.10.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.10.1...v5.10.2) (2022-01-31) +## [4.31.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.31.1...v4.31.2) (2021-09-20) **Note:** Version bump only for package @typescript-eslint/parser +## [4.31.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.31.0...v4.31.1) (2021-09-13) +**Note:** Version bump only for package @typescript-eslint/parser - - -## [5.10.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.10.0...v5.10.1) (2022-01-24) +# [4.31.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.30.0...v4.31.0) (2021-09-06) **Note:** Version bump only for package @typescript-eslint/parser +# [4.30.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.29.3...v4.30.0) (2021-08-30) +### Features +- **typescript-estree:** add support for class static blocks ([#3730](https://github.com/typescript-eslint/typescript-eslint/issues/3730)) ([f81831b](https://github.com/typescript-eslint/typescript-eslint/commit/f81831bd279a32da6dbab0f1c061053ea43965f6)) +## [4.29.3](https://github.com/typescript-eslint/typescript-eslint/compare/v4.29.2...v4.29.3) (2021-08-23) -# [5.10.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.9.1...v5.10.0) (2022-01-17) +**Note:** Version bump only for package @typescript-eslint/parser +## [4.29.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.29.1...v4.29.2) (2021-08-16) -### Features +**Note:** Version bump only for package @typescript-eslint/parser -* rename `experimental-utils` to `utils` and make `experimental-utils` an alias to the new package ([#4172](https://github.com/typescript-eslint/typescript-eslint/issues/4172)) ([1d55a75](https://github.com/typescript-eslint/typescript-eslint/commit/1d55a7511b38d8e2b2eabe59f639e0a865e6c93f)) +## [4.29.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.29.0...v4.29.1) (2021-08-09) +**Note:** Version bump only for package @typescript-eslint/parser +# [4.29.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.5...v4.29.0) (2021-08-02) +### Features +- **eslint-plugin:** Catch unused React import with new JSX transform ([#3577](https://github.com/typescript-eslint/typescript-eslint/issues/3577)) ([02998ea](https://github.com/typescript-eslint/typescript-eslint/commit/02998eac510665758b9a093d43afc310f3ac980d)) +- **typescript-estree:** add support for custom module resolution ([#3516](https://github.com/typescript-eslint/typescript-eslint/issues/3516)) ([d48429d](https://github.com/typescript-eslint/typescript-eslint/commit/d48429d97326545bb727f88ce9056270b1599a31)) -## [5.9.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.9.0...v5.9.1) (2022-01-10) +## [4.28.5](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.4...v4.28.5) (2021-07-26) **Note:** Version bump only for package @typescript-eslint/parser +## [4.28.4](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.3...v4.28.4) (2021-07-19) +**Note:** Version bump only for package @typescript-eslint/parser - - -# [5.9.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.8.1...v5.9.0) (2022-01-03) +## [4.28.3](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.2...v4.28.3) (2021-07-12) **Note:** Version bump only for package @typescript-eslint/parser +## [4.28.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.1...v4.28.2) (2021-07-05) +**Note:** Version bump only for package @typescript-eslint/parser +## [4.28.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.0...v4.28.1) (2021-06-28) +**Note:** Version bump only for package @typescript-eslint/parser -## [5.8.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.8.0...v5.8.1) (2021-12-27) +# [4.28.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.27.0...v4.28.0) (2021-06-21) **Note:** Version bump only for package @typescript-eslint/parser +# [4.27.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.26.1...v4.27.0) (2021-06-14) + +### Bug Fixes +- **typescript-estree:** allow providing more one than one existing program in config ([#3508](https://github.com/typescript-eslint/typescript-eslint/issues/3508)) ([4f1806e](https://github.com/typescript-eslint/typescript-eslint/commit/4f1806e548affb7265da360d1fc8d033e25de325)) +### Features +- allow user to provide TS program instance in parser options ([#3484](https://github.com/typescript-eslint/typescript-eslint/issues/3484)) ([e855b18](https://github.com/typescript-eslint/typescript-eslint/commit/e855b18b8feee0edb5c617c11006861426a6f530)) -# [5.8.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.7.0...v5.8.0) (2021-12-20) +## [4.26.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.26.0...v4.26.1) (2021-06-07) **Note:** Version bump only for package @typescript-eslint/parser +# [4.26.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.25.0...v4.26.0) (2021-05-31) +**Note:** Version bump only for package @typescript-eslint/parser +# [4.25.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.24.0...v4.25.0) (2021-05-24) +**Note:** Version bump only for package @typescript-eslint/parser -# [5.7.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.6.0...v5.7.0) (2021-12-13) +# [4.24.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.23.0...v4.24.0) (2021-05-17) **Note:** Version bump only for package @typescript-eslint/parser +# [4.23.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.22.1...v4.23.0) (2021-05-10) +### Features +- refactor to split AST specification out as its own module ([#2911](https://github.com/typescript-eslint/typescript-eslint/issues/2911)) ([25ea953](https://github.com/typescript-eslint/typescript-eslint/commit/25ea953cc60b118bd385c71e0a9b61c286c26fcf)) - -# [5.6.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.5.0...v5.6.0) (2021-12-06) +## [4.22.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.22.0...v4.22.1) (2021-05-04) **Note:** Version bump only for package @typescript-eslint/parser +# [4.22.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.21.0...v4.22.0) (2021-04-12) +**Note:** Version bump only for package @typescript-eslint/parser +# [4.21.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.20.0...v4.21.0) (2021-04-05) +**Note:** Version bump only for package @typescript-eslint/parser -# [5.5.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.4.0...v5.5.0) (2021-11-29) +# [4.20.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.19.0...v4.20.0) (2021-03-29) **Note:** Version bump only for package @typescript-eslint/parser +# [4.19.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.18.0...v4.19.0) (2021-03-22) +**Note:** Version bump only for package @typescript-eslint/parser +# [4.18.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.17.0...v4.18.0) (2021-03-15) +**Note:** Version bump only for package @typescript-eslint/parser -# [5.4.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.3.1...v5.4.0) (2021-11-15) +# [4.17.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.16.1...v4.17.0) (2021-03-08) **Note:** Version bump only for package @typescript-eslint/parser +## [4.16.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.16.0...v4.16.1) (2021-03-01) +**Note:** Version bump only for package @typescript-eslint/parser +# [4.16.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.15.2...v4.16.0) (2021-03-01) +**Note:** Version bump only for package @typescript-eslint/parser -## [5.3.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.3.0...v5.3.1) (2021-11-08) +## [4.15.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.15.1...v4.15.2) (2021-02-22) **Note:** Version bump only for package @typescript-eslint/parser +## [4.15.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.15.0...v4.15.1) (2021-02-15) +**Note:** Version bump only for package @typescript-eslint/parser +# [4.15.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.14.2...v4.15.0) (2021-02-08) +**Note:** Version bump only for package @typescript-eslint/parser -# [5.3.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.2.0...v5.3.0) (2021-11-01) +## [4.14.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.14.1...v4.14.2) (2021-02-01) **Note:** Version bump only for package @typescript-eslint/parser +## [4.14.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.14.0...v4.14.1) (2021-01-25) +**Note:** Version bump only for package @typescript-eslint/parser +# [4.14.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.13.0...v4.14.0) (2021-01-18) +### Features -# [5.2.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.1.0...v5.2.0) (2021-10-25) +- add support for decorator metadata in scope analysis and in consistent-type-imports ([#2751](https://github.com/typescript-eslint/typescript-eslint/issues/2751)) ([445e416](https://github.com/typescript-eslint/typescript-eslint/commit/445e416878b27a54bf07c2d3b84dabd7b06e51bc)), closes [#2559](https://github.com/typescript-eslint/typescript-eslint/issues/2559) + +# [4.13.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.12.0...v4.13.0) (2021-01-11) **Note:** Version bump only for package @typescript-eslint/parser +# [4.12.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.11.1...v4.12.0) (2021-01-04) +**Note:** Version bump only for package @typescript-eslint/parser +## [4.11.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.11.0...v4.11.1) (2020-12-28) +**Note:** Version bump only for package @typescript-eslint/parser -# [5.1.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.0.0...v5.1.0) (2021-10-18) +# [4.11.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.10.0...v4.11.0) (2020-12-21) **Note:** Version bump only for package @typescript-eslint/parser +# [4.10.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.9.1...v4.10.0) (2020-12-14) +**Note:** Version bump only for package @typescript-eslint/parser +## [4.9.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.9.0...v4.9.1) (2020-12-07) +**Note:** Version bump only for package @typescript-eslint/parser -# [5.0.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.33.0...v5.0.0) (2021-10-11) +# [4.9.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.8.2...v4.9.0) (2020-11-30) +**Note:** Version bump only for package @typescript-eslint/parser -### Features +## [4.8.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.8.1...v4.8.2) (2020-11-23) -* support ESLint v8 ([#3737](https://github.com/typescript-eslint/typescript-eslint/issues/3737)) ([4ca62ae](https://github.com/typescript-eslint/typescript-eslint/commit/4ca62aee6681d706e762a8db727541ca204364f2)) +**Note:** Version bump only for package @typescript-eslint/parser +## [4.8.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.8.0...v4.8.1) (2020-11-17) +**Note:** Version bump only for package @typescript-eslint/parser +# [4.8.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.7.0...v4.8.0) (2020-11-16) +**Note:** Version bump only for package @typescript-eslint/parser -# [4.33.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.32.0...v4.33.0) (2021-10-04) +# [4.7.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.6.1...v4.7.0) (2020-11-09) **Note:** Version bump only for package @typescript-eslint/parser +## [4.6.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.6.0...v4.6.1) (2020-11-02) + +**Note:** Version bump only for package @typescript-eslint/parser +# [4.6.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.5.0...v4.6.0) (2020-10-26) +**Note:** Version bump only for package @typescript-eslint/parser +# [4.5.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.4.1...v4.5.0) (2020-10-19) -# [4.32.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.31.2...v4.32.0) (2021-09-27) +### Bug Fixes +- **parser:** minor fix regexp, map-filter to reduce ([#2684](https://github.com/typescript-eslint/typescript-eslint/issues/2684)) ([f1329f6](https://github.com/typescript-eslint/typescript-eslint/commit/f1329f6c4e3d1de21b1dc59c30ce16503c346eee)) ### Features -* Support `'latest'` as `ecmaVersion` ([#3873](https://github.com/typescript-eslint/typescript-eslint/issues/3873)) ([25a42c0](https://github.com/typescript-eslint/typescript-eslint/commit/25a42c0bbe92d1ecbc2e8ff9ef3a3ef413f728b0)) - - - - - -## [4.31.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.31.1...v4.31.2) (2021-09-20) - -**Note:** Version bump only for package @typescript-eslint/parser - - - - - -## [4.31.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.31.0...v4.31.1) (2021-09-13) - -**Note:** Version bump only for package @typescript-eslint/parser - - - - - -# [4.31.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.30.0...v4.31.0) (2021-09-06) - -**Note:** Version bump only for package @typescript-eslint/parser - - - - - -# [4.30.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.29.3...v4.30.0) (2021-08-30) - - -### Features - -* **typescript-estree:** add support for class static blocks ([#3730](https://github.com/typescript-eslint/typescript-eslint/issues/3730)) ([f81831b](https://github.com/typescript-eslint/typescript-eslint/commit/f81831bd279a32da6dbab0f1c061053ea43965f6)) - - - - - -## [4.29.3](https://github.com/typescript-eslint/typescript-eslint/compare/v4.29.2...v4.29.3) (2021-08-23) - -**Note:** Version bump only for package @typescript-eslint/parser - - - - - -## [4.29.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.29.1...v4.29.2) (2021-08-16) - -**Note:** Version bump only for package @typescript-eslint/parser - - - - - -## [4.29.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.29.0...v4.29.1) (2021-08-09) - -**Note:** Version bump only for package @typescript-eslint/parser - - - - - -# [4.29.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.5...v4.29.0) (2021-08-02) - - -### Features - -* **eslint-plugin:** Catch unused React import with new JSX transform ([#3577](https://github.com/typescript-eslint/typescript-eslint/issues/3577)) ([02998ea](https://github.com/typescript-eslint/typescript-eslint/commit/02998eac510665758b9a093d43afc310f3ac980d)) -* **typescript-estree:** add support for custom module resolution ([#3516](https://github.com/typescript-eslint/typescript-eslint/issues/3516)) ([d48429d](https://github.com/typescript-eslint/typescript-eslint/commit/d48429d97326545bb727f88ce9056270b1599a31)) - - - - - -## [4.28.5](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.4...v4.28.5) (2021-07-26) - -**Note:** Version bump only for package @typescript-eslint/parser - - - - - -## [4.28.4](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.3...v4.28.4) (2021-07-19) - -**Note:** Version bump only for package @typescript-eslint/parser - - - - - -## [4.28.3](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.2...v4.28.3) (2021-07-12) - -**Note:** Version bump only for package @typescript-eslint/parser - - - - - -## [4.28.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.1...v4.28.2) (2021-07-05) - -**Note:** Version bump only for package @typescript-eslint/parser - - - - - -## [4.28.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.0...v4.28.1) (2021-06-28) - -**Note:** Version bump only for package @typescript-eslint/parser - - - - - -# [4.28.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.27.0...v4.28.0) (2021-06-21) - -**Note:** Version bump only for package @typescript-eslint/parser - - - - - -# [4.27.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.26.1...v4.27.0) (2021-06-14) - - -### Bug Fixes - -* **typescript-estree:** allow providing more one than one existing program in config ([#3508](https://github.com/typescript-eslint/typescript-eslint/issues/3508)) ([4f1806e](https://github.com/typescript-eslint/typescript-eslint/commit/4f1806e548affb7265da360d1fc8d033e25de325)) - - -### Features - -* allow user to provide TS program instance in parser options ([#3484](https://github.com/typescript-eslint/typescript-eslint/issues/3484)) ([e855b18](https://github.com/typescript-eslint/typescript-eslint/commit/e855b18b8feee0edb5c617c11006861426a6f530)) - - - - - -## [4.26.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.26.0...v4.26.1) (2021-06-07) - -**Note:** Version bump only for package @typescript-eslint/parser - - - - - -# [4.26.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.25.0...v4.26.0) (2021-05-31) - -**Note:** Version bump only for package @typescript-eslint/parser - - - - - -# [4.25.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.24.0...v4.25.0) (2021-05-24) - -**Note:** Version bump only for package @typescript-eslint/parser - - - - - -# [4.24.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.23.0...v4.24.0) (2021-05-17) - -**Note:** Version bump only for package @typescript-eslint/parser - - - - - -# [4.23.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.22.1...v4.23.0) (2021-05-10) - - -### Features - -* refactor to split AST specification out as its own module ([#2911](https://github.com/typescript-eslint/typescript-eslint/issues/2911)) ([25ea953](https://github.com/typescript-eslint/typescript-eslint/commit/25ea953cc60b118bd385c71e0a9b61c286c26fcf)) - - - - - -## [4.22.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.22.0...v4.22.1) (2021-05-04) - -**Note:** Version bump only for package @typescript-eslint/parser - - - - - -# [4.22.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.21.0...v4.22.0) (2021-04-12) - -**Note:** Version bump only for package @typescript-eslint/parser - - - - - -# [4.21.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.20.0...v4.21.0) (2021-04-05) - -**Note:** Version bump only for package @typescript-eslint/parser - - - - - -# [4.20.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.19.0...v4.20.0) (2021-03-29) - -**Note:** Version bump only for package @typescript-eslint/parser - - - - - -# [4.19.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.18.0...v4.19.0) (2021-03-22) - -**Note:** Version bump only for package @typescript-eslint/parser - - - - - -# [4.18.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.17.0...v4.18.0) (2021-03-15) - -**Note:** Version bump only for package @typescript-eslint/parser - - - - - -# [4.17.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.16.1...v4.17.0) (2021-03-08) - -**Note:** Version bump only for package @typescript-eslint/parser - - - - - -## [4.16.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.16.0...v4.16.1) (2021-03-01) - -**Note:** Version bump only for package @typescript-eslint/parser - - - - - -# [4.16.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.15.2...v4.16.0) (2021-03-01) - -**Note:** Version bump only for package @typescript-eslint/parser - - - - - -## [4.15.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.15.1...v4.15.2) (2021-02-22) - -**Note:** Version bump only for package @typescript-eslint/parser - - - - - -## [4.15.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.15.0...v4.15.1) (2021-02-15) - -**Note:** Version bump only for package @typescript-eslint/parser - - - - - -# [4.15.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.14.2...v4.15.0) (2021-02-08) - -**Note:** Version bump only for package @typescript-eslint/parser - - - - - -## [4.14.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.14.1...v4.14.2) (2021-02-01) - -**Note:** Version bump only for package @typescript-eslint/parser - - - - - -## [4.14.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.14.0...v4.14.1) (2021-01-25) - -**Note:** Version bump only for package @typescript-eslint/parser - - - - - -# [4.14.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.13.0...v4.14.0) (2021-01-18) - - -### Features - -* add support for decorator metadata in scope analysis and in consistent-type-imports ([#2751](https://github.com/typescript-eslint/typescript-eslint/issues/2751)) ([445e416](https://github.com/typescript-eslint/typescript-eslint/commit/445e416878b27a54bf07c2d3b84dabd7b06e51bc)), closes [#2559](https://github.com/typescript-eslint/typescript-eslint/issues/2559) - - - - - -# [4.13.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.12.0...v4.13.0) (2021-01-11) - -**Note:** Version bump only for package @typescript-eslint/parser - - - - - -# [4.12.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.11.1...v4.12.0) (2021-01-04) - -**Note:** Version bump only for package @typescript-eslint/parser - - - - - -## [4.11.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.11.0...v4.11.1) (2020-12-28) - -**Note:** Version bump only for package @typescript-eslint/parser - - - - - -# [4.11.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.10.0...v4.11.0) (2020-12-21) - -**Note:** Version bump only for package @typescript-eslint/parser - - - - - -# [4.10.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.9.1...v4.10.0) (2020-12-14) - -**Note:** Version bump only for package @typescript-eslint/parser - - - - - -## [4.9.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.9.0...v4.9.1) (2020-12-07) - -**Note:** Version bump only for package @typescript-eslint/parser - - - - - -# [4.9.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.8.2...v4.9.0) (2020-11-30) - -**Note:** Version bump only for package @typescript-eslint/parser - - - - - -## [4.8.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.8.1...v4.8.2) (2020-11-23) - -**Note:** Version bump only for package @typescript-eslint/parser - - - - - -## [4.8.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.8.0...v4.8.1) (2020-11-17) - -**Note:** Version bump only for package @typescript-eslint/parser - - - - - -# [4.8.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.7.0...v4.8.0) (2020-11-16) - -**Note:** Version bump only for package @typescript-eslint/parser - - - - - -# [4.7.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.6.1...v4.7.0) (2020-11-09) - -**Note:** Version bump only for package @typescript-eslint/parser - - - - - -## [4.6.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.6.0...v4.6.1) (2020-11-02) - -**Note:** Version bump only for package @typescript-eslint/parser - - - - - -# [4.6.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.5.0...v4.6.0) (2020-10-26) - -**Note:** Version bump only for package @typescript-eslint/parser - - - - - -# [4.5.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.4.1...v4.5.0) (2020-10-19) - - -### Bug Fixes - -* **parser:** minor fix regexp, map-filter to reduce ([#2684](https://github.com/typescript-eslint/typescript-eslint/issues/2684)) ([f1329f6](https://github.com/typescript-eslint/typescript-eslint/commit/f1329f6c4e3d1de21b1dc59c30ce16503c346eee)) - - -### Features - -* **typescript-estree:** add flag EXPERIMENTAL_useSourceOfProjectReferenceRedirect ([#2669](https://github.com/typescript-eslint/typescript-eslint/issues/2669)) ([90a5878](https://github.com/typescript-eslint/typescript-eslint/commit/90a587845088da1b205e4d7d77dbc3f9447b1c5a)) - - - - +- **typescript-estree:** add flag EXPERIMENTAL_useSourceOfProjectReferenceRedirect ([#2669](https://github.com/typescript-eslint/typescript-eslint/issues/2669)) ([90a5878](https://github.com/typescript-eslint/typescript-eslint/commit/90a587845088da1b205e4d7d77dbc3f9447b1c5a)) ## [4.4.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.4.0...v4.4.1) (2020-10-12) **Note:** Version bump only for package @typescript-eslint/parser - - - - # [4.4.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.3.0...v4.4.0) (2020-10-05) **Note:** Version bump only for package @typescript-eslint/parser - - - - # [4.3.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.2.0...v4.3.0) (2020-09-28) **Note:** Version bump only for package @typescript-eslint/parser - - - - # [4.2.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.1.1...v4.2.0) (2020-09-21) **Note:** Version bump only for package @typescript-eslint/parser - - - - ## [4.1.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.1.0...v4.1.1) (2020-09-14) -**Note:** Version bump only for package @typescript-eslint/parser - - - - - -# [4.1.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.0.1...v4.1.0) (2020-09-07) - - -### Features - -* **scope-manager:** add support for JSX scope analysis ([#2498](https://github.com/typescript-eslint/typescript-eslint/issues/2498)) ([f887ab5](https://github.com/typescript-eslint/typescript-eslint/commit/f887ab51f58c1b3571f9a14832864bc0ca59623f)), closes [#2455](https://github.com/typescript-eslint/typescript-eslint/issues/2455) [#2477](https://github.com/typescript-eslint/typescript-eslint/issues/2477) - - - - - -## [4.0.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.0.0...v4.0.1) (2020-08-31) - -**Note:** Version bump only for package @typescript-eslint/parser - - - - - -# [4.0.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.10.1...v4.0.0) (2020-08-31) - -## [Please see the release notes for v4.0.0](https://github.com/typescript-eslint/typescript-eslint/releases/tag/v4.0.0) - -### Features - -* consume new scope analysis package ([#2039](https://github.com/typescript-eslint/typescript-eslint/issues/2039)) ([3be125d](https://github.com/typescript-eslint/typescript-eslint/commit/3be125d9bdbee1984ac6037874edf619213bd3d0)) -* support ESTree optional chaining representation ([#2308](https://github.com/typescript-eslint/typescript-eslint/issues/2308)) ([e9d2ab6](https://github.com/typescript-eslint/typescript-eslint/commit/e9d2ab638b6767700b52797e74b814ea059beaae)) -* **typescript-estree:** switch to globby ([#2418](https://github.com/typescript-eslint/typescript-eslint/issues/2418)) ([3a7ec9b](https://github.com/typescript-eslint/typescript-eslint/commit/3a7ec9bcf1873a99c6da2f19ade8ab4763b4793c)), closes [#2398](https://github.com/typescript-eslint/typescript-eslint/issues/2398) - - -### BREAKING CHANGES - -* **typescript-estree:** - removes the ability to supply a `RegExp` to `projectFolderIgnoreList`, and changes the meaning of the string value from a regex to a glob. - - - - - -## [3.10.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.10.0...v3.10.1) (2020-08-25) - -**Note:** Version bump only for package @typescript-eslint/parser - - - - - -# [3.10.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.9.1...v3.10.0) (2020-08-24) - -**Note:** Version bump only for package @typescript-eslint/parser - - - - - -## [3.9.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.9.0...v3.9.1) (2020-08-17) - -**Note:** Version bump only for package @typescript-eslint/parser - - - - - -# [3.9.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.8.0...v3.9.0) (2020-08-10) - - -### Features - -* **typescript-estree:** support TSv4 labelled tuple members ([#2378](https://github.com/typescript-eslint/typescript-eslint/issues/2378)) ([00d84ff](https://github.com/typescript-eslint/typescript-eslint/commit/00d84ffbcbe9d0ec98bdb2f2ce59959a27ce4dbe)) - - - - - -# [3.8.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.7.1...v3.8.0) (2020-08-03) - -**Note:** Version bump only for package @typescript-eslint/parser - - - - - -## [3.7.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.7.0...v3.7.1) (2020-07-27) - -**Note:** Version bump only for package @typescript-eslint/parser - - - - - -# [3.7.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.6.1...v3.7.0) (2020-07-20) - - -### Features - -* **typescript-estree:** support short-circuiting assignment operators ([#2307](https://github.com/typescript-eslint/typescript-eslint/issues/2307)) ([2c90d9f](https://github.com/typescript-eslint/typescript-eslint/commit/2c90d9fa3aa5ebd7db697dddb7762bca2dd0e06b)) -* **typescript-estree:** support type annotations on catch clauses ([#2306](https://github.com/typescript-eslint/typescript-eslint/issues/2306)) ([b5afe9c](https://github.com/typescript-eslint/typescript-eslint/commit/b5afe9c560b9f38c8dffc312a600db30944129c8)) - - - - - -## [3.6.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.6.0...v3.6.1) (2020-07-13) - -**Note:** Version bump only for package @typescript-eslint/parser - - - - - -# [3.6.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.5.0...v3.6.0) (2020-07-06) - -**Note:** Version bump only for package @typescript-eslint/parser - - - - - -# [3.5.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.4.0...v3.5.0) (2020-06-29) +**Note:** Version bump only for package @typescript-eslint/parser +# [4.1.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.0.1...v4.1.0) (2020-09-07) ### Features -* split types into their own package ([#2229](https://github.com/typescript-eslint/typescript-eslint/issues/2229)) ([5f45918](https://github.com/typescript-eslint/typescript-eslint/commit/5f4591886f3438329fbf2229b03ac66174334a24)) +- **scope-manager:** add support for JSX scope analysis ([#2498](https://github.com/typescript-eslint/typescript-eslint/issues/2498)) ([f887ab5](https://github.com/typescript-eslint/typescript-eslint/commit/f887ab51f58c1b3571f9a14832864bc0ca59623f)), closes [#2455](https://github.com/typescript-eslint/typescript-eslint/issues/2455) [#2477](https://github.com/typescript-eslint/typescript-eslint/issues/2477) +## [4.0.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.0.0...v4.0.1) (2020-08-31) +**Note:** Version bump only for package @typescript-eslint/parser +# [4.0.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.10.1...v4.0.0) (2020-08-31) +## [Please see the release notes for v4.0.0](https://github.com/typescript-eslint/typescript-eslint/releases/tag/v4.0.0) -# [3.4.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.3.0...v3.4.0) (2020-06-22) +### Features -**Note:** Version bump only for package @typescript-eslint/parser +- consume new scope analysis package ([#2039](https://github.com/typescript-eslint/typescript-eslint/issues/2039)) ([3be125d](https://github.com/typescript-eslint/typescript-eslint/commit/3be125d9bdbee1984ac6037874edf619213bd3d0)) +- support ESTree optional chaining representation ([#2308](https://github.com/typescript-eslint/typescript-eslint/issues/2308)) ([e9d2ab6](https://github.com/typescript-eslint/typescript-eslint/commit/e9d2ab638b6767700b52797e74b814ea059beaae)) +- **typescript-estree:** switch to globby ([#2418](https://github.com/typescript-eslint/typescript-eslint/issues/2418)) ([3a7ec9b](https://github.com/typescript-eslint/typescript-eslint/commit/3a7ec9bcf1873a99c6da2f19ade8ab4763b4793c)), closes [#2398](https://github.com/typescript-eslint/typescript-eslint/issues/2398) +### BREAKING CHANGES +- **typescript-estree:** - removes the ability to supply a `RegExp` to `projectFolderIgnoreList`, and changes the meaning of the string value from a regex to a glob. +## [3.10.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.10.0...v3.10.1) (2020-08-25) +**Note:** Version bump only for package @typescript-eslint/parser -# [3.3.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.2.0...v3.3.0) (2020-06-15) +# [3.10.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.9.1...v3.10.0) (2020-08-24) **Note:** Version bump only for package @typescript-eslint/parser +## [3.9.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.9.0...v3.9.1) (2020-08-17) +**Note:** Version bump only for package @typescript-eslint/parser +# [3.9.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.8.0...v3.9.0) (2020-08-10) +### Features -# [3.2.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.1.0...v3.2.0) (2020-06-08) - +- **typescript-estree:** support TSv4 labelled tuple members ([#2378](https://github.com/typescript-eslint/typescript-eslint/issues/2378)) ([00d84ff](https://github.com/typescript-eslint/typescript-eslint/commit/00d84ffbcbe9d0ec98bdb2f2ce59959a27ce4dbe)) -### Bug Fixes +# [3.8.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.7.1...v3.8.0) (2020-08-03) -* **eslint-plugin:** [prefer-optional-chain] handling first member expression ([#2156](https://github.com/typescript-eslint/typescript-eslint/issues/2156)) ([de18660](https://github.com/typescript-eslint/typescript-eslint/commit/de18660a8cf8f7033798646d8c5b0938d1accb12)) +**Note:** Version bump only for package @typescript-eslint/parser +## [3.7.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.7.0...v3.7.1) (2020-07-27) +**Note:** Version bump only for package @typescript-eslint/parser +# [3.7.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.6.1...v3.7.0) (2020-07-20) +### Features -# [3.1.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.0.2...v3.1.0) (2020-06-01) +- **typescript-estree:** support short-circuiting assignment operators ([#2307](https://github.com/typescript-eslint/typescript-eslint/issues/2307)) ([2c90d9f](https://github.com/typescript-eslint/typescript-eslint/commit/2c90d9fa3aa5ebd7db697dddb7762bca2dd0e06b)) +- **typescript-estree:** support type annotations on catch clauses ([#2306](https://github.com/typescript-eslint/typescript-eslint/issues/2306)) ([b5afe9c](https://github.com/typescript-eslint/typescript-eslint/commit/b5afe9c560b9f38c8dffc312a600db30944129c8)) +## [3.6.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.6.0...v3.6.1) (2020-07-13) -### Bug Fixes +**Note:** Version bump only for package @typescript-eslint/parser -* **experimental-utils:** downlevel type declarations for versions older than 3.8 ([#2133](https://github.com/typescript-eslint/typescript-eslint/issues/2133)) ([7925823](https://github.com/typescript-eslint/typescript-eslint/commit/792582326a8065270b69a0ffcaad5a7b4b103ff3)) +# [3.6.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.5.0...v3.6.0) (2020-07-06) +**Note:** Version bump only for package @typescript-eslint/parser +# [3.5.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.4.0...v3.5.0) (2020-06-29) +### Features +- split types into their own package ([#2229](https://github.com/typescript-eslint/typescript-eslint/issues/2229)) ([5f45918](https://github.com/typescript-eslint/typescript-eslint/commit/5f4591886f3438329fbf2229b03ac66174334a24)) -## [3.0.2](https://github.com/typescript-eslint/typescript-eslint/compare/v3.0.1...v3.0.2) (2020-05-27) +# [3.4.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.3.0...v3.4.0) (2020-06-22) **Note:** Version bump only for package @typescript-eslint/parser +# [3.3.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.2.0...v3.3.0) (2020-06-15) +**Note:** Version bump only for package @typescript-eslint/parser +# [3.2.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.1.0...v3.2.0) (2020-06-08) +### Bug Fixes -## [3.0.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.0.0...v3.0.1) (2020-05-25) +- **eslint-plugin:** [prefer-optional-chain] handling first member expression ([#2156](https://github.com/typescript-eslint/typescript-eslint/issues/2156)) ([de18660](https://github.com/typescript-eslint/typescript-eslint/commit/de18660a8cf8f7033798646d8c5b0938d1accb12)) +# [3.1.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.0.2...v3.1.0) (2020-06-01) ### Bug Fixes -* **typescript-estree:** handle `BigInt` with `_` numeric separator ([#2067](https://github.com/typescript-eslint/typescript-eslint/issues/2067)) ([66f1627](https://github.com/typescript-eslint/typescript-eslint/commit/66f1627b11a566d5b925a577e800f99d5c808be2)) +- **experimental-utils:** downlevel type declarations for versions older than 3.8 ([#2133](https://github.com/typescript-eslint/typescript-eslint/issues/2133)) ([7925823](https://github.com/typescript-eslint/typescript-eslint/commit/792582326a8065270b69a0ffcaad5a7b4b103ff3)) +## [3.0.2](https://github.com/typescript-eslint/typescript-eslint/compare/v3.0.1...v3.0.2) (2020-05-27) + +**Note:** Version bump only for package @typescript-eslint/parser +## [3.0.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.0.0...v3.0.1) (2020-05-25) +### Bug Fixes +- **typescript-estree:** handle `BigInt` with `_` numeric separator ([#2067](https://github.com/typescript-eslint/typescript-eslint/issues/2067)) ([66f1627](https://github.com/typescript-eslint/typescript-eslint/commit/66f1627b11a566d5b925a577e800f99d5c808be2)) # [3.0.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.34.0...v3.0.0) (2020-05-21) @@ -1062,471 +703,264 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline ### Bug Fixes -* **typescript-estree:** use `TSEmptyBodyFunctionExpression` for body-less nodes ([#1289](https://github.com/typescript-eslint/typescript-eslint/issues/1289)) ([82e7163](https://github.com/typescript-eslint/typescript-eslint/commit/82e7163214b56ccde93ba97807b161669a50a60b)) - +- **typescript-estree:** use `TSEmptyBodyFunctionExpression` for body-less nodes ([#1289](https://github.com/typescript-eslint/typescript-eslint/issues/1289)) ([82e7163](https://github.com/typescript-eslint/typescript-eslint/commit/82e7163214b56ccde93ba97807b161669a50a60b)) ### Features -* add index files to parser and typescript-estree ([3dfc46d](https://github.com/typescript-eslint/typescript-eslint/commit/3dfc46dccbbd28eed2d74c7b6cacddf1a0848598)) -* **experimental-utils:** upgrade eslint types for v7 ([#2023](https://github.com/typescript-eslint/typescript-eslint/issues/2023)) ([06869c9](https://github.com/typescript-eslint/typescript-eslint/commit/06869c9656fa37936126666845aee40aad546ebd)) -* upgrade to ESLint v7 ([#2022](https://github.com/typescript-eslint/typescript-eslint/issues/2022)) ([208de71](https://github.com/typescript-eslint/typescript-eslint/commit/208de71059746bf38e94bd460346ffb2698a3e12)) -* **typescript-estree:** align nodes with estree 2020 ([#1389](https://github.com/typescript-eslint/typescript-eslint/issues/1389)) ([aff5b62](https://github.com/typescript-eslint/typescript-eslint/commit/aff5b62044f9b93f2087a1d261e9be3f8d6fd54d)) -* **typescript-estree:** align optional fields ([#1429](https://github.com/typescript-eslint/typescript-eslint/issues/1429)) ([0e0010f](https://github.com/typescript-eslint/typescript-eslint/commit/0e0010f82952f9beeeb84136eea00cc5eecc9db6)) -* drop support for node v8 ([#1997](https://github.com/typescript-eslint/typescript-eslint/issues/1997)) ([b6c3b7b](https://github.com/typescript-eslint/typescript-eslint/commit/b6c3b7b84b8d199fa75a46432febd4a364a63217)) -* **eslint-plugin:** [ban-types] rework default options ([#848](https://github.com/typescript-eslint/typescript-eslint/issues/848)) ([8e31d5d](https://github.com/typescript-eslint/typescript-eslint/commit/8e31d5dbe9fe5227fdbefcecfd50ce5dd51360c3)) -* **typescript-estree:** handle 3.9's non-null assertion changes ([#2036](https://github.com/typescript-eslint/typescript-eslint/issues/2036)) ([06bec63](https://github.com/typescript-eslint/typescript-eslint/commit/06bec63c56536db070608ab136d2ad57083f0c6a)) - - - - +- add index files to parser and typescript-estree ([3dfc46d](https://github.com/typescript-eslint/typescript-eslint/commit/3dfc46dccbbd28eed2d74c7b6cacddf1a0848598)) +- **experimental-utils:** upgrade eslint types for v7 ([#2023](https://github.com/typescript-eslint/typescript-eslint/issues/2023)) ([06869c9](https://github.com/typescript-eslint/typescript-eslint/commit/06869c9656fa37936126666845aee40aad546ebd)) +- upgrade to ESLint v7 ([#2022](https://github.com/typescript-eslint/typescript-eslint/issues/2022)) ([208de71](https://github.com/typescript-eslint/typescript-eslint/commit/208de71059746bf38e94bd460346ffb2698a3e12)) +- **typescript-estree:** align nodes with estree 2020 ([#1389](https://github.com/typescript-eslint/typescript-eslint/issues/1389)) ([aff5b62](https://github.com/typescript-eslint/typescript-eslint/commit/aff5b62044f9b93f2087a1d261e9be3f8d6fd54d)) +- **typescript-estree:** align optional fields ([#1429](https://github.com/typescript-eslint/typescript-eslint/issues/1429)) ([0e0010f](https://github.com/typescript-eslint/typescript-eslint/commit/0e0010f82952f9beeeb84136eea00cc5eecc9db6)) +- drop support for node v8 ([#1997](https://github.com/typescript-eslint/typescript-eslint/issues/1997)) ([b6c3b7b](https://github.com/typescript-eslint/typescript-eslint/commit/b6c3b7b84b8d199fa75a46432febd4a364a63217)) +- **eslint-plugin:** [ban-types] rework default options ([#848](https://github.com/typescript-eslint/typescript-eslint/issues/848)) ([8e31d5d](https://github.com/typescript-eslint/typescript-eslint/commit/8e31d5dbe9fe5227fdbefcecfd50ce5dd51360c3)) +- **typescript-estree:** handle 3.9's non-null assertion changes ([#2036](https://github.com/typescript-eslint/typescript-eslint/issues/2036)) ([06bec63](https://github.com/typescript-eslint/typescript-eslint/commit/06bec63c56536db070608ab136d2ad57083f0c6a)) # [2.34.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.33.0...v2.34.0) (2020-05-18) **Note:** Version bump only for package @typescript-eslint/parser - - - - # [2.33.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.32.0...v2.33.0) (2020-05-12) **Note:** Version bump only for package @typescript-eslint/parser - - - - # [2.32.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.31.0...v2.32.0) (2020-05-11) - ### Features -* bump dependencies and align AST ([#2007](https://github.com/typescript-eslint/typescript-eslint/issues/2007)) ([18668b7](https://github.com/typescript-eslint/typescript-eslint/commit/18668b78fd7d1e5281af7fc26c76e0ca53297f69)) - - - - +- bump dependencies and align AST ([#2007](https://github.com/typescript-eslint/typescript-eslint/issues/2007)) ([18668b7](https://github.com/typescript-eslint/typescript-eslint/commit/18668b78fd7d1e5281af7fc26c76e0ca53297f69)) # [2.31.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.30.0...v2.31.0) (2020-05-04) **Note:** Version bump only for package @typescript-eslint/parser - - - - # [2.30.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.29.0...v2.30.0) (2020-04-27) **Note:** Version bump only for package @typescript-eslint/parser - - - - # [2.29.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.28.0...v2.29.0) (2020-04-20) **Note:** Version bump only for package @typescript-eslint/parser - - - - # [2.28.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.27.0...v2.28.0) (2020-04-13) **Note:** Version bump only for package @typescript-eslint/parser - - - - # [2.27.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.26.0...v2.27.0) (2020-04-06) **Note:** Version bump only for package @typescript-eslint/parser - - - - # [2.26.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.25.0...v2.26.0) (2020-03-30) - ### Features -* **typescript-estree:** add option to ignore certain folders from glob resolution ([#1802](https://github.com/typescript-eslint/typescript-eslint/issues/1802)) ([1e29e69](https://github.com/typescript-eslint/typescript-eslint/commit/1e29e69b289d61107a7de67592beae331ba50222)) - - - - +- **typescript-estree:** add option to ignore certain folders from glob resolution ([#1802](https://github.com/typescript-eslint/typescript-eslint/issues/1802)) ([1e29e69](https://github.com/typescript-eslint/typescript-eslint/commit/1e29e69b289d61107a7de67592beae331ba50222)) # [2.25.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.24.0...v2.25.0) (2020-03-23) **Note:** Version bump only for package @typescript-eslint/parser - - - - # [2.24.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.23.0...v2.24.0) (2020-03-16) - ### Features -* **typescript-estree:** support 3.8 `export * as ns` ([#1698](https://github.com/typescript-eslint/typescript-eslint/issues/1698)) ([133f622](https://github.com/typescript-eslint/typescript-eslint/commit/133f622f38a286eac45288a9789d2ee529d5e582)) - - - - +- **typescript-estree:** support 3.8 `export * as ns` ([#1698](https://github.com/typescript-eslint/typescript-eslint/issues/1698)) ([133f622](https://github.com/typescript-eslint/typescript-eslint/commit/133f622f38a286eac45288a9789d2ee529d5e582)) # [2.23.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.22.0...v2.23.0) (2020-03-09) - ### Features -* **typescript-estree:** support 3.8 import/export type ([#1697](https://github.com/typescript-eslint/typescript-eslint/issues/1697)) ([625d603](https://github.com/typescript-eslint/typescript-eslint/commit/625d603f94bf0521f834313bf31c734ce4948b7a)) - - - - +- **typescript-estree:** support 3.8 import/export type ([#1697](https://github.com/typescript-eslint/typescript-eslint/issues/1697)) ([625d603](https://github.com/typescript-eslint/typescript-eslint/commit/625d603f94bf0521f834313bf31c734ce4948b7a)) # [2.22.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.21.0...v2.22.0) (2020-03-02) **Note:** Version bump only for package @typescript-eslint/parser - - - - # [2.21.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.20.0...v2.21.0) (2020-02-24) **Note:** Version bump only for package @typescript-eslint/parser - - - - # [2.20.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.19.2...v2.20.0) (2020-02-17) **Note:** Version bump only for package @typescript-eslint/parser - - - - ## [2.19.2](https://github.com/typescript-eslint/typescript-eslint/compare/v2.19.1...v2.19.2) (2020-02-10) **Note:** Version bump only for package @typescript-eslint/parser - - - - ## [2.19.1](https://github.com/typescript-eslint/typescript-eslint/compare/v2.19.0...v2.19.1) (2020-02-10) **Note:** Version bump only for package @typescript-eslint/parser - - - - # [2.19.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.18.0...v2.19.0) (2020-02-03) **Note:** Version bump only for package @typescript-eslint/parser - - - - # [2.18.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.17.0...v2.18.0) (2020-01-27) - ### Bug Fixes -* **typescript-estree:** fix identifier tokens typed as `Keyword` ([#1487](https://github.com/typescript-eslint/typescript-eslint/issues/1487)) ([77a1caa](https://github.com/typescript-eslint/typescript-eslint/commit/77a1caa562638645b4717449800e410107d512c8)) - +- **typescript-estree:** fix identifier tokens typed as `Keyword` ([#1487](https://github.com/typescript-eslint/typescript-eslint/issues/1487)) ([77a1caa](https://github.com/typescript-eslint/typescript-eslint/commit/77a1caa562638645b4717449800e410107d512c8)) ### Features -* **eslint-plugin:** add new rule prefer-as-const ([#1431](https://github.com/typescript-eslint/typescript-eslint/issues/1431)) ([420db96](https://github.com/typescript-eslint/typescript-eslint/commit/420db96921435e8bf7fb484ae74552a912a6adde)) -* **parser:** clean up scope-analysis types ([#1481](https://github.com/typescript-eslint/typescript-eslint/issues/1481)) ([4a727fa](https://github.com/typescript-eslint/typescript-eslint/commit/4a727fa083d749dba9eaf39322856f5f69c28cd8)) - - - - +- **eslint-plugin:** add new rule prefer-as-const ([#1431](https://github.com/typescript-eslint/typescript-eslint/issues/1431)) ([420db96](https://github.com/typescript-eslint/typescript-eslint/commit/420db96921435e8bf7fb484ae74552a912a6adde)) +- **parser:** clean up scope-analysis types ([#1481](https://github.com/typescript-eslint/typescript-eslint/issues/1481)) ([4a727fa](https://github.com/typescript-eslint/typescript-eslint/commit/4a727fa083d749dba9eaf39322856f5f69c28cd8)) # [2.17.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.16.0...v2.17.0) (2020-01-20) **Note:** Version bump only for package @typescript-eslint/parser - - - - # [2.16.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.15.0...v2.16.0) (2020-01-13) - ### Bug Fixes -* **typescript-estree:** resolve path relative to tsconfigRootDir ([#1439](https://github.com/typescript-eslint/typescript-eslint/issues/1439)) ([c709056](https://github.com/typescript-eslint/typescript-eslint/commit/c709056)) - - - - +- **typescript-estree:** resolve path relative to tsconfigRootDir ([#1439](https://github.com/typescript-eslint/typescript-eslint/issues/1439)) ([c709056](https://github.com/typescript-eslint/typescript-eslint/commit/c709056)) # [2.15.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.14.0...v2.15.0) (2020-01-06) **Note:** Version bump only for package @typescript-eslint/parser - - - - # [2.14.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.13.0...v2.14.0) (2019-12-30) - ### Bug Fixes -* **typescript-estree:** visit typeParameters in OptionalCallExpr ([#1377](https://github.com/typescript-eslint/typescript-eslint/issues/1377)) ([cba6a2a](https://github.com/typescript-eslint/typescript-eslint/commit/cba6a2a)) - - - - +- **typescript-estree:** visit typeParameters in OptionalCallExpr ([#1377](https://github.com/typescript-eslint/typescript-eslint/issues/1377)) ([cba6a2a](https://github.com/typescript-eslint/typescript-eslint/commit/cba6a2a)) # [2.13.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.12.0...v2.13.0) (2019-12-23) - ### Features -* **typescript-estree:** computed members discriminated unions ([#1349](https://github.com/typescript-eslint/typescript-eslint/issues/1349)) ([013df9a](https://github.com/typescript-eslint/typescript-eslint/commit/013df9a)) - - - - +- **typescript-estree:** computed members discriminated unions ([#1349](https://github.com/typescript-eslint/typescript-eslint/issues/1349)) ([013df9a](https://github.com/typescript-eslint/typescript-eslint/commit/013df9a)) # [2.12.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.11.0...v2.12.0) (2019-12-16) **Note:** Version bump only for package @typescript-eslint/parser - - - - # [2.11.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.10.0...v2.11.0) (2019-12-09) **Note:** Version bump only for package @typescript-eslint/parser - - - - # [2.10.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.9.0...v2.10.0) (2019-12-02) **Note:** Version bump only for package @typescript-eslint/parser - - - - # [2.9.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.8.0...v2.9.0) (2019-11-25) **Note:** Version bump only for package @typescript-eslint/parser - - - - # [2.8.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.7.0...v2.8.0) (2019-11-18) - ### Bug Fixes -* **typescript-estree:** options range loc being always true ([#704](https://github.com/typescript-eslint/typescript-eslint/issues/704)) ([db1aa18](https://github.com/typescript-eslint/typescript-eslint/commit/db1aa18)) - - - - +- **typescript-estree:** options range loc being always true ([#704](https://github.com/typescript-eslint/typescript-eslint/issues/704)) ([db1aa18](https://github.com/typescript-eslint/typescript-eslint/commit/db1aa18)) # [2.7.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.6.1...v2.7.0) (2019-11-11) - ### Features -* **parser:** handle optional chaining in scope analysis ([#1169](https://github.com/typescript-eslint/typescript-eslint/issues/1169)) ([026ceb9](https://github.com/typescript-eslint/typescript-eslint/commit/026ceb9)) - - - - +- **parser:** handle optional chaining in scope analysis ([#1169](https://github.com/typescript-eslint/typescript-eslint/issues/1169)) ([026ceb9](https://github.com/typescript-eslint/typescript-eslint/commit/026ceb9)) ## [2.6.1](https://github.com/typescript-eslint/typescript-eslint/compare/v2.6.0...v2.6.1) (2019-11-04) - ### Bug Fixes -* **typescript-estree:** fix filename handling for vue JSX + markdown ([#1127](https://github.com/typescript-eslint/typescript-eslint/issues/1127)) ([366518f](https://github.com/typescript-eslint/typescript-eslint/commit/366518f)) - - - - +- **typescript-estree:** fix filename handling for vue JSX + markdown ([#1127](https://github.com/typescript-eslint/typescript-eslint/issues/1127)) ([366518f](https://github.com/typescript-eslint/typescript-eslint/commit/366518f)) # [2.6.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.5.0...v2.6.0) (2019-10-28) - ### Bug Fixes -* **typescript-estree:** correct parenthesized optional chain AST ([#1141](https://github.com/typescript-eslint/typescript-eslint/issues/1141)) ([5ae286e](https://github.com/typescript-eslint/typescript-eslint/commit/5ae286e)) - +- **typescript-estree:** correct parenthesized optional chain AST ([#1141](https://github.com/typescript-eslint/typescript-eslint/issues/1141)) ([5ae286e](https://github.com/typescript-eslint/typescript-eslint/commit/5ae286e)) ### Features -* **typescript-estree:** add support for declare class properties ([#1136](https://github.com/typescript-eslint/typescript-eslint/issues/1136)) ([1508670](https://github.com/typescript-eslint/typescript-eslint/commit/1508670)) - - - - +- **typescript-estree:** add support for declare class properties ([#1136](https://github.com/typescript-eslint/typescript-eslint/issues/1136)) ([1508670](https://github.com/typescript-eslint/typescript-eslint/commit/1508670)) # [2.5.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.4.0...v2.5.0) (2019-10-21) **Note:** Version bump only for package @typescript-eslint/parser - - - - # [2.4.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.3.3...v2.4.0) (2019-10-14) - ### Bug Fixes -* support long running "watch" lint sessions ([#973](https://github.com/typescript-eslint/typescript-eslint/issues/973)) ([854620e](https://github.com/typescript-eslint/typescript-eslint/commit/854620e)) - +- support long running "watch" lint sessions ([#973](https://github.com/typescript-eslint/typescript-eslint/issues/973)) ([854620e](https://github.com/typescript-eslint/typescript-eslint/commit/854620e)) ### Features -* **typescript-estree:** support for parsing 3.7 features ([#1045](https://github.com/typescript-eslint/typescript-eslint/issues/1045)) ([623febf](https://github.com/typescript-eslint/typescript-eslint/commit/623febf)) - - - - +- **typescript-estree:** support for parsing 3.7 features ([#1045](https://github.com/typescript-eslint/typescript-eslint/issues/1045)) ([623febf](https://github.com/typescript-eslint/typescript-eslint/commit/623febf)) ## [2.3.3](https://github.com/typescript-eslint/typescript-eslint/compare/v2.3.2...v2.3.3) (2019-10-07) **Note:** Version bump only for package @typescript-eslint/parser - - - - ## [2.3.2](https://github.com/typescript-eslint/typescript-eslint/compare/v2.3.1...v2.3.2) (2019-09-30) - ### Bug Fixes -* **typescript-estree:** handle optional computed prop w/o type ([#1026](https://github.com/typescript-eslint/typescript-eslint/issues/1026)) ([95c13fe](https://github.com/typescript-eslint/typescript-eslint/commit/95c13fe)) - - - - +- **typescript-estree:** handle optional computed prop w/o type ([#1026](https://github.com/typescript-eslint/typescript-eslint/issues/1026)) ([95c13fe](https://github.com/typescript-eslint/typescript-eslint/commit/95c13fe)) ## [2.3.1](https://github.com/typescript-eslint/typescript-eslint/compare/v2.3.0...v2.3.1) (2019-09-23) - ### Bug Fixes -* **typescript-estree:** parsing error for await in non-async func ([#988](https://github.com/typescript-eslint/typescript-eslint/issues/988)) ([19abbe0](https://github.com/typescript-eslint/typescript-eslint/commit/19abbe0)) - - - - +- **typescript-estree:** parsing error for await in non-async func ([#988](https://github.com/typescript-eslint/typescript-eslint/issues/988)) ([19abbe0](https://github.com/typescript-eslint/typescript-eslint/commit/19abbe0)) # [2.3.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.2.0...v2.3.0) (2019-09-16) **Note:** Version bump only for package @typescript-eslint/parser - - - - # [2.2.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.1.0...v2.2.0) (2019-09-09) **Note:** Version bump only for package @typescript-eslint/parser - - - - # [2.1.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.0.0...v2.1.0) (2019-09-02) - ### Bug Fixes -* **typescript-estree:** improve missing project file error msg ([#866](https://github.com/typescript-eslint/typescript-eslint/issues/866)) ([8f3b0a8](https://github.com/typescript-eslint/typescript-eslint/commit/8f3b0a8)), closes [#853](https://github.com/typescript-eslint/typescript-eslint/issues/853) - +- **typescript-estree:** improve missing project file error msg ([#866](https://github.com/typescript-eslint/typescript-eslint/issues/866)) ([8f3b0a8](https://github.com/typescript-eslint/typescript-eslint/commit/8f3b0a8)), closes [#853](https://github.com/typescript-eslint/typescript-eslint/issues/853) ### Features -* **typescript-estree:** Accept a glob pattern for `options.project` ([#806](https://github.com/typescript-eslint/typescript-eslint/issues/806)) ([9e5f21e](https://github.com/typescript-eslint/typescript-eslint/commit/9e5f21e)) - - - - +- **typescript-estree:** Accept a glob pattern for `options.project` ([#806](https://github.com/typescript-eslint/typescript-eslint/issues/806)) ([9e5f21e](https://github.com/typescript-eslint/typescript-eslint/commit/9e5f21e)) # [2.0.0](https://github.com/typescript-eslint/typescript-eslint/compare/v1.13.0...v2.0.0) (2019-08-13) - -* feat(eslint-plugin)!: change recommended config (#729) ([428567d](https://github.com/typescript-eslint/typescript-eslint/commit/428567d)), closes [#729](https://github.com/typescript-eslint/typescript-eslint/issues/729) -* feat(typescript-estree)!: throw error on file not in project when `project` set (#760) ([3777b77](https://github.com/typescript-eslint/typescript-eslint/commit/3777b77)), closes [#760](https://github.com/typescript-eslint/typescript-eslint/issues/760) - +- feat(eslint-plugin)!: change recommended config (#729) ([428567d](https://github.com/typescript-eslint/typescript-eslint/commit/428567d)), closes [#729](https://github.com/typescript-eslint/typescript-eslint/issues/729) +- feat(typescript-estree)!: throw error on file not in project when `project` set (#760) ([3777b77](https://github.com/typescript-eslint/typescript-eslint/commit/3777b77)), closes [#760](https://github.com/typescript-eslint/typescript-eslint/issues/760) ### Bug Fixes -* **typescript-estree:** fix `is` token typed as `Keyword ([#750](https://github.com/typescript-eslint/typescript-eslint/issues/750)) ([35dec52](https://github.com/typescript-eslint/typescript-eslint/commit/35dec52)) -* **typescript-estree:** jsx comment parsing ([#703](https://github.com/typescript-eslint/typescript-eslint/issues/703)) ([0cfc48e](https://github.com/typescript-eslint/typescript-eslint/commit/0cfc48e)) - +- **typescript-estree:** fix `is` token typed as `Keyword ([#750](https://github.com/typescript-eslint/typescript-eslint/issues/750)) ([35dec52](https://github.com/typescript-eslint/typescript-eslint/commit/35dec52)) +- **typescript-estree:** jsx comment parsing ([#703](https://github.com/typescript-eslint/typescript-eslint/issues/703)) ([0cfc48e](https://github.com/typescript-eslint/typescript-eslint/commit/0cfc48e)) ### Features -* explicitly support eslint v6 ([#645](https://github.com/typescript-eslint/typescript-eslint/issues/645)) ([34a7cf6](https://github.com/typescript-eslint/typescript-eslint/commit/34a7cf6)) - +- explicitly support eslint v6 ([#645](https://github.com/typescript-eslint/typescript-eslint/issues/645)) ([34a7cf6](https://github.com/typescript-eslint/typescript-eslint/commit/34a7cf6)) ### BREAKING CHANGES -* recommended config changes are considered breaking -* by default we will now throw when a file is not in the `project` provided -* Node 6 is no longer supported - - - - +- recommended config changes are considered breaking +- by default we will now throw when a file is not in the `project` provided +- Node 6 is no longer supported # [1.13.0](https://github.com/typescript-eslint/typescript-eslint/compare/v1.12.0...v1.13.0) (2019-07-21) **Note:** Version bump only for package @typescript-eslint/parser - - - - # [1.12.0](https://github.com/typescript-eslint/typescript-eslint/compare/v1.11.0...v1.12.0) (2019-07-12) - ### Bug Fixes -* **typescript-estree:** fix `async` identifier token typed as `Keyword` ([#681](https://github.com/typescript-eslint/typescript-eslint/issues/681)) ([6de19d3](https://github.com/typescript-eslint/typescript-eslint/commit/6de19d3)) - - - - +- **typescript-estree:** fix `async` identifier token typed as `Keyword` ([#681](https://github.com/typescript-eslint/typescript-eslint/issues/681)) ([6de19d3](https://github.com/typescript-eslint/typescript-eslint/commit/6de19d3)) # [1.11.0](https://github.com/typescript-eslint/typescript-eslint/compare/v1.10.2...v1.11.0) (2019-06-23) - ### Bug Fixes -* **parser:** add simpleTraverse, replaces private ESLint util ([#628](https://github.com/typescript-eslint/typescript-eslint/issues/628)) ([aa206c4](https://github.com/typescript-eslint/typescript-eslint/commit/aa206c4)) -* **typescript-estree:** fix more cases with double slash in JSX text ([#607](https://github.com/typescript-eslint/typescript-eslint/issues/607)) ([34cfa53](https://github.com/typescript-eslint/typescript-eslint/commit/34cfa53)) - - - - +- **parser:** add simpleTraverse, replaces private ESLint util ([#628](https://github.com/typescript-eslint/typescript-eslint/issues/628)) ([aa206c4](https://github.com/typescript-eslint/typescript-eslint/commit/aa206c4)) +- **typescript-estree:** fix more cases with double slash in JSX text ([#607](https://github.com/typescript-eslint/typescript-eslint/issues/607)) ([34cfa53](https://github.com/typescript-eslint/typescript-eslint/commit/34cfa53)) ## [1.10.2](https://github.com/typescript-eslint/typescript-eslint/compare/v1.10.1...v1.10.2) (2019-06-10) diff --git a/packages/parser/LICENSE b/packages/parser/LICENSE index a2d896685ac..dc04d8c91c0 100644 --- a/packages/parser/LICENSE +++ b/packages/parser/LICENSE @@ -4,11 +4,11 @@ Copyright JS Foundation and other contributors, https://js.foundation Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. +- Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +- Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE diff --git a/packages/parser/README.md b/packages/parser/README.md index 3488cd5e505..f057b97f868 100644 --- a/packages/parser/README.md +++ b/packages/parser/README.md @@ -1,302 +1,10 @@ -

TypeScript ESLint Parser

+# `@typescript-eslint/parser` -

An ESLint parser which leverages TypeScript ESTree to allow for ESLint to lint TypeScript source code.

+> An ESLint parser which leverages TypeScript ESTree to allow for ESLint to lint TypeScript source code. -

- CI - NPM Version - NPM Downloads -

+[![NPM Version](https://img.shields.io/npm/v/@typescript-eslint/parser.svg?style=flat-square)](https://www.npmjs.com/package/@typescript-eslint/parser) +[![NPM Downloads](https://img.shields.io/npm/dm/@typescript-eslint/parser.svg?style=flat-square)](https://www.npmjs.com/package/@typescript-eslint/parser) -## Getting Started +👉 See **https://typescript-eslint.io/architecture/parser** for documentation on this package. -**[You can find our Getting Started docs here](https://typescript-eslint.io/docs/linting)** - -These docs walk you through setting up ESLint, this parser, and our plugin. If you know what you're doing and just want to quick start, read on... - -## Quick-start - -### Installation - -```bash -$ yarn add -D typescript @typescript-eslint/parser -$ npm i --save-dev typescript @typescript-eslint/parser -``` - -### Usage - -In your ESLint configuration file, set the `parser` property: - -```json -{ - "parser": "@typescript-eslint/parser" -} -``` - -There is sometimes an incorrect assumption that the parser itself is what does everything necessary to facilitate the use of ESLint with TypeScript. In actuality, it is the combination of the parser _and_ one or more plugins which allow you to maximize your usage of ESLint with TypeScript. - -For example, once this parser successfully produces an AST for the TypeScript source code, it might well contain some information which simply does not exist in a standard JavaScript context, such as the data for a TypeScript-specific construct, like an `interface`. - -The core rules built into ESLint, such as `indent` have no knowledge of such constructs, so it is impossible to expect them to work out of the box with them. - -Instead, you also need to make use of one more plugins which will add or extend rules with TypeScript-specific features. - -By far the most common case will be installing the [`@typescript-eslint/eslint-plugin`](https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/eslint-plugin) plugin, but there are also other relevant options available such a [`@typescript-eslint/eslint-plugin-tslint`](https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/eslint-plugin-tslint). - -## Configuration - -The following additional configuration options are available by specifying them in [`parserOptions`](https://eslint.org/docs/user-guide/configuring/language-options#specifying-parser-options) in your ESLint configuration file. - -```ts -interface ParserOptions { - ecmaFeatures?: { - jsx?: boolean; - globalReturn?: boolean; - }; - ecmaVersion?: number | 'latest'; - - jsxPragma?: string | null; - jsxFragmentName?: string | null; - lib?: string[]; - - project?: string | string[]; - projectFolderIgnoreList?: string[]; - tsconfigRootDir?: string; - extraFileExtensions?: string[]; - warnOnUnsupportedTypeScriptVersion?: boolean; - - program?: import('typescript').Program; - moduleResolver?: string; - - emitDecoratorMetadata?: boolean; -} -``` - -### `parserOptions.ecmaFeatures.jsx` - -Default `false`. - -Enable parsing JSX when `true`. More details can be found [here](https://www.typescriptlang.org/docs/handbook/jsx.html). - -**NOTE:** this setting does not affect known file types (`.js`, `.mjs`, `.cjs`, `.jsx`, `.ts`, `.mts`, `.cts`, `.tsx`, `.json`) because the TypeScript compiler has its own internal handling for known file extensions. - - - -The exact behavior is as follows: - -- `.js`, `.mjs`, `.cjs`, `.jsx`, `.tsx` files are always parsed as if this is `true`. -- `.ts`, `.mts`, `.cts` files are always parsed as if this is `false`. -- For "unknown" extensions (`.md`, `.vue`): - - If `parserOptions.project` is _not_ provided: - - The setting will be respected. - - If `parserOptions.project` is provided (i.e. you are using rules with type information): - - **always parsed as if this is `false`** - -### `parserOptions.ecmaFeatures.globalReturn` - -Default `false`. - -This options allows you to tell the parser if you want to allow global `return` statements in your codebase. - -### `parserOptions.ecmaVersion` - -Default `2018`. - -Accepts any valid ECMAScript version number or `'latest'`: - -- A version: es3, es5, es6, es7, es8, es9, es10, es11, es12, es13, ..., or -- A year: es2015, es2016, es2017, es2018, es2019, es2020, es2021, es2022, ..., or -- `'latest'` - -When it's a version or a year, the value **must** be a number - so do not include the `es` prefix. - -Specifies the version of ECMAScript syntax you want to use. This is used by the parser to determine how to perform scope analysis, and it affects the default - -### `parserOptions.jsxPragma` - -Default `'React'` - -The identifier that's used for JSX Elements creation (after transpilation). -If you're using a library other than React (like `preact`), then you should change this value. If you are using the [new JSX transform](https://reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html) you can set this to `null`. - -This should not be a member expression - just the root identifier (i.e. use `"React"` instead of `"React.createElement"`). - -If you provide `parserOptions.project`, you do not need to set this, as it will automatically detected from the compiler. - -### `parserOptions.jsxFragmentName` - -Default `null` - -The identifier that's used for JSX fragment elements (after transpilation). -If `null`, assumes transpilation will always use a member of the configured `jsxPragma`. -This should not be a member expression - just the root identifier (i.e. use `"h"` instead of `"h.Fragment"`). - -If you provide `parserOptions.project`, you do not need to set this, as it will automatically detected from the compiler. - -### `parserOptions.lib` - -Default `['es2018']` - -For valid options, see the [TypeScript compiler options](https://www.typescriptlang.org/tsconfig#lib). - -Specifies the TypeScript `lib`s that are available. This is used by the scope analyser to ensure there are global variables declared for the types exposed by TypeScript. - -If you provide `parserOptions.project`, you do not need to set this, as it will automatically detected from the compiler. - -### `parserOptions.project` - -Default `undefined`. - -This option allows you to provide a path to your project's `tsconfig.json`. **This setting is required if you want to use rules which require type information**. Relative paths are interpreted relative to the current working directory if `tsconfigRootDir` is not set. If you intend on running ESLint from directories other than the project root, you should consider using `tsconfigRootDir`. - -- Accepted values: - - ```js - // path - project: './tsconfig.json'; - - // glob pattern - project: './packages/**/tsconfig.json'; - - // array of paths and/or glob patterns - project: ['./packages/**/tsconfig.json', './separate-package/tsconfig.json']; - ``` - -- If you use project references, TypeScript will not automatically use project references to resolve files. This means that you will have to add each referenced tsconfig to the `project` field either separately, or via a glob. - -- TypeScript will ignore files with duplicate filenames in the same folder (for example, `src/file.ts` and `src/file.js`). TypeScript purposely ignore all but one of the files, only keeping the one file with the highest priority extension (the extension priority order (from highest to lowest) is `.ts`, `.tsx`, `.d.ts`, `.js`, `.jsx`). For more info see #955. - -- Note that if this setting is specified and `createDefaultProgram` is not, you must only lint files that are included in the projects as defined by the provided `tsconfig.json` files. If your existing configuration does not include all of the files you would like to lint, you can create a separate `tsconfig.eslint.json` as follows: - - ```jsonc - { - // extend your base config so you don't have to redefine your compilerOptions - "extends": "./tsconfig.json", - "include": [ - "src/**/*.ts", - "test/**/*.ts", - "typings/**/*.ts", - // etc - - // if you have a mixed JS/TS codebase, don't forget to include your JS files - "src/**/*.js" - ] - } - ``` - -### `parserOptions.tsconfigRootDir` - -Default `undefined`. - -This option allows you to provide the root directory for relative tsconfig paths specified in the `project` option above. - -### `parserOptions.projectFolderIgnoreList` - -Default `["**/node_modules/**"]`. - -This option allows you to ignore folders from being included in your provided list of `project`s. -This is useful if you have configured glob patterns, but want to make sure you ignore certain folders. - -It accepts an array of globs to exclude from the `project` globs. - -For example, by default it will ensure that a glob like `./**/tsconfig.json` will not match any `tsconfig`s within your `node_modules` folder (some npm packages do not exclude their source files from their published packages). - -### `parserOptions.extraFileExtensions` - -Default `undefined`. - -This option allows you to provide one or more additional file extensions which should be considered in the TypeScript Program compilation. -The default extensions are `['.js', '.mjs', '.cjs', '.jsx', '.ts', '.mts', '.cts', '.tsx']`. -Add extensions starting with `.`, followed by the file extension. E.g. for a `.vue` file use `"extraFileExtensions": [".vue"]`. - -### `parserOptions.warnOnUnsupportedTypeScriptVersion` - -Default `true`. - -This option allows you to toggle the warning that the parser will give you if you use a version of TypeScript which is not explicitly supported - -### `parserOptions.createDefaultProgram` - -Default `false`. - -This option allows you to request that when the `project` setting is specified, files will be allowed when not included in the projects defined by the provided `tsconfig.json` files. **Using this option will incur significant performance costs. This option is primarily included for backwards-compatibility.** See the **`project`** section above for more information. - -### `parserOptions.programs` - -Default `undefined`. - -This option allows you to programmatically provide an array of one or more instances of a TypeScript Program object that will provide type information to rules. -This will override any programs that would have been computed from `parserOptions.project` or `parserOptions.createDefaultProgram`. -All linted files must be part of the provided program(s). - -### `parserOptions.moduleResolver` - -Default `undefined`. - -This option allows you to provide a custom module resolution. The value should point to a JS file that default exports (`export default`, or `module.exports =`, or `export =`) a file with the following interface: - -```ts -interface ModuleResolver { - version: 1; - resolveModuleNames( - moduleNames: string[], - containingFile: string, - reusedNames: string[] | undefined, - redirectedReference: ts.ResolvedProjectReference | undefined, - options: ts.CompilerOptions, - ): (ts.ResolvedModule | undefined)[]; -} -``` - -[Refer to the TypeScript Wiki for an example on how to write the `resolveModuleNames` function](https://github.com/Microsoft/TypeScript/wiki/Using-the-Compiler-API#customizing-module-resolution). - -Note that if you pass custom programs via `options.programs` this option will not have any effect over them (you can simply add the custom resolution on them directly). - -### `parserOptions.emitDecoratorMetadata` - -Default `undefined`. - -This option allow you to tell parser to act as if `emitDecoratorMetadata: true` is set in `tsconfig.json`, but without [type-aware linting](https://typescript-eslint.io/docs/linting/typed-linting). In other words, you don't have to specify `parserOptions.project` in this case, making the linting process faster. - -## Utilities - -### `createProgram(configFile, projectDirectory)` - -This serves as a utility method for users of the `parserOptions.programs` feature to create a TypeScript program instance from a config file. - -```ts -declare function createProgram( - configFile: string, - projectDirectory?: string, -): import('typescript').Program; -``` - -Example usage in .eslintrc.js: - -```js -const parser = require('@typescript-eslint/parser'); -const programs = [parser.createProgram('tsconfig.json')]; -module.exports = { - parserOptions: { - programs, - }, -}; -``` - -## Supported TypeScript Version - -Please see [`typescript-eslint`](https://github.com/typescript-eslint/typescript-eslint) for the supported TypeScript version. - -**Please ensure that you are using a supported version before submitting any issues/bug reports.** - -## Reporting Issues - -Please use the `@typescript-eslint/parser` issue template when creating your issue and fill out the information requested as best you can. This will really help us when looking into your issue. - -## License - -TypeScript ESLint Parser is licensed under a permissive BSD 2-clause license. - -## Contributing - -[See the contributing guide here](../../CONTRIBUTING.md) +> See https://typescript-eslint.io for general documentation on typescript-eslint, the tooling that allows you to run ESLint and Prettier on TypeScript code. diff --git a/packages/parser/package.json b/packages/parser/package.json index a7a34bbdb92..72b9df7a210 100644 --- a/packages/parser/package.json +++ b/packages/parser/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/parser", - "version": "5.31.0", + "version": "5.50.0", "description": "An ESLint custom parser which leverages TypeScript ESTree", "main": "dist/index.js", "types": "dist/index.d.ts", @@ -37,7 +37,7 @@ "clean": "tsc -b tsconfig.build.json --clean", "postclean": "rimraf dist && rimraf _ts3.4 && rimraf coverage", "format": "prettier --write \"./**/*.{ts,mts,cts,tsx,js,mjs,cjs,jsx,json,md,css}\" --ignore-path ../../.prettierignore", - "lint": "eslint . --ignore-path='../../.eslintignore'", + "lint": "nx lint", "test": "jest --coverage", "typecheck": "tsc -p tsconfig.json --noEmit" }, @@ -45,9 +45,9 @@ "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" }, "dependencies": { - "@typescript-eslint/scope-manager": "5.31.0", - "@typescript-eslint/types": "5.31.0", - "@typescript-eslint/typescript-estree": "5.31.0", + "@typescript-eslint/scope-manager": "5.50.0", + "@typescript-eslint/types": "5.50.0", + "@typescript-eslint/typescript-estree": "5.50.0", "debug": "^4.3.4" }, "devDependencies": { diff --git a/packages/parser/project.json b/packages/parser/project.json index c9c9e3b6321..39cc9637919 100644 --- a/packages/parser/project.json +++ b/packages/parser/project.json @@ -1,5 +1,15 @@ { - "root": "packages/parser", + "name": "parser", + "$schema": "../../node_modules/nx/schemas/project-schema.json", "type": "library", - "implicitDependencies": [] + "implicitDependencies": [], + "targets": { + "lint": { + "executor": "@nrwl/linter:eslint", + "outputs": ["{options.outputFile}"], + "options": { + "lintFilePatterns": ["packages/parser/**/*.ts"] + } + } + } } diff --git a/packages/parser/src/parser.ts b/packages/parser/src/parser.ts index 94689968cac..f151cbdc143 100644 --- a/packages/parser/src/parser.ts +++ b/packages/parser/src/parser.ts @@ -1,17 +1,21 @@ -import { ParserOptions, TSESTree, Lib } from '@typescript-eslint/types'; -import { - parseAndGenerateServices, +import type { + AnalyzeOptions, + ScopeManager, +} from '@typescript-eslint/scope-manager'; +import { analyze } from '@typescript-eslint/scope-manager'; +import type { Lib, TSESTree } from '@typescript-eslint/types'; +import { ParserOptions } from '@typescript-eslint/types'; +import type { ParserServices, TSESTreeOptions, - visitorKeys, } from '@typescript-eslint/typescript-estree'; import { - analyze, - AnalyzeOptions, - ScopeManager, -} from '@typescript-eslint/scope-manager'; + parseAndGenerateServices, + visitorKeys, +} from '@typescript-eslint/typescript-estree'; import debug from 'debug'; -import { CompilerOptions, ScriptTarget } from 'typescript'; +import type { CompilerOptions } from 'typescript'; +import { ScriptTarget } from 'typescript'; const log = debug('typescript-eslint:parser:parser'); @@ -132,30 +136,28 @@ function parseForESLint( analyzeOptions.lib = getLib(compilerOptions); log('Resolved libs from program: %o', analyzeOptions.lib); } - if (parserOptions.jsx === true) { - if ( - analyzeOptions.jsxPragma === undefined && - compilerOptions.jsxFactory != null - ) { - // in case the user has specified something like "preact.h" - const factory = compilerOptions.jsxFactory.split('.')[0].trim(); - analyzeOptions.jsxPragma = factory; - log('Resolved jsxPragma from program: %s', analyzeOptions.jsxPragma); - } - if ( - analyzeOptions.jsxFragmentName === undefined && - compilerOptions.jsxFragmentFactory != null - ) { - // in case the user has specified something like "preact.Fragment" - const fragFactory = compilerOptions.jsxFragmentFactory - .split('.')[0] - .trim(); - analyzeOptions.jsxFragmentName = fragFactory; - log( - 'Resolved jsxFragmentName from program: %s', - analyzeOptions.jsxFragmentName, - ); - } + if ( + analyzeOptions.jsxPragma === undefined && + compilerOptions.jsxFactory != null + ) { + // in case the user has specified something like "preact.h" + const factory = compilerOptions.jsxFactory.split('.')[0].trim(); + analyzeOptions.jsxPragma = factory; + log('Resolved jsxPragma from program: %s', analyzeOptions.jsxPragma); + } + if ( + analyzeOptions.jsxFragmentName === undefined && + compilerOptions.jsxFragmentFactory != null + ) { + // in case the user has specified something like "preact.Fragment" + const fragFactory = compilerOptions.jsxFragmentFactory + .split('.')[0] + .trim(); + analyzeOptions.jsxFragmentName = fragFactory; + log( + 'Resolved jsxFragmentName from program: %s', + analyzeOptions.jsxFragmentName, + ); } if (compilerOptions.emitDecoratorMetadata === true) { emitDecoratorMetadata = true; diff --git a/packages/parser/tests/lib/__snapshots__/services.ts.snap b/packages/parser/tests/lib/__snapshots__/services.ts.snap index d7af97b5b5d..7dfa8a7b4d4 100644 --- a/packages/parser/tests/lib/__snapshots__/services.ts.snap +++ b/packages/parser/tests/lib/__snapshots__/services.ts.snap @@ -1,43 +1,43 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`services fixtures/isolated-file.src 1`] = ` -Object { - "body": Array [ - Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { +{ + "body": [ + { + "declarations": [ + { + "id": { + "loc": { + "end": { "column": 7, "line": 1, }, - "start": Object { + "start": { "column": 6, "line": 1, }, }, "name": "x", - "range": Array [ + "range": [ 6, 7, ], "type": "Identifier", }, - "init": Object { - "elements": Array [ - Object { - "loc": Object { - "end": Object { + "init": { + "elements": [ + { + "loc": { + "end": { "column": 12, "line": 1, }, - "start": Object { + "start": { "column": 11, "line": 1, }, }, - "range": Array [ + "range": [ 11, 12, ], @@ -45,18 +45,18 @@ Object { "type": "Literal", "value": 3, }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 15, "line": 1, }, - "start": Object { + "start": { "column": 14, "line": 1, }, }, - "range": Array [ + "range": [ 14, 15, ], @@ -64,18 +64,18 @@ Object { "type": "Literal", "value": 4, }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 18, "line": 1, }, - "start": Object { + "start": { "column": 17, "line": 1, }, }, - "range": Array [ + "range": [ 17, 18, ], @@ -84,33 +84,33 @@ Object { "value": 5, }, ], - "loc": Object { - "end": Object { + "loc": { + "end": { "column": 19, "line": 1, }, - "start": Object { + "start": { "column": 10, "line": 1, }, }, - "range": Array [ + "range": [ 10, 19, ], "type": "ArrayExpression", }, - "loc": Object { - "end": Object { + "loc": { + "end": { "column": 19, "line": 1, }, - "start": Object { + "start": { "column": 6, "line": 1, }, }, - "range": Array [ + "range": [ 6, 19, ], @@ -118,232 +118,232 @@ Object { }, ], "kind": "const", - "loc": Object { - "end": Object { + "loc": { + "end": { "column": 20, "line": 1, }, - "start": Object { + "start": { "column": 0, "line": 1, }, }, - "range": Array [ + "range": [ 0, 20, ], "type": "VariableDeclaration", }, ], - "comments": Array [], - "loc": Object { - "end": Object { + "comments": [], + "loc": { + "end": { "column": 0, "line": 2, }, - "start": Object { + "start": { "column": 0, "line": 1, }, }, - "range": Array [ + "range": [ 0, 21, ], "sourceType": "module", - "tokens": Array [ - Object { - "loc": Object { - "end": Object { + "tokens": [ + { + "loc": { + "end": { "column": 5, "line": 1, }, - "start": Object { + "start": { "column": 0, "line": 1, }, }, - "range": Array [ + "range": [ 0, 5, ], "type": "Keyword", "value": "const", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 7, "line": 1, }, - "start": Object { + "start": { "column": 6, "line": 1, }, }, - "range": Array [ + "range": [ 6, 7, ], "type": "Identifier", "value": "x", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 9, "line": 1, }, - "start": Object { + "start": { "column": 8, "line": 1, }, }, - "range": Array [ + "range": [ 8, 9, ], "type": "Punctuator", "value": "=", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 11, "line": 1, }, - "start": Object { + "start": { "column": 10, "line": 1, }, }, - "range": Array [ + "range": [ 10, 11, ], "type": "Punctuator", "value": "[", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 12, "line": 1, }, - "start": Object { + "start": { "column": 11, "line": 1, }, }, - "range": Array [ + "range": [ 11, 12, ], "type": "Numeric", "value": "3", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 13, "line": 1, }, - "start": Object { + "start": { "column": 12, "line": 1, }, }, - "range": Array [ + "range": [ 12, 13, ], "type": "Punctuator", "value": ",", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 15, "line": 1, }, - "start": Object { + "start": { "column": 14, "line": 1, }, }, - "range": Array [ + "range": [ 14, 15, ], "type": "Numeric", "value": "4", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 16, "line": 1, }, - "start": Object { + "start": { "column": 15, "line": 1, }, }, - "range": Array [ + "range": [ 15, 16, ], "type": "Punctuator", "value": ",", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 18, "line": 1, }, - "start": Object { + "start": { "column": 17, "line": 1, }, }, - "range": Array [ + "range": [ 17, 18, ], "type": "Numeric", "value": "5", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 19, "line": 1, }, - "start": Object { + "start": { "column": 18, "line": 1, }, }, - "range": Array [ + "range": [ 18, 19, ], "type": "Punctuator", "value": "]", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 20, "line": 1, }, - "start": Object { + "start": { "column": 19, "line": 1, }, }, - "range": Array [ + "range": [ 19, 20, ], diff --git a/packages/parser/tests/lib/parser.ts b/packages/parser/tests/lib/parser.ts index 096905b23aa..7f2f193e11d 100644 --- a/packages/parser/tests/lib/parser.ts +++ b/packages/parser/tests/lib/parser.ts @@ -1,6 +1,7 @@ -import { ParserOptions } from '@typescript-eslint/types'; -import * as typescriptESTree from '@typescript-eslint/typescript-estree/dist/parser'; import * as scopeManager from '@typescript-eslint/scope-manager/dist/analyze'; +import type { ParserOptions } from '@typescript-eslint/types'; +import * as typescriptESTree from '@typescript-eslint/typescript-estree/dist/parser'; + import { parse, parseForESLint } from '../../src/parser'; describe('parser', () => { diff --git a/packages/parser/tests/lib/services.ts b/packages/parser/tests/lib/services.ts index 4567f5f85a4..89856370621 100644 --- a/packages/parser/tests/lib/services.ts +++ b/packages/parser/tests/lib/services.ts @@ -1,13 +1,14 @@ -import path from 'path'; +import { createProgram } from '@typescript-eslint/typescript-estree'; import fs from 'fs'; import glob from 'glob'; -import { ParserOptions } from '../../src/parser'; +import path from 'path'; + +import type { ParserOptions } from '../../src/parser'; import { createSnapshotTestBlock, formatSnapshotName, testServices, } from '../tools/test-utils'; -import { createProgram } from '@typescript-eslint/typescript-estree'; //------------------------------------------------------------------------------ // Setup diff --git a/packages/parser/tests/lib/tsx.ts b/packages/parser/tests/lib/tsx.ts index aa53fec69bd..40ae54250f6 100644 --- a/packages/parser/tests/lib/tsx.ts +++ b/packages/parser/tests/lib/tsx.ts @@ -1,6 +1,7 @@ +import type { ParserOptions } from '@typescript-eslint/types'; + import { parseForESLint } from '../../src/parser'; import { serializer } from '../tools/ts-error-serializer'; -import type { ParserOptions } from '@typescript-eslint/types'; //------------------------------------------------------------------------------ // Tests diff --git a/packages/parser/tests/tools/test-utils.ts b/packages/parser/tests/tools/test-utils.ts index 6dd679d1fea..f36f37440d7 100644 --- a/packages/parser/tests/tools/test-utils.ts +++ b/packages/parser/tests/tools/test-utils.ts @@ -1,6 +1,7 @@ -import { TSESTree } from '@typescript-eslint/typescript-estree'; +import type { TSESTree } from '@typescript-eslint/typescript-estree'; + +import type { ParserOptions } from '../../src/parser'; import * as parser from '../../src/parser'; -import { ParserOptions } from '../../src/parser'; const defaultConfig = { loc: true, diff --git a/packages/parser/tests/tools/ts-error-serializer.ts b/packages/parser/tests/tools/ts-error-serializer.ts index 3ffcec30b8c..6d24367a526 100644 --- a/packages/parser/tests/tools/ts-error-serializer.ts +++ b/packages/parser/tests/tools/ts-error-serializer.ts @@ -1,5 +1,5 @@ -import type { Plugin } from 'pretty-format'; import { TSError } from '@typescript-eslint/typescript-estree/dist/node-utils'; +import type { Plugin } from 'pretty-format'; export const serializer: Plugin = { test: (val: unknown): val is TSError => val instanceof TSError, diff --git a/packages/parser/tsconfig.build.json b/packages/parser/tsconfig.build.json index 8556d030722..4a72f7a3d46 100644 --- a/packages/parser/tsconfig.build.json +++ b/packages/parser/tsconfig.build.json @@ -8,7 +8,6 @@ }, "include": ["src"], "references": [ - { "path": "../utils/tsconfig.build.json" }, { "path": "../scope-manager/tsconfig.build.json" }, { "path": "../types/tsconfig.build.json" }, { "path": "../typescript-estree/tsconfig.build.json" } diff --git a/packages/parser/tsconfig.json b/packages/parser/tsconfig.json index ae4f11eded6..eebdf92705d 100644 --- a/packages/parser/tsconfig.json +++ b/packages/parser/tsconfig.json @@ -7,7 +7,6 @@ "include": ["src", "tests", "tools"], "exclude": ["tests/fixtures"], "references": [ - { "path": "../utils/tsconfig.build.json" }, { "path": "../scope-manager/tsconfig.build.json" }, { "path": "../types/tsconfig.build.json" }, { "path": "../typescript-estree/tsconfig.build.json" } diff --git a/packages/scope-manager/CHANGELOG.md b/packages/scope-manager/CHANGELOG.md index 8c1b32a851c..4243c56c73e 100644 --- a/packages/scope-manager/CHANGELOG.md +++ b/packages/scope-manager/CHANGELOG.md @@ -3,29 +3,23 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. -# [5.31.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.7...v5.31.0) (2022-07-25) - - -### Bug Fixes - -* **scope-manager:** handle typeParameters of TSInstantiationExpression ([#5355](https://github.com/typescript-eslint/typescript-eslint/issues/5355)) ([2595ccf](https://github.com/typescript-eslint/typescript-eslint/commit/2595ccf67cd5158edbd6bebd9ac2dbd8bbd8b99c)) - +# [5.50.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.49.0...v5.50.0) (2023-01-31) +**Note:** Version bump only for package @typescript-eslint/scope-manager -## [5.30.7](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.6...v5.30.7) (2022-07-18) -### Bug Fixes +# [5.49.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.48.2...v5.49.0) (2023-01-23) -* **scope-manager:** allow visiting of constraint in infer type ([#5331](https://github.com/typescript-eslint/typescript-eslint/issues/5331)) ([b2846a1](https://github.com/typescript-eslint/typescript-eslint/commit/b2846a16777a3aea7b1e6ac9d81b9b6dce0bb874)) +**Note:** Version bump only for package @typescript-eslint/scope-manager -## [5.30.6](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.5...v5.30.6) (2022-07-11) +## [5.48.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.48.1...v5.48.2) (2023-01-16) **Note:** Version bump only for package @typescript-eslint/scope-manager @@ -33,7 +27,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline -## [5.30.5](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.4...v5.30.5) (2022-07-04) +## [5.48.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.48.0...v5.48.1) (2023-01-09) **Note:** Version bump only for package @typescript-eslint/scope-manager @@ -41,1022 +35,694 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline -## [5.30.4](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.3...v5.30.4) (2022-07-03) +# [5.48.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.47.1...v5.48.0) (2023-01-02) **Note:** Version bump only for package @typescript-eslint/scope-manager +## [5.47.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.47.0...v5.47.1) (2022-12-26) +**Note:** Version bump only for package @typescript-eslint/scope-manager - - -## [5.30.3](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.2...v5.30.3) (2022-07-01) +# [5.47.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.46.1...v5.47.0) (2022-12-19) **Note:** Version bump only for package @typescript-eslint/scope-manager +## [5.46.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.46.0...v5.46.1) (2022-12-12) +**Note:** Version bump only for package @typescript-eslint/scope-manager +# [5.46.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.45.1...v5.46.0) (2022-12-08) +**Note:** Version bump only for package @typescript-eslint/scope-manager -## [5.30.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.1...v5.30.2) (2022-07-01) +## [5.45.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.45.0...v5.45.1) (2022-12-05) **Note:** Version bump only for package @typescript-eslint/scope-manager +# [5.45.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.44.0...v5.45.0) (2022-11-28) +### Bug Fixes +- **scope-manager:** add support for TS4.9 satisfies expression ([#6059](https://github.com/typescript-eslint/typescript-eslint/issues/6059)) ([44027db](https://github.com/typescript-eslint/typescript-eslint/commit/44027db379e6e074a16cda2755ef554c2b0a4c5a)) +### Features -## 5.30.1 (2022-07-01) - -**Note:** Version bump only for package @typescript-eslint/scope-manager +- support Auto Accessor syntax ([#5926](https://github.com/typescript-eslint/typescript-eslint/issues/5926)) ([becd1f8](https://github.com/typescript-eslint/typescript-eslint/commit/becd1f8581c0013399dfe71be6c265e96cedb57a)) +# [5.44.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.43.0...v5.44.0) (2022-11-21) +### Features +- update to TypeScript 4.9 ([#5716](https://github.com/typescript-eslint/typescript-eslint/issues/5716)) ([4d744ea](https://github.com/typescript-eslint/typescript-eslint/commit/4d744ea10ba03c66eebcb63e8722e9f0165fbeed)) +# [5.43.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.42.1...v5.43.0) (2022-11-14) -# [5.30.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.29.0...v5.30.0) (2022-06-27) +**Note:** Version bump only for package @typescript-eslint/scope-manager +## [5.42.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.42.0...v5.42.1) (2022-11-07) -### Features +**Note:** Version bump only for package @typescript-eslint/scope-manager -* treat `this` in `typeof this` as a `ThisExpression` ([#4382](https://github.com/typescript-eslint/typescript-eslint/issues/4382)) ([b04b2ce](https://github.com/typescript-eslint/typescript-eslint/commit/b04b2ce1ba90d94718891f2562dd210a6d7b8609)) +# [5.42.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.41.0...v5.42.0) (2022-10-31) +### Features +- **scope-manager:** ignore ECMA version ([#5881](https://github.com/typescript-eslint/typescript-eslint/issues/5881)) ([3b8d449](https://github.com/typescript-eslint/typescript-eslint/commit/3b8d449696c319690536a18a48ef32749dc2f559)) +### Reverts +- Revert "feat(scope-manager): ignore ECMA version" (#5888) ([2ee81df](https://github.com/typescript-eslint/typescript-eslint/commit/2ee81df5a365d82ef4b3dfc124d4ec39c7bcb725)), closes [#5888](https://github.com/typescript-eslint/typescript-eslint/issues/5888) [#5881](https://github.com/typescript-eslint/typescript-eslint/issues/5881) -# [5.29.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.28.0...v5.29.0) (2022-06-20) +# [5.41.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.40.1...v5.41.0) (2022-10-24) **Note:** Version bump only for package @typescript-eslint/scope-manager +## [5.40.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.40.0...v5.40.1) (2022-10-17) +**Note:** Version bump only for package @typescript-eslint/scope-manager +# [5.40.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.39.0...v5.40.0) (2022-10-10) +**Note:** Version bump only for package @typescript-eslint/scope-manager -# [5.28.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.27.1...v5.28.0) (2022-06-13) - - -### Bug Fixes +# [5.39.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.38.1...v5.39.0) (2022-10-03) -* [TS4.7] allow visiting of typeParameters in TSTypeQuery ([#5166](https://github.com/typescript-eslint/typescript-eslint/issues/5166)) ([dc1f930](https://github.com/typescript-eslint/typescript-eslint/commit/dc1f9309cf04aa7314e758980ac687558482f47f)) +**Note:** Version bump only for package @typescript-eslint/scope-manager +## [5.38.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.38.0...v5.38.1) (2022-09-26) +**Note:** Version bump only for package @typescript-eslint/scope-manager +# [5.38.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.37.0...v5.38.0) (2022-09-19) +**Note:** Version bump only for package @typescript-eslint/scope-manager -## [5.27.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.27.0...v5.27.1) (2022-06-06) +# [5.37.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.36.2...v5.37.0) (2022-09-12) **Note:** Version bump only for package @typescript-eslint/scope-manager +## [5.36.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.36.1...v5.36.2) (2022-09-05) +### Bug Fixes +- **scope-manager:** correct handling for class static blocks ([#5580](https://github.com/typescript-eslint/typescript-eslint/issues/5580)) ([35bb8dd](https://github.com/typescript-eslint/typescript-eslint/commit/35bb8ddac1b46397f6447c1a6e1e4e1774dd7957)) +## [5.36.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.36.0...v5.36.1) (2022-08-30) -# [5.27.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.26.0...v5.27.0) (2022-05-30) +**Note:** Version bump only for package @typescript-eslint/scope-manager +# [5.36.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.35.1...v5.36.0) (2022-08-30) ### Features -* [4.7] support new extensions ([#5027](https://github.com/typescript-eslint/typescript-eslint/issues/5027)) ([efc147b](https://github.com/typescript-eslint/typescript-eslint/commit/efc147b04dce52ab17415b6a4ae4076b944b9036)) - - +- support TypeScript 4.8 ([#5551](https://github.com/typescript-eslint/typescript-eslint/issues/5551)) ([81450ed](https://github.com/typescript-eslint/typescript-eslint/commit/81450ed7eaede74b384e9a91a84e9b4d34513866)) +## [5.35.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.35.0...v5.35.1) (2022-08-24) +**Note:** Version bump only for package @typescript-eslint/scope-manager -# [5.26.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.25.0...v5.26.0) (2022-05-23) +# [5.35.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.34.0...v5.35.0) (2022-08-24) **Note:** Version bump only for package @typescript-eslint/scope-manager +# [5.34.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.33.1...v5.34.0) (2022-08-22) +### Bug Fixes +- **scope-manager:** visit static blocks ([#5489](https://github.com/typescript-eslint/typescript-eslint/issues/5489)) ([78745c2](https://github.com/typescript-eslint/typescript-eslint/commit/78745c2092064446837b5683892001030a8bb4e2)) +## [5.33.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.33.0...v5.33.1) (2022-08-15) -# [5.25.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.24.0...v5.25.0) (2022-05-17) - +**Note:** Version bump only for package @typescript-eslint/scope-manager -### Features +# [5.33.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.32.0...v5.33.0) (2022-08-08) -* update to TypeScript 4.7-rc ([#4829](https://github.com/typescript-eslint/typescript-eslint/issues/4829)) ([6fe783c](https://github.com/typescript-eslint/typescript-eslint/commit/6fe783c20aebe26ef42b526e4a59a9be84dd5643)) +**Note:** Version bump only for package @typescript-eslint/scope-manager +# [5.32.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.31.0...v5.32.0) (2022-08-01) +**Note:** Version bump only for package @typescript-eslint/scope-manager +# [5.31.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.7...v5.31.0) (2022-07-25) +### Bug Fixes -# [5.24.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.23.0...v5.24.0) (2022-05-16) +- **scope-manager:** handle typeParameters of TSInstantiationExpression ([#5355](https://github.com/typescript-eslint/typescript-eslint/issues/5355)) ([2595ccf](https://github.com/typescript-eslint/typescript-eslint/commit/2595ccf67cd5158edbd6bebd9ac2dbd8bbd8b99c)) +## [5.30.7](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.6...v5.30.7) (2022-07-18) -### Features +### Bug Fixes -* **eslint-plugin:** add new 'strict' config ([#4706](https://github.com/typescript-eslint/typescript-eslint/issues/4706)) ([4a500b2](https://github.com/typescript-eslint/typescript-eslint/commit/4a500b2d92a91873dbb729793d1ee1c36ef06ed8)) +- **scope-manager:** allow visiting of constraint in infer type ([#5331](https://github.com/typescript-eslint/typescript-eslint/issues/5331)) ([b2846a1](https://github.com/typescript-eslint/typescript-eslint/commit/b2846a16777a3aea7b1e6ac9d81b9b6dce0bb874)) +## [5.30.6](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.5...v5.30.6) (2022-07-11) +**Note:** Version bump only for package @typescript-eslint/scope-manager +## [5.30.5](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.4...v5.30.5) (2022-07-04) +**Note:** Version bump only for package @typescript-eslint/scope-manager -# [5.23.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.22.0...v5.23.0) (2022-05-09) +## [5.30.4](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.3...v5.30.4) (2022-07-03) **Note:** Version bump only for package @typescript-eslint/scope-manager +## [5.30.3](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.2...v5.30.3) (2022-07-01) + +**Note:** Version bump only for package @typescript-eslint/scope-manager +## [5.30.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.1...v5.30.2) (2022-07-01) +**Note:** Version bump only for package @typescript-eslint/scope-manager +## 5.30.1 (2022-07-01) -# [5.22.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.21.0...v5.22.0) (2022-05-02) +**Note:** Version bump only for package @typescript-eslint/scope-manager +# [5.30.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.29.0...v5.30.0) (2022-06-27) ### Features -* **ast-spec:** add fixture test framework and some initial fixtures ([#3258](https://github.com/typescript-eslint/typescript-eslint/issues/3258)) ([f3cf87b](https://github.com/typescript-eslint/typescript-eslint/commit/f3cf87bf20fd0542f92a96a318aa9ee5bf23c1f6)) +- treat `this` in `typeof this` as a `ThisExpression` ([#4382](https://github.com/typescript-eslint/typescript-eslint/issues/4382)) ([b04b2ce](https://github.com/typescript-eslint/typescript-eslint/commit/b04b2ce1ba90d94718891f2562dd210a6d7b8609)) + +# [5.29.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.28.0...v5.29.0) (2022-06-20) +**Note:** Version bump only for package @typescript-eslint/scope-manager +# [5.28.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.27.1...v5.28.0) (2022-06-13) +### Bug Fixes +- [TS4.7] allow visiting of typeParameters in TSTypeQuery ([#5166](https://github.com/typescript-eslint/typescript-eslint/issues/5166)) ([dc1f930](https://github.com/typescript-eslint/typescript-eslint/commit/dc1f9309cf04aa7314e758980ac687558482f47f)) -# [5.21.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.20.0...v5.21.0) (2022-04-25) +## [5.27.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.27.0...v5.27.1) (2022-06-06) **Note:** Version bump only for package @typescript-eslint/scope-manager +# [5.27.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.26.0...v5.27.0) (2022-05-30) +### Features +- [4.7] support new extensions ([#5027](https://github.com/typescript-eslint/typescript-eslint/issues/5027)) ([efc147b](https://github.com/typescript-eslint/typescript-eslint/commit/efc147b04dce52ab17415b6a4ae4076b944b9036)) - -# [5.20.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.19.0...v5.20.0) (2022-04-18) +# [5.26.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.25.0...v5.26.0) (2022-05-23) **Note:** Version bump only for package @typescript-eslint/scope-manager +# [5.25.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.24.0...v5.25.0) (2022-05-17) +### Features +- update to TypeScript 4.7-rc ([#4829](https://github.com/typescript-eslint/typescript-eslint/issues/4829)) ([6fe783c](https://github.com/typescript-eslint/typescript-eslint/commit/6fe783c20aebe26ef42b526e4a59a9be84dd5643)) +# [5.24.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.23.0...v5.24.0) (2022-05-16) -# [5.19.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.18.0...v5.19.0) (2022-04-11) - -**Note:** Version bump only for package @typescript-eslint/scope-manager +### Features +- **eslint-plugin:** add new 'strict' config ([#4706](https://github.com/typescript-eslint/typescript-eslint/issues/4706)) ([4a500b2](https://github.com/typescript-eslint/typescript-eslint/commit/4a500b2d92a91873dbb729793d1ee1c36ef06ed8)) +# [5.23.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.22.0...v5.23.0) (2022-05-09) +**Note:** Version bump only for package @typescript-eslint/scope-manager +# [5.22.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.21.0...v5.22.0) (2022-05-02) -# [5.18.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.17.0...v5.18.0) (2022-04-04) +### Features -**Note:** Version bump only for package @typescript-eslint/scope-manager +- **ast-spec:** add fixture test framework and some initial fixtures ([#3258](https://github.com/typescript-eslint/typescript-eslint/issues/3258)) ([f3cf87b](https://github.com/typescript-eslint/typescript-eslint/commit/f3cf87bf20fd0542f92a96a318aa9ee5bf23c1f6)) +# [5.21.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.20.0...v5.21.0) (2022-04-25) +**Note:** Version bump only for package @typescript-eslint/scope-manager +# [5.20.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.19.0...v5.20.0) (2022-04-18) +**Note:** Version bump only for package @typescript-eslint/scope-manager -# [5.17.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.16.0...v5.17.0) (2022-03-28) +# [5.19.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.18.0...v5.19.0) (2022-04-11) **Note:** Version bump only for package @typescript-eslint/scope-manager +# [5.18.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.17.0...v5.18.0) (2022-04-04) +**Note:** Version bump only for package @typescript-eslint/scope-manager +# [5.17.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.16.0...v5.17.0) (2022-03-28) +**Note:** Version bump only for package @typescript-eslint/scope-manager # [5.16.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.15.0...v5.16.0) (2022-03-21) - ### Bug Fixes -* **scope-manager:** incorrect reference for this within a jsx identifier ([#4535](https://github.com/typescript-eslint/typescript-eslint/issues/4535)) ([dd49280](https://github.com/typescript-eslint/typescript-eslint/commit/dd49280e50cb2f5bd26dc07210551bc1fda120af)) - - - - +- **scope-manager:** incorrect reference for this within a jsx identifier ([#4535](https://github.com/typescript-eslint/typescript-eslint/issues/4535)) ([dd49280](https://github.com/typescript-eslint/typescript-eslint/commit/dd49280e50cb2f5bd26dc07210551bc1fda120af)) # [5.15.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.14.0...v5.15.0) (2022-03-14) **Note:** Version bump only for package @typescript-eslint/scope-manager - - - - # [5.14.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.13.0...v5.14.0) (2022-03-07) - ### Features -* TypeScript 4.6 ([#4615](https://github.com/typescript-eslint/typescript-eslint/issues/4615)) ([a02c63a](https://github.com/typescript-eslint/typescript-eslint/commit/a02c63a264e5a6c3557468a8eff48d34ca2b718a)) - - - - +- TypeScript 4.6 ([#4615](https://github.com/typescript-eslint/typescript-eslint/issues/4615)) ([a02c63a](https://github.com/typescript-eslint/typescript-eslint/commit/a02c63a264e5a6c3557468a8eff48d34ca2b718a)) # [5.13.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.12.1...v5.13.0) (2022-02-28) **Note:** Version bump only for package @typescript-eslint/scope-manager - - - - ## [5.12.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.12.0...v5.12.1) (2022-02-21) **Note:** Version bump only for package @typescript-eslint/scope-manager - - - - # [5.12.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.11.0...v5.12.0) (2022-02-14) **Note:** Version bump only for package @typescript-eslint/scope-manager - - - - # [5.11.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.10.2...v5.11.0) (2022-02-07) **Note:** Version bump only for package @typescript-eslint/scope-manager - - - - ## [5.10.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.10.1...v5.10.2) (2022-01-31) **Note:** Version bump only for package @typescript-eslint/scope-manager - - - - ## [5.10.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.10.0...v5.10.1) (2022-01-24) **Note:** Version bump only for package @typescript-eslint/scope-manager - - - - # [5.10.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.9.1...v5.10.0) (2022-01-17) **Note:** Version bump only for package @typescript-eslint/scope-manager - - - - ## [5.9.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.9.0...v5.9.1) (2022-01-10) **Note:** Version bump only for package @typescript-eslint/scope-manager - - - - # [5.9.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.8.1...v5.9.0) (2022-01-03) **Note:** Version bump only for package @typescript-eslint/scope-manager - - - - ## [5.8.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.8.0...v5.8.1) (2021-12-27) **Note:** Version bump only for package @typescript-eslint/scope-manager - - - - # [5.8.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.7.0...v5.8.0) (2021-12-20) **Note:** Version bump only for package @typescript-eslint/scope-manager - - - - # [5.7.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.6.0...v5.7.0) (2021-12-13) **Note:** Version bump only for package @typescript-eslint/scope-manager - - - - # [5.6.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.5.0...v5.6.0) (2021-12-06) - ### Features -* **scope-manager:** support TS4.5 import/export specifier kind ([#4234](https://github.com/typescript-eslint/typescript-eslint/issues/4234)) ([833f822](https://github.com/typescript-eslint/typescript-eslint/commit/833f8221ce00aecb7d08c519bab9568353850f48)) -* **scope-manager:** update lib types ([#4240](https://github.com/typescript-eslint/typescript-eslint/issues/4240)) ([8377e6e](https://github.com/typescript-eslint/typescript-eslint/commit/8377e6ea422ee2d52455da8955ff055e09c238d3)) - - - - +- **scope-manager:** support TS4.5 import/export specifier kind ([#4234](https://github.com/typescript-eslint/typescript-eslint/issues/4234)) ([833f822](https://github.com/typescript-eslint/typescript-eslint/commit/833f8221ce00aecb7d08c519bab9568353850f48)) +- **scope-manager:** update lib types ([#4240](https://github.com/typescript-eslint/typescript-eslint/issues/4240)) ([8377e6e](https://github.com/typescript-eslint/typescript-eslint/commit/8377e6ea422ee2d52455da8955ff055e09c238d3)) # [5.5.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.4.0...v5.5.0) (2021-11-29) - ### Bug Fixes -* **scope-manager:** support static class blocks ([#4211](https://github.com/typescript-eslint/typescript-eslint/issues/4211)) ([f8e9125](https://github.com/typescript-eslint/typescript-eslint/commit/f8e91256e0a721aaa906a5c40a92784da9433b53)) - - - - +- **scope-manager:** support static class blocks ([#4211](https://github.com/typescript-eslint/typescript-eslint/issues/4211)) ([f8e9125](https://github.com/typescript-eslint/typescript-eslint/commit/f8e91256e0a721aaa906a5c40a92784da9433b53)) # [5.4.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.3.1...v5.4.0) (2021-11-15) - ### Bug Fixes -* correct issues with circular imports ([#4140](https://github.com/typescript-eslint/typescript-eslint/issues/4140)) ([4c87b24](https://github.com/typescript-eslint/typescript-eslint/commit/4c87b2486a9c90794d972a4d093c1dc22ffb418b)) - +- correct issues with circular imports ([#4140](https://github.com/typescript-eslint/typescript-eslint/issues/4140)) ([4c87b24](https://github.com/typescript-eslint/typescript-eslint/commit/4c87b2486a9c90794d972a4d093c1dc22ffb418b)) ### Features -* **typescript-estree:** support Import Assertions ([#4074](https://github.com/typescript-eslint/typescript-eslint/issues/4074)) ([ae0fb5a](https://github.com/typescript-eslint/typescript-eslint/commit/ae0fb5a591958216b7df656e66b1dfe464898167)) - - - - +- **typescript-estree:** support Import Assertions ([#4074](https://github.com/typescript-eslint/typescript-eslint/issues/4074)) ([ae0fb5a](https://github.com/typescript-eslint/typescript-eslint/commit/ae0fb5a591958216b7df656e66b1dfe464898167)) ## [5.3.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.3.0...v5.3.1) (2021-11-08) **Note:** Version bump only for package @typescript-eslint/scope-manager - - - - # [5.3.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.2.0...v5.3.0) (2021-11-01) **Note:** Version bump only for package @typescript-eslint/scope-manager - - - - # [5.2.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.1.0...v5.2.0) (2021-10-25) **Note:** Version bump only for package @typescript-eslint/scope-manager - - - - # [5.1.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.0.0...v5.1.0) (2021-10-18) **Note:** Version bump only for package @typescript-eslint/scope-manager - - - - # [5.0.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.33.0...v5.0.0) (2021-10-11) - ### Features -* align class property representation with ESTree ([#3806](https://github.com/typescript-eslint/typescript-eslint/issues/3806)) ([22fa5c0](https://github.com/typescript-eslint/typescript-eslint/commit/22fa5c0c4705ed2898f00b7cacc5dd642d859275)), closes [#3430](https://github.com/typescript-eslint/typescript-eslint/issues/3430) [#3077](https://github.com/typescript-eslint/typescript-eslint/issues/3077) -* support `PrivateIdentifier` ([#3808](https://github.com/typescript-eslint/typescript-eslint/issues/3808)) ([0eefe5e](https://github.com/typescript-eslint/typescript-eslint/commit/0eefe5e49d21af3f1e3e2d9a90c2e49929863ac2)), closes [#3430](https://github.com/typescript-eslint/typescript-eslint/issues/3430) [#2933](https://github.com/typescript-eslint/typescript-eslint/issues/2933) -* **eslint-plugin:** removed value from abstract property nodes ([#3765](https://github.com/typescript-eslint/typescript-eslint/issues/3765)) ([5823524](https://github.com/typescript-eslint/typescript-eslint/commit/58235241714596b641a1e8b39c569e561e0039b4)), closes [#3748](https://github.com/typescript-eslint/typescript-eslint/issues/3748) - - - - +- align class property representation with ESTree ([#3806](https://github.com/typescript-eslint/typescript-eslint/issues/3806)) ([22fa5c0](https://github.com/typescript-eslint/typescript-eslint/commit/22fa5c0c4705ed2898f00b7cacc5dd642d859275)), closes [#3430](https://github.com/typescript-eslint/typescript-eslint/issues/3430) [#3077](https://github.com/typescript-eslint/typescript-eslint/issues/3077) +- support `PrivateIdentifier` ([#3808](https://github.com/typescript-eslint/typescript-eslint/issues/3808)) ([0eefe5e](https://github.com/typescript-eslint/typescript-eslint/commit/0eefe5e49d21af3f1e3e2d9a90c2e49929863ac2)), closes [#3430](https://github.com/typescript-eslint/typescript-eslint/issues/3430) [#2933](https://github.com/typescript-eslint/typescript-eslint/issues/2933) +- **eslint-plugin:** removed value from abstract property nodes ([#3765](https://github.com/typescript-eslint/typescript-eslint/issues/3765)) ([5823524](https://github.com/typescript-eslint/typescript-eslint/commit/58235241714596b641a1e8b39c569e561e0039b4)), closes [#3748](https://github.com/typescript-eslint/typescript-eslint/issues/3748) # [4.33.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.32.0...v4.33.0) (2021-10-04) **Note:** Version bump only for package @typescript-eslint/scope-manager - - - - # [4.32.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.31.2...v4.32.0) (2021-09-27) - ### Features -* **eslint-plugin-internal:** [prefer-ast-types-enum] add `DefinitionType` enum ([#3916](https://github.com/typescript-eslint/typescript-eslint/issues/3916)) ([13b7de5](https://github.com/typescript-eslint/typescript-eslint/commit/13b7de508e0f8eac492879ff9ab99acd8d3e977e)) -* Support `'latest'` as `ecmaVersion` ([#3873](https://github.com/typescript-eslint/typescript-eslint/issues/3873)) ([25a42c0](https://github.com/typescript-eslint/typescript-eslint/commit/25a42c0bbe92d1ecbc2e8ff9ef3a3ef413f728b0)) - - - - +- **eslint-plugin-internal:** [prefer-ast-types-enum] add `DefinitionType` enum ([#3916](https://github.com/typescript-eslint/typescript-eslint/issues/3916)) ([13b7de5](https://github.com/typescript-eslint/typescript-eslint/commit/13b7de508e0f8eac492879ff9ab99acd8d3e977e)) +- Support `'latest'` as `ecmaVersion` ([#3873](https://github.com/typescript-eslint/typescript-eslint/issues/3873)) ([25a42c0](https://github.com/typescript-eslint/typescript-eslint/commit/25a42c0bbe92d1ecbc2e8ff9ef3a3ef413f728b0)) ## [4.31.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.31.1...v4.31.2) (2021-09-20) **Note:** Version bump only for package @typescript-eslint/scope-manager - - - - ## [4.31.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.31.0...v4.31.1) (2021-09-13) **Note:** Version bump only for package @typescript-eslint/scope-manager - - - - # [4.31.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.30.0...v4.31.0) (2021-09-06) **Note:** Version bump only for package @typescript-eslint/scope-manager - - - - # [4.30.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.29.3...v4.30.0) (2021-08-30) - ### Features -* **typescript-estree:** add support for class static blocks ([#3730](https://github.com/typescript-eslint/typescript-eslint/issues/3730)) ([f81831b](https://github.com/typescript-eslint/typescript-eslint/commit/f81831bd279a32da6dbab0f1c061053ea43965f6)) - - - - +- **typescript-estree:** add support for class static blocks ([#3730](https://github.com/typescript-eslint/typescript-eslint/issues/3730)) ([f81831b](https://github.com/typescript-eslint/typescript-eslint/commit/f81831bd279a32da6dbab0f1c061053ea43965f6)) ## [4.29.3](https://github.com/typescript-eslint/typescript-eslint/compare/v4.29.2...v4.29.3) (2021-08-23) **Note:** Version bump only for package @typescript-eslint/scope-manager - - - - ## [4.29.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.29.1...v4.29.2) (2021-08-16) **Note:** Version bump only for package @typescript-eslint/scope-manager - - - - ## [4.29.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.29.0...v4.29.1) (2021-08-09) **Note:** Version bump only for package @typescript-eslint/scope-manager - - - - # [4.29.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.5...v4.29.0) (2021-08-02) - ### Features -* **eslint-plugin:** Catch unused React import with new JSX transform ([#3577](https://github.com/typescript-eslint/typescript-eslint/issues/3577)) ([02998ea](https://github.com/typescript-eslint/typescript-eslint/commit/02998eac510665758b9a093d43afc310f3ac980d)) - - - - +- **eslint-plugin:** Catch unused React import with new JSX transform ([#3577](https://github.com/typescript-eslint/typescript-eslint/issues/3577)) ([02998ea](https://github.com/typescript-eslint/typescript-eslint/commit/02998eac510665758b9a093d43afc310f3ac980d)) ## [4.28.5](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.4...v4.28.5) (2021-07-26) **Note:** Version bump only for package @typescript-eslint/scope-manager - - - - ## [4.28.4](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.3...v4.28.4) (2021-07-19) **Note:** Version bump only for package @typescript-eslint/scope-manager - - - - ## [4.28.3](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.2...v4.28.3) (2021-07-12) **Note:** Version bump only for package @typescript-eslint/scope-manager - - - - ## [4.28.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.1...v4.28.2) (2021-07-05) **Note:** Version bump only for package @typescript-eslint/scope-manager - - - - ## [4.28.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.0...v4.28.1) (2021-06-28) **Note:** Version bump only for package @typescript-eslint/scope-manager - - - - # [4.28.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.27.0...v4.28.0) (2021-06-21) **Note:** Version bump only for package @typescript-eslint/scope-manager - - - - # [4.27.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.26.1...v4.27.0) (2021-06-14) **Note:** Version bump only for package @typescript-eslint/scope-manager - - - - ## [4.26.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.26.0...v4.26.1) (2021-06-07) **Note:** Version bump only for package @typescript-eslint/scope-manager - - - - # [4.26.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.25.0...v4.26.0) (2021-05-31) - ### Bug Fixes -* generate library types for TypeScript v4.3 ([#3460](https://github.com/typescript-eslint/typescript-eslint/issues/3460)) ([ed4776a](https://github.com/typescript-eslint/typescript-eslint/commit/ed4776afa1374279027b9b7d82aa4b453b334998)), closes [#3449](https://github.com/typescript-eslint/typescript-eslint/issues/3449) - +- generate library types for TypeScript v4.3 ([#3460](https://github.com/typescript-eslint/typescript-eslint/issues/3460)) ([ed4776a](https://github.com/typescript-eslint/typescript-eslint/commit/ed4776afa1374279027b9b7d82aa4b453b334998)), closes [#3449](https://github.com/typescript-eslint/typescript-eslint/issues/3449) ### Features -* **scope-manager:** reduce generated lib file size ([#3468](https://github.com/typescript-eslint/typescript-eslint/issues/3468)) ([258116b](https://github.com/typescript-eslint/typescript-eslint/commit/258116ba7b0dd4ac7a1cc3876fab12f2556bda74)) - - - - +- **scope-manager:** reduce generated lib file size ([#3468](https://github.com/typescript-eslint/typescript-eslint/issues/3468)) ([258116b](https://github.com/typescript-eslint/typescript-eslint/commit/258116ba7b0dd4ac7a1cc3876fab12f2556bda74)) # [4.25.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.24.0...v4.25.0) (2021-05-24) **Note:** Version bump only for package @typescript-eslint/scope-manager - - - - # [4.24.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.23.0...v4.24.0) (2021-05-17) **Note:** Version bump only for package @typescript-eslint/scope-manager - - - - # [4.23.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.22.1...v4.23.0) (2021-05-10) - ### Bug Fixes -* **scope-manager:** fix visiting TSAsExpression in assignment ([#3355](https://github.com/typescript-eslint/typescript-eslint/issues/3355)) ([87521a0](https://github.com/typescript-eslint/typescript-eslint/commit/87521a024103bc5fc643861649bee9a288f55b7b)) - +- **scope-manager:** fix visiting TSAsExpression in assignment ([#3355](https://github.com/typescript-eslint/typescript-eslint/issues/3355)) ([87521a0](https://github.com/typescript-eslint/typescript-eslint/commit/87521a024103bc5fc643861649bee9a288f55b7b)) ### Features -* refactor to split AST specification out as its own module ([#2911](https://github.com/typescript-eslint/typescript-eslint/issues/2911)) ([25ea953](https://github.com/typescript-eslint/typescript-eslint/commit/25ea953cc60b118bd385c71e0a9b61c286c26fcf)) - - - - +- refactor to split AST specification out as its own module ([#2911](https://github.com/typescript-eslint/typescript-eslint/issues/2911)) ([25ea953](https://github.com/typescript-eslint/typescript-eslint/commit/25ea953cc60b118bd385c71e0a9b61c286c26fcf)) ## [4.22.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.22.0...v4.22.1) (2021-05-04) **Note:** Version bump only for package @typescript-eslint/scope-manager - - - - # [4.22.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.21.0...v4.22.0) (2021-04-12) **Note:** Version bump only for package @typescript-eslint/scope-manager - - - - # [4.21.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.20.0...v4.21.0) (2021-04-05) **Note:** Version bump only for package @typescript-eslint/scope-manager - - - - # [4.20.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.19.0...v4.20.0) (2021-03-29) **Note:** Version bump only for package @typescript-eslint/scope-manager - - - - # [4.19.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.18.0...v4.19.0) (2021-03-22) **Note:** Version bump only for package @typescript-eslint/scope-manager - - - - # [4.18.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.17.0...v4.18.0) (2021-03-15) **Note:** Version bump only for package @typescript-eslint/scope-manager - - - - # [4.17.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.16.1...v4.17.0) (2021-03-08) **Note:** Version bump only for package @typescript-eslint/scope-manager - - - - ## [4.16.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.16.0...v4.16.1) (2021-03-01) **Note:** Version bump only for package @typescript-eslint/scope-manager - - - - # [4.16.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.15.2...v4.16.0) (2021-03-01) - ### Bug Fixes -* **scope-manager:** update libs for typescript 4.2 ([#3118](https://github.com/typescript-eslint/typescript-eslint/issues/3118)) ([0336c79](https://github.com/typescript-eslint/typescript-eslint/commit/0336c798c9502fc250d2eaa045661950da55e52f)) - - - - +- **scope-manager:** update libs for typescript 4.2 ([#3118](https://github.com/typescript-eslint/typescript-eslint/issues/3118)) ([0336c79](https://github.com/typescript-eslint/typescript-eslint/commit/0336c798c9502fc250d2eaa045661950da55e52f)) ## [4.15.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.15.1...v4.15.2) (2021-02-22) **Note:** Version bump only for package @typescript-eslint/scope-manager - - - - ## [4.15.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.15.0...v4.15.1) (2021-02-15) **Note:** Version bump only for package @typescript-eslint/scope-manager - - - - # [4.15.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.14.2...v4.15.0) (2021-02-08) - ### Bug Fixes -* **scope-manager:** fix visiting of TSImportType ([#3008](https://github.com/typescript-eslint/typescript-eslint/issues/3008)) ([ce4fcbf](https://github.com/typescript-eslint/typescript-eslint/commit/ce4fcbf4401098387a2cf19ae8457c89c509239a)), closes [#3006](https://github.com/typescript-eslint/typescript-eslint/issues/3006) - - - - +- **scope-manager:** fix visiting of TSImportType ([#3008](https://github.com/typescript-eslint/typescript-eslint/issues/3008)) ([ce4fcbf](https://github.com/typescript-eslint/typescript-eslint/commit/ce4fcbf4401098387a2cf19ae8457c89c509239a)), closes [#3006](https://github.com/typescript-eslint/typescript-eslint/issues/3006) ## [4.14.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.14.1...v4.14.2) (2021-02-01) - ### Bug Fixes -* **scope-manager:** correctly reference generic parameters when decorator metadata is enabled ([#2975](https://github.com/typescript-eslint/typescript-eslint/issues/2975)) ([7695ef3](https://github.com/typescript-eslint/typescript-eslint/commit/7695ef318f1cc8688acaabf4f2730769622f083f)), closes [#2972](https://github.com/typescript-eslint/typescript-eslint/issues/2972) - - - - +- **scope-manager:** correctly reference generic parameters when decorator metadata is enabled ([#2975](https://github.com/typescript-eslint/typescript-eslint/issues/2975)) ([7695ef3](https://github.com/typescript-eslint/typescript-eslint/commit/7695ef318f1cc8688acaabf4f2730769622f083f)), closes [#2972](https://github.com/typescript-eslint/typescript-eslint/issues/2972) ## [4.14.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.14.0...v4.14.1) (2021-01-25) - ### Bug Fixes -* **scope-manager:** fix incorrect handling of class decorators and class method default params ([#2943](https://github.com/typescript-eslint/typescript-eslint/issues/2943)) ([e1eac83](https://github.com/typescript-eslint/typescript-eslint/commit/e1eac8312268d1855a2ed7784b4d190ecb9c9fa4)), closes [#2941](https://github.com/typescript-eslint/typescript-eslint/issues/2941) [#2942](https://github.com/typescript-eslint/typescript-eslint/issues/2942) [#2751](https://github.com/typescript-eslint/typescript-eslint/issues/2751) - - - - +- **scope-manager:** fix incorrect handling of class decorators and class method default params ([#2943](https://github.com/typescript-eslint/typescript-eslint/issues/2943)) ([e1eac83](https://github.com/typescript-eslint/typescript-eslint/commit/e1eac8312268d1855a2ed7784b4d190ecb9c9fa4)), closes [#2941](https://github.com/typescript-eslint/typescript-eslint/issues/2941) [#2942](https://github.com/typescript-eslint/typescript-eslint/issues/2942) [#2751](https://github.com/typescript-eslint/typescript-eslint/issues/2751) # [4.14.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.13.0...v4.14.0) (2021-01-18) - ### Features -* add support for decorator metadata in scope analysis and in consistent-type-imports ([#2751](https://github.com/typescript-eslint/typescript-eslint/issues/2751)) ([445e416](https://github.com/typescript-eslint/typescript-eslint/commit/445e416878b27a54bf07c2d3b84dabd7b06e51bc)), closes [#2559](https://github.com/typescript-eslint/typescript-eslint/issues/2559) - - - - +- add support for decorator metadata in scope analysis and in consistent-type-imports ([#2751](https://github.com/typescript-eslint/typescript-eslint/issues/2751)) ([445e416](https://github.com/typescript-eslint/typescript-eslint/commit/445e416878b27a54bf07c2d3b84dabd7b06e51bc)), closes [#2559](https://github.com/typescript-eslint/typescript-eslint/issues/2559) # [4.13.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.12.0...v4.13.0) (2021-01-11) **Note:** Version bump only for package @typescript-eslint/scope-manager - - - - # [4.12.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.11.1...v4.12.0) (2021-01-04) **Note:** Version bump only for package @typescript-eslint/scope-manager - - - - ## [4.11.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.11.0...v4.11.1) (2020-12-28) **Note:** Version bump only for package @typescript-eslint/scope-manager - - - - # [4.11.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.10.0...v4.11.0) (2020-12-21) **Note:** Version bump only for package @typescript-eslint/scope-manager - - - - # [4.10.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.9.1...v4.10.0) (2020-12-14) **Note:** Version bump only for package @typescript-eslint/scope-manager - - - - ## [4.9.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.9.0...v4.9.1) (2020-12-07) **Note:** Version bump only for package @typescript-eslint/scope-manager - - - - # [4.9.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.8.2...v4.9.0) (2020-11-30) - ### Bug Fixes -* **scope-manager:** fix assertion assignments not being marked as write references ([#2809](https://github.com/typescript-eslint/typescript-eslint/issues/2809)) ([fa68492](https://github.com/typescript-eslint/typescript-eslint/commit/fa6849245ca55ca407dc031afbad456f2925a8e9)), closes [#2804](https://github.com/typescript-eslint/typescript-eslint/issues/2804) - +- **scope-manager:** fix assertion assignments not being marked as write references ([#2809](https://github.com/typescript-eslint/typescript-eslint/issues/2809)) ([fa68492](https://github.com/typescript-eslint/typescript-eslint/commit/fa6849245ca55ca407dc031afbad456f2925a8e9)), closes [#2804](https://github.com/typescript-eslint/typescript-eslint/issues/2804) ### Features -* **eslint-plugin:** [no-unused-vars] fork the base rule ([#2768](https://github.com/typescript-eslint/typescript-eslint/issues/2768)) ([a8227a6](https://github.com/typescript-eslint/typescript-eslint/commit/a8227a6185dd24de4bfc7d766931643871155021)), closes [#2782](https://github.com/typescript-eslint/typescript-eslint/issues/2782) [#2714](https://github.com/typescript-eslint/typescript-eslint/issues/2714) [#2648](https://github.com/typescript-eslint/typescript-eslint/issues/2648) - - - - +- **eslint-plugin:** [no-unused-vars] fork the base rule ([#2768](https://github.com/typescript-eslint/typescript-eslint/issues/2768)) ([a8227a6](https://github.com/typescript-eslint/typescript-eslint/commit/a8227a6185dd24de4bfc7d766931643871155021)), closes [#2782](https://github.com/typescript-eslint/typescript-eslint/issues/2782) [#2714](https://github.com/typescript-eslint/typescript-eslint/issues/2714) [#2648](https://github.com/typescript-eslint/typescript-eslint/issues/2648) ## [4.8.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.8.1...v4.8.2) (2020-11-23) **Note:** Version bump only for package @typescript-eslint/scope-manager - - - - ## [4.8.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.8.0...v4.8.1) (2020-11-17) **Note:** Version bump only for package @typescript-eslint/scope-manager - - - - # [4.8.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.7.0...v4.8.0) (2020-11-16) **Note:** Version bump only for package @typescript-eslint/scope-manager - - - - # [4.7.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.6.1...v4.7.0) (2020-11-09) - ### Features -* support TS4.1 features ([#2748](https://github.com/typescript-eslint/typescript-eslint/issues/2748)) ([2be354b](https://github.com/typescript-eslint/typescript-eslint/commit/2be354bb15f9013a2da1b13a0c0836e9ef057e16)), closes [#2583](https://github.com/typescript-eslint/typescript-eslint/issues/2583) - - - - +- support TS4.1 features ([#2748](https://github.com/typescript-eslint/typescript-eslint/issues/2748)) ([2be354b](https://github.com/typescript-eslint/typescript-eslint/commit/2be354bb15f9013a2da1b13a0c0836e9ef057e16)), closes [#2583](https://github.com/typescript-eslint/typescript-eslint/issues/2583) ## [4.6.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.6.0...v4.6.1) (2020-11-02) **Note:** Version bump only for package @typescript-eslint/scope-manager - - - - # [4.6.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.5.0...v4.6.0) (2020-10-26) **Note:** Version bump only for package @typescript-eslint/scope-manager - - - - # [4.5.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.4.1...v4.5.0) (2020-10-19) - ### Features -* **typescript-estree:** add flag EXPERIMENTAL_useSourceOfProjectReferenceRedirect ([#2669](https://github.com/typescript-eslint/typescript-eslint/issues/2669)) ([90a5878](https://github.com/typescript-eslint/typescript-eslint/commit/90a587845088da1b205e4d7d77dbc3f9447b1c5a)) - - - - +- **typescript-estree:** add flag EXPERIMENTAL_useSourceOfProjectReferenceRedirect ([#2669](https://github.com/typescript-eslint/typescript-eslint/issues/2669)) ([90a5878](https://github.com/typescript-eslint/typescript-eslint/commit/90a587845088da1b205e4d7d77dbc3f9447b1c5a)) ## [4.4.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.4.0...v4.4.1) (2020-10-12) - ### Bug Fixes -* **scope-manager:** don't create a variable for global augmentation ([#2639](https://github.com/typescript-eslint/typescript-eslint/issues/2639)) ([6bc9325](https://github.com/typescript-eslint/typescript-eslint/commit/6bc93257ec876214743a165093b6666d713379f6)) - - - - +- **scope-manager:** don't create a variable for global augmentation ([#2639](https://github.com/typescript-eslint/typescript-eslint/issues/2639)) ([6bc9325](https://github.com/typescript-eslint/typescript-eslint/commit/6bc93257ec876214743a165093b6666d713379f6)) # [4.4.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.3.0...v4.4.0) (2020-10-05) **Note:** Version bump only for package @typescript-eslint/scope-manager - - - - # [4.3.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.2.0...v4.3.0) (2020-09-28) **Note:** Version bump only for package @typescript-eslint/scope-manager - - - - # [4.2.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.1.1...v4.2.0) (2020-09-21) - ### Bug Fixes -* **scope-manager:** correct analysis of inferred types in conditional types ([#2537](https://github.com/typescript-eslint/typescript-eslint/issues/2537)) ([4f660fd](https://github.com/typescript-eslint/typescript-eslint/commit/4f660fd31acbb88b30719f925dcb2b3022cc2bab)) - - - - +- **scope-manager:** correct analysis of inferred types in conditional types ([#2537](https://github.com/typescript-eslint/typescript-eslint/issues/2537)) ([4f660fd](https://github.com/typescript-eslint/typescript-eslint/commit/4f660fd31acbb88b30719f925dcb2b3022cc2bab)) ## [4.1.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.1.0...v4.1.1) (2020-09-14) **Note:** Version bump only for package @typescript-eslint/scope-manager - - - - # [4.1.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.0.1...v4.1.0) (2020-09-07) - ### Bug Fixes -* **eslint-plugin:** [no-unused-vars] correct detection of unused vars in a declared module with `export =` ([#2505](https://github.com/typescript-eslint/typescript-eslint/issues/2505)) ([3d07a99](https://github.com/typescript-eslint/typescript-eslint/commit/3d07a99faa0a5fc1b44acdb43ddbfc90a5105833)) -* **scope-manager:** add `const` as a global type variable ([#2499](https://github.com/typescript-eslint/typescript-eslint/issues/2499)) ([eb3f6e3](https://github.com/typescript-eslint/typescript-eslint/commit/eb3f6e39391d62ac424baa305a15e61806b2fd65)) -* **scope-manager:** correctly handle inferred types in nested type scopes ([#2497](https://github.com/typescript-eslint/typescript-eslint/issues/2497)) ([95f6bf4](https://github.com/typescript-eslint/typescript-eslint/commit/95f6bf4818cdec48a0583bf82f928c598af22736)) -* **scope-manager:** don't create references for intrinsic JSX elements ([#2504](https://github.com/typescript-eslint/typescript-eslint/issues/2504)) ([cdb9807](https://github.com/typescript-eslint/typescript-eslint/commit/cdb9807a5a368a136856cd03048b68e0f2dfb405)) -* **scope-manager:** fallback to lib 'esnext' or 'es5' when ecma version is unsupported ([#2474](https://github.com/typescript-eslint/typescript-eslint/issues/2474)) ([20a7dcc](https://github.com/typescript-eslint/typescript-eslint/commit/20a7dcc808a39cd447d6e52fc5a1e1373d7122e9)) -* **scope-manager:** support rest function type parameters ([#2491](https://github.com/typescript-eslint/typescript-eslint/issues/2491)) ([9d8b4c4](https://github.com/typescript-eslint/typescript-eslint/commit/9d8b4c479c98623e4198aa07639321929a8a876f)), closes [#2449](https://github.com/typescript-eslint/typescript-eslint/issues/2449) -* **scope-manager:** support tagged template string generic type parameters ([#2492](https://github.com/typescript-eslint/typescript-eslint/issues/2492)) ([a2686c0](https://github.com/typescript-eslint/typescript-eslint/commit/a2686c04293ab9070c1500a0dab7e205bd1fa9d2)) -* **scope-manager:** support type predicates ([#2493](https://github.com/typescript-eslint/typescript-eslint/issues/2493)) ([a40f54c](https://github.com/typescript-eslint/typescript-eslint/commit/a40f54c39d59096a0d12a492807dcd52fbcdc384)), closes [#2462](https://github.com/typescript-eslint/typescript-eslint/issues/2462) -* **scope-manager:** treat type imports as both values and types ([#2494](https://github.com/typescript-eslint/typescript-eslint/issues/2494)) ([916e95a](https://github.com/typescript-eslint/typescript-eslint/commit/916e95a505689746dda38a67148c95cc7d207d9f)), closes [#2453](https://github.com/typescript-eslint/typescript-eslint/issues/2453) - +- **eslint-plugin:** [no-unused-vars] correct detection of unused vars in a declared module with `export =` ([#2505](https://github.com/typescript-eslint/typescript-eslint/issues/2505)) ([3d07a99](https://github.com/typescript-eslint/typescript-eslint/commit/3d07a99faa0a5fc1b44acdb43ddbfc90a5105833)) +- **scope-manager:** add `const` as a global type variable ([#2499](https://github.com/typescript-eslint/typescript-eslint/issues/2499)) ([eb3f6e3](https://github.com/typescript-eslint/typescript-eslint/commit/eb3f6e39391d62ac424baa305a15e61806b2fd65)) +- **scope-manager:** correctly handle inferred types in nested type scopes ([#2497](https://github.com/typescript-eslint/typescript-eslint/issues/2497)) ([95f6bf4](https://github.com/typescript-eslint/typescript-eslint/commit/95f6bf4818cdec48a0583bf82f928c598af22736)) +- **scope-manager:** don't create references for intrinsic JSX elements ([#2504](https://github.com/typescript-eslint/typescript-eslint/issues/2504)) ([cdb9807](https://github.com/typescript-eslint/typescript-eslint/commit/cdb9807a5a368a136856cd03048b68e0f2dfb405)) +- **scope-manager:** fallback to lib 'esnext' or 'es5' when ecma version is unsupported ([#2474](https://github.com/typescript-eslint/typescript-eslint/issues/2474)) ([20a7dcc](https://github.com/typescript-eslint/typescript-eslint/commit/20a7dcc808a39cd447d6e52fc5a1e1373d7122e9)) +- **scope-manager:** support rest function type parameters ([#2491](https://github.com/typescript-eslint/typescript-eslint/issues/2491)) ([9d8b4c4](https://github.com/typescript-eslint/typescript-eslint/commit/9d8b4c479c98623e4198aa07639321929a8a876f)), closes [#2449](https://github.com/typescript-eslint/typescript-eslint/issues/2449) +- **scope-manager:** support tagged template string generic type parameters ([#2492](https://github.com/typescript-eslint/typescript-eslint/issues/2492)) ([a2686c0](https://github.com/typescript-eslint/typescript-eslint/commit/a2686c04293ab9070c1500a0dab7e205bd1fa9d2)) +- **scope-manager:** support type predicates ([#2493](https://github.com/typescript-eslint/typescript-eslint/issues/2493)) ([a40f54c](https://github.com/typescript-eslint/typescript-eslint/commit/a40f54c39d59096a0d12a492807dcd52fbcdc384)), closes [#2462](https://github.com/typescript-eslint/typescript-eslint/issues/2462) +- **scope-manager:** treat type imports as both values and types ([#2494](https://github.com/typescript-eslint/typescript-eslint/issues/2494)) ([916e95a](https://github.com/typescript-eslint/typescript-eslint/commit/916e95a505689746dda38a67148c95cc7d207d9f)), closes [#2453](https://github.com/typescript-eslint/typescript-eslint/issues/2453) ### Features -* **scope-manager:** add support for JSX scope analysis ([#2498](https://github.com/typescript-eslint/typescript-eslint/issues/2498)) ([f887ab5](https://github.com/typescript-eslint/typescript-eslint/commit/f887ab51f58c1b3571f9a14832864bc0ca59623f)), closes [#2455](https://github.com/typescript-eslint/typescript-eslint/issues/2455) [#2477](https://github.com/typescript-eslint/typescript-eslint/issues/2477) - - - - +- **scope-manager:** add support for JSX scope analysis ([#2498](https://github.com/typescript-eslint/typescript-eslint/issues/2498)) ([f887ab5](https://github.com/typescript-eslint/typescript-eslint/commit/f887ab51f58c1b3571f9a14832864bc0ca59623f)), closes [#2455](https://github.com/typescript-eslint/typescript-eslint/issues/2455) [#2477](https://github.com/typescript-eslint/typescript-eslint/issues/2477) ## [4.0.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.0.0...v4.0.1) (2020-08-31) **Note:** Version bump only for package @typescript-eslint/scope-manager - - - - # [4.0.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.10.1...v4.0.0) (2020-08-31) ## [Please see the release notes for v4.0.0](https://github.com/typescript-eslint/typescript-eslint/releases/tag/v4.0.0) ### Bug Fixes -* **scope-manager:** correct analysis of abstract class properties ([#2420](https://github.com/typescript-eslint/typescript-eslint/issues/2420)) ([cd84549](https://github.com/typescript-eslint/typescript-eslint/commit/cd84549beba3cf471d75cfd9ba26f80366842ed5)) - +- **scope-manager:** correct analysis of abstract class properties ([#2420](https://github.com/typescript-eslint/typescript-eslint/issues/2420)) ([cd84549](https://github.com/typescript-eslint/typescript-eslint/commit/cd84549beba3cf471d75cfd9ba26f80366842ed5)) ### Features -* support ESTree optional chaining representation ([#2308](https://github.com/typescript-eslint/typescript-eslint/issues/2308)) ([e9d2ab6](https://github.com/typescript-eslint/typescript-eslint/commit/e9d2ab638b6767700b52797e74b814ea059beaae)) - - - - +- support ESTree optional chaining representation ([#2308](https://github.com/typescript-eslint/typescript-eslint/issues/2308)) ([e9d2ab6](https://github.com/typescript-eslint/typescript-eslint/commit/e9d2ab638b6767700b52797e74b814ea059beaae)) ## [3.10.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.10.0...v3.10.1) (2020-08-25) **Note:** Version bump only for package @typescript-eslint/scope-manager - - - - # [3.10.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.9.1...v3.10.0) (2020-08-24) **Note:** Version bump only for package @typescript-eslint/scope-manager - - - - ## [3.9.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.9.0...v3.9.1) (2020-08-17) **Note:** Version bump only for package @typescript-eslint/scope-manager - - - - # [3.9.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.8.0...v3.9.0) (2020-08-10) - ### Features -* **typescript-estree:** support TSv4 labelled tuple members ([#2378](https://github.com/typescript-eslint/typescript-eslint/issues/2378)) ([00d84ff](https://github.com/typescript-eslint/typescript-eslint/commit/00d84ffbcbe9d0ec98bdb2f2ce59959a27ce4dbe)) - - - - +- **typescript-estree:** support TSv4 labelled tuple members ([#2378](https://github.com/typescript-eslint/typescript-eslint/issues/2378)) ([00d84ff](https://github.com/typescript-eslint/typescript-eslint/commit/00d84ffbcbe9d0ec98bdb2f2ce59959a27ce4dbe)) # [3.8.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.7.1...v3.8.0) (2020-08-03) **Note:** Version bump only for package @typescript-eslint/scope-manager - - - - ## [3.7.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.7.0...v3.7.1) (2020-07-27) **Note:** Version bump only for package @typescript-eslint/scope-manager - - - - # [3.7.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.6.1...v3.7.0) (2020-07-20) **Note:** Version bump only for package @typescript-eslint/scope-manager - - - - ## [3.6.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.6.0...v3.6.1) (2020-07-13) **Note:** Version bump only for package @typescript-eslint/scope-manager - - - - # [3.6.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.5.0...v3.6.0) (2020-07-06) **Note:** Version bump only for package @typescript-eslint/scope-manager - - - - # [3.5.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.4.0...v3.5.0) (2020-06-29) - ### Features -* add package scope-manager ([#1939](https://github.com/typescript-eslint/typescript-eslint/issues/1939)) ([682eb7e](https://github.com/typescript-eslint/typescript-eslint/commit/682eb7e009c3f22a542882dfd3602196a60d2a1e)) +- add package scope-manager ([#1939](https://github.com/typescript-eslint/typescript-eslint/issues/1939)) ([682eb7e](https://github.com/typescript-eslint/typescript-eslint/commit/682eb7e009c3f22a542882dfd3602196a60d2a1e)) diff --git a/packages/scope-manager/LICENSE b/packages/scope-manager/LICENSE index 7e7370143b2..a1164108d4d 100644 --- a/packages/scope-manager/LICENSE +++ b/packages/scope-manager/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2019 TypeScript ESLint and other contributors +Copyright (c) 2019 typescript-eslint and other contributors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/packages/scope-manager/README.md b/packages/scope-manager/README.md index d51f7716ef4..0258932e390 100644 --- a/packages/scope-manager/README.md +++ b/packages/scope-manager/README.md @@ -1,120 +1,8 @@ -

TypeScript Scope Manager

+# `@typescript-eslint/scope-manager` -

- CI - NPM Version - NPM Downloads -

+[![NPM Version](https://img.shields.io/npm/v/@typescript-eslint/scope-manager.svg?style=flat-square)](https://www.npmjs.com/package/@typescript-eslint/scope-manager) +[![NPM Downloads](https://img.shields.io/npm/dm/@typescript-eslint/scope-manager.svg?style=flat-square)](https://www.npmjs.com/package/@typescript-eslint/scope-manager) -This is a fork of [`eslint-scope`](https://github.com/eslint/eslint-scope), enhanced to support TypeScript functionality. -[You can view the original license for the code here](https://github.com/eslint/eslint-scope/blob/dbddf14d5771b21b5da704213e4508c660ca1c64/LICENSE). +👉 See **https://typescript-eslint.io/architecture/scope-manager** for documentation on this package. -This package is consumed automatically by [`@typescript-eslint/parser`](../parser). -You probably don't want to use it directly. - -## Getting Started - -**[You can find our Getting Started docs here](https://typescript-eslint.io/docs/linting)** - -## Installation - -```bash -$ yarn add -D typescript @typescript-eslint/scope-manager -$ npm i --save-dev typescript @typescript-eslint/scope-manager -``` - -## API - -### `analyze(tree, options)` - -Analyses a given AST and returns the resulting `ScopeManager`. - -```ts -interface AnalyzeOptions { - /** - * Known visitor keys. - */ - childVisitorKeys?: Record | null; - - /** - * Which ECMAScript version is considered. - * Defaults to `2018`. - * `'latest'` is converted to 1e8 at parser. - */ - ecmaVersion?: EcmaVersion | 1e8; - - /** - * Whether the whole script is executed under node.js environment. - * When enabled, the scope manager adds a function scope immediately following the global scope. - * Defaults to `false`. - */ - globalReturn?: boolean; - - /** - * Implied strict mode (if ecmaVersion >= 5). - * Defaults to `false`. - */ - impliedStrict?: boolean; - - /** - * The identifier that's used for JSX Element creation (after transpilation). - * This should not be a member expression - just the root identifier (i.e. use "React" instead of "React.createElement"). - * Defaults to `"React"`. - */ - jsxPragma?: string; - - /** - * The identifier that's used for JSX fragment elements (after transpilation). - * If `null`, assumes transpilation will always use a member on `jsxFactory` (i.e. React.Fragment). - * This should not be a member expression - just the root identifier (i.e. use "h" instead of "h.Fragment"). - * Defaults to `null`. - */ - jsxFragmentName?: string | null; - - /** - * The lib used by the project. - * This automatically defines a type variable for any types provided by the configured TS libs. - * For more information, see https://www.typescriptlang.org/tsconfig#lib - * - * Defaults to the lib for the provided `ecmaVersion`. - */ - lib?: Lib[]; - - /** - * The source type of the script. - */ - sourceType?: 'script' | 'module'; - - /** - * Emit design-type metadata for decorated declarations in source. - * Defaults to `false`. - */ - emitDecoratorMetadata?: boolean; -} -``` - -Example usage: - -```ts -import { analyze } from '@typescript-eslint/scope-manager'; -import { parse } from '@typescript-eslint/typescript-estree'; - -const code = `const hello: string = 'world';`; -const ast = parse(code, { - // note that scope-manager requires ranges on the AST - range: true, -}); -const scope = analyze(ast, { - ecmaVersion: 2020, - sourceType: 'module', -}); -``` - -## References - -- https://eslint.org/docs/developer-guide/scope-manager-interface -- https://github.com/eslint/eslint-scope - -## Contributing - -[See the contributing guide here](../../CONTRIBUTING.md) +> See https://typescript-eslint.io for general documentation on typescript-eslint, the tooling that allows you to run ESLint and Prettier on TypeScript code. diff --git a/packages/scope-manager/jest.config.js b/packages/scope-manager/jest.config.js index 9148e4d46fb..e9aff2600f8 100644 --- a/packages/scope-manager/jest.config.js +++ b/packages/scope-manager/jest.config.js @@ -1,8 +1,14 @@ 'use strict'; // @ts-check + +const baseConfig = require('../../jest.config.base.js'); + /** @type {import('@jest/types').Config.InitialOptions} */ module.exports = { - ...require('../../jest.config.base.js'), - setupFilesAfterEnv: ['./tests/util/serializers/index.ts'], + ...baseConfig, + setupFilesAfterEnv: [ + ...baseConfig.setupFilesAfterEnv, + './tests/util/serializers/index.ts', + ], }; diff --git a/packages/scope-manager/package.json b/packages/scope-manager/package.json index cf66eeae3e3..afa72f7662a 100644 --- a/packages/scope-manager/package.json +++ b/packages/scope-manager/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/scope-manager", - "version": "5.31.0", + "version": "5.50.0", "description": "TypeScript scope analyser for ESLint", "keywords": [ "eslint", @@ -28,22 +28,22 @@ "main": "dist/index.js", "types": "dist/index.d.ts", "scripts": { - "build": "cd ../../ && nx build @typescript-eslint/scope-manager", - "clean": "cd ../../ && nx clean @typescript-eslint/scope-manager", - "clean-fixtures": "cd ../../ && nx clean-fixtures @typescript-eslint/scope-manager", + "build": "nx build", + "clean": "nx clean", + "clean-fixtures": "nx clean-fixtures", "format": "prettier --write \"./**/*.{ts,mts,cts,tsx,js,mjs,cjs,jsx,json,md,css}\" --ignore-path ../../.prettierignore", - "generate:lib": "cd ../../ && nx generate-lib @typescript-eslint/scope-manager", - "lint": "cd ../../ && nx lint @typescript-eslint/scope-manager", - "test": "cd ../../ && nx test @typescript-eslint/scope-manager --code-coverage", - "typecheck": "cd ../../ && nx typecheck @typescript-eslint/scope-manager" + "generate:lib": "nx generate-lib", + "lint": "nx lint", + "test": "nx test --code-coverage", + "typecheck": "nx typecheck" }, "dependencies": { - "@typescript-eslint/types": "5.31.0", - "@typescript-eslint/visitor-keys": "5.31.0" + "@typescript-eslint/types": "5.50.0", + "@typescript-eslint/visitor-keys": "5.50.0" }, "devDependencies": { "@types/glob": "*", - "@typescript-eslint/typescript-estree": "5.31.0", + "@typescript-eslint/typescript-estree": "5.50.0", "glob": "*", "jest-specific-snapshot": "*", "make-dir": "*", diff --git a/packages/scope-manager/project.json b/packages/scope-manager/project.json index 7753d267f39..9694ae86163 100644 --- a/packages/scope-manager/project.json +++ b/packages/scope-manager/project.json @@ -1,14 +1,12 @@ { - "root": "packages/scope-manager", + "name": "scope-manager", + "$schema": "../../node_modules/nx/schemas/project-schema.json", "sourceRoot": "packages/scope-manager/src", "projectType": "library", "targets": { "build": { - "executor": "@nrwl/workspace:run-commands", - "outputs": [ - "packages/scope-manager/dist", - "packages/scope-manager/_ts3.4" - ], + "executor": "nx:run-commands", + "outputs": ["{projectRoot}/dist", "{projectRoot}/_ts3.4"], "options": { "parallel": false, "cwd": "packages/scope-manager", @@ -20,7 +18,7 @@ } }, "typecheck": { - "executor": "@nrwl/workspace:run-commands", + "executor": "nx:run-commands", "options": { "parallel": true, "cwd": "packages/scope-manager", @@ -31,7 +29,7 @@ } }, "clean": { - "executor": "@nrwl/workspace:run-commands", + "executor": "nx:run-commands", "options": { "parallel": false, "cwd": "packages/scope-manager", @@ -44,7 +42,7 @@ } }, "clean-fixtures": { - "executor": "@nrwl/workspace:run-commands", + "executor": "nx:run-commands", "options": { "parallel": false, "cwd": "packages/scope-manager", @@ -55,26 +53,23 @@ "executor": "@nrwl/linter:eslint", "outputs": ["{options.outputFile}"], "options": { - "lintFilePatterns": ["packages/scope-manager/**/*.{ts,js}"], - "ignorePath": ".eslintignore" + "lintFilePatterns": ["packages/scope-manager/**/*.ts"] } }, "test": { "executor": "@nrwl/jest:jest", - "outputs": ["packages/scope-manager/coverage"], + "outputs": ["{projectRoot}/coverage"], "options": { "jestConfig": "packages/scope-manager/jest.config.js", "passWithNoTests": true } }, "generate-lib": { - "executor": "@nrwl/workspace:run-commands", + "executor": "nx:run-commands", "options": { "parallel": false, "cwd": "packages/scope-manager", - "commands": [ - "../../node_modules/.bin/ts-node --files --transpile-only tools/generate-lib.ts" - ] + "commands": ["yarn tsx tools/generate-lib.ts"] } } }, diff --git a/packages/scope-manager/src/ScopeManager.ts b/packages/scope-manager/src/ScopeManager.ts index 7be6811114b..7f4b2a5f705 100644 --- a/packages/scope-manager/src/ScopeManager.ts +++ b/packages/scope-manager/src/ScopeManager.ts @@ -1,5 +1,7 @@ -import { TSESTree } from '@typescript-eslint/types'; +import type { TSESTree } from '@typescript-eslint/types'; + import { assert } from './assert'; +import type { Scope } from './scope'; import { BlockScope, CatchScope, @@ -12,7 +14,6 @@ import { GlobalScope, MappedTypeScope, ModuleScope, - Scope, SwitchScope, TSEnumScope, TSModuleScope, @@ -21,8 +22,7 @@ import { } from './scope'; import { ClassFieldInitializerScope } from './scope/ClassFieldInitializerScope'; import { ClassStaticBlockScope } from './scope/ClassStaticBlockScope'; - -import { Variable } from './variable'; +import type { Variable } from './variable'; interface ScopeManagerOptions { globalReturn?: boolean; @@ -140,7 +140,7 @@ class ScopeManager { protected nestScope(scope: T): T; protected nestScope(scope: Scope): Scope { if (scope instanceof GlobalScope) { - assert(this.currentScope === null); + assert(this.currentScope == null); this.globalScope = scope; } this.currentScope = scope; diff --git a/packages/scope-manager/src/analyze.ts b/packages/scope-manager/src/analyze.ts index febd7a26652..8e8e0d83406 100644 --- a/packages/scope-manager/src/analyze.ts +++ b/packages/scope-manager/src/analyze.ts @@ -1,12 +1,14 @@ -import { TSESTree, EcmaVersion, Lib } from '@typescript-eslint/types'; +import type { EcmaVersion, Lib, TSESTree } from '@typescript-eslint/types'; import { visitorKeys } from '@typescript-eslint/visitor-keys'; -import { Referencer, ReferencerOptions } from './referencer'; -import { ScopeManager } from './ScopeManager'; + import { lib as TSLibraries } from './lib'; +import type { ReferencerOptions } from './referencer'; +import { Referencer } from './referencer'; +import { ScopeManager } from './ScopeManager'; -//////////////////////////////////////////////////// -// MAKE SURE THIS IS KEPT IN SYNC WITH THE README // -//////////////////////////////////////////////////// +////////////////////////////////////////////////////////// +// MAKE SURE THIS IS KEPT IN SYNC WITH THE WEBSITE DOCS // +////////////////////////////////////////////////////////// interface AnalyzeOptions { /** diff --git a/packages/scope-manager/src/definition/CatchClauseDefinition.ts b/packages/scope-manager/src/definition/CatchClauseDefinition.ts index 1bfb569e044..10dccb9d25f 100644 --- a/packages/scope-manager/src/definition/CatchClauseDefinition.ts +++ b/packages/scope-manager/src/definition/CatchClauseDefinition.ts @@ -1,6 +1,7 @@ -import { TSESTree } from '@typescript-eslint/types'; -import { DefinitionType } from './DefinitionType'; +import type { TSESTree } from '@typescript-eslint/types'; + import { DefinitionBase } from './DefinitionBase'; +import { DefinitionType } from './DefinitionType'; class CatchClauseDefinition extends DefinitionBase< DefinitionType.CatchClause, diff --git a/packages/scope-manager/src/definition/ClassNameDefinition.ts b/packages/scope-manager/src/definition/ClassNameDefinition.ts index 5d587b342ad..62e1d4ad3f3 100644 --- a/packages/scope-manager/src/definition/ClassNameDefinition.ts +++ b/packages/scope-manager/src/definition/ClassNameDefinition.ts @@ -1,6 +1,7 @@ -import { TSESTree } from '@typescript-eslint/types'; -import { DefinitionType } from './DefinitionType'; +import type { TSESTree } from '@typescript-eslint/types'; + import { DefinitionBase } from './DefinitionBase'; +import { DefinitionType } from './DefinitionType'; class ClassNameDefinition extends DefinitionBase< DefinitionType.ClassName, diff --git a/packages/scope-manager/src/definition/Definition.ts b/packages/scope-manager/src/definition/Definition.ts index 19814bf892d..35b380ee662 100644 --- a/packages/scope-manager/src/definition/Definition.ts +++ b/packages/scope-manager/src/definition/Definition.ts @@ -1,14 +1,14 @@ -import { CatchClauseDefinition } from './CatchClauseDefinition'; -import { ClassNameDefinition } from './ClassNameDefinition'; -import { FunctionNameDefinition } from './FunctionNameDefinition'; -import { ImplicitGlobalVariableDefinition } from './ImplicitGlobalVariableDefinition'; -import { ImportBindingDefinition } from './ImportBindingDefinition'; -import { ParameterDefinition } from './ParameterDefinition'; -import { TSEnumMemberDefinition } from './TSEnumMemberDefinition'; -import { TSEnumNameDefinition } from './TSEnumNameDefinition'; -import { TSModuleNameDefinition } from './TSModuleNameDefinition'; -import { TypeDefinition } from './TypeDefinition'; -import { VariableDefinition } from './VariableDefinition'; +import type { CatchClauseDefinition } from './CatchClauseDefinition'; +import type { ClassNameDefinition } from './ClassNameDefinition'; +import type { FunctionNameDefinition } from './FunctionNameDefinition'; +import type { ImplicitGlobalVariableDefinition } from './ImplicitGlobalVariableDefinition'; +import type { ImportBindingDefinition } from './ImportBindingDefinition'; +import type { ParameterDefinition } from './ParameterDefinition'; +import type { TSEnumMemberDefinition } from './TSEnumMemberDefinition'; +import type { TSEnumNameDefinition } from './TSEnumNameDefinition'; +import type { TSModuleNameDefinition } from './TSModuleNameDefinition'; +import type { TypeDefinition } from './TypeDefinition'; +import type { VariableDefinition } from './VariableDefinition'; type Definition = | CatchClauseDefinition diff --git a/packages/scope-manager/src/definition/DefinitionBase.ts b/packages/scope-manager/src/definition/DefinitionBase.ts index 7147ebc60ed..2418e5e8af4 100644 --- a/packages/scope-manager/src/definition/DefinitionBase.ts +++ b/packages/scope-manager/src/definition/DefinitionBase.ts @@ -1,6 +1,7 @@ -import { TSESTree } from '@typescript-eslint/types'; -import { DefinitionType } from './DefinitionType'; +import type { TSESTree } from '@typescript-eslint/types'; + import { createIdGenerator } from '../ID'; +import type { DefinitionType } from './DefinitionType'; const generator = createIdGenerator(); diff --git a/packages/scope-manager/src/definition/FunctionNameDefinition.ts b/packages/scope-manager/src/definition/FunctionNameDefinition.ts index b4cf2405552..8c42adfb005 100644 --- a/packages/scope-manager/src/definition/FunctionNameDefinition.ts +++ b/packages/scope-manager/src/definition/FunctionNameDefinition.ts @@ -1,6 +1,7 @@ -import { TSESTree } from '@typescript-eslint/types'; -import { DefinitionType } from './DefinitionType'; +import type { TSESTree } from '@typescript-eslint/types'; + import { DefinitionBase } from './DefinitionBase'; +import { DefinitionType } from './DefinitionType'; class FunctionNameDefinition extends DefinitionBase< DefinitionType.FunctionName, diff --git a/packages/scope-manager/src/definition/ImplicitGlobalVariableDefinition.ts b/packages/scope-manager/src/definition/ImplicitGlobalVariableDefinition.ts index 43012c0fce9..35c2a5b7f7d 100644 --- a/packages/scope-manager/src/definition/ImplicitGlobalVariableDefinition.ts +++ b/packages/scope-manager/src/definition/ImplicitGlobalVariableDefinition.ts @@ -1,6 +1,7 @@ -import { TSESTree } from '@typescript-eslint/types'; -import { DefinitionType } from './DefinitionType'; +import type { TSESTree } from '@typescript-eslint/types'; + import { DefinitionBase } from './DefinitionBase'; +import { DefinitionType } from './DefinitionType'; class ImplicitGlobalVariableDefinition extends DefinitionBase< DefinitionType.ImplicitGlobalVariable, diff --git a/packages/scope-manager/src/definition/ImportBindingDefinition.ts b/packages/scope-manager/src/definition/ImportBindingDefinition.ts index 874edadf5e9..2003158b84e 100644 --- a/packages/scope-manager/src/definition/ImportBindingDefinition.ts +++ b/packages/scope-manager/src/definition/ImportBindingDefinition.ts @@ -1,6 +1,7 @@ -import { TSESTree } from '@typescript-eslint/types'; -import { DefinitionType } from './DefinitionType'; +import type { TSESTree } from '@typescript-eslint/types'; + import { DefinitionBase } from './DefinitionBase'; +import { DefinitionType } from './DefinitionType'; class ImportBindingDefinition extends DefinitionBase< DefinitionType.ImportBinding, diff --git a/packages/scope-manager/src/definition/ParameterDefinition.ts b/packages/scope-manager/src/definition/ParameterDefinition.ts index b0c0ea3280d..631d2df663e 100644 --- a/packages/scope-manager/src/definition/ParameterDefinition.ts +++ b/packages/scope-manager/src/definition/ParameterDefinition.ts @@ -1,6 +1,7 @@ -import { TSESTree } from '@typescript-eslint/types'; -import { DefinitionType } from './DefinitionType'; +import type { TSESTree } from '@typescript-eslint/types'; + import { DefinitionBase } from './DefinitionBase'; +import { DefinitionType } from './DefinitionType'; class ParameterDefinition extends DefinitionBase< DefinitionType.Parameter, diff --git a/packages/scope-manager/src/definition/TSEnumMemberDefinition.ts b/packages/scope-manager/src/definition/TSEnumMemberDefinition.ts index cff6bbaa6d1..a4380cc3878 100644 --- a/packages/scope-manager/src/definition/TSEnumMemberDefinition.ts +++ b/packages/scope-manager/src/definition/TSEnumMemberDefinition.ts @@ -1,6 +1,7 @@ -import { TSESTree } from '@typescript-eslint/types'; -import { DefinitionType } from './DefinitionType'; +import type { TSESTree } from '@typescript-eslint/types'; + import { DefinitionBase } from './DefinitionBase'; +import { DefinitionType } from './DefinitionType'; class TSEnumMemberDefinition extends DefinitionBase< DefinitionType.TSEnumMember, diff --git a/packages/scope-manager/src/definition/TSEnumNameDefinition.ts b/packages/scope-manager/src/definition/TSEnumNameDefinition.ts index 5374a56260a..094047dae6e 100644 --- a/packages/scope-manager/src/definition/TSEnumNameDefinition.ts +++ b/packages/scope-manager/src/definition/TSEnumNameDefinition.ts @@ -1,6 +1,7 @@ -import { TSESTree } from '@typescript-eslint/types'; -import { DefinitionType } from './DefinitionType'; +import type { TSESTree } from '@typescript-eslint/types'; + import { DefinitionBase } from './DefinitionBase'; +import { DefinitionType } from './DefinitionType'; class TSEnumNameDefinition extends DefinitionBase< DefinitionType.TSEnumName, diff --git a/packages/scope-manager/src/definition/TSModuleNameDefinition.ts b/packages/scope-manager/src/definition/TSModuleNameDefinition.ts index 98f907789b7..bad778f9b6d 100644 --- a/packages/scope-manager/src/definition/TSModuleNameDefinition.ts +++ b/packages/scope-manager/src/definition/TSModuleNameDefinition.ts @@ -1,6 +1,7 @@ -import { TSESTree } from '@typescript-eslint/types'; -import { DefinitionType } from './DefinitionType'; +import type { TSESTree } from '@typescript-eslint/types'; + import { DefinitionBase } from './DefinitionBase'; +import { DefinitionType } from './DefinitionType'; class TSModuleNameDefinition extends DefinitionBase< DefinitionType.TSModuleName, diff --git a/packages/scope-manager/src/definition/TypeDefinition.ts b/packages/scope-manager/src/definition/TypeDefinition.ts index ad3b4368791..506274d4273 100644 --- a/packages/scope-manager/src/definition/TypeDefinition.ts +++ b/packages/scope-manager/src/definition/TypeDefinition.ts @@ -1,6 +1,7 @@ -import { TSESTree } from '@typescript-eslint/types'; -import { DefinitionType } from './DefinitionType'; +import type { TSESTree } from '@typescript-eslint/types'; + import { DefinitionBase } from './DefinitionBase'; +import { DefinitionType } from './DefinitionType'; class TypeDefinition extends DefinitionBase< DefinitionType.Type, diff --git a/packages/scope-manager/src/definition/VariableDefinition.ts b/packages/scope-manager/src/definition/VariableDefinition.ts index 975c5886185..8883c4c3384 100644 --- a/packages/scope-manager/src/definition/VariableDefinition.ts +++ b/packages/scope-manager/src/definition/VariableDefinition.ts @@ -1,6 +1,7 @@ -import { TSESTree } from '@typescript-eslint/types'; -import { DefinitionType } from './DefinitionType'; +import type { TSESTree } from '@typescript-eslint/types'; + import { DefinitionBase } from './DefinitionBase'; +import { DefinitionType } from './DefinitionType'; class VariableDefinition extends DefinitionBase< DefinitionType.Variable, diff --git a/packages/scope-manager/src/lib/dom.iterable.ts b/packages/scope-manager/src/lib/dom.iterable.ts index 094303434e3..1d43661478b 100644 --- a/packages/scope-manager/src/lib/dom.iterable.ts +++ b/packages/scope-manager/src/lib/dom.iterable.ts @@ -3,7 +3,7 @@ // RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: // npx nx generate-lib @typescript-eslint/scope-manager -import { ImplicitLibVariableOptions } from '../variable'; +import type { ImplicitLibVariableOptions } from '../variable'; import { TYPE } from './base-config'; export const dom_iterable = { @@ -13,6 +13,7 @@ export const dom_iterable = { CSSRuleList: TYPE, CSSStyleDeclaration: TYPE, Cache: TYPE, + CanvasPath: TYPE, CanvasPathDrawingStyles: TYPE, DOMRectList: TYPE, DOMStringList: TYPE, @@ -30,9 +31,6 @@ export const dom_iterable = { Headers: TYPE, IDBDatabase: TYPE, IDBObjectStore: TYPE, - MIDIInputMap: TYPE, - MIDIOutput: TYPE, - MIDIOutputMap: TYPE, MediaKeyStatusMap: TYPE, MediaList: TYPE, MessageEvent: TYPE, diff --git a/packages/scope-manager/src/lib/dom.ts b/packages/scope-manager/src/lib/dom.ts index e862fbc92d4..1087a238dfc 100644 --- a/packages/scope-manager/src/lib/dom.ts +++ b/packages/scope-manager/src/lib/dom.ts @@ -3,7 +3,7 @@ // RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: // npx nx generate-lib @typescript-eslint/scope-manager -import { ImplicitLibVariableOptions } from '../variable'; +import type { ImplicitLibVariableOptions } from '../variable'; import { TYPE, TYPE_VALUE } from './base-config'; export const dom = { @@ -66,7 +66,7 @@ export const dom = { DeviceMotionEventInit: TYPE, DeviceMotionEventRotationRateInit: TYPE, DeviceOrientationEventInit: TYPE, - DisplayMediaStreamConstraints: TYPE, + DisplayMediaStreamOptions: TYPE, DocumentTimelineOptions: TYPE, DoubleRange: TYPE, DragEventInit: TYPE, @@ -108,6 +108,7 @@ export const dom = { IDBDatabaseInfo: TYPE, IDBIndexParameters: TYPE, IDBObjectStoreParameters: TYPE, + IDBTransactionOptions: TYPE, IDBVersionChangeEventInit: TYPE, IIRFilterOptions: TYPE, IdleRequestOptions: TYPE, @@ -127,9 +128,6 @@ export const dom = { LockInfo: TYPE, LockManagerSnapshot: TYPE, LockOptions: TYPE, - MIDIConnectionEventInit: TYPE, - MIDIMessageEventInit: TYPE, - MIDIOptions: TYPE, MediaCapabilitiesDecodingInfo: TYPE, MediaCapabilitiesEncodingInfo: TYPE, MediaCapabilitiesInfo: TYPE, @@ -145,7 +143,6 @@ export const dom = { MediaMetadataInit: TYPE, MediaPositionState: TYPE, MediaQueryListEventInit: TYPE, - MediaRecorderErrorEventInit: TYPE, MediaRecorderOptions: TYPE, MediaSessionActionDetails: TYPE, MediaStreamAudioSourceOptions: TYPE, @@ -186,6 +183,7 @@ export const dom = { PeriodicWaveConstraints: TYPE, PeriodicWaveOptions: TYPE, PermissionDescriptor: TYPE, + PictureInPictureEventInit: TYPE, PointerEventInit: TYPE, PopStateEventInit: TYPE, PositionOptions: TYPE, @@ -245,8 +243,9 @@ export const dom = { RTCStats: TYPE, RTCTrackEventInit: TYPE, RTCTransportStats: TYPE, - ReadableStreamDefaultReadDoneResult: TYPE, - ReadableStreamDefaultReadValueResult: TYPE, + ReadableStreamGetReaderOptions: TYPE, + ReadableStreamReadDoneResult: TYPE, + ReadableStreamReadValueResult: TYPE, ReadableWritablePair: TYPE, RegistrationOptions: TYPE, RequestInit: TYPE, @@ -286,11 +285,14 @@ export const dom = { TransitionEventInit: TYPE, UIEventInit: TYPE, ULongRange: TYPE, + UnderlyingByteSource: TYPE, + UnderlyingDefaultSource: TYPE, UnderlyingSink: TYPE, UnderlyingSource: TYPE, + ValidityStateFlags: TYPE, VideoColorSpaceInit: TYPE, VideoConfiguration: TYPE, - VideoFrameMetadata: TYPE, + VideoFrameCallbackMetadata: TYPE, WaveShaperOptions: TYPE, WebGLContextAttributes: TYPE, WebGLContextEventInit: TYPE, @@ -349,12 +351,16 @@ export const dom = { CDATASection: TYPE_VALUE, CSSAnimation: TYPE_VALUE, CSSConditionRule: TYPE_VALUE, + CSSContainerRule: TYPE_VALUE, CSSCounterStyleRule: TYPE_VALUE, CSSFontFaceRule: TYPE_VALUE, + CSSFontPaletteValuesRule: TYPE_VALUE, CSSGroupingRule: TYPE_VALUE, CSSImportRule: TYPE_VALUE, CSSKeyframeRule: TYPE_VALUE, CSSKeyframesRule: TYPE_VALUE, + CSSLayerBlockRule: TYPE_VALUE, + CSSLayerStatementRule: TYPE_VALUE, CSSMediaRule: TYPE_VALUE, CSSNamespaceRule: TYPE_VALUE, CSSPageRule: TYPE_VALUE, @@ -450,8 +456,10 @@ export const dom = { EXT_frag_depth: TYPE, EXT_sRGB: TYPE, EXT_shader_texture_lod: TYPE, + EXT_texture_compression_bptc: TYPE, EXT_texture_compression_rgtc: TYPE, EXT_texture_filter_anisotropic: TYPE, + EXT_texture_norm16: TYPE, ElementEventMap: TYPE, Element: TYPE_VALUE, ElementCSSInlineStyle: TYPE, @@ -620,17 +628,6 @@ export const dom = { Location: TYPE_VALUE, Lock: TYPE_VALUE, LockManager: TYPE_VALUE, - MIDIAccessEventMap: TYPE, - MIDIAccess: TYPE_VALUE, - MIDIConnectionEvent: TYPE_VALUE, - MIDIInputEventMap: TYPE, - MIDIInput: TYPE_VALUE, - MIDIInputMap: TYPE_VALUE, - MIDIMessageEvent: TYPE_VALUE, - MIDIOutput: TYPE_VALUE, - MIDIOutputMap: TYPE_VALUE, - MIDIPortEventMap: TYPE, - MIDIPort: TYPE_VALUE, MathMLElementEventMap: TYPE, MathMLElement: TYPE_VALUE, MediaCapabilities: TYPE_VALUE, @@ -653,7 +650,6 @@ export const dom = { MediaQueryListEvent: TYPE_VALUE, MediaRecorderEventMap: TYPE, MediaRecorder: TYPE_VALUE, - MediaRecorderErrorEvent: TYPE_VALUE, MediaSession: TYPE_VALUE, MediaSourceEventMap: TYPE, MediaSource: TYPE_VALUE, @@ -684,11 +680,9 @@ export const dom = { NavigatorID: TYPE, NavigatorLanguage: TYPE, NavigatorLocks: TYPE, - NavigatorNetworkInformation: TYPE, NavigatorOnLine: TYPE, NavigatorPlugins: TYPE, NavigatorStorage: TYPE, - NetworkInformation: TYPE_VALUE, Node: TYPE_VALUE, NodeIterator: TYPE_VALUE, NodeList: TYPE_VALUE, @@ -697,6 +691,7 @@ export const dom = { NonElementParentNode: TYPE, NotificationEventMap: TYPE, Notification: TYPE_VALUE, + OES_draw_buffers_indexed: TYPE, OES_element_index_uint: TYPE, OES_fbo_render_mipmap: TYPE, OES_standard_derivatives: TYPE, @@ -709,6 +704,9 @@ export const dom = { OfflineAudioCompletionEvent: TYPE_VALUE, OfflineAudioContextEventMap: TYPE, OfflineAudioContext: TYPE_VALUE, + OffscreenCanvasEventMap: TYPE, + OffscreenCanvas: TYPE_VALUE, + OffscreenCanvasRenderingContext2D: TYPE_VALUE, OscillatorNode: TYPE_VALUE, OverconstrainedError: TYPE_VALUE, PageTransitionEvent: TYPE_VALUE, @@ -738,6 +736,7 @@ export const dom = { PermissionStatusEventMap: TYPE, PermissionStatus: TYPE_VALUE, Permissions: TYPE_VALUE, + PictureInPictureEvent: TYPE_VALUE, PictureInPictureWindowEventMap: TYPE, PictureInPictureWindow: TYPE_VALUE, Plugin: TYPE_VALUE, @@ -781,7 +780,10 @@ export const dom = { RTCTrackEvent: TYPE_VALUE, RadioNodeList: TYPE_VALUE, Range: TYPE_VALUE, + ReadableByteStreamController: TYPE_VALUE, ReadableStream: TYPE_VALUE, + ReadableStreamBYOBReader: TYPE_VALUE, + ReadableStreamBYOBRequest: TYPE_VALUE, ReadableStreamDefaultController: TYPE_VALUE, ReadableStreamDefaultReader: TYPE_VALUE, ReadableStreamGenericReader: TYPE, @@ -1122,11 +1124,12 @@ export const dom = { MessageEventSource: TYPE, MutationRecordType: TYPE, NamedCurve: TYPE, + OffscreenRenderingContext: TYPE, OnBeforeUnloadEventHandler: TYPE, OnErrorEventHandler: TYPE, PerformanceEntryList: TYPE, ReadableStreamController: TYPE, - ReadableStreamDefaultReadResult: TYPE, + ReadableStreamReadResult: TYPE, ReadableStreamReader: TYPE, RenderingContext: TYPE, RequestInfo: TYPE, @@ -1134,8 +1137,6 @@ export const dom = { TimerHandler: TYPE, Transferable: TYPE, Uint32List: TYPE, - UvmEntries: TYPE, - UvmEntry: TYPE, VibratePattern: TYPE, WindowProxy: TYPE, XMLHttpRequestBodyInit: TYPE, @@ -1170,7 +1171,6 @@ export const dom = { ColorSpaceConversion: TYPE, CompositeOperation: TYPE, CompositeOperationOrAuto: TYPE, - ConnectionType: TYPE, CredentialMediationRequirement: TYPE, DOMParserSupportedType: TYPE, DirectionSetting: TYPE, @@ -1201,9 +1201,6 @@ export const dom = { KeyUsage: TYPE, LineAlignSetting: TYPE, LockMode: TYPE, - MIDIPortConnectionState: TYPE, - MIDIPortDeviceState: TYPE, - MIDIPortType: TYPE, MediaDecodingType: TYPE, MediaDeviceKind: TYPE, MediaEncodingType: TYPE, @@ -1218,6 +1215,7 @@ export const dom = { NavigationTimingType: TYPE, NotificationDirection: TYPE, NotificationPermission: TYPE, + OffscreenRenderingContextId: TYPE, OrientationLockType: TYPE, OrientationType: TYPE, OscillatorType: TYPE, @@ -1242,7 +1240,6 @@ export const dom = { RTCIceCandidateType: TYPE, RTCIceComponent: TYPE, RTCIceConnectionState: TYPE, - RTCIceCredentialType: TYPE, RTCIceGathererState: TYPE, RTCIceGatheringState: TYPE, RTCIceProtocol: TYPE, @@ -1258,6 +1255,8 @@ export const dom = { RTCSignalingState: TYPE, RTCStatsIceCandidatePairState: TYPE, RTCStatsType: TYPE, + ReadableStreamReaderMode: TYPE, + ReadableStreamType: TYPE, ReadyState: TYPE, RecordingState: TYPE, ReferrerPolicy: TYPE, diff --git a/packages/scope-manager/src/lib/es2015.collection.ts b/packages/scope-manager/src/lib/es2015.collection.ts index 98933f1c1fd..51386ebcc74 100644 --- a/packages/scope-manager/src/lib/es2015.collection.ts +++ b/packages/scope-manager/src/lib/es2015.collection.ts @@ -3,8 +3,8 @@ // RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: // npx nx generate-lib @typescript-eslint/scope-manager -import { ImplicitLibVariableOptions } from '../variable'; -import { TYPE_VALUE, TYPE } from './base-config'; +import type { ImplicitLibVariableOptions } from '../variable'; +import { TYPE, TYPE_VALUE } from './base-config'; export const es2015_collection = { Map: TYPE_VALUE, diff --git a/packages/scope-manager/src/lib/es2015.core.ts b/packages/scope-manager/src/lib/es2015.core.ts index ba44cf290b4..f9475d7db1d 100644 --- a/packages/scope-manager/src/lib/es2015.core.ts +++ b/packages/scope-manager/src/lib/es2015.core.ts @@ -3,7 +3,7 @@ // RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: // npx nx generate-lib @typescript-eslint/scope-manager -import { ImplicitLibVariableOptions } from '../variable'; +import type { ImplicitLibVariableOptions } from '../variable'; import { TYPE } from './base-config'; export const es2015_core = { diff --git a/packages/scope-manager/src/lib/es2015.generator.ts b/packages/scope-manager/src/lib/es2015.generator.ts index f5dce9611ae..90d26e1ea0d 100644 --- a/packages/scope-manager/src/lib/es2015.generator.ts +++ b/packages/scope-manager/src/lib/es2015.generator.ts @@ -3,9 +3,9 @@ // RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: // npx nx generate-lib @typescript-eslint/scope-manager -import { ImplicitLibVariableOptions } from '../variable'; -import { es2015_iterable } from './es2015.iterable'; +import type { ImplicitLibVariableOptions } from '../variable'; import { TYPE } from './base-config'; +import { es2015_iterable } from './es2015.iterable'; export const es2015_generator = { ...es2015_iterable, diff --git a/packages/scope-manager/src/lib/es2015.iterable.ts b/packages/scope-manager/src/lib/es2015.iterable.ts index d27ab2efcc6..2ab60a44b84 100644 --- a/packages/scope-manager/src/lib/es2015.iterable.ts +++ b/packages/scope-manager/src/lib/es2015.iterable.ts @@ -3,9 +3,9 @@ // RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: // npx nx generate-lib @typescript-eslint/scope-manager -import { ImplicitLibVariableOptions } from '../variable'; -import { es2015_symbol } from './es2015.symbol'; +import type { ImplicitLibVariableOptions } from '../variable'; import { TYPE } from './base-config'; +import { es2015_symbol } from './es2015.symbol'; export const es2015_iterable = { ...es2015_symbol, diff --git a/packages/scope-manager/src/lib/es2015.promise.ts b/packages/scope-manager/src/lib/es2015.promise.ts index 1334b2abca4..a3896e0f46f 100644 --- a/packages/scope-manager/src/lib/es2015.promise.ts +++ b/packages/scope-manager/src/lib/es2015.promise.ts @@ -3,7 +3,7 @@ // RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: // npx nx generate-lib @typescript-eslint/scope-manager -import { ImplicitLibVariableOptions } from '../variable'; +import type { ImplicitLibVariableOptions } from '../variable'; import { TYPE } from './base-config'; export const es2015_promise = { diff --git a/packages/scope-manager/src/lib/es2015.proxy.ts b/packages/scope-manager/src/lib/es2015.proxy.ts index d2c0d9b6616..2dbc6e22263 100644 --- a/packages/scope-manager/src/lib/es2015.proxy.ts +++ b/packages/scope-manager/src/lib/es2015.proxy.ts @@ -3,7 +3,7 @@ // RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: // npx nx generate-lib @typescript-eslint/scope-manager -import { ImplicitLibVariableOptions } from '../variable'; +import type { ImplicitLibVariableOptions } from '../variable'; import { TYPE } from './base-config'; export const es2015_proxy = { diff --git a/packages/scope-manager/src/lib/es2015.reflect.ts b/packages/scope-manager/src/lib/es2015.reflect.ts index 4a71e4b9def..dcc2a5d910b 100644 --- a/packages/scope-manager/src/lib/es2015.reflect.ts +++ b/packages/scope-manager/src/lib/es2015.reflect.ts @@ -3,7 +3,7 @@ // RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: // npx nx generate-lib @typescript-eslint/scope-manager -import { ImplicitLibVariableOptions } from '../variable'; +import type { ImplicitLibVariableOptions } from '../variable'; import { TYPE_VALUE } from './base-config'; export const es2015_reflect = { diff --git a/packages/scope-manager/src/lib/es2015.symbol.ts b/packages/scope-manager/src/lib/es2015.symbol.ts index c027cae3b38..eef09036f87 100644 --- a/packages/scope-manager/src/lib/es2015.symbol.ts +++ b/packages/scope-manager/src/lib/es2015.symbol.ts @@ -3,7 +3,7 @@ // RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: // npx nx generate-lib @typescript-eslint/scope-manager -import { ImplicitLibVariableOptions } from '../variable'; +import type { ImplicitLibVariableOptions } from '../variable'; import { TYPE } from './base-config'; export const es2015_symbol = { diff --git a/packages/scope-manager/src/lib/es2015.symbol.wellknown.ts b/packages/scope-manager/src/lib/es2015.symbol.wellknown.ts index 16d88e5ca57..94fd4ac4e70 100644 --- a/packages/scope-manager/src/lib/es2015.symbol.wellknown.ts +++ b/packages/scope-manager/src/lib/es2015.symbol.wellknown.ts @@ -3,9 +3,9 @@ // RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: // npx nx generate-lib @typescript-eslint/scope-manager -import { ImplicitLibVariableOptions } from '../variable'; -import { es2015_symbol } from './es2015.symbol'; +import type { ImplicitLibVariableOptions } from '../variable'; import { TYPE } from './base-config'; +import { es2015_symbol } from './es2015.symbol'; export const es2015_symbol_wellknown = { ...es2015_symbol, diff --git a/packages/scope-manager/src/lib/es2015.ts b/packages/scope-manager/src/lib/es2015.ts index 9e225bddb33..f6a8aa8ab73 100644 --- a/packages/scope-manager/src/lib/es2015.ts +++ b/packages/scope-manager/src/lib/es2015.ts @@ -3,12 +3,12 @@ // RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: // npx nx generate-lib @typescript-eslint/scope-manager -import { ImplicitLibVariableOptions } from '../variable'; +import type { ImplicitLibVariableOptions } from '../variable'; import { es5 } from './es5'; -import { es2015_core } from './es2015.core'; import { es2015_collection } from './es2015.collection'; -import { es2015_iterable } from './es2015.iterable'; +import { es2015_core } from './es2015.core'; import { es2015_generator } from './es2015.generator'; +import { es2015_iterable } from './es2015.iterable'; import { es2015_promise } from './es2015.promise'; import { es2015_proxy } from './es2015.proxy'; import { es2015_reflect } from './es2015.reflect'; diff --git a/packages/scope-manager/src/lib/es2016.array.include.ts b/packages/scope-manager/src/lib/es2016.array.include.ts index 7cab0a4c84d..17c927bd467 100644 --- a/packages/scope-manager/src/lib/es2016.array.include.ts +++ b/packages/scope-manager/src/lib/es2016.array.include.ts @@ -3,7 +3,7 @@ // RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: // npx nx generate-lib @typescript-eslint/scope-manager -import { ImplicitLibVariableOptions } from '../variable'; +import type { ImplicitLibVariableOptions } from '../variable'; import { TYPE } from './base-config'; export const es2016_array_include = { diff --git a/packages/scope-manager/src/lib/es2016.full.ts b/packages/scope-manager/src/lib/es2016.full.ts index cfc4632c7da..e7fb9802cb7 100644 --- a/packages/scope-manager/src/lib/es2016.full.ts +++ b/packages/scope-manager/src/lib/es2016.full.ts @@ -3,12 +3,12 @@ // RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: // npx nx generate-lib @typescript-eslint/scope-manager -import { ImplicitLibVariableOptions } from '../variable'; -import { es2016 } from './es2016'; +import type { ImplicitLibVariableOptions } from '../variable'; import { dom } from './dom'; -import { webworker_importscripts } from './webworker.importscripts'; -import { scripthost } from './scripthost'; import { dom_iterable } from './dom.iterable'; +import { es2016 } from './es2016'; +import { scripthost } from './scripthost'; +import { webworker_importscripts } from './webworker.importscripts'; export const es2016_full = { ...es2016, diff --git a/packages/scope-manager/src/lib/es2016.ts b/packages/scope-manager/src/lib/es2016.ts index f4ac61374c3..f00abac6c4f 100644 --- a/packages/scope-manager/src/lib/es2016.ts +++ b/packages/scope-manager/src/lib/es2016.ts @@ -3,7 +3,7 @@ // RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: // npx nx generate-lib @typescript-eslint/scope-manager -import { ImplicitLibVariableOptions } from '../variable'; +import type { ImplicitLibVariableOptions } from '../variable'; import { es2015 } from './es2015'; import { es2016_array_include } from './es2016.array.include'; diff --git a/packages/scope-manager/src/lib/es2017.full.ts b/packages/scope-manager/src/lib/es2017.full.ts index 26d2c2b1f8c..a1d8c386bb4 100644 --- a/packages/scope-manager/src/lib/es2017.full.ts +++ b/packages/scope-manager/src/lib/es2017.full.ts @@ -3,12 +3,12 @@ // RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: // npx nx generate-lib @typescript-eslint/scope-manager -import { ImplicitLibVariableOptions } from '../variable'; -import { es2017 } from './es2017'; +import type { ImplicitLibVariableOptions } from '../variable'; import { dom } from './dom'; -import { webworker_importscripts } from './webworker.importscripts'; -import { scripthost } from './scripthost'; import { dom_iterable } from './dom.iterable'; +import { es2017 } from './es2017'; +import { scripthost } from './scripthost'; +import { webworker_importscripts } from './webworker.importscripts'; export const es2017_full = { ...es2017, diff --git a/packages/scope-manager/src/lib/es2017.intl.ts b/packages/scope-manager/src/lib/es2017.intl.ts index 48e7fe21715..b8f1325672e 100644 --- a/packages/scope-manager/src/lib/es2017.intl.ts +++ b/packages/scope-manager/src/lib/es2017.intl.ts @@ -3,7 +3,7 @@ // RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: // npx nx generate-lib @typescript-eslint/scope-manager -import { ImplicitLibVariableOptions } from '../variable'; +import type { ImplicitLibVariableOptions } from '../variable'; import { TYPE_VALUE } from './base-config'; export const es2017_intl = { diff --git a/packages/scope-manager/src/lib/es2017.object.ts b/packages/scope-manager/src/lib/es2017.object.ts index 17344ec6591..66bea4e7d3f 100644 --- a/packages/scope-manager/src/lib/es2017.object.ts +++ b/packages/scope-manager/src/lib/es2017.object.ts @@ -3,7 +3,7 @@ // RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: // npx nx generate-lib @typescript-eslint/scope-manager -import { ImplicitLibVariableOptions } from '../variable'; +import type { ImplicitLibVariableOptions } from '../variable'; import { TYPE } from './base-config'; export const es2017_object = { diff --git a/packages/scope-manager/src/lib/es2017.sharedmemory.ts b/packages/scope-manager/src/lib/es2017.sharedmemory.ts index d5f3c8970b2..998d41493fd 100644 --- a/packages/scope-manager/src/lib/es2017.sharedmemory.ts +++ b/packages/scope-manager/src/lib/es2017.sharedmemory.ts @@ -3,10 +3,10 @@ // RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: // npx nx generate-lib @typescript-eslint/scope-manager -import { ImplicitLibVariableOptions } from '../variable'; +import type { ImplicitLibVariableOptions } from '../variable'; +import { TYPE, TYPE_VALUE } from './base-config'; import { es2015_symbol } from './es2015.symbol'; import { es2015_symbol_wellknown } from './es2015.symbol.wellknown'; -import { TYPE_VALUE, TYPE } from './base-config'; export const es2017_sharedmemory = { ...es2015_symbol, diff --git a/packages/scope-manager/src/lib/es2017.string.ts b/packages/scope-manager/src/lib/es2017.string.ts index 8ca832f3cf8..64ec52f3074 100644 --- a/packages/scope-manager/src/lib/es2017.string.ts +++ b/packages/scope-manager/src/lib/es2017.string.ts @@ -3,7 +3,7 @@ // RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: // npx nx generate-lib @typescript-eslint/scope-manager -import { ImplicitLibVariableOptions } from '../variable'; +import type { ImplicitLibVariableOptions } from '../variable'; import { TYPE } from './base-config'; export const es2017_string = { diff --git a/packages/scope-manager/src/lib/es2017.ts b/packages/scope-manager/src/lib/es2017.ts index c28a0b45236..3cbafd35b16 100644 --- a/packages/scope-manager/src/lib/es2017.ts +++ b/packages/scope-manager/src/lib/es2017.ts @@ -3,12 +3,12 @@ // RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: // npx nx generate-lib @typescript-eslint/scope-manager -import { ImplicitLibVariableOptions } from '../variable'; +import type { ImplicitLibVariableOptions } from '../variable'; import { es2016 } from './es2016'; +import { es2017_intl } from './es2017.intl'; import { es2017_object } from './es2017.object'; import { es2017_sharedmemory } from './es2017.sharedmemory'; import { es2017_string } from './es2017.string'; -import { es2017_intl } from './es2017.intl'; import { es2017_typedarrays } from './es2017.typedarrays'; export const es2017 = { diff --git a/packages/scope-manager/src/lib/es2017.typedarrays.ts b/packages/scope-manager/src/lib/es2017.typedarrays.ts index 0c9a43160b8..8fdb9a96281 100644 --- a/packages/scope-manager/src/lib/es2017.typedarrays.ts +++ b/packages/scope-manager/src/lib/es2017.typedarrays.ts @@ -3,7 +3,7 @@ // RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: // npx nx generate-lib @typescript-eslint/scope-manager -import { ImplicitLibVariableOptions } from '../variable'; +import type { ImplicitLibVariableOptions } from '../variable'; import { TYPE } from './base-config'; export const es2017_typedarrays = { diff --git a/packages/scope-manager/src/lib/es2018.asyncgenerator.ts b/packages/scope-manager/src/lib/es2018.asyncgenerator.ts index 68f67bd6483..5af8bd0a663 100644 --- a/packages/scope-manager/src/lib/es2018.asyncgenerator.ts +++ b/packages/scope-manager/src/lib/es2018.asyncgenerator.ts @@ -3,9 +3,9 @@ // RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: // npx nx generate-lib @typescript-eslint/scope-manager -import { ImplicitLibVariableOptions } from '../variable'; -import { es2018_asynciterable } from './es2018.asynciterable'; +import type { ImplicitLibVariableOptions } from '../variable'; import { TYPE } from './base-config'; +import { es2018_asynciterable } from './es2018.asynciterable'; export const es2018_asyncgenerator = { ...es2018_asynciterable, diff --git a/packages/scope-manager/src/lib/es2018.asynciterable.ts b/packages/scope-manager/src/lib/es2018.asynciterable.ts index ce4aebafb0d..5d4e373ef76 100644 --- a/packages/scope-manager/src/lib/es2018.asynciterable.ts +++ b/packages/scope-manager/src/lib/es2018.asynciterable.ts @@ -3,10 +3,10 @@ // RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: // npx nx generate-lib @typescript-eslint/scope-manager -import { ImplicitLibVariableOptions } from '../variable'; -import { es2015_symbol } from './es2015.symbol'; -import { es2015_iterable } from './es2015.iterable'; +import type { ImplicitLibVariableOptions } from '../variable'; import { TYPE } from './base-config'; +import { es2015_iterable } from './es2015.iterable'; +import { es2015_symbol } from './es2015.symbol'; export const es2018_asynciterable = { ...es2015_symbol, diff --git a/packages/scope-manager/src/lib/es2018.full.ts b/packages/scope-manager/src/lib/es2018.full.ts index 8e0ab3621f2..802e30c6659 100644 --- a/packages/scope-manager/src/lib/es2018.full.ts +++ b/packages/scope-manager/src/lib/es2018.full.ts @@ -3,12 +3,12 @@ // RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: // npx nx generate-lib @typescript-eslint/scope-manager -import { ImplicitLibVariableOptions } from '../variable'; -import { es2018 } from './es2018'; +import type { ImplicitLibVariableOptions } from '../variable'; import { dom } from './dom'; -import { webworker_importscripts } from './webworker.importscripts'; -import { scripthost } from './scripthost'; import { dom_iterable } from './dom.iterable'; +import { es2018 } from './es2018'; +import { scripthost } from './scripthost'; +import { webworker_importscripts } from './webworker.importscripts'; export const es2018_full = { ...es2018, diff --git a/packages/scope-manager/src/lib/es2018.intl.ts b/packages/scope-manager/src/lib/es2018.intl.ts index 8496761b2d2..9736c0ba48a 100644 --- a/packages/scope-manager/src/lib/es2018.intl.ts +++ b/packages/scope-manager/src/lib/es2018.intl.ts @@ -3,7 +3,7 @@ // RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: // npx nx generate-lib @typescript-eslint/scope-manager -import { ImplicitLibVariableOptions } from '../variable'; +import type { ImplicitLibVariableOptions } from '../variable'; import { TYPE_VALUE } from './base-config'; export const es2018_intl = { diff --git a/packages/scope-manager/src/lib/es2018.promise.ts b/packages/scope-manager/src/lib/es2018.promise.ts index cc74f3b02b8..ac1e02d8a05 100644 --- a/packages/scope-manager/src/lib/es2018.promise.ts +++ b/packages/scope-manager/src/lib/es2018.promise.ts @@ -3,7 +3,7 @@ // RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: // npx nx generate-lib @typescript-eslint/scope-manager -import { ImplicitLibVariableOptions } from '../variable'; +import type { ImplicitLibVariableOptions } from '../variable'; import { TYPE } from './base-config'; export const es2018_promise = { diff --git a/packages/scope-manager/src/lib/es2018.regexp.ts b/packages/scope-manager/src/lib/es2018.regexp.ts index 7c1ca120117..0fdf10f793a 100644 --- a/packages/scope-manager/src/lib/es2018.regexp.ts +++ b/packages/scope-manager/src/lib/es2018.regexp.ts @@ -3,7 +3,7 @@ // RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: // npx nx generate-lib @typescript-eslint/scope-manager -import { ImplicitLibVariableOptions } from '../variable'; +import type { ImplicitLibVariableOptions } from '../variable'; import { TYPE } from './base-config'; export const es2018_regexp = { diff --git a/packages/scope-manager/src/lib/es2018.ts b/packages/scope-manager/src/lib/es2018.ts index a3b3fbe508c..d79390a3b87 100644 --- a/packages/scope-manager/src/lib/es2018.ts +++ b/packages/scope-manager/src/lib/es2018.ts @@ -3,13 +3,13 @@ // RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: // npx nx generate-lib @typescript-eslint/scope-manager -import { ImplicitLibVariableOptions } from '../variable'; +import type { ImplicitLibVariableOptions } from '../variable'; import { es2017 } from './es2017'; -import { es2018_asynciterable } from './es2018.asynciterable'; import { es2018_asyncgenerator } from './es2018.asyncgenerator'; +import { es2018_asynciterable } from './es2018.asynciterable'; +import { es2018_intl } from './es2018.intl'; import { es2018_promise } from './es2018.promise'; import { es2018_regexp } from './es2018.regexp'; -import { es2018_intl } from './es2018.intl'; export const es2018 = { ...es2017, diff --git a/packages/scope-manager/src/lib/es2019.array.ts b/packages/scope-manager/src/lib/es2019.array.ts index 6d814131f52..b682bb04457 100644 --- a/packages/scope-manager/src/lib/es2019.array.ts +++ b/packages/scope-manager/src/lib/es2019.array.ts @@ -3,7 +3,7 @@ // RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: // npx nx generate-lib @typescript-eslint/scope-manager -import { ImplicitLibVariableOptions } from '../variable'; +import type { ImplicitLibVariableOptions } from '../variable'; import { TYPE } from './base-config'; export const es2019_array = { diff --git a/packages/scope-manager/src/lib/es2019.full.ts b/packages/scope-manager/src/lib/es2019.full.ts index a97c713f5a0..8cee3178bc6 100644 --- a/packages/scope-manager/src/lib/es2019.full.ts +++ b/packages/scope-manager/src/lib/es2019.full.ts @@ -3,12 +3,12 @@ // RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: // npx nx generate-lib @typescript-eslint/scope-manager -import { ImplicitLibVariableOptions } from '../variable'; -import { es2019 } from './es2019'; +import type { ImplicitLibVariableOptions } from '../variable'; import { dom } from './dom'; -import { webworker_importscripts } from './webworker.importscripts'; -import { scripthost } from './scripthost'; import { dom_iterable } from './dom.iterable'; +import { es2019 } from './es2019'; +import { scripthost } from './scripthost'; +import { webworker_importscripts } from './webworker.importscripts'; export const es2019_full = { ...es2019, diff --git a/packages/scope-manager/src/lib/es2019.intl.ts b/packages/scope-manager/src/lib/es2019.intl.ts new file mode 100644 index 00000000000..64b46f40ebb --- /dev/null +++ b/packages/scope-manager/src/lib/es2019.intl.ts @@ -0,0 +1,11 @@ +// 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 @typescript-eslint/scope-manager + +import type { ImplicitLibVariableOptions } from '../variable'; +import { TYPE_VALUE } from './base-config'; + +export const es2019_intl = { + Intl: TYPE_VALUE, +} as Record; diff --git a/packages/scope-manager/src/lib/es2019.object.ts b/packages/scope-manager/src/lib/es2019.object.ts index 87f3bb33f45..f1f113ed54d 100644 --- a/packages/scope-manager/src/lib/es2019.object.ts +++ b/packages/scope-manager/src/lib/es2019.object.ts @@ -3,9 +3,9 @@ // RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: // npx nx generate-lib @typescript-eslint/scope-manager -import { ImplicitLibVariableOptions } from '../variable'; -import { es2015_iterable } from './es2015.iterable'; +import type { ImplicitLibVariableOptions } from '../variable'; import { TYPE } from './base-config'; +import { es2015_iterable } from './es2015.iterable'; export const es2019_object = { ...es2015_iterable, diff --git a/packages/scope-manager/src/lib/es2019.string.ts b/packages/scope-manager/src/lib/es2019.string.ts index af1f1f8f2b5..eae2a44d376 100644 --- a/packages/scope-manager/src/lib/es2019.string.ts +++ b/packages/scope-manager/src/lib/es2019.string.ts @@ -3,7 +3,7 @@ // RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: // npx nx generate-lib @typescript-eslint/scope-manager -import { ImplicitLibVariableOptions } from '../variable'; +import type { ImplicitLibVariableOptions } from '../variable'; import { TYPE } from './base-config'; export const es2019_string = { diff --git a/packages/scope-manager/src/lib/es2019.symbol.ts b/packages/scope-manager/src/lib/es2019.symbol.ts index 5c8a1fd2894..b39b41add7a 100644 --- a/packages/scope-manager/src/lib/es2019.symbol.ts +++ b/packages/scope-manager/src/lib/es2019.symbol.ts @@ -3,7 +3,7 @@ // RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: // npx nx generate-lib @typescript-eslint/scope-manager -import { ImplicitLibVariableOptions } from '../variable'; +import type { ImplicitLibVariableOptions } from '../variable'; import { TYPE } from './base-config'; export const es2019_symbol = { diff --git a/packages/scope-manager/src/lib/es2019.ts b/packages/scope-manager/src/lib/es2019.ts index ef90be7456f..cd6d33c1f5d 100644 --- a/packages/scope-manager/src/lib/es2019.ts +++ b/packages/scope-manager/src/lib/es2019.ts @@ -3,9 +3,10 @@ // RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: // npx nx generate-lib @typescript-eslint/scope-manager -import { ImplicitLibVariableOptions } from '../variable'; +import type { ImplicitLibVariableOptions } from '../variable'; import { es2018 } from './es2018'; import { es2019_array } from './es2019.array'; +import { es2019_intl } from './es2019.intl'; import { es2019_object } from './es2019.object'; import { es2019_string } from './es2019.string'; import { es2019_symbol } from './es2019.symbol'; @@ -16,4 +17,5 @@ export const es2019 = { ...es2019_object, ...es2019_string, ...es2019_symbol, + ...es2019_intl, } as Record; diff --git a/packages/scope-manager/src/lib/es2020.bigint.ts b/packages/scope-manager/src/lib/es2020.bigint.ts index 3444dc701a2..52fbba1ca2e 100644 --- a/packages/scope-manager/src/lib/es2020.bigint.ts +++ b/packages/scope-manager/src/lib/es2020.bigint.ts @@ -3,9 +3,9 @@ // RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: // npx nx generate-lib @typescript-eslint/scope-manager -import { ImplicitLibVariableOptions } from '../variable'; -import { es2020_intl } from './es2020.intl'; +import type { ImplicitLibVariableOptions } from '../variable'; import { TYPE, TYPE_VALUE } from './base-config'; +import { es2020_intl } from './es2020.intl'; export const es2020_bigint = { ...es2020_intl, diff --git a/packages/scope-manager/src/lib/es2020.date.ts b/packages/scope-manager/src/lib/es2020.date.ts index 1a5ed0d23f3..b4c3d319deb 100644 --- a/packages/scope-manager/src/lib/es2020.date.ts +++ b/packages/scope-manager/src/lib/es2020.date.ts @@ -3,9 +3,9 @@ // RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: // npx nx generate-lib @typescript-eslint/scope-manager -import { ImplicitLibVariableOptions } from '../variable'; -import { es2020_intl } from './es2020.intl'; +import type { ImplicitLibVariableOptions } from '../variable'; import { TYPE } from './base-config'; +import { es2020_intl } from './es2020.intl'; export const es2020_date = { ...es2020_intl, diff --git a/packages/scope-manager/src/lib/es2020.full.ts b/packages/scope-manager/src/lib/es2020.full.ts index 6467ba7818d..1de20eaecc4 100644 --- a/packages/scope-manager/src/lib/es2020.full.ts +++ b/packages/scope-manager/src/lib/es2020.full.ts @@ -3,12 +3,12 @@ // RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: // npx nx generate-lib @typescript-eslint/scope-manager -import { ImplicitLibVariableOptions } from '../variable'; -import { es2020 } from './es2020'; +import type { ImplicitLibVariableOptions } from '../variable'; import { dom } from './dom'; -import { webworker_importscripts } from './webworker.importscripts'; -import { scripthost } from './scripthost'; import { dom_iterable } from './dom.iterable'; +import { es2020 } from './es2020'; +import { scripthost } from './scripthost'; +import { webworker_importscripts } from './webworker.importscripts'; export const es2020_full = { ...es2020, diff --git a/packages/scope-manager/src/lib/es2020.intl.ts b/packages/scope-manager/src/lib/es2020.intl.ts index a6ba13fec03..2866dde791e 100644 --- a/packages/scope-manager/src/lib/es2020.intl.ts +++ b/packages/scope-manager/src/lib/es2020.intl.ts @@ -3,9 +3,11 @@ // RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: // npx nx generate-lib @typescript-eslint/scope-manager -import { ImplicitLibVariableOptions } from '../variable'; +import type { ImplicitLibVariableOptions } from '../variable'; import { TYPE_VALUE } from './base-config'; +import { es2018_intl } from './es2018.intl'; export const es2020_intl = { + ...es2018_intl, Intl: TYPE_VALUE, } as Record; diff --git a/packages/scope-manager/src/lib/es2020.number.ts b/packages/scope-manager/src/lib/es2020.number.ts index 04ba01bc4bf..445b6073364 100644 --- a/packages/scope-manager/src/lib/es2020.number.ts +++ b/packages/scope-manager/src/lib/es2020.number.ts @@ -3,9 +3,9 @@ // RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: // npx nx generate-lib @typescript-eslint/scope-manager -import { ImplicitLibVariableOptions } from '../variable'; -import { es2020_intl } from './es2020.intl'; +import type { ImplicitLibVariableOptions } from '../variable'; import { TYPE } from './base-config'; +import { es2020_intl } from './es2020.intl'; export const es2020_number = { ...es2020_intl, diff --git a/packages/scope-manager/src/lib/es2020.promise.ts b/packages/scope-manager/src/lib/es2020.promise.ts index c875a4c7b31..0352586806d 100644 --- a/packages/scope-manager/src/lib/es2020.promise.ts +++ b/packages/scope-manager/src/lib/es2020.promise.ts @@ -3,7 +3,7 @@ // RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: // npx nx generate-lib @typescript-eslint/scope-manager -import { ImplicitLibVariableOptions } from '../variable'; +import type { ImplicitLibVariableOptions } from '../variable'; import { TYPE } from './base-config'; export const es2020_promise = { diff --git a/packages/scope-manager/src/lib/es2020.sharedmemory.ts b/packages/scope-manager/src/lib/es2020.sharedmemory.ts index e927965e621..180e291c0cc 100644 --- a/packages/scope-manager/src/lib/es2020.sharedmemory.ts +++ b/packages/scope-manager/src/lib/es2020.sharedmemory.ts @@ -3,7 +3,7 @@ // RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: // npx nx generate-lib @typescript-eslint/scope-manager -import { ImplicitLibVariableOptions } from '../variable'; +import type { ImplicitLibVariableOptions } from '../variable'; import { TYPE } from './base-config'; export const es2020_sharedmemory = { diff --git a/packages/scope-manager/src/lib/es2020.string.ts b/packages/scope-manager/src/lib/es2020.string.ts index c33be91dd3f..ef0a81e1ca8 100644 --- a/packages/scope-manager/src/lib/es2020.string.ts +++ b/packages/scope-manager/src/lib/es2020.string.ts @@ -3,9 +3,9 @@ // RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: // npx nx generate-lib @typescript-eslint/scope-manager -import { ImplicitLibVariableOptions } from '../variable'; -import { es2015_iterable } from './es2015.iterable'; +import type { ImplicitLibVariableOptions } from '../variable'; import { TYPE } from './base-config'; +import { es2015_iterable } from './es2015.iterable'; export const es2020_string = { ...es2015_iterable, diff --git a/packages/scope-manager/src/lib/es2020.symbol.wellknown.ts b/packages/scope-manager/src/lib/es2020.symbol.wellknown.ts index db8d79e9f44..1e104700032 100644 --- a/packages/scope-manager/src/lib/es2020.symbol.wellknown.ts +++ b/packages/scope-manager/src/lib/es2020.symbol.wellknown.ts @@ -3,10 +3,10 @@ // RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: // npx nx generate-lib @typescript-eslint/scope-manager -import { ImplicitLibVariableOptions } from '../variable'; +import type { ImplicitLibVariableOptions } from '../variable'; +import { TYPE } from './base-config'; import { es2015_iterable } from './es2015.iterable'; import { es2015_symbol } from './es2015.symbol'; -import { TYPE } from './base-config'; export const es2020_symbol_wellknown = { ...es2015_iterable, diff --git a/packages/scope-manager/src/lib/es2020.ts b/packages/scope-manager/src/lib/es2020.ts index 3a89464f456..c6b1140596b 100644 --- a/packages/scope-manager/src/lib/es2020.ts +++ b/packages/scope-manager/src/lib/es2020.ts @@ -3,16 +3,16 @@ // RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: // npx nx generate-lib @typescript-eslint/scope-manager -import { ImplicitLibVariableOptions } from '../variable'; +import type { ImplicitLibVariableOptions } from '../variable'; import { es2019 } from './es2019'; import { es2020_bigint } from './es2020.bigint'; import { es2020_date } from './es2020.date'; +import { es2020_intl } from './es2020.intl'; import { es2020_number } from './es2020.number'; import { es2020_promise } from './es2020.promise'; import { es2020_sharedmemory } from './es2020.sharedmemory'; import { es2020_string } from './es2020.string'; import { es2020_symbol_wellknown } from './es2020.symbol.wellknown'; -import { es2020_intl } from './es2020.intl'; export const es2020 = { ...es2019, diff --git a/packages/scope-manager/src/lib/es2021.full.ts b/packages/scope-manager/src/lib/es2021.full.ts index 2bf87c06e1a..e45a862ff2b 100644 --- a/packages/scope-manager/src/lib/es2021.full.ts +++ b/packages/scope-manager/src/lib/es2021.full.ts @@ -3,12 +3,12 @@ // RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: // npx nx generate-lib @typescript-eslint/scope-manager -import { ImplicitLibVariableOptions } from '../variable'; -import { es2021 } from './es2021'; +import type { ImplicitLibVariableOptions } from '../variable'; import { dom } from './dom'; -import { webworker_importscripts } from './webworker.importscripts'; -import { scripthost } from './scripthost'; import { dom_iterable } from './dom.iterable'; +import { es2021 } from './es2021'; +import { scripthost } from './scripthost'; +import { webworker_importscripts } from './webworker.importscripts'; export const es2021_full = { ...es2021, diff --git a/packages/scope-manager/src/lib/es2021.intl.ts b/packages/scope-manager/src/lib/es2021.intl.ts index f73cbe394ab..e8cebf8ed07 100644 --- a/packages/scope-manager/src/lib/es2021.intl.ts +++ b/packages/scope-manager/src/lib/es2021.intl.ts @@ -3,7 +3,7 @@ // RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: // npx nx generate-lib @typescript-eslint/scope-manager -import { ImplicitLibVariableOptions } from '../variable'; +import type { ImplicitLibVariableOptions } from '../variable'; import { TYPE_VALUE } from './base-config'; export const es2021_intl = { diff --git a/packages/scope-manager/src/lib/es2021.promise.ts b/packages/scope-manager/src/lib/es2021.promise.ts index 3607632e743..20d1f1b313c 100644 --- a/packages/scope-manager/src/lib/es2021.promise.ts +++ b/packages/scope-manager/src/lib/es2021.promise.ts @@ -3,8 +3,8 @@ // RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: // npx nx generate-lib @typescript-eslint/scope-manager -import { ImplicitLibVariableOptions } from '../variable'; -import { TYPE_VALUE, TYPE } from './base-config'; +import type { ImplicitLibVariableOptions } from '../variable'; +import { TYPE, TYPE_VALUE } from './base-config'; export const es2021_promise = { AggregateError: TYPE_VALUE, diff --git a/packages/scope-manager/src/lib/es2021.string.ts b/packages/scope-manager/src/lib/es2021.string.ts index 28e9af00f37..8b7aa25c5a5 100644 --- a/packages/scope-manager/src/lib/es2021.string.ts +++ b/packages/scope-manager/src/lib/es2021.string.ts @@ -3,7 +3,7 @@ // RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: // npx nx generate-lib @typescript-eslint/scope-manager -import { ImplicitLibVariableOptions } from '../variable'; +import type { ImplicitLibVariableOptions } from '../variable'; import { TYPE } from './base-config'; export const es2021_string = { diff --git a/packages/scope-manager/src/lib/es2021.ts b/packages/scope-manager/src/lib/es2021.ts index 43fd33f9abe..c54cfc31ccb 100644 --- a/packages/scope-manager/src/lib/es2021.ts +++ b/packages/scope-manager/src/lib/es2021.ts @@ -3,12 +3,12 @@ // RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: // npx nx generate-lib @typescript-eslint/scope-manager -import { ImplicitLibVariableOptions } from '../variable'; +import type { ImplicitLibVariableOptions } from '../variable'; import { es2020 } from './es2020'; +import { es2021_intl } from './es2021.intl'; import { es2021_promise } from './es2021.promise'; import { es2021_string } from './es2021.string'; import { es2021_weakref } from './es2021.weakref'; -import { es2021_intl } from './es2021.intl'; export const es2021 = { ...es2020, diff --git a/packages/scope-manager/src/lib/es2021.weakref.ts b/packages/scope-manager/src/lib/es2021.weakref.ts index 4a7ee2ea44c..a65c90a8058 100644 --- a/packages/scope-manager/src/lib/es2021.weakref.ts +++ b/packages/scope-manager/src/lib/es2021.weakref.ts @@ -3,8 +3,8 @@ // RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: // npx nx generate-lib @typescript-eslint/scope-manager -import { ImplicitLibVariableOptions } from '../variable'; -import { TYPE_VALUE, TYPE } from './base-config'; +import type { ImplicitLibVariableOptions } from '../variable'; +import { TYPE, TYPE_VALUE } from './base-config'; export const es2021_weakref = { WeakRef: TYPE_VALUE, diff --git a/packages/scope-manager/src/lib/es2022.array.ts b/packages/scope-manager/src/lib/es2022.array.ts index 95785becd3d..3927f26851e 100644 --- a/packages/scope-manager/src/lib/es2022.array.ts +++ b/packages/scope-manager/src/lib/es2022.array.ts @@ -3,7 +3,7 @@ // RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: // npx nx generate-lib @typescript-eslint/scope-manager -import { ImplicitLibVariableOptions } from '../variable'; +import type { ImplicitLibVariableOptions } from '../variable'; import { TYPE } from './base-config'; export const es2022_array = { diff --git a/packages/scope-manager/src/lib/es2022.error.ts b/packages/scope-manager/src/lib/es2022.error.ts index f1e1bc2fa0f..282f66648bb 100644 --- a/packages/scope-manager/src/lib/es2022.error.ts +++ b/packages/scope-manager/src/lib/es2022.error.ts @@ -3,7 +3,7 @@ // RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: // npx nx generate-lib @typescript-eslint/scope-manager -import { ImplicitLibVariableOptions } from '../variable'; +import type { ImplicitLibVariableOptions } from '../variable'; import { TYPE } from './base-config'; export const es2022_error = { diff --git a/packages/scope-manager/src/lib/es2022.full.ts b/packages/scope-manager/src/lib/es2022.full.ts index 3ef0dd62eca..1cf84cd17eb 100644 --- a/packages/scope-manager/src/lib/es2022.full.ts +++ b/packages/scope-manager/src/lib/es2022.full.ts @@ -3,12 +3,12 @@ // RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: // npx nx generate-lib @typescript-eslint/scope-manager -import { ImplicitLibVariableOptions } from '../variable'; -import { es2022 } from './es2022'; +import type { ImplicitLibVariableOptions } from '../variable'; import { dom } from './dom'; -import { webworker_importscripts } from './webworker.importscripts'; -import { scripthost } from './scripthost'; import { dom_iterable } from './dom.iterable'; +import { es2022 } from './es2022'; +import { scripthost } from './scripthost'; +import { webworker_importscripts } from './webworker.importscripts'; export const es2022_full = { ...es2022, diff --git a/packages/scope-manager/src/lib/es2022.intl.ts b/packages/scope-manager/src/lib/es2022.intl.ts new file mode 100644 index 00000000000..22c7fc5694d --- /dev/null +++ b/packages/scope-manager/src/lib/es2022.intl.ts @@ -0,0 +1,11 @@ +// 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 @typescript-eslint/scope-manager + +import type { ImplicitLibVariableOptions } from '../variable'; +import { TYPE_VALUE } from './base-config'; + +export const es2022_intl = { + Intl: TYPE_VALUE, +} as Record; diff --git a/packages/scope-manager/src/lib/es2022.object.ts b/packages/scope-manager/src/lib/es2022.object.ts index 650a01c3835..ea209894d13 100644 --- a/packages/scope-manager/src/lib/es2022.object.ts +++ b/packages/scope-manager/src/lib/es2022.object.ts @@ -3,7 +3,7 @@ // RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: // npx nx generate-lib @typescript-eslint/scope-manager -import { ImplicitLibVariableOptions } from '../variable'; +import type { ImplicitLibVariableOptions } from '../variable'; import { TYPE } from './base-config'; export const es2022_object = { diff --git a/packages/scope-manager/src/lib/es2022.sharedmemory.ts b/packages/scope-manager/src/lib/es2022.sharedmemory.ts new file mode 100644 index 00000000000..24d82d60912 --- /dev/null +++ b/packages/scope-manager/src/lib/es2022.sharedmemory.ts @@ -0,0 +1,11 @@ +// 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 @typescript-eslint/scope-manager + +import type { ImplicitLibVariableOptions } from '../variable'; +import { TYPE } from './base-config'; + +export const es2022_sharedmemory = { + Atomics: TYPE, +} as Record; diff --git a/packages/scope-manager/src/lib/es2022.string.ts b/packages/scope-manager/src/lib/es2022.string.ts index 3c4e1a766cd..8cd490c9bc5 100644 --- a/packages/scope-manager/src/lib/es2022.string.ts +++ b/packages/scope-manager/src/lib/es2022.string.ts @@ -3,7 +3,7 @@ // RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: // npx nx generate-lib @typescript-eslint/scope-manager -import { ImplicitLibVariableOptions } from '../variable'; +import type { ImplicitLibVariableOptions } from '../variable'; import { TYPE } from './base-config'; export const es2022_string = { diff --git a/packages/scope-manager/src/lib/es2022.ts b/packages/scope-manager/src/lib/es2022.ts index a81f7b70b47..0956c0111d6 100644 --- a/packages/scope-manager/src/lib/es2022.ts +++ b/packages/scope-manager/src/lib/es2022.ts @@ -3,17 +3,21 @@ // RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: // npx nx generate-lib @typescript-eslint/scope-manager -import { ImplicitLibVariableOptions } from '../variable'; +import type { ImplicitLibVariableOptions } from '../variable'; import { es2021 } from './es2021'; import { es2022_array } from './es2022.array'; import { es2022_error } from './es2022.error'; +import { es2022_intl } from './es2022.intl'; import { es2022_object } from './es2022.object'; +import { es2022_sharedmemory } from './es2022.sharedmemory'; import { es2022_string } from './es2022.string'; export const es2022 = { ...es2021, ...es2022_array, ...es2022_error, + ...es2022_intl, ...es2022_object, + ...es2022_sharedmemory, ...es2022_string, } as Record; diff --git a/packages/scope-manager/src/lib/es5.ts b/packages/scope-manager/src/lib/es5.ts index 888faf61520..cef8eb253ce 100644 --- a/packages/scope-manager/src/lib/es5.ts +++ b/packages/scope-manager/src/lib/es5.ts @@ -3,7 +3,7 @@ // RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: // npx nx generate-lib @typescript-eslint/scope-manager -import { ImplicitLibVariableOptions } from '../variable'; +import type { ImplicitLibVariableOptions } from '../variable'; import { TYPE, TYPE_VALUE } from './base-config'; export const es5 = { diff --git a/packages/scope-manager/src/lib/es6.ts b/packages/scope-manager/src/lib/es6.ts index 57c3eca6234..12bf80e84c9 100644 --- a/packages/scope-manager/src/lib/es6.ts +++ b/packages/scope-manager/src/lib/es6.ts @@ -3,12 +3,12 @@ // RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: // npx nx generate-lib @typescript-eslint/scope-manager -import { ImplicitLibVariableOptions } from '../variable'; +import type { ImplicitLibVariableOptions } from '../variable'; import { es5 } from './es5'; -import { es2015_core } from './es2015.core'; import { es2015_collection } from './es2015.collection'; -import { es2015_iterable } from './es2015.iterable'; +import { es2015_core } from './es2015.core'; import { es2015_generator } from './es2015.generator'; +import { es2015_iterable } from './es2015.iterable'; import { es2015_promise } from './es2015.promise'; import { es2015_proxy } from './es2015.proxy'; import { es2015_reflect } from './es2015.reflect'; diff --git a/packages/scope-manager/src/lib/es7.ts b/packages/scope-manager/src/lib/es7.ts index dd0ae5bef60..e79a1dd39c7 100644 --- a/packages/scope-manager/src/lib/es7.ts +++ b/packages/scope-manager/src/lib/es7.ts @@ -3,7 +3,7 @@ // RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: // npx nx generate-lib @typescript-eslint/scope-manager -import { ImplicitLibVariableOptions } from '../variable'; +import type { ImplicitLibVariableOptions } from '../variable'; import { es2015 } from './es2015'; import { es2016_array_include } from './es2016.array.include'; diff --git a/packages/scope-manager/src/lib/esnext.array.ts b/packages/scope-manager/src/lib/esnext.array.ts index 87709c583e4..e7d9824cf8c 100644 --- a/packages/scope-manager/src/lib/esnext.array.ts +++ b/packages/scope-manager/src/lib/esnext.array.ts @@ -3,7 +3,7 @@ // RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: // npx nx generate-lib @typescript-eslint/scope-manager -import { ImplicitLibVariableOptions } from '../variable'; +import type { ImplicitLibVariableOptions } from '../variable'; import { TYPE } from './base-config'; export const esnext_array = { diff --git a/packages/scope-manager/src/lib/esnext.asynciterable.ts b/packages/scope-manager/src/lib/esnext.asynciterable.ts index 22c97a07040..2479b150904 100644 --- a/packages/scope-manager/src/lib/esnext.asynciterable.ts +++ b/packages/scope-manager/src/lib/esnext.asynciterable.ts @@ -3,10 +3,10 @@ // RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: // npx nx generate-lib @typescript-eslint/scope-manager -import { ImplicitLibVariableOptions } from '../variable'; -import { es2015_symbol } from './es2015.symbol'; -import { es2015_iterable } from './es2015.iterable'; +import type { ImplicitLibVariableOptions } from '../variable'; import { TYPE } from './base-config'; +import { es2015_iterable } from './es2015.iterable'; +import { es2015_symbol } from './es2015.symbol'; export const esnext_asynciterable = { ...es2015_symbol, diff --git a/packages/scope-manager/src/lib/esnext.bigint.ts b/packages/scope-manager/src/lib/esnext.bigint.ts index 079bc59bf87..ccd2ae93293 100644 --- a/packages/scope-manager/src/lib/esnext.bigint.ts +++ b/packages/scope-manager/src/lib/esnext.bigint.ts @@ -3,9 +3,9 @@ // RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: // npx nx generate-lib @typescript-eslint/scope-manager -import { ImplicitLibVariableOptions } from '../variable'; -import { es2020_intl } from './es2020.intl'; +import type { ImplicitLibVariableOptions } from '../variable'; import { TYPE, TYPE_VALUE } from './base-config'; +import { es2020_intl } from './es2020.intl'; export const esnext_bigint = { ...es2020_intl, diff --git a/packages/scope-manager/src/lib/esnext.full.ts b/packages/scope-manager/src/lib/esnext.full.ts index 5d7b43c2b66..2bae36c386e 100644 --- a/packages/scope-manager/src/lib/esnext.full.ts +++ b/packages/scope-manager/src/lib/esnext.full.ts @@ -3,12 +3,12 @@ // RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: // npx nx generate-lib @typescript-eslint/scope-manager -import { ImplicitLibVariableOptions } from '../variable'; -import { esnext } from './esnext'; +import type { ImplicitLibVariableOptions } from '../variable'; import { dom } from './dom'; -import { webworker_importscripts } from './webworker.importscripts'; -import { scripthost } from './scripthost'; import { dom_iterable } from './dom.iterable'; +import { esnext } from './esnext'; +import { scripthost } from './scripthost'; +import { webworker_importscripts } from './webworker.importscripts'; export const esnext_full = { ...esnext, diff --git a/packages/scope-manager/src/lib/esnext.intl.ts b/packages/scope-manager/src/lib/esnext.intl.ts index 03cc1fb5997..35c7ef82ddb 100644 --- a/packages/scope-manager/src/lib/esnext.intl.ts +++ b/packages/scope-manager/src/lib/esnext.intl.ts @@ -3,7 +3,7 @@ // RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: // npx nx generate-lib @typescript-eslint/scope-manager -import { ImplicitLibVariableOptions } from '../variable'; +import type { ImplicitLibVariableOptions } from '../variable'; import { TYPE_VALUE } from './base-config'; export const esnext_intl = { diff --git a/packages/scope-manager/src/lib/esnext.promise.ts b/packages/scope-manager/src/lib/esnext.promise.ts index 8042c77f8b4..08c9e142841 100644 --- a/packages/scope-manager/src/lib/esnext.promise.ts +++ b/packages/scope-manager/src/lib/esnext.promise.ts @@ -3,8 +3,8 @@ // RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: // npx nx generate-lib @typescript-eslint/scope-manager -import { ImplicitLibVariableOptions } from '../variable'; -import { TYPE_VALUE, TYPE } from './base-config'; +import type { ImplicitLibVariableOptions } from '../variable'; +import { TYPE, TYPE_VALUE } from './base-config'; export const esnext_promise = { AggregateError: TYPE_VALUE, diff --git a/packages/scope-manager/src/lib/esnext.string.ts b/packages/scope-manager/src/lib/esnext.string.ts index 354c5d6dfea..d0bacb659a4 100644 --- a/packages/scope-manager/src/lib/esnext.string.ts +++ b/packages/scope-manager/src/lib/esnext.string.ts @@ -3,7 +3,7 @@ // RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: // npx nx generate-lib @typescript-eslint/scope-manager -import { ImplicitLibVariableOptions } from '../variable'; +import type { ImplicitLibVariableOptions } from '../variable'; import { TYPE } from './base-config'; export const esnext_string = { diff --git a/packages/scope-manager/src/lib/esnext.symbol.ts b/packages/scope-manager/src/lib/esnext.symbol.ts index 49b2a8c9cd7..fb16e1cb55a 100644 --- a/packages/scope-manager/src/lib/esnext.symbol.ts +++ b/packages/scope-manager/src/lib/esnext.symbol.ts @@ -3,7 +3,7 @@ // RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: // npx nx generate-lib @typescript-eslint/scope-manager -import { ImplicitLibVariableOptions } from '../variable'; +import type { ImplicitLibVariableOptions } from '../variable'; import { TYPE } from './base-config'; export const esnext_symbol = { diff --git a/packages/scope-manager/src/lib/esnext.ts b/packages/scope-manager/src/lib/esnext.ts index e6c59d96cf2..31ac2762267 100644 --- a/packages/scope-manager/src/lib/esnext.ts +++ b/packages/scope-manager/src/lib/esnext.ts @@ -3,7 +3,7 @@ // RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: // npx nx generate-lib @typescript-eslint/scope-manager -import { ImplicitLibVariableOptions } from '../variable'; +import type { ImplicitLibVariableOptions } from '../variable'; import { es2022 } from './es2022'; import { esnext_intl } from './esnext.intl'; diff --git a/packages/scope-manager/src/lib/esnext.weakref.ts b/packages/scope-manager/src/lib/esnext.weakref.ts index aec8e3070bf..9a7df1c6d58 100644 --- a/packages/scope-manager/src/lib/esnext.weakref.ts +++ b/packages/scope-manager/src/lib/esnext.weakref.ts @@ -3,8 +3,8 @@ // RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: // npx nx generate-lib @typescript-eslint/scope-manager -import { ImplicitLibVariableOptions } from '../variable'; -import { TYPE_VALUE, TYPE } from './base-config'; +import type { ImplicitLibVariableOptions } from '../variable'; +import { TYPE, TYPE_VALUE } from './base-config'; export const esnext_weakref = { WeakRef: TYPE_VALUE, diff --git a/packages/scope-manager/src/lib/index.ts b/packages/scope-manager/src/lib/index.ts index ab0328f7cf0..dfee880fa16 100644 --- a/packages/scope-manager/src/lib/index.ts +++ b/packages/scope-manager/src/lib/index.ts @@ -3,26 +3,14 @@ // RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: // npx nx generate-lib @typescript-eslint/scope-manager +import { dom } from './dom'; +import { dom_iterable } from './dom.iterable'; import { es5 } from './es5'; import { es6 } from './es6'; -import { es2015 } from './es2015'; import { es7 } from './es7'; -import { es2016 } from './es2016'; -import { es2017 } from './es2017'; -import { es2018 } from './es2018'; -import { es2019 } from './es2019'; -import { es2020 } from './es2020'; -import { es2021 } from './es2021'; -import { es2022 } from './es2022'; -import { esnext } from './esnext'; -import { dom } from './dom'; -import { dom_iterable } from './dom.iterable'; -import { webworker } from './webworker'; -import { webworker_importscripts } from './webworker.importscripts'; -import { webworker_iterable } from './webworker.iterable'; -import { scripthost } from './scripthost'; -import { es2015_core } from './es2015.core'; +import { es2015 } from './es2015'; import { es2015_collection } from './es2015.collection'; +import { es2015_core } from './es2015.core'; import { es2015_generator } from './es2015.generator'; import { es2015_iterable } from './es2015.iterable'; import { es2015_promise } from './es2015.promise'; @@ -30,54 +18,69 @@ import { es2015_proxy } from './es2015.proxy'; import { es2015_reflect } from './es2015.reflect'; import { es2015_symbol } from './es2015.symbol'; import { es2015_symbol_wellknown } from './es2015.symbol.wellknown'; +import { es2016 } from './es2016'; import { es2016_array_include } from './es2016.array.include'; +import { es2016_full } from './es2016.full'; +import { es2017 } from './es2017'; +import { es2017_full } from './es2017.full'; +import { es2017_intl } from './es2017.intl'; import { es2017_object } from './es2017.object'; import { es2017_sharedmemory } from './es2017.sharedmemory'; import { es2017_string } from './es2017.string'; -import { es2017_intl } from './es2017.intl'; import { es2017_typedarrays } from './es2017.typedarrays'; +import { es2018 } from './es2018'; import { es2018_asyncgenerator } from './es2018.asyncgenerator'; import { es2018_asynciterable } from './es2018.asynciterable'; +import { es2018_full } from './es2018.full'; import { es2018_intl } from './es2018.intl'; import { es2018_promise } from './es2018.promise'; import { es2018_regexp } from './es2018.regexp'; +import { es2019 } from './es2019'; import { es2019_array } from './es2019.array'; +import { es2019_full } from './es2019.full'; +import { es2019_intl } from './es2019.intl'; import { es2019_object } from './es2019.object'; import { es2019_string } from './es2019.string'; import { es2019_symbol } from './es2019.symbol'; +import { es2020 } from './es2020'; import { es2020_bigint } from './es2020.bigint'; import { es2020_date } from './es2020.date'; +import { es2020_full } from './es2020.full'; +import { es2020_intl } from './es2020.intl'; +import { es2020_number } from './es2020.number'; import { es2020_promise } from './es2020.promise'; import { es2020_sharedmemory } from './es2020.sharedmemory'; import { es2020_string } from './es2020.string'; import { es2020_symbol_wellknown } from './es2020.symbol.wellknown'; -import { es2020_intl } from './es2020.intl'; -import { es2020_number } from './es2020.number'; +import { es2021 } from './es2021'; +import { es2021_full } from './es2021.full'; +import { es2021_intl } from './es2021.intl'; import { es2021_promise } from './es2021.promise'; import { es2021_string } from './es2021.string'; import { es2021_weakref } from './es2021.weakref'; -import { es2021_intl } from './es2021.intl'; +import { es2022 } from './es2022'; import { es2022_array } from './es2022.array'; import { es2022_error } from './es2022.error'; +import { es2022_full } from './es2022.full'; +import { es2022_intl } from './es2022.intl'; import { es2022_object } from './es2022.object'; +import { es2022_sharedmemory } from './es2022.sharedmemory'; import { es2022_string } from './es2022.string'; +import { esnext } from './esnext'; import { esnext_array } from './esnext.array'; -import { esnext_symbol } from './esnext.symbol'; import { esnext_asynciterable } from './esnext.asynciterable'; -import { esnext_intl } from './esnext.intl'; import { esnext_bigint } from './esnext.bigint'; -import { esnext_string } from './esnext.string'; +import { esnext_full } from './esnext.full'; +import { esnext_intl } from './esnext.intl'; import { esnext_promise } from './esnext.promise'; +import { esnext_string } from './esnext.string'; +import { esnext_symbol } from './esnext.symbol'; import { esnext_weakref } from './esnext.weakref'; -import { es2016_full } from './es2016.full'; -import { es2017_full } from './es2017.full'; -import { es2018_full } from './es2018.full'; -import { es2019_full } from './es2019.full'; -import { es2020_full } from './es2020.full'; -import { es2021_full } from './es2021.full'; -import { es2022_full } from './es2022.full'; -import { esnext_full } from './esnext.full'; import { lib as libBase } from './lib'; +import { scripthost } from './scripthost'; +import { webworker } from './webworker'; +import { webworker_importscripts } from './webworker.importscripts'; +import { webworker_iterable } from './webworker.iterable'; const lib = { es5, @@ -122,6 +125,7 @@ const lib = { 'es2019.object': es2019_object, 'es2019.string': es2019_string, 'es2019.symbol': es2019_symbol, + 'es2019.intl': es2019_intl, 'es2020.bigint': es2020_bigint, 'es2020.date': es2020_date, 'es2020.promise': es2020_promise, @@ -136,7 +140,9 @@ const lib = { 'es2021.intl': es2021_intl, 'es2022.array': es2022_array, 'es2022.error': es2022_error, + 'es2022.intl': es2022_intl, 'es2022.object': es2022_object, + 'es2022.sharedmemory': es2022_sharedmemory, 'es2022.string': es2022_string, 'esnext.array': esnext_array, 'esnext.symbol': esnext_symbol, diff --git a/packages/scope-manager/src/lib/lib.ts b/packages/scope-manager/src/lib/lib.ts index 68367da23d9..4ec72e9e80b 100644 --- a/packages/scope-manager/src/lib/lib.ts +++ b/packages/scope-manager/src/lib/lib.ts @@ -3,11 +3,11 @@ // RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: // npx nx generate-lib @typescript-eslint/scope-manager -import { ImplicitLibVariableOptions } from '../variable'; -import { es5 } from './es5'; +import type { ImplicitLibVariableOptions } from '../variable'; import { dom } from './dom'; -import { webworker_importscripts } from './webworker.importscripts'; +import { es5 } from './es5'; import { scripthost } from './scripthost'; +import { webworker_importscripts } from './webworker.importscripts'; export const lib = { ...es5, diff --git a/packages/scope-manager/src/lib/scripthost.ts b/packages/scope-manager/src/lib/scripthost.ts index c143fc8ae59..cf802a3abad 100644 --- a/packages/scope-manager/src/lib/scripthost.ts +++ b/packages/scope-manager/src/lib/scripthost.ts @@ -3,8 +3,8 @@ // RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: // npx nx generate-lib @typescript-eslint/scope-manager -import { ImplicitLibVariableOptions } from '../variable'; -import { TYPE_VALUE, TYPE } from './base-config'; +import type { ImplicitLibVariableOptions } from '../variable'; +import { TYPE, TYPE_VALUE } from './base-config'; export const scripthost = { ActiveXObject: TYPE_VALUE, diff --git a/packages/scope-manager/src/lib/webworker.importscripts.ts b/packages/scope-manager/src/lib/webworker.importscripts.ts index 4b3bb5f95c6..f7f1cb026bc 100644 --- a/packages/scope-manager/src/lib/webworker.importscripts.ts +++ b/packages/scope-manager/src/lib/webworker.importscripts.ts @@ -3,7 +3,7 @@ // RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: // npx nx generate-lib @typescript-eslint/scope-manager -import { ImplicitLibVariableOptions } from '../variable'; +import type { ImplicitLibVariableOptions } from '../variable'; export const webworker_importscripts = {} as Record< string, diff --git a/packages/scope-manager/src/lib/webworker.iterable.ts b/packages/scope-manager/src/lib/webworker.iterable.ts index 80a04c759e4..5ff03255ece 100644 --- a/packages/scope-manager/src/lib/webworker.iterable.ts +++ b/packages/scope-manager/src/lib/webworker.iterable.ts @@ -3,11 +3,13 @@ // RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: // npx nx generate-lib @typescript-eslint/scope-manager -import { ImplicitLibVariableOptions } from '../variable'; +import type { ImplicitLibVariableOptions } from '../variable'; import { TYPE } from './base-config'; export const webworker_iterable = { Cache: TYPE, + CanvasPath: TYPE, + CanvasPathDrawingStyles: TYPE, DOMStringList: TYPE, FileList: TYPE, FontFaceSet: TYPE, diff --git a/packages/scope-manager/src/lib/webworker.ts b/packages/scope-manager/src/lib/webworker.ts index 55e4f2b58c5..bddb6bf9aa4 100644 --- a/packages/scope-manager/src/lib/webworker.ts +++ b/packages/scope-manager/src/lib/webworker.ts @@ -3,7 +3,7 @@ // RUN THE FOLLOWING COMMAND FROM THE WORKSPACE ROOT TO REGENERATE: // npx nx generate-lib @typescript-eslint/scope-manager -import { ImplicitLibVariableOptions } from '../variable'; +import type { ImplicitLibVariableOptions } from '../variable'; import { TYPE, TYPE_VALUE } from './base-config'; export const webworker = { @@ -51,6 +51,7 @@ export const webworker = { IDBDatabaseInfo: TYPE, IDBIndexParameters: TYPE, IDBObjectStoreParameters: TYPE, + IDBTransactionOptions: TYPE, IDBVersionChangeEventInit: TYPE, ImageBitmapOptions: TYPE, ImageBitmapRenderingContextSettings: TYPE, @@ -87,8 +88,9 @@ export const webworker = { QueuingStrategyInit: TYPE, RTCEncodedAudioFrameMetadata: TYPE, RTCEncodedVideoFrameMetadata: TYPE, - ReadableStreamDefaultReadDoneResult: TYPE, - ReadableStreamDefaultReadValueResult: TYPE, + ReadableStreamGetReaderOptions: TYPE, + ReadableStreamReadDoneResult: TYPE, + ReadableStreamReadValueResult: TYPE, ReadableWritablePair: TYPE, RegistrationOptions: TYPE, RequestInit: TYPE, @@ -107,6 +109,8 @@ export const webworker = { TextDecoderOptions: TYPE, TextEncoderEncodeIntoResult: TYPE, Transformer: TYPE, + UnderlyingByteSource: TYPE, + UnderlyingDefaultSource: TYPE, UnderlyingSink: TYPE, UnderlyingSource: TYPE, VideoColorSpaceInit: TYPE, @@ -128,9 +132,23 @@ export const webworker = { ByteLengthQueuingStrategy: TYPE_VALUE, Cache: TYPE_VALUE, CacheStorage: TYPE_VALUE, + CanvasCompositing: TYPE, + CanvasDrawImage: TYPE, + CanvasDrawPath: TYPE, + CanvasFillStrokeStyles: TYPE, + CanvasFilters: TYPE, CanvasGradient: TYPE_VALUE, + CanvasImageData: TYPE, + CanvasImageSmoothing: TYPE, CanvasPath: TYPE, + CanvasPathDrawingStyles: TYPE, CanvasPattern: TYPE_VALUE, + CanvasRect: TYPE, + CanvasShadowStyles: TYPE, + CanvasState: TYPE, + CanvasText: TYPE, + CanvasTextDrawingStyles: TYPE, + CanvasTransform: TYPE, Client: TYPE_VALUE, Clients: TYPE_VALUE, CloseEvent: TYPE_VALUE, @@ -156,8 +174,10 @@ export const webworker = { EXT_frag_depth: TYPE, EXT_sRGB: TYPE, EXT_shader_texture_lod: TYPE, + EXT_texture_compression_bptc: TYPE, EXT_texture_compression_rgtc: TYPE, EXT_texture_filter_anisotropic: TYPE, + EXT_texture_norm16: TYPE, ErrorEvent: TYPE_VALUE, Event: TYPE_VALUE, EventListener: TYPE, @@ -215,13 +235,12 @@ export const webworker = { NavigatorID: TYPE, NavigatorLanguage: TYPE, NavigatorLocks: TYPE, - NavigatorNetworkInformation: TYPE, NavigatorOnLine: TYPE, NavigatorStorage: TYPE, - NetworkInformation: TYPE_VALUE, NotificationEventMap: TYPE, Notification: TYPE_VALUE, NotificationEvent: TYPE_VALUE, + OES_draw_buffers_indexed: TYPE, OES_element_index_uint: TYPE, OES_fbo_render_mipmap: TYPE, OES_standard_derivatives: TYPE, @@ -231,7 +250,9 @@ export const webworker = { OES_texture_half_float_linear: TYPE, OES_vertex_array_object: TYPE, OVR_multiview2: TYPE, - OffscreenCanvas: TYPE, + OffscreenCanvasEventMap: TYPE, + OffscreenCanvas: TYPE_VALUE, + OffscreenCanvasRenderingContext2D: TYPE_VALUE, Path2D: TYPE_VALUE, PerformanceEventMap: TYPE, Performance: TYPE_VALUE, @@ -254,7 +275,10 @@ export const webworker = { PushSubscriptionOptions: TYPE_VALUE, RTCEncodedAudioFrame: TYPE_VALUE, RTCEncodedVideoFrame: TYPE_VALUE, + ReadableByteStreamController: TYPE_VALUE, ReadableStream: TYPE_VALUE, + ReadableStreamBYOBReader: TYPE_VALUE, + ReadableStreamBYOBRequest: TYPE_VALUE, ReadableStreamDefaultController: TYPE_VALUE, ReadableStreamDefaultReader: TYPE_VALUE, ReadableStreamGenericReader: TYPE, @@ -386,11 +410,12 @@ export const webworker = { Int32List: TYPE, MessageEventSource: TYPE, NamedCurve: TYPE, + OffscreenRenderingContext: TYPE, OnErrorEventHandler: TYPE, PerformanceEntryList: TYPE, PushMessageDataInit: TYPE, ReadableStreamController: TYPE, - ReadableStreamDefaultReadResult: TYPE, + ReadableStreamReadResult: TYPE, ReadableStreamReader: TYPE, RequestInfo: TYPE, TexImageSource: TYPE, @@ -400,22 +425,33 @@ export const webworker = { VibratePattern: TYPE, XMLHttpRequestBodyInit: TYPE, BinaryType: TYPE, + CanvasDirection: TYPE, + CanvasFillRule: TYPE, + CanvasFontKerning: TYPE, + CanvasFontStretch: TYPE, + CanvasFontVariantCaps: TYPE, + CanvasLineCap: TYPE, + CanvasLineJoin: TYPE, + CanvasTextAlign: TYPE, + CanvasTextBaseline: TYPE, + CanvasTextRendering: TYPE, ClientTypes: TYPE, ColorGamut: TYPE, ColorSpaceConversion: TYPE, - ConnectionType: TYPE, DocumentVisibilityState: TYPE, EndingType: TYPE, FileSystemHandleKind: TYPE, FontFaceLoadStatus: TYPE, FontFaceSetLoadStatus: TYPE, FrameType: TYPE, + GlobalCompositeOperation: TYPE, HdrMetadataType: TYPE, IDBCursorDirection: TYPE, IDBRequestReadyState: TYPE, IDBTransactionDurability: TYPE, IDBTransactionMode: TYPE, ImageOrientation: TYPE, + ImageSmoothingQuality: TYPE, KeyFormat: TYPE, KeyType: TYPE, KeyUsage: TYPE, @@ -424,12 +460,15 @@ export const webworker = { MediaEncodingType: TYPE, NotificationDirection: TYPE, NotificationPermission: TYPE, + OffscreenRenderingContextId: TYPE, PermissionName: TYPE, PermissionState: TYPE, PredefinedColorSpace: TYPE, PremultiplyAlpha: TYPE, PushEncryptionKeyName: TYPE, RTCEncodedVideoFrameType: TYPE, + ReadableStreamReaderMode: TYPE, + ReadableStreamType: TYPE, ReferrerPolicy: TYPE, RequestCache: TYPE, RequestCredentials: TYPE, diff --git a/packages/scope-manager/src/referencer/ClassVisitor.ts b/packages/scope-manager/src/referencer/ClassVisitor.ts index 7e2dfc17c86..0f3b6a20e94 100644 --- a/packages/scope-manager/src/referencer/ClassVisitor.ts +++ b/packages/scope-manager/src/referencer/ClassVisitor.ts @@ -1,6 +1,8 @@ -import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/types'; +import type { TSESTree } from '@typescript-eslint/types'; +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + import { ClassNameDefinition, ParameterDefinition } from '../definition'; -import { Referencer } from './Referencer'; +import type { Referencer } from './Referencer'; import { TypeVisitor } from './TypeVisitor'; import { Visitor } from './Visitor'; @@ -81,9 +83,13 @@ class ClassVisitor extends Visitor { } protected visitPropertyDefinition( - node: TSESTree.TSAbstractPropertyDefinition | TSESTree.PropertyDefinition, + node: + | TSESTree.AccessorProperty + | TSESTree.PropertyDefinition + | TSESTree.TSAbstractAccessorProperty + | TSESTree.TSAbstractPropertyDefinition, ): void { - this.visitProperty(node); + this.visitPropertyBase(node); /** * class A { * @meta // <--- check this @@ -157,7 +163,7 @@ class ClassVisitor extends Visitor { * } */ if ( - keyName !== null && + keyName != null && this.#classNode.body.body.find( (node): node is TSESTree.MethodDefinition => node !== methodNode && @@ -227,9 +233,11 @@ class ClassVisitor extends Visitor { this.#referencer.close(node); } - protected visitProperty( + protected visitPropertyBase( node: + | TSESTree.AccessorProperty | TSESTree.PropertyDefinition + | TSESTree.TSAbstractAccessorProperty | TSESTree.TSAbstractPropertyDefinition | TSESTree.TSAbstractMethodDefinition, ): void { @@ -238,7 +246,10 @@ class ClassVisitor extends Visitor { } if (node.value) { - if (node.type === AST_NODE_TYPES.PropertyDefinition) { + if ( + node.type === AST_NODE_TYPES.PropertyDefinition || + node.type === AST_NODE_TYPES.AccessorProperty + ) { this.#referencer.scopeManager.nestClassFieldInitializerScope( node.value, ); @@ -246,7 +257,10 @@ class ClassVisitor extends Visitor { this.#referencer.visit(node.value); - if (node.type === AST_NODE_TYPES.PropertyDefinition) { + if ( + node.type === AST_NODE_TYPES.PropertyDefinition || + node.type === AST_NODE_TYPES.AccessorProperty + ) { this.#referencer.close(node.value); } } @@ -326,6 +340,10 @@ class ClassVisitor extends Visitor { // Visit selectors // ///////////////////// + protected AccessorProperty(node: TSESTree.AccessorProperty): void { + this.visitPropertyDefinition(node); + } + protected ClassBody(node: TSESTree.ClassBody): void { // this is here on purpose so that this visitor explicitly declares visitors // for all nodes it cares about (see the instance visit method above) @@ -340,6 +358,12 @@ class ClassVisitor extends Visitor { this.visitMethod(node); } + protected TSAbstractAccessorProperty( + node: TSESTree.TSAbstractAccessorProperty, + ): void { + this.visitPropertyDefinition(node); + } + protected TSAbstractPropertyDefinition( node: TSESTree.TSAbstractPropertyDefinition, ): void { @@ -349,7 +373,7 @@ class ClassVisitor extends Visitor { protected TSAbstractMethodDefinition( node: TSESTree.TSAbstractMethodDefinition, ): void { - this.visitProperty(node); + this.visitPropertyBase(node); } protected Identifier(node: TSESTree.Identifier): void { @@ -359,6 +383,14 @@ class ClassVisitor extends Visitor { protected PrivateIdentifier(): void { // intentionally skip } + + protected StaticBlock(node: TSESTree.StaticBlock): void { + this.#referencer.scopeManager.nestClassStaticBlockScope(node); + + node.body.forEach(b => this.visit(b)); + + this.#referencer.close(node); + } } /** diff --git a/packages/scope-manager/src/referencer/ExportVisitor.ts b/packages/scope-manager/src/referencer/ExportVisitor.ts index 60dc45bdbff..1af3a81ca2c 100644 --- a/packages/scope-manager/src/referencer/ExportVisitor.ts +++ b/packages/scope-manager/src/referencer/ExportVisitor.ts @@ -1,5 +1,7 @@ -import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/types'; -import { Referencer } from './Referencer'; +import type { TSESTree } from '@typescript-eslint/types'; +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import type { Referencer } from './Referencer'; import { Visitor } from './Visitor'; type ExportNode = diff --git a/packages/scope-manager/src/referencer/ImportVisitor.ts b/packages/scope-manager/src/referencer/ImportVisitor.ts index 19a9b1d7d5e..50c29980942 100644 --- a/packages/scope-manager/src/referencer/ImportVisitor.ts +++ b/packages/scope-manager/src/referencer/ImportVisitor.ts @@ -1,6 +1,7 @@ -import { TSESTree } from '@typescript-eslint/types'; +import type { TSESTree } from '@typescript-eslint/types'; + import { ImportBindingDefinition } from '../definition'; -import { Referencer } from './Referencer'; +import type { Referencer } from './Referencer'; import { Visitor } from './Visitor'; class ImportVisitor extends Visitor { diff --git a/packages/scope-manager/src/referencer/PatternVisitor.ts b/packages/scope-manager/src/referencer/PatternVisitor.ts index eb34103457d..53de28469e8 100644 --- a/packages/scope-manager/src/referencer/PatternVisitor.ts +++ b/packages/scope-manager/src/referencer/PatternVisitor.ts @@ -1,5 +1,8 @@ -import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/types'; -import { VisitorBase, VisitorOptions } from './VisitorBase'; +import type { TSESTree } from '@typescript-eslint/types'; +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import type { VisitorOptions } from './VisitorBase'; +import { VisitorBase } from './VisitorBase'; type PatternVisitorCallback = ( pattern: TSESTree.Identifier, @@ -94,10 +97,7 @@ class PatternVisitor extends VisitorBase { this.#callback(pattern, { topLevel: pattern === this.#rootPattern, - rest: - lastRestElement !== null && - lastRestElement !== undefined && - lastRestElement.argument === pattern, + rest: lastRestElement != null && lastRestElement.argument === pattern, assignments: this.#assignments, }); } diff --git a/packages/scope-manager/src/referencer/Reference.ts b/packages/scope-manager/src/referencer/Reference.ts index 9cf624f82a1..d74b628d8cc 100644 --- a/packages/scope-manager/src/referencer/Reference.ts +++ b/packages/scope-manager/src/referencer/Reference.ts @@ -1,7 +1,8 @@ -import { TSESTree } from '@typescript-eslint/types'; +import type { TSESTree } from '@typescript-eslint/types'; + import { createIdGenerator } from '../ID'; -import { Scope } from '../scope'; -import { Variable } from '../variable'; +import type { Scope } from '../scope'; +import type { Variable } from '../variable'; enum ReferenceFlag { Read = 0x1, diff --git a/packages/scope-manager/src/referencer/Referencer.ts b/packages/scope-manager/src/referencer/Referencer.ts index 52f2dc09681..ea095a22e51 100644 --- a/packages/scope-manager/src/referencer/Referencer.ts +++ b/packages/scope-manager/src/referencer/Referencer.ts @@ -1,12 +1,6 @@ -import { AST_NODE_TYPES, Lib, TSESTree } from '@typescript-eslint/types'; -import { ClassVisitor } from './ClassVisitor'; -import { ExportVisitor } from './ExportVisitor'; -import { ImportVisitor } from './ImportVisitor'; -import { PatternVisitor } from './PatternVisitor'; -import { ReferenceFlag, ReferenceImplicitGlobal } from './Reference'; -import { ScopeManager } from '../ScopeManager'; -import { TypeVisitor } from './TypeVisitor'; -import { Visitor, VisitorOptions } from './Visitor'; +import type { Lib, TSESTree } from '@typescript-eslint/types'; +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + import { assert } from '../assert'; import { CatchClauseDefinition, @@ -19,7 +13,17 @@ import { VariableDefinition, } from '../definition'; import { lib as TSLibraries } from '../lib'; -import { Scope, GlobalScope } from '../scope'; +import type { GlobalScope, Scope } from '../scope'; +import type { ScopeManager } from '../ScopeManager'; +import { ClassVisitor } from './ClassVisitor'; +import { ExportVisitor } from './ExportVisitor'; +import { ImportVisitor } from './ImportVisitor'; +import { PatternVisitor } from './PatternVisitor'; +import type { ReferenceImplicitGlobal } from './Reference'; +import { ReferenceFlag } from './Reference'; +import { TypeVisitor } from './TypeVisitor'; +import type { VisitorOptions } from './Visitor'; +import { Visitor } from './Visitor'; interface ReferencerOptions extends VisitorOptions { jsxPragma: string | null; @@ -120,7 +124,7 @@ class Referencer extends Visitor { } private referenceJsxPragma(): void { - if (this.#jsxPragma === null || this.#hasReferencedJsxFactory) { + if (this.#jsxPragma == null || this.#hasReferencedJsxFactory) { return; } this.#hasReferencedJsxFactory = this.referenceInSomeUpperScope( @@ -130,7 +134,7 @@ class Referencer extends Visitor { private referenceJsxFragment(): void { if ( - this.#jsxFragmentName === null || + this.#jsxFragmentName == null || this.#hasReferencedJsxFragmentFactory ) { return; @@ -297,7 +301,10 @@ class Referencer extends Visitor { } protected visitTypeAssertion( - node: TSESTree.TSAsExpression | TSESTree.TSTypeAssertion, + node: + | TSESTree.TSAsExpression + | TSESTree.TSTypeAssertion + | TSESTree.TSSatisfiesExpression, ): void { this.visit(node.expression); this.visitType(node.typeAnnotation); @@ -671,7 +678,7 @@ class Referencer extends Visitor { member.id.type === AST_NODE_TYPES.Literal && typeof member.id.value === 'string' ) { - const name = member.id as TSESTree.StringLiteral; + const name = member.id; this.currentScope().defineLiteralIdentifier( name, new TSEnumMemberDefinition(name, member), @@ -720,6 +727,10 @@ class Referencer extends Visitor { this.close(node); } + protected TSSatisfiesExpression(node: TSESTree.TSSatisfiesExpression): void { + this.visitTypeAssertion(node); + } + protected TSTypeAliasDeclaration( node: TSESTree.TSTypeAliasDeclaration, ): void { diff --git a/packages/scope-manager/src/referencer/TypeVisitor.ts b/packages/scope-manager/src/referencer/TypeVisitor.ts index 9fd00046f8a..0b4bbbcaf99 100644 --- a/packages/scope-manager/src/referencer/TypeVisitor.ts +++ b/packages/scope-manager/src/referencer/TypeVisitor.ts @@ -1,8 +1,10 @@ -import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/types'; -import { Referencer } from './Referencer'; -import { Visitor } from './Visitor'; +import type { TSESTree } from '@typescript-eslint/types'; +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + import { ParameterDefinition, TypeDefinition } from '../definition'; import { ScopeType } from '../scope'; +import type { Referencer } from './Referencer'; +import { Visitor } from './Visitor'; class TypeVisitor extends Visitor { readonly #referencer: Referencer; diff --git a/packages/scope-manager/src/referencer/Visitor.ts b/packages/scope-manager/src/referencer/Visitor.ts index a3e1e989d51..a6b07b18efa 100644 --- a/packages/scope-manager/src/referencer/Visitor.ts +++ b/packages/scope-manager/src/referencer/Visitor.ts @@ -1,10 +1,11 @@ -import { TSESTree } from '@typescript-eslint/types'; -import { VisitorBase, VisitorOptions } from './VisitorBase'; -import { - PatternVisitor, +import type { TSESTree } from '@typescript-eslint/types'; + +import type { PatternVisitorCallback, PatternVisitorOptions, } from './PatternVisitor'; +import { PatternVisitor } from './PatternVisitor'; +import { VisitorBase, VisitorOptions } from './VisitorBase'; interface VisitPatternOptions extends PatternVisitorOptions { processRightHandNodes?: boolean; diff --git a/packages/scope-manager/src/referencer/VisitorBase.ts b/packages/scope-manager/src/referencer/VisitorBase.ts index 8e06863a229..5a7a8bbebe0 100644 --- a/packages/scope-manager/src/referencer/VisitorBase.ts +++ b/packages/scope-manager/src/referencer/VisitorBase.ts @@ -1,5 +1,5 @@ -import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/types'; -import { visitorKeys, VisitorKeys } from '@typescript-eslint/visitor-keys'; +import type { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/types'; +import { VisitorKeys, visitorKeys } from '@typescript-eslint/visitor-keys'; interface VisitorOptions { childVisitorKeys?: VisitorKeys | null; diff --git a/packages/scope-manager/src/scope/BlockScope.ts b/packages/scope-manager/src/scope/BlockScope.ts index 959044282c2..58e836e3b12 100644 --- a/packages/scope-manager/src/scope/BlockScope.ts +++ b/packages/scope-manager/src/scope/BlockScope.ts @@ -1,8 +1,9 @@ -import { TSESTree } from '@typescript-eslint/types'; -import { Scope } from './Scope'; +import type { TSESTree } from '@typescript-eslint/types'; + +import type { ScopeManager } from '../ScopeManager'; +import type { Scope } from './Scope'; import { ScopeBase } from './ScopeBase'; import { ScopeType } from './ScopeType'; -import { ScopeManager } from '../ScopeManager'; class BlockScope extends ScopeBase< ScopeType.block, diff --git a/packages/scope-manager/src/scope/CatchScope.ts b/packages/scope-manager/src/scope/CatchScope.ts index 46b4005f3ac..d6ea58ff47d 100644 --- a/packages/scope-manager/src/scope/CatchScope.ts +++ b/packages/scope-manager/src/scope/CatchScope.ts @@ -1,8 +1,9 @@ -import { TSESTree } from '@typescript-eslint/types'; -import { Scope } from './Scope'; +import type { TSESTree } from '@typescript-eslint/types'; + +import type { ScopeManager } from '../ScopeManager'; +import type { Scope } from './Scope'; import { ScopeBase } from './ScopeBase'; import { ScopeType } from './ScopeType'; -import { ScopeManager } from '../ScopeManager'; class CatchScope extends ScopeBase< ScopeType.catch, diff --git a/packages/scope-manager/src/scope/ClassFieldInitializerScope.ts b/packages/scope-manager/src/scope/ClassFieldInitializerScope.ts index b176fb2060f..c2513901623 100644 --- a/packages/scope-manager/src/scope/ClassFieldInitializerScope.ts +++ b/packages/scope-manager/src/scope/ClassFieldInitializerScope.ts @@ -1,8 +1,9 @@ -import { TSESTree } from '@typescript-eslint/types'; -import { Scope } from './Scope'; +import type { TSESTree } from '@typescript-eslint/types'; + +import type { ScopeManager } from '../ScopeManager'; +import type { Scope } from './Scope'; import { ScopeBase } from './ScopeBase'; import { ScopeType } from './ScopeType'; -import { ScopeManager } from '../ScopeManager'; class ClassFieldInitializerScope extends ScopeBase< ScopeType.classFieldInitializer, diff --git a/packages/scope-manager/src/scope/ClassScope.ts b/packages/scope-manager/src/scope/ClassScope.ts index ee28a31aa08..b280cad65b2 100644 --- a/packages/scope-manager/src/scope/ClassScope.ts +++ b/packages/scope-manager/src/scope/ClassScope.ts @@ -1,8 +1,9 @@ -import { TSESTree } from '@typescript-eslint/types'; -import { Scope } from './Scope'; +import type { TSESTree } from '@typescript-eslint/types'; + +import type { ScopeManager } from '../ScopeManager'; +import type { Scope } from './Scope'; import { ScopeBase } from './ScopeBase'; import { ScopeType } from './ScopeType'; -import { ScopeManager } from '../ScopeManager'; class ClassScope extends ScopeBase< ScopeType.class, diff --git a/packages/scope-manager/src/scope/ClassStaticBlockScope.ts b/packages/scope-manager/src/scope/ClassStaticBlockScope.ts index 40a5d54b37c..a9eb599ab53 100644 --- a/packages/scope-manager/src/scope/ClassStaticBlockScope.ts +++ b/packages/scope-manager/src/scope/ClassStaticBlockScope.ts @@ -1,12 +1,13 @@ -import { TSESTree } from '@typescript-eslint/types'; -import { Scope } from './Scope'; +import type { TSESTree } from '@typescript-eslint/types'; + +import type { ScopeManager } from '../ScopeManager'; +import type { Scope } from './Scope'; import { ScopeBase } from './ScopeBase'; import { ScopeType } from './ScopeType'; -import { ScopeManager } from '../ScopeManager'; class ClassStaticBlockScope extends ScopeBase< ScopeType.classStaticBlock, - TSESTree.Expression, + TSESTree.StaticBlock, Scope > { constructor( diff --git a/packages/scope-manager/src/scope/ConditionalTypeScope.ts b/packages/scope-manager/src/scope/ConditionalTypeScope.ts index c20f1217e0e..7175457ad8a 100644 --- a/packages/scope-manager/src/scope/ConditionalTypeScope.ts +++ b/packages/scope-manager/src/scope/ConditionalTypeScope.ts @@ -1,8 +1,9 @@ -import { TSESTree } from '@typescript-eslint/types'; -import { Scope } from './Scope'; +import type { TSESTree } from '@typescript-eslint/types'; + +import type { ScopeManager } from '../ScopeManager'; +import type { Scope } from './Scope'; import { ScopeBase } from './ScopeBase'; import { ScopeType } from './ScopeType'; -import { ScopeManager } from '../ScopeManager'; class ConditionalTypeScope extends ScopeBase< ScopeType.conditionalType, diff --git a/packages/scope-manager/src/scope/ForScope.ts b/packages/scope-manager/src/scope/ForScope.ts index 36703b5d197..6b12f0c50f9 100644 --- a/packages/scope-manager/src/scope/ForScope.ts +++ b/packages/scope-manager/src/scope/ForScope.ts @@ -1,8 +1,9 @@ -import { TSESTree } from '@typescript-eslint/types'; -import { Scope } from './Scope'; +import type { TSESTree } from '@typescript-eslint/types'; + +import type { ScopeManager } from '../ScopeManager'; +import type { Scope } from './Scope'; import { ScopeBase } from './ScopeBase'; import { ScopeType } from './ScopeType'; -import { ScopeManager } from '../ScopeManager'; class ForScope extends ScopeBase< ScopeType.for, diff --git a/packages/scope-manager/src/scope/FunctionExpressionNameScope.ts b/packages/scope-manager/src/scope/FunctionExpressionNameScope.ts index a84bc4b2c8d..d3c8825a306 100644 --- a/packages/scope-manager/src/scope/FunctionExpressionNameScope.ts +++ b/packages/scope-manager/src/scope/FunctionExpressionNameScope.ts @@ -1,9 +1,10 @@ -import { TSESTree } from '@typescript-eslint/types'; +import type { TSESTree } from '@typescript-eslint/types'; + +import { FunctionNameDefinition } from '../definition'; +import type { ScopeManager } from '../ScopeManager'; +import type { Scope } from './Scope'; import { ScopeBase } from './ScopeBase'; import { ScopeType } from './ScopeType'; -import { Scope } from './Scope'; -import { FunctionNameDefinition } from '../definition'; -import { ScopeManager } from '../ScopeManager'; class FunctionExpressionNameScope extends ScopeBase< ScopeType.functionExpressionName, diff --git a/packages/scope-manager/src/scope/FunctionScope.ts b/packages/scope-manager/src/scope/FunctionScope.ts index a26b272fd02..c2a48fc45c3 100644 --- a/packages/scope-manager/src/scope/FunctionScope.ts +++ b/packages/scope-manager/src/scope/FunctionScope.ts @@ -1,10 +1,12 @@ -import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/types'; -import { Scope } from './Scope'; +import type { TSESTree } from '@typescript-eslint/types'; +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import type { Reference } from '../referencer/Reference'; +import type { ScopeManager } from '../ScopeManager'; +import type { Variable } from '../variable'; +import type { Scope } from './Scope'; import { ScopeBase } from './ScopeBase'; import { ScopeType } from './ScopeType'; -import { Reference } from '../referencer/Reference'; -import { ScopeManager } from '../ScopeManager'; -import { Variable } from '../variable'; class FunctionScope extends ScopeBase< ScopeType.function, diff --git a/packages/scope-manager/src/scope/FunctionTypeScope.ts b/packages/scope-manager/src/scope/FunctionTypeScope.ts index d459070cdf8..f6029a0df5d 100644 --- a/packages/scope-manager/src/scope/FunctionTypeScope.ts +++ b/packages/scope-manager/src/scope/FunctionTypeScope.ts @@ -1,8 +1,9 @@ -import { TSESTree } from '@typescript-eslint/types'; -import { Scope } from './Scope'; +import type { TSESTree } from '@typescript-eslint/types'; + +import type { ScopeManager } from '../ScopeManager'; +import type { Scope } from './Scope'; import { ScopeBase } from './ScopeBase'; import { ScopeType } from './ScopeType'; -import { ScopeManager } from '../ScopeManager'; class FunctionTypeScope extends ScopeBase< ScopeType.functionType, diff --git a/packages/scope-manager/src/scope/GlobalScope.ts b/packages/scope-manager/src/scope/GlobalScope.ts index 9dfb1e30284..de253e5543d 100644 --- a/packages/scope-manager/src/scope/GlobalScope.ts +++ b/packages/scope-manager/src/scope/GlobalScope.ts @@ -1,16 +1,15 @@ -import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/types'; -import { Scope } from './Scope'; -import { ScopeBase } from './ScopeBase'; -import { ScopeType } from './ScopeType'; +import type { TSESTree } from '@typescript-eslint/types'; +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + import { assert } from '../assert'; import { ImplicitGlobalVariableDefinition } from '../definition/ImplicitGlobalVariableDefinition'; -import { Reference } from '../referencer/Reference'; -import { ScopeManager } from '../ScopeManager'; -import { - Variable, - ImplicitLibVariable, - ImplicitLibVariableOptions, -} from '../variable'; +import type { Reference } from '../referencer/Reference'; +import type { ScopeManager } from '../ScopeManager'; +import type { ImplicitLibVariableOptions, Variable } from '../variable'; +import { ImplicitLibVariable } from '../variable'; +import type { Scope } from './Scope'; +import { ScopeBase } from './ScopeBase'; +import { ScopeType } from './ScopeType'; class GlobalScope extends ScopeBase< ScopeType.global, diff --git a/packages/scope-manager/src/scope/MappedTypeScope.ts b/packages/scope-manager/src/scope/MappedTypeScope.ts index 9b5c2a05d4b..4711b18ee84 100644 --- a/packages/scope-manager/src/scope/MappedTypeScope.ts +++ b/packages/scope-manager/src/scope/MappedTypeScope.ts @@ -1,8 +1,9 @@ -import { TSESTree } from '@typescript-eslint/types'; -import { Scope } from './Scope'; +import type { TSESTree } from '@typescript-eslint/types'; + +import type { ScopeManager } from '../ScopeManager'; +import type { Scope } from './Scope'; import { ScopeBase } from './ScopeBase'; import { ScopeType } from './ScopeType'; -import { ScopeManager } from '../ScopeManager'; class MappedTypeScope extends ScopeBase< ScopeType.mappedType, diff --git a/packages/scope-manager/src/scope/ModuleScope.ts b/packages/scope-manager/src/scope/ModuleScope.ts index 87c5ab52830..95af2f7065a 100644 --- a/packages/scope-manager/src/scope/ModuleScope.ts +++ b/packages/scope-manager/src/scope/ModuleScope.ts @@ -1,8 +1,9 @@ -import { TSESTree } from '@typescript-eslint/types'; -import { Scope } from './Scope'; +import type { TSESTree } from '@typescript-eslint/types'; + +import type { ScopeManager } from '../ScopeManager'; +import type { Scope } from './Scope'; import { ScopeBase } from './ScopeBase'; import { ScopeType } from './ScopeType'; -import { ScopeManager } from '../ScopeManager'; class ModuleScope extends ScopeBase { constructor( diff --git a/packages/scope-manager/src/scope/Scope.ts b/packages/scope-manager/src/scope/Scope.ts index e6237a09119..708869313a6 100644 --- a/packages/scope-manager/src/scope/Scope.ts +++ b/packages/scope-manager/src/scope/Scope.ts @@ -1,21 +1,21 @@ -import { BlockScope } from './BlockScope'; -import { CatchScope } from './CatchScope'; -import { ClassFieldInitializerScope } from './ClassFieldInitializerScope'; -import { ClassStaticBlockScope } from './ClassStaticBlockScope'; -import { ClassScope } from './ClassScope'; -import { ConditionalTypeScope } from './ConditionalTypeScope'; -import { ForScope } from './ForScope'; -import { FunctionExpressionNameScope } from './FunctionExpressionNameScope'; -import { FunctionScope } from './FunctionScope'; -import { FunctionTypeScope } from './FunctionTypeScope'; -import { GlobalScope } from './GlobalScope'; -import { MappedTypeScope } from './MappedTypeScope'; -import { ModuleScope } from './ModuleScope'; -import { SwitchScope } from './SwitchScope'; -import { TSEnumScope } from './TSEnumScope'; -import { TSModuleScope } from './TSModuleScope'; -import { TypeScope } from './TypeScope'; -import { WithScope } from './WithScope'; +import type { BlockScope } from './BlockScope'; +import type { CatchScope } from './CatchScope'; +import type { ClassFieldInitializerScope } from './ClassFieldInitializerScope'; +import type { ClassScope } from './ClassScope'; +import type { ClassStaticBlockScope } from './ClassStaticBlockScope'; +import type { ConditionalTypeScope } from './ConditionalTypeScope'; +import type { ForScope } from './ForScope'; +import type { FunctionExpressionNameScope } from './FunctionExpressionNameScope'; +import type { FunctionScope } from './FunctionScope'; +import type { FunctionTypeScope } from './FunctionTypeScope'; +import type { GlobalScope } from './GlobalScope'; +import type { MappedTypeScope } from './MappedTypeScope'; +import type { ModuleScope } from './ModuleScope'; +import type { SwitchScope } from './SwitchScope'; +import type { TSEnumScope } from './TSEnumScope'; +import type { TSModuleScope } from './TSModuleScope'; +import type { TypeScope } from './TypeScope'; +import type { WithScope } from './WithScope'; type Scope = | BlockScope diff --git a/packages/scope-manager/src/scope/ScopeBase.ts b/packages/scope-manager/src/scope/ScopeBase.ts index 76c23f720f5..ae26d129cb5 100644 --- a/packages/scope-manager/src/scope/ScopeBase.ts +++ b/packages/scope-manager/src/scope/ScopeBase.ts @@ -1,21 +1,24 @@ -import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/types'; -import { FunctionScope } from './FunctionScope'; -import { GlobalScope } from './GlobalScope'; -import { ScopeType } from './ScopeType'; -import { ScopeManager } from '../ScopeManager'; -import { Scope } from './Scope'; -import { ModuleScope } from './ModuleScope'; +import type { TSESTree } from '@typescript-eslint/types'; +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + import { assert } from '../assert'; -import { Definition, DefinitionType } from '../definition'; +import type { Definition } from '../definition'; +import { DefinitionType } from '../definition'; import { createIdGenerator } from '../ID'; +import type { ReferenceImplicitGlobal } from '../referencer/Reference'; import { Reference, ReferenceFlag, - ReferenceImplicitGlobal, ReferenceTypeFlag, } from '../referencer/Reference'; +import type { ScopeManager } from '../ScopeManager'; import { Variable } from '../variable'; -import { TSModuleScope } from './TSModuleScope'; +import type { FunctionScope } from './FunctionScope'; +import type { GlobalScope } from './GlobalScope'; +import type { ModuleScope } from './ModuleScope'; +import type { Scope } from './Scope'; +import { ScopeType } from './ScopeType'; +import type { TSModuleScope } from './TSModuleScope'; /** * Test if scope is strict diff --git a/packages/scope-manager/src/scope/SwitchScope.ts b/packages/scope-manager/src/scope/SwitchScope.ts index 7a684564cd4..ee2406c18d2 100644 --- a/packages/scope-manager/src/scope/SwitchScope.ts +++ b/packages/scope-manager/src/scope/SwitchScope.ts @@ -1,8 +1,9 @@ -import { TSESTree } from '@typescript-eslint/types'; -import { Scope } from './Scope'; +import type { TSESTree } from '@typescript-eslint/types'; + +import type { ScopeManager } from '../ScopeManager'; +import type { Scope } from './Scope'; import { ScopeBase } from './ScopeBase'; import { ScopeType } from './ScopeType'; -import { ScopeManager } from '../ScopeManager'; class SwitchScope extends ScopeBase< ScopeType.switch, diff --git a/packages/scope-manager/src/scope/TSEnumScope.ts b/packages/scope-manager/src/scope/TSEnumScope.ts index 3962784acd2..b5f6210a728 100644 --- a/packages/scope-manager/src/scope/TSEnumScope.ts +++ b/packages/scope-manager/src/scope/TSEnumScope.ts @@ -1,8 +1,9 @@ -import { TSESTree } from '@typescript-eslint/types'; -import { Scope } from './Scope'; +import type { TSESTree } from '@typescript-eslint/types'; + +import type { ScopeManager } from '../ScopeManager'; +import type { Scope } from './Scope'; import { ScopeBase } from './ScopeBase'; import { ScopeType } from './ScopeType'; -import { ScopeManager } from '../ScopeManager'; class TSEnumScope extends ScopeBase< ScopeType.tsEnum, diff --git a/packages/scope-manager/src/scope/TSModuleScope.ts b/packages/scope-manager/src/scope/TSModuleScope.ts index bdc7c7dc329..7ebdafd6c15 100644 --- a/packages/scope-manager/src/scope/TSModuleScope.ts +++ b/packages/scope-manager/src/scope/TSModuleScope.ts @@ -1,8 +1,9 @@ -import { TSESTree } from '@typescript-eslint/types'; -import { Scope } from './Scope'; +import type { TSESTree } from '@typescript-eslint/types'; + +import type { ScopeManager } from '../ScopeManager'; +import type { Scope } from './Scope'; import { ScopeBase } from './ScopeBase'; import { ScopeType } from './ScopeType'; -import { ScopeManager } from '../ScopeManager'; class TSModuleScope extends ScopeBase< ScopeType.tsModule, diff --git a/packages/scope-manager/src/scope/TypeScope.ts b/packages/scope-manager/src/scope/TypeScope.ts index 7f21a60f22b..167c118f850 100644 --- a/packages/scope-manager/src/scope/TypeScope.ts +++ b/packages/scope-manager/src/scope/TypeScope.ts @@ -1,8 +1,9 @@ -import { TSESTree } from '@typescript-eslint/types'; -import { Scope } from './Scope'; +import type { TSESTree } from '@typescript-eslint/types'; + +import type { ScopeManager } from '../ScopeManager'; +import type { Scope } from './Scope'; import { ScopeBase } from './ScopeBase'; import { ScopeType } from './ScopeType'; -import { ScopeManager } from '../ScopeManager'; class TypeScope extends ScopeBase< ScopeType.type, diff --git a/packages/scope-manager/src/scope/WithScope.ts b/packages/scope-manager/src/scope/WithScope.ts index f867a1e994e..7058ab70faa 100644 --- a/packages/scope-manager/src/scope/WithScope.ts +++ b/packages/scope-manager/src/scope/WithScope.ts @@ -1,9 +1,10 @@ -import { TSESTree } from '@typescript-eslint/types'; -import { Scope } from './Scope'; +import type { TSESTree } from '@typescript-eslint/types'; + +import { assert } from '../assert'; +import type { ScopeManager } from '../ScopeManager'; +import type { Scope } from './Scope'; import { ScopeBase } from './ScopeBase'; import { ScopeType } from './ScopeType'; -import { assert } from '../assert'; -import { ScopeManager } from '../ScopeManager'; class WithScope extends ScopeBase< ScopeType.with, diff --git a/packages/scope-manager/src/variable/ESLintScopeVariable.ts b/packages/scope-manager/src/variable/ESLintScopeVariable.ts index b40bb1c9026..51670c08f1a 100644 --- a/packages/scope-manager/src/variable/ESLintScopeVariable.ts +++ b/packages/scope-manager/src/variable/ESLintScopeVariable.ts @@ -1,5 +1,6 @@ +import type { TSESTree } from '@typescript-eslint/types'; + import { VariableBase } from './VariableBase'; -import { TSESTree } from '@typescript-eslint/types'; /** * ESLint defines global variables using the eslint-scope Variable class diff --git a/packages/scope-manager/src/variable/ImplicitLibVariable.ts b/packages/scope-manager/src/variable/ImplicitLibVariable.ts index 898ee4a6fb7..2ebb8fef0ee 100644 --- a/packages/scope-manager/src/variable/ImplicitLibVariable.ts +++ b/packages/scope-manager/src/variable/ImplicitLibVariable.ts @@ -1,6 +1,6 @@ +import type { Scope } from '../scope'; import { ESLintScopeVariable } from './ESLintScopeVariable'; -import { Variable } from './Variable'; -import { Scope } from '../scope'; +import type { Variable } from './Variable'; interface ImplicitLibVariableOptions { readonly eslintImplicitGlobalSetting?: ESLintScopeVariable['eslintImplicitGlobalSetting']; diff --git a/packages/scope-manager/src/variable/VariableBase.ts b/packages/scope-manager/src/variable/VariableBase.ts index 95b1796196b..f3c9fd44997 100644 --- a/packages/scope-manager/src/variable/VariableBase.ts +++ b/packages/scope-manager/src/variable/VariableBase.ts @@ -1,8 +1,9 @@ -import { TSESTree } from '@typescript-eslint/types'; -import { Definition } from '../definition'; +import type { TSESTree } from '@typescript-eslint/types'; + +import type { Definition } from '../definition'; import { createIdGenerator } from '../ID'; -import { Reference } from '../referencer/Reference'; -import { Scope } from '../scope'; +import type { Reference } from '../referencer/Reference'; +import type { Scope } from '../scope'; const generator = createIdGenerator(); diff --git a/packages/scope-manager/tests/eslint-scope/child-visitor-keys.test.ts b/packages/scope-manager/tests/eslint-scope/child-visitor-keys.test.ts index 8975dc5043d..0e9d7faf9cf 100644 --- a/packages/scope-manager/tests/eslint-scope/child-visitor-keys.test.ts +++ b/packages/scope-manager/tests/eslint-scope/child-visitor-keys.test.ts @@ -1,6 +1,7 @@ -import { TSESTree } from '@typescript-eslint/types'; -import { parse } from '../util'; +import type { TSESTree } from '@typescript-eslint/types'; + import { analyze } from '../../src/analyze'; +import { parse } from '../util'; describe('childVisitorKeys option', () => { it('should not visit to properties which are not given.', () => { diff --git a/packages/scope-manager/tests/eslint-scope/class-fields.test.ts b/packages/scope-manager/tests/eslint-scope/class-fields.test.ts index 541b46a2fff..504cd5880ae 100644 --- a/packages/scope-manager/tests/eslint-scope/class-fields.test.ts +++ b/packages/scope-manager/tests/eslint-scope/class-fields.test.ts @@ -1,10 +1,8 @@ import { expectToBeClassFieldInitializerScope, - expectToBeIdentifier, -} from '../util'; -import { expectToBeClassScope, expectToBeGlobalScope, + expectToBeIdentifier, parseAndAnalyze, } from '../util'; diff --git a/packages/scope-manager/tests/eslint-scope/es6-arrow-function-expression.test.ts b/packages/scope-manager/tests/eslint-scope/es6-arrow-function-expression.test.ts index a172d54423d..8545a278fca 100644 --- a/packages/scope-manager/tests/eslint-scope/es6-arrow-function-expression.test.ts +++ b/packages/scope-manager/tests/eslint-scope/es6-arrow-function-expression.test.ts @@ -1,4 +1,5 @@ import { AST_NODE_TYPES } from '@typescript-eslint/types'; + import { expectToBeFunctionScope, expectToBeGlobalScope, diff --git a/packages/scope-manager/tests/eslint-scope/es6-catch.test.ts b/packages/scope-manager/tests/eslint-scope/es6-catch.test.ts index c82f3791833..a1a31a4c0f7 100644 --- a/packages/scope-manager/tests/eslint-scope/es6-catch.test.ts +++ b/packages/scope-manager/tests/eslint-scope/es6-catch.test.ts @@ -1,4 +1,5 @@ import { AST_NODE_TYPES } from '@typescript-eslint/types'; + import { expectToBeBlockScope, expectToBeCatchScope, diff --git a/packages/scope-manager/tests/eslint-scope/es6-class.test.ts b/packages/scope-manager/tests/eslint-scope/es6-class.test.ts index a3c03b20518..3138b1c5f75 100644 --- a/packages/scope-manager/tests/eslint-scope/es6-class.test.ts +++ b/packages/scope-manager/tests/eslint-scope/es6-class.test.ts @@ -1,4 +1,5 @@ import { AST_NODE_TYPES } from '@typescript-eslint/types'; + import { expectToBeClassScope, expectToBeFunctionScope, diff --git a/packages/scope-manager/tests/eslint-scope/es6-import.test.ts b/packages/scope-manager/tests/eslint-scope/es6-import.test.ts index 835676292a2..38319a79bf6 100644 --- a/packages/scope-manager/tests/eslint-scope/es6-import.test.ts +++ b/packages/scope-manager/tests/eslint-scope/es6-import.test.ts @@ -1,4 +1,3 @@ -import { parseAndAnalyze } from '../util/parse'; import { expectToBeGlobalScope, expectToBeImportBindingDefinition, @@ -6,6 +5,7 @@ import { expectToBeVariableDefinition, getRealVariables, } from '../util'; +import { parseAndAnalyze } from '../util/parse'; describe('import declaration', () => { // http://people.mozilla.org/~jorendorff/es6-draft.html#sec-static-and-runtme-semantics-module-records diff --git a/packages/scope-manager/tests/eslint-scope/es6-new-target.test.ts b/packages/scope-manager/tests/eslint-scope/es6-new-target.test.ts index 442f17a1212..72d15a196ce 100644 --- a/packages/scope-manager/tests/eslint-scope/es6-new-target.test.ts +++ b/packages/scope-manager/tests/eslint-scope/es6-new-target.test.ts @@ -1,4 +1,5 @@ import { AST_NODE_TYPES } from '@typescript-eslint/types'; + import { expectToBeFunctionScope, getRealVariables, diff --git a/packages/scope-manager/tests/eslint-scope/es6-object.test.ts b/packages/scope-manager/tests/eslint-scope/es6-object.test.ts index 5f69b51040d..5b39f7d23b0 100644 --- a/packages/scope-manager/tests/eslint-scope/es6-object.test.ts +++ b/packages/scope-manager/tests/eslint-scope/es6-object.test.ts @@ -1,4 +1,5 @@ import { AST_NODE_TYPES } from '@typescript-eslint/types'; + import { expectToBeFunctionScope, expectToBeGlobalScope, diff --git a/packages/scope-manager/tests/eslint-scope/es6-rest-args.test.ts b/packages/scope-manager/tests/eslint-scope/es6-rest-args.test.ts index 6d0fc2d4c67..e48ac9716c7 100644 --- a/packages/scope-manager/tests/eslint-scope/es6-rest-args.test.ts +++ b/packages/scope-manager/tests/eslint-scope/es6-rest-args.test.ts @@ -1,4 +1,5 @@ import { AST_NODE_TYPES } from '@typescript-eslint/types'; + import { expectToBeFunctionScope, expectToBeGlobalScope, diff --git a/packages/scope-manager/tests/eslint-scope/es6-switch.test.ts b/packages/scope-manager/tests/eslint-scope/es6-switch.test.ts index f36731f43c9..d0280769b27 100644 --- a/packages/scope-manager/tests/eslint-scope/es6-switch.test.ts +++ b/packages/scope-manager/tests/eslint-scope/es6-switch.test.ts @@ -1,4 +1,5 @@ import { AST_NODE_TYPES } from '@typescript-eslint/types'; + import { expectToBeGlobalScope, expectToBeSwitchScope, diff --git a/packages/scope-manager/tests/eslint-scope/es6-template-literal.test.ts b/packages/scope-manager/tests/eslint-scope/es6-template-literal.test.ts index 0e019c68a99..a263f305eae 100644 --- a/packages/scope-manager/tests/eslint-scope/es6-template-literal.test.ts +++ b/packages/scope-manager/tests/eslint-scope/es6-template-literal.test.ts @@ -1,4 +1,5 @@ import { AST_NODE_TYPES } from '@typescript-eslint/types'; + import { expectToBeFunctionScope, expectToBeGlobalScope, diff --git a/packages/scope-manager/tests/eslint-scope/get-declared-variables.test.ts b/packages/scope-manager/tests/eslint-scope/get-declared-variables.test.ts index 7f57a448375..23e02b9af0c 100644 --- a/packages/scope-manager/tests/eslint-scope/get-declared-variables.test.ts +++ b/packages/scope-manager/tests/eslint-scope/get-declared-variables.test.ts @@ -1,7 +1,9 @@ -import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/types'; +import type { TSESTree } from '@typescript-eslint/types'; +import { AST_NODE_TYPES } from '@typescript-eslint/types'; import { simpleTraverse } from '@typescript-eslint/typescript-estree'; -import { parse } from '../util/parse'; + import { analyze } from '../../src/analyze'; +import { parse } from '../util/parse'; describe('ScopeManager.prototype.getDeclaredVariables', () => { function verify( diff --git a/packages/scope-manager/tests/eslint-scope/global-return.test.ts b/packages/scope-manager/tests/eslint-scope/global-return.test.ts index 285f7d7c62e..8293dd8d867 100644 --- a/packages/scope-manager/tests/eslint-scope/global-return.test.ts +++ b/packages/scope-manager/tests/eslint-scope/global-return.test.ts @@ -1,9 +1,10 @@ import { AST_NODE_TYPES } from '@typescript-eslint/types'; + import { - expectToBeGlobalScope, expectToBeFunctionScope, - expectToBeModuleScope, + expectToBeGlobalScope, expectToBeImportBindingDefinition, + expectToBeModuleScope, getRealVariables, } from '../util'; import { parseAndAnalyze } from '../util/parse'; diff --git a/packages/scope-manager/tests/eslint-scope/implicit-global-reference.test.ts b/packages/scope-manager/tests/eslint-scope/implicit-global-reference.test.ts index bc2d589a943..743d19873ec 100644 --- a/packages/scope-manager/tests/eslint-scope/implicit-global-reference.test.ts +++ b/packages/scope-manager/tests/eslint-scope/implicit-global-reference.test.ts @@ -1,9 +1,9 @@ +import { DefinitionType } from '../../src/definition'; import { expectToBeGlobalScope, getRealVariables, parseAndAnalyze, } from '../util'; -import { DefinitionType } from '../../src/definition'; describe('implicit global reference', () => { it('assignments global scope', () => { diff --git a/packages/scope-manager/tests/eslint-scope/implied-strict.test.ts b/packages/scope-manager/tests/eslint-scope/implied-strict.test.ts index 645e8c83c07..34151be8c3d 100644 --- a/packages/scope-manager/tests/eslint-scope/implied-strict.test.ts +++ b/packages/scope-manager/tests/eslint-scope/implied-strict.test.ts @@ -1,4 +1,5 @@ import { AST_NODE_TYPES } from '@typescript-eslint/types'; + import { expectToBeFunctionScope, expectToBeGlobalScope, diff --git a/packages/scope-manager/tests/eslint-scope/map-ecma-version.test.ts b/packages/scope-manager/tests/eslint-scope/map-ecma-version.test.ts index 9cf4cfab3d7..becca474ff3 100644 --- a/packages/scope-manager/tests/eslint-scope/map-ecma-version.test.ts +++ b/packages/scope-manager/tests/eslint-scope/map-ecma-version.test.ts @@ -1,6 +1,7 @@ +import type { EcmaVersion, Lib, TSESTree } from '@typescript-eslint/types'; + import { analyze } from '../../src/analyze'; import { Referencer } from '../../src/referencer'; -import { TSESTree, EcmaVersion, Lib } from '@typescript-eslint/types'; jest.mock('../../src/referencer'); jest.mock('../../src/ScopeManager'); diff --git a/packages/scope-manager/tests/eslint-scope/typescript.test.ts b/packages/scope-manager/tests/eslint-scope/typescript.test.ts index 03928e08e5e..6cdb4340573 100644 --- a/packages/scope-manager/tests/eslint-scope/typescript.test.ts +++ b/packages/scope-manager/tests/eslint-scope/typescript.test.ts @@ -1,4 +1,5 @@ import { AST_NODE_TYPES } from '@typescript-eslint/types'; + import { expectToBeFunctionScope, expectToBeGlobalScope, diff --git a/packages/scope-manager/tests/fixtures.test.ts b/packages/scope-manager/tests/fixtures.test.ts index b5a2fc70bd6..fa86c1544c7 100644 --- a/packages/scope-manager/tests/fixtures.test.ts +++ b/packages/scope-manager/tests/fixtures.test.ts @@ -2,7 +2,9 @@ import fs from 'fs'; import glob from 'glob'; import makeDir from 'make-dir'; import path from 'path'; -import { parseAndAnalyze, AnalyzeOptions } from './util'; + +import type { AnalyzeOptions } from './util'; +import { parseAndAnalyze } from './util'; // Assign a segment set to this variable to limit the test to only this segment // This is super helpful if you need to debug why a specific fixture isn't producing the correct output diff --git a/packages/scope-manager/tests/fixtures/class/declaration/abstract-accessor-property.ts b/packages/scope-manager/tests/fixtures/class/declaration/abstract-accessor-property.ts new file mode 100644 index 00000000000..b84caed0b39 --- /dev/null +++ b/packages/scope-manager/tests/fixtures/class/declaration/abstract-accessor-property.ts @@ -0,0 +1,5 @@ +type T = 1; + +abstract class Foo { + abstract prop: T; +} diff --git a/packages/scope-manager/tests/fixtures/class/declaration/abstract-accessor-property.ts.shot b/packages/scope-manager/tests/fixtures/class/declaration/abstract-accessor-property.ts.shot new file mode 100644 index 00000000000..c895afba904 --- /dev/null +++ b/packages/scope-manager/tests/fixtures/class/declaration/abstract-accessor-property.ts.shot @@ -0,0 +1,88 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`class declaration abstract-accessor-property 1`] = ` +ScopeManager { + variables: Array [ + ImplicitGlobalConstTypeVariable, + Variable$2 { + defs: Array [ + TypeDefinition$1 { + name: Identifier<"T">, + node: TSTypeAliasDeclaration$1, + }, + ], + name: "T", + references: Array [ + Reference$1 { + identifier: Identifier<"T">, + isRead: true, + isTypeReference: true, + isValueReference: false, + isWrite: false, + resolved: Variable$2, + }, + ], + isValueVariable: false, + isTypeVariable: true, + }, + Variable$3 { + defs: Array [ + ClassNameDefinition$2 { + name: Identifier<"Foo">, + node: ClassDeclaration$2, + }, + ], + name: "Foo", + references: Array [], + isValueVariable: true, + isTypeVariable: true, + }, + Variable$4 { + defs: Array [ + ClassNameDefinition$3 { + name: Identifier<"Foo">, + node: ClassDeclaration$2, + }, + ], + name: "Foo", + references: Array [], + isValueVariable: true, + isTypeVariable: true, + }, + ], + scopes: Array [ + GlobalScope$1 { + block: Program$3, + isStrict: false, + references: Array [], + set: Map { + "const" => ImplicitGlobalConstTypeVariable, + "T" => Variable$2, + "Foo" => Variable$3, + }, + type: "global", + upper: null, + variables: Array [ + ImplicitGlobalConstTypeVariable, + Variable$2, + Variable$3, + ], + }, + ClassScope$2 { + block: ClassDeclaration$2, + isStrict: true, + references: Array [ + Reference$1, + ], + set: Map { + "Foo" => Variable$4, + }, + type: "class", + upper: GlobalScope$1, + variables: Array [ + Variable$4, + ], + }, + ], +} +`; diff --git a/packages/scope-manager/tests/fixtures/class/declaration/accessor-property-type-annotation.ts b/packages/scope-manager/tests/fixtures/class/declaration/accessor-property-type-annotation.ts new file mode 100644 index 00000000000..824821d682e --- /dev/null +++ b/packages/scope-manager/tests/fixtures/class/declaration/accessor-property-type-annotation.ts @@ -0,0 +1,4 @@ +type T = 1; +class A { + prop: T; +} diff --git a/packages/scope-manager/tests/fixtures/class/declaration/accessor-property-type-annotation.ts.shot b/packages/scope-manager/tests/fixtures/class/declaration/accessor-property-type-annotation.ts.shot new file mode 100644 index 00000000000..fb8248edefe --- /dev/null +++ b/packages/scope-manager/tests/fixtures/class/declaration/accessor-property-type-annotation.ts.shot @@ -0,0 +1,88 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`class declaration accessor-property-type-annotation 1`] = ` +ScopeManager { + variables: Array [ + ImplicitGlobalConstTypeVariable, + Variable$2 { + defs: Array [ + TypeDefinition$1 { + name: Identifier<"T">, + node: TSTypeAliasDeclaration$1, + }, + ], + name: "T", + references: Array [ + Reference$1 { + identifier: Identifier<"T">, + isRead: true, + isTypeReference: true, + isValueReference: false, + isWrite: false, + resolved: Variable$2, + }, + ], + isValueVariable: false, + isTypeVariable: true, + }, + Variable$3 { + defs: Array [ + ClassNameDefinition$2 { + name: Identifier<"A">, + node: ClassDeclaration$2, + }, + ], + name: "A", + references: Array [], + isValueVariable: true, + isTypeVariable: true, + }, + Variable$4 { + defs: Array [ + ClassNameDefinition$3 { + name: Identifier<"A">, + node: ClassDeclaration$2, + }, + ], + name: "A", + references: Array [], + isValueVariable: true, + isTypeVariable: true, + }, + ], + scopes: Array [ + GlobalScope$1 { + block: Program$3, + isStrict: false, + references: Array [], + set: Map { + "const" => ImplicitGlobalConstTypeVariable, + "T" => Variable$2, + "A" => Variable$3, + }, + type: "global", + upper: null, + variables: Array [ + ImplicitGlobalConstTypeVariable, + Variable$2, + Variable$3, + ], + }, + ClassScope$2 { + block: ClassDeclaration$2, + isStrict: true, + references: Array [ + Reference$1, + ], + set: Map { + "A" => Variable$4, + }, + type: "class", + upper: GlobalScope$1, + variables: Array [ + Variable$4, + ], + }, + ], +} +`; diff --git a/packages/scope-manager/tests/fixtures/class/declaration/accessor-property.ts b/packages/scope-manager/tests/fixtures/class/declaration/accessor-property.ts new file mode 100644 index 00000000000..e75d9def3e9 --- /dev/null +++ b/packages/scope-manager/tests/fixtures/class/declaration/accessor-property.ts @@ -0,0 +1,7 @@ +const x = 1; +class A { + prop1 = 1; + prop2 = x; +} + +const unresolved = prop1; diff --git a/packages/scope-manager/tests/fixtures/class/declaration/accessor-property.ts.shot b/packages/scope-manager/tests/fixtures/class/declaration/accessor-property.ts.shot new file mode 100644 index 00000000000..88914131b5c --- /dev/null +++ b/packages/scope-manager/tests/fixtures/class/declaration/accessor-property.ts.shot @@ -0,0 +1,152 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`class declaration accessor-property 1`] = ` +ScopeManager { + variables: Array [ + ImplicitGlobalConstTypeVariable, + Variable$2 { + defs: Array [ + VariableDefinition$1 { + name: Identifier<"x">, + node: VariableDeclarator$1, + }, + ], + name: "x", + references: Array [ + Reference$1 { + identifier: Identifier<"x">, + init: true, + isRead: false, + isTypeReference: false, + isValueReference: true, + isWrite: true, + resolved: Variable$2, + writeExpr: Literal$2, + }, + Reference$2 { + identifier: Identifier<"x">, + isRead: true, + isTypeReference: false, + isValueReference: true, + isWrite: false, + resolved: Variable$2, + }, + ], + isValueVariable: true, + isTypeVariable: false, + }, + Variable$3 { + defs: Array [ + ClassNameDefinition$2 { + name: Identifier<"A">, + node: ClassDeclaration$3, + }, + ], + name: "A", + references: Array [], + isValueVariable: true, + isTypeVariable: true, + }, + Variable$4 { + defs: Array [ + ClassNameDefinition$3 { + name: Identifier<"A">, + node: ClassDeclaration$3, + }, + ], + name: "A", + references: Array [], + isValueVariable: true, + isTypeVariable: true, + }, + Variable$5 { + defs: Array [ + VariableDefinition$4 { + name: Identifier<"unresolved">, + node: VariableDeclarator$4, + }, + ], + name: "unresolved", + references: Array [ + Reference$3 { + identifier: Identifier<"unresolved">, + init: true, + isRead: false, + isTypeReference: false, + isValueReference: true, + isWrite: true, + resolved: Variable$5, + writeExpr: Identifier<"prop1">, + }, + ], + isValueVariable: true, + isTypeVariable: false, + }, + ], + scopes: Array [ + GlobalScope$1 { + block: Program$5, + isStrict: false, + references: Array [ + Reference$1, + Reference$3, + Reference$4 { + identifier: Identifier<"prop1">, + isRead: true, + isTypeReference: false, + isValueReference: true, + isWrite: false, + resolved: null, + }, + ], + set: Map { + "const" => ImplicitGlobalConstTypeVariable, + "x" => Variable$2, + "A" => Variable$3, + "unresolved" => Variable$5, + }, + type: "global", + upper: null, + variables: Array [ + ImplicitGlobalConstTypeVariable, + Variable$2, + Variable$3, + Variable$5, + ], + }, + ClassScope$2 { + block: ClassDeclaration$3, + isStrict: true, + references: Array [], + set: Map { + "A" => Variable$4, + }, + type: "class", + upper: GlobalScope$1, + variables: Array [ + Variable$4, + ], + }, + ClassFieldInitializerScope$3 { + block: Literal$6, + isStrict: true, + references: Array [], + set: Map {}, + type: "class-field-initializer", + upper: ClassScope$2, + variables: Array [], + }, + ClassFieldInitializerScope$4 { + block: Identifier<"x">, + isStrict: true, + references: Array [ + Reference$2, + ], + set: Map {}, + type: "class-field-initializer", + upper: ClassScope$2, + variables: Array [], + }, + ], +} +`; diff --git a/packages/scope-manager/tests/fixtures/class/declaration/static-block.ts b/packages/scope-manager/tests/fixtures/class/declaration/static-block.ts new file mode 100644 index 00000000000..93b92f6cf1f --- /dev/null +++ b/packages/scope-manager/tests/fixtures/class/declaration/static-block.ts @@ -0,0 +1,3 @@ +class A { + static {} +} diff --git a/packages/scope-manager/tests/fixtures/class/declaration/static-block.ts.shot b/packages/scope-manager/tests/fixtures/class/declaration/static-block.ts.shot new file mode 100644 index 00000000000..b49013a5575 --- /dev/null +++ b/packages/scope-manager/tests/fixtures/class/declaration/static-block.ts.shot @@ -0,0 +1,72 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`class declaration static-block 1`] = ` +ScopeManager { + variables: Array [ + ImplicitGlobalConstTypeVariable, + Variable$2 { + defs: Array [ + ClassNameDefinition$1 { + name: Identifier<"A">, + node: ClassDeclaration$1, + }, + ], + name: "A", + references: Array [], + isValueVariable: true, + isTypeVariable: true, + }, + Variable$3 { + defs: Array [ + ClassNameDefinition$2 { + name: Identifier<"A">, + node: ClassDeclaration$1, + }, + ], + name: "A", + references: Array [], + isValueVariable: true, + isTypeVariable: true, + }, + ], + scopes: Array [ + GlobalScope$1 { + block: Program$2, + isStrict: false, + references: Array [], + set: Map { + "const" => ImplicitGlobalConstTypeVariable, + "A" => Variable$2, + }, + type: "global", + upper: null, + variables: Array [ + ImplicitGlobalConstTypeVariable, + Variable$2, + ], + }, + ClassScope$2 { + block: ClassDeclaration$1, + isStrict: true, + references: Array [], + set: Map { + "A" => Variable$3, + }, + type: "class", + upper: GlobalScope$1, + variables: Array [ + Variable$3, + ], + }, + ClassStaticBlockScope$3 { + block: StaticBlock$3, + isStrict: true, + references: Array [], + set: Map {}, + type: "class-static-block", + upper: ClassScope$2, + variables: Array [], + }, + ], +} +`; diff --git a/packages/scope-manager/tests/fixtures/class/declaration/static-external-ref.ts b/packages/scope-manager/tests/fixtures/class/declaration/static-external-ref.ts new file mode 100644 index 00000000000..d2237dc62b5 --- /dev/null +++ b/packages/scope-manager/tests/fixtures/class/declaration/static-external-ref.ts @@ -0,0 +1,7 @@ +function f() {} + +class A { + static { + f(); + } +} diff --git a/packages/scope-manager/tests/fixtures/class/declaration/static-external-ref.ts.shot b/packages/scope-manager/tests/fixtures/class/declaration/static-external-ref.ts.shot new file mode 100644 index 00000000000..0ef13dfe6d5 --- /dev/null +++ b/packages/scope-manager/tests/fixtures/class/declaration/static-external-ref.ts.shot @@ -0,0 +1,117 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`class declaration static-external-ref 1`] = ` +ScopeManager { + variables: Array [ + ImplicitGlobalConstTypeVariable, + Variable$2 { + defs: Array [ + FunctionNameDefinition$1 { + name: Identifier<"f">, + node: FunctionDeclaration$1, + }, + ], + name: "f", + references: Array [ + Reference$1 { + identifier: Identifier<"f">, + isRead: true, + isTypeReference: false, + isValueReference: true, + isWrite: false, + resolved: Variable$2, + }, + ], + isValueVariable: true, + isTypeVariable: false, + }, + Variable$3 { + defs: Array [], + name: "arguments", + references: Array [], + isValueVariable: true, + isTypeVariable: true, + }, + Variable$4 { + defs: Array [ + ClassNameDefinition$2 { + name: Identifier<"A">, + node: ClassDeclaration$2, + }, + ], + name: "A", + references: Array [], + isValueVariable: true, + isTypeVariable: true, + }, + Variable$5 { + defs: Array [ + ClassNameDefinition$3 { + name: Identifier<"A">, + node: ClassDeclaration$2, + }, + ], + name: "A", + references: Array [], + isValueVariable: true, + isTypeVariable: true, + }, + ], + scopes: Array [ + GlobalScope$1 { + block: Program$3, + isStrict: false, + references: Array [], + set: Map { + "const" => ImplicitGlobalConstTypeVariable, + "f" => Variable$2, + "A" => Variable$4, + }, + type: "global", + upper: null, + variables: Array [ + ImplicitGlobalConstTypeVariable, + Variable$2, + Variable$4, + ], + }, + FunctionScope$2 { + block: FunctionDeclaration$1, + isStrict: false, + references: Array [], + set: Map { + "arguments" => Variable$3, + }, + type: "function", + upper: GlobalScope$1, + variables: Array [ + Variable$3, + ], + }, + ClassScope$3 { + block: ClassDeclaration$2, + isStrict: true, + references: Array [], + set: Map { + "A" => Variable$5, + }, + type: "class", + upper: GlobalScope$1, + variables: Array [ + Variable$5, + ], + }, + ClassStaticBlockScope$4 { + block: StaticBlock$4, + isStrict: true, + references: Array [ + Reference$1, + ], + set: Map {}, + type: "class-static-block", + upper: ClassScope$3, + variables: Array [], + }, + ], +} +`; diff --git a/packages/scope-manager/tests/fixtures/class/declaration/static-with-constructor.ts b/packages/scope-manager/tests/fixtures/class/declaration/static-with-constructor.ts new file mode 100644 index 00000000000..ceb030c000c --- /dev/null +++ b/packages/scope-manager/tests/fixtures/class/declaration/static-with-constructor.ts @@ -0,0 +1,10 @@ +// https://github.com/typescript-eslint/typescript-eslint/issues/5577 +function f() {} + +class A { + static {} + + constructor() { + f(); + } +} diff --git a/packages/scope-manager/tests/fixtures/class/declaration/static-with-constructor.ts.shot b/packages/scope-manager/tests/fixtures/class/declaration/static-with-constructor.ts.shot new file mode 100644 index 00000000000..76d943c8df8 --- /dev/null +++ b/packages/scope-manager/tests/fixtures/class/declaration/static-with-constructor.ts.shot @@ -0,0 +1,137 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`class declaration static-with-constructor 1`] = ` +ScopeManager { + variables: Array [ + ImplicitGlobalConstTypeVariable, + Variable$2 { + defs: Array [ + FunctionNameDefinition$1 { + name: Identifier<"f">, + node: FunctionDeclaration$1, + }, + ], + name: "f", + references: Array [ + Reference$1 { + identifier: Identifier<"f">, + isRead: true, + isTypeReference: false, + isValueReference: true, + isWrite: false, + resolved: Variable$2, + }, + ], + isValueVariable: true, + isTypeVariable: false, + }, + Variable$3 { + defs: Array [], + name: "arguments", + references: Array [], + isValueVariable: true, + isTypeVariable: true, + }, + Variable$4 { + defs: Array [ + ClassNameDefinition$2 { + name: Identifier<"A">, + node: ClassDeclaration$2, + }, + ], + name: "A", + references: Array [], + isValueVariable: true, + isTypeVariable: true, + }, + Variable$5 { + defs: Array [ + ClassNameDefinition$3 { + name: Identifier<"A">, + node: ClassDeclaration$2, + }, + ], + name: "A", + references: Array [], + isValueVariable: true, + isTypeVariable: true, + }, + Variable$6 { + defs: Array [], + name: "arguments", + references: Array [], + isValueVariable: true, + isTypeVariable: true, + }, + ], + scopes: Array [ + GlobalScope$1 { + block: Program$3, + isStrict: false, + references: Array [], + set: Map { + "const" => ImplicitGlobalConstTypeVariable, + "f" => Variable$2, + "A" => Variable$4, + }, + type: "global", + upper: null, + variables: Array [ + ImplicitGlobalConstTypeVariable, + Variable$2, + Variable$4, + ], + }, + FunctionScope$2 { + block: FunctionDeclaration$1, + isStrict: false, + references: Array [], + set: Map { + "arguments" => Variable$3, + }, + type: "function", + upper: GlobalScope$1, + variables: Array [ + Variable$3, + ], + }, + ClassScope$3 { + block: ClassDeclaration$2, + isStrict: true, + references: Array [], + set: Map { + "A" => Variable$5, + }, + type: "class", + upper: GlobalScope$1, + variables: Array [ + Variable$5, + ], + }, + ClassStaticBlockScope$4 { + block: StaticBlock$4, + isStrict: true, + references: Array [], + set: Map {}, + type: "class-static-block", + upper: ClassScope$3, + variables: Array [], + }, + FunctionScope$5 { + block: FunctionExpression$5, + isStrict: true, + references: Array [ + Reference$1, + ], + set: Map { + "arguments" => Variable$6, + }, + type: "function", + upper: ClassScope$3, + variables: Array [ + Variable$6, + ], + }, + ], +} +`; diff --git a/packages/scope-manager/tests/fixtures/instantiation-expressions/type-arguments1.ts b/packages/scope-manager/tests/fixtures/instantiation-expressions/type-arguments1.ts index dc8e0419db7..243db1b4aa8 100644 --- a/packages/scope-manager/tests/fixtures/instantiation-expressions/type-arguments1.ts +++ b/packages/scope-manager/tests/fixtures/instantiation-expressions/type-arguments1.ts @@ -1,9 +1,9 @@ class Foo { - value: T + value: T; } class Bar { - foo = Foo + foo = Foo; } -new Bar() +new Bar(); diff --git a/packages/scope-manager/tests/fixtures/type-assertion/satisfies.ts b/packages/scope-manager/tests/fixtures/type-assertion/satisfies.ts new file mode 100644 index 00000000000..69dae24ecf2 --- /dev/null +++ b/packages/scope-manager/tests/fixtures/type-assertion/satisfies.ts @@ -0,0 +1,4 @@ +const x = 1; +type T = 1; + +x satisfies T; diff --git a/packages/scope-manager/tests/fixtures/type-assertion/satisfies.ts.shot b/packages/scope-manager/tests/fixtures/type-assertion/satisfies.ts.shot new file mode 100644 index 00000000000..9d6dcc03ce1 --- /dev/null +++ b/packages/scope-manager/tests/fixtures/type-assertion/satisfies.ts.shot @@ -0,0 +1,84 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`type-assertion satisfies 1`] = ` +ScopeManager { + variables: Array [ + ImplicitGlobalConstTypeVariable, + Variable$2 { + defs: Array [ + VariableDefinition$1 { + name: Identifier<"x">, + node: VariableDeclarator$1, + }, + ], + name: "x", + references: Array [ + Reference$1 { + identifier: Identifier<"x">, + init: true, + isRead: false, + isTypeReference: false, + isValueReference: true, + isWrite: true, + resolved: Variable$2, + writeExpr: Literal$2, + }, + Reference$2 { + identifier: Identifier<"x">, + isRead: true, + isTypeReference: false, + isValueReference: true, + isWrite: false, + resolved: Variable$2, + }, + ], + isValueVariable: true, + isTypeVariable: false, + }, + Variable$3 { + defs: Array [ + TypeDefinition$2 { + name: Identifier<"T">, + node: TSTypeAliasDeclaration$3, + }, + ], + name: "T", + references: Array [ + Reference$3 { + identifier: Identifier<"T">, + isRead: true, + isTypeReference: true, + isValueReference: false, + isWrite: false, + resolved: Variable$3, + }, + ], + isValueVariable: false, + isTypeVariable: true, + }, + ], + scopes: Array [ + GlobalScope$1 { + block: Program$4, + isStrict: false, + references: Array [ + Reference$1, + Reference$2, + Reference$3, + ], + set: Map { + "const" => ImplicitGlobalConstTypeVariable, + "x" => Variable$2, + "T" => Variable$3, + }, + type: "global", + upper: null, + variables: Array [ + ImplicitGlobalConstTypeVariable, + Variable$2, + Variable$3, + ], + }, + ], +} +`; diff --git a/packages/scope-manager/tests/lib.test.ts b/packages/scope-manager/tests/lib.test.ts index 97573cef7da..81ed1789088 100644 --- a/packages/scope-manager/tests/lib.test.ts +++ b/packages/scope-manager/tests/lib.test.ts @@ -1,5 +1,5 @@ -import { parseAndAnalyze } from './util'; import { ImplicitLibVariable } from '../src'; +import { parseAndAnalyze } from './util'; describe('implicit lib definitions', () => { it('should define no implicit variables if provided an empty array', () => { diff --git a/packages/scope-manager/tests/types/reference-type.test.ts b/packages/scope-manager/tests/types/reference-type.test.ts index 2b4a305ff06..1ede0488440 100644 --- a/packages/scope-manager/tests/types/reference-type.test.ts +++ b/packages/scope-manager/tests/types/reference-type.test.ts @@ -1,4 +1,5 @@ import { AST_NODE_TYPES } from '@typescript-eslint/types'; + import { getSpecificNode, parseAndAnalyze } from '../util'; describe('referencing a type - positive', () => { diff --git a/packages/scope-manager/tests/types/variable-definition.test.ts b/packages/scope-manager/tests/types/variable-definition.test.ts index e7ea065516a..4ed907805fc 100644 --- a/packages/scope-manager/tests/types/variable-definition.test.ts +++ b/packages/scope-manager/tests/types/variable-definition.test.ts @@ -1,4 +1,5 @@ import { AST_NODE_TYPES } from '@typescript-eslint/types'; + import { getSpecificNode, parseAndAnalyze } from '../util'; describe('variable definition', () => { @@ -8,16 +9,16 @@ describe('variable definition', () => { `); const node = getSpecificNode(ast, AST_NODE_TYPES.TSTypeAliasDeclaration); expect(scopeManager.getDeclaredVariables(node)).toMatchInlineSnapshot(` - Array [ + [ Variable$2 { - defs: Array [ + defs: [ TypeDefinition$1 { name: Identifier<"TypeDecl">, node: TSTypeAliasDeclaration$1, }, ], name: "TypeDecl", - references: Array [], + references: [], isValueVariable: false, isTypeVariable: true, }, @@ -33,16 +34,16 @@ describe('variable definition', () => { `); const node = getSpecificNode(ast, AST_NODE_TYPES.TSInterfaceDeclaration); expect(scopeManager.getDeclaredVariables(node)).toMatchInlineSnapshot(` - Array [ + [ Variable$2 { - defs: Array [ + defs: [ TypeDefinition$1 { name: Identifier<"InterfaceDecl">, node: TSInterfaceDeclaration$1, }, ], name: "InterfaceDecl", - references: Array [], + references: [], isValueVariable: false, isTypeVariable: true, }, @@ -56,16 +57,16 @@ describe('variable definition', () => { `); const node = getSpecificNode(ast, AST_NODE_TYPES.TSTypeParameter); expect(scopeManager.getDeclaredVariables(node)).toMatchInlineSnapshot(` - Array [ + [ Variable$3 { - defs: Array [ + defs: [ TypeDefinition$2 { name: Identifier<"TypeParam">, node: TSTypeParameter$1, }, ], name: "TypeParam", - references: Array [], + references: [], isValueVariable: false, isTypeVariable: true, }, @@ -83,16 +84,16 @@ describe('variable definition', () => { n => n.typeParameter, ); expect(scopeManager.getDeclaredVariables(node)).toMatchInlineSnapshot(` - Array [ + [ Variable$4 { - defs: Array [ + defs: [ TypeDefinition$3 { name: Identifier<"Inferred">, node: TSTypeParameter$1, }, ], name: "Inferred", - references: Array [ + references: [ Reference$3 { identifier: Identifier<"Inferred">, isRead: true, diff --git a/packages/scope-manager/tests/util/expect.ts b/packages/scope-manager/tests/util/expect.ts index 5609a923598..310a93ac7a3 100644 --- a/packages/scope-manager/tests/util/expect.ts +++ b/packages/scope-manager/tests/util/expect.ts @@ -1,30 +1,32 @@ -import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/types'; -import { +import type { TSESTree } from '@typescript-eslint/types'; +import { AST_NODE_TYPES } from '@typescript-eslint/types'; + +import type { CatchClauseDefinition, ClassNameDefinition, Definition, - DefinitionType, FunctionNameDefinition, ImplicitGlobalVariableDefinition, ImportBindingDefinition, ParameterDefinition, VariableDefinition, } from '../../src/definition'; -import { +import { DefinitionType } from '../../src/definition'; +import type { BlockScope, CatchScope, - ClassScope, ClassFieldInitializerScope, + ClassScope, ForScope, FunctionExpressionNameScope, FunctionScope, GlobalScope, ModuleScope, Scope, - ScopeType, SwitchScope, WithScope, } from '../../src/scope'; +import { ScopeType } from '../../src/scope'; ////////////////// // EXPECT SCOPE // diff --git a/packages/scope-manager/tests/util/getSpecificNode.ts b/packages/scope-manager/tests/util/getSpecificNode.ts index 8f04f4a88b4..a6d35615612 100644 --- a/packages/scope-manager/tests/util/getSpecificNode.ts +++ b/packages/scope-manager/tests/util/getSpecificNode.ts @@ -1,4 +1,4 @@ -import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/types'; +import type { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/types'; import { simpleTraverse } from '@typescript-eslint/typescript-estree'; function getSpecificNode< diff --git a/packages/scope-manager/tests/util/misc.ts b/packages/scope-manager/tests/util/misc.ts index 8a7062a5bf4..9a6eb46246b 100644 --- a/packages/scope-manager/tests/util/misc.ts +++ b/packages/scope-manager/tests/util/misc.ts @@ -1,4 +1,5 @@ -import { ImplicitLibVariable, Variable } from '../../src'; +import type { Variable } from '../../src'; +import { ImplicitLibVariable } from '../../src'; function getRealVariables(variables: Variable[]): Variable[] { return variables.filter(v => !(v instanceof ImplicitLibVariable)); diff --git a/packages/scope-manager/tests/util/parse.ts b/packages/scope-manager/tests/util/parse.ts index 8391cd42593..70983bfdd90 100644 --- a/packages/scope-manager/tests/util/parse.ts +++ b/packages/scope-manager/tests/util/parse.ts @@ -1,4 +1,5 @@ import * as tseslint from '@typescript-eslint/typescript-estree'; + import { analyze, AnalyzeOptions } from '../../src/analyze'; type SourceType = AnalyzeOptions['sourceType']; diff --git a/packages/scope-manager/tests/util/serializers/DefinitionBase.ts b/packages/scope-manager/tests/util/serializers/DefinitionBase.ts index a65781553d1..7402ee1cc68 100644 --- a/packages/scope-manager/tests/util/serializers/DefinitionBase.ts +++ b/packages/scope-manager/tests/util/serializers/DefinitionBase.ts @@ -1,5 +1,5 @@ -import { createSerializer } from './baseSerializer'; import { DefinitionBase } from '../../../src/definition/DefinitionBase'; +import { createSerializer } from './baseSerializer'; // hacking around the fact that you can't use abstract classes generically // eslint-disable-next-line @typescript-eslint/no-explicit-any diff --git a/packages/scope-manager/tests/util/serializers/Reference.ts b/packages/scope-manager/tests/util/serializers/Reference.ts index 84b51dbe49a..715624b6031 100644 --- a/packages/scope-manager/tests/util/serializers/Reference.ts +++ b/packages/scope-manager/tests/util/serializers/Reference.ts @@ -1,5 +1,5 @@ -import { createSerializer } from './baseSerializer'; import { Reference } from '../../../src/referencer/Reference'; +import { createSerializer } from './baseSerializer'; const serializer = createSerializer(Reference, [ 'identifier', diff --git a/packages/scope-manager/tests/util/serializers/ScopeBase.ts b/packages/scope-manager/tests/util/serializers/ScopeBase.ts index fea57627e81..41bf00eefbf 100644 --- a/packages/scope-manager/tests/util/serializers/ScopeBase.ts +++ b/packages/scope-manager/tests/util/serializers/ScopeBase.ts @@ -1,5 +1,5 @@ -import { createSerializer } from './baseSerializer'; import { ScopeBase } from '../../../src/scope/ScopeBase'; +import { createSerializer } from './baseSerializer'; // hacking around the fact that you can't use abstract classes generically // eslint-disable-next-line @typescript-eslint/no-explicit-any diff --git a/packages/scope-manager/tests/util/serializers/ScopeManager.ts b/packages/scope-manager/tests/util/serializers/ScopeManager.ts index 4b10150f179..433693416cb 100644 --- a/packages/scope-manager/tests/util/serializers/ScopeManager.ts +++ b/packages/scope-manager/tests/util/serializers/ScopeManager.ts @@ -1,5 +1,5 @@ -import { createSerializer } from './baseSerializer'; import { ScopeManager } from '../../../src/ScopeManager'; +import { createSerializer } from './baseSerializer'; const serializer = createSerializer(ScopeManager, [ // purposely put variables first diff --git a/packages/scope-manager/tests/util/serializers/TSESTreeNode.ts b/packages/scope-manager/tests/util/serializers/TSESTreeNode.ts index 806ad70a8b2..ace1e809da6 100644 --- a/packages/scope-manager/tests/util/serializers/TSESTreeNode.ts +++ b/packages/scope-manager/tests/util/serializers/TSESTreeNode.ts @@ -1,5 +1,7 @@ -import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/types'; -import { NewPlugin } from 'pretty-format'; +import type { TSESTree } from '@typescript-eslint/types'; +import { AST_NODE_TYPES } from '@typescript-eslint/types'; +import type { NewPlugin } from 'pretty-format'; + import { createIdGenerator } from '../../../src/ID'; const EXCLUDED_KEYS = new Set([ diff --git a/packages/scope-manager/tests/util/serializers/Variable.ts b/packages/scope-manager/tests/util/serializers/Variable.ts index 504bdc516ce..4469f649506 100644 --- a/packages/scope-manager/tests/util/serializers/Variable.ts +++ b/packages/scope-manager/tests/util/serializers/Variable.ts @@ -1,5 +1,5 @@ -import { createSerializer } from './baseSerializer'; import { ImplicitLibVariable, Variable } from '../../../src/variable'; +import { createSerializer } from './baseSerializer'; const serializer = createSerializer(Variable, [ // diff --git a/packages/scope-manager/tests/util/serializers/baseSerializer.ts b/packages/scope-manager/tests/util/serializers/baseSerializer.ts index a5d11b2a9f3..4a2932341b3 100644 --- a/packages/scope-manager/tests/util/serializers/baseSerializer.ts +++ b/packages/scope-manager/tests/util/serializers/baseSerializer.ts @@ -1,4 +1,4 @@ -import { NewPlugin } from 'pretty-format'; +import type { NewPlugin } from 'pretty-format'; type ConstructorSignature = new (...args: never) => unknown; diff --git a/packages/scope-manager/tests/util/serializers/index.ts b/packages/scope-manager/tests/util/serializers/index.ts index d4bbed92941..b59683d3359 100644 --- a/packages/scope-manager/tests/util/serializers/index.ts +++ b/packages/scope-manager/tests/util/serializers/index.ts @@ -1,11 +1,12 @@ import { addSerializer } from 'jest-specific-snapshot'; + +import { resetIds } from '../../../src/ID'; import * as DefinitionBase from './DefinitionBase'; import * as Reference from './Reference'; import * as ScopeBase from './ScopeBase'; import * as ScopeManager from './ScopeManager'; import * as TSESTreeNode from './TSESTreeNode'; import * as Variable from './Variable'; -import { resetIds } from '../../../src/ID'; const serializers = [ DefinitionBase.serializer, diff --git a/packages/scope-manager/tools/generate-lib.ts b/packages/scope-manager/tools/generate-lib.ts index 8d2395e375b..ffd630136f0 100644 --- a/packages/scope-manager/tools/generate-lib.ts +++ b/packages/scope-manager/tools/generate-lib.ts @@ -1,10 +1,12 @@ -import { TSESTree, AST_TOKEN_TYPES } from '@typescript-eslint/types'; +import type { TSESTree } from '@typescript-eslint/types'; +import { AST_TOKEN_TYPES } from '@typescript-eslint/types'; import * as fs from 'fs'; import * as path from 'path'; import { format, resolveConfig } from 'prettier'; import rimraf from 'rimraf'; import * as ts from 'typescript'; -import { ScopeManager, Variable } from '../src'; + +import type { ScopeManager, Variable } from '../src'; import { parseAndAnalyze } from '../tests/util/parse'; const libMap = new Map(ts.libMap); diff --git a/packages/shared-fixtures/CHANGELOG.md b/packages/shared-fixtures/CHANGELOG.md index 9eb4fbd3075..3548d5254c6 100644 --- a/packages/shared-fixtures/CHANGELOG.md +++ b/packages/shared-fixtures/CHANGELOG.md @@ -3,7 +3,7 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. -# [5.31.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.7...v5.31.0) (2022-07-25) +# [5.50.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.49.0...v5.50.0) (2023-01-31) **Note:** Version bump only for package @typescript-eslint/shared-fixtures @@ -11,7 +11,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline -## [5.30.7](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.6...v5.30.7) (2022-07-18) +# [5.49.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.48.2...v5.49.0) (2023-01-23) **Note:** Version bump only for package @typescript-eslint/shared-fixtures @@ -19,7 +19,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline -## [5.30.6](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.5...v5.30.6) (2022-07-11) +## [5.48.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.48.1...v5.48.2) (2023-01-16) **Note:** Version bump only for package @typescript-eslint/shared-fixtures @@ -27,7 +27,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline -## [5.30.5](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.4...v5.30.5) (2022-07-04) +## [5.48.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.48.0...v5.48.1) (2023-01-09) **Note:** Version bump only for package @typescript-eslint/shared-fixtures @@ -35,1569 +35,944 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline -## [5.30.4](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.3...v5.30.4) (2022-07-03) +# [5.48.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.47.1...v5.48.0) (2023-01-02) **Note:** Version bump only for package @typescript-eslint/shared-fixtures - - - - -## [5.30.3](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.2...v5.30.3) (2022-07-01) +## [5.47.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.47.0...v5.47.1) (2022-12-26) **Note:** Version bump only for package @typescript-eslint/shared-fixtures +# [5.47.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.46.1...v5.47.0) (2022-12-19) +**Note:** Version bump only for package @typescript-eslint/shared-fixtures +## [5.46.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.46.0...v5.46.1) (2022-12-12) +**Note:** Version bump only for package @typescript-eslint/shared-fixtures -## [5.30.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.1...v5.30.2) (2022-07-01) +# [5.46.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.45.1...v5.46.0) (2022-12-08) **Note:** Version bump only for package @typescript-eslint/shared-fixtures +## [5.45.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.45.0...v5.45.1) (2022-12-05) +**Note:** Version bump only for package @typescript-eslint/shared-fixtures +# [5.45.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.44.0...v5.45.0) (2022-11-28) +**Note:** Version bump only for package @typescript-eslint/shared-fixtures -## 5.30.1 (2022-07-01) +# [5.44.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.43.0...v5.44.0) (2022-11-21) **Note:** Version bump only for package @typescript-eslint/shared-fixtures +# [5.43.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.42.1...v5.43.0) (2022-11-14) +**Note:** Version bump only for package @typescript-eslint/shared-fixtures +## [5.42.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.42.0...v5.42.1) (2022-11-07) +**Note:** Version bump only for package @typescript-eslint/shared-fixtures -# [5.30.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.29.0...v5.30.0) (2022-06-27) +# [5.42.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.41.0...v5.42.0) (2022-10-31) +**Note:** Version bump only for package @typescript-eslint/shared-fixtures -### Features +# [5.41.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.40.1...v5.41.0) (2022-10-24) -* treat `this` in `typeof this` as a `ThisExpression` ([#4382](https://github.com/typescript-eslint/typescript-eslint/issues/4382)) ([b04b2ce](https://github.com/typescript-eslint/typescript-eslint/commit/b04b2ce1ba90d94718891f2562dd210a6d7b8609)) +**Note:** Version bump only for package @typescript-eslint/shared-fixtures +## [5.40.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.40.0...v5.40.1) (2022-10-17) +**Note:** Version bump only for package @typescript-eslint/shared-fixtures +# [5.40.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.39.0...v5.40.0) (2022-10-10) +**Note:** Version bump only for package @typescript-eslint/shared-fixtures -# [5.29.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.28.0...v5.29.0) (2022-06-20) +# [5.39.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.38.1...v5.39.0) (2022-10-03) **Note:** Version bump only for package @typescript-eslint/shared-fixtures +## [5.38.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.38.0...v5.38.1) (2022-09-26) +**Note:** Version bump only for package @typescript-eslint/shared-fixtures +# [5.38.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.37.0...v5.38.0) (2022-09-19) +**Note:** Version bump only for package @typescript-eslint/shared-fixtures -# [5.28.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.27.1...v5.28.0) (2022-06-13) +# [5.37.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.36.2...v5.37.0) (2022-09-12) **Note:** Version bump only for package @typescript-eslint/shared-fixtures +## [5.36.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.36.1...v5.36.2) (2022-09-05) +### Bug Fixes +- **typescript-estree:** don't double add decorators to a parameter property's parameter ([#5582](https://github.com/typescript-eslint/typescript-eslint/issues/5582)) ([863694c](https://github.com/typescript-eslint/typescript-eslint/commit/863694cbc71b5158ca6a018de8707c9f9fbc22c3)) - -## [5.27.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.27.0...v5.27.1) (2022-06-06) +## [5.36.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.36.0...v5.36.1) (2022-08-30) **Note:** Version bump only for package @typescript-eslint/shared-fixtures +# [5.36.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.35.1...v5.36.0) (2022-08-30) +**Note:** Version bump only for package @typescript-eslint/shared-fixtures +## [5.35.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.35.0...v5.35.1) (2022-08-24) +**Note:** Version bump only for package @typescript-eslint/shared-fixtures -# [5.27.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.26.0...v5.27.0) (2022-05-30) +# [5.35.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.34.0...v5.35.0) (2022-08-24) +**Note:** Version bump only for package @typescript-eslint/shared-fixtures -### Features +# [5.34.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.33.1...v5.34.0) (2022-08-22) -* [TS4.7] support type parameters for `typeof` ([#5067](https://github.com/typescript-eslint/typescript-eslint/issues/5067)) ([836de79](https://github.com/typescript-eslint/typescript-eslint/commit/836de79e8d1bff43149168cc913a4c2b60e79bf6)) +**Note:** Version bump only for package @typescript-eslint/shared-fixtures +## [5.33.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.33.0...v5.33.1) (2022-08-15) +**Note:** Version bump only for package @typescript-eslint/shared-fixtures +# [5.33.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.32.0...v5.33.0) (2022-08-08) +**Note:** Version bump only for package @typescript-eslint/shared-fixtures -# [5.26.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.25.0...v5.26.0) (2022-05-23) +# [5.32.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.31.0...v5.32.0) (2022-08-01) +**Note:** Version bump only for package @typescript-eslint/shared-fixtures -### Features +# [5.31.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.7...v5.31.0) (2022-07-25) -* [4.7] support instantiation expressions ([#4938](https://github.com/typescript-eslint/typescript-eslint/issues/4938)) ([79fbc77](https://github.com/typescript-eslint/typescript-eslint/commit/79fbc7743ae5dce3190f8168776e0204755390ad)) -* [4.7] support optional variance annotation ([#4831](https://github.com/typescript-eslint/typescript-eslint/issues/4831)) ([7e7b24c](https://github.com/typescript-eslint/typescript-eslint/commit/7e7b24c196e6d968e48f97f46feae5e7027e22d2)) -* **typescript-estree:** `extends` constraints for `infer` ([#4830](https://github.com/typescript-eslint/typescript-eslint/issues/4830)) ([8cbbcc3](https://github.com/typescript-eslint/typescript-eslint/commit/8cbbcc3d317779e0dcba15d3835137f38383de34)) +**Note:** Version bump only for package @typescript-eslint/shared-fixtures +## [5.30.7](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.6...v5.30.7) (2022-07-18) +**Note:** Version bump only for package @typescript-eslint/shared-fixtures +## [5.30.6](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.5...v5.30.6) (2022-07-11) +**Note:** Version bump only for package @typescript-eslint/shared-fixtures -# [5.25.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.24.0...v5.25.0) (2022-05-17) +## [5.30.5](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.4...v5.30.5) (2022-07-04) **Note:** Version bump only for package @typescript-eslint/shared-fixtures +## [5.30.4](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.3...v5.30.4) (2022-07-03) +**Note:** Version bump only for package @typescript-eslint/shared-fixtures +## [5.30.3](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.2...v5.30.3) (2022-07-01) +**Note:** Version bump only for package @typescript-eslint/shared-fixtures -# [5.24.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.23.0...v5.24.0) (2022-05-16) +## [5.30.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.1...v5.30.2) (2022-07-01) **Note:** Version bump only for package @typescript-eslint/shared-fixtures +## 5.30.1 (2022-07-01) + +**Note:** Version bump only for package @typescript-eslint/shared-fixtures +# [5.30.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.29.0...v5.30.0) (2022-06-27) +### Features +- treat `this` in `typeof this` as a `ThisExpression` ([#4382](https://github.com/typescript-eslint/typescript-eslint/issues/4382)) ([b04b2ce](https://github.com/typescript-eslint/typescript-eslint/commit/b04b2ce1ba90d94718891f2562dd210a6d7b8609)) -# [5.23.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.22.0...v5.23.0) (2022-05-09) +# [5.29.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.28.0...v5.29.0) (2022-06-20) **Note:** Version bump only for package @typescript-eslint/shared-fixtures +# [5.28.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.27.1...v5.28.0) (2022-06-13) +**Note:** Version bump only for package @typescript-eslint/shared-fixtures +## [5.27.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.27.0...v5.27.1) (2022-06-06) +**Note:** Version bump only for package @typescript-eslint/shared-fixtures -# [5.22.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.21.0...v5.22.0) (2022-05-02) +# [5.27.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.26.0...v5.27.0) (2022-05-30) -**Note:** Version bump only for package @typescript-eslint/shared-fixtures +### Features +- [TS4.7] support type parameters for `typeof` ([#5067](https://github.com/typescript-eslint/typescript-eslint/issues/5067)) ([836de79](https://github.com/typescript-eslint/typescript-eslint/commit/836de79e8d1bff43149168cc913a4c2b60e79bf6)) +# [5.26.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.25.0...v5.26.0) (2022-05-23) +### Features +- [4.7] support instantiation expressions ([#4938](https://github.com/typescript-eslint/typescript-eslint/issues/4938)) ([79fbc77](https://github.com/typescript-eslint/typescript-eslint/commit/79fbc7743ae5dce3190f8168776e0204755390ad)) +- [4.7] support optional variance annotation ([#4831](https://github.com/typescript-eslint/typescript-eslint/issues/4831)) ([7e7b24c](https://github.com/typescript-eslint/typescript-eslint/commit/7e7b24c196e6d968e48f97f46feae5e7027e22d2)) +- **typescript-estree:** `extends` constraints for `infer` ([#4830](https://github.com/typescript-eslint/typescript-eslint/issues/4830)) ([8cbbcc3](https://github.com/typescript-eslint/typescript-eslint/commit/8cbbcc3d317779e0dcba15d3835137f38383de34)) -# [5.21.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.20.0...v5.21.0) (2022-04-25) +# [5.25.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.24.0...v5.25.0) (2022-05-17) **Note:** Version bump only for package @typescript-eslint/shared-fixtures +# [5.24.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.23.0...v5.24.0) (2022-05-16) +**Note:** Version bump only for package @typescript-eslint/shared-fixtures +# [5.23.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.22.0...v5.23.0) (2022-05-09) +**Note:** Version bump only for package @typescript-eslint/shared-fixtures -# [5.20.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.19.0...v5.20.0) (2022-04-18) +# [5.22.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.21.0...v5.22.0) (2022-05-02) **Note:** Version bump only for package @typescript-eslint/shared-fixtures +# [5.21.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.20.0...v5.21.0) (2022-04-25) +**Note:** Version bump only for package @typescript-eslint/shared-fixtures +# [5.20.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.19.0...v5.20.0) (2022-04-18) +**Note:** Version bump only for package @typescript-eslint/shared-fixtures # [5.19.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.18.0...v5.19.0) (2022-04-11) **Note:** Version bump only for package @typescript-eslint/shared-fixtures - - - - # [5.18.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.17.0...v5.18.0) (2022-04-04) **Note:** Version bump only for package @typescript-eslint/shared-fixtures - - - - # [5.17.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.16.0...v5.17.0) (2022-03-28) **Note:** Version bump only for package @typescript-eslint/shared-fixtures - - - - # [5.16.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.15.0...v5.16.0) (2022-03-21) **Note:** Version bump only for package @typescript-eslint/shared-fixtures - - - - # [5.15.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.14.0...v5.15.0) (2022-03-14) **Note:** Version bump only for package @typescript-eslint/shared-fixtures +# [5.14.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.13.0...v5.14.0) (2022-03-07) +**Note:** Version bump only for package @typescript-eslint/shared-fixtures +# [5.13.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.12.1...v5.13.0) (2022-02-28) +**Note:** Version bump only for package @typescript-eslint/shared-fixtures -# [5.14.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.13.0...v5.14.0) (2022-03-07) +## [5.12.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.12.0...v5.12.1) (2022-02-21) **Note:** Version bump only for package @typescript-eslint/shared-fixtures +# [5.12.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.11.0...v5.12.0) (2022-02-14) +**Note:** Version bump only for package @typescript-eslint/shared-fixtures +# [5.11.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.10.2...v5.11.0) (2022-02-07) +**Note:** Version bump only for package @typescript-eslint/shared-fixtures -# [5.13.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.12.1...v5.13.0) (2022-02-28) +## [5.10.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.10.1...v5.10.2) (2022-01-31) **Note:** Version bump only for package @typescript-eslint/shared-fixtures +## [5.10.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.10.0...v5.10.1) (2022-01-24) +**Note:** Version bump only for package @typescript-eslint/shared-fixtures +# [5.10.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.9.1...v5.10.0) (2022-01-17) +**Note:** Version bump only for package @typescript-eslint/shared-fixtures -## [5.12.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.12.0...v5.12.1) (2022-02-21) +## [5.9.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.9.0...v5.9.1) (2022-01-10) **Note:** Version bump only for package @typescript-eslint/shared-fixtures +# [5.9.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.8.1...v5.9.0) (2022-01-03) +**Note:** Version bump only for package @typescript-eslint/shared-fixtures +## [5.8.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.8.0...v5.8.1) (2021-12-27) +**Note:** Version bump only for package @typescript-eslint/shared-fixtures -# [5.12.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.11.0...v5.12.0) (2022-02-14) +# [5.8.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.7.0...v5.8.0) (2021-12-20) **Note:** Version bump only for package @typescript-eslint/shared-fixtures +# [5.7.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.6.0...v5.7.0) (2021-12-13) +**Note:** Version bump only for package @typescript-eslint/shared-fixtures +# [5.6.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.5.0...v5.6.0) (2021-12-06) +**Note:** Version bump only for package @typescript-eslint/shared-fixtures -# [5.11.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.10.2...v5.11.0) (2022-02-07) +# [5.5.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.4.0...v5.5.0) (2021-11-29) **Note:** Version bump only for package @typescript-eslint/shared-fixtures +# [5.4.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.3.1...v5.4.0) (2021-11-15) +### Features +- **typescript-estree:** support Import Assertions ([#4074](https://github.com/typescript-eslint/typescript-eslint/issues/4074)) ([ae0fb5a](https://github.com/typescript-eslint/typescript-eslint/commit/ae0fb5a591958216b7df656e66b1dfe464898167)) +- **typescript-estree:** support private fields in-in syntax ([#4075](https://github.com/typescript-eslint/typescript-eslint/issues/4075)) ([939d8ea](https://github.com/typescript-eslint/typescript-eslint/commit/939d8eac547fb1734aa00f1ea01cc6eae0b4280a)) +- **typescript-estree:** support type-only module specifiers ([#4076](https://github.com/typescript-eslint/typescript-eslint/issues/4076)) ([77baa92](https://github.com/typescript-eslint/typescript-eslint/commit/77baa9203638e888a76e21003a278a8da386e133)) - -## [5.10.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.10.1...v5.10.2) (2022-01-31) +## [5.3.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.3.0...v5.3.1) (2021-11-08) **Note:** Version bump only for package @typescript-eslint/shared-fixtures +# [5.3.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.2.0...v5.3.0) (2021-11-01) +**Note:** Version bump only for package @typescript-eslint/shared-fixtures - - -## [5.10.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.10.0...v5.10.1) (2022-01-24) +# [5.2.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.1.0...v5.2.0) (2021-10-25) **Note:** Version bump only for package @typescript-eslint/shared-fixtures +# [5.1.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.0.0...v5.1.0) (2021-10-18) +### Bug Fixes +- **typescript-estree:** support private optional property definition ([#3997](https://github.com/typescript-eslint/typescript-eslint/issues/3997)) ([8605e08](https://github.com/typescript-eslint/typescript-eslint/commit/8605e080a4dac4a277e6108cd9ed1e5a707302fa)) +# [5.0.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.33.0...v5.0.0) (2021-10-11) -# [5.10.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.9.1...v5.10.0) (2022-01-17) +### Bug Fixes -**Note:** Version bump only for package @typescript-eslint/shared-fixtures +- **typescript-estree:** change `source` of ExportNamedDeclaration to Literal from Expression ([#3763](https://github.com/typescript-eslint/typescript-eslint/issues/3763)) ([dc5a0f5](https://github.com/typescript-eslint/typescript-eslint/commit/dc5a0f5104b400f4422b8d67ecfc6cc7a32613a2)) +### Features +- support `PrivateIdentifier` ([#3808](https://github.com/typescript-eslint/typescript-eslint/issues/3808)) ([0eefe5e](https://github.com/typescript-eslint/typescript-eslint/commit/0eefe5e49d21af3f1e3e2d9a90c2e49929863ac2)), closes [#3430](https://github.com/typescript-eslint/typescript-eslint/issues/3430) [#2933](https://github.com/typescript-eslint/typescript-eslint/issues/2933) +- **eslint-plugin:** removed value from abstract property nodes ([#3765](https://github.com/typescript-eslint/typescript-eslint/issues/3765)) ([5823524](https://github.com/typescript-eslint/typescript-eslint/commit/58235241714596b641a1e8b39c569e561e0039b4)), closes [#3748](https://github.com/typescript-eslint/typescript-eslint/issues/3748) +# [4.33.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.32.0...v4.33.0) (2021-10-04) +**Note:** Version bump only for package @typescript-eslint/shared-fixtures -## [5.9.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.9.0...v5.9.1) (2022-01-10) +# [4.32.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.31.2...v4.32.0) (2021-09-27) **Note:** Version bump only for package @typescript-eslint/shared-fixtures +## [4.31.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.31.1...v4.31.2) (2021-09-20) +**Note:** Version bump only for package @typescript-eslint/shared-fixtures +## [4.31.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.31.0...v4.31.1) (2021-09-13) +**Note:** Version bump only for package @typescript-eslint/shared-fixtures -# [5.9.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.8.1...v5.9.0) (2022-01-03) +# [4.31.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.30.0...v4.31.0) (2021-09-06) **Note:** Version bump only for package @typescript-eslint/shared-fixtures +# [4.30.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.29.3...v4.30.0) (2021-08-30) +### Features +- **typescript-estree:** add support for class static blocks ([#3730](https://github.com/typescript-eslint/typescript-eslint/issues/3730)) ([f81831b](https://github.com/typescript-eslint/typescript-eslint/commit/f81831bd279a32da6dbab0f1c061053ea43965f6)) - -## [5.8.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.8.0...v5.8.1) (2021-12-27) +## [4.29.3](https://github.com/typescript-eslint/typescript-eslint/compare/v4.29.2...v4.29.3) (2021-08-23) **Note:** Version bump only for package @typescript-eslint/shared-fixtures +## [4.29.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.29.1...v4.29.2) (2021-08-16) +**Note:** Version bump only for package @typescript-eslint/shared-fixtures +## [4.29.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.29.0...v4.29.1) (2021-08-09) +**Note:** Version bump only for package @typescript-eslint/shared-fixtures -# [5.8.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.7.0...v5.8.0) (2021-12-20) +# [4.29.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.5...v4.29.0) (2021-08-02) **Note:** Version bump only for package @typescript-eslint/shared-fixtures +## [4.28.5](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.4...v4.28.5) (2021-07-26) +**Note:** Version bump only for package @typescript-eslint/shared-fixtures +## [4.28.4](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.3...v4.28.4) (2021-07-19) +**Note:** Version bump only for package @typescript-eslint/shared-fixtures -# [5.7.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.6.0...v5.7.0) (2021-12-13) +## [4.28.3](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.2...v4.28.3) (2021-07-12) **Note:** Version bump only for package @typescript-eslint/shared-fixtures +## [4.28.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.1...v4.28.2) (2021-07-05) +**Note:** Version bump only for package @typescript-eslint/shared-fixtures +## [4.28.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.0...v4.28.1) (2021-06-28) +**Note:** Version bump only for package @typescript-eslint/shared-fixtures -# [5.6.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.5.0...v5.6.0) (2021-12-06) +# [4.28.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.27.0...v4.28.0) (2021-06-21) **Note:** Version bump only for package @typescript-eslint/shared-fixtures +# [4.27.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.26.1...v4.27.0) (2021-06-14) +### Bug Fixes +- **typescript-estree:** support override modifier for parameter property ([#3485](https://github.com/typescript-eslint/typescript-eslint/issues/3485)) ([33b9f69](https://github.com/typescript-eslint/typescript-eslint/commit/33b9f69a681cd3219a2acca5b0b2fa67609f099e)) - -# [5.5.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.4.0...v5.5.0) (2021-11-29) +## [4.26.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.26.0...v4.26.1) (2021-06-07) **Note:** Version bump only for package @typescript-eslint/shared-fixtures +# [4.26.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.25.0...v4.26.0) (2021-05-31) +**Note:** Version bump only for package @typescript-eslint/shared-fixtures - - -# [5.4.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.3.1...v5.4.0) (2021-11-15) - +# [4.25.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.24.0...v4.25.0) (2021-05-24) ### Features -* **typescript-estree:** support Import Assertions ([#4074](https://github.com/typescript-eslint/typescript-eslint/issues/4074)) ([ae0fb5a](https://github.com/typescript-eslint/typescript-eslint/commit/ae0fb5a591958216b7df656e66b1dfe464898167)) -* **typescript-estree:** support private fields in-in syntax ([#4075](https://github.com/typescript-eslint/typescript-eslint/issues/4075)) ([939d8ea](https://github.com/typescript-eslint/typescript-eslint/commit/939d8eac547fb1734aa00f1ea01cc6eae0b4280a)) -* **typescript-estree:** support type-only module specifiers ([#4076](https://github.com/typescript-eslint/typescript-eslint/issues/4076)) ([77baa92](https://github.com/typescript-eslint/typescript-eslint/commit/77baa9203638e888a76e21003a278a8da386e133)) +- **typescript-estree:** [TS4.3] support overrides on class members ([#3429](https://github.com/typescript-eslint/typescript-eslint/issues/3429)) ([21d1b62](https://github.com/typescript-eslint/typescript-eslint/commit/21d1b62a0b84b502d2cf12674b3d141994a3ffd4)) +- **typescript-estree:** add support for getter/setter signatures on types ([#3427](https://github.com/typescript-eslint/typescript-eslint/issues/3427)) ([b830b7f](https://github.com/typescript-eslint/typescript-eslint/commit/b830b7f4e8a99affc8af8b53cb83371ef81d7032)), closes [#3272](https://github.com/typescript-eslint/typescript-eslint/issues/3272) [#3272](https://github.com/typescript-eslint/typescript-eslint/issues/3272) +# [4.24.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.23.0...v4.24.0) (2021-05-17) +**Note:** Version bump only for package @typescript-eslint/shared-fixtures +# [4.23.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.22.1...v4.23.0) (2021-05-10) +**Note:** Version bump only for package @typescript-eslint/shared-fixtures -## [5.3.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.3.0...v5.3.1) (2021-11-08) +## [4.22.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.22.0...v4.22.1) (2021-05-04) **Note:** Version bump only for package @typescript-eslint/shared-fixtures +# [4.22.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.21.0...v4.22.0) (2021-04-12) +**Note:** Version bump only for package @typescript-eslint/shared-fixtures +# [4.21.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.20.0...v4.21.0) (2021-04-05) +**Note:** Version bump only for package @typescript-eslint/shared-fixtures -# [5.3.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.2.0...v5.3.0) (2021-11-01) +# [4.20.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.19.0...v4.20.0) (2021-03-29) **Note:** Version bump only for package @typescript-eslint/shared-fixtures +# [4.19.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.18.0...v4.19.0) (2021-03-22) + +### Bug Fixes +- **typescript-estree:** [ts 4.2] add support for import type equal declaration ([#3189](https://github.com/typescript-eslint/typescript-eslint/issues/3189)) ([6a25faf](https://github.com/typescript-eslint/typescript-eslint/commit/6a25faf5cfa4d21a7546d9866819f4e017308fb2)) +# [4.18.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.17.0...v4.18.0) (2021-03-15) +**Note:** Version bump only for package @typescript-eslint/shared-fixtures -# [5.2.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.1.0...v5.2.0) (2021-10-25) +# [4.17.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.16.1...v4.17.0) (2021-03-08) **Note:** Version bump only for package @typescript-eslint/shared-fixtures +## [4.16.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.16.0...v4.16.1) (2021-03-01) +**Note:** Version bump only for package @typescript-eslint/shared-fixtures +# [4.16.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.15.2...v4.16.0) (2021-03-01) +### Features -# [5.1.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.0.0...v5.1.0) (2021-10-18) +- TypeScript 4.2 syntax support ([#3112](https://github.com/typescript-eslint/typescript-eslint/issues/3112)) ([2ebfb21](https://github.com/typescript-eslint/typescript-eslint/commit/2ebfb21ba6c88c793cfbd0e231e5803b2381694c)) +## [4.15.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.15.1...v4.15.2) (2021-02-22) ### Bug Fixes -* **typescript-estree:** support private optional property definition ([#3997](https://github.com/typescript-eslint/typescript-eslint/issues/3997)) ([8605e08](https://github.com/typescript-eslint/typescript-eslint/commit/8605e080a4dac4a277e6108cd9ed1e5a707302fa)) +- add missing intrinsic keyword node to AST ([#3081](https://github.com/typescript-eslint/typescript-eslint/issues/3081)) ([409bf0b](https://github.com/typescript-eslint/typescript-eslint/commit/409bf0bb3e2ac4d8782408d436ebdefb42dba38b)) +## [4.15.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.15.0...v4.15.1) (2021-02-15) +**Note:** Version bump only for package @typescript-eslint/shared-fixtures +# [4.15.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.14.2...v4.15.0) (2021-02-08) +### Features -# [5.0.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.33.0...v5.0.0) (2021-10-11) +- **typescript-estree:** improve logic used to escape string literals in jsx ([#2995](https://github.com/typescript-eslint/typescript-eslint/issues/2995)) ([3cb3aad](https://github.com/typescript-eslint/typescript-eslint/commit/3cb3aade2864bab15ed1ff8d7cd32766aa57152f)) +## [4.14.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.14.1...v4.14.2) (2021-02-01) -### Bug Fixes +**Note:** Version bump only for package @typescript-eslint/shared-fixtures -* **typescript-estree:** change `source` of ExportNamedDeclaration to Literal from Expression ([#3763](https://github.com/typescript-eslint/typescript-eslint/issues/3763)) ([dc5a0f5](https://github.com/typescript-eslint/typescript-eslint/commit/dc5a0f5104b400f4422b8d67ecfc6cc7a32613a2)) +## [4.14.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.14.0...v4.14.1) (2021-01-25) +**Note:** Version bump only for package @typescript-eslint/shared-fixtures -### Features +# [4.14.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.13.0...v4.14.0) (2021-01-18) -* support `PrivateIdentifier` ([#3808](https://github.com/typescript-eslint/typescript-eslint/issues/3808)) ([0eefe5e](https://github.com/typescript-eslint/typescript-eslint/commit/0eefe5e49d21af3f1e3e2d9a90c2e49929863ac2)), closes [#3430](https://github.com/typescript-eslint/typescript-eslint/issues/3430) [#2933](https://github.com/typescript-eslint/typescript-eslint/issues/2933) -* **eslint-plugin:** removed value from abstract property nodes ([#3765](https://github.com/typescript-eslint/typescript-eslint/issues/3765)) ([5823524](https://github.com/typescript-eslint/typescript-eslint/commit/58235241714596b641a1e8b39c569e561e0039b4)), closes [#3748](https://github.com/typescript-eslint/typescript-eslint/issues/3748) +**Note:** Version bump only for package @typescript-eslint/shared-fixtures +# [4.13.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.12.0...v4.13.0) (2021-01-11) +**Note:** Version bump only for package @typescript-eslint/shared-fixtures +# [4.12.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.11.1...v4.12.0) (2021-01-04) +**Note:** Version bump only for package @typescript-eslint/shared-fixtures -# [4.33.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.32.0...v4.33.0) (2021-10-04) +## [4.11.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.11.0...v4.11.1) (2020-12-28) **Note:** Version bump only for package @typescript-eslint/shared-fixtures +# [4.11.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.10.0...v4.11.0) (2020-12-21) +**Note:** Version bump only for package @typescript-eslint/shared-fixtures +# [4.10.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.9.1...v4.10.0) (2020-12-14) +**Note:** Version bump only for package @typescript-eslint/shared-fixtures -# [4.32.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.31.2...v4.32.0) (2021-09-27) +## [4.9.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.9.0...v4.9.1) (2020-12-07) **Note:** Version bump only for package @typescript-eslint/shared-fixtures +# [4.9.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.8.2...v4.9.0) (2020-11-30) +**Note:** Version bump only for package @typescript-eslint/shared-fixtures +## [4.8.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.8.1...v4.8.2) (2020-11-23) +**Note:** Version bump only for package @typescript-eslint/shared-fixtures -## [4.31.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.31.1...v4.31.2) (2021-09-20) +## [4.8.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.8.0...v4.8.1) (2020-11-17) **Note:** Version bump only for package @typescript-eslint/shared-fixtures +# [4.8.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.7.0...v4.8.0) (2020-11-16) +**Note:** Version bump only for package @typescript-eslint/shared-fixtures +# [4.7.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.6.1...v4.7.0) (2020-11-09) +### Features -## [4.31.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.31.0...v4.31.1) (2021-09-13) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - - - - - -# [4.31.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.30.0...v4.31.0) (2021-09-06) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - - - - - -# [4.30.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.29.3...v4.30.0) (2021-08-30) - - -### Features - -* **typescript-estree:** add support for class static blocks ([#3730](https://github.com/typescript-eslint/typescript-eslint/issues/3730)) ([f81831b](https://github.com/typescript-eslint/typescript-eslint/commit/f81831bd279a32da6dbab0f1c061053ea43965f6)) - - - - - -## [4.29.3](https://github.com/typescript-eslint/typescript-eslint/compare/v4.29.2...v4.29.3) (2021-08-23) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - - - - - -## [4.29.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.29.1...v4.29.2) (2021-08-16) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - - - - - -## [4.29.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.29.0...v4.29.1) (2021-08-09) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - - - - - -# [4.29.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.5...v4.29.0) (2021-08-02) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - - - - - -## [4.28.5](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.4...v4.28.5) (2021-07-26) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - - - - - -## [4.28.4](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.3...v4.28.4) (2021-07-19) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - - - - - -## [4.28.3](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.2...v4.28.3) (2021-07-12) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - - - - - -## [4.28.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.1...v4.28.2) (2021-07-05) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - - - - - -## [4.28.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.0...v4.28.1) (2021-06-28) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - - - - - -# [4.28.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.27.0...v4.28.0) (2021-06-21) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - - - - - -# [4.27.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.26.1...v4.27.0) (2021-06-14) - - -### Bug Fixes - -* **typescript-estree:** support override modifier for parameter property ([#3485](https://github.com/typescript-eslint/typescript-eslint/issues/3485)) ([33b9f69](https://github.com/typescript-eslint/typescript-eslint/commit/33b9f69a681cd3219a2acca5b0b2fa67609f099e)) - - - - - -## [4.26.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.26.0...v4.26.1) (2021-06-07) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - - - - - -# [4.26.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.25.0...v4.26.0) (2021-05-31) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - - - - - -# [4.25.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.24.0...v4.25.0) (2021-05-24) - - -### Features - -* **typescript-estree:** [TS4.3] support overrides on class members ([#3429](https://github.com/typescript-eslint/typescript-eslint/issues/3429)) ([21d1b62](https://github.com/typescript-eslint/typescript-eslint/commit/21d1b62a0b84b502d2cf12674b3d141994a3ffd4)) -* **typescript-estree:** add support for getter/setter signatures on types ([#3427](https://github.com/typescript-eslint/typescript-eslint/issues/3427)) ([b830b7f](https://github.com/typescript-eslint/typescript-eslint/commit/b830b7f4e8a99affc8af8b53cb83371ef81d7032)), closes [#3272](https://github.com/typescript-eslint/typescript-eslint/issues/3272) [#3272](https://github.com/typescript-eslint/typescript-eslint/issues/3272) - - - - - -# [4.24.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.23.0...v4.24.0) (2021-05-17) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - - - - - -# [4.23.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.22.1...v4.23.0) (2021-05-10) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - - - - - -## [4.22.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.22.0...v4.22.1) (2021-05-04) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - - - - - -# [4.22.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.21.0...v4.22.0) (2021-04-12) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - - - - - -# [4.21.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.20.0...v4.21.0) (2021-04-05) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - - - - - -# [4.20.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.19.0...v4.20.0) (2021-03-29) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - - - - - -# [4.19.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.18.0...v4.19.0) (2021-03-22) - - -### Bug Fixes - -* **typescript-estree:** [ts 4.2] add support for import type equal declaration ([#3189](https://github.com/typescript-eslint/typescript-eslint/issues/3189)) ([6a25faf](https://github.com/typescript-eslint/typescript-eslint/commit/6a25faf5cfa4d21a7546d9866819f4e017308fb2)) - - - - - -# [4.18.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.17.0...v4.18.0) (2021-03-15) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - - - - - -# [4.17.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.16.1...v4.17.0) (2021-03-08) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - - - - - -## [4.16.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.16.0...v4.16.1) (2021-03-01) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - - - - - -# [4.16.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.15.2...v4.16.0) (2021-03-01) - - -### Features - -* TypeScript 4.2 syntax support ([#3112](https://github.com/typescript-eslint/typescript-eslint/issues/3112)) ([2ebfb21](https://github.com/typescript-eslint/typescript-eslint/commit/2ebfb21ba6c88c793cfbd0e231e5803b2381694c)) - - - - - -## [4.15.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.15.1...v4.15.2) (2021-02-22) - - -### Bug Fixes - -* add missing intrinsic keyword node to AST ([#3081](https://github.com/typescript-eslint/typescript-eslint/issues/3081)) ([409bf0b](https://github.com/typescript-eslint/typescript-eslint/commit/409bf0bb3e2ac4d8782408d436ebdefb42dba38b)) - - - - - -## [4.15.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.15.0...v4.15.1) (2021-02-15) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - - - - - -# [4.15.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.14.2...v4.15.0) (2021-02-08) - - -### Features - -* **typescript-estree:** improve logic used to escape string literals in jsx ([#2995](https://github.com/typescript-eslint/typescript-eslint/issues/2995)) ([3cb3aad](https://github.com/typescript-eslint/typescript-eslint/commit/3cb3aade2864bab15ed1ff8d7cd32766aa57152f)) - - - - - -## [4.14.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.14.1...v4.14.2) (2021-02-01) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - - - - - -## [4.14.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.14.0...v4.14.1) (2021-01-25) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - - - - - -# [4.14.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.13.0...v4.14.0) (2021-01-18) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - - - - - -# [4.13.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.12.0...v4.13.0) (2021-01-11) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - - - - - -# [4.12.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.11.1...v4.12.0) (2021-01-04) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - - - - - -## [4.11.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.11.0...v4.11.1) (2020-12-28) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - - - - - -# [4.11.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.10.0...v4.11.0) (2020-12-21) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - - - - - -# [4.10.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.9.1...v4.10.0) (2020-12-14) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - - - - - -## [4.9.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.9.0...v4.9.1) (2020-12-07) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - - - - - -# [4.9.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.8.2...v4.9.0) (2020-11-30) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - - - - - -## [4.8.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.8.1...v4.8.2) (2020-11-23) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - - - - - -## [4.8.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.8.0...v4.8.1) (2020-11-17) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - - - - - -# [4.8.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.7.0...v4.8.0) (2020-11-16) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - - - - - -# [4.7.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.6.1...v4.7.0) (2020-11-09) - - -### Features - -* support TS4.1 features ([#2748](https://github.com/typescript-eslint/typescript-eslint/issues/2748)) ([2be354b](https://github.com/typescript-eslint/typescript-eslint/commit/2be354bb15f9013a2da1b13a0c0836e9ef057e16)), closes [#2583](https://github.com/typescript-eslint/typescript-eslint/issues/2583) - - - - - -## [4.6.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.6.0...v4.6.1) (2020-11-02) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - - - - - -# [4.6.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.5.0...v4.6.0) (2020-10-26) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - - - - - -# [4.5.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.4.1...v4.5.0) (2020-10-19) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - - - - - -## [4.4.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.4.0...v4.4.1) (2020-10-12) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - - - - - -# [4.4.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.3.0...v4.4.0) (2020-10-05) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - - - - - -# [4.3.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.2.0...v4.3.0) (2020-09-28) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - - - - - -# [4.2.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.1.1...v4.2.0) (2020-09-21) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - - - - - -## [4.1.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.1.0...v4.1.1) (2020-09-14) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - - - - - -# [4.1.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.0.1...v4.1.0) (2020-09-07) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - - - - - -## [4.0.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.0.0...v4.0.1) (2020-08-31) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - - - - - -# [4.0.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.10.1...v4.0.0) (2020-08-31) - -## [Please see the release notes for v4.0.0](https://github.com/typescript-eslint/typescript-eslint/releases/tag/v4.0.0) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - - - - - -## [3.10.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.10.0...v3.10.1) (2020-08-25) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - - - - - -# [3.10.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.9.1...v3.10.0) (2020-08-24) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - - - - - -## [3.9.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.9.0...v3.9.1) (2020-08-17) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - - - - - -# [3.9.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.8.0...v3.9.0) (2020-08-10) - - -### Features - -* **typescript-estree:** support TSv4 labelled tuple members ([#2378](https://github.com/typescript-eslint/typescript-eslint/issues/2378)) ([00d84ff](https://github.com/typescript-eslint/typescript-eslint/commit/00d84ffbcbe9d0ec98bdb2f2ce59959a27ce4dbe)) - - - - - -# [3.8.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.7.1...v3.8.0) (2020-08-03) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - - - - - -## [3.7.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.7.0...v3.7.1) (2020-07-27) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - - - - - -# [3.7.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.6.1...v3.7.0) (2020-07-20) - - -### Features - -* **typescript-estree:** support short-circuiting assignment operators ([#2307](https://github.com/typescript-eslint/typescript-eslint/issues/2307)) ([2c90d9f](https://github.com/typescript-eslint/typescript-eslint/commit/2c90d9fa3aa5ebd7db697dddb7762bca2dd0e06b)) -* **typescript-estree:** support type annotations on catch clauses ([#2306](https://github.com/typescript-eslint/typescript-eslint/issues/2306)) ([b5afe9c](https://github.com/typescript-eslint/typescript-eslint/commit/b5afe9c560b9f38c8dffc312a600db30944129c8)) - - - - - -## [3.6.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.6.0...v3.6.1) (2020-07-13) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - - - - - -# [3.6.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.5.0...v3.6.0) (2020-07-06) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - - - - - -# [3.5.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.4.0...v3.5.0) (2020-06-29) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - - - - - -# [3.4.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.3.0...v3.4.0) (2020-06-22) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - - - - - -# [3.3.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.2.0...v3.3.0) (2020-06-15) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - - - - - -# [3.2.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.1.0...v3.2.0) (2020-06-08) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - - - - - -# [3.1.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.0.2...v3.1.0) (2020-06-01) - - -### Bug Fixes - -* **experimental-utils:** downlevel type declarations for versions older than 3.8 ([#2133](https://github.com/typescript-eslint/typescript-eslint/issues/2133)) ([7925823](https://github.com/typescript-eslint/typescript-eslint/commit/792582326a8065270b69a0ffcaad5a7b4b103ff3)) - - - - - -## [3.0.2](https://github.com/typescript-eslint/typescript-eslint/compare/v3.0.1...v3.0.2) (2020-05-27) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - - - - - -## [3.0.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.0.0...v3.0.1) (2020-05-25) - - -### Bug Fixes - -* **typescript-estree:** handle `BigInt` with `_` numeric separator ([#2067](https://github.com/typescript-eslint/typescript-eslint/issues/2067)) ([66f1627](https://github.com/typescript-eslint/typescript-eslint/commit/66f1627b11a566d5b925a577e800f99d5c808be2)) - - - - - -# [3.0.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.34.0...v3.0.0) (2020-05-21) - -## [Please see the release notes for v3.0.0](https://github.com/typescript-eslint/typescript-eslint/releases/tag/v3.0.0) - -### Features - -* **typescript-estree:** align nodes with estree 2020 ([#1389](https://github.com/typescript-eslint/typescript-eslint/issues/1389)) ([aff5b62](https://github.com/typescript-eslint/typescript-eslint/commit/aff5b62044f9b93f2087a1d261e9be3f8d6fd54d)) -* **typescript-estree:** align optional fields ([#1429](https://github.com/typescript-eslint/typescript-eslint/issues/1429)) ([0e0010f](https://github.com/typescript-eslint/typescript-eslint/commit/0e0010f82952f9beeeb84136eea00cc5eecc9db6)) -* **typescript-estree:** handle 3.9's non-null assertion changes ([#2036](https://github.com/typescript-eslint/typescript-eslint/issues/2036)) ([06bec63](https://github.com/typescript-eslint/typescript-eslint/commit/06bec63c56536db070608ab136d2ad57083f0c6a)) - - - - - -# [2.34.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.33.0...v2.34.0) (2020-05-18) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - - - - - -# [2.33.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.32.0...v2.33.0) (2020-05-12) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - - - - - -# [2.32.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.31.0...v2.32.0) (2020-05-11) - - -### Features - -* bump dependencies and align AST ([#2007](https://github.com/typescript-eslint/typescript-eslint/issues/2007)) ([18668b7](https://github.com/typescript-eslint/typescript-eslint/commit/18668b78fd7d1e5281af7fc26c76e0ca53297f69)) - - - - - -# [2.31.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.30.0...v2.31.0) (2020-05-04) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - - - - - -# [2.30.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.29.0...v2.30.0) (2020-04-27) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - - - - - -# [2.29.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.28.0...v2.29.0) (2020-04-20) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - - - - - -# [2.28.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.27.0...v2.28.0) (2020-04-13) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - - - - - -# [2.27.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.26.0...v2.27.0) (2020-04-06) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - - - - - -# [2.26.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.25.0...v2.26.0) (2020-03-30) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - - - - - -# [2.25.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.24.0...v2.25.0) (2020-03-23) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures - - - - - -# [2.24.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.23.0...v2.24.0) (2020-03-16) - - -### Features - -* **typescript-estree:** support 3.8 `export * as ns` ([#1698](https://github.com/typescript-eslint/typescript-eslint/issues/1698)) ([133f622](https://github.com/typescript-eslint/typescript-eslint/commit/133f622f38a286eac45288a9789d2ee529d5e582)) - - - - - -# [2.23.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.22.0...v2.23.0) (2020-03-09) - - -### Features - -* **typescript-estree:** support 3.8 import/export type ([#1697](https://github.com/typescript-eslint/typescript-eslint/issues/1697)) ([625d603](https://github.com/typescript-eslint/typescript-eslint/commit/625d603f94bf0521f834313bf31c734ce4948b7a)) - - - - - -# [2.22.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.21.0...v2.22.0) (2020-03-02) - -**Note:** Version bump only for package @typescript-eslint/shared-fixtures +- support TS4.1 features ([#2748](https://github.com/typescript-eslint/typescript-eslint/issues/2748)) ([2be354b](https://github.com/typescript-eslint/typescript-eslint/commit/2be354bb15f9013a2da1b13a0c0836e9ef057e16)), closes [#2583](https://github.com/typescript-eslint/typescript-eslint/issues/2583) +## [4.6.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.6.0...v4.6.1) (2020-11-02) +**Note:** Version bump only for package @typescript-eslint/shared-fixtures +# [4.6.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.5.0...v4.6.0) (2020-10-26) +**Note:** Version bump only for package @typescript-eslint/shared-fixtures -# [2.21.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.20.0...v2.21.0) (2020-02-24) +# [4.5.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.4.1...v4.5.0) (2020-10-19) **Note:** Version bump only for package @typescript-eslint/shared-fixtures +## [4.4.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.4.0...v4.4.1) (2020-10-12) +**Note:** Version bump only for package @typescript-eslint/shared-fixtures +# [4.4.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.3.0...v4.4.0) (2020-10-05) +**Note:** Version bump only for package @typescript-eslint/shared-fixtures -# [2.20.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.19.2...v2.20.0) (2020-02-17) +# [4.3.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.2.0...v4.3.0) (2020-09-28) **Note:** Version bump only for package @typescript-eslint/shared-fixtures +# [4.2.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.1.1...v4.2.0) (2020-09-21) +**Note:** Version bump only for package @typescript-eslint/shared-fixtures +## [4.1.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.1.0...v4.1.1) (2020-09-14) +**Note:** Version bump only for package @typescript-eslint/shared-fixtures -## [2.19.2](https://github.com/typescript-eslint/typescript-eslint/compare/v2.19.1...v2.19.2) (2020-02-10) +# [4.1.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.0.1...v4.1.0) (2020-09-07) **Note:** Version bump only for package @typescript-eslint/shared-fixtures +## [4.0.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.0.0...v4.0.1) (2020-08-31) +**Note:** Version bump only for package @typescript-eslint/shared-fixtures +# [4.0.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.10.1...v4.0.0) (2020-08-31) - -## [2.19.1](https://github.com/typescript-eslint/typescript-eslint/compare/v2.19.0...v2.19.1) (2020-02-10) +## [Please see the release notes for v4.0.0](https://github.com/typescript-eslint/typescript-eslint/releases/tag/v4.0.0) **Note:** Version bump only for package @typescript-eslint/shared-fixtures +## [3.10.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.10.0...v3.10.1) (2020-08-25) +**Note:** Version bump only for package @typescript-eslint/shared-fixtures - - -# [2.19.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.18.0...v2.19.0) (2020-02-03) +# [3.10.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.9.1...v3.10.0) (2020-08-24) **Note:** Version bump only for package @typescript-eslint/shared-fixtures +## [3.9.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.9.0...v3.9.1) (2020-08-17) +**Note:** Version bump only for package @typescript-eslint/shared-fixtures +# [3.9.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.8.0...v3.9.0) (2020-08-10) +### Features -# [2.18.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.17.0...v2.18.0) (2020-01-27) +- **typescript-estree:** support TSv4 labelled tuple members ([#2378](https://github.com/typescript-eslint/typescript-eslint/issues/2378)) ([00d84ff](https://github.com/typescript-eslint/typescript-eslint/commit/00d84ffbcbe9d0ec98bdb2f2ce59959a27ce4dbe)) +# [3.8.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.7.1...v3.8.0) (2020-08-03) -### Bug Fixes +**Note:** Version bump only for package @typescript-eslint/shared-fixtures -* **typescript-estree:** fix identifier tokens typed as `Keyword` ([#1487](https://github.com/typescript-eslint/typescript-eslint/issues/1487)) ([77a1caa](https://github.com/typescript-eslint/typescript-eslint/commit/77a1caa562638645b4717449800e410107d512c8)) +## [3.7.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.7.0...v3.7.1) (2020-07-27) +**Note:** Version bump only for package @typescript-eslint/shared-fixtures +# [3.7.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.6.1...v3.7.0) (2020-07-20) +### Features +- **typescript-estree:** support short-circuiting assignment operators ([#2307](https://github.com/typescript-eslint/typescript-eslint/issues/2307)) ([2c90d9f](https://github.com/typescript-eslint/typescript-eslint/commit/2c90d9fa3aa5ebd7db697dddb7762bca2dd0e06b)) +- **typescript-estree:** support type annotations on catch clauses ([#2306](https://github.com/typescript-eslint/typescript-eslint/issues/2306)) ([b5afe9c](https://github.com/typescript-eslint/typescript-eslint/commit/b5afe9c560b9f38c8dffc312a600db30944129c8)) -# [2.17.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.16.0...v2.17.0) (2020-01-20) +## [3.6.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.6.0...v3.6.1) (2020-07-13) **Note:** Version bump only for package @typescript-eslint/shared-fixtures +# [3.6.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.5.0...v3.6.0) (2020-07-06) +**Note:** Version bump only for package @typescript-eslint/shared-fixtures - - -# [2.16.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.15.0...v2.16.0) (2020-01-13) +# [3.5.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.4.0...v3.5.0) (2020-06-29) **Note:** Version bump only for package @typescript-eslint/shared-fixtures +# [3.4.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.3.0...v3.4.0) (2020-06-22) +**Note:** Version bump only for package @typescript-eslint/shared-fixtures +# [3.3.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.2.0...v3.3.0) (2020-06-15) +**Note:** Version bump only for package @typescript-eslint/shared-fixtures -# [2.15.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.14.0...v2.15.0) (2020-01-06) +# [3.2.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.1.0...v3.2.0) (2020-06-08) **Note:** Version bump only for package @typescript-eslint/shared-fixtures +# [3.1.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.0.2...v3.1.0) (2020-06-01) +### Bug Fixes +- **experimental-utils:** downlevel type declarations for versions older than 3.8 ([#2133](https://github.com/typescript-eslint/typescript-eslint/issues/2133)) ([7925823](https://github.com/typescript-eslint/typescript-eslint/commit/792582326a8065270b69a0ffcaad5a7b4b103ff3)) +## [3.0.2](https://github.com/typescript-eslint/typescript-eslint/compare/v3.0.1...v3.0.2) (2020-05-27) -# [2.14.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.13.0...v2.14.0) (2019-12-30) +**Note:** Version bump only for package @typescript-eslint/shared-fixtures +## [3.0.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.0.0...v3.0.1) (2020-05-25) ### Bug Fixes -* **typescript-estree:** visit typeParameters in OptionalCallExpr ([#1377](https://github.com/typescript-eslint/typescript-eslint/issues/1377)) ([cba6a2a](https://github.com/typescript-eslint/typescript-eslint/commit/cba6a2a)) - +- **typescript-estree:** handle `BigInt` with `_` numeric separator ([#2067](https://github.com/typescript-eslint/typescript-eslint/issues/2067)) ([66f1627](https://github.com/typescript-eslint/typescript-eslint/commit/66f1627b11a566d5b925a577e800f99d5c808be2)) +# [3.0.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.34.0...v3.0.0) (2020-05-21) +## [Please see the release notes for v3.0.0](https://github.com/typescript-eslint/typescript-eslint/releases/tag/v3.0.0) +### Features -# [2.13.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.12.0...v2.13.0) (2019-12-23) +- **typescript-estree:** align nodes with estree 2020 ([#1389](https://github.com/typescript-eslint/typescript-eslint/issues/1389)) ([aff5b62](https://github.com/typescript-eslint/typescript-eslint/commit/aff5b62044f9b93f2087a1d261e9be3f8d6fd54d)) +- **typescript-estree:** align optional fields ([#1429](https://github.com/typescript-eslint/typescript-eslint/issues/1429)) ([0e0010f](https://github.com/typescript-eslint/typescript-eslint/commit/0e0010f82952f9beeeb84136eea00cc5eecc9db6)) +- **typescript-estree:** handle 3.9's non-null assertion changes ([#2036](https://github.com/typescript-eslint/typescript-eslint/issues/2036)) ([06bec63](https://github.com/typescript-eslint/typescript-eslint/commit/06bec63c56536db070608ab136d2ad57083f0c6a)) +# [2.34.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.33.0...v2.34.0) (2020-05-18) -### Features +**Note:** Version bump only for package @typescript-eslint/shared-fixtures -* **typescript-estree:** computed members discriminated unions ([#1349](https://github.com/typescript-eslint/typescript-eslint/issues/1349)) ([013df9a](https://github.com/typescript-eslint/typescript-eslint/commit/013df9a)) +# [2.33.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.32.0...v2.33.0) (2020-05-12) +**Note:** Version bump only for package @typescript-eslint/shared-fixtures +# [2.32.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.31.0...v2.32.0) (2020-05-11) +### Features +- bump dependencies and align AST ([#2007](https://github.com/typescript-eslint/typescript-eslint/issues/2007)) ([18668b7](https://github.com/typescript-eslint/typescript-eslint/commit/18668b78fd7d1e5281af7fc26c76e0ca53297f69)) -# [2.12.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.11.0...v2.12.0) (2019-12-16) +# [2.31.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.30.0...v2.31.0) (2020-05-04) **Note:** Version bump only for package @typescript-eslint/shared-fixtures +# [2.30.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.29.0...v2.30.0) (2020-04-27) +**Note:** Version bump only for package @typescript-eslint/shared-fixtures +# [2.29.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.28.0...v2.29.0) (2020-04-20) +**Note:** Version bump only for package @typescript-eslint/shared-fixtures -# [2.11.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.10.0...v2.11.0) (2019-12-09) +# [2.28.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.27.0...v2.28.0) (2020-04-13) **Note:** Version bump only for package @typescript-eslint/shared-fixtures +# [2.27.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.26.0...v2.27.0) (2020-04-06) +**Note:** Version bump only for package @typescript-eslint/shared-fixtures +# [2.26.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.25.0...v2.26.0) (2020-03-30) +**Note:** Version bump only for package @typescript-eslint/shared-fixtures -# [2.10.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.9.0...v2.10.0) (2019-12-02) +# [2.25.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.24.0...v2.25.0) (2020-03-23) **Note:** Version bump only for package @typescript-eslint/shared-fixtures +# [2.24.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.23.0...v2.24.0) (2020-03-16) +### Features +- **typescript-estree:** support 3.8 `export * as ns` ([#1698](https://github.com/typescript-eslint/typescript-eslint/issues/1698)) ([133f622](https://github.com/typescript-eslint/typescript-eslint/commit/133f622f38a286eac45288a9789d2ee529d5e582)) +# [2.23.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.22.0...v2.23.0) (2020-03-09) -# [2.9.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.8.0...v2.9.0) (2019-11-25) +### Features -**Note:** Version bump only for package @typescript-eslint/shared-fixtures +- **typescript-estree:** support 3.8 import/export type ([#1697](https://github.com/typescript-eslint/typescript-eslint/issues/1697)) ([625d603](https://github.com/typescript-eslint/typescript-eslint/commit/625d603f94bf0521f834313bf31c734ce4948b7a)) +# [2.22.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.21.0...v2.22.0) (2020-03-02) +**Note:** Version bump only for package @typescript-eslint/shared-fixtures +# [2.21.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.20.0...v2.21.0) (2020-02-24) +**Note:** Version bump only for package @typescript-eslint/shared-fixtures -# [2.8.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.7.0...v2.8.0) (2019-11-18) +# [2.20.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.19.2...v2.20.0) (2020-02-17) **Note:** Version bump only for package @typescript-eslint/shared-fixtures +## [2.19.2](https://github.com/typescript-eslint/typescript-eslint/compare/v2.19.1...v2.19.2) (2020-02-10) +**Note:** Version bump only for package @typescript-eslint/shared-fixtures +## [2.19.1](https://github.com/typescript-eslint/typescript-eslint/compare/v2.19.0...v2.19.1) (2020-02-10) +**Note:** Version bump only for package @typescript-eslint/shared-fixtures -# [2.7.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.6.1...v2.7.0) (2019-11-11) +# [2.19.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.18.0...v2.19.0) (2020-02-03) **Note:** Version bump only for package @typescript-eslint/shared-fixtures +# [2.18.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.17.0...v2.18.0) (2020-01-27) +### Bug Fixes +- **typescript-estree:** fix identifier tokens typed as `Keyword` ([#1487](https://github.com/typescript-eslint/typescript-eslint/issues/1487)) ([77a1caa](https://github.com/typescript-eslint/typescript-eslint/commit/77a1caa562638645b4717449800e410107d512c8)) - -## [2.6.1](https://github.com/typescript-eslint/typescript-eslint/compare/v2.6.0...v2.6.1) (2019-11-04) +# [2.17.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.16.0...v2.17.0) (2020-01-20) **Note:** Version bump only for package @typescript-eslint/shared-fixtures +# [2.16.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.15.0...v2.16.0) (2020-01-13) +**Note:** Version bump only for package @typescript-eslint/shared-fixtures +# [2.15.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.14.0...v2.15.0) (2020-01-06) +**Note:** Version bump only for package @typescript-eslint/shared-fixtures -# [2.6.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.5.0...v2.6.0) (2019-10-28) - +# [2.14.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.13.0...v2.14.0) (2019-12-30) ### Bug Fixes -* **typescript-estree:** correct parenthesized optional chain AST ([#1141](https://github.com/typescript-eslint/typescript-eslint/issues/1141)) ([5ae286e](https://github.com/typescript-eslint/typescript-eslint/commit/5ae286e)) +- **typescript-estree:** visit typeParameters in OptionalCallExpr ([#1377](https://github.com/typescript-eslint/typescript-eslint/issues/1377)) ([cba6a2a](https://github.com/typescript-eslint/typescript-eslint/commit/cba6a2a)) +# [2.13.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.12.0...v2.13.0) (2019-12-23) ### Features -* **typescript-estree:** add support for declare class properties ([#1136](https://github.com/typescript-eslint/typescript-eslint/issues/1136)) ([1508670](https://github.com/typescript-eslint/typescript-eslint/commit/1508670)) +- **typescript-estree:** computed members discriminated unions ([#1349](https://github.com/typescript-eslint/typescript-eslint/issues/1349)) ([013df9a](https://github.com/typescript-eslint/typescript-eslint/commit/013df9a)) +# [2.12.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.11.0...v2.12.0) (2019-12-16) +**Note:** Version bump only for package @typescript-eslint/shared-fixtures +# [2.11.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.10.0...v2.11.0) (2019-12-09) +**Note:** Version bump only for package @typescript-eslint/shared-fixtures -# [2.5.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.4.0...v2.5.0) (2019-10-21) +# [2.10.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.9.0...v2.10.0) (2019-12-02) **Note:** Version bump only for package @typescript-eslint/shared-fixtures +# [2.9.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.8.0...v2.9.0) (2019-11-25) + +**Note:** Version bump only for package @typescript-eslint/shared-fixtures +# [2.8.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.7.0...v2.8.0) (2019-11-18) +**Note:** Version bump only for package @typescript-eslint/shared-fixtures +# [2.7.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.6.1...v2.7.0) (2019-11-11) -# [2.4.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.3.3...v2.4.0) (2019-10-14) +**Note:** Version bump only for package @typescript-eslint/shared-fixtures +## [2.6.1](https://github.com/typescript-eslint/typescript-eslint/compare/v2.6.0...v2.6.1) (2019-11-04) -### Features +**Note:** Version bump only for package @typescript-eslint/shared-fixtures -* **typescript-estree:** support for parsing 3.7 features ([#1045](https://github.com/typescript-eslint/typescript-eslint/issues/1045)) ([623febf](https://github.com/typescript-eslint/typescript-eslint/commit/623febf)) +# [2.6.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.5.0...v2.6.0) (2019-10-28) +### Bug Fixes +- **typescript-estree:** correct parenthesized optional chain AST ([#1141](https://github.com/typescript-eslint/typescript-eslint/issues/1141)) ([5ae286e](https://github.com/typescript-eslint/typescript-eslint/commit/5ae286e)) +### Features +- **typescript-estree:** add support for declare class properties ([#1136](https://github.com/typescript-eslint/typescript-eslint/issues/1136)) ([1508670](https://github.com/typescript-eslint/typescript-eslint/commit/1508670)) -## [2.3.3](https://github.com/typescript-eslint/typescript-eslint/compare/v2.3.2...v2.3.3) (2019-10-07) +# [2.5.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.4.0...v2.5.0) (2019-10-21) **Note:** Version bump only for package @typescript-eslint/shared-fixtures +# [2.4.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.3.3...v2.4.0) (2019-10-14) +### Features +- **typescript-estree:** support for parsing 3.7 features ([#1045](https://github.com/typescript-eslint/typescript-eslint/issues/1045)) ([623febf](https://github.com/typescript-eslint/typescript-eslint/commit/623febf)) +## [2.3.3](https://github.com/typescript-eslint/typescript-eslint/compare/v2.3.2...v2.3.3) (2019-10-07) -## [2.3.2](https://github.com/typescript-eslint/typescript-eslint/compare/v2.3.1...v2.3.2) (2019-09-30) +**Note:** Version bump only for package @typescript-eslint/shared-fixtures +## [2.3.2](https://github.com/typescript-eslint/typescript-eslint/compare/v2.3.1...v2.3.2) (2019-09-30) ### Bug Fixes -* **typescript-estree:** handle optional computed prop w/o type ([#1026](https://github.com/typescript-eslint/typescript-eslint/issues/1026)) ([95c13fe](https://github.com/typescript-eslint/typescript-eslint/commit/95c13fe)) - - - - +- **typescript-estree:** handle optional computed prop w/o type ([#1026](https://github.com/typescript-eslint/typescript-eslint/issues/1026)) ([95c13fe](https://github.com/typescript-eslint/typescript-eslint/commit/95c13fe)) ## [2.3.1](https://github.com/typescript-eslint/typescript-eslint/compare/v2.3.0...v2.3.1) (2019-09-23) - ### Bug Fixes -* **typescript-estree:** parsing error for await in non-async func ([#988](https://github.com/typescript-eslint/typescript-eslint/issues/988)) ([19abbe0](https://github.com/typescript-eslint/typescript-eslint/commit/19abbe0)) - - - - +- **typescript-estree:** parsing error for await in non-async func ([#988](https://github.com/typescript-eslint/typescript-eslint/issues/988)) ([19abbe0](https://github.com/typescript-eslint/typescript-eslint/commit/19abbe0)) # [2.3.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.2.0...v2.3.0) (2019-09-16) **Note:** Version bump only for package @typescript-eslint/shared-fixtures - - - - # [2.2.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.1.0...v2.2.0) (2019-09-09) **Note:** Version bump only for package @typescript-eslint/shared-fixtures - - - - # [2.1.0](https://github.com/typescript-eslint/typescript-eslint/compare/v2.0.0...v2.1.0) (2019-09-02) **Note:** Version bump only for package @typescript-eslint/shared-fixtures - - - - # [2.0.0](https://github.com/typescript-eslint/typescript-eslint/compare/v1.13.0...v2.0.0) (2019-08-13) - ### Bug Fixes -* **typescript-estree:** fix `is` token typed as `Keyword ([#750](https://github.com/typescript-eslint/typescript-eslint/issues/750)) ([35dec52](https://github.com/typescript-eslint/typescript-eslint/commit/35dec52)) -* **typescript-estree:** jsx comment parsing ([#703](https://github.com/typescript-eslint/typescript-eslint/issues/703)) ([0cfc48e](https://github.com/typescript-eslint/typescript-eslint/commit/0cfc48e)) - - - - +- **typescript-estree:** fix `is` token typed as `Keyword ([#750](https://github.com/typescript-eslint/typescript-eslint/issues/750)) ([35dec52](https://github.com/typescript-eslint/typescript-eslint/commit/35dec52)) +- **typescript-estree:** jsx comment parsing ([#703](https://github.com/typescript-eslint/typescript-eslint/issues/703)) ([0cfc48e](https://github.com/typescript-eslint/typescript-eslint/commit/0cfc48e)) # [1.13.0](https://github.com/typescript-eslint/typescript-eslint/compare/v1.12.0...v1.13.0) (2019-07-21) **Note:** Version bump only for package @typescript-eslint/shared-fixtures - - - - # [1.12.0](https://github.com/typescript-eslint/typescript-eslint/compare/v1.11.0...v1.12.0) (2019-07-12) - ### Bug Fixes -* **typescript-estree:** fix `async` identifier token typed as `Keyword` ([#681](https://github.com/typescript-eslint/typescript-eslint/issues/681)) ([6de19d3](https://github.com/typescript-eslint/typescript-eslint/commit/6de19d3)) - - - - +- **typescript-estree:** fix `async` identifier token typed as `Keyword` ([#681](https://github.com/typescript-eslint/typescript-eslint/issues/681)) ([6de19d3](https://github.com/typescript-eslint/typescript-eslint/commit/6de19d3)) # [1.11.0](https://github.com/typescript-eslint/typescript-eslint/compare/v1.10.2...v1.11.0) (2019-06-23) - ### Bug Fixes -* **typescript-estree:** fix more cases with double slash in JSX text ([#607](https://github.com/typescript-eslint/typescript-eslint/issues/607)) ([34cfa53](https://github.com/typescript-eslint/typescript-eslint/commit/34cfa53)) - - - - +- **typescript-estree:** fix more cases with double slash in JSX text ([#607](https://github.com/typescript-eslint/typescript-eslint/issues/607)) ([34cfa53](https://github.com/typescript-eslint/typescript-eslint/commit/34cfa53)) ## [1.10.2](https://github.com/typescript-eslint/typescript-eslint/compare/v1.10.1...v1.10.2) (2019-06-10) **Note:** Version bump only for package @typescript-eslint/shared-fixtures - - - - ## [1.10.1](https://github.com/typescript-eslint/typescript-eslint/compare/v1.10.0...v1.10.1) (2019-06-09) **Note:** Version bump only for package @typescript-eslint/shared-fixtures - - - - # [1.10.0](https://github.com/typescript-eslint/typescript-eslint/compare/v1.9.0...v1.10.0) (2019-06-09) - ### Bug Fixes -* **typescript-estree:** stop ignoring comments in JSX with generic ([#596](https://github.com/typescript-eslint/typescript-eslint/issues/596)) ([31d5bd4](https://github.com/typescript-eslint/typescript-eslint/commit/31d5bd4)) - - - - +- **typescript-estree:** stop ignoring comments in JSX with generic ([#596](https://github.com/typescript-eslint/typescript-eslint/issues/596)) ([31d5bd4](https://github.com/typescript-eslint/typescript-eslint/commit/31d5bd4)) # [1.9.0](https://github.com/typescript-eslint/typescript-eslint/compare/v1.8.0...v1.9.0) (2019-05-12) **Note:** Version bump only for package @typescript-eslint/shared-fixtures - - - - # [1.8.0](https://github.com/typescript-eslint/typescript-eslint/compare/v1.7.0...v1.8.0) (2019-05-10) **Note:** Version bump only for package @typescript-eslint/shared-fixtures - - - - # [1.7.0](https://github.com/typescript-eslint/typescript-eslint/compare/v1.6.0...v1.7.0) (2019-04-20) **Note:** Version bump only for package @typescript-eslint/shared-fixtures - - - - # [1.6.0](https://github.com/typescript-eslint/typescript-eslint/compare/v1.5.0...v1.6.0) (2019-04-03) - ### Features -* change TypeScript version range to >=3.2.1 <3.5.0 ([#399](https://github.com/typescript-eslint/typescript-eslint/issues/399)) ([a4f95d3](https://github.com/typescript-eslint/typescript-eslint/commit/a4f95d3)) - - - - +- change TypeScript version range to >=3.2.1 <3.5.0 ([#399](https://github.com/typescript-eslint/typescript-eslint/issues/399)) ([a4f95d3](https://github.com/typescript-eslint/typescript-eslint/commit/a4f95d3)) # [1.5.0](https://github.com/typescript-eslint/typescript-eslint/compare/v1.4.2...v1.5.0) (2019-03-20) **Note:** Version bump only for package @typescript-eslint/shared-fixtures - - - - ## [1.4.2](https://github.com/typescript-eslint/typescript-eslint/compare/v1.4.1...v1.4.2) (2019-02-25) **Note:** Version bump only for package @typescript-eslint/shared-fixtures - - - - ## [1.4.1](https://github.com/typescript-eslint/typescript-eslint/compare/v1.4.0...v1.4.1) (2019-02-23) **Note:** Version bump only for package @typescript-eslint/shared-fixtures - - - - # [1.4.0](https://github.com/typescript-eslint/typescript-eslint/compare/v1.3.0...v1.4.0) (2019-02-19) - ### Features -* **ts-estree:** fix parsing nested sequence expressions ([#286](https://github.com/typescript-eslint/typescript-eslint/issues/286)) ([ecc9631](https://github.com/typescript-eslint/typescript-eslint/commit/ecc9631)) - - - - +- **ts-estree:** fix parsing nested sequence expressions ([#286](https://github.com/typescript-eslint/typescript-eslint/issues/286)) ([ecc9631](https://github.com/typescript-eslint/typescript-eslint/commit/ecc9631)) # [1.3.0](https://github.com/typescript-eslint/typescript-eslint/compare/v1.2.0...v1.3.0) (2019-02-07) - ### Bug Fixes -* **ts-estree:** align typeArguments and typeParameters across nodes ([#223](https://github.com/typescript-eslint/typescript-eslint/issues/223)) ([3306198](https://github.com/typescript-eslint/typescript-eslint/commit/3306198)) - +- **ts-estree:** align typeArguments and typeParameters across nodes ([#223](https://github.com/typescript-eslint/typescript-eslint/issues/223)) ([3306198](https://github.com/typescript-eslint/typescript-eslint/commit/3306198)) ### Features -* **ts-estree:** enable errors 1098 and 1099 ([#219](https://github.com/typescript-eslint/typescript-eslint/issues/219)) ([fc50167](https://github.com/typescript-eslint/typescript-eslint/commit/fc50167)) - - - - +- **ts-estree:** enable errors 1098 and 1099 ([#219](https://github.com/typescript-eslint/typescript-eslint/issues/219)) ([fc50167](https://github.com/typescript-eslint/typescript-eslint/commit/fc50167)) # [1.2.0](https://github.com/typescript-eslint/typescript-eslint/compare/v1.1.1...v1.2.0) (2019-02-01) **Note:** Version bump only for package @typescript-eslint/shared-fixtures - - - - ## [1.1.1](https://github.com/typescript-eslint/typescript-eslint/compare/v1.1.0...v1.1.1) (2019-01-29) **Note:** Version bump only for package @typescript-eslint/shared-fixtures - - - - # [1.1.0](https://github.com/typescript-eslint/typescript-eslint/compare/v1.0.0...v1.1.0) (2019-01-23) - ### Bug Fixes -* **typescript-estree:** correct range of parameters with comments ([#128](https://github.com/typescript-eslint/typescript-eslint/issues/128)) ([91eedf2](https://github.com/typescript-eslint/typescript-eslint/commit/91eedf2)) - - - - +- **typescript-estree:** correct range of parameters with comments ([#128](https://github.com/typescript-eslint/typescript-eslint/issues/128)) ([91eedf2](https://github.com/typescript-eslint/typescript-eslint/commit/91eedf2)) # [1.0.0](https://github.com/typescript-eslint/typescript-eslint/compare/v0.2.1...v1.0.0) (2019-01-20) **Note:** Version bump only for package @typescript-eslint/shared-fixtures - - - - ## [0.2.1](https://github.com/typescript-eslint/typescript-eslint/compare/v0.2.0...v0.2.1) (2019-01-20) **Note:** Version bump only for package @typescript-eslint/shared-fixtures diff --git a/packages/shared-fixtures/README.md b/packages/shared-fixtures/README.md index 866a6e86614..eb3bceabc7f 100644 --- a/packages/shared-fixtures/README.md +++ b/packages/shared-fixtures/README.md @@ -1,7 +1,10 @@ -

Fixtures for Testing typescript-eslint

+# `@typescript-eslint/shared-fixtures` -

Code fixtures used to test the parser. This is not intended for external use.

+> Code fixtures used to test the `typescript-estree` parser. -

- CI -

+## ✋ Internal Package + +This is an _internal package_ to the [typescript-eslint monorepo](https://github.com/typescript-eslint/typescript-eslint). +You likely don't want to use it directly. + +👉 See **https://typescript-eslint.io** for docs on typescript-eslint. diff --git a/packages/shared-fixtures/fixtures/typescript/decorators/class-decorators/class-parameter-property.src.ts b/packages/shared-fixtures/fixtures/typescript/decorators/class-decorators/class-parameter-property.src.ts new file mode 100644 index 00000000000..d8503e061cc --- /dev/null +++ b/packages/shared-fixtures/fixtures/typescript/decorators/class-decorators/class-parameter-property.src.ts @@ -0,0 +1,3 @@ +class A { + constructor(@d private x: number) {} +} diff --git a/packages/shared-fixtures/fixtures/typescript/decorators/class-decorators/export-default-class-decorator.src.ts b/packages/shared-fixtures/fixtures/typescript/decorators/class-decorators/export-default-class-decorator.src.ts new file mode 100644 index 00000000000..92c9258b9e0 --- /dev/null +++ b/packages/shared-fixtures/fixtures/typescript/decorators/class-decorators/export-default-class-decorator.src.ts @@ -0,0 +1,2 @@ +@sealed +export default class Qux {} diff --git a/packages/shared-fixtures/fixtures/typescript/decorators/class-decorators/export-named-class-decorator.src.ts b/packages/shared-fixtures/fixtures/typescript/decorators/class-decorators/export-named-class-decorator.src.ts new file mode 100644 index 00000000000..53ef2e4d568 --- /dev/null +++ b/packages/shared-fixtures/fixtures/typescript/decorators/class-decorators/export-named-class-decorator.src.ts @@ -0,0 +1,2 @@ +@sealed +export class Qux {} diff --git a/packages/shared-fixtures/package.json b/packages/shared-fixtures/package.json index aaf5ae87789..0e3d35976d4 100644 --- a/packages/shared-fixtures/package.json +++ b/packages/shared-fixtures/package.json @@ -1,5 +1,6 @@ { + "description": "Code fixtures used to test the typescript-estree parser.", "name": "@typescript-eslint/shared-fixtures", - "version": "5.31.0", + "version": "5.50.0", "private": true } diff --git a/packages/shared-fixtures/project.json b/packages/shared-fixtures/project.json index b100b1e4ba7..412bca4935f 100644 --- a/packages/shared-fixtures/project.json +++ b/packages/shared-fixtures/project.json @@ -1,5 +1,6 @@ { - "root": "packages/shared-fixtures", + "name": "shared-fixtures", + "$schema": "../../node_modules/nx/schemas/project-schema.json", "type": "library", "implicitDependencies": [] } diff --git a/packages/type-utils/CHANGELOG.md b/packages/type-utils/CHANGELOG.md index 5fb62320d69..26f418c1436 100644 --- a/packages/type-utils/CHANGELOG.md +++ b/packages/type-utils/CHANGELOG.md @@ -3,7 +3,7 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. -# [5.31.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.7...v5.31.0) (2022-07-25) +# [5.50.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.49.0...v5.50.0) (2023-01-31) **Note:** Version bump only for package @typescript-eslint/type-utils @@ -11,7 +11,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline -## [5.30.7](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.6...v5.30.7) (2022-07-18) +# [5.49.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.48.2...v5.49.0) (2023-01-23) **Note:** Version bump only for package @typescript-eslint/type-utils @@ -19,7 +19,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline -## [5.30.6](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.5...v5.30.6) (2022-07-11) +## [5.48.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.48.1...v5.48.2) (2023-01-16) **Note:** Version bump only for package @typescript-eslint/type-utils @@ -27,7 +27,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline -## [5.30.5](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.4...v5.30.5) (2022-07-04) +## [5.48.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.48.0...v5.48.1) (2023-01-09) **Note:** Version bump only for package @typescript-eslint/type-utils @@ -35,273 +35,276 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline -## [5.30.4](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.3...v5.30.4) (2022-07-03) +# [5.48.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.47.1...v5.48.0) (2023-01-02) **Note:** Version bump only for package @typescript-eslint/type-utils +## [5.47.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.47.0...v5.47.1) (2022-12-26) +**Note:** Version bump only for package @typescript-eslint/type-utils - - -## [5.30.3](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.2...v5.30.3) (2022-07-01) +# [5.47.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.46.1...v5.47.0) (2022-12-19) **Note:** Version bump only for package @typescript-eslint/type-utils +## [5.46.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.46.0...v5.46.1) (2022-12-12) +**Note:** Version bump only for package @typescript-eslint/type-utils +# [5.46.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.45.1...v5.46.0) (2022-12-08) +**Note:** Version bump only for package @typescript-eslint/type-utils -## [5.30.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.1...v5.30.2) (2022-07-01) +## [5.45.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.45.0...v5.45.1) (2022-12-05) **Note:** Version bump only for package @typescript-eslint/type-utils +# [5.45.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.44.0...v5.45.0) (2022-11-28) +**Note:** Version bump only for package @typescript-eslint/type-utils +# [5.44.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.43.0...v5.44.0) (2022-11-21) +**Note:** Version bump only for package @typescript-eslint/type-utils -## 5.30.1 (2022-07-01) +# [5.43.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.42.1...v5.43.0) (2022-11-14) **Note:** Version bump only for package @typescript-eslint/type-utils +## [5.42.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.42.0...v5.42.1) (2022-11-07) +### Bug Fixes +- **eslint-plugin:** isTypeReadonly stack overflow ([#5875](https://github.com/typescript-eslint/typescript-eslint/issues/5875)) ([#5876](https://github.com/typescript-eslint/typescript-eslint/issues/5876)) ([2d9a33c](https://github.com/typescript-eslint/typescript-eslint/commit/2d9a33cfb2db53d76246a59253daaf2abb19ee57)) - -# [5.30.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.29.0...v5.30.0) (2022-06-27) +# [5.42.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.41.0...v5.42.0) (2022-10-31) **Note:** Version bump only for package @typescript-eslint/type-utils +# [5.41.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.40.1...v5.41.0) (2022-10-24) +### Bug Fixes +- **type-utils:** prevent stack overflow in `isTypeReadonly` ([#5860](https://github.com/typescript-eslint/typescript-eslint/issues/5860)) ([a6d8f7e](https://github.com/typescript-eslint/typescript-eslint/commit/a6d8f7edb84f9f6dd59a76faf53bf686756e2aed)), closes [#4476](https://github.com/typescript-eslint/typescript-eslint/issues/4476) - -# [5.29.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.28.0...v5.29.0) (2022-06-20) +## [5.40.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.40.0...v5.40.1) (2022-10-17) **Note:** Version bump only for package @typescript-eslint/type-utils +# [5.40.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.39.0...v5.40.0) (2022-10-10) +**Note:** Version bump only for package @typescript-eslint/type-utils +# [5.39.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.38.1...v5.39.0) (2022-10-03) +**Note:** Version bump only for package @typescript-eslint/type-utils -# [5.28.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.27.1...v5.28.0) (2022-06-13) +## [5.38.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.38.0...v5.38.1) (2022-09-26) **Note:** Version bump only for package @typescript-eslint/type-utils +# [5.38.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.37.0...v5.38.0) (2022-09-19) +**Note:** Version bump only for package @typescript-eslint/type-utils - - -## [5.27.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.27.0...v5.27.1) (2022-06-06) +# [5.37.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.36.2...v5.37.0) (2022-09-12) **Note:** Version bump only for package @typescript-eslint/type-utils +## [5.36.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.36.1...v5.36.2) (2022-09-05) +**Note:** Version bump only for package @typescript-eslint/type-utils +## [5.36.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.36.0...v5.36.1) (2022-08-30) +**Note:** Version bump only for package @typescript-eslint/type-utils -# [5.27.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.26.0...v5.27.0) (2022-05-30) - +# [5.36.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.35.1...v5.36.0) (2022-08-30) ### Features -* [4.7] support new extensions ([#5027](https://github.com/typescript-eslint/typescript-eslint/issues/5027)) ([efc147b](https://github.com/typescript-eslint/typescript-eslint/commit/efc147b04dce52ab17415b6a4ae4076b944b9036)) +- support TypeScript 4.8 ([#5551](https://github.com/typescript-eslint/typescript-eslint/issues/5551)) ([81450ed](https://github.com/typescript-eslint/typescript-eslint/commit/81450ed7eaede74b384e9a91a84e9b4d34513866)) +## [5.35.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.35.0...v5.35.1) (2022-08-24) +**Note:** Version bump only for package @typescript-eslint/type-utils +# [5.35.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.34.0...v5.35.0) (2022-08-24) +**Note:** Version bump only for package @typescript-eslint/type-utils -# [5.26.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.25.0...v5.26.0) (2022-05-23) +# [5.34.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.33.1...v5.34.0) (2022-08-22) **Note:** Version bump only for package @typescript-eslint/type-utils +## [5.33.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.33.0...v5.33.1) (2022-08-15) +**Note:** Version bump only for package @typescript-eslint/type-utils +# [5.33.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.32.0...v5.33.0) (2022-08-08) +**Note:** Version bump only for package @typescript-eslint/type-utils -# [5.25.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.24.0...v5.25.0) (2022-05-17) +# [5.32.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.31.0...v5.32.0) (2022-08-01) **Note:** Version bump only for package @typescript-eslint/type-utils +# [5.31.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.7...v5.31.0) (2022-07-25) +**Note:** Version bump only for package @typescript-eslint/type-utils +## [5.30.7](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.6...v5.30.7) (2022-07-18) +**Note:** Version bump only for package @typescript-eslint/type-utils -# [5.24.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.23.0...v5.24.0) (2022-05-16) +## [5.30.6](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.5...v5.30.6) (2022-07-11) **Note:** Version bump only for package @typescript-eslint/type-utils +## [5.30.5](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.4...v5.30.5) (2022-07-04) +**Note:** Version bump only for package @typescript-eslint/type-utils +## [5.30.4](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.3...v5.30.4) (2022-07-03) +**Note:** Version bump only for package @typescript-eslint/type-utils -# [5.23.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.22.0...v5.23.0) (2022-05-09) +## [5.30.3](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.2...v5.30.3) (2022-07-01) **Note:** Version bump only for package @typescript-eslint/type-utils +## [5.30.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.1...v5.30.2) (2022-07-01) +**Note:** Version bump only for package @typescript-eslint/type-utils +## 5.30.1 (2022-07-01) +**Note:** Version bump only for package @typescript-eslint/type-utils -# [5.22.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.21.0...v5.22.0) (2022-05-02) +# [5.30.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.29.0...v5.30.0) (2022-06-27) **Note:** Version bump only for package @typescript-eslint/type-utils +# [5.29.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.28.0...v5.29.0) (2022-06-20) +**Note:** Version bump only for package @typescript-eslint/type-utils +# [5.28.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.27.1...v5.28.0) (2022-06-13) +**Note:** Version bump only for package @typescript-eslint/type-utils -# [5.21.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.20.0...v5.21.0) (2022-04-25) +## [5.27.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.27.0...v5.27.1) (2022-06-06) **Note:** Version bump only for package @typescript-eslint/type-utils +# [5.27.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.26.0...v5.27.0) (2022-05-30) +### Features +- [4.7] support new extensions ([#5027](https://github.com/typescript-eslint/typescript-eslint/issues/5027)) ([efc147b](https://github.com/typescript-eslint/typescript-eslint/commit/efc147b04dce52ab17415b6a4ae4076b944b9036)) - -# [5.20.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.19.0...v5.20.0) (2022-04-18) +# [5.26.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.25.0...v5.26.0) (2022-05-23) **Note:** Version bump only for package @typescript-eslint/type-utils +# [5.25.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.24.0...v5.25.0) (2022-05-17) +**Note:** Version bump only for package @typescript-eslint/type-utils +# [5.24.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.23.0...v5.24.0) (2022-05-16) +**Note:** Version bump only for package @typescript-eslint/type-utils -# [5.19.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.18.0...v5.19.0) (2022-04-11) +# [5.23.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.22.0...v5.23.0) (2022-05-09) **Note:** Version bump only for package @typescript-eslint/type-utils +# [5.22.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.21.0...v5.22.0) (2022-05-02) +**Note:** Version bump only for package @typescript-eslint/type-utils +# [5.21.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.20.0...v5.21.0) (2022-04-25) +**Note:** Version bump only for package @typescript-eslint/type-utils -# [5.18.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.17.0...v5.18.0) (2022-04-04) +# [5.20.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.19.0...v5.20.0) (2022-04-18) **Note:** Version bump only for package @typescript-eslint/type-utils +# [5.19.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.18.0...v5.19.0) (2022-04-11) +**Note:** Version bump only for package @typescript-eslint/type-utils +# [5.18.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.17.0...v5.18.0) (2022-04-04) +**Note:** Version bump only for package @typescript-eslint/type-utils # [5.17.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.16.0...v5.17.0) (2022-03-28) **Note:** Version bump only for package @typescript-eslint/type-utils - - - - # [5.16.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.15.0...v5.16.0) (2022-03-21) **Note:** Version bump only for package @typescript-eslint/type-utils - - - - # [5.15.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.14.0...v5.15.0) (2022-03-14) **Note:** Version bump only for package @typescript-eslint/type-utils - - - - # [5.14.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.13.0...v5.14.0) (2022-03-07) - ### Bug Fixes -* **eslint-plugin:** [prefer-readonly-parameter-types] handle class sharp private field and member without throwing error ([#4343](https://github.com/typescript-eslint/typescript-eslint/issues/4343)) ([a65713a](https://github.com/typescript-eslint/typescript-eslint/commit/a65713ae138e56555d01a9e8e5179221a2f39e75)) - - - - +- **eslint-plugin:** [prefer-readonly-parameter-types] handle class sharp private field and member without throwing error ([#4343](https://github.com/typescript-eslint/typescript-eslint/issues/4343)) ([a65713a](https://github.com/typescript-eslint/typescript-eslint/commit/a65713ae138e56555d01a9e8e5179221a2f39e75)) # [5.13.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.12.1...v5.13.0) (2022-02-28) - ### Features -* **eslint-plugin:** add `no-redundant-type-constituents` rule ([#4378](https://github.com/typescript-eslint/typescript-eslint/issues/4378)) ([63d051e](https://github.com/typescript-eslint/typescript-eslint/commit/63d051eed29dcf71015a23992feac0a8f92717a0)) - - - - +- **eslint-plugin:** add `no-redundant-type-constituents` rule ([#4378](https://github.com/typescript-eslint/typescript-eslint/issues/4378)) ([63d051e](https://github.com/typescript-eslint/typescript-eslint/commit/63d051eed29dcf71015a23992feac0a8f92717a0)) ## [5.12.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.12.0...v5.12.1) (2022-02-21) - ### Bug Fixes -* **eslint-plugin:** [no-unnecessary-type-arguments] fix comparison of types ([#4555](https://github.com/typescript-eslint/typescript-eslint/issues/4555)) ([fc3936e](https://github.com/typescript-eslint/typescript-eslint/commit/fc3936e99712374a707ce9e0101bc641807b9ea6)) - - - - +- **eslint-plugin:** [no-unnecessary-type-arguments] fix comparison of types ([#4555](https://github.com/typescript-eslint/typescript-eslint/issues/4555)) ([fc3936e](https://github.com/typescript-eslint/typescript-eslint/commit/fc3936e99712374a707ce9e0101bc641807b9ea6)) # [5.12.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.11.0...v5.12.0) (2022-02-14) **Note:** Version bump only for package @typescript-eslint/type-utils - - - - # [5.11.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.10.2...v5.11.0) (2022-02-07) **Note:** Version bump only for package @typescript-eslint/type-utils - - - - ## [5.10.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.10.1...v5.10.2) (2022-01-31) **Note:** Version bump only for package @typescript-eslint/type-utils - - - - ## [5.10.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.10.0...v5.10.1) (2022-01-24) **Note:** Version bump only for package @typescript-eslint/type-utils - - - - # [5.10.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.9.1...v5.10.0) (2022-01-17) - ### Bug Fixes -* **type-utils:** check IndexSignature internals when checking isTypeReadonly ([#4417](https://github.com/typescript-eslint/typescript-eslint/issues/4417)) ([ef3147c](https://github.com/typescript-eslint/typescript-eslint/commit/ef3147cf73767ddece91ce57f6028a83ce074b60)), closes [#4410](https://github.com/typescript-eslint/typescript-eslint/issues/4410) [#3714](https://github.com/typescript-eslint/typescript-eslint/issues/3714) -* **type-utils:** intersection types involving readonly arrays are now handled in most cases ([#4429](https://github.com/typescript-eslint/typescript-eslint/issues/4429)) ([5046882](https://github.com/typescript-eslint/typescript-eslint/commit/5046882025e3bc8cb122ecef703aebd0b5e79017)) -* **type-utils:** isTypeReadonly now handles conditional types ([#4421](https://github.com/typescript-eslint/typescript-eslint/issues/4421)) ([39a6806](https://github.com/typescript-eslint/typescript-eslint/commit/39a6806c61a48bbca93f9ffb965dd8b3fe0575b3)) -* **type-utils:** union types always being marked as readonly ([#4419](https://github.com/typescript-eslint/typescript-eslint/issues/4419)) ([99ab193](https://github.com/typescript-eslint/typescript-eslint/commit/99ab193bb02f181bed4ed917b1d121ed189d3fe4)) - +- **type-utils:** check IndexSignature internals when checking isTypeReadonly ([#4417](https://github.com/typescript-eslint/typescript-eslint/issues/4417)) ([ef3147c](https://github.com/typescript-eslint/typescript-eslint/commit/ef3147cf73767ddece91ce57f6028a83ce074b60)), closes [#4410](https://github.com/typescript-eslint/typescript-eslint/issues/4410) [#3714](https://github.com/typescript-eslint/typescript-eslint/issues/3714) +- **type-utils:** intersection types involving readonly arrays are now handled in most cases ([#4429](https://github.com/typescript-eslint/typescript-eslint/issues/4429)) ([5046882](https://github.com/typescript-eslint/typescript-eslint/commit/5046882025e3bc8cb122ecef703aebd0b5e79017)) +- **type-utils:** isTypeReadonly now handles conditional types ([#4421](https://github.com/typescript-eslint/typescript-eslint/issues/4421)) ([39a6806](https://github.com/typescript-eslint/typescript-eslint/commit/39a6806c61a48bbca93f9ffb965dd8b3fe0575b3)) +- **type-utils:** union types always being marked as readonly ([#4419](https://github.com/typescript-eslint/typescript-eslint/issues/4419)) ([99ab193](https://github.com/typescript-eslint/typescript-eslint/commit/99ab193bb02f181bed4ed917b1d121ed189d3fe4)) ### Features -* rename `experimental-utils` to `utils` and make `experimental-utils` an alias to the new package ([#4172](https://github.com/typescript-eslint/typescript-eslint/issues/4172)) ([1d55a75](https://github.com/typescript-eslint/typescript-eslint/commit/1d55a7511b38d8e2b2eabe59f639e0a865e6c93f)) -* **type-utils:** make isTypeReadonly's options param optional ([#4415](https://github.com/typescript-eslint/typescript-eslint/issues/4415)) ([3a07a56](https://github.com/typescript-eslint/typescript-eslint/commit/3a07a563c987ff25f6cd8925eeeb2ede47cc19e8)) - - - - +- rename `experimental-utils` to `utils` and make `experimental-utils` an alias to the new package ([#4172](https://github.com/typescript-eslint/typescript-eslint/issues/4172)) ([1d55a75](https://github.com/typescript-eslint/typescript-eslint/commit/1d55a7511b38d8e2b2eabe59f639e0a865e6c93f)) +- **type-utils:** make isTypeReadonly's options param optional ([#4415](https://github.com/typescript-eslint/typescript-eslint/issues/4415)) ([3a07a56](https://github.com/typescript-eslint/typescript-eslint/commit/3a07a563c987ff25f6cd8925eeeb2ede47cc19e8)) ## [5.9.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.9.0...v5.9.1) (2022-01-10) **Note:** Version bump only for package @typescript-eslint/type-utils - - - - # [5.9.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.8.1...v5.9.0) (2022-01-03) - ### Features -* **experimental-utils:** move isTypeReadonly from eslint-plugin to experimental-utils ([#3658](https://github.com/typescript-eslint/typescript-eslint/issues/3658)) ([a9eb0b9](https://github.com/typescript-eslint/typescript-eslint/commit/a9eb0b9eb2db291ea36065ec34f84bf5c5504b43)) +- **experimental-utils:** move isTypeReadonly from eslint-plugin to experimental-utils ([#3658](https://github.com/typescript-eslint/typescript-eslint/issues/3658)) ([a9eb0b9](https://github.com/typescript-eslint/typescript-eslint/commit/a9eb0b9eb2db291ea36065ec34f84bf5c5504b43)) diff --git a/packages/type-utils/LICENSE b/packages/type-utils/LICENSE index 7641edcfd0a..dabd464af3a 100644 --- a/packages/type-utils/LICENSE +++ b/packages/type-utils/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2021 TypeScript ESLint and other contributors +Copyright (c) 2021 typescript-eslint and other contributors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/packages/type-utils/README.md b/packages/type-utils/README.md index 19a4bf7e964..2f842e803cc 100644 --- a/packages/type-utils/README.md +++ b/packages/type-utils/README.md @@ -1,15 +1,12 @@ -

Type utils for ESLint Plugins

+# `@typescript-eslint/type-utils` -

Type utilities for working with TypeScript within ESLint rules.

+> Type utilities for working with TypeScript within ESLint rules. -

- CI - NPM Version - NPM Downloads -

+The utilities in this package are separated from `@typescript-eslint/utils` so that that package does not require a dependency on `typescript`. -This utilities in this package are separated from `@typescript-eslint/utils` so that that package does not require a dependency on `typescript`. +## ✋ Internal Package -## Contributing +This is an _internal package_ to the [typescript-eslint monorepo](https://github.com/typescript-eslint/typescript-eslint). +You likely don't want to use it directly. -[See the contributing guide here](../../CONTRIBUTING.md) +👉 See **https://typescript-eslint.io** for docs on typescript-eslint. diff --git a/packages/type-utils/package.json b/packages/type-utils/package.json index f459f69c051..2b44585a682 100644 --- a/packages/type-utils/package.json +++ b/packages/type-utils/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/type-utils", - "version": "5.31.0", + "version": "5.50.0", "description": "Type utilities for working with TypeScript + ESLint together", "keywords": [ "eslint", @@ -34,17 +34,18 @@ "clean": "tsc -b tsconfig.build.json --clean", "postclean": "rimraf dist && rimraf _ts3.4 && rimraf coverage", "format": "prettier --write \"./**/*.{ts,mts,cts,tsx,js,mjs,cjs,jsx,json,md,css}\" --ignore-path ../../.prettierignore", - "lint": "eslint . --ignore-path='../../.eslintignore'", + "lint": "nx lint", "test": "jest --coverage", "typecheck": "tsc -p tsconfig.json --noEmit" }, "dependencies": { - "@typescript-eslint/utils": "5.31.0", + "@typescript-eslint/typescript-estree": "5.50.0", + "@typescript-eslint/utils": "5.50.0", "debug": "^4.3.4", "tsutils": "^3.21.0" }, "devDependencies": { - "@typescript-eslint/parser": "5.31.0", + "@typescript-eslint/parser": "5.50.0", "typescript": "*" }, "peerDependencies": { diff --git a/packages/type-utils/project.json b/packages/type-utils/project.json index fea4ee94ee4..77fdd9b5fce 100644 --- a/packages/type-utils/project.json +++ b/packages/type-utils/project.json @@ -1,5 +1,15 @@ { - "root": "packages/type-utils", + "name": "type-utils", + "$schema": "../../node_modules/nx/schemas/project-schema.json", "type": "library", - "implicitDependencies": [] + "implicitDependencies": [], + "targets": { + "lint": { + "executor": "@nrwl/linter:eslint", + "outputs": ["{options.outputFile}"], + "options": { + "lintFilePatterns": ["packages/type-utils/**/*.ts"] + } + } + } } diff --git a/packages/type-utils/src/containsAllTypesByName.ts b/packages/type-utils/src/containsAllTypesByName.ts index 798355adb59..07aa20dac04 100644 --- a/packages/type-utils/src/containsAllTypesByName.ts +++ b/packages/type-utils/src/containsAllTypesByName.ts @@ -1,5 +1,6 @@ import { isTypeReference, isUnionOrIntersectionType } from 'tsutils'; import * as ts from 'typescript'; + import { isTypeFlagSet } from './typeFlagUtils'; /** diff --git a/packages/type-utils/src/getConstrainedTypeAtLocation.ts b/packages/type-utils/src/getConstrainedTypeAtLocation.ts index d14b4d4a7bf..50317b00e56 100644 --- a/packages/type-utils/src/getConstrainedTypeAtLocation.ts +++ b/packages/type-utils/src/getConstrainedTypeAtLocation.ts @@ -1,4 +1,4 @@ -import * as ts from 'typescript'; +import type * as ts from 'typescript'; /** * Resolves the given node's type. Will resolve to the type's generic constraint, if it has one. diff --git a/packages/type-utils/src/getContextualType.ts b/packages/type-utils/src/getContextualType.ts index 78bffbc523c..07515628265 100644 --- a/packages/type-utils/src/getContextualType.ts +++ b/packages/type-utils/src/getContextualType.ts @@ -1,13 +1,13 @@ import { + isBinaryExpression, isCallExpression, - isJsxExpression, isIdentifier, + isJsxExpression, isNewExpression, isParameterDeclaration, + isPropertyAssignment, isPropertyDeclaration, isVariableDeclaration, - isPropertyAssignment, - isBinaryExpression, } from 'tsutils'; import * as ts from 'typescript'; diff --git a/packages/type-utils/src/getDeclaration.ts b/packages/type-utils/src/getDeclaration.ts index 6dab23f92cd..d0c6c998d33 100644 --- a/packages/type-utils/src/getDeclaration.ts +++ b/packages/type-utils/src/getDeclaration.ts @@ -1,4 +1,4 @@ -import * as ts from 'typescript'; +import type * as ts from 'typescript'; /** * Gets the declaration for the given variable diff --git a/packages/type-utils/src/getTypeArguments.ts b/packages/type-utils/src/getTypeArguments.ts index 5af50f81d33..04187cea5af 100644 --- a/packages/type-utils/src/getTypeArguments.ts +++ b/packages/type-utils/src/getTypeArguments.ts @@ -1,4 +1,4 @@ -import * as ts from 'typescript'; +import type * as ts from 'typescript'; export function getTypeArguments( type: ts.TypeReference, diff --git a/packages/type-utils/src/index.ts b/packages/type-utils/src/index.ts index 44eb35ec945..dde032e1770 100644 --- a/packages/type-utils/src/index.ts +++ b/packages/type-utils/src/index.ts @@ -12,3 +12,8 @@ export * from './predicates'; export * from './propertyTypes'; export * from './requiresQuoting'; export * from './typeFlagUtils'; +export { + getDecorators, + getModifiers, + typescriptVersionIsAtLeast, +} from '@typescript-eslint/typescript-estree'; diff --git a/packages/type-utils/src/isTypeReadonly.ts b/packages/type-utils/src/isTypeReadonly.ts index 3098df3c435..7ba2b300089 100644 --- a/packages/type-utils/src/isTypeReadonly.ts +++ b/packages/type-utils/src/isTypeReadonly.ts @@ -1,14 +1,15 @@ import { ESLintUtils } from '@typescript-eslint/utils'; import { isConditionalType, + isIntersectionType, isObjectType, - isUnionType, - unionTypeParts, isPropertyReadonlyInType, isSymbolFlagSet, - isIntersectionType, + isUnionType, + unionTypeParts, } from 'tsutils'; import * as ts from 'typescript'; + import { getTypeOfPropertyOfType } from './propertyTypes'; const enum Readonlyness { @@ -112,6 +113,10 @@ function isTypeReadonlyObject( return Readonlyness.Mutable; } + if (indexInfo.type === type || seenTypes.has(indexInfo.type)) { + return Readonlyness.Readonly; + } + return isTypeReadonlyRecurser( checker, indexInfo.type, diff --git a/packages/type-utils/src/isUnsafeAssignment.ts b/packages/type-utils/src/isUnsafeAssignment.ts index ecd236ad37a..15a5e7c50bc 100644 --- a/packages/type-utils/src/isUnsafeAssignment.ts +++ b/packages/type-utils/src/isUnsafeAssignment.ts @@ -1,6 +1,8 @@ -import { TSESTree, AST_NODE_TYPES } from '@typescript-eslint/utils'; +import type { TSESTree } from '@typescript-eslint/utils'; +import { AST_NODE_TYPES } from '@typescript-eslint/utils'; import { isTypeReference } from 'tsutils'; -import * as ts from 'typescript'; +import type * as ts from 'typescript'; + import { isTypeAnyType, isTypeUnknownType } from './predicates'; /** diff --git a/packages/type-utils/src/predicates.ts b/packages/type-utils/src/predicates.ts index 541d236bd7c..72f59e4fc9d 100644 --- a/packages/type-utils/src/predicates.ts +++ b/packages/type-utils/src/predicates.ts @@ -1,6 +1,7 @@ import debug from 'debug'; import { unionTypeParts } from 'tsutils'; import * as ts from 'typescript'; + import { getTypeArguments } from './getTypeArguments'; import { getTypeFlags, isTypeFlagSet } from './typeFlagUtils'; diff --git a/packages/type-utils/src/propertyTypes.ts b/packages/type-utils/src/propertyTypes.ts index 7e064ea0ace..d2f214263fc 100644 --- a/packages/type-utils/src/propertyTypes.ts +++ b/packages/type-utils/src/propertyTypes.ts @@ -1,4 +1,4 @@ -import * as ts from 'typescript'; +import type * as ts from 'typescript'; export function getTypeOfPropertyOfName( checker: ts.TypeChecker, diff --git a/packages/type-utils/tests/isTypeReadonly.test.ts b/packages/type-utils/tests/isTypeReadonly.test.ts index 0cbda39727a..0b171dc12a2 100644 --- a/packages/type-utils/tests/isTypeReadonly.test.ts +++ b/packages/type-utils/tests/isTypeReadonly.test.ts @@ -1,11 +1,12 @@ -import * as ts from 'typescript'; -import { TSESTree } from '@typescript-eslint/utils'; import { parseForESLint } from '@typescript-eslint/parser'; +import type { TSESTree } from '@typescript-eslint/utils'; +import path from 'path'; +import type * as ts from 'typescript'; + import { isTypeReadonly, type ReadonlynessOptions, } from '../src/isTypeReadonly'; -import path from 'path'; describe('isTypeReadonly', () => { const rootDir = path.join(__dirname, 'fixtures'); @@ -133,6 +134,18 @@ describe('isTypeReadonly', () => { ); }); + describe('is readonly circular', () => { + const runTests = runTestIsReadonly; + + it('handles circular readonly PropertySignature inside a readonly IndexSignature', () => + runTests('interface Test { readonly [key: string]: Test };')); + + it('handles circular readonly PropertySignature inside interdependent objects', () => + runTests( + 'interface Test1 { readonly [key: string]: Test } interface Test { readonly [key: string]: Test1 }', + )); + }); + describe('is not readonly', () => { const runTests = runTestIsNotReadonly; @@ -144,6 +157,28 @@ describe('isTypeReadonly', () => { runTests, ); }); + + describe('is not readonly circular', () => { + const runTests = runTestIsNotReadonly; + + it('handles circular mutable PropertySignature', () => + runTests('interface Test { [key: string]: Test };')); + + it.each([ + [ + 'interface Test1 { [key: string]: Test } interface Test { readonly [key: string]: Test1 }', + ], + [ + 'interface Test1 { readonly [key: string]: Test } interface Test { [key: string]: Test1 }', + ], + [ + 'interface Test1 { [key: string]: Test } interface Test { [key: string]: Test1 }', + ], + ])( + 'handles circular mutable PropertySignature inside interdependent objects', + runTests, + ); + }); }); describe('Union', () => { diff --git a/packages/type-utils/tests/isUnsafeAssignment.test.ts b/packages/type-utils/tests/isUnsafeAssignment.test.ts index 6b794705751..e49e25c8655 100644 --- a/packages/type-utils/tests/isUnsafeAssignment.test.ts +++ b/packages/type-utils/tests/isUnsafeAssignment.test.ts @@ -1,8 +1,9 @@ -import * as ts from 'typescript'; -import { TSESTree } from '@typescript-eslint/utils'; import { parseForESLint } from '@typescript-eslint/parser'; -import { isUnsafeAssignment } from '../src/isUnsafeAssignment'; +import type { TSESTree } from '@typescript-eslint/utils'; import path from 'path'; +import type * as ts from 'typescript'; + +import { isUnsafeAssignment } from '../src/isUnsafeAssignment'; describe('isUnsafeAssignment', () => { const rootDir = path.join(__dirname, 'fixtures'); diff --git a/packages/types/CHANGELOG.md b/packages/types/CHANGELOG.md index a349101ec1f..0cd6d24aa09 100644 --- a/packages/types/CHANGELOG.md +++ b/packages/types/CHANGELOG.md @@ -3,7 +3,7 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. -# [5.31.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.7...v5.31.0) (2022-07-25) +# [5.50.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.49.0...v5.50.0) (2023-01-31) **Note:** Version bump only for package @typescript-eslint/types @@ -11,18 +11,15 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline -## [5.30.7](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.6...v5.30.7) (2022-07-18) - - -### Bug Fixes +# [5.49.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.48.2...v5.49.0) (2023-01-23) -* expose types supporting old versions of typescript ([#5339](https://github.com/typescript-eslint/typescript-eslint/issues/5339)) ([4ba9bdb](https://github.com/typescript-eslint/typescript-eslint/commit/4ba9bdb93f87e6bc370f13aa1de48f435abe3f88)) +**Note:** Version bump only for package @typescript-eslint/types -## [5.30.6](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.5...v5.30.6) (2022-07-11) +## [5.48.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.48.1...v5.48.2) (2023-01-16) **Note:** Version bump only for package @typescript-eslint/types @@ -30,7 +27,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline -## [5.30.5](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.4...v5.30.5) (2022-07-04) +## [5.48.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.48.0...v5.48.1) (2023-01-09) **Note:** Version bump only for package @typescript-eslint/types @@ -38,989 +35,654 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline -## [5.30.4](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.3...v5.30.4) (2022-07-03) +# [5.48.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.47.1...v5.48.0) (2023-01-02) **Note:** Version bump only for package @typescript-eslint/types +## [5.47.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.47.0...v5.47.1) (2022-12-26) +**Note:** Version bump only for package @typescript-eslint/types +# [5.47.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.46.1...v5.47.0) (2022-12-19) +**Note:** Version bump only for package @typescript-eslint/types -## [5.30.3](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.2...v5.30.3) (2022-07-01) +## [5.46.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.46.0...v5.46.1) (2022-12-12) **Note:** Version bump only for package @typescript-eslint/types +# [5.46.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.45.1...v5.46.0) (2022-12-08) +**Note:** Version bump only for package @typescript-eslint/types +## [5.45.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.45.0...v5.45.1) (2022-12-05) +**Note:** Version bump only for package @typescript-eslint/types -## [5.30.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.1...v5.30.2) (2022-07-01) +# [5.45.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.44.0...v5.45.0) (2022-11-28) **Note:** Version bump only for package @typescript-eslint/types +# [5.44.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.43.0...v5.44.0) (2022-11-21) +### Features +- update to TypeScript 4.9 ([#5716](https://github.com/typescript-eslint/typescript-eslint/issues/5716)) ([4d744ea](https://github.com/typescript-eslint/typescript-eslint/commit/4d744ea10ba03c66eebcb63e8722e9f0165fbeed)) - -## 5.30.1 (2022-07-01) +# [5.43.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.42.1...v5.43.0) (2022-11-14) **Note:** Version bump only for package @typescript-eslint/types +## [5.42.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.42.0...v5.42.1) (2022-11-07) +**Note:** Version bump only for package @typescript-eslint/types +# [5.42.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.41.0...v5.42.0) (2022-10-31) +**Note:** Version bump only for package @typescript-eslint/types -# [5.30.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.29.0...v5.30.0) (2022-06-27) +# [5.41.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.40.1...v5.41.0) (2022-10-24) **Note:** Version bump only for package @typescript-eslint/types +## [5.40.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.40.0...v5.40.1) (2022-10-17) +**Note:** Version bump only for package @typescript-eslint/types - - -# [5.29.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.28.0...v5.29.0) (2022-06-20) +# [5.40.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.39.0...v5.40.0) (2022-10-10) **Note:** Version bump only for package @typescript-eslint/types +# [5.39.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.38.1...v5.39.0) (2022-10-03) +**Note:** Version bump only for package @typescript-eslint/types +## [5.38.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.38.0...v5.38.1) (2022-09-26) +**Note:** Version bump only for package @typescript-eslint/types -# [5.28.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.27.1...v5.28.0) (2022-06-13) +# [5.38.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.37.0...v5.38.0) (2022-09-19) **Note:** Version bump only for package @typescript-eslint/types +# [5.37.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.36.2...v5.37.0) (2022-09-12) +**Note:** Version bump only for package @typescript-eslint/types +## [5.36.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.36.1...v5.36.2) (2022-09-05) +**Note:** Version bump only for package @typescript-eslint/types -## [5.27.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.27.0...v5.27.1) (2022-06-06) +## [5.36.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.36.0...v5.36.1) (2022-08-30) **Note:** Version bump only for package @typescript-eslint/types +# [5.36.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.35.1...v5.36.0) (2022-08-30) +### Features +- support TypeScript 4.8 ([#5551](https://github.com/typescript-eslint/typescript-eslint/issues/5551)) ([81450ed](https://github.com/typescript-eslint/typescript-eslint/commit/81450ed7eaede74b384e9a91a84e9b4d34513866)) +## [5.35.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.35.0...v5.35.1) (2022-08-24) -# [5.27.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.26.0...v5.27.0) (2022-05-30) - +**Note:** Version bump only for package @typescript-eslint/types -### Bug Fixes +# [5.35.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.34.0...v5.35.0) (2022-08-24) -* **types:** remove leftovers from removal of useJSXTextNode ([#5091](https://github.com/typescript-eslint/typescript-eslint/issues/5091)) ([f9c3647](https://github.com/typescript-eslint/typescript-eslint/commit/f9c3647cb637c8d1ee461b471da9d817ccbde77c)) +**Note:** Version bump only for package @typescript-eslint/types +# [5.34.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.33.1...v5.34.0) (2022-08-22) ### Features -* [4.7] support new extensions ([#5027](https://github.com/typescript-eslint/typescript-eslint/issues/5027)) ([efc147b](https://github.com/typescript-eslint/typescript-eslint/commit/efc147b04dce52ab17415b6a4ae4076b944b9036)) +- **types:** add unbound property in parser options ([#5419](https://github.com/typescript-eslint/typescript-eslint/issues/5419)) ([e08a9dd](https://github.com/typescript-eslint/typescript-eslint/commit/e08a9dd79365c1b1f5d0145ab69377f7d45f8a4f)) +## [5.33.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.33.0...v5.33.1) (2022-08-15) +**Note:** Version bump only for package @typescript-eslint/types +# [5.33.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.32.0...v5.33.0) (2022-08-08) +**Note:** Version bump only for package @typescript-eslint/types -# [5.26.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.25.0...v5.26.0) (2022-05-23) +# [5.32.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.31.0...v5.32.0) (2022-08-01) **Note:** Version bump only for package @typescript-eslint/types +# [5.31.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.7...v5.31.0) (2022-07-25) +**Note:** Version bump only for package @typescript-eslint/types +## [5.30.7](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.6...v5.30.7) (2022-07-18) +### Bug Fixes -# [5.25.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.24.0...v5.25.0) (2022-05-17) - +- expose types supporting old versions of typescript ([#5339](https://github.com/typescript-eslint/typescript-eslint/issues/5339)) ([4ba9bdb](https://github.com/typescript-eslint/typescript-eslint/commit/4ba9bdb93f87e6bc370f13aa1de48f435abe3f88)) -### Features +## [5.30.6](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.5...v5.30.6) (2022-07-11) -* update to TypeScript 4.7-rc ([#4829](https://github.com/typescript-eslint/typescript-eslint/issues/4829)) ([6fe783c](https://github.com/typescript-eslint/typescript-eslint/commit/6fe783c20aebe26ef42b526e4a59a9be84dd5643)) +**Note:** Version bump only for package @typescript-eslint/types +## [5.30.5](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.4...v5.30.5) (2022-07-04) +**Note:** Version bump only for package @typescript-eslint/types +## [5.30.4](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.3...v5.30.4) (2022-07-03) +**Note:** Version bump only for package @typescript-eslint/types -# [5.24.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.23.0...v5.24.0) (2022-05-16) +## [5.30.3](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.2...v5.30.3) (2022-07-01) **Note:** Version bump only for package @typescript-eslint/types +## [5.30.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.1...v5.30.2) (2022-07-01) +**Note:** Version bump only for package @typescript-eslint/types +## 5.30.1 (2022-07-01) +**Note:** Version bump only for package @typescript-eslint/types -# [5.23.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.22.0...v5.23.0) (2022-05-09) +# [5.30.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.29.0...v5.30.0) (2022-06-27) **Note:** Version bump only for package @typescript-eslint/types +# [5.29.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.28.0...v5.29.0) (2022-06-20) +**Note:** Version bump only for package @typescript-eslint/types +# [5.28.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.27.1...v5.28.0) (2022-06-13) +**Note:** Version bump only for package @typescript-eslint/types -# [5.22.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.21.0...v5.22.0) (2022-05-02) - +## [5.27.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.27.0...v5.27.1) (2022-06-06) -### Features +**Note:** Version bump only for package @typescript-eslint/types -* **ast-spec:** add fixture test framework and some initial fixtures ([#3258](https://github.com/typescript-eslint/typescript-eslint/issues/3258)) ([f3cf87b](https://github.com/typescript-eslint/typescript-eslint/commit/f3cf87bf20fd0542f92a96a318aa9ee5bf23c1f6)) +# [5.27.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.26.0...v5.27.0) (2022-05-30) +### Bug Fixes +- **types:** remove leftovers from removal of useJSXTextNode ([#5091](https://github.com/typescript-eslint/typescript-eslint/issues/5091)) ([f9c3647](https://github.com/typescript-eslint/typescript-eslint/commit/f9c3647cb637c8d1ee461b471da9d817ccbde77c)) +### Features +- [4.7] support new extensions ([#5027](https://github.com/typescript-eslint/typescript-eslint/issues/5027)) ([efc147b](https://github.com/typescript-eslint/typescript-eslint/commit/efc147b04dce52ab17415b6a4ae4076b944b9036)) -# [5.21.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.20.0...v5.21.0) (2022-04-25) +# [5.26.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.25.0...v5.26.0) (2022-05-23) **Note:** Version bump only for package @typescript-eslint/types +# [5.25.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.24.0...v5.25.0) (2022-05-17) +### Features +- update to TypeScript 4.7-rc ([#4829](https://github.com/typescript-eslint/typescript-eslint/issues/4829)) ([6fe783c](https://github.com/typescript-eslint/typescript-eslint/commit/6fe783c20aebe26ef42b526e4a59a9be84dd5643)) - -# [5.20.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.19.0...v5.20.0) (2022-04-18) +# [5.24.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.23.0...v5.24.0) (2022-05-16) **Note:** Version bump only for package @typescript-eslint/types +# [5.23.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.22.0...v5.23.0) (2022-05-09) +**Note:** Version bump only for package @typescript-eslint/types +# [5.22.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.21.0...v5.22.0) (2022-05-02) +### Features -# [5.19.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.18.0...v5.19.0) (2022-04-11) +- **ast-spec:** add fixture test framework and some initial fixtures ([#3258](https://github.com/typescript-eslint/typescript-eslint/issues/3258)) ([f3cf87b](https://github.com/typescript-eslint/typescript-eslint/commit/f3cf87bf20fd0542f92a96a318aa9ee5bf23c1f6)) + +# [5.21.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.20.0...v5.21.0) (2022-04-25) **Note:** Version bump only for package @typescript-eslint/types +# [5.20.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.19.0...v5.20.0) (2022-04-18) +**Note:** Version bump only for package @typescript-eslint/types +# [5.19.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.18.0...v5.19.0) (2022-04-11) +**Note:** Version bump only for package @typescript-eslint/types # [5.18.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.17.0...v5.18.0) (2022-04-04) **Note:** Version bump only for package @typescript-eslint/types - - - - # [5.17.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.16.0...v5.17.0) (2022-03-28) **Note:** Version bump only for package @typescript-eslint/types - - - - # [5.16.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.15.0...v5.16.0) (2022-03-21) **Note:** Version bump only for package @typescript-eslint/types - - - - # [5.15.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.14.0...v5.15.0) (2022-03-14) - ### Features -* **parser:** add `parserOptions.emitDecoratorMetadata` ([#4646](https://github.com/typescript-eslint/typescript-eslint/issues/4646)) ([e3dd343](https://github.com/typescript-eslint/typescript-eslint/commit/e3dd343e51e3b7772e825a609735a04c921c1ec5)) - - - - +- **parser:** add `parserOptions.emitDecoratorMetadata` ([#4646](https://github.com/typescript-eslint/typescript-eslint/issues/4646)) ([e3dd343](https://github.com/typescript-eslint/typescript-eslint/commit/e3dd343e51e3b7772e825a609735a04c921c1ec5)) # [5.14.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.13.0...v5.14.0) (2022-03-07) - ### Features -* TypeScript 4.6 ([#4615](https://github.com/typescript-eslint/typescript-eslint/issues/4615)) ([a02c63a](https://github.com/typescript-eslint/typescript-eslint/commit/a02c63a264e5a6c3557468a8eff48d34ca2b718a)) - - - - +- TypeScript 4.6 ([#4615](https://github.com/typescript-eslint/typescript-eslint/issues/4615)) ([a02c63a](https://github.com/typescript-eslint/typescript-eslint/commit/a02c63a264e5a6c3557468a8eff48d34ca2b718a)) # [5.13.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.12.1...v5.13.0) (2022-02-28) **Note:** Version bump only for package @typescript-eslint/types - - - - ## [5.12.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.12.0...v5.12.1) (2022-02-21) **Note:** Version bump only for package @typescript-eslint/types - - - - # [5.12.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.11.0...v5.12.0) (2022-02-14) **Note:** Version bump only for package @typescript-eslint/types - - - - # [5.11.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.10.2...v5.11.0) (2022-02-07) **Note:** Version bump only for package @typescript-eslint/types - - - - ## [5.10.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.10.1...v5.10.2) (2022-01-31) **Note:** Version bump only for package @typescript-eslint/types - - - - ## [5.10.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.10.0...v5.10.1) (2022-01-24) **Note:** Version bump only for package @typescript-eslint/types - - - - # [5.10.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.9.1...v5.10.0) (2022-01-17) - ### Features -* rename `experimental-utils` to `utils` and make `experimental-utils` an alias to the new package ([#4172](https://github.com/typescript-eslint/typescript-eslint/issues/4172)) ([1d55a75](https://github.com/typescript-eslint/typescript-eslint/commit/1d55a7511b38d8e2b2eabe59f639e0a865e6c93f)) - - - - +- rename `experimental-utils` to `utils` and make `experimental-utils` an alias to the new package ([#4172](https://github.com/typescript-eslint/typescript-eslint/issues/4172)) ([1d55a75](https://github.com/typescript-eslint/typescript-eslint/commit/1d55a7511b38d8e2b2eabe59f639e0a865e6c93f)) ## [5.9.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.9.0...v5.9.1) (2022-01-10) **Note:** Version bump only for package @typescript-eslint/types - - - - # [5.9.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.8.1...v5.9.0) (2022-01-03) **Note:** Version bump only for package @typescript-eslint/types - - - - ## [5.8.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.8.0...v5.8.1) (2021-12-27) **Note:** Version bump only for package @typescript-eslint/types - - - - # [5.8.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.7.0...v5.8.0) (2021-12-20) **Note:** Version bump only for package @typescript-eslint/types - - - - # [5.7.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.6.0...v5.7.0) (2021-12-13) **Note:** Version bump only for package @typescript-eslint/types - - - - # [5.6.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.5.0...v5.6.0) (2021-12-06) - ### Features -* **scope-manager:** update lib types ([#4240](https://github.com/typescript-eslint/typescript-eslint/issues/4240)) ([8377e6e](https://github.com/typescript-eslint/typescript-eslint/commit/8377e6ea422ee2d52455da8955ff055e09c238d3)) - - - - +- **scope-manager:** update lib types ([#4240](https://github.com/typescript-eslint/typescript-eslint/issues/4240)) ([8377e6e](https://github.com/typescript-eslint/typescript-eslint/commit/8377e6ea422ee2d52455da8955ff055e09c238d3)) # [5.5.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.4.0...v5.5.0) (2021-11-29) **Note:** Version bump only for package @typescript-eslint/types - - - - # [5.4.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.3.1...v5.4.0) (2021-11-15) **Note:** Version bump only for package @typescript-eslint/types - - - - ## [5.3.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.3.0...v5.3.1) (2021-11-08) **Note:** Version bump only for package @typescript-eslint/types - - - - # [5.3.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.2.0...v5.3.0) (2021-11-01) **Note:** Version bump only for package @typescript-eslint/types - - - - # [5.2.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.1.0...v5.2.0) (2021-10-25) **Note:** Version bump only for package @typescript-eslint/types - - - - # [5.1.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.0.0...v5.1.0) (2021-10-18) **Note:** Version bump only for package @typescript-eslint/types - - - - # [5.0.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.33.0...v5.0.0) (2021-10-11) - ### Features -* support `PrivateIdentifier` ([#3808](https://github.com/typescript-eslint/typescript-eslint/issues/3808)) ([0eefe5e](https://github.com/typescript-eslint/typescript-eslint/commit/0eefe5e49d21af3f1e3e2d9a90c2e49929863ac2)), closes [#3430](https://github.com/typescript-eslint/typescript-eslint/issues/3430) [#2933](https://github.com/typescript-eslint/typescript-eslint/issues/2933) - - - - +- support `PrivateIdentifier` ([#3808](https://github.com/typescript-eslint/typescript-eslint/issues/3808)) ([0eefe5e](https://github.com/typescript-eslint/typescript-eslint/commit/0eefe5e49d21af3f1e3e2d9a90c2e49929863ac2)), closes [#3430](https://github.com/typescript-eslint/typescript-eslint/issues/3430) [#2933](https://github.com/typescript-eslint/typescript-eslint/issues/2933) # [4.33.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.32.0...v4.33.0) (2021-10-04) **Note:** Version bump only for package @typescript-eslint/types - - - - # [4.32.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.31.2...v4.32.0) (2021-09-27) - ### Features -* Support `'latest'` as `ecmaVersion` ([#3873](https://github.com/typescript-eslint/typescript-eslint/issues/3873)) ([25a42c0](https://github.com/typescript-eslint/typescript-eslint/commit/25a42c0bbe92d1ecbc2e8ff9ef3a3ef413f728b0)) - - - - +- Support `'latest'` as `ecmaVersion` ([#3873](https://github.com/typescript-eslint/typescript-eslint/issues/3873)) ([25a42c0](https://github.com/typescript-eslint/typescript-eslint/commit/25a42c0bbe92d1ecbc2e8ff9ef3a3ef413f728b0)) ## [4.31.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.31.1...v4.31.2) (2021-09-20) **Note:** Version bump only for package @typescript-eslint/types - - - - ## [4.31.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.31.0...v4.31.1) (2021-09-13) **Note:** Version bump only for package @typescript-eslint/types - - - - # [4.31.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.30.0...v4.31.0) (2021-09-06) **Note:** Version bump only for package @typescript-eslint/types - - - - # [4.30.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.29.3...v4.30.0) (2021-08-30) **Note:** Version bump only for package @typescript-eslint/types - - - - ## [4.29.3](https://github.com/typescript-eslint/typescript-eslint/compare/v4.29.2...v4.29.3) (2021-08-23) **Note:** Version bump only for package @typescript-eslint/types - - - - ## [4.29.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.29.1...v4.29.2) (2021-08-16) **Note:** Version bump only for package @typescript-eslint/types - - - - ## [4.29.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.29.0...v4.29.1) (2021-08-09) **Note:** Version bump only for package @typescript-eslint/types - - - - # [4.29.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.5...v4.29.0) (2021-08-02) - ### Features -* **eslint-plugin:** Catch unused React import with new JSX transform ([#3577](https://github.com/typescript-eslint/typescript-eslint/issues/3577)) ([02998ea](https://github.com/typescript-eslint/typescript-eslint/commit/02998eac510665758b9a093d43afc310f3ac980d)) -* **typescript-estree:** add support for custom module resolution ([#3516](https://github.com/typescript-eslint/typescript-eslint/issues/3516)) ([d48429d](https://github.com/typescript-eslint/typescript-eslint/commit/d48429d97326545bb727f88ce9056270b1599a31)) - - - - +- **eslint-plugin:** Catch unused React import with new JSX transform ([#3577](https://github.com/typescript-eslint/typescript-eslint/issues/3577)) ([02998ea](https://github.com/typescript-eslint/typescript-eslint/commit/02998eac510665758b9a093d43afc310f3ac980d)) +- **typescript-estree:** add support for custom module resolution ([#3516](https://github.com/typescript-eslint/typescript-eslint/issues/3516)) ([d48429d](https://github.com/typescript-eslint/typescript-eslint/commit/d48429d97326545bb727f88ce9056270b1599a31)) ## [4.28.5](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.4...v4.28.5) (2021-07-26) **Note:** Version bump only for package @typescript-eslint/types - - - - ## [4.28.4](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.3...v4.28.4) (2021-07-19) **Note:** Version bump only for package @typescript-eslint/types - - - - ## [4.28.3](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.2...v4.28.3) (2021-07-12) **Note:** Version bump only for package @typescript-eslint/types - - - - ## [4.28.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.1...v4.28.2) (2021-07-05) **Note:** Version bump only for package @typescript-eslint/types - - - - ## [4.28.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.0...v4.28.1) (2021-06-28) **Note:** Version bump only for package @typescript-eslint/types - - - - # [4.28.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.27.0...v4.28.0) (2021-06-21) **Note:** Version bump only for package @typescript-eslint/types - - - - # [4.27.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.26.1...v4.27.0) (2021-06-14) - ### Features -* allow user to provide TS program instance in parser options ([#3484](https://github.com/typescript-eslint/typescript-eslint/issues/3484)) ([e855b18](https://github.com/typescript-eslint/typescript-eslint/commit/e855b18b8feee0edb5c617c11006861426a6f530)) - - - - +- allow user to provide TS program instance in parser options ([#3484](https://github.com/typescript-eslint/typescript-eslint/issues/3484)) ([e855b18](https://github.com/typescript-eslint/typescript-eslint/commit/e855b18b8feee0edb5c617c11006861426a6f530)) ## [4.26.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.26.0...v4.26.1) (2021-06-07) **Note:** Version bump only for package @typescript-eslint/types - - - - # [4.26.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.25.0...v4.26.0) (2021-05-31) - ### Bug Fixes -* generate library types for TypeScript v4.3 ([#3460](https://github.com/typescript-eslint/typescript-eslint/issues/3460)) ([ed4776a](https://github.com/typescript-eslint/typescript-eslint/commit/ed4776afa1374279027b9b7d82aa4b453b334998)), closes [#3449](https://github.com/typescript-eslint/typescript-eslint/issues/3449) - - - - +- generate library types for TypeScript v4.3 ([#3460](https://github.com/typescript-eslint/typescript-eslint/issues/3460)) ([ed4776a](https://github.com/typescript-eslint/typescript-eslint/commit/ed4776afa1374279027b9b7d82aa4b453b334998)), closes [#3449](https://github.com/typescript-eslint/typescript-eslint/issues/3449) # [4.25.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.24.0...v4.25.0) (2021-05-24) **Note:** Version bump only for package @typescript-eslint/types - - - - # [4.24.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.23.0...v4.24.0) (2021-05-17) **Note:** Version bump only for package @typescript-eslint/types - - - - # [4.23.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.22.1...v4.23.0) (2021-05-10) - ### Features -* refactor to split AST specification out as its own module ([#2911](https://github.com/typescript-eslint/typescript-eslint/issues/2911)) ([25ea953](https://github.com/typescript-eslint/typescript-eslint/commit/25ea953cc60b118bd385c71e0a9b61c286c26fcf)) - - - - +- refactor to split AST specification out as its own module ([#2911](https://github.com/typescript-eslint/typescript-eslint/issues/2911)) ([25ea953](https://github.com/typescript-eslint/typescript-eslint/commit/25ea953cc60b118bd385c71e0a9b61c286c26fcf)) ## [4.22.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.22.0...v4.22.1) (2021-05-04) **Note:** Version bump only for package @typescript-eslint/types - - - - # [4.22.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.21.0...v4.22.0) (2021-04-12) **Note:** Version bump only for package @typescript-eslint/types - - - - # [4.21.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.20.0...v4.21.0) (2021-04-05) **Note:** Version bump only for package @typescript-eslint/types - - - - # [4.20.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.19.0...v4.20.0) (2021-03-29) **Note:** Version bump only for package @typescript-eslint/types - - - - # [4.19.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.18.0...v4.19.0) (2021-03-22) - ### Bug Fixes -* **typescript-estree:** [ts 4.2] add support for import type equal declaration ([#3189](https://github.com/typescript-eslint/typescript-eslint/issues/3189)) ([6a25faf](https://github.com/typescript-eslint/typescript-eslint/commit/6a25faf5cfa4d21a7546d9866819f4e017308fb2)) - - - - +- **typescript-estree:** [ts 4.2] add support for import type equal declaration ([#3189](https://github.com/typescript-eslint/typescript-eslint/issues/3189)) ([6a25faf](https://github.com/typescript-eslint/typescript-eslint/commit/6a25faf5cfa4d21a7546d9866819f4e017308fb2)) # [4.18.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.17.0...v4.18.0) (2021-03-15) **Note:** Version bump only for package @typescript-eslint/types - - - - # [4.17.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.16.1...v4.17.0) (2021-03-08) **Note:** Version bump only for package @typescript-eslint/types - - - - ## [4.16.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.16.0...v4.16.1) (2021-03-01) **Note:** Version bump only for package @typescript-eslint/types - - - - # [4.16.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.15.2...v4.16.0) (2021-03-01) - ### Features -* TypeScript 4.2 syntax support ([#3112](https://github.com/typescript-eslint/typescript-eslint/issues/3112)) ([2ebfb21](https://github.com/typescript-eslint/typescript-eslint/commit/2ebfb21ba6c88c793cfbd0e231e5803b2381694c)) - - - - +- TypeScript 4.2 syntax support ([#3112](https://github.com/typescript-eslint/typescript-eslint/issues/3112)) ([2ebfb21](https://github.com/typescript-eslint/typescript-eslint/commit/2ebfb21ba6c88c793cfbd0e231e5803b2381694c)) ## [4.15.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.15.1...v4.15.2) (2021-02-22) - ### Bug Fixes -* **typescript-estree:** correct issues in AST definition ([#3083](https://github.com/typescript-eslint/typescript-eslint/issues/3083)) ([509a117](https://github.com/typescript-eslint/typescript-eslint/commit/509a11749f85400a01e9fecfecd12871ce562d3d)) -* add missing intrinsic keyword node to AST ([#3081](https://github.com/typescript-eslint/typescript-eslint/issues/3081)) ([409bf0b](https://github.com/typescript-eslint/typescript-eslint/commit/409bf0bb3e2ac4d8782408d436ebdefb42dba38b)) - - - - +- **typescript-estree:** correct issues in AST definition ([#3083](https://github.com/typescript-eslint/typescript-eslint/issues/3083)) ([509a117](https://github.com/typescript-eslint/typescript-eslint/commit/509a11749f85400a01e9fecfecd12871ce562d3d)) +- add missing intrinsic keyword node to AST ([#3081](https://github.com/typescript-eslint/typescript-eslint/issues/3081)) ([409bf0b](https://github.com/typescript-eslint/typescript-eslint/commit/409bf0bb3e2ac4d8782408d436ebdefb42dba38b)) ## [4.15.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.15.0...v4.15.1) (2021-02-15) **Note:** Version bump only for package @typescript-eslint/types - - - - # [4.15.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.14.2...v4.15.0) (2021-02-08) **Note:** Version bump only for package @typescript-eslint/types - - - - ## [4.14.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.14.1...v4.14.2) (2021-02-01) **Note:** Version bump only for package @typescript-eslint/types - - - - ## [4.14.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.14.0...v4.14.1) (2021-01-25) **Note:** Version bump only for package @typescript-eslint/types - - - - # [4.14.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.13.0...v4.14.0) (2021-01-18) **Note:** Version bump only for package @typescript-eslint/types - - - - # [4.13.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.12.0...v4.13.0) (2021-01-11) **Note:** Version bump only for package @typescript-eslint/types - - - - # [4.12.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.11.1...v4.12.0) (2021-01-04) **Note:** Version bump only for package @typescript-eslint/types - - - - ## [4.11.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.11.0...v4.11.1) (2020-12-28) **Note:** Version bump only for package @typescript-eslint/types - - - - # [4.11.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.10.0...v4.11.0) (2020-12-21) **Note:** Version bump only for package @typescript-eslint/types - - - - # [4.10.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.9.1...v4.10.0) (2020-12-14) **Note:** Version bump only for package @typescript-eslint/types - - - - ## [4.9.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.9.0...v4.9.1) (2020-12-07) **Note:** Version bump only for package @typescript-eslint/types - - - - # [4.9.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.8.2...v4.9.0) (2020-11-30) - ### Features -* **eslint-plugin:** [no-unused-vars] fork the base rule ([#2768](https://github.com/typescript-eslint/typescript-eslint/issues/2768)) ([a8227a6](https://github.com/typescript-eslint/typescript-eslint/commit/a8227a6185dd24de4bfc7d766931643871155021)), closes [#2782](https://github.com/typescript-eslint/typescript-eslint/issues/2782) [#2714](https://github.com/typescript-eslint/typescript-eslint/issues/2714) [#2648](https://github.com/typescript-eslint/typescript-eslint/issues/2648) - - - - +- **eslint-plugin:** [no-unused-vars] fork the base rule ([#2768](https://github.com/typescript-eslint/typescript-eslint/issues/2768)) ([a8227a6](https://github.com/typescript-eslint/typescript-eslint/commit/a8227a6185dd24de4bfc7d766931643871155021)), closes [#2782](https://github.com/typescript-eslint/typescript-eslint/issues/2782) [#2714](https://github.com/typescript-eslint/typescript-eslint/issues/2714) [#2648](https://github.com/typescript-eslint/typescript-eslint/issues/2648) ## [4.8.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.8.1...v4.8.2) (2020-11-23) **Note:** Version bump only for package @typescript-eslint/types - - - - ## [4.8.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.8.0...v4.8.1) (2020-11-17) **Note:** Version bump only for package @typescript-eslint/types - - - - # [4.8.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.7.0...v4.8.0) (2020-11-16) **Note:** Version bump only for package @typescript-eslint/types - - - - # [4.7.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.6.1...v4.7.0) (2020-11-09) - ### Features -* support TS4.1 features ([#2748](https://github.com/typescript-eslint/typescript-eslint/issues/2748)) ([2be354b](https://github.com/typescript-eslint/typescript-eslint/commit/2be354bb15f9013a2da1b13a0c0836e9ef057e16)), closes [#2583](https://github.com/typescript-eslint/typescript-eslint/issues/2583) - - - - +- support TS4.1 features ([#2748](https://github.com/typescript-eslint/typescript-eslint/issues/2748)) ([2be354b](https://github.com/typescript-eslint/typescript-eslint/commit/2be354bb15f9013a2da1b13a0c0836e9ef057e16)), closes [#2583](https://github.com/typescript-eslint/typescript-eslint/issues/2583) ## [4.6.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.6.0...v4.6.1) (2020-11-02) **Note:** Version bump only for package @typescript-eslint/types - - - - # [4.6.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.5.0...v4.6.0) (2020-10-26) **Note:** Version bump only for package @typescript-eslint/types - - - - # [4.5.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.4.1...v4.5.0) (2020-10-19) - ### Features -* **typescript-estree:** add flag EXPERIMENTAL_useSourceOfProjectReferenceRedirect ([#2669](https://github.com/typescript-eslint/typescript-eslint/issues/2669)) ([90a5878](https://github.com/typescript-eslint/typescript-eslint/commit/90a587845088da1b205e4d7d77dbc3f9447b1c5a)) - - - - +- **typescript-estree:** add flag EXPERIMENTAL_useSourceOfProjectReferenceRedirect ([#2669](https://github.com/typescript-eslint/typescript-eslint/issues/2669)) ([90a5878](https://github.com/typescript-eslint/typescript-eslint/commit/90a587845088da1b205e4d7d77dbc3f9447b1c5a)) ## [4.4.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.4.0...v4.4.1) (2020-10-12) **Note:** Version bump only for package @typescript-eslint/types - - - - # [4.4.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.3.0...v4.4.0) (2020-10-05) **Note:** Version bump only for package @typescript-eslint/types - - - - # [4.3.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.2.0...v4.3.0) (2020-09-28) **Note:** Version bump only for package @typescript-eslint/types - - - - # [4.2.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.1.1...v4.2.0) (2020-09-21) **Note:** Version bump only for package @typescript-eslint/types - - - - ## [4.1.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.1.0...v4.1.1) (2020-09-14) - ### Bug Fixes -* **types:** artificial fix needed to trigger release ([b577daf](https://github.com/typescript-eslint/typescript-eslint/commit/b577daf27cd87870b6e095e4e995519f96d321dd)) - - - - +- **types:** artificial fix needed to trigger release ([b577daf](https://github.com/typescript-eslint/typescript-eslint/commit/b577daf27cd87870b6e095e4e995519f96d321dd)) # [4.1.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.0.1...v4.1.0) (2020-09-07) - ### Bug Fixes -* **eslint-plugin:** [no-unused-vars] correct detection of unused vars in a declared module with `export =` ([#2505](https://github.com/typescript-eslint/typescript-eslint/issues/2505)) ([3d07a99](https://github.com/typescript-eslint/typescript-eslint/commit/3d07a99faa0a5fc1b44acdb43ddbfc90a5105833)) - +- **eslint-plugin:** [no-unused-vars] correct detection of unused vars in a declared module with `export =` ([#2505](https://github.com/typescript-eslint/typescript-eslint/issues/2505)) ([3d07a99](https://github.com/typescript-eslint/typescript-eslint/commit/3d07a99faa0a5fc1b44acdb43ddbfc90a5105833)) ### Features -* **scope-manager:** add support for JSX scope analysis ([#2498](https://github.com/typescript-eslint/typescript-eslint/issues/2498)) ([f887ab5](https://github.com/typescript-eslint/typescript-eslint/commit/f887ab51f58c1b3571f9a14832864bc0ca59623f)), closes [#2455](https://github.com/typescript-eslint/typescript-eslint/issues/2455) [#2477](https://github.com/typescript-eslint/typescript-eslint/issues/2477) - - - - +- **scope-manager:** add support for JSX scope analysis ([#2498](https://github.com/typescript-eslint/typescript-eslint/issues/2498)) ([f887ab5](https://github.com/typescript-eslint/typescript-eslint/commit/f887ab51f58c1b3571f9a14832864bc0ca59623f)), closes [#2455](https://github.com/typescript-eslint/typescript-eslint/issues/2455) [#2477](https://github.com/typescript-eslint/typescript-eslint/issues/2477) ## [4.0.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.0.0...v4.0.1) (2020-08-31) **Note:** Version bump only for package @typescript-eslint/types - - - - # [4.0.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.10.1...v4.0.0) (2020-08-31) ## [Please see the release notes for v4.0.0](https://github.com/typescript-eslint/typescript-eslint/releases/tag/v4.0.0) ### Bug Fixes -* correct decorator traversal for AssignmentPattern ([#2375](https://github.com/typescript-eslint/typescript-eslint/issues/2375)) ([d738fa4](https://github.com/typescript-eslint/typescript-eslint/commit/d738fa4eff0a5c4cfc9b30b1c0502f8d1e78d7b6)) -* **typescript-estree:** correct ChainExpression interaction with parentheses and non-nulls ([#2380](https://github.com/typescript-eslint/typescript-eslint/issues/2380)) ([762bc99](https://github.com/typescript-eslint/typescript-eslint/commit/762bc99584ede4d0b8099a743991e957aec86aa8)) - +- correct decorator traversal for AssignmentPattern ([#2375](https://github.com/typescript-eslint/typescript-eslint/issues/2375)) ([d738fa4](https://github.com/typescript-eslint/typescript-eslint/commit/d738fa4eff0a5c4cfc9b30b1c0502f8d1e78d7b6)) +- **typescript-estree:** correct ChainExpression interaction with parentheses and non-nulls ([#2380](https://github.com/typescript-eslint/typescript-eslint/issues/2380)) ([762bc99](https://github.com/typescript-eslint/typescript-eslint/commit/762bc99584ede4d0b8099a743991e957aec86aa8)) ### Features -* consume new scope analysis package ([#2039](https://github.com/typescript-eslint/typescript-eslint/issues/2039)) ([3be125d](https://github.com/typescript-eslint/typescript-eslint/commit/3be125d9bdbee1984ac6037874edf619213bd3d0)) -* support ESTree optional chaining representation ([#2308](https://github.com/typescript-eslint/typescript-eslint/issues/2308)) ([e9d2ab6](https://github.com/typescript-eslint/typescript-eslint/commit/e9d2ab638b6767700b52797e74b814ea059beaae)) - +- consume new scope analysis package ([#2039](https://github.com/typescript-eslint/typescript-eslint/issues/2039)) ([3be125d](https://github.com/typescript-eslint/typescript-eslint/commit/3be125d9bdbee1984ac6037874edf619213bd3d0)) +- support ESTree optional chaining representation ([#2308](https://github.com/typescript-eslint/typescript-eslint/issues/2308)) ([e9d2ab6](https://github.com/typescript-eslint/typescript-eslint/commit/e9d2ab638b6767700b52797e74b814ea059beaae)) ### BREAKING CHANGES -* - Removed decorators property from several Nodes that could never semantically have them (FunctionDeclaration, TSEnumDeclaration, and TSInterfaceDeclaration) -- Removed AST_NODE_TYPES.Import. This is a minor breaking change as the node type that used this was removed ages ago. - - - +- - Removed decorators property from several Nodes that could never semantically have them (FunctionDeclaration, TSEnumDeclaration, and TSInterfaceDeclaration) +* Removed AST_NODE_TYPES.Import. This is a minor breaking change as the node type that used this was removed ages ago. ## [3.10.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.10.0...v3.10.1) (2020-08-25) **Note:** Version bump only for package @typescript-eslint/types - - - - # [3.10.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.9.1...v3.10.0) (2020-08-24) **Note:** Version bump only for package @typescript-eslint/types - - - - ## [3.9.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.9.0...v3.9.1) (2020-08-17) **Note:** Version bump only for package @typescript-eslint/types - - - - # [3.9.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.8.0...v3.9.0) (2020-08-10) - ### Features -* **typescript-estree:** support TSv4 labelled tuple members ([#2378](https://github.com/typescript-eslint/typescript-eslint/issues/2378)) ([00d84ff](https://github.com/typescript-eslint/typescript-eslint/commit/00d84ffbcbe9d0ec98bdb2f2ce59959a27ce4dbe)) - - - - +- **typescript-estree:** support TSv4 labelled tuple members ([#2378](https://github.com/typescript-eslint/typescript-eslint/issues/2378)) ([00d84ff](https://github.com/typescript-eslint/typescript-eslint/commit/00d84ffbcbe9d0ec98bdb2f2ce59959a27ce4dbe)) # [3.8.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.7.1...v3.8.0) (2020-08-03) **Note:** Version bump only for package @typescript-eslint/types - - - - ## [3.7.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.7.0...v3.7.1) (2020-07-27) **Note:** Version bump only for package @typescript-eslint/types - - - - # [3.7.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.6.1...v3.7.0) (2020-07-20) - ### Features -* **eslint-plugin:** [no-empty-function] add `decoratedFunctions` option ([#2295](https://github.com/typescript-eslint/typescript-eslint/issues/2295)) ([88f08f4](https://github.com/typescript-eslint/typescript-eslint/commit/88f08f410760f58fdc2de58ecd9dab9610821642)) -* **typescript-estree:** support short-circuiting assignment operators ([#2307](https://github.com/typescript-eslint/typescript-eslint/issues/2307)) ([2c90d9f](https://github.com/typescript-eslint/typescript-eslint/commit/2c90d9fa3aa5ebd7db697dddb7762bca2dd0e06b)) - - - - +- **eslint-plugin:** [no-empty-function] add `decoratedFunctions` option ([#2295](https://github.com/typescript-eslint/typescript-eslint/issues/2295)) ([88f08f4](https://github.com/typescript-eslint/typescript-eslint/commit/88f08f410760f58fdc2de58ecd9dab9610821642)) +- **typescript-estree:** support short-circuiting assignment operators ([#2307](https://github.com/typescript-eslint/typescript-eslint/issues/2307)) ([2c90d9f](https://github.com/typescript-eslint/typescript-eslint/commit/2c90d9fa3aa5ebd7db697dddb7762bca2dd0e06b)) ## [3.6.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.6.0...v3.6.1) (2020-07-13) **Note:** Version bump only for package @typescript-eslint/types - - - - # [3.6.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.5.0...v3.6.0) (2020-07-06) **Note:** Version bump only for package @typescript-eslint/types - - - - # [3.5.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.4.0...v3.5.0) (2020-06-29) - ### Features -* add package scope-manager ([#1939](https://github.com/typescript-eslint/typescript-eslint/issues/1939)) ([682eb7e](https://github.com/typescript-eslint/typescript-eslint/commit/682eb7e009c3f22a542882dfd3602196a60d2a1e)) -* split types into their own package ([#2229](https://github.com/typescript-eslint/typescript-eslint/issues/2229)) ([5f45918](https://github.com/typescript-eslint/typescript-eslint/commit/5f4591886f3438329fbf2229b03ac66174334a24)) +- add package scope-manager ([#1939](https://github.com/typescript-eslint/typescript-eslint/issues/1939)) ([682eb7e](https://github.com/typescript-eslint/typescript-eslint/commit/682eb7e009c3f22a542882dfd3602196a60d2a1e)) +- split types into their own package ([#2229](https://github.com/typescript-eslint/typescript-eslint/issues/2229)) ([5f45918](https://github.com/typescript-eslint/typescript-eslint/commit/5f4591886f3438329fbf2229b03ac66174334a24)) diff --git a/packages/types/LICENSE b/packages/types/LICENSE index 7e7370143b2..a1164108d4d 100644 --- a/packages/types/LICENSE +++ b/packages/types/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2019 TypeScript ESLint and other contributors +Copyright (c) 2019 typescript-eslint and other contributors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/packages/types/README.md b/packages/types/README.md index 273ac71a936..7a3008bb982 100644 --- a/packages/types/README.md +++ b/packages/types/README.md @@ -1,17 +1,12 @@ -

TypeScript-ESTree Types

+# `@typescript-eslint/types` -

- CI - NPM Version - NPM Downloads -

+> Types for the TypeScript-ESTree AST spec This package exists to help us reduce cycles and provide lighter-weight packages at runtime. -You probably don't want to use it directly. -If you're building an ESLint plugin, consider using [`@typescript-eslint/utils`](../utils). -If you're parsing TypeScript code, consider using [`@typescript-eslint/typescript-estree`](../typescript-estree). +## ✋ Internal Package -## Contributing +This is an _internal package_ to the [typescript-eslint monorepo](https://github.com/typescript-eslint/typescript-eslint). +You likely don't want to use it directly. -[See the contributing guide here](../../CONTRIBUTING.md) +👉 See **https://typescript-eslint.io** for docs on typescript-eslint. diff --git a/packages/types/package.json b/packages/types/package.json index 428f0a74707..ccc72bcd698 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/types", - "version": "5.31.0", + "version": "5.50.0", "description": "Types for the TypeScript-ESTree AST spec", "keywords": [ "eslint", @@ -29,14 +29,14 @@ "main": "dist/index.js", "types": "dist/index.d.ts", "scripts": { - "prebuild": "yarn ts-node --transpile-only ./tools/copy-ast-spec.ts", + "prebuild": "yarn tsx ./tools/copy-ast-spec.ts", "build": "tsc -b tsconfig.build.json", "postbuild": "downlevel-dts dist _ts3.4/dist", "clean": "tsc -b tsconfig.build.json --clean", - "postclean": "rimraf dist && rimraf _ts3.4 && rimraf coverage", + "postclean": "rimraf dist && rimraf src/generated && rimraf _ts3.4 && rimraf coverage", "format": "prettier --write \"./**/*.{ts,mts,cts,tsx,js,mjs,cjs,jsx,json,md,css}\" --ignore-path ../../.prettierignore", - "generate:lib": "../../node_modules/.bin/ts-node --files --transpile-only ../scope-manager/tools/generate-lib.ts", - "lint": "eslint . --ignore-path='../../.eslintignore'", + "generate:lib": "yarn tsx ../scope-manager/tools/generate-lib.ts", + "lint": "nx lint", "typecheck": "tsc -p tsconfig.json --noEmit" }, "nx": { diff --git a/packages/types/project.json b/packages/types/project.json index d0c5660433f..74fee293f18 100644 --- a/packages/types/project.json +++ b/packages/types/project.json @@ -1,5 +1,15 @@ { - "root": "packages/types", + "name": "types", + "$schema": "../../node_modules/nx/schemas/project-schema.json", "type": "library", - "implicitDependencies": ["@typescript-eslint/ast-spec"] + "implicitDependencies": ["ast-spec"], + "targets": { + "lint": { + "executor": "@nrwl/linter:eslint", + "outputs": ["{options.outputFile}"], + "options": { + "lintFilePatterns": ["packages/types/**/*.ts"] + } + } + } } diff --git a/packages/types/src/lib.ts b/packages/types/src/lib.ts index 9310996e516..880bafe5b5e 100644 --- a/packages/types/src/lib.ts +++ b/packages/types/src/lib.ts @@ -46,6 +46,7 @@ type Lib = | 'es2019.object' | 'es2019.string' | 'es2019.symbol' + | 'es2019.intl' | 'es2020.bigint' | 'es2020.date' | 'es2020.promise' @@ -60,7 +61,9 @@ type Lib = | 'es2021.intl' | 'es2022.array' | 'es2022.error' + | 'es2022.intl' | 'es2022.object' + | 'es2022.sharedmemory' | 'es2022.string' | 'esnext.array' | 'esnext.symbol' diff --git a/packages/types/src/parser-options.ts b/packages/types/src/parser-options.ts index bb5101768e0..a7fe3ce3ab3 100644 --- a/packages/types/src/parser-options.ts +++ b/packages/types/src/parser-options.ts @@ -1,7 +1,9 @@ -import { Lib } from './lib'; import type { Program } from 'typescript'; +import type { Lib } from './lib'; + type DebugLevel = boolean | ('typescript-eslint' | 'eslint' | 'typescript')[]; +type CacheDurationSeconds = number | 'Infinity'; type EcmaVersion = | 3 @@ -58,6 +60,17 @@ interface ParserOptions { tsconfigRootDir?: string; warnOnUnsupportedTypeScriptVersion?: boolean; moduleResolver?: string; + cacheLifetime?: { + glob?: CacheDurationSeconds; + }; + + [additionalProperties: string]: unknown; } -export { DebugLevel, EcmaVersion, ParserOptions, SourceType }; +export { + CacheDurationSeconds, + DebugLevel, + EcmaVersion, + ParserOptions, + SourceType, +}; diff --git a/packages/types/src/ts-estree.ts b/packages/types/src/ts-estree.ts index 5f46887c44a..7ce3d0a674a 100644 --- a/packages/types/src/ts-estree.ts +++ b/packages/types/src/ts-estree.ts @@ -1,4 +1,4 @@ -import * as TSESTree from './generated/ast-spec'; +import type * as TSESTree from './generated/ast-spec'; // augment to add the parent property, which isn't part of the spec declare module './generated/ast-spec' { diff --git a/packages/typescript-estree/CHANGELOG.md b/packages/typescript-estree/CHANGELOG.md index b2dd189b6a4..b74f9d0a82d 100644 --- a/packages/typescript-estree/CHANGELOG.md +++ b/packages/typescript-estree/CHANGELOG.md @@ -3,7 +3,7 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. -# [5.31.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.7...v5.31.0) (2022-07-25) +# [5.50.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.49.0...v5.50.0) (2023-01-31) **Note:** Version bump only for package @typescript-eslint/typescript-estree @@ -11,18 +11,18 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline -## [5.30.7](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.6...v5.30.7) (2022-07-18) +# [5.49.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.48.2...v5.49.0) (2023-01-23) ### Bug Fixes -* expose types supporting old versions of typescript ([#5339](https://github.com/typescript-eslint/typescript-eslint/issues/5339)) ([4ba9bdb](https://github.com/typescript-eslint/typescript-eslint/commit/4ba9bdb93f87e6bc370f13aa1de48f435abe3f88)) +* **typescript-estree:** fix typo in FAQ link ([#6346](https://github.com/typescript-eslint/typescript-eslint/issues/6346)) ([eefc578](https://github.com/typescript-eslint/typescript-eslint/commit/eefc5781b0f455264e4e58e33c27f8a91b3ab5e3)) -## [5.30.6](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.5...v5.30.6) (2022-07-11) +## [5.48.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.48.1...v5.48.2) (2023-01-16) **Note:** Version bump only for package @typescript-eslint/typescript-estree @@ -30,7 +30,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline -## [5.30.5](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.4...v5.30.5) (2022-07-04) +## [5.48.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.48.0...v5.48.1) (2023-01-09) **Note:** Version bump only for package @typescript-eslint/typescript-estree @@ -38,1702 +38,1116 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline -## [5.30.4](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.3...v5.30.4) (2022-07-03) +# [5.48.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.47.1...v5.48.0) (2023-01-02) **Note:** Version bump only for package @typescript-eslint/typescript-estree +## [5.47.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.47.0...v5.47.1) (2022-12-26) +### Bug Fixes +- **ast-spec:** correct some incorrect ast types ([#6257](https://github.com/typescript-eslint/typescript-eslint/issues/6257)) ([0f3f645](https://github.com/typescript-eslint/typescript-eslint/commit/0f3f64571ea5d938081b1a9f3fd1495765201700)) - -## [5.30.3](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.2...v5.30.3) (2022-07-01) +# [5.47.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.46.1...v5.47.0) (2022-12-19) **Note:** Version bump only for package @typescript-eslint/typescript-estree +## [5.46.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.46.0...v5.46.1) (2022-12-12) +**Note:** Version bump only for package @typescript-eslint/typescript-estree +# [5.46.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.45.1...v5.46.0) (2022-12-08) +**Note:** Version bump only for package @typescript-eslint/typescript-estree -## [5.30.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.1...v5.30.2) (2022-07-01) +## [5.45.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.45.0...v5.45.1) (2022-12-05) **Note:** Version bump only for package @typescript-eslint/typescript-estree +# [5.45.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.44.0...v5.45.0) (2022-11-28) +### Bug Fixes +- **typescript-estree:** stub out `ts.SatisfiesExpression` on old TS versions ([#6076](https://github.com/typescript-eslint/typescript-eslint/issues/6076)) ([1302b30](https://github.com/typescript-eslint/typescript-eslint/commit/1302b30ecad9eb55aa9f1daa5068d9fb72c3688e)) +### Features -## 5.30.1 (2022-07-01) - -**Note:** Version bump only for package @typescript-eslint/typescript-estree +- support Auto Accessor syntax ([#5926](https://github.com/typescript-eslint/typescript-eslint/issues/5926)) ([becd1f8](https://github.com/typescript-eslint/typescript-eslint/commit/becd1f8581c0013399dfe71be6c265e96cedb57a)) +# [5.44.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.43.0...v5.44.0) (2022-11-21) +### Bug Fixes +- **typescript-estree:** don't consider a cached program unless it's specified in the current `parserOptions.project` config ([#5999](https://github.com/typescript-eslint/typescript-eslint/issues/5999)) ([530e0e6](https://github.com/typescript-eslint/typescript-eslint/commit/530e0e618cdf4bb956149bf8a8484848e1b9a1f5)) +### Features -# [5.30.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.29.0...v5.30.0) (2022-06-27) +- support parsing `satisfies` operators ([#5717](https://github.com/typescript-eslint/typescript-eslint/issues/5717)) ([20d7cae](https://github.com/typescript-eslint/typescript-eslint/commit/20d7caee35ab84ae6381fdf04338c9e2b9e2bc48)) +- update to TypeScript 4.9 ([#5716](https://github.com/typescript-eslint/typescript-eslint/issues/5716)) ([4d744ea](https://github.com/typescript-eslint/typescript-eslint/commit/4d744ea10ba03c66eebcb63e8722e9f0165fbeed)) +# [5.43.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.42.1...v5.43.0) (2022-11-14) -### Features +**Note:** Version bump only for package @typescript-eslint/typescript-estree -* treat `this` in `typeof this` as a `ThisExpression` ([#4382](https://github.com/typescript-eslint/typescript-eslint/issues/4382)) ([b04b2ce](https://github.com/typescript-eslint/typescript-eslint/commit/b04b2ce1ba90d94718891f2562dd210a6d7b8609)) +## [5.42.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.42.0...v5.42.1) (2022-11-07) +**Note:** Version bump only for package @typescript-eslint/typescript-estree +# [5.42.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.41.0...v5.42.0) (2022-10-31) +### Bug Fixes +- **typescript-estree:** don't allow single-run unless we're in type-aware linting mode ([#5893](https://github.com/typescript-eslint/typescript-eslint/issues/5893)) ([891b087](https://github.com/typescript-eslint/typescript-eslint/commit/891b0879ba9c64a4722b8c0bf9e599a725b6d6df)) -# [5.29.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.28.0...v5.29.0) (2022-06-20) +### Features -**Note:** Version bump only for package @typescript-eslint/typescript-estree +- **typescript-estree:** clarify docs and error for program project without matching TSConfig ([#5762](https://github.com/typescript-eslint/typescript-eslint/issues/5762)) ([67744db](https://github.com/typescript-eslint/typescript-eslint/commit/67744db31f61acab14b5fe027fbc2844ba198c97)) +# [5.41.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.40.1...v5.41.0) (2022-10-24) +**Note:** Version bump only for package @typescript-eslint/typescript-estree +## [5.40.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.40.0...v5.40.1) (2022-10-17) +**Note:** Version bump only for package @typescript-eslint/typescript-estree -# [5.28.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.27.1...v5.28.0) (2022-06-13) +# [5.40.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.39.0...v5.40.0) (2022-10-10) **Note:** Version bump only for package @typescript-eslint/typescript-estree +# [5.39.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.38.1...v5.39.0) (2022-10-03) +**Note:** Version bump only for package @typescript-eslint/typescript-estree +## [5.38.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.38.0...v5.38.1) (2022-09-26) +**Note:** Version bump only for package @typescript-eslint/typescript-estree -## [5.27.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.27.0...v5.27.1) (2022-06-06) +# [5.38.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.37.0...v5.38.0) (2022-09-19) **Note:** Version bump only for package @typescript-eslint/typescript-estree +# [5.37.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.36.2...v5.37.0) (2022-09-12) +**Note:** Version bump only for package @typescript-eslint/typescript-estree +## [5.36.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.36.1...v5.36.2) (2022-09-05) +### Bug Fixes -# [5.27.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.26.0...v5.27.0) (2022-05-30) +- **typescript-estree:** don't double add decorators to a parameter property's parameter ([#5582](https://github.com/typescript-eslint/typescript-eslint/issues/5582)) ([863694c](https://github.com/typescript-eslint/typescript-eslint/commit/863694cbc71b5158ca6a018de8707c9f9fbc22c3)) +## [5.36.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.36.0...v5.36.1) (2022-08-30) ### Bug Fixes -* **types:** remove leftovers from removal of useJSXTextNode ([#5091](https://github.com/typescript-eslint/typescript-eslint/issues/5091)) ([f9c3647](https://github.com/typescript-eslint/typescript-eslint/commit/f9c3647cb637c8d1ee461b471da9d817ccbde77c)) +- **typescript-estree:** fix decorator regression for pre TS4.8 ([#5574](https://github.com/typescript-eslint/typescript-eslint/issues/5574)) ([a603015](https://github.com/typescript-eslint/typescript-eslint/commit/a603015c93a6ea96d500c57bec1e284340141b1f)) +# [5.36.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.35.1...v5.36.0) (2022-08-30) ### Features -* [4.7] support new extensions ([#5027](https://github.com/typescript-eslint/typescript-eslint/issues/5027)) ([efc147b](https://github.com/typescript-eslint/typescript-eslint/commit/efc147b04dce52ab17415b6a4ae4076b944b9036)) -* [TS4.7] support type parameters for `typeof` ([#5067](https://github.com/typescript-eslint/typescript-eslint/issues/5067)) ([836de79](https://github.com/typescript-eslint/typescript-eslint/commit/836de79e8d1bff43149168cc913a4c2b60e79bf6)) -* bump dependency ranges to TypeScript 4.7 ([#5082](https://github.com/typescript-eslint/typescript-eslint/issues/5082)) ([c4310b1](https://github.com/typescript-eslint/typescript-eslint/commit/c4310b1aac35c7d31b826f0602eca6a5900a09ee)) - +- support TypeScript 4.8 ([#5551](https://github.com/typescript-eslint/typescript-eslint/issues/5551)) ([81450ed](https://github.com/typescript-eslint/typescript-eslint/commit/81450ed7eaede74b384e9a91a84e9b4d34513866)) +## [5.35.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.35.0...v5.35.1) (2022-08-24) +**Note:** Version bump only for package @typescript-eslint/typescript-estree +# [5.35.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.34.0...v5.35.0) (2022-08-24) -# [5.26.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.25.0...v5.26.0) (2022-05-23) +**Note:** Version bump only for package @typescript-eslint/typescript-estree +# [5.34.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.33.1...v5.34.0) (2022-08-22) ### Features -* [4.7] support instantiation expressions ([#4938](https://github.com/typescript-eslint/typescript-eslint/issues/4938)) ([79fbc77](https://github.com/typescript-eslint/typescript-eslint/commit/79fbc7743ae5dce3190f8168776e0204755390ad)) -* [4.7] support optional variance annotation ([#4831](https://github.com/typescript-eslint/typescript-eslint/issues/4831)) ([7e7b24c](https://github.com/typescript-eslint/typescript-eslint/commit/7e7b24c196e6d968e48f97f46feae5e7027e22d2)) -* **typescript-estree:** `extends` constraints for `infer` ([#4830](https://github.com/typescript-eslint/typescript-eslint/issues/4830)) ([8cbbcc3](https://github.com/typescript-eslint/typescript-eslint/commit/8cbbcc3d317779e0dcba15d3835137f38383de34)) - +- **eslint-plugin:** [prefer-optional-chain] support suggesting `!foo || !foo.bar` as a valid match for the rule ([#5266](https://github.com/typescript-eslint/typescript-eslint/issues/5266)) ([aca935c](https://github.com/typescript-eslint/typescript-eslint/commit/aca935c9696712d4aff18144c4690db4d6ba9bf9)) +## [5.33.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.33.0...v5.33.1) (2022-08-15) +**Note:** Version bump only for package @typescript-eslint/typescript-estree +# [5.33.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.32.0...v5.33.0) (2022-08-08) -# [5.25.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.24.0...v5.25.0) (2022-05-17) +**Note:** Version bump only for package @typescript-eslint/typescript-estree +# [5.32.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.31.0...v5.32.0) (2022-08-01) -### Features +**Note:** Version bump only for package @typescript-eslint/typescript-estree -* update to TypeScript 4.7-rc ([#4829](https://github.com/typescript-eslint/typescript-eslint/issues/4829)) ([6fe783c](https://github.com/typescript-eslint/typescript-eslint/commit/6fe783c20aebe26ef42b526e4a59a9be84dd5643)) +# [5.31.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.7...v5.31.0) (2022-07-25) +**Note:** Version bump only for package @typescript-eslint/typescript-estree +## [5.30.7](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.6...v5.30.7) (2022-07-18) +### Bug Fixes +- expose types supporting old versions of typescript ([#5339](https://github.com/typescript-eslint/typescript-eslint/issues/5339)) ([4ba9bdb](https://github.com/typescript-eslint/typescript-eslint/commit/4ba9bdb93f87e6bc370f13aa1de48f435abe3f88)) -# [5.24.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.23.0...v5.24.0) (2022-05-16) +## [5.30.6](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.5...v5.30.6) (2022-07-11) **Note:** Version bump only for package @typescript-eslint/typescript-estree +## [5.30.5](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.4...v5.30.5) (2022-07-04) +**Note:** Version bump only for package @typescript-eslint/typescript-estree - - -# [5.23.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.22.0...v5.23.0) (2022-05-09) +## [5.30.4](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.3...v5.30.4) (2022-07-03) **Note:** Version bump only for package @typescript-eslint/typescript-estree +## [5.30.3](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.2...v5.30.3) (2022-07-01) +**Note:** Version bump only for package @typescript-eslint/typescript-estree +## [5.30.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.1...v5.30.2) (2022-07-01) +**Note:** Version bump only for package @typescript-eslint/typescript-estree -# [5.22.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.21.0...v5.22.0) (2022-05-02) +## 5.30.1 (2022-07-01) **Note:** Version bump only for package @typescript-eslint/typescript-estree +# [5.30.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.29.0...v5.30.0) (2022-06-27) +### Features +- treat `this` in `typeof this` as a `ThisExpression` ([#4382](https://github.com/typescript-eslint/typescript-eslint/issues/4382)) ([b04b2ce](https://github.com/typescript-eslint/typescript-eslint/commit/b04b2ce1ba90d94718891f2562dd210a6d7b8609)) - -# [5.21.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.20.0...v5.21.0) (2022-04-25) +# [5.29.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.28.0...v5.29.0) (2022-06-20) **Note:** Version bump only for package @typescript-eslint/typescript-estree +# [5.28.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.27.1...v5.28.0) (2022-06-13) +**Note:** Version bump only for package @typescript-eslint/typescript-estree - - -# [5.20.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.19.0...v5.20.0) (2022-04-18) +## [5.27.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.27.0...v5.27.1) (2022-06-06) **Note:** Version bump only for package @typescript-eslint/typescript-estree +# [5.27.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.26.0...v5.27.0) (2022-05-30) +### Bug Fixes +- **types:** remove leftovers from removal of useJSXTextNode ([#5091](https://github.com/typescript-eslint/typescript-eslint/issues/5091)) ([f9c3647](https://github.com/typescript-eslint/typescript-eslint/commit/f9c3647cb637c8d1ee461b471da9d817ccbde77c)) +### Features -# [5.19.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.18.0...v5.19.0) (2022-04-11) +- [4.7] support new extensions ([#5027](https://github.com/typescript-eslint/typescript-eslint/issues/5027)) ([efc147b](https://github.com/typescript-eslint/typescript-eslint/commit/efc147b04dce52ab17415b6a4ae4076b944b9036)) +- [TS4.7] support type parameters for `typeof` ([#5067](https://github.com/typescript-eslint/typescript-eslint/issues/5067)) ([836de79](https://github.com/typescript-eslint/typescript-eslint/commit/836de79e8d1bff43149168cc913a4c2b60e79bf6)) +- bump dependency ranges to TypeScript 4.7 ([#5082](https://github.com/typescript-eslint/typescript-eslint/issues/5082)) ([c4310b1](https://github.com/typescript-eslint/typescript-eslint/commit/c4310b1aac35c7d31b826f0602eca6a5900a09ee)) -**Note:** Version bump only for package @typescript-eslint/typescript-estree +# [5.26.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.25.0...v5.26.0) (2022-05-23) +### Features +- [4.7] support instantiation expressions ([#4938](https://github.com/typescript-eslint/typescript-eslint/issues/4938)) ([79fbc77](https://github.com/typescript-eslint/typescript-eslint/commit/79fbc7743ae5dce3190f8168776e0204755390ad)) +- [4.7] support optional variance annotation ([#4831](https://github.com/typescript-eslint/typescript-eslint/issues/4831)) ([7e7b24c](https://github.com/typescript-eslint/typescript-eslint/commit/7e7b24c196e6d968e48f97f46feae5e7027e22d2)) +- **typescript-estree:** `extends` constraints for `infer` ([#4830](https://github.com/typescript-eslint/typescript-eslint/issues/4830)) ([8cbbcc3](https://github.com/typescript-eslint/typescript-eslint/commit/8cbbcc3d317779e0dcba15d3835137f38383de34)) +# [5.25.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.24.0...v5.25.0) (2022-05-17) +### Features -# [5.18.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.17.0...v5.18.0) (2022-04-04) +- update to TypeScript 4.7-rc ([#4829](https://github.com/typescript-eslint/typescript-eslint/issues/4829)) ([6fe783c](https://github.com/typescript-eslint/typescript-eslint/commit/6fe783c20aebe26ef42b526e4a59a9be84dd5643)) + +# [5.24.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.23.0...v5.24.0) (2022-05-16) **Note:** Version bump only for package @typescript-eslint/typescript-estree +# [5.23.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.22.0...v5.23.0) (2022-05-09) +**Note:** Version bump only for package @typescript-eslint/typescript-estree +# [5.22.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.21.0...v5.22.0) (2022-05-02) +**Note:** Version bump only for package @typescript-eslint/typescript-estree -# [5.17.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.16.0...v5.17.0) (2022-03-28) +# [5.21.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.20.0...v5.21.0) (2022-04-25) **Note:** Version bump only for package @typescript-eslint/typescript-estree +# [5.20.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.19.0...v5.20.0) (2022-04-18) +**Note:** Version bump only for package @typescript-eslint/typescript-estree +# [5.19.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.18.0...v5.19.0) (2022-04-11) +**Note:** Version bump only for package @typescript-eslint/typescript-estree -# [5.16.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.15.0...v5.16.0) (2022-03-21) +# [5.18.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.17.0...v5.18.0) (2022-04-04) **Note:** Version bump only for package @typescript-eslint/typescript-estree +# [5.17.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.16.0...v5.17.0) (2022-03-28) +**Note:** Version bump only for package @typescript-eslint/typescript-estree +# [5.16.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.15.0...v5.16.0) (2022-03-21) +**Note:** Version bump only for package @typescript-eslint/typescript-estree # [5.15.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.14.0...v5.15.0) (2022-03-14) **Note:** Version bump only for package @typescript-eslint/typescript-estree - - - - # [5.14.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.13.0...v5.14.0) (2022-03-07) - ### Features -* TypeScript 4.6 ([#4615](https://github.com/typescript-eslint/typescript-eslint/issues/4615)) ([a02c63a](https://github.com/typescript-eslint/typescript-eslint/commit/a02c63a264e5a6c3557468a8eff48d34ca2b718a)) +- TypeScript 4.6 ([#4615](https://github.com/typescript-eslint/typescript-eslint/issues/4615)) ([a02c63a](https://github.com/typescript-eslint/typescript-eslint/commit/a02c63a264e5a6c3557468a8eff48d34ca2b718a)) +# [5.13.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.12.1...v5.13.0) (2022-02-28) +**Note:** Version bump only for package @typescript-eslint/typescript-estree +## [5.12.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.12.0...v5.12.1) (2022-02-21) +**Note:** Version bump only for package @typescript-eslint/typescript-estree -# [5.13.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.12.1...v5.13.0) (2022-02-28) +# [5.12.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.11.0...v5.12.0) (2022-02-14) **Note:** Version bump only for package @typescript-eslint/typescript-estree +# [5.11.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.10.2...v5.11.0) (2022-02-07) +**Note:** Version bump only for package @typescript-eslint/typescript-estree +## [5.10.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.10.1...v5.10.2) (2022-01-31) +**Note:** Version bump only for package @typescript-eslint/typescript-estree -## [5.12.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.12.0...v5.12.1) (2022-02-21) +## [5.10.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.10.0...v5.10.1) (2022-01-24) **Note:** Version bump only for package @typescript-eslint/typescript-estree +# [5.10.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.9.1...v5.10.0) (2022-01-17) +**Note:** Version bump only for package @typescript-eslint/typescript-estree +## [5.9.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.9.0...v5.9.1) (2022-01-10) +**Note:** Version bump only for package @typescript-eslint/typescript-estree -# [5.12.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.11.0...v5.12.0) (2022-02-14) +# [5.9.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.8.1...v5.9.0) (2022-01-03) **Note:** Version bump only for package @typescript-eslint/typescript-estree +## [5.8.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.8.0...v5.8.1) (2021-12-27) +**Note:** Version bump only for package @typescript-eslint/typescript-estree +# [5.8.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.7.0...v5.8.0) (2021-12-20) +**Note:** Version bump only for package @typescript-eslint/typescript-estree -# [5.11.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.10.2...v5.11.0) (2022-02-07) +# [5.7.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.6.0...v5.7.0) (2021-12-13) -**Note:** Version bump only for package @typescript-eslint/typescript-estree +### Bug Fixes +- **typescript-estree:** type-only regression for consumers not yet on TS 4.5 ([#4272](https://github.com/typescript-eslint/typescript-eslint/issues/4272)) ([550b61e](https://github.com/typescript-eslint/typescript-eslint/commit/550b61ee1096113b234bf035dd267ba385809961)) +# [5.6.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.5.0...v5.6.0) (2021-12-06) +### Features +- **scope-manager:** update lib types ([#4240](https://github.com/typescript-eslint/typescript-eslint/issues/4240)) ([8377e6e](https://github.com/typescript-eslint/typescript-eslint/commit/8377e6ea422ee2d52455da8955ff055e09c238d3)) -## [5.10.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.10.1...v5.10.2) (2022-01-31) +# [5.5.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.4.0...v5.5.0) (2021-11-29) **Note:** Version bump only for package @typescript-eslint/typescript-estree +# [5.4.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.3.1...v5.4.0) (2021-11-15) +### Features +- **typescript-estree:** support Import Assertions ([#4074](https://github.com/typescript-eslint/typescript-eslint/issues/4074)) ([ae0fb5a](https://github.com/typescript-eslint/typescript-eslint/commit/ae0fb5a591958216b7df656e66b1dfe464898167)) +- **typescript-estree:** support private fields in-in syntax ([#4075](https://github.com/typescript-eslint/typescript-eslint/issues/4075)) ([939d8ea](https://github.com/typescript-eslint/typescript-eslint/commit/939d8eac547fb1734aa00f1ea01cc6eae0b4280a)) +- **typescript-estree:** support type-only module specifiers ([#4076](https://github.com/typescript-eslint/typescript-eslint/issues/4076)) ([77baa92](https://github.com/typescript-eslint/typescript-eslint/commit/77baa9203638e888a76e21003a278a8da386e133)) - -## [5.10.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.10.0...v5.10.1) (2022-01-24) +## [5.3.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.3.0...v5.3.1) (2021-11-08) **Note:** Version bump only for package @typescript-eslint/typescript-estree +# [5.3.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.2.0...v5.3.0) (2021-11-01) +**Note:** Version bump only for package @typescript-eslint/typescript-estree - - -# [5.10.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.9.1...v5.10.0) (2022-01-17) +# [5.2.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.1.0...v5.2.0) (2021-10-25) **Note:** Version bump only for package @typescript-eslint/typescript-estree +# [5.1.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.0.0...v5.1.0) (2021-10-18) +### Bug Fixes +- **typescript-estree:** support private optional property definition ([#3997](https://github.com/typescript-eslint/typescript-eslint/issues/3997)) ([8605e08](https://github.com/typescript-eslint/typescript-eslint/commit/8605e080a4dac4a277e6108cd9ed1e5a707302fa)) +# [5.0.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.33.0...v5.0.0) (2021-10-11) -## [5.9.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.9.0...v5.9.1) (2022-01-10) +### Bug Fixes -**Note:** Version bump only for package @typescript-eslint/typescript-estree +- **typescript-estree:** change `source` of ExportNamedDeclaration to Literal from Expression ([#3763](https://github.com/typescript-eslint/typescript-eslint/issues/3763)) ([dc5a0f5](https://github.com/typescript-eslint/typescript-eslint/commit/dc5a0f5104b400f4422b8d67ecfc6cc7a32613a2)) +### Features +- **ast-spec:** bring `Node` objects in line with ESTree ([#3771](https://github.com/typescript-eslint/typescript-eslint/issues/3771)) ([dd14064](https://github.com/typescript-eslint/typescript-eslint/commit/dd140643b457aa515cc21fcda2b3cd4acc2a1c5c)) +- **eslint-plugin:** update recommended configs ([#3809](https://github.com/typescript-eslint/typescript-eslint/issues/3809)) ([deeb7bb](https://github.com/typescript-eslint/typescript-eslint/commit/deeb7bb9334d301c6af56aefd37d318231af11ef)) +- align class property representation with ESTree ([#3806](https://github.com/typescript-eslint/typescript-eslint/issues/3806)) ([22fa5c0](https://github.com/typescript-eslint/typescript-eslint/commit/22fa5c0c4705ed2898f00b7cacc5dd642d859275)), closes [#3430](https://github.com/typescript-eslint/typescript-eslint/issues/3430) [#3077](https://github.com/typescript-eslint/typescript-eslint/issues/3077) +- remove `TSParenthesizedType` ([#3340](https://github.com/typescript-eslint/typescript-eslint/issues/3340)) ([c8ee432](https://github.com/typescript-eslint/typescript-eslint/commit/c8ee43269faea4c04ec02eaa2b81a0aa6eec5d3e)), closes [#3136](https://github.com/typescript-eslint/typescript-eslint/issues/3136) +- support `PrivateIdentifier` ([#3808](https://github.com/typescript-eslint/typescript-eslint/issues/3808)) ([0eefe5e](https://github.com/typescript-eslint/typescript-eslint/commit/0eefe5e49d21af3f1e3e2d9a90c2e49929863ac2)), closes [#3430](https://github.com/typescript-eslint/typescript-eslint/issues/3430) [#2933](https://github.com/typescript-eslint/typescript-eslint/issues/2933) +- **eslint-plugin:** removed value from abstract property nodes ([#3765](https://github.com/typescript-eslint/typescript-eslint/issues/3765)) ([5823524](https://github.com/typescript-eslint/typescript-eslint/commit/58235241714596b641a1e8b39c569e561e0039b4)), closes [#3748](https://github.com/typescript-eslint/typescript-eslint/issues/3748) +- **typescript-estree:** remove legacy `useJSXTextNode` option ([#3109](https://github.com/typescript-eslint/typescript-eslint/issues/3109)) ([5b84b98](https://github.com/typescript-eslint/typescript-eslint/commit/5b84b98fb3cf68d944b7d4e970f39f4e88f0b2d5)) +# [4.33.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.32.0...v4.33.0) (2021-10-04) +**Note:** Version bump only for package @typescript-eslint/typescript-estree -# [5.9.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.8.1...v5.9.0) (2022-01-03) +# [4.32.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.31.2...v4.32.0) (2021-09-27) **Note:** Version bump only for package @typescript-eslint/typescript-estree +## [4.31.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.31.1...v4.31.2) (2021-09-20) +**Note:** Version bump only for package @typescript-eslint/typescript-estree +## [4.31.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.31.0...v4.31.1) (2021-09-13) +**Note:** Version bump only for package @typescript-eslint/typescript-estree -## [5.8.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.8.0...v5.8.1) (2021-12-27) +# [4.31.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.30.0...v4.31.0) (2021-09-06) **Note:** Version bump only for package @typescript-eslint/typescript-estree +# [4.30.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.29.3...v4.30.0) (2021-08-30) +### Features +- **typescript-estree:** add support for class static blocks ([#3730](https://github.com/typescript-eslint/typescript-eslint/issues/3730)) ([f81831b](https://github.com/typescript-eslint/typescript-eslint/commit/f81831bd279a32da6dbab0f1c061053ea43965f6)) - -# [5.8.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.7.0...v5.8.0) (2021-12-20) +## [4.29.3](https://github.com/typescript-eslint/typescript-eslint/compare/v4.29.2...v4.29.3) (2021-08-23) **Note:** Version bump only for package @typescript-eslint/typescript-estree +## [4.29.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.29.1...v4.29.2) (2021-08-16) +**Note:** Version bump only for package @typescript-eslint/typescript-estree +## [4.29.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.29.0...v4.29.1) (2021-08-09) +**Note:** Version bump only for package @typescript-eslint/typescript-estree -# [5.7.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.6.0...v5.7.0) (2021-12-13) - +# [4.29.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.5...v4.29.0) (2021-08-02) ### Bug Fixes -* **typescript-estree:** type-only regression for consumers not yet on TS 4.5 ([#4272](https://github.com/typescript-eslint/typescript-eslint/issues/4272)) ([550b61e](https://github.com/typescript-eslint/typescript-eslint/commit/550b61ee1096113b234bf035dd267ba385809961)) +- **typescript-estree:** correct tty check ([#3635](https://github.com/typescript-eslint/typescript-eslint/issues/3635)) ([62bcc93](https://github.com/typescript-eslint/typescript-eslint/commit/62bcc937f08cd18296ffbe96a3551ec1fb87aecd)) +- **typescript-estree:** ensure --fix works with singleRun mode ([#3655](https://github.com/typescript-eslint/typescript-eslint/issues/3655)) ([99eca0d](https://github.com/typescript-eslint/typescript-eslint/commit/99eca0d428187d4c29ded9ddd1b57b40ab463c01)) +### Features +- **ast-spec:** make `BaseNode` & `BaseToken` more type-safe ([#3560](https://github.com/typescript-eslint/typescript-eslint/issues/3560)) ([a6c5604](https://github.com/typescript-eslint/typescript-eslint/commit/a6c5604b65b6330d047aa016fc46b8a597a6ae58)) +- **typescript-estree:** add support for custom module resolution ([#3516](https://github.com/typescript-eslint/typescript-eslint/issues/3516)) ([d48429d](https://github.com/typescript-eslint/typescript-eslint/commit/d48429d97326545bb727f88ce9056270b1599a31)) +## [4.28.5](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.4...v4.28.5) (2021-07-26) +**Note:** Version bump only for package @typescript-eslint/typescript-estree -# [5.6.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.5.0...v5.6.0) (2021-12-06) +## [4.28.4](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.3...v4.28.4) (2021-07-19) +**Note:** Version bump only for package @typescript-eslint/typescript-estree -### Features +## [4.28.3](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.2...v4.28.3) (2021-07-12) -* **scope-manager:** update lib types ([#4240](https://github.com/typescript-eslint/typescript-eslint/issues/4240)) ([8377e6e](https://github.com/typescript-eslint/typescript-eslint/commit/8377e6ea422ee2d52455da8955ff055e09c238d3)) +**Note:** Version bump only for package @typescript-eslint/typescript-estree +## [4.28.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.1...v4.28.2) (2021-07-05) +**Note:** Version bump only for package @typescript-eslint/typescript-estree +## [4.28.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.0...v4.28.1) (2021-06-28) +**Note:** Version bump only for package @typescript-eslint/typescript-estree -# [5.5.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.4.0...v5.5.0) (2021-11-29) +# [4.28.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.27.0...v4.28.0) (2021-06-21) **Note:** Version bump only for package @typescript-eslint/typescript-estree +# [4.27.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.26.1...v4.27.0) (2021-06-14) +### Bug Fixes +- **typescript-estree:** allow providing more one than one existing program in config ([#3508](https://github.com/typescript-eslint/typescript-eslint/issues/3508)) ([4f1806e](https://github.com/typescript-eslint/typescript-eslint/commit/4f1806e548affb7265da360d1fc8d033e25de325)) +- **typescript-estree:** support override modifier for parameter property ([#3485](https://github.com/typescript-eslint/typescript-eslint/issues/3485)) ([33b9f69](https://github.com/typescript-eslint/typescript-eslint/commit/33b9f69a681cd3219a2acca5b0b2fa67609f099e)) +### Features -# [5.4.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.3.1...v5.4.0) (2021-11-15) +- **ast-spec:** specify `PunctuatorToken`'s `value` type ([#3496](https://github.com/typescript-eslint/typescript-eslint/issues/3496)) ([fdb1d81](https://github.com/typescript-eslint/typescript-eslint/commit/fdb1d81f0fcf75a9216e6a90469f18c24c91f718)) +- **typescript-estree:** add opt-in inference for single runs and create programs for projects up front ([#3512](https://github.com/typescript-eslint/typescript-eslint/issues/3512)) ([06c2d9b](https://github.com/typescript-eslint/typescript-eslint/commit/06c2d9ba5442330f56637ecb14fae7e41696699c)) +- allow user to provide TS program instance in parser options ([#3484](https://github.com/typescript-eslint/typescript-eslint/issues/3484)) ([e855b18](https://github.com/typescript-eslint/typescript-eslint/commit/e855b18b8feee0edb5c617c11006861426a6f530)) +## [4.26.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.26.0...v4.26.1) (2021-06-07) -### Features +**Note:** Version bump only for package @typescript-eslint/typescript-estree + +# [4.26.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.25.0...v4.26.0) (2021-05-31) -* **typescript-estree:** support Import Assertions ([#4074](https://github.com/typescript-eslint/typescript-eslint/issues/4074)) ([ae0fb5a](https://github.com/typescript-eslint/typescript-eslint/commit/ae0fb5a591958216b7df656e66b1dfe464898167)) -* **typescript-estree:** support private fields in-in syntax ([#4075](https://github.com/typescript-eslint/typescript-eslint/issues/4075)) ([939d8ea](https://github.com/typescript-eslint/typescript-eslint/commit/939d8eac547fb1734aa00f1ea01cc6eae0b4280a)) -* **typescript-estree:** support type-only module specifiers ([#4076](https://github.com/typescript-eslint/typescript-eslint/issues/4076)) ([77baa92](https://github.com/typescript-eslint/typescript-eslint/commit/77baa9203638e888a76e21003a278a8da386e133)) +### Bug Fixes +- generate library types for TypeScript v4.3 ([#3460](https://github.com/typescript-eslint/typescript-eslint/issues/3460)) ([ed4776a](https://github.com/typescript-eslint/typescript-eslint/commit/ed4776afa1374279027b9b7d82aa4b453b334998)), closes [#3449](https://github.com/typescript-eslint/typescript-eslint/issues/3449) +# [4.25.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.24.0...v4.25.0) (2021-05-24) +### Features +- **typescript-estree:** [TS4.3] support overrides on class members ([#3429](https://github.com/typescript-eslint/typescript-eslint/issues/3429)) ([21d1b62](https://github.com/typescript-eslint/typescript-eslint/commit/21d1b62a0b84b502d2cf12674b3d141994a3ffd4)) +- **typescript-estree:** add support for getter/setter signatures on types ([#3427](https://github.com/typescript-eslint/typescript-eslint/issues/3427)) ([b830b7f](https://github.com/typescript-eslint/typescript-eslint/commit/b830b7f4e8a99affc8af8b53cb83371ef81d7032)), closes [#3272](https://github.com/typescript-eslint/typescript-eslint/issues/3272) [#3272](https://github.com/typescript-eslint/typescript-eslint/issues/3272) -## [5.3.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.3.0...v5.3.1) (2021-11-08) +# [4.24.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.23.0...v4.24.0) (2021-05-17) **Note:** Version bump only for package @typescript-eslint/typescript-estree +# [4.23.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.22.1...v4.23.0) (2021-05-10) +### Features +- refactor to split AST specification out as its own module ([#2911](https://github.com/typescript-eslint/typescript-eslint/issues/2911)) ([25ea953](https://github.com/typescript-eslint/typescript-eslint/commit/25ea953cc60b118bd385c71e0a9b61c286c26fcf)) - -# [5.3.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.2.0...v5.3.0) (2021-11-01) +## [4.22.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.22.0...v4.22.1) (2021-05-04) **Note:** Version bump only for package @typescript-eslint/typescript-estree +# [4.22.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.21.0...v4.22.0) (2021-04-12) +**Note:** Version bump only for package @typescript-eslint/typescript-estree +# [4.21.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.20.0...v4.21.0) (2021-04-05) +**Note:** Version bump only for package @typescript-eslint/typescript-estree -# [5.2.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.1.0...v5.2.0) (2021-10-25) +# [4.20.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.19.0...v4.20.0) (2021-03-29) **Note:** Version bump only for package @typescript-eslint/typescript-estree +# [4.19.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.18.0...v4.19.0) (2021-03-22) +### Bug Fixes +- **typescript-estree:** [ts 4.2] add support for import type equal declaration ([#3189](https://github.com/typescript-eslint/typescript-eslint/issues/3189)) ([6a25faf](https://github.com/typescript-eslint/typescript-eslint/commit/6a25faf5cfa4d21a7546d9866819f4e017308fb2)) +# [4.18.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.17.0...v4.18.0) (2021-03-15) -# [5.1.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.0.0...v5.1.0) (2021-10-18) +**Note:** Version bump only for package @typescript-eslint/typescript-estree +# [4.17.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.16.1...v4.17.0) (2021-03-08) -### Bug Fixes +**Note:** Version bump only for package @typescript-eslint/typescript-estree -* **typescript-estree:** support private optional property definition ([#3997](https://github.com/typescript-eslint/typescript-eslint/issues/3997)) ([8605e08](https://github.com/typescript-eslint/typescript-eslint/commit/8605e080a4dac4a277e6108cd9ed1e5a707302fa)) +## [4.16.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.16.0...v4.16.1) (2021-03-01) +### Bug Fixes +- **typescript-estree:** update TS version range ([#3127](https://github.com/typescript-eslint/typescript-eslint/issues/3127)) ([0473674](https://github.com/typescript-eslint/typescript-eslint/commit/0473674c58df5039a2de3c63ad7494fc6be7487e)) +# [4.16.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.15.2...v4.16.0) (2021-03-01) +### Features -# [5.0.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.33.0...v5.0.0) (2021-10-11) +- TypeScript 4.2 syntax support ([#3112](https://github.com/typescript-eslint/typescript-eslint/issues/3112)) ([2ebfb21](https://github.com/typescript-eslint/typescript-eslint/commit/2ebfb21ba6c88c793cfbd0e231e5803b2381694c)) +- **typescript-estree:** throw custom error instead of plain object ([#3011](https://github.com/typescript-eslint/typescript-eslint/issues/3011)) ([ae14bf5](https://github.com/typescript-eslint/typescript-eslint/commit/ae14bf55fe31b0eb982ba17333e4aac550d10342)) +## [4.15.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.15.1...v4.15.2) (2021-02-22) ### Bug Fixes -* **typescript-estree:** change `source` of ExportNamedDeclaration to Literal from Expression ([#3763](https://github.com/typescript-eslint/typescript-eslint/issues/3763)) ([dc5a0f5](https://github.com/typescript-eslint/typescript-eslint/commit/dc5a0f5104b400f4422b8d67ecfc6cc7a32613a2)) +- **typescript-estree:** correct issues in AST definition ([#3083](https://github.com/typescript-eslint/typescript-eslint/issues/3083)) ([509a117](https://github.com/typescript-eslint/typescript-eslint/commit/509a11749f85400a01e9fecfecd12871ce562d3d)) +- add missing intrinsic keyword node to AST ([#3081](https://github.com/typescript-eslint/typescript-eslint/issues/3081)) ([409bf0b](https://github.com/typescript-eslint/typescript-eslint/commit/409bf0bb3e2ac4d8782408d436ebdefb42dba38b)) +- correct test names on windows for semantic-diagnostics-enabled ([#3060](https://github.com/typescript-eslint/typescript-eslint/issues/3060)) ([885780d](https://github.com/typescript-eslint/typescript-eslint/commit/885780d4a2b07e418256b7323d76b18453c14a50)) +## [4.15.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.15.0...v4.15.1) (2021-02-15) -### Features +**Note:** Version bump only for package @typescript-eslint/typescript-estree -* **ast-spec:** bring `Node` objects in line with ESTree ([#3771](https://github.com/typescript-eslint/typescript-eslint/issues/3771)) ([dd14064](https://github.com/typescript-eslint/typescript-eslint/commit/dd140643b457aa515cc21fcda2b3cd4acc2a1c5c)) -* **eslint-plugin:** update recommended configs ([#3809](https://github.com/typescript-eslint/typescript-eslint/issues/3809)) ([deeb7bb](https://github.com/typescript-eslint/typescript-eslint/commit/deeb7bb9334d301c6af56aefd37d318231af11ef)) -* align class property representation with ESTree ([#3806](https://github.com/typescript-eslint/typescript-eslint/issues/3806)) ([22fa5c0](https://github.com/typescript-eslint/typescript-eslint/commit/22fa5c0c4705ed2898f00b7cacc5dd642d859275)), closes [#3430](https://github.com/typescript-eslint/typescript-eslint/issues/3430) [#3077](https://github.com/typescript-eslint/typescript-eslint/issues/3077) -* remove `TSParenthesizedType` ([#3340](https://github.com/typescript-eslint/typescript-eslint/issues/3340)) ([c8ee432](https://github.com/typescript-eslint/typescript-eslint/commit/c8ee43269faea4c04ec02eaa2b81a0aa6eec5d3e)), closes [#3136](https://github.com/typescript-eslint/typescript-eslint/issues/3136) -* support `PrivateIdentifier` ([#3808](https://github.com/typescript-eslint/typescript-eslint/issues/3808)) ([0eefe5e](https://github.com/typescript-eslint/typescript-eslint/commit/0eefe5e49d21af3f1e3e2d9a90c2e49929863ac2)), closes [#3430](https://github.com/typescript-eslint/typescript-eslint/issues/3430) [#2933](https://github.com/typescript-eslint/typescript-eslint/issues/2933) -* **eslint-plugin:** removed value from abstract property nodes ([#3765](https://github.com/typescript-eslint/typescript-eslint/issues/3765)) ([5823524](https://github.com/typescript-eslint/typescript-eslint/commit/58235241714596b641a1e8b39c569e561e0039b4)), closes [#3748](https://github.com/typescript-eslint/typescript-eslint/issues/3748) -* **typescript-estree:** remove legacy `useJSXTextNode` option ([#3109](https://github.com/typescript-eslint/typescript-eslint/issues/3109)) ([5b84b98](https://github.com/typescript-eslint/typescript-eslint/commit/5b84b98fb3cf68d944b7d4e970f39f4e88f0b2d5)) +# [4.15.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.14.2...v4.15.0) (2021-02-08) +### Features +- **typescript-estree:** improve logic used to escape string literals in jsx ([#2995](https://github.com/typescript-eslint/typescript-eslint/issues/2995)) ([3cb3aad](https://github.com/typescript-eslint/typescript-eslint/commit/3cb3aade2864bab15ed1ff8d7cd32766aa57152f)) +## [4.14.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.14.1...v4.14.2) (2021-02-01) +**Note:** Version bump only for package @typescript-eslint/typescript-estree -# [4.33.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.32.0...v4.33.0) (2021-10-04) +## [4.14.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.14.0...v4.14.1) (2021-01-25) **Note:** Version bump only for package @typescript-eslint/typescript-estree +# [4.14.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.13.0...v4.14.0) (2021-01-18) +**Note:** Version bump only for package @typescript-eslint/typescript-estree +# [4.13.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.12.0...v4.13.0) (2021-01-11) +**Note:** Version bump only for package @typescript-eslint/typescript-estree -# [4.32.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.31.2...v4.32.0) (2021-09-27) +# [4.12.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.11.1...v4.12.0) (2021-01-04) **Note:** Version bump only for package @typescript-eslint/typescript-estree +## [4.11.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.11.0...v4.11.1) (2020-12-28) +**Note:** Version bump only for package @typescript-eslint/typescript-estree +# [4.11.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.10.0...v4.11.0) (2020-12-21) +**Note:** Version bump only for package @typescript-eslint/typescript-estree -## [4.31.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.31.1...v4.31.2) (2021-09-20) +# [4.10.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.9.1...v4.10.0) (2020-12-14) **Note:** Version bump only for package @typescript-eslint/typescript-estree +## [4.9.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.9.0...v4.9.1) (2020-12-07) +**Note:** Version bump only for package @typescript-eslint/typescript-estree +# [4.9.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.8.2...v4.9.0) (2020-11-30) +### Bug Fixes -## [4.31.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.31.0...v4.31.1) (2021-09-13) - -**Note:** Version bump only for package @typescript-eslint/typescript-estree - - - - - -# [4.31.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.30.0...v4.31.0) (2021-09-06) - -**Note:** Version bump only for package @typescript-eslint/typescript-estree - - - - - -# [4.30.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.29.3...v4.30.0) (2021-08-30) - - -### Features - -* **typescript-estree:** add support for class static blocks ([#3730](https://github.com/typescript-eslint/typescript-eslint/issues/3730)) ([f81831b](https://github.com/typescript-eslint/typescript-eslint/commit/f81831bd279a32da6dbab0f1c061053ea43965f6)) - - - - - -## [4.29.3](https://github.com/typescript-eslint/typescript-eslint/compare/v4.29.2...v4.29.3) (2021-08-23) - -**Note:** Version bump only for package @typescript-eslint/typescript-estree - - - - - -## [4.29.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.29.1...v4.29.2) (2021-08-16) - -**Note:** Version bump only for package @typescript-eslint/typescript-estree - - - - - -## [4.29.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.29.0...v4.29.1) (2021-08-09) - -**Note:** Version bump only for package @typescript-eslint/typescript-estree - - - - - -# [4.29.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.5...v4.29.0) (2021-08-02) - - -### Bug Fixes - -* **typescript-estree:** correct tty check ([#3635](https://github.com/typescript-eslint/typescript-eslint/issues/3635)) ([62bcc93](https://github.com/typescript-eslint/typescript-eslint/commit/62bcc937f08cd18296ffbe96a3551ec1fb87aecd)) -* **typescript-estree:** ensure --fix works with singleRun mode ([#3655](https://github.com/typescript-eslint/typescript-eslint/issues/3655)) ([99eca0d](https://github.com/typescript-eslint/typescript-eslint/commit/99eca0d428187d4c29ded9ddd1b57b40ab463c01)) - - -### Features - -* **ast-spec:** make `BaseNode` & `BaseToken` more type-safe ([#3560](https://github.com/typescript-eslint/typescript-eslint/issues/3560)) ([a6c5604](https://github.com/typescript-eslint/typescript-eslint/commit/a6c5604b65b6330d047aa016fc46b8a597a6ae58)) -* **typescript-estree:** add support for custom module resolution ([#3516](https://github.com/typescript-eslint/typescript-eslint/issues/3516)) ([d48429d](https://github.com/typescript-eslint/typescript-eslint/commit/d48429d97326545bb727f88ce9056270b1599a31)) - - - - - -## [4.28.5](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.4...v4.28.5) (2021-07-26) - -**Note:** Version bump only for package @typescript-eslint/typescript-estree - - - - - -## [4.28.4](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.3...v4.28.4) (2021-07-19) - -**Note:** Version bump only for package @typescript-eslint/typescript-estree - - - - - -## [4.28.3](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.2...v4.28.3) (2021-07-12) - -**Note:** Version bump only for package @typescript-eslint/typescript-estree - - - - - -## [4.28.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.1...v4.28.2) (2021-07-05) - -**Note:** Version bump only for package @typescript-eslint/typescript-estree - - - - - -## [4.28.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.0...v4.28.1) (2021-06-28) - -**Note:** Version bump only for package @typescript-eslint/typescript-estree - - - - - -# [4.28.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.27.0...v4.28.0) (2021-06-21) - -**Note:** Version bump only for package @typescript-eslint/typescript-estree - - - - - -# [4.27.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.26.1...v4.27.0) (2021-06-14) - - -### Bug Fixes - -* **typescript-estree:** allow providing more one than one existing program in config ([#3508](https://github.com/typescript-eslint/typescript-eslint/issues/3508)) ([4f1806e](https://github.com/typescript-eslint/typescript-eslint/commit/4f1806e548affb7265da360d1fc8d033e25de325)) -* **typescript-estree:** support override modifier for parameter property ([#3485](https://github.com/typescript-eslint/typescript-eslint/issues/3485)) ([33b9f69](https://github.com/typescript-eslint/typescript-eslint/commit/33b9f69a681cd3219a2acca5b0b2fa67609f099e)) - - -### Features - -* **ast-spec:** specify `PunctuatorToken`'s `value` type ([#3496](https://github.com/typescript-eslint/typescript-eslint/issues/3496)) ([fdb1d81](https://github.com/typescript-eslint/typescript-eslint/commit/fdb1d81f0fcf75a9216e6a90469f18c24c91f718)) -* **typescript-estree:** add opt-in inference for single runs and create programs for projects up front ([#3512](https://github.com/typescript-eslint/typescript-eslint/issues/3512)) ([06c2d9b](https://github.com/typescript-eslint/typescript-eslint/commit/06c2d9ba5442330f56637ecb14fae7e41696699c)) -* allow user to provide TS program instance in parser options ([#3484](https://github.com/typescript-eslint/typescript-eslint/issues/3484)) ([e855b18](https://github.com/typescript-eslint/typescript-eslint/commit/e855b18b8feee0edb5c617c11006861426a6f530)) - - - - - -## [4.26.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.26.0...v4.26.1) (2021-06-07) - -**Note:** Version bump only for package @typescript-eslint/typescript-estree - - - - - -# [4.26.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.25.0...v4.26.0) (2021-05-31) - - -### Bug Fixes - -* generate library types for TypeScript v4.3 ([#3460](https://github.com/typescript-eslint/typescript-eslint/issues/3460)) ([ed4776a](https://github.com/typescript-eslint/typescript-eslint/commit/ed4776afa1374279027b9b7d82aa4b453b334998)), closes [#3449](https://github.com/typescript-eslint/typescript-eslint/issues/3449) - - - - - -# [4.25.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.24.0...v4.25.0) (2021-05-24) - - -### Features - -* **typescript-estree:** [TS4.3] support overrides on class members ([#3429](https://github.com/typescript-eslint/typescript-eslint/issues/3429)) ([21d1b62](https://github.com/typescript-eslint/typescript-eslint/commit/21d1b62a0b84b502d2cf12674b3d141994a3ffd4)) -* **typescript-estree:** add support for getter/setter signatures on types ([#3427](https://github.com/typescript-eslint/typescript-eslint/issues/3427)) ([b830b7f](https://github.com/typescript-eslint/typescript-eslint/commit/b830b7f4e8a99affc8af8b53cb83371ef81d7032)), closes [#3272](https://github.com/typescript-eslint/typescript-eslint/issues/3272) [#3272](https://github.com/typescript-eslint/typescript-eslint/issues/3272) - - - - - -# [4.24.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.23.0...v4.24.0) (2021-05-17) - -**Note:** Version bump only for package @typescript-eslint/typescript-estree - - - - - -# [4.23.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.22.1...v4.23.0) (2021-05-10) - - -### Features - -* refactor to split AST specification out as its own module ([#2911](https://github.com/typescript-eslint/typescript-eslint/issues/2911)) ([25ea953](https://github.com/typescript-eslint/typescript-eslint/commit/25ea953cc60b118bd385c71e0a9b61c286c26fcf)) - - - - - -## [4.22.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.22.0...v4.22.1) (2021-05-04) - -**Note:** Version bump only for package @typescript-eslint/typescript-estree - - - - - -# [4.22.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.21.0...v4.22.0) (2021-04-12) - -**Note:** Version bump only for package @typescript-eslint/typescript-estree - - - - - -# [4.21.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.20.0...v4.21.0) (2021-04-05) - -**Note:** Version bump only for package @typescript-eslint/typescript-estree - - - - - -# [4.20.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.19.0...v4.20.0) (2021-03-29) - -**Note:** Version bump only for package @typescript-eslint/typescript-estree - - - - - -# [4.19.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.18.0...v4.19.0) (2021-03-22) - - -### Bug Fixes - -* **typescript-estree:** [ts 4.2] add support for import type equal declaration ([#3189](https://github.com/typescript-eslint/typescript-eslint/issues/3189)) ([6a25faf](https://github.com/typescript-eslint/typescript-eslint/commit/6a25faf5cfa4d21a7546d9866819f4e017308fb2)) - - - - - -# [4.18.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.17.0...v4.18.0) (2021-03-15) - -**Note:** Version bump only for package @typescript-eslint/typescript-estree - - - - - -# [4.17.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.16.1...v4.17.0) (2021-03-08) - -**Note:** Version bump only for package @typescript-eslint/typescript-estree - - - - - -## [4.16.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.16.0...v4.16.1) (2021-03-01) - - -### Bug Fixes - -* **typescript-estree:** update TS version range ([#3127](https://github.com/typescript-eslint/typescript-eslint/issues/3127)) ([0473674](https://github.com/typescript-eslint/typescript-eslint/commit/0473674c58df5039a2de3c63ad7494fc6be7487e)) - - - - - -# [4.16.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.15.2...v4.16.0) (2021-03-01) - - -### Features - -* TypeScript 4.2 syntax support ([#3112](https://github.com/typescript-eslint/typescript-eslint/issues/3112)) ([2ebfb21](https://github.com/typescript-eslint/typescript-eslint/commit/2ebfb21ba6c88c793cfbd0e231e5803b2381694c)) -* **typescript-estree:** throw custom error instead of plain object ([#3011](https://github.com/typescript-eslint/typescript-eslint/issues/3011)) ([ae14bf5](https://github.com/typescript-eslint/typescript-eslint/commit/ae14bf55fe31b0eb982ba17333e4aac550d10342)) - - - - - -## [4.15.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.15.1...v4.15.2) (2021-02-22) - - -### Bug Fixes - -* **typescript-estree:** correct issues in AST definition ([#3083](https://github.com/typescript-eslint/typescript-eslint/issues/3083)) ([509a117](https://github.com/typescript-eslint/typescript-eslint/commit/509a11749f85400a01e9fecfecd12871ce562d3d)) -* add missing intrinsic keyword node to AST ([#3081](https://github.com/typescript-eslint/typescript-eslint/issues/3081)) ([409bf0b](https://github.com/typescript-eslint/typescript-eslint/commit/409bf0bb3e2ac4d8782408d436ebdefb42dba38b)) -* correct test names on windows for semantic-diagnostics-enabled ([#3060](https://github.com/typescript-eslint/typescript-eslint/issues/3060)) ([885780d](https://github.com/typescript-eslint/typescript-eslint/commit/885780d4a2b07e418256b7323d76b18453c14a50)) - - - - - -## [4.15.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.15.0...v4.15.1) (2021-02-15) - -**Note:** Version bump only for package @typescript-eslint/typescript-estree - - - - - -# [4.15.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.14.2...v4.15.0) (2021-02-08) - - -### Features - -* **typescript-estree:** improve logic used to escape string literals in jsx ([#2995](https://github.com/typescript-eslint/typescript-eslint/issues/2995)) ([3cb3aad](https://github.com/typescript-eslint/typescript-eslint/commit/3cb3aade2864bab15ed1ff8d7cd32766aa57152f)) - - - - - -## [4.14.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.14.1...v4.14.2) (2021-02-01) - -**Note:** Version bump only for package @typescript-eslint/typescript-estree - - - - - -## [4.14.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.14.0...v4.14.1) (2021-01-25) - -**Note:** Version bump only for package @typescript-eslint/typescript-estree - - - - - -# [4.14.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.13.0...v4.14.0) (2021-01-18) - -**Note:** Version bump only for package @typescript-eslint/typescript-estree - - - - - -# [4.13.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.12.0...v4.13.0) (2021-01-11) - -**Note:** Version bump only for package @typescript-eslint/typescript-estree - - - - - -# [4.12.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.11.1...v4.12.0) (2021-01-04) - -**Note:** Version bump only for package @typescript-eslint/typescript-estree - - - - - -## [4.11.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.11.0...v4.11.1) (2020-12-28) - -**Note:** Version bump only for package @typescript-eslint/typescript-estree - - - - - -# [4.11.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.10.0...v4.11.0) (2020-12-21) - -**Note:** Version bump only for package @typescript-eslint/typescript-estree - - - - - -# [4.10.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.9.1...v4.10.0) (2020-12-14) - -**Note:** Version bump only for package @typescript-eslint/typescript-estree - - - - - -## [4.9.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.9.0...v4.9.1) (2020-12-07) - -**Note:** Version bump only for package @typescript-eslint/typescript-estree - - - - - -# [4.9.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.8.2...v4.9.0) (2020-11-30) - - -### Bug Fixes - -* **typescript-estree:** add default value for `parserOptions.projectFolderIgnoreList` and deduplicate resolved projects ([#2819](https://github.com/typescript-eslint/typescript-eslint/issues/2819)) ([bf904ec](https://github.com/typescript-eslint/typescript-eslint/commit/bf904ec72db57174fec531f61e9427230662553e)), closes [#2418](https://github.com/typescript-eslint/typescript-eslint/issues/2418) [#2814](https://github.com/typescript-eslint/typescript-eslint/issues/2814) - - - - - -## [4.8.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.8.1...v4.8.2) (2020-11-23) - - -### Bug Fixes - -* **typescript-estree:** fix type-only regression for consumers not yet on TS 4.1 ([#2789](https://github.com/typescript-eslint/typescript-eslint/issues/2789)) ([50a46c6](https://github.com/typescript-eslint/typescript-eslint/commit/50a46c60fb81d8434aa4268a13d17d8fcf499e21)) - - - - - -## [4.8.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.8.0...v4.8.1) (2020-11-17) - - -### Bug Fixes - -* **typescript-estree:** parseWithNodeMaps returning empty maps ([#2773](https://github.com/typescript-eslint/typescript-eslint/issues/2773)) ([3e4a0ed](https://github.com/typescript-eslint/typescript-eslint/commit/3e4a0ed0d615fd22a2f28c7c8af6179673e195f8)) - - - - - -# [4.8.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.7.0...v4.8.0) (2020-11-16) - - -### Features - -* **typescript-estree:** add `parseWithNodeMaps` API ([#2760](https://github.com/typescript-eslint/typescript-eslint/issues/2760)) ([9441d50](https://github.com/typescript-eslint/typescript-eslint/commit/9441d5030211f1c32f5ae8e61d5565cab8bb6823)), closes [#1852](https://github.com/typescript-eslint/typescript-eslint/issues/1852) - - - - - -# [4.7.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.6.1...v4.7.0) (2020-11-09) - - -### Features - -* support TS4.1 features ([#2748](https://github.com/typescript-eslint/typescript-eslint/issues/2748)) ([2be354b](https://github.com/typescript-eslint/typescript-eslint/commit/2be354bb15f9013a2da1b13a0c0836e9ef057e16)), closes [#2583](https://github.com/typescript-eslint/typescript-eslint/issues/2583) - - - - - -## [4.6.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.6.0...v4.6.1) (2020-11-02) - -**Note:** Version bump only for package @typescript-eslint/typescript-estree - - - - - -# [4.6.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.5.0...v4.6.0) (2020-10-26) - -**Note:** Version bump only for package @typescript-eslint/typescript-estree - - - - - -# [4.5.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.4.1...v4.5.0) (2020-10-19) - - -### Features - -* **typescript-estree:** add flag EXPERIMENTAL_useSourceOfProjectReferenceRedirect ([#2669](https://github.com/typescript-eslint/typescript-eslint/issues/2669)) ([90a5878](https://github.com/typescript-eslint/typescript-eslint/commit/90a587845088da1b205e4d7d77dbc3f9447b1c5a)) - - - - - -## [4.4.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.4.0...v4.4.1) (2020-10-12) - -**Note:** Version bump only for package @typescript-eslint/typescript-estree - - - - - -# [4.4.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.3.0...v4.4.0) (2020-10-05) - -**Note:** Version bump only for package @typescript-eslint/typescript-estree - - - - - -# [4.3.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.2.0...v4.3.0) (2020-09-28) - -**Note:** Version bump only for package @typescript-eslint/typescript-estree - - - - - -# [4.2.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.1.1...v4.2.0) (2020-09-21) - -**Note:** Version bump only for package @typescript-eslint/typescript-estree - - - - - -## [4.1.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.1.0...v4.1.1) (2020-09-14) - -**Note:** Version bump only for package @typescript-eslint/typescript-estree - - - - - -# [4.1.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.0.1...v4.1.0) (2020-09-07) - -**Note:** Version bump only for package @typescript-eslint/typescript-estree - - - - - -## [4.0.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.0.0...v4.0.1) (2020-08-31) - -**Note:** Version bump only for package @typescript-eslint/typescript-estree - - - - - -# [4.0.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.10.1...v4.0.0) (2020-08-31) - - -### Bug Fixes - -* correct decorator traversal for AssignmentPattern ([#2375](https://github.com/typescript-eslint/typescript-eslint/issues/2375)) ([d738fa4](https://github.com/typescript-eslint/typescript-eslint/commit/d738fa4eff0a5c4cfc9b30b1c0502f8d1e78d7b6)) -* **typescript-estree:** correct ChainExpression interaction with parentheses and non-nulls ([#2380](https://github.com/typescript-eslint/typescript-eslint/issues/2380)) ([762bc99](https://github.com/typescript-eslint/typescript-eslint/commit/762bc99584ede4d0b8099a743991e957aec86aa8)) - - -### Features - -* support ESTree optional chaining representation ([#2308](https://github.com/typescript-eslint/typescript-eslint/issues/2308)) ([e9d2ab6](https://github.com/typescript-eslint/typescript-eslint/commit/e9d2ab638b6767700b52797e74b814ea059beaae)) -* **typescript-estree:** switch to globby ([#2418](https://github.com/typescript-eslint/typescript-eslint/issues/2418)) ([3a7ec9b](https://github.com/typescript-eslint/typescript-eslint/commit/3a7ec9bcf1873a99c6da2f19ade8ab4763b4793c)), closes [#2398](https://github.com/typescript-eslint/typescript-eslint/issues/2398) - - -### BREAKING CHANGES - -* **typescript-estree:** - removes the ability to supply a `RegExp` to `projectFolderIgnoreList`, and changes the meaning of the string value from a regex to a glob. -* - Removed decorators property from several Nodes that could never semantically have them (FunctionDeclaration, TSEnumDeclaration, and TSInterfaceDeclaration) -- Removed AST_NODE_TYPES.Import. This is a minor breaking change as the node type that used this was removed ages ago. - - - - - -## [3.10.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.10.0...v3.10.1) (2020-08-25) - -**Note:** Version bump only for package @typescript-eslint/typescript-estree - - - - - -# [3.10.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.9.1...v3.10.0) (2020-08-24) - - -### Bug Fixes - -* **typescript-estree:** ts.NamedTupleMember workaround for TypeScript ESTree +# `@typescript-eslint/typescript-estree` -

A parser that converts TypeScript source code into an ESTree-compatible form

- -

- CI - NPM Version - NPM Downloads -

- -## Getting Started - -**[You can find our Getting Started docs here](https://typescript-eslint.io/docs/linting)** - -## About - -This parser is somewhat generic and robust, and could be used to power any use-case which requires taking TypeScript source code and producing an ESTree-compatible AST. - -In fact, it is already used within these hyper-popular open-source projects to power their TypeScript support: - -- [ESLint](https://eslint.org), the pluggable linting utility for JavaScript and JSX -- [Prettier](https://prettier.io), an opinionated code formatter - -## Installation - -```sh -yarn add -D @typescript-eslint/typescript-estree -``` - -## API - -### Parsing - -#### `parse(code, options)` - -Parses the given string of code with the options provided and returns an ESTree-compatible AST. - -```ts -interface ParseOptions { - /** - * create a top-level comments array containing all comments - */ - comment?: boolean; - - /** - * An array of modules to turn explicit debugging on for. - * - 'typescript-eslint' is the same as setting the env var `DEBUG=typescript-eslint:*` - * - 'eslint' is the same as setting the env var `DEBUG=eslint:*` - * - 'typescript' is the same as setting `extendedDiagnostics: true` in your tsconfig compilerOptions - * - * For convenience, also supports a boolean: - * - true === ['typescript-eslint'] - * - false === [] - */ - debugLevel?: boolean | ('typescript-eslint' | 'eslint' | 'typescript')[]; - - /** - * Cause the parser to error if it encounters an unknown AST node type (useful for testing). - * This case only usually occurs when TypeScript releases new features. - */ - errorOnUnknownASTType?: boolean; - - /** - * Absolute (or relative to `cwd`) path to the file being parsed. - */ - filePath?: string; - - /** - * Enable parsing of JSX. - * For more details, see https://www.typescriptlang.org/docs/handbook/jsx.html - * - * NOTE: this setting does not effect known file types (.js, .cjs, .mjs, .jsx, .ts, .mts, .cts, .tsx, .json) because the - * TypeScript compiler has its own internal handling for known file extensions. - * - * For the exact behavior, see https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/parser#parseroptionsecmafeaturesjsx - */ - jsx?: boolean; - - /** - * Controls whether the `loc` information to each node. - * The `loc` property is an object which contains the exact line/column the node starts/ends on. - * This is similar to the `range` property, except it is line/column relative. - */ - loc?: boolean; - - /* - * Allows overriding of function used for logging. - * When value is `false`, no logging will occur. - * When value is not provided, `console.log()` will be used. - */ - loggerFn?: Function | false; - - /** - * Controls whether the `range` property is included on AST nodes. - * The `range` property is a [number, number] which indicates the start/end index of the node in the file contents. - * This is similar to the `loc` property, except this is the absolute index. - */ - range?: boolean; - - /** - * Set to true to create a top-level array containing all tokens from the file. - */ - tokens?: boolean; -} - -const PARSE_DEFAULT_OPTIONS: ParseOptions = { - comment: false, - errorOnUnknownASTType: false, - filePath: 'estree.ts', // or 'estree.tsx', if you pass jsx: true - jsx: false, - loc: false, - loggerFn: undefined, - range: false, - tokens: false, -}; - -declare function parse( - code: string, - options: ParseOptions = PARSE_DEFAULT_OPTIONS, -): TSESTree.Program; -``` - -Example usage: - -```js -import { parse } from '@typescript-eslint/typescript-estree'; - -const code = `const hello: string = 'world';`; -const ast = parse(code, { - loc: true, - range: true, -}); -``` - -#### `parseAndGenerateServices(code, options)` - -Parses the given string of code with the options provided and returns an ESTree-compatible AST. Accepts additional options which can be used to generate type information along with the AST. - -```ts -interface ParseAndGenerateServicesOptions extends ParseOptions { - /** - * Causes the parser to error if the TypeScript compiler returns any unexpected syntax/semantic errors. - */ - errorOnTypeScriptSyntacticAndSemanticIssues?: boolean; - - /** - * ***EXPERIMENTAL FLAG*** - Use this at your own risk. - * - * Causes TS to use the source files for referenced projects instead of the compiled .d.ts files. - * This feature is not yet optimized, and is likely to cause OOMs for medium to large projects. - * - * This flag REQUIRES at least TS v3.9, otherwise it does nothing. - * - * See: https://github.com/typescript-eslint/typescript-eslint/issues/2094 - */ - EXPERIMENTAL_useSourceOfProjectReferenceRedirect?: boolean; - - /** - * When `project` is provided, this controls the non-standard file extensions which will be parsed. - * It accepts an array of file extensions, each preceded by a `.`. - */ - extraFileExtensions?: string[]; - - /** - * Absolute (or relative to `tsconfigRootDir`) path to the file being parsed. - * When `project` is provided, this is required, as it is used to fetch the file from the TypeScript compiler's cache. - */ - filePath?: string; - - /** - * Allows the user to control whether or not two-way AST node maps are preserved - * during the AST conversion process. - * - * By default: the AST node maps are NOT preserved, unless `project` has been specified, - * in which case the maps are made available on the returned `parserServices`. - * - * NOTE: If `preserveNodeMaps` is explicitly set by the user, it will be respected, - * regardless of whether or not `project` is in use. - */ - preserveNodeMaps?: boolean; - - /** - * Absolute (or relative to `tsconfigRootDir`) paths to the tsconfig(s). - * If this is provided, type information will be returned. - */ - project?: string | string[]; - - /** - * If you provide a glob (or globs) to the project option, you can use this option to ignore certain folders from - * being matched by the globs. - * This accepts an array of globs to ignore. - * - * By default, this is set to ["/node_modules/"] - */ - projectFolderIgnoreList?: string[]; - - /** - * The absolute path to the root directory for all provided `project`s. - */ - tsconfigRootDir?: string; - - /** - * An array of one or more instances of TypeScript Program objects to be used for type information. - * This overrides any program or programs that would have been computed from the `project` option. - * All linted files must be part of the provided program(s). - */ - programs?: Program[]; - - /** - *************************************************************************************** - * IT IS RECOMMENDED THAT YOU DO NOT USE THIS OPTION, AS IT CAUSES PERFORMANCE ISSUES. * - *************************************************************************************** - * - * When passed with `project`, this allows the parser to create a catch-all, default program. - * This means that if the parser encounters a file not included in any of the provided `project`s, - * it will not error, but will instead parse the file and its dependencies in a new program. - */ - createDefaultProgram?: boolean; - - /** - * ESLint (and therefore typescript-eslint) is used in both "single run"/one-time contexts, - * such as an ESLint CLI invocation, and long-running sessions (such as continuous feedback - * on a file in an IDE). - * - * When typescript-eslint handles TypeScript Program management behind the scenes, this distinction - * is important because there is significant overhead to managing the so called Watch Programs - * needed for the long-running use-case. - * - * When allowAutomaticSingleRunInference is enabled, we will use common heuristics to infer - * whether or not ESLint is being used as part of a single run. - */ - allowAutomaticSingleRunInference?: boolean; - - /** - * Path to a file exporting a custom ModuleResolver. - */ - moduleResolver?: string; -} - -interface ParserServices { - program: ts.Program; - esTreeNodeToTSNodeMap: WeakMap; - tsNodeToESTreeNodeMap: WeakMap; - hasFullTypeInformation: boolean; -} - -interface ParseAndGenerateServicesResult { - ast: TSESTree.Program; - services: ParserServices; -} - -const PARSE_AND_GENERATE_SERVICES_DEFAULT_OPTIONS: ParseOptions = { - ...PARSE_DEFAULT_OPTIONS, - errorOnTypeScriptSyntacticAndSemanticIssues: false, - extraFileExtensions: [], - preserveNodeMaps: false, // or true, if you do not set this, but pass `project` - project: undefined, - projectFolderIgnoreList: ['/node_modules/'], - tsconfigRootDir: process.cwd(), -}; - -declare function parseAndGenerateServices( - code: string, - options: ParseOptions = PARSE_DEFAULT_OPTIONS, -): ParseAndGenerateServicesResult; -``` - -Example usage: - -```js -import { parseAndGenerateServices } from '@typescript-eslint/typescript-estree'; - -const code = `const hello: string = 'world';`; -const { ast, services } = parseAndGenerateServices(code, { - filePath: '/some/path/to/file/foo.ts', - loc: true, - project: './tsconfig.json', - range: true, -}); -``` - -#### `parseWithNodeMaps(code, options)` - -Parses the given string of code with the options provided and returns both the ESTree-compatible AST as well as the node maps. -This allows you to work with both ASTs without the overhead of types that may come with `parseAndGenerateServices`. - -```ts -interface ParseWithNodeMapsResult { - ast: TSESTree.Program; - esTreeNodeToTSNodeMap: ParserServices['esTreeNodeToTSNodeMap']; - tsNodeToESTreeNodeMap: ParserServices['tsNodeToESTreeNodeMap']; -} - -declare function parseWithNodeMaps( - code: string, - options: ParseOptions = PARSE_DEFAULT_OPTIONS, -): ParseWithNodeMapsResult; -``` - -Example usage: - -```js -import { parseWithNodeMaps } from '@typescript-eslint/typescript-estree'; - -const code = `const hello: string = 'world';`; -const { ast, esTreeNodeToTSNodeMap, tsNodeToESTreeNodeMap } = parseWithNodeMaps( - code, - { - loc: true, - range: true, - }, -); -``` - -### `TSESTree`, `AST_NODE_TYPES` and `AST_TOKEN_TYPES` - -Types for the AST produced by the parse functions. - -- `TSESTree` is a namespace which contains object types representing all of the AST Nodes produced by the parser. -- `AST_NODE_TYPES` is an enum which provides the values for every single AST node's `type` property. -- `AST_TOKEN_TYPES` is an enum which provides the values for every single AST token's `type` property. - -### Utilities - -#### `createProgram(configFile, projectDirectory)` - -This serves as a utility method for users of the `ParseOptions.programs` feature to create a TypeScript program instance from a config file. - -```ts -declare function createProgram( - configFile: string, - projectDirectory: string = process.cwd(), -): import('typescript').Program; -``` - -Example usage: - -```js -const tsESTree = require('@typescript-eslint/typescript-estree'); - -const program = tsESTree.createProgram('tsconfig.json'); -const code = `const hello: string = 'world';`; -const { ast, services } = parseAndGenerateServices(code, { - filePath: '/some/path/to/file/foo.ts', - loc: true, - program, - range: true, -}); -``` - -## Supported TypeScript Version - -See the [Supported TypeScript Version](../../README.md#supported-typescript-version) section in the project root. - -If you use a non-supported version of TypeScript, the parser will log a warning to the console. - -**Please ensure that you are using a supported version before submitting any issues/bug reports.** - -## Reporting Issues - -Please check the current list of open and known issues and ensure the issue has not been reported before. When creating a new issue provide as much information about your environment as possible. This includes: - -- TypeScript version -- The `typescript-estree` version - -## AST Alignment Tests - -A couple of years after work on this parser began, the TypeScript Team at Microsoft began [officially supporting TypeScript parsing via Babel](https://blogs.msdn.microsoft.com/typescript/2018/08/27/typescript-and-babel-7/). - -I work closely with the TypeScript Team and we are gradually aligning the AST of this project with the one produced by Babel's parser. To that end, I have created a full test harness to compare the ASTs of the two projects which runs on every PR, please see [the code](https://github.com/typescript-eslint/typescript-eslint/tree/main/packages/typescript-estree/tests/ast-alignment) for more details. - -## Debugging - -If you encounter a bug with the parser that you want to investigate, you can turn on the debug logging via setting the environment variable: `DEBUG=typescript-eslint:*`. -I.e. in this repo you can run: `DEBUG=typescript-eslint:* yarn lint`. - -## License - -TypeScript ESTree inherits from the the original TypeScript ESLint Parser license, as the majority of the work began there. It is licensed under a permissive BSD 2-clause license. +[![NPM Version](https://img.shields.io/npm/v/@typescript-eslint/typescript-estree.svg?style=flat-square)](https://www.npmjs.com/package/@typescript-eslint/utils) +[![NPM Downloads](https://img.shields.io/npm/dm/@typescript-eslint/typescript-estree.svg?style=flat-square)](https://www.npmjs.com/package/@typescript-eslint/utils) ## Contributing -[See the contributing guide here](../../CONTRIBUTING.md) +👉 See **https://typescript-eslint.io/architecture/typescript-estree** for documentation on this package. + +> See https://typescript-eslint.io for general documentation on typescript-eslint, the tooling that allows you to run ESLint and Prettier on TypeScript code. diff --git a/packages/typescript-estree/package.json b/packages/typescript-estree/package.json index df745ec45e1..728c8d417e9 100644 --- a/packages/typescript-estree/package.json +++ b/packages/typescript-estree/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/typescript-estree", - "version": "5.31.0", + "version": "5.50.0", "description": "A parser that converts TypeScript source code into an ESTree compatible form", "main": "dist/index.js", "types": "dist/index.d.ts", @@ -37,13 +37,13 @@ "clean": "tsc -b tsconfig.build.json --clean", "postclean": "rimraf dist && rimraf _ts3.4 && rimraf coverage", "format": "prettier --write \"./**/*.{ts,mts,cts,tsx,js,mjs,cjs,jsx,json,md,css}\" --ignore-path ../../.prettierignore", - "lint": "eslint . --ignore-path='../../.eslintignore'", + "lint": "nx lint", "test": "jest --coverage", "typecheck": "tsc -p tsconfig.json --noEmit" }, "dependencies": { - "@typescript-eslint/types": "5.31.0", - "@typescript-eslint/visitor-keys": "5.31.0", + "@typescript-eslint/types": "5.50.0", + "@typescript-eslint/visitor-keys": "5.50.0", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -59,7 +59,7 @@ "@types/is-glob": "*", "@types/semver": "*", "@types/tmp": "*", - "@typescript-eslint/shared-fixtures": "5.31.0", + "@typescript-eslint/shared-fixtures": "5.50.0", "glob": "*", "jest-specific-snapshot": "*", "make-dir": "*", diff --git a/packages/typescript-estree/project.json b/packages/typescript-estree/project.json index fe32123b550..2856ffe4f07 100644 --- a/packages/typescript-estree/project.json +++ b/packages/typescript-estree/project.json @@ -1,5 +1,15 @@ { - "root": "packages/typescript-estree", + "name": "typescript-estree", + "$schema": "../../node_modules/nx/schemas/project-schema.json", "type": "library", - "implicitDependencies": ["@typescript-eslint/types"] + "implicitDependencies": ["types"], + "targets": { + "lint": { + "executor": "@nrwl/linter:eslint", + "outputs": ["{options.outputFile}"], + "options": { + "lintFilePatterns": ["packages/typescript-estree/**/*.ts"] + } + } + } } diff --git a/packages/typescript-estree/src/ast-converter.ts b/packages/typescript-estree/src/ast-converter.ts index 49ffd28f479..b9be864f529 100644 --- a/packages/typescript-estree/src/ast-converter.ts +++ b/packages/typescript-estree/src/ast-converter.ts @@ -1,14 +1,16 @@ import type { SourceFile } from 'typescript'; -import { convertError, Converter, ASTMaps } from './convert'; + +import type { ASTMaps } from './convert'; +import { Converter, convertError } from './convert'; import { convertComments } from './convert-comments'; import { convertTokens } from './node-utils'; -import type { Extra } from './parser-options'; -import type { TSESTree } from './ts-estree'; +import type { ParseSettings } from './parseSettings'; import { simpleTraverse } from './simple-traverse'; +import type { TSESTree } from './ts-estree'; export function astConverter( ast: SourceFile, - extra: Extra, + parseSettings: ParseSettings, shouldPreserveNodeMaps: boolean, ): { estree: TSESTree.Program; astMaps: ASTMaps } { /** @@ -24,7 +26,7 @@ export function astConverter( * Recursively convert the TypeScript AST into an ESTree-compatible AST */ const instance = new Converter(ast, { - errorOnUnknownASTType: extra.errorOnUnknownASTType || false, + errorOnUnknownASTType: parseSettings.errorOnUnknownASTType || false, shouldPreserveNodeMaps, }); @@ -33,15 +35,15 @@ export function astConverter( /** * Optionally remove range and loc if specified */ - if (!extra.range || !extra.loc) { + if (!parseSettings.range || !parseSettings.loc) { simpleTraverse(estree, { enter: node => { - if (!extra.range) { + if (!parseSettings.range) { // eslint-disable-next-line @typescript-eslint/ban-ts-comment -- TS 4.0 made this an error because the types aren't optional // @ts-expect-error delete node.range; } - if (!extra.loc) { + if (!parseSettings.loc) { // eslint-disable-next-line @typescript-eslint/ban-ts-comment -- TS 4.0 made this an error because the types aren't optional // @ts-expect-error delete node.loc; @@ -53,15 +55,15 @@ export function astConverter( /** * Optionally convert and include all tokens in the AST */ - if (extra.tokens) { + if (parseSettings.tokens) { estree.tokens = convertTokens(ast); } /** * Optionally convert and include all comments in the AST */ - if (extra.comment) { - estree.comments = convertComments(ast, extra.code); + if (parseSettings.comment) { + estree.comments = convertComments(ast, parseSettings.code); } const astMaps = instance.getASTMaps(); diff --git a/packages/typescript-estree/src/convert-comments.ts b/packages/typescript-estree/src/convert-comments.ts index effc4ead907..d4dd9f124a7 100644 --- a/packages/typescript-estree/src/convert-comments.ts +++ b/packages/typescript-estree/src/convert-comments.ts @@ -1,7 +1,9 @@ -import * as ts from 'typescript'; import { forEachComment } from 'tsutils/util/util'; +import * as ts from 'typescript'; + import { getLocFor } from './node-utils'; -import { AST_TOKEN_TYPES, TSESTree } from './ts-estree'; +import type { TSESTree } from './ts-estree'; +import { AST_TOKEN_TYPES } from './ts-estree'; /** * Convert all comments for the given AST. @@ -20,7 +22,7 @@ export function convertComments( ast, (_, comment) => { const type = - comment.kind == ts.SyntaxKind.SingleLineCommentTrivia + comment.kind === ts.SyntaxKind.SingleLineCommentTrivia ? AST_TOKEN_TYPES.Line : AST_TOKEN_TYPES.Block; const range: TSESTree.Range = [comment.pos, comment.end]; diff --git a/packages/typescript-estree/src/convert.ts b/packages/typescript-estree/src/convert.ts index a1bd4489e3b..1b1f78041bb 100644 --- a/packages/typescript-estree/src/convert.ts +++ b/packages/typescript-estree/src/convert.ts @@ -1,6 +1,9 @@ // There's lots of funny stuff due to the typing of ts.Node /* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-member-access */ import * as ts from 'typescript'; + +import { getDecorators, getModifiers } from './getModifiers'; +import type { TSError } from './node-utils'; import { canContainDirective, createError, @@ -21,7 +24,6 @@ import { isESTreeClassMember, isOptional, isThisInTypeQuery, - TSError, unescapeStringLiteralText, } from './node-utils'; import type { @@ -29,12 +31,8 @@ import type { ParserWeakMapESTreeToTSNode, } from './parser-options'; import type { SemanticOrSyntacticError } from './semantic-or-syntactic-errors'; -import { - AST_NODE_TYPES, - TSESTree, - TSESTreeToTSNode, - TSNode, -} from './ts-estree'; +import type { TSESTree, TSESTreeToTSNode, TSNode } from './ts-estree'; +import { AST_NODE_TYPES } from './ts-estree'; import { typescriptVersionIsAtLeast } from './version-check'; const SyntaxKind = ts.SyntaxKind; @@ -160,14 +158,15 @@ export class Converter { result: T, ): TSESTree.ExportDefaultDeclaration | TSESTree.ExportNamedDeclaration | T { // check for exports - if (node.modifiers && node.modifiers[0].kind === SyntaxKind.ExportKeyword) { + const modifiers = getModifiers(node); + if (modifiers?.[0].kind === SyntaxKind.ExportKeyword) { /** * Make sure that original node is registered instead of export */ this.registerTSNodeInNodeMap(node, result); - const exportKeyword = node.modifiers[0]; - const nextModifier = node.modifiers[1]; + const exportKeyword = modifiers[0]; + const nextModifier = modifiers[1]; const declarationIsDefault = nextModifier && nextModifier.kind === SyntaxKind.DefaultKeyword; @@ -402,16 +401,15 @@ export class Converter { private convertParameters( parameters: ts.NodeArray, ): TSESTree.Parameter[] { - if (!parameters || !parameters.length) { + if (!parameters?.length) { return []; } return parameters.map(param => { const convertedParam = this.convertChild(param) as TSESTree.Parameter; - if (param.decorators?.length) { - convertedParam.decorators = param.decorators.map(el => - this.convertChild(el), - ); + const decorators = getDecorators(param); + if (decorators?.length) { + convertedParam.decorators = decorators.map(el => this.convertChild(el)); } return convertedParam; }); @@ -512,17 +510,38 @@ export class Converter { ) : null; } - if ('decorators' in node && node.decorators && node.decorators.length) { - result.decorators = node.decorators.map(el => this.convertChild(el)); + const decorators = getDecorators(node); + if (decorators?.length) { + result.decorators = decorators.map(el => this.convertChild(el)); } + // keys we never want to clone from the base typescript node as they + // introduce garbage into our AST + const KEYS_TO_NOT_COPY = new Set([ + '_children', + 'decorators', + 'end', + 'flags', + 'illegalDecorators', + 'heritageClauses', + 'locals', + 'localSymbol', + 'jsDoc', + 'kind', + 'modifierFlagsCache', + 'modifiers', + 'nextContainer', + 'parent', + 'pos', + 'symbol', + 'transformFlags', + 'type', + 'typeArguments', + 'typeParameters', + ]); + Object.entries(node) - .filter( - ([key]) => - !/^(?:_children|kind|parent|pos|end|flags|modifierFlagsCache|jsDoc|type|typeArguments|typeParameters|decorators|transformFlags)$/.test( - key, - ), - ) + .filter(([key]) => !KEYS_TO_NOT_COPY.has(key)) .forEach(([key, value]) => { if (Array.isArray(value)) { result[key] = value.map(el => this.convertChild(el as TSNode)); @@ -682,18 +701,21 @@ export class Converter { /** * Applies the given TS modifiers to the given result object. + * + * This method adds not standardized `modifiers` property in nodes + * * @param result * @param modifiers original ts.Nodes from the node.modifiers array * @returns the current result object will be mutated - * @deprecated This method adds not standardized `modifiers` property in nodes */ private applyModifiersToResult( result: TSESTree.TSEnumDeclaration | TSESTree.TSModuleDeclaration, - modifiers?: ts.ModifiersArray, + modifiers: Iterable | undefined, ): void { - if (!modifiers || !modifiers.length) { + if (!modifiers) { return; } + const remainingModifiers: TSESTree.Modifier[] = []; /** * Some modifiers are explicitly handled by applying them as @@ -728,7 +750,7 @@ export class Converter { * not been explicitly handled above, we just convert and * add the modifiers array to the result node. */ - if (remainingModifiers.length) { + if (remainingModifiers.length > 0) { result.modifiers = remainingModifiers; } } @@ -1034,14 +1056,11 @@ export class Converter { /** * Semantically, decorators are not allowed on variable declarations, - * but the TypeScript compiler will parse them and produce a valid AST, - * so we handle them here too. + * Pre 4.8 TS would include them in the AST, so we did as well. + * However as of 4.8 TS no longer includes it (as it is, well, invalid). + * + * So for consistency across versions, we no longer include it either. */ - if (node.decorators) { - (result as any).decorators = node.decorators.map(el => - this.convertChild(el), - ); - } if (hasModifier(SyntaxKind.DeclareKeyword, node)) { result.declare = true; @@ -1151,12 +1170,30 @@ export class Converter { case SyntaxKind.PropertyDeclaration: { const isAbstract = hasModifier(SyntaxKind.AbstractKeyword, node); + const isAccessor = hasModifier(SyntaxKind.AccessorKeyword, node); + + // eslint-disable-next-line @typescript-eslint/explicit-function-return-type -- TODO - add ignore IIFE option + const type = (() => { + if (isAccessor) { + if (isAbstract) { + return AST_NODE_TYPES.TSAbstractAccessorProperty; + } + return AST_NODE_TYPES.AccessorProperty; + } + + if (isAbstract) { + return AST_NODE_TYPES.TSAbstractPropertyDefinition; + } + return AST_NODE_TYPES.PropertyDefinition; + })(); + const result = this.createNode< - TSESTree.TSAbstractPropertyDefinition | TSESTree.PropertyDefinition + | TSESTree.TSAbstractAccessorProperty + | TSESTree.TSAbstractPropertyDefinition + | TSESTree.PropertyDefinition + | TSESTree.AccessorProperty >(node, { - type: isAbstract - ? AST_NODE_TYPES.TSAbstractPropertyDefinition - : AST_NODE_TYPES.PropertyDefinition, + type, key: this.convertChild(node.name), value: isAbstract ? null : this.convertChild(node.initializer), computed: isComputedProperty(node.name), @@ -1170,8 +1207,9 @@ export class Converter { result.typeAnnotation = this.convertTypeAnnotation(node.type, node); } - if (node.decorators) { - result.decorators = node.decorators.map(el => this.convertChild(el)); + const decorators = getDecorators(node); + if (decorators) { + result.decorators = decorators.map(el => this.convertChild(el)); } const accessibility = getTSNodeAccessibility(node); @@ -1284,10 +1322,9 @@ export class Converter { override: hasModifier(SyntaxKind.OverrideKeyword, node), }); - if (node.decorators) { - result.decorators = node.decorators.map(el => - this.convertChild(el), - ); + const decorators = getDecorators(node); + if (decorators) { + result.decorators = decorators.map(el => this.convertChild(el)); } const accessibility = getTSNodeAccessibility(node); @@ -1621,7 +1658,8 @@ export class Converter { right: this.convertChild(node.initializer), }); - if (node.modifiers) { + const modifiers = getModifiers(node); + if (modifiers) { // AssignmentPattern should not contain modifiers in range result.range[0] = parameter.range[0]; result.loc = getLocFor(result.range[0], result.range[1], this.ast); @@ -1649,7 +1687,8 @@ export class Converter { parameter.optional = true; } - if (node.modifiers) { + const modifiers = getModifiers(node); + if (modifiers) { return this.createNode(node, { type: AST_NODE_TYPES.TSParameterProperty, accessibility: getTSNodeAccessibility(node) ?? undefined, @@ -1740,8 +1779,9 @@ export class Converter { result.declare = true; } - if (node.decorators) { - result.decorators = node.decorators.map(el => this.convertChild(el)); + const decorators = getDecorators(node); + if (decorators) { + result.decorators = decorators.map(el => this.convertChild(el)); } const filteredMembers = node.members.filter(isESTreeClassMember); @@ -2148,7 +2188,7 @@ export class Converter { type: AST_NODE_TYPES.Literal, raw: rawValue, value: value, - bigint: value === null ? bigint : String(value), + bigint: value == null ? bigint : String(value), range, }); } @@ -2519,7 +2559,11 @@ export class Converter { typeAnnotation: node.type ? this.convertTypeAnnotation(node.type, node) : undefined, - initializer: this.convertChild(node.initializer) || undefined, + initializer: + this.convertChild( + // eslint-disable-next-line deprecation/deprecation -- TODO breaking change remove this from the AST + node.initializer, + ) || undefined, readonly: hasModifier(SyntaxKind.ReadonlyKeyword, node) || undefined, static: hasModifier(SyntaxKind.StaticKeyword, node) || undefined, export: hasModifier(SyntaxKind.ExportKeyword, node) || undefined, @@ -2734,7 +2778,7 @@ export class Converter { members: node.members.map(el => this.convertChild(el)), }); // apply modifiers first... - this.applyModifiersToResult(result, node.modifiers); + this.applyModifiersToResult(result, getModifiers(node)); // ...then check for exports return this.fixExports(node, result); } @@ -2762,7 +2806,7 @@ export class Converter { result.body = this.convertChild(node.body); } // apply modifiers first... - this.applyModifiersToResult(result, node.modifiers); + this.applyModifiersToResult(result, getModifiers(node)); if (node.flags & ts.NodeFlags.GlobalAugmentation) { result.global = true; } @@ -2937,6 +2981,14 @@ export class Converter { }); } + case SyntaxKind.SatisfiesExpression: { + return this.createNode(node, { + type: AST_NODE_TYPES.TSSatisfiesExpression, + expression: this.convertChild(node.expression), + typeAnnotation: this.convertChild(node.type), + }); + } + default: return this.deeplyCopy(node); } diff --git a/packages/typescript-estree/src/create-program/WatchCompilerHostOfConfigFile.ts b/packages/typescript-estree/src/create-program/WatchCompilerHostOfConfigFile.ts index 565f58417c8..667e2b4b05e 100644 --- a/packages/typescript-estree/src/create-program/WatchCompilerHostOfConfigFile.ts +++ b/packages/typescript-estree/src/create-program/WatchCompilerHostOfConfigFile.ts @@ -2,7 +2,7 @@ // They have been trimmed down to only include the relevant bits // We use some special internal TS apis to help us do our parsing flexibly -import * as ts from 'typescript'; +import type * as ts from 'typescript'; // https://github.com/microsoft/TypeScript/blob/b84e65db4ea5c39dbaa2ccd6594efe4653318251/src/compiler/watchUtilities.ts#L6-L18 interface DirectoryStructureHost { diff --git a/packages/typescript-estree/src/create-program/createDefaultProgram.ts b/packages/typescript-estree/src/create-program/createDefaultProgram.ts index 6e8c2161250..a2de81399d2 100644 --- a/packages/typescript-estree/src/create-program/createDefaultProgram.ts +++ b/packages/typescript-estree/src/create-program/createDefaultProgram.ts @@ -1,10 +1,10 @@ import debug from 'debug'; import path from 'path'; import * as ts from 'typescript'; -import { Extra } from '../parser-options'; + +import type { ParseSettings } from '../parseSettings'; +import type { ASTAndProgram } from './shared'; import { - ASTAndProgram, - CanonicalPath, createDefaultCompilerOptionsFromExtra, getModuleResolver, } from './shared'; @@ -12,27 +12,26 @@ import { const log = debug('typescript-eslint:typescript-estree:createDefaultProgram'); /** - * @param code The code of the file being linted - * @param extra The config object - * @param extra.tsconfigRootDir The root directory for relative tsconfig paths - * @param extra.projects Provided tsconfig paths + * @param parseSettings Internal settings for parsing the file * @returns If found, returns the source file corresponding to the code and the containing program */ function createDefaultProgram( - code: string, - extra: Extra, + parseSettings: ParseSettings, ): ASTAndProgram | undefined { - log('Getting default program for: %s', extra.filePath || 'unnamed file'); + log( + 'Getting default program for: %s', + parseSettings.filePath || 'unnamed file', + ); - if (!extra.projects || extra.projects.length !== 1) { + if (parseSettings.projects?.length !== 1) { return undefined; } - const tsconfigPath: CanonicalPath = extra.projects[0]; + const tsconfigPath = parseSettings.projects[0]; const commandLine = ts.getParsedCommandLineOfConfigFile( tsconfigPath, - createDefaultCompilerOptionsFromExtra(extra), + createDefaultCompilerOptionsFromExtra(parseSettings), { ...ts.sys, onUnRecoverableConfigFileDiagnostic: () => {} }, ); @@ -45,24 +44,24 @@ function createDefaultProgram( /* setParentNodes */ true, ); - if (extra.moduleResolver) { + if (parseSettings.moduleResolver) { compilerHost.resolveModuleNames = getModuleResolver( - extra.moduleResolver, + parseSettings.moduleResolver, ).resolveModuleNames; } const oldReadFile = compilerHost.readFile; compilerHost.readFile = (fileName: string): string | undefined => - path.normalize(fileName) === path.normalize(extra.filePath) - ? code + path.normalize(fileName) === path.normalize(parseSettings.filePath) + ? parseSettings.code : oldReadFile(fileName); const program = ts.createProgram( - [extra.filePath], + [parseSettings.filePath], commandLine.options, compilerHost, ); - const ast = program.getSourceFile(extra.filePath); + const ast = program.getSourceFile(parseSettings.filePath); return ast && { ast, program }; } diff --git a/packages/typescript-estree/src/create-program/createIsolatedProgram.ts b/packages/typescript-estree/src/create-program/createIsolatedProgram.ts index c4392941bb6..5ec1c8e0fe7 100644 --- a/packages/typescript-estree/src/create-program/createIsolatedProgram.ts +++ b/packages/typescript-estree/src/create-program/createIsolatedProgram.ts @@ -1,8 +1,10 @@ import debug from 'debug'; import * as ts from 'typescript'; -import { Extra } from '../parser-options'; -import { ASTAndProgram, createDefaultCompilerOptionsFromExtra } from './shared'; + +import type { ParseSettings } from '../parseSettings'; import { getScriptKind } from './getScriptKind'; +import type { ASTAndProgram } from './shared'; +import { createDefaultCompilerOptionsFromExtra } from './shared'; const log = debug('typescript-eslint:typescript-estree:createIsolatedProgram'); @@ -10,11 +12,11 @@ const log = debug('typescript-eslint:typescript-estree:createIsolatedProgram'); * @param code The code of the file being linted * @returns Returns a new source file and program corresponding to the linted code */ -function createIsolatedProgram(code: string, extra: Extra): ASTAndProgram { +function createIsolatedProgram(parseSettings: ParseSettings): ASTAndProgram { log( 'Getting isolated program in %s mode for: %s', - extra.jsx ? 'TSX' : 'TS', - extra.filePath, + parseSettings.jsx ? 'TSX' : 'TS', + parseSettings.filePath, ); const compilerHost: ts.CompilerHost = { @@ -22,7 +24,7 @@ function createIsolatedProgram(code: string, extra: Extra): ASTAndProgram { return true; }, getCanonicalFileName() { - return extra.filePath; + return parseSettings.filePath; }, getCurrentDirectory() { return ''; @@ -41,10 +43,10 @@ function createIsolatedProgram(code: string, extra: Extra): ASTAndProgram { getSourceFile(filename: string) { return ts.createSourceFile( filename, - code, + parseSettings.code, ts.ScriptTarget.Latest, /* setParentNodes */ true, - getScriptKind(extra.filePath, extra.jsx), + getScriptKind(parseSettings.filePath, parseSettings.jsx), ); }, readFile() { @@ -59,17 +61,17 @@ function createIsolatedProgram(code: string, extra: Extra): ASTAndProgram { }; const program = ts.createProgram( - [extra.filePath], + [parseSettings.filePath], { noResolve: true, target: ts.ScriptTarget.Latest, - jsx: extra.jsx ? ts.JsxEmit.Preserve : undefined, - ...createDefaultCompilerOptionsFromExtra(extra), + jsx: parseSettings.jsx ? ts.JsxEmit.Preserve : undefined, + ...createDefaultCompilerOptionsFromExtra(parseSettings), }, compilerHost, ); - const ast = program.getSourceFile(extra.filePath); + const ast = program.getSourceFile(parseSettings.filePath); if (!ast) { throw new Error( 'Expected an ast to be returned for the single-file isolated program.', diff --git a/packages/typescript-estree/src/create-program/createProjectProgram.ts b/packages/typescript-estree/src/create-program/createProjectProgram.ts index 4558cc36b55..77a3bec2141 100644 --- a/packages/typescript-estree/src/create-program/createProjectProgram.ts +++ b/packages/typescript-estree/src/create-program/createProjectProgram.ts @@ -1,10 +1,12 @@ import debug from 'debug'; import path from 'path'; import * as ts from 'typescript'; -import { getProgramsForProjects } from './createWatchProgram'; + import { firstDefined } from '../node-utils'; -import { Extra } from '../parser-options'; -import { ASTAndProgram, getAstFromProgram } from './shared'; +import type { ParseSettings } from '../parseSettings'; +import { getWatchProgramsForProjects } from './getWatchProgramsForProjects'; +import type { ASTAndProgram } from './shared'; +import { getAstFromProgram } from './shared'; const log = debug('typescript-eslint:typescript-estree:createProjectProgram'); @@ -20,77 +22,94 @@ const DEFAULT_EXTRA_FILE_EXTENSIONS = [ ] as readonly string[]; /** - * @param code The code of the file being linted - * @param createDefaultProgram True if the default program should be created - * @param extra The config object - * @returns If found, returns the source file corresponding to the code and the containing program + * @param parseSettings Internal settings for parsing the file + * @returns If found, the source file corresponding to the code and the containing program */ function createProjectProgram( - code: string, - createDefaultProgram: boolean, - extra: Extra, + parseSettings: ParseSettings, ): ASTAndProgram | undefined { - log('Creating project program for: %s', extra.filePath); + log('Creating project program for: %s', parseSettings.filePath); - const astAndProgram = firstDefined( - getProgramsForProjects(code, extra.filePath, extra), - currentProgram => getAstFromProgram(currentProgram, extra), + const programsForProjects = getWatchProgramsForProjects(parseSettings); + const astAndProgram = firstDefined(programsForProjects, currentProgram => + getAstFromProgram(currentProgram, parseSettings), ); - if (!astAndProgram && !createDefaultProgram) { - // the file was either not matched within the tsconfig, or the extension wasn't expected - const errorLines = [ - '"parserOptions.project" has been set for @typescript-eslint/parser.', - `The file does not match your project config: ${path.relative( - extra.tsconfigRootDir || process.cwd(), - extra.filePath, - )}.`, - ]; - let hasMatchedAnError = false; + // The file was either matched within the tsconfig, or we allow creating a default program + if (astAndProgram || parseSettings.createDefaultProgram) { + return astAndProgram; + } - const extraFileExtensions = extra.extraFileExtensions || []; + const describeFilePath = (filePath: string): string => { + const relative = path.relative( + parseSettings.tsconfigRootDir || process.cwd(), + filePath, + ); + if (parseSettings.tsconfigRootDir) { + return `/${relative}`; + } + return `/${relative}`; + }; - extraFileExtensions.forEach(extraExtension => { - if (!extraExtension.startsWith('.')) { - errorLines.push( - `Found unexpected extension "${extraExtension}" specified with the "extraFileExtensions" option. Did you mean ".${extraExtension}"?`, - ); - } - if (DEFAULT_EXTRA_FILE_EXTENSIONS.includes(extraExtension)) { - errorLines.push( - `You unnecessarily included the extension "${extraExtension}" with the "extraFileExtensions" option. This extension is already handled by the parser by default.`, - ); - } - }); + const describedFilePath = describeFilePath(parseSettings.filePath); + const relativeProjects = parseSettings.projects.map(describeFilePath); + const describedPrograms = + relativeProjects.length === 1 + ? relativeProjects[0] + : `\n${relativeProjects.map(project => `- ${project}`).join('\n')}`; + const errorLines = [ + `ESLint was configured to run on \`${describedFilePath}\` using \`parserOptions.project\`: ${describedPrograms}`, + ]; + let hasMatchedAnError = false; + + const extraFileExtensions = parseSettings.extraFileExtensions || []; - const fileExtension = path.extname(extra.filePath); - if (!DEFAULT_EXTRA_FILE_EXTENSIONS.includes(fileExtension)) { - const nonStandardExt = `The extension for the file (${fileExtension}) is non-standard`; - if (extraFileExtensions.length > 0) { - if (!extraFileExtensions.includes(fileExtension)) { - errorLines.push( - `${nonStandardExt}. It should be added to your existing "parserOptions.extraFileExtensions".`, - ); - hasMatchedAnError = true; - } - } else { + extraFileExtensions.forEach(extraExtension => { + if (!extraExtension.startsWith('.')) { + errorLines.push( + `Found unexpected extension \`${extraExtension}\` specified with the \`parserOptions.extraFileExtensions\` option. Did you mean \`.${extraExtension}\`?`, + ); + } + if (DEFAULT_EXTRA_FILE_EXTENSIONS.includes(extraExtension)) { + errorLines.push( + `You unnecessarily included the extension \`${extraExtension}\` with the \`parserOptions.extraFileExtensions\` option. This extension is already handled by the parser by default.`, + ); + } + }); + + const fileExtension = path.extname(parseSettings.filePath); + if (!DEFAULT_EXTRA_FILE_EXTENSIONS.includes(fileExtension)) { + const nonStandardExt = `The extension for the file (\`${fileExtension}\`) is non-standard`; + if (extraFileExtensions.length > 0) { + if (!extraFileExtensions.includes(fileExtension)) { errorLines.push( - `${nonStandardExt}. You should add "parserOptions.extraFileExtensions" to your config.`, + `${nonStandardExt}. It should be added to your existing \`parserOptions.extraFileExtensions\`.`, ); hasMatchedAnError = true; } - } - - if (!hasMatchedAnError) { + } else { errorLines.push( - 'The file must be included in at least one of the projects provided.', + `${nonStandardExt}. You should add \`parserOptions.extraFileExtensions\` to your config.`, ); + hasMatchedAnError = true; } + } - throw new Error(errorLines.join('\n')); + if (!hasMatchedAnError) { + const [describedInclusions, describedSpecifiers] = + parseSettings.projects.length === 1 + ? ['that TSConfig does not', 'that TSConfig'] + : ['none of those TSConfigs', 'one of those TSConfigs']; + errorLines.push( + `However, ${describedInclusions} include this file. Either:`, + `- Change ESLint's list of included files to not include this file`, + `- Change ${describedSpecifiers} to include this file`, + `- Create a new TSConfig that includes this file and include it in your parserOptions.project`, + `See the typescript-eslint docs for more info: https://typescript-eslint.io/linting/troubleshooting#i-get-errors-telling-me-eslint-was-configured-to-run--however-that-tsconfig-does-not--none-of-those-tsconfigs-include-this-file`, + ); } - return astAndProgram; + throw new Error(errorLines.join('\n')); } export { createProjectProgram }; diff --git a/packages/typescript-estree/src/create-program/createSourceFile.ts b/packages/typescript-estree/src/create-program/createSourceFile.ts index e3c6acf6dff..806e503f0e4 100644 --- a/packages/typescript-estree/src/create-program/createSourceFile.ts +++ b/packages/typescript-estree/src/create-program/createSourceFile.ts @@ -1,23 +1,24 @@ import debug from 'debug'; import * as ts from 'typescript'; -import { Extra } from '../parser-options'; + +import type { ParseSettings } from '../parseSettings'; import { getScriptKind } from './getScriptKind'; const log = debug('typescript-eslint:typescript-estree:createSourceFile'); -function createSourceFile(code: string, extra: Extra): ts.SourceFile { +function createSourceFile(parseSettings: ParseSettings): ts.SourceFile { log( 'Getting AST without type information in %s mode for: %s', - extra.jsx ? 'TSX' : 'TS', - extra.filePath, + parseSettings.jsx ? 'TSX' : 'TS', + parseSettings.filePath, ); return ts.createSourceFile( - extra.filePath, - code, + parseSettings.filePath, + parseSettings.code, ts.ScriptTarget.Latest, /* setParentNodes */ true, - getScriptKind(extra.filePath, extra.jsx), + getScriptKind(parseSettings.filePath, parseSettings.jsx), ); } diff --git a/packages/typescript-estree/src/create-program/createWatchProgram.ts b/packages/typescript-estree/src/create-program/getWatchProgramsForProjects.ts similarity index 88% rename from packages/typescript-estree/src/create-program/createWatchProgram.ts rename to packages/typescript-estree/src/create-program/getWatchProgramsForProjects.ts index ae2dec4de51..d9d4de9c833 100644 --- a/packages/typescript-estree/src/create-program/createWatchProgram.ts +++ b/packages/typescript-estree/src/create-program/getWatchProgramsForProjects.ts @@ -2,15 +2,17 @@ import debug from 'debug'; import fs from 'fs'; import semver from 'semver'; import * as ts from 'typescript'; -import { Extra } from '../parser-options'; -import { WatchCompilerHostOfConfigFile } from './WatchCompilerHostOfConfigFile'; + +import type { ParseSettings } from '../parseSettings'; +import type { CanonicalPath } from './shared'; import { canonicalDirname, - CanonicalPath, createDefaultCompilerOptionsFromExtra, + createHash, getCanonicalFileName, getModuleResolver, } from './shared'; +import type { WatchCompilerHostOfConfigFile } from './WatchCompilerHostOfConfigFile'; const log = debug('typescript-eslint:typescript-estree:createWatchProgram'); @@ -104,56 +106,39 @@ function diagnosticReporter(diagnostic: ts.Diagnostic): void { ); } -/** - * Hash content for compare content. - * @param content hashed contend - * @returns hashed result - */ -function createHash(content: string): string { - // No ts.sys in browser environments. - if (ts.sys?.createHash) { - return ts.sys.createHash(content); - } - return content; -} - function updateCachedFileList( tsconfigPath: CanonicalPath, program: ts.Program, - extra: Extra, + parseSettings: ParseSettings, ): Set { - const fileList = extra.EXPERIMENTAL_useSourceOfProjectReferenceRedirect - ? new Set( - program.getSourceFiles().map(sf => getCanonicalFileName(sf.fileName)), - ) - : new Set(program.getRootFileNames().map(f => getCanonicalFileName(f))); + const fileList = + parseSettings.EXPERIMENTAL_useSourceOfProjectReferenceRedirect + ? new Set( + program.getSourceFiles().map(sf => getCanonicalFileName(sf.fileName)), + ) + : new Set(program.getRootFileNames().map(f => getCanonicalFileName(f))); programFileListCache.set(tsconfigPath, fileList); return fileList; } /** * Calculate project environments using options provided by consumer and paths from config - * @param code The code being linted - * @param filePathIn The path of the file being parsed - * @param extra.tsconfigRootDir The root directory for relative tsconfig paths - * @param extra.projects Provided tsconfig paths + * @param parseSettings Internal settings for parsing the file * @returns The programs corresponding to the supplied tsconfig paths */ -function getProgramsForProjects( - code: string, - filePathIn: string, - extra: Extra, +function getWatchProgramsForProjects( + parseSettings: ParseSettings, ): ts.Program[] { - const filePath = getCanonicalFileName(filePathIn); + const filePath = getCanonicalFileName(parseSettings.filePath); const results = []; // preserve reference to code and file being linted - currentLintOperationState.code = code; + currentLintOperationState.code = parseSettings.code; currentLintOperationState.filePath = filePath; // Update file version if necessary const fileWatchCallbacks = fileWatchCallbackTrackingMap.get(filePath); - const codeHash = createHash(code); + const codeHash = createHash(parseSettings.code); if ( parsedFilesSeenHash.get(filePath) !== codeHash && fileWatchCallbacks && @@ -164,16 +149,30 @@ function getProgramsForProjects( ); } + const currentProjectsFromSettings = new Set(parseSettings.projects); + /* * before we go into the process of attempting to find and update every program * see if we know of a program that contains this file */ for (const [tsconfigPath, existingWatch] of knownWatchProgramMap.entries()) { + if (!currentProjectsFromSettings.has(tsconfigPath)) { + // the current parser run doesn't specify this tsconfig in parserOptions.project + // so we don't want to consider it for caching purposes. + // + // if we did consider it we might return a program for a project + // that wasn't specified in the current parser run (which is obv bad!). + continue; + } let fileList = programFileListCache.get(tsconfigPath); let updatedProgram: ts.Program | null = null; if (!fileList) { updatedProgram = existingWatch.getProgram().getProgram(); - fileList = updateCachedFileList(tsconfigPath, updatedProgram, extra); + fileList = updateCachedFileList( + tsconfigPath, + updatedProgram, + parseSettings, + ); } if (fileList.has(filePath)) { @@ -197,7 +196,7 @@ function getProgramsForProjects( * - the required program hasn't been created yet, or * - the file is new/renamed, and the program hasn't been updated. */ - for (const tsconfigPath of extra.projects) { + for (const tsconfigPath of parseSettings.projects) { const existingWatch = knownWatchProgramMap.get(tsconfigPath); if (existingWatch) { @@ -217,7 +216,7 @@ function getProgramsForProjects( const fileList = updateCachedFileList( tsconfigPath, updatedProgram, - extra, + parseSettings, ); if (fileList.has(filePath)) { log('Found updated program for file. %s', filePath); @@ -229,7 +228,7 @@ function getProgramsForProjects( continue; } - const programWatch = createWatchProgram(tsconfigPath, extra); + const programWatch = createWatchProgram(tsconfigPath, parseSettings); knownWatchProgramMap.set(tsconfigPath, programWatch); const program = programWatch.getProgram().getProgram(); @@ -237,7 +236,7 @@ function getProgramsForProjects( program.getTypeChecker(); // cache and check the file list - const fileList = updateCachedFileList(tsconfigPath, program, extra); + const fileList = updateCachedFileList(tsconfigPath, program, parseSettings); if (fileList.has(filePath)) { log('Found program for file. %s', filePath); // we can return early because we know this program contains the file @@ -256,23 +255,23 @@ const isRunningNoTimeoutFix = semver.satisfies(ts.version, '>=3.9.0-beta', { function createWatchProgram( tsconfigPath: string, - extra: Extra, + parseSettings: ParseSettings, ): ts.WatchOfConfigFile { log('Creating watch program for %s.', tsconfigPath); // create compiler host const watchCompilerHost = ts.createWatchCompilerHost( tsconfigPath, - createDefaultCompilerOptionsFromExtra(extra), + createDefaultCompilerOptionsFromExtra(parseSettings), ts.sys, ts.createAbstractBuilder, diagnosticReporter, /*reportWatchStatus*/ () => {}, ) as WatchCompilerHostOfConfigFile; - if (extra.moduleResolver) { + if (parseSettings.moduleResolver) { watchCompilerHost.resolveModuleNames = getModuleResolver( - extra.moduleResolver, + parseSettings.moduleResolver, ).resolveModuleNames; } @@ -336,7 +335,9 @@ function createWatchProgram( ): string[] => oldReadDirectory( path, - !extensions ? undefined : extensions.concat(extra.extraFileExtensions), + !extensions + ? undefined + : extensions.concat(parseSettings.extraFileExtensions), exclude, include, depth, @@ -344,7 +345,7 @@ function createWatchProgram( oldOnDirectoryStructureHostCreate(host); }; // This works only on 3.9 - watchCompilerHost.extraFileExtensions = extra.extraFileExtensions.map( + watchCompilerHost.extraFileExtensions = parseSettings.extraFileExtensions.map( extension => ({ extension, isMixedContent: true, @@ -358,7 +359,7 @@ function createWatchProgram( * See https://github.com/typescript-eslint/typescript-eslint/issues/2094 */ watchCompilerHost.useSourceOfProjectReferenceRedirect = (): boolean => - extra.EXPERIMENTAL_useSourceOfProjectReferenceRedirect; + parseSettings.EXPERIMENTAL_useSourceOfProjectReferenceRedirect; // Since we don't want to asynchronously update program we want to disable timeout methods // So any changes in the program will be delayed and updated when getProgram is called on watch @@ -537,4 +538,4 @@ function maybeInvalidateProgram( return null; } -export { clearWatchCaches, createWatchProgram, getProgramsForProjects }; +export { clearWatchCaches, getWatchProgramsForProjects }; diff --git a/packages/typescript-estree/src/create-program/shared.ts b/packages/typescript-estree/src/create-program/shared.ts index 770b137f212..e8de9796928 100644 --- a/packages/typescript-estree/src/create-program/shared.ts +++ b/packages/typescript-estree/src/create-program/shared.ts @@ -1,7 +1,9 @@ import path from 'path'; +import type { Program } from 'typescript'; import * as ts from 'typescript'; -import { Program } from 'typescript'; -import { Extra, ModuleResolver } from '../parser-options'; + +import type { ModuleResolver } from '../parser-options'; +import type { ParseSettings } from '../parseSettings'; interface ASTAndProgram { ast: ts.SourceFile; @@ -32,9 +34,9 @@ const DEFAULT_COMPILER_OPTIONS: ts.CompilerOptions = { }; function createDefaultCompilerOptionsFromExtra( - extra: Extra, + parseSettings: ParseSettings, ): ts.CompilerOptions { - if (extra.debugLevel.has('typescript')) { + if (parseSettings.debugLevel.has('typescript')) { return { ...DEFAULT_COMPILER_OPTIONS, extendedDiagnostics: true, @@ -62,10 +64,10 @@ function getCanonicalFileName(filePath: string): CanonicalPath { return correctPathCasing(normalized) as CanonicalPath; } -function ensureAbsolutePath(p: string, extra: Extra): string { +function ensureAbsolutePath(p: string, tsconfigRootDir: string): string { return path.isAbsolute(p) ? p - : path.join(extra.tsconfigRootDir || process.cwd(), p); + : path.join(tsconfigRootDir || process.cwd(), p); } function canonicalDirname(p: CanonicalPath): CanonicalPath { @@ -91,12 +93,12 @@ function getExtension(fileName: string | undefined): string | null { function getAstFromProgram( currentProgram: Program, - extra: Extra, + parseSettings: ParseSettings, ): ASTAndProgram | undefined { - const ast = currentProgram.getSourceFile(extra.filePath); + const ast = currentProgram.getSourceFile(parseSettings.filePath); // working around https://github.com/typescript-eslint/typescript-eslint/issues/1573 - const expectedExt = getExtension(extra.filePath); + const expectedExt = getExtension(parseSettings.filePath); const returnedExt = getExtension(ast?.fileName); if (expectedExt !== returnedExt) { return undefined; @@ -122,12 +124,26 @@ function getModuleResolver(moduleResolverPath: string): ModuleResolver { return moduleResolver; } +/** + * Hash content for compare content. + * @param content hashed contend + * @returns hashed result + */ +function createHash(content: string): string { + // No ts.sys in browser environments. + if (ts.sys?.createHash) { + return ts.sys.createHash(content); + } + return content; +} + export { ASTAndProgram, CORE_COMPILER_OPTIONS, canonicalDirname, CanonicalPath, createDefaultCompilerOptionsFromExtra, + createHash, ensureAbsolutePath, getCanonicalFileName, getAstFromProgram, diff --git a/packages/typescript-estree/src/create-program/useProvidedPrograms.ts b/packages/typescript-estree/src/create-program/useProvidedPrograms.ts index 23b56497dc6..fc99416faa5 100644 --- a/packages/typescript-estree/src/create-program/useProvidedPrograms.ts +++ b/packages/typescript-estree/src/create-program/useProvidedPrograms.ts @@ -2,27 +2,25 @@ import debug from 'debug'; import * as fs from 'fs'; import * as path from 'path'; import * as ts from 'typescript'; -import { Extra } from '../parser-options'; -import { - ASTAndProgram, - CORE_COMPILER_OPTIONS, - getAstFromProgram, -} from './shared'; + +import type { ParseSettings } from '../parseSettings'; +import type { ASTAndProgram } from './shared'; +import { CORE_COMPILER_OPTIONS, getAstFromProgram } from './shared'; const log = debug('typescript-eslint:typescript-estree:useProvidedProgram'); function useProvidedPrograms( programInstances: Iterable, - extra: Extra, + parseSettings: ParseSettings, ): ASTAndProgram | undefined { log( 'Retrieving ast for %s from provided program instance(s)', - extra.filePath, + parseSettings.filePath, ); let astAndProgram: ASTAndProgram | undefined; for (const programInstance of programInstances) { - astAndProgram = getAstFromProgram(programInstance, extra); + astAndProgram = getAstFromProgram(programInstance, parseSettings); // Stop at the first applicable program instance if (astAndProgram) { break; @@ -31,8 +29,8 @@ function useProvidedPrograms( if (!astAndProgram) { const relativeFilePath = path.relative( - extra.tsconfigRootDir || process.cwd(), - extra.filePath, + parseSettings.tsconfigRootDir || process.cwd(), + parseSettings.filePath, ); const errorLines = [ '"parserOptions.programs" has been provided for @typescript-eslint/parser.', diff --git a/packages/typescript-estree/src/getModifiers.ts b/packages/typescript-estree/src/getModifiers.ts new file mode 100644 index 00000000000..a584a7659a7 --- /dev/null +++ b/packages/typescript-estree/src/getModifiers.ts @@ -0,0 +1,53 @@ +import * as ts from 'typescript'; + +import { typescriptVersionIsAtLeast } from './version-check'; + +const isAtLeast48 = typescriptVersionIsAtLeast['4.8']; + +export function getModifiers( + node: ts.Node | null | undefined, +): undefined | ts.Modifier[] { + if (node == null) { + return undefined; + } + + if (isAtLeast48) { + // eslint-disable-next-line deprecation/deprecation -- this is safe as it's guarded + if (ts.canHaveModifiers(node)) { + // eslint-disable-next-line deprecation/deprecation -- this is safe as it's guarded + const modifiers = ts.getModifiers(node); + return modifiers ? Array.from(modifiers) : undefined; + } + + return undefined; + } + + return ( + // eslint-disable-next-line deprecation/deprecation -- intentional fallback for older TS versions + node.modifiers?.filter((m): m is ts.Modifier => !ts.isDecorator(m)) + ); +} + +export function getDecorators( + node: ts.Node | null | undefined, +): undefined | ts.Decorator[] { + if (node == null) { + return undefined; + } + + if (isAtLeast48) { + // eslint-disable-next-line deprecation/deprecation -- this is safe as it's guarded + if (ts.canHaveDecorators(node)) { + // eslint-disable-next-line deprecation/deprecation -- this is safe as it's guarded + const decorators = ts.getDecorators(node); + return decorators ? Array.from(decorators) : undefined; + } + + return undefined; + } + + return ( + // eslint-disable-next-line deprecation/deprecation -- intentional fallback for older TS versions + node.decorators?.filter(ts.isDecorator) + ); +} diff --git a/packages/typescript-estree/src/index.ts b/packages/typescript-estree/src/index.ts index fda8b30032f..bc7ed6024f3 100644 --- a/packages/typescript-estree/src/index.ts +++ b/packages/typescript-estree/src/index.ts @@ -10,9 +10,11 @@ export { export { ParserServices, TSESTreeOptions } from './parser-options'; export { simpleTraverse } from './simple-traverse'; export * from './ts-estree'; -export { clearWatchCaches as clearCaches } from './create-program/createWatchProgram'; +export { clearWatchCaches as clearCaches } from './create-program/getWatchProgramsForProjects'; export { createProgramFromConfigFile as createProgram } from './create-program/useProvidedPrograms'; export * from './create-program/getScriptKind'; +export { typescriptVersionIsAtLeast } from './version-check'; +export * from './getModifiers'; // re-export for backwards-compat export { visitorKeys } from '@typescript-eslint/visitor-keys'; diff --git a/packages/typescript-estree/src/node-utils.ts b/packages/typescript-estree/src/node-utils.ts index 1f7b75651d5..2b7351b0408 100644 --- a/packages/typescript-estree/src/node-utils.ts +++ b/packages/typescript-estree/src/node-utils.ts @@ -1,6 +1,9 @@ import * as ts from 'typescript'; -import { AST_NODE_TYPES, AST_TOKEN_TYPES, TSESTree } from './ts-estree'; + +import { getModifiers } from './getModifiers'; import { xhtmlEntities } from './jsx/xhtml-entities'; +import type { TSESTree } from './ts-estree'; +import { AST_NODE_TYPES, AST_TOKEN_TYPES } from './ts-estree'; const SyntaxKind = ts.SyntaxKind; @@ -80,11 +83,8 @@ export function hasModifier( modifierKind: ts.KeywordSyntaxKind, node: ts.Node, ): boolean { - return ( - !!node.modifiers && - !!node.modifiers.length && - node.modifiers.some(modifier => modifier.kind === modifierKind) - ); + const modifiers = getModifiers(node); + return modifiers?.some(modifier => modifier.kind === modifierKind) === true; } /** @@ -93,12 +93,11 @@ export function hasModifier( * @returns returns last modifier if present or null */ export function getLastModifier(node: ts.Node): ts.Modifier | null { - return ( - (!!node.modifiers && - !!node.modifiers.length && - node.modifiers[node.modifiers.length - 1]) || - null - ); + const modifiers = getModifiers(node); + if (modifiers == null) { + return null; + } + return modifiers[modifiers.length - 1] ?? null; } /** @@ -274,8 +273,8 @@ export function getDeclarationKind( export function getTSNodeAccessibility( node: ts.Node, ): 'public' | 'protected' | 'private' | null { - const modifiers = node.modifiers; - if (!modifiers) { + const modifiers = getModifiers(node); + if (modifiers == null) { return null; } for (const modifier of modifiers) { diff --git a/packages/typescript-estree/src/parseSettings/ExpiringCache.ts b/packages/typescript-estree/src/parseSettings/ExpiringCache.ts new file mode 100644 index 00000000000..f296c9f5f59 --- /dev/null +++ b/packages/typescript-estree/src/parseSettings/ExpiringCache.ts @@ -0,0 +1,69 @@ +import type { CacheDurationSeconds } from '@typescript-eslint/types'; + +export const DEFAULT_TSCONFIG_CACHE_DURATION_SECONDS = 30; +const ZERO_HR_TIME: [number, number] = [0, 0]; + +/** + * A map with key-level expiration. + */ +export class ExpiringCache { + readonly #cacheDurationSeconds: CacheDurationSeconds; + /** + * The mapping of path-like string to the resolved TSConfig(s) + */ + protected readonly map = new Map< + TKey, + Readonly<{ + value: TValue; + lastSeen: [number, number]; + }> + >(); + + constructor(cacheDurationSeconds: CacheDurationSeconds) { + this.#cacheDurationSeconds = cacheDurationSeconds; + } + + set(key: TKey, value: TValue): this { + this.map.set(key, { + value, + lastSeen: + this.#cacheDurationSeconds === 'Infinity' + ? // no need to waste time calculating the hrtime in infinity mode as there's no expiry + ZERO_HR_TIME + : process.hrtime(), + }); + return this; + } + + get(key: TKey): TValue | undefined { + const entry = this.map.get(key); + if (entry?.value != null) { + if (this.#cacheDurationSeconds === 'Infinity') { + return entry.value; + } + + const ageSeconds = process.hrtime(entry.lastSeen)[0]; + if (ageSeconds < this.#cacheDurationSeconds) { + // cache hit woo! + return entry.value; + } else { + // key has expired - clean it up to free up memory + this.cleanupKey(key); + } + } + // no hit :'( + return undefined; + } + + protected cleanupKey(key: TKey): void { + this.map.delete(key); + } + + get size(): number { + return this.map.size; + } + + clear(): void { + this.map.clear(); + } +} diff --git a/packages/typescript-estree/src/parseSettings/createParseSettings.ts b/packages/typescript-estree/src/parseSettings/createParseSettings.ts new file mode 100644 index 00000000000..e7267a85268 --- /dev/null +++ b/packages/typescript-estree/src/parseSettings/createParseSettings.ts @@ -0,0 +1,131 @@ +import debug from 'debug'; + +import { ensureAbsolutePath } from '../create-program/shared'; +import type { TSESTreeOptions } from '../parser-options'; +import type { MutableParseSettings } from './index'; +import { inferSingleRun } from './inferSingleRun'; +import { resolveProjectList } from './resolveProjectList'; +import { warnAboutTSVersion } from './warnAboutTSVersion'; + +const log = debug( + 'typescript-eslint:typescript-estree:parser:parseSettings:createParseSettings', +); + +export function createParseSettings( + code: string, + options: Partial = {}, +): MutableParseSettings { + const tsconfigRootDir = + typeof options.tsconfigRootDir === 'string' + ? options.tsconfigRootDir + : process.cwd(); + const parseSettings: MutableParseSettings = { + code: enforceString(code), + comment: options.comment === true, + comments: [], + createDefaultProgram: options.createDefaultProgram === true, + debugLevel: + options.debugLevel === true + ? new Set(['typescript-eslint']) + : Array.isArray(options.debugLevel) + ? new Set(options.debugLevel) + : new Set(), + errorOnTypeScriptSyntacticAndSemanticIssues: false, + errorOnUnknownASTType: options.errorOnUnknownASTType === true, + EXPERIMENTAL_useSourceOfProjectReferenceRedirect: + options.EXPERIMENTAL_useSourceOfProjectReferenceRedirect === true, + extraFileExtensions: + Array.isArray(options.extraFileExtensions) && + options.extraFileExtensions.every(ext => typeof ext === 'string') + ? options.extraFileExtensions + : [], + filePath: ensureAbsolutePath( + typeof options.filePath === 'string' && options.filePath !== '' + ? options.filePath + : getFileName(options.jsx), + tsconfigRootDir, + ), + jsx: options.jsx === true, + loc: options.loc === true, + log: + typeof options.loggerFn === 'function' + ? options.loggerFn + : options.loggerFn === false + ? (): void => {} + : console.log, // eslint-disable-line no-console + moduleResolver: options.moduleResolver ?? '', + preserveNodeMaps: options.preserveNodeMaps !== false, + programs: Array.isArray(options.programs) ? options.programs : null, + projects: [], + range: options.range === true, + singleRun: inferSingleRun(options), + tokens: options.tokens === true ? [] : null, + tsconfigRootDir, + }; + + // debug doesn't support multiple `enable` calls, so have to do it all at once + if (parseSettings.debugLevel.size > 0) { + const namespaces = []; + if (parseSettings.debugLevel.has('typescript-eslint')) { + namespaces.push('typescript-eslint:*'); + } + if ( + parseSettings.debugLevel.has('eslint') || + // make sure we don't turn off the eslint debug if it was enabled via --debug + debug.enabled('eslint:*,-eslint:code-path') + ) { + // https://github.com/eslint/eslint/blob/9dfc8501fb1956c90dc11e6377b4cb38a6bea65d/bin/eslint.js#L25 + namespaces.push('eslint:*,-eslint:code-path'); + } + debug.enable(namespaces.join(',')); + } + + if (Array.isArray(options.programs)) { + if (!options.programs.length) { + throw new Error( + `You have set parserOptions.programs to an empty array. This will cause all files to not be found in existing programs. Either provide one or more existing TypeScript Program instances in the array, or remove the parserOptions.programs setting.`, + ); + } + log( + 'parserOptions.programs was provided, so parserOptions.project will be ignored.', + ); + } + + // Providing a program overrides project resolution + if (!parseSettings.programs) { + parseSettings.projects = resolveProjectList({ + cacheLifetime: options.cacheLifetime, + project: options.project, + projectFolderIgnoreList: options.projectFolderIgnoreList, + singleRun: parseSettings.singleRun, + tsconfigRootDir: tsconfigRootDir, + }); + } + + warnAboutTSVersion(parseSettings); + + return parseSettings; +} + +/** + * Ensures source code is a string. + */ +function enforceString(code: unknown): string { + if (typeof code !== 'string') { + return String(code); + } + + return code; +} + +/** + * Compute the filename based on the parser options. + * + * Even if jsx option is set in typescript compiler, filename still has to + * contain .tsx file extension. + * + * @param options Parser options + */ +function getFileName(jsx?: boolean): string { + return jsx ? 'estree.tsx' : 'estree.ts'; +} diff --git a/packages/typescript-estree/src/parseSettings/index.ts b/packages/typescript-estree/src/parseSettings/index.ts new file mode 100644 index 00000000000..53b1acf4a6f --- /dev/null +++ b/packages/typescript-estree/src/parseSettings/index.ts @@ -0,0 +1,124 @@ +import type * as ts from 'typescript'; + +import type { CanonicalPath } from '../create-program/shared'; +import type { TSESTree } from '../ts-estree'; + +type DebugModule = 'typescript-eslint' | 'eslint' | 'typescript'; + +/** + * Internal settings used by the parser to run on a file. + */ +export interface MutableParseSettings { + /** + * Code of the file being parsed. + */ + code: string; + + /** + * Whether the `comment` parse option is enabled. + */ + comment: boolean; + + /** + * If the `comment` parse option is enabled, retrieved comments. + */ + comments: TSESTree.Comment[]; + + /** + * Whether to create a TypeScript program if one is not provided. + */ + createDefaultProgram: boolean; + + /** + * Which debug areas should be logged. + */ + debugLevel: Set; + + /** + * Whether to error if TypeScript reports a semantic or syntactic error diagnostic. + */ + errorOnTypeScriptSyntacticAndSemanticIssues: boolean; + + /** + * Whether to error if an unknown AST node type is encountered. + */ + errorOnUnknownASTType: boolean; + + /** + * Whether TS should use the source files for referenced projects instead of the compiled .d.ts files. + * + * @remarks + * This feature is not yet optimized, and is likely to cause OOMs for medium to large projects. + * This flag REQUIRES at least TS v3.9, otherwise it does nothing. + */ + EXPERIMENTAL_useSourceOfProjectReferenceRedirect: boolean; + + /** + * Any non-standard file extensions which will be parsed. + */ + extraFileExtensions: string[]; + + /** + * Path of the file being parsed. + */ + filePath: string; + + /** + * Whether parsing of JSX is enabled. + * + * @remarks The applicable file extension is still required. + */ + jsx: boolean; + + /** + * Whether to add `loc` information to each node. + */ + loc: boolean; + + /** + * Log function, if not `console.log`. + */ + log: (message: string) => void; + + /** + * Path for a module resolver to use for the compiler host's `resolveModuleNames`. + */ + moduleResolver: string; + + /** + * Whether two-way AST node maps are preserved during the AST conversion process. + */ + preserveNodeMaps?: boolean; + + /** + * One or more instances of TypeScript Program objects to be used for type information. + */ + programs: null | Iterable; + + /** + * Normalized paths to provided project paths. + */ + projects: readonly CanonicalPath[]; + + /** + * Whether to add the `range` property to AST nodes. + */ + range: boolean; + + /** + * Whether this is part of a single run, rather than a long-running process. + */ + singleRun: boolean; + + /** + * If the `tokens` parse option is enabled, retrieved tokens. + */ + tokens: null | TSESTree.Token[]; + + /** + * The absolute path to the root directory for all provided `project`s. + */ + tsconfigRootDir: string; +} + +export type ParseSettings = Readonly; diff --git a/packages/typescript-estree/src/parseSettings/inferSingleRun.ts b/packages/typescript-estree/src/parseSettings/inferSingleRun.ts new file mode 100644 index 00000000000..5d765a22ce9 --- /dev/null +++ b/packages/typescript-estree/src/parseSettings/inferSingleRun.ts @@ -0,0 +1,56 @@ +import { normalize } from 'path'; + +import type { TSESTreeOptions } from '../parser-options'; + +/** + * ESLint (and therefore typescript-eslint) is used in both "single run"/one-time contexts, + * such as an ESLint CLI invocation, and long-running sessions (such as continuous feedback + * on a file in an IDE). + * + * When typescript-eslint handles TypeScript Program management behind the scenes, this distinction + * is important because there is significant overhead to managing the so called Watch Programs + * needed for the long-running use-case. We therefore use the following logic to figure out which + * of these contexts applies to the current execution. + * + * @returns Whether this is part of a single run, rather than a long-running process. + */ +export function inferSingleRun(options: TSESTreeOptions | undefined): boolean { + if ( + // single-run implies type-aware linting - no projects means we can't be in single-run mode + options?.project == null || + // programs passed via options means the user should be managing the programs, so we shouldn't + // be creating our own single-run programs accidentally + options?.programs != null + ) { + return false; + } + + // Allow users to explicitly inform us of their intent to perform a single run (or not) with TSESTREE_SINGLE_RUN + if (process.env.TSESTREE_SINGLE_RUN === 'false') { + return false; + } + if (process.env.TSESTREE_SINGLE_RUN === 'true') { + return true; + } + + // Currently behind a flag while we gather real-world feedback + if (options?.allowAutomaticSingleRunInference) { + if ( + // Default to single runs for CI processes. CI=true is set by most CI providers by default. + process.env.CI === 'true' || + // This will be true for invocations such as `npx eslint ...` and `./node_modules/.bin/eslint ...` + process.argv[1].endsWith(normalize('node_modules/.bin/eslint')) + ) { + return true; + } + } + + /** + * We default to assuming that this run could be part of a long-running session (e.g. in an IDE) + * and watch programs will therefore be required. + * + * Unless we can reliably infer otherwise, we default to assuming that this run could be part + * of a long-running session (e.g. in an IDE) and watch programs will therefore be required + */ + return false; +} diff --git a/packages/typescript-estree/src/parseSettings/resolveProjectList.ts b/packages/typescript-estree/src/parseSettings/resolveProjectList.ts new file mode 100644 index 00000000000..72e9539d2b9 --- /dev/null +++ b/packages/typescript-estree/src/parseSettings/resolveProjectList.ts @@ -0,0 +1,146 @@ +import debug from 'debug'; +import { sync as globSync } from 'globby'; +import isGlob from 'is-glob'; + +import type { CanonicalPath } from '../create-program/shared'; +import { + createHash, + ensureAbsolutePath, + getCanonicalFileName, +} from '../create-program/shared'; +import type { TSESTreeOptions } from '../parser-options'; +import { + DEFAULT_TSCONFIG_CACHE_DURATION_SECONDS, + ExpiringCache, +} from './ExpiringCache'; + +const log = debug( + 'typescript-eslint:typescript-estree:parser:parseSettings:resolveProjectList', +); + +let RESOLUTION_CACHE: ExpiringCache | null = + null; + +/** + * Normalizes, sanitizes, resolves and filters the provided project paths + */ +export function resolveProjectList( + options: Readonly<{ + cacheLifetime?: TSESTreeOptions['cacheLifetime']; + project: TSESTreeOptions['project']; + projectFolderIgnoreList: TSESTreeOptions['projectFolderIgnoreList']; + singleRun: boolean; + tsconfigRootDir: string; + }>, +): readonly CanonicalPath[] { + const sanitizedProjects: string[] = []; + + // Normalize and sanitize the project paths + if (typeof options.project === 'string') { + sanitizedProjects.push(options.project); + } else if (Array.isArray(options.project)) { + for (const project of options.project) { + if (typeof project === 'string') { + sanitizedProjects.push(project); + } + } + } + + if (sanitizedProjects.length === 0) { + return []; + } + + const projectFolderIgnoreList = ( + options.projectFolderIgnoreList ?? ['**/node_modules/**'] + ) + .reduce((acc, folder) => { + if (typeof folder === 'string') { + acc.push(folder); + } + return acc; + }, []) + // prefix with a ! for not match glob + .map(folder => (folder.startsWith('!') ? folder : `!${folder}`)); + + const cacheKey = getHash({ + project: sanitizedProjects, + projectFolderIgnoreList, + tsconfigRootDir: options.tsconfigRootDir, + }); + if (RESOLUTION_CACHE == null) { + // note - we initialize the global cache based on the first config we encounter. + // this does mean that you can't have multiple lifetimes set per folder + // I doubt that anyone will really bother reconfiguring this, let alone + // try to do complicated setups, so we'll deal with this later if ever. + RESOLUTION_CACHE = new ExpiringCache( + options.singleRun + ? 'Infinity' + : options.cacheLifetime?.glob ?? + DEFAULT_TSCONFIG_CACHE_DURATION_SECONDS, + ); + } else { + const cached = RESOLUTION_CACHE.get(cacheKey); + if (cached) { + return cached; + } + } + + // Transform glob patterns into paths + const nonGlobProjects = sanitizedProjects.filter(project => !isGlob(project)); + const globProjects = sanitizedProjects.filter(project => isGlob(project)); + + const uniqueCanonicalProjectPaths = new Set( + nonGlobProjects + .concat( + globProjects.length === 0 + ? [] + : globSync([...globProjects, ...projectFolderIgnoreList], { + cwd: options.tsconfigRootDir, + }), + ) + .map(project => + getCanonicalFileName( + ensureAbsolutePath(project, options.tsconfigRootDir), + ), + ), + ); + + log( + 'parserOptions.project (excluding ignored) matched projects: %s', + uniqueCanonicalProjectPaths, + ); + + const returnValue = Array.from(uniqueCanonicalProjectPaths); + RESOLUTION_CACHE.set(cacheKey, returnValue); + return returnValue; +} + +function getHash({ + project, + projectFolderIgnoreList, + tsconfigRootDir, +}: Readonly<{ + project: readonly string[]; + projectFolderIgnoreList: readonly string[]; + tsconfigRootDir: string; +}>): string { + // create a stable representation of the config + const hashObject = { + tsconfigRootDir, + // the project order does matter and can impact the resolved globs + project, + // the ignore order won't doesn't ever matter + projectFolderIgnoreList: [...projectFolderIgnoreList].sort(), + }; + + return createHash(JSON.stringify(hashObject)); +} + +/** + * Exported for testing purposes only + * @internal + */ +export function clearGlobResolutionCache(): void { + RESOLUTION_CACHE?.clear(); + RESOLUTION_CACHE = null; +} diff --git a/packages/typescript-estree/src/parseSettings/warnAboutTSVersion.ts b/packages/typescript-estree/src/parseSettings/warnAboutTSVersion.ts new file mode 100644 index 00000000000..13eef19e796 --- /dev/null +++ b/packages/typescript-estree/src/parseSettings/warnAboutTSVersion.ts @@ -0,0 +1,45 @@ +import semver from 'semver'; +import * as ts from 'typescript'; + +import type { ParseSettings } from './index'; +/** + * This needs to be kept in sync with /docs/maintenance/Versioning.md + * in the typescript-eslint monorepo + */ +const SUPPORTED_TYPESCRIPT_VERSIONS = '>=3.3.1 <5.0.0'; + +/* + * The semver package will ignore prerelease ranges, and we don't want to explicitly document every one + * List them all separately here, so we can automatically create the full string + */ +const SUPPORTED_PRERELEASE_RANGES: string[] = []; +const ACTIVE_TYPESCRIPT_VERSION = ts.version; +const isRunningSupportedTypeScriptVersion = semver.satisfies( + ACTIVE_TYPESCRIPT_VERSION, + [SUPPORTED_TYPESCRIPT_VERSIONS] + .concat(SUPPORTED_PRERELEASE_RANGES) + .join(' || '), +); + +let warnedAboutTSVersion = false; + +export function warnAboutTSVersion(parseSettings: ParseSettings): void { + if (!isRunningSupportedTypeScriptVersion && !warnedAboutTSVersion) { + const isTTY = + typeof process === 'undefined' ? false : process.stdout?.isTTY; + if (isTTY) { + const border = '============='; + const versionWarning = [ + border, + 'WARNING: You are currently running a version of TypeScript which is not officially supported by @typescript-eslint/typescript-estree.', + 'You may find that it works just fine, or you may not.', + `SUPPORTED TYPESCRIPT VERSIONS: ${SUPPORTED_TYPESCRIPT_VERSIONS}`, + `YOUR TYPESCRIPT VERSION: ${ACTIVE_TYPESCRIPT_VERSION}`, + 'Please only submit bug reports when using the officially supported version.', + border, + ]; + parseSettings.log(versionWarning.join('\n\n')); + } + warnedAboutTSVersion = true; + } +} diff --git a/packages/typescript-estree/src/parser-options.ts b/packages/typescript-estree/src/parser-options.ts index 9763e5894b6..8cfe3c934c2 100644 --- a/packages/typescript-estree/src/parser-options.ts +++ b/packages/typescript-estree/src/parser-options.ts @@ -1,38 +1,14 @@ -import { DebugLevel } from '@typescript-eslint/types'; -import * as ts from 'typescript'; -import { CanonicalPath } from './create-program/shared'; -import { TSESTree, TSESTreeToTSNode, TSNode, TSToken } from './ts-estree'; - -type DebugModule = 'typescript-eslint' | 'eslint' | 'typescript'; - -export interface Extra { - code: string; - comment: boolean; - comments: TSESTree.Comment[]; - createDefaultProgram: boolean; - debugLevel: Set; - errorOnTypeScriptSyntacticAndSemanticIssues: boolean; - errorOnUnknownASTType: boolean; - EXPERIMENTAL_useSourceOfProjectReferenceRedirect: boolean; - extraFileExtensions: string[]; - filePath: string; - jsx: boolean; - loc: boolean; - singleRun: boolean; - log: (message: string) => void; - preserveNodeMaps?: boolean; - programs: null | Iterable; - projects: CanonicalPath[]; - range: boolean; - strict: boolean; - tokens: null | TSESTree.Token[]; - tsconfigRootDir: string; - moduleResolver: string; -} +import type { + CacheDurationSeconds, + DebugLevel, +} from '@typescript-eslint/types'; +import type * as ts from 'typescript'; + +import type { TSESTree, TSESTreeToTSNode, TSNode, TSToken } from './ts-estree'; -//////////////////////////////////////////////////// -// MAKE SURE THIS IS KEPT IN SYNC WITH THE README // -//////////////////////////////////////////////////// +////////////////////////////////////////////////////////// +// MAKE SURE THIS IS KEPT IN SYNC WITH THE WEBSITE DOCS // +////////////////////////////////////////////////////////// interface ParseOptions { /** @@ -195,6 +171,25 @@ interface ParseAndGenerateServicesOptions extends ParseOptions { */ allowAutomaticSingleRunInference?: boolean; + /** + * Granular control of the expiry lifetime of our internal caches. + * You can specify the number of seconds as an integer number, or the string + * 'Infinity' if you never want the cache to expire. + * + * By default cache entries will be evicted after 30 seconds, or will persist + * indefinitely if `allowAutomaticSingleRunInference = true` AND the parser + * infers that it is a single run. + */ + cacheLifetime?: { + /** + * Glob resolution for `parserOptions.project` values. + */ + glob?: CacheDurationSeconds; + }; + + /** + * Path to a file exporting a custom `ModuleResolver`. + */ moduleResolver?: string; } diff --git a/packages/typescript-estree/src/parser.ts b/packages/typescript-estree/src/parser.ts index f734c402eeb..c5504ba961a 100644 --- a/packages/typescript-estree/src/parser.ts +++ b/packages/typescript-estree/src/parser.ts @@ -1,52 +1,25 @@ import debug from 'debug'; -import { sync as globSync } from 'globby'; -import isGlob from 'is-glob'; -import semver from 'semver'; -import { normalize } from 'path'; -import * as ts from 'typescript'; +import type * as ts from 'typescript'; + import { astConverter } from './ast-converter'; import { convertError } from './convert'; import { createDefaultProgram } from './create-program/createDefaultProgram'; import { createIsolatedProgram } from './create-program/createIsolatedProgram'; import { createProjectProgram } from './create-program/createProjectProgram'; import { createSourceFile } from './create-program/createSourceFile'; -import { Extra, TSESTreeOptions, ParserServices } from './parser-options'; -import { getFirstSemanticOrSyntacticError } from './semantic-or-syntactic-errors'; -import { TSESTree } from './ts-estree'; -import { - ASTAndProgram, - CanonicalPath, - ensureAbsolutePath, - getCanonicalFileName, -} from './create-program/shared'; +import type { ASTAndProgram, CanonicalPath } from './create-program/shared'; import { createProgramFromConfigFile, useProvidedPrograms, } from './create-program/useProvidedPrograms'; +import type { ParserServices, TSESTreeOptions } from './parser-options'; +import type { ParseSettings } from './parseSettings'; +import { createParseSettings } from './parseSettings/createParseSettings'; +import { getFirstSemanticOrSyntacticError } from './semantic-or-syntactic-errors'; +import type { TSESTree } from './ts-estree'; const log = debug('typescript-eslint:typescript-estree:parser'); -/** - * This needs to be kept in sync with the top-level README.md in the - * typescript-eslint monorepo - */ -const SUPPORTED_TYPESCRIPT_VERSIONS = '>=3.3.1 <4.8.0'; -/* - * The semver package will ignore prerelease ranges, and we don't want to explicitly document every one - * List them all separately here, so we can automatically create the full string - */ -const SUPPORTED_PRERELEASE_RANGES: string[] = []; -const ACTIVE_TYPESCRIPT_VERSION = ts.version; -const isRunningSupportedTypeScriptVersion = semver.satisfies( - ACTIVE_TYPESCRIPT_VERSION, - [SUPPORTED_TYPESCRIPT_VERSIONS] - .concat(SUPPORTED_PRERELEASE_RANGES) - .join(' || '), -); - -let extra: Extra; -let warnedAboutTSVersion = false; - /** * Cache existing programs for the single run use-case. * @@ -57,348 +30,24 @@ function clearProgramCache(): void { existingPrograms.clear(); } -function enforceString(code: unknown): string { - /** - * Ensure the source code is a string - */ - if (typeof code !== 'string') { - return String(code); - } - - return code; -} - /** - * @param code The code of the file being linted - * @param programInstances One or more (potentially lazily constructed) existing programs to use + * @param parseSettings Internal settings for parsing the file * @param shouldProvideParserServices True if the program should be attempted to be calculated from provided tsconfig files - * @param shouldCreateDefaultProgram True if the program should be created from compiler host * @returns Returns a source file and program corresponding to the linted code */ function getProgramAndAST( - code: string, - programInstances: Iterable | null, + parseSettings: ParseSettings, shouldProvideParserServices: boolean, - shouldCreateDefaultProgram: boolean, ): ASTAndProgram { return ( - (programInstances && useProvidedPrograms(programInstances, extra)) || - (shouldProvideParserServices && - createProjectProgram(code, shouldCreateDefaultProgram, extra)) || + (parseSettings.programs && + useProvidedPrograms(parseSettings.programs, parseSettings)) || + (shouldProvideParserServices && createProjectProgram(parseSettings)) || (shouldProvideParserServices && - shouldCreateDefaultProgram && - createDefaultProgram(code, extra)) || - createIsolatedProgram(code, extra) - ); -} - -/** - * Compute the filename based on the parser options. - * - * Even if jsx option is set in typescript compiler, filename still has to - * contain .tsx file extension. - * - * @param options Parser options - */ -function getFileName({ jsx }: { jsx?: boolean } = {}): string { - return jsx ? 'estree.tsx' : 'estree.ts'; -} - -/** - * Resets the extra config object - */ -function resetExtra(): void { - extra = { - code: '', - comment: false, - comments: [], - createDefaultProgram: false, - debugLevel: new Set(), - errorOnTypeScriptSyntacticAndSemanticIssues: false, - errorOnUnknownASTType: false, - EXPERIMENTAL_useSourceOfProjectReferenceRedirect: false, - extraFileExtensions: [], - filePath: getFileName(), - jsx: false, - loc: false, - log: console.log, // eslint-disable-line no-console - preserveNodeMaps: true, - programs: null, - projects: [], - range: false, - strict: false, - tokens: null, - tsconfigRootDir: process.cwd(), - /** - * Unless we can reliably infer otherwise, we default to assuming that this run could be part - * of a long-running session (e.g. in an IDE) and watch programs will therefore be required - */ - singleRun: false, - moduleResolver: '', - }; -} - -function getTsconfigPath(tsconfigPath: string, extra: Extra): CanonicalPath { - return getCanonicalFileName(ensureAbsolutePath(tsconfigPath, extra)); -} - -/** - * Normalizes, sanitizes, resolves and filters the provided project paths - */ -function prepareAndTransformProjects( - projectsInput: string | string[] | undefined, - ignoreListInput: string[], -): CanonicalPath[] { - const sanitizedProjects: string[] = []; - - // Normalize and sanitize the project paths - if (typeof projectsInput === 'string') { - sanitizedProjects.push(projectsInput); - } else if (Array.isArray(projectsInput)) { - for (const project of projectsInput) { - if (typeof project === 'string') { - sanitizedProjects.push(project); - } - } - } - - if (sanitizedProjects.length === 0) { - return []; - } - - // Transform glob patterns into paths - const nonGlobProjects = sanitizedProjects.filter(project => !isGlob(project)); - const globProjects = sanitizedProjects.filter(project => isGlob(project)); - const uniqueCanonicalProjectPaths = new Set( - nonGlobProjects - .concat( - globSync([...globProjects, ...ignoreListInput], { - cwd: extra.tsconfigRootDir, - }), - ) - .map(project => getTsconfigPath(project, extra)), - ); - - log( - 'parserOptions.project (excluding ignored) matched projects: %s', - uniqueCanonicalProjectPaths, + parseSettings.createDefaultProgram && + createDefaultProgram(parseSettings)) || + createIsolatedProgram(parseSettings) ); - - return Array.from(uniqueCanonicalProjectPaths); -} - -function applyParserOptionsToExtra(options: TSESTreeOptions): void { - /** - * Configure Debug logging - */ - if (options.debugLevel === true) { - extra.debugLevel = new Set(['typescript-eslint']); - } else if (Array.isArray(options.debugLevel)) { - extra.debugLevel = new Set(options.debugLevel); - } - if (extra.debugLevel.size > 0) { - // debug doesn't support multiple `enable` calls, so have to do it all at once - const namespaces = []; - if (extra.debugLevel.has('typescript-eslint')) { - namespaces.push('typescript-eslint:*'); - } - if ( - extra.debugLevel.has('eslint') || - // make sure we don't turn off the eslint debug if it was enabled via --debug - debug.enabled('eslint:*,-eslint:code-path') - ) { - // https://github.com/eslint/eslint/blob/9dfc8501fb1956c90dc11e6377b4cb38a6bea65d/bin/eslint.js#L25 - namespaces.push('eslint:*,-eslint:code-path'); - } - debug.enable(namespaces.join(',')); - } - - /** - * Track range information in the AST - */ - extra.range = typeof options.range === 'boolean' && options.range; - extra.loc = typeof options.loc === 'boolean' && options.loc; - - /** - * Track tokens in the AST - */ - if (typeof options.tokens === 'boolean' && options.tokens) { - extra.tokens = []; - } - - /** - * Track comments in the AST - */ - if (typeof options.comment === 'boolean' && options.comment) { - extra.comment = true; - extra.comments = []; - } - - /** - * Enable JSX - note the applicable file extension is still required - */ - if (typeof options.jsx !== 'boolean') { - extra.jsx = false; - } else { - extra.jsx = options.jsx; - } - - /** - * Get the file path - */ - if (typeof options.filePath === 'string' && options.filePath !== '') { - extra.filePath = options.filePath; - } else { - extra.filePath = getFileName(extra); - } - - /** - * Allow the user to cause the parser to error if it encounters an unknown AST Node Type - * (used in testing) - */ - if ( - typeof options.errorOnUnknownASTType === 'boolean' && - options.errorOnUnknownASTType - ) { - extra.errorOnUnknownASTType = true; - } - - /** - * Allow the user to override the function used for logging - */ - if (typeof options.loggerFn === 'function') { - extra.log = options.loggerFn; - } else if (options.loggerFn === false) { - extra.log = (): void => {}; - } - - if (typeof options.tsconfigRootDir === 'string') { - extra.tsconfigRootDir = options.tsconfigRootDir; - } - - // NOTE - ensureAbsolutePath relies upon having the correct tsconfigRootDir in extra - extra.filePath = ensureAbsolutePath(extra.filePath, extra); - - if (Array.isArray(options.programs)) { - if (!options.programs.length) { - throw new Error( - `You have set parserOptions.programs to an empty array. This will cause all files to not be found in existing programs. Either provide one or more existing TypeScript Program instances in the array, or remove the parserOptions.programs setting.`, - ); - } - extra.programs = options.programs; - log( - 'parserOptions.programs was provided, so parserOptions.project will be ignored.', - ); - } - - if (!extra.programs) { - // providing a program overrides project resolution - const projectFolderIgnoreList = ( - options.projectFolderIgnoreList ?? ['**/node_modules/**'] - ) - .reduce((acc, folder) => { - if (typeof folder === 'string') { - acc.push(folder); - } - return acc; - }, []) - // prefix with a ! for not match glob - .map(folder => (folder.startsWith('!') ? folder : `!${folder}`)); - // NOTE - prepareAndTransformProjects relies upon having the correct tsconfigRootDir in extra - extra.projects = prepareAndTransformProjects( - options.project, - projectFolderIgnoreList, - ); - } - - if ( - Array.isArray(options.extraFileExtensions) && - options.extraFileExtensions.every(ext => typeof ext === 'string') - ) { - extra.extraFileExtensions = options.extraFileExtensions; - } - - /** - * Allow the user to enable or disable the preservation of the AST node maps - * during the conversion process. - */ - if (typeof options.preserveNodeMaps === 'boolean') { - extra.preserveNodeMaps = options.preserveNodeMaps; - } - - extra.createDefaultProgram = - typeof options.createDefaultProgram === 'boolean' && - options.createDefaultProgram; - - extra.EXPERIMENTAL_useSourceOfProjectReferenceRedirect = - typeof options.EXPERIMENTAL_useSourceOfProjectReferenceRedirect === - 'boolean' && options.EXPERIMENTAL_useSourceOfProjectReferenceRedirect; - - if (typeof options.moduleResolver === 'string') { - extra.moduleResolver = options.moduleResolver; - } -} - -function warnAboutTSVersion(): void { - if (!isRunningSupportedTypeScriptVersion && !warnedAboutTSVersion) { - const isTTY = - typeof process === 'undefined' ? false : process.stdout?.isTTY; - if (isTTY) { - const border = '============='; - const versionWarning = [ - border, - 'WARNING: You are currently running a version of TypeScript which is not officially supported by @typescript-eslint/typescript-estree.', - 'You may find that it works just fine, or you may not.', - `SUPPORTED TYPESCRIPT VERSIONS: ${SUPPORTED_TYPESCRIPT_VERSIONS}`, - `YOUR TYPESCRIPT VERSION: ${ACTIVE_TYPESCRIPT_VERSION}`, - 'Please only submit bug reports when using the officially supported version.', - border, - ]; - extra.log(versionWarning.join('\n\n')); - } - warnedAboutTSVersion = true; - } -} - -/** - * ESLint (and therefore typescript-eslint) is used in both "single run"/one-time contexts, - * such as an ESLint CLI invocation, and long-running sessions (such as continuous feedback - * on a file in an IDE). - * - * When typescript-eslint handles TypeScript Program management behind the scenes, this distinction - * is important because there is significant overhead to managing the so called Watch Programs - * needed for the long-running use-case. We therefore use the following logic to figure out which - * of these contexts applies to the current execution. - */ -function inferSingleRun(options: TSESTreeOptions | undefined): void { - // Allow users to explicitly inform us of their intent to perform a single run (or not) with TSESTREE_SINGLE_RUN - if (process.env.TSESTREE_SINGLE_RUN === 'false') { - extra.singleRun = false; - return; - } - if (process.env.TSESTREE_SINGLE_RUN === 'true') { - extra.singleRun = true; - return; - } - - // Currently behind a flag while we gather real-world feedback - if (options?.allowAutomaticSingleRunInference) { - if ( - // Default to single runs for CI processes. CI=true is set by most CI providers by default. - process.env.CI === 'true' || - // This will be true for invocations such as `npx eslint ...` and `./node_modules/.bin/eslint ...` - process.argv[1].endsWith(normalize('node_modules/.bin/eslint')) - ) { - extra.singleRun = true; - return; - } - } - - /** - * We default to assuming that this run could be part of a long-running session (e.g. in an IDE) - * and watch programs will therefore be required - */ - extra.singleRun = false; } // eslint-disable-next-line @typescript-eslint/no-empty-interface @@ -433,7 +82,7 @@ function parseWithNodeMapsInternal( /** * Reset the parse configuration */ - resetExtra(); + const parseSettings = createParseSettings(code, options); /** * Ensure users do not attempt to use parse() when they need parseAndGenerateServices() @@ -445,38 +94,18 @@ function parseWithNodeMapsInternal( } /** - * Ensure the source code is a string, and store a reference to it - */ - code = enforceString(code); - extra.code = code; - - /** - * Apply the given parser options - */ - if (typeof options !== 'undefined') { - applyParserOptionsToExtra(options); - } - - /** - * Warn if the user is using an unsupported version of TypeScript - */ - warnAboutTSVersion(); - - /** - * Figure out whether this is a single run or part of a long-running process + * Create a ts.SourceFile directly, no ts.Program is needed for a simple parse */ - inferSingleRun(options); - - /** - * Create a ts.SourceFile directly, no ts.Program is needed for a simple - * parse - */ - const ast = createSourceFile(code, extra); + const ast = createSourceFile(parseSettings); /** * Convert the TypeScript AST to an ESTree-compatible one */ - const { estree, astMaps } = astConverter(ast, extra, shouldPreserveNodeMaps); + const { estree, astMaps } = astConverter( + ast, + parseSettings, + shouldPreserveNodeMaps, + ); return { ast: estree as AST, @@ -505,47 +134,31 @@ function parseAndGenerateServices( /** * Reset the parse configuration */ - resetExtra(); + const parseSettings = createParseSettings(code, options); - /** - * Ensure the source code is a string, and store a reference to it - */ - code = enforceString(code); - extra.code = code; - - /** - * Apply the given parser options - */ if (typeof options !== 'undefined') { - applyParserOptionsToExtra(options); if ( typeof options.errorOnTypeScriptSyntacticAndSemanticIssues === 'boolean' && options.errorOnTypeScriptSyntacticAndSemanticIssues ) { - extra.errorOnTypeScriptSyntacticAndSemanticIssues = true; + parseSettings.errorOnTypeScriptSyntacticAndSemanticIssues = true; } } - /** - * Warn if the user is using an unsupported version of TypeScript - */ - warnAboutTSVersion(); - - /** - * Figure out whether this is a single run or part of a long-running process - */ - inferSingleRun(options); - /** * If this is a single run in which the user has not provided any existing programs but there * are programs which need to be created from the provided "project" option, * create an Iterable which will lazily create the programs as needed by the iteration logic */ - if (extra.singleRun && !extra.programs && extra.projects?.length > 0) { - extra.programs = { + if ( + parseSettings.singleRun && + !parseSettings.programs && + parseSettings.projects?.length > 0 + ) { + parseSettings.programs = { *[Symbol.iterator](): Iterator { - for (const configFile of extra.projects) { + for (const configFile of parseSettings.projects) { const existingProgram = existingPrograms.get(configFile); if (existingProgram) { yield existingProgram; @@ -567,7 +180,7 @@ function parseAndGenerateServices( * Generate a full ts.Program or offer provided instances in order to be able to provide parser services, such as type-checking */ const shouldProvideParserServices = - extra.programs != null || (extra.projects && extra.projects.length > 0); + parseSettings.programs != null || parseSettings.projects?.length > 0; /** * If we are in singleRun mode but the parseAndGenerateServices() function has been called more than once for the current file, @@ -577,46 +190,38 @@ function parseAndGenerateServices( * In this scenario we cannot rely upon the singleRun AOT compiled programs because the SourceFiles will not contain the source * with the latest fixes applied. Therefore we fallback to creating the quickest possible isolated program from the updated source. */ - let ast: ts.SourceFile; - let program: ts.Program; - - if (extra.singleRun && options.filePath) { + if (parseSettings.singleRun && options.filePath) { parseAndGenerateServicesCalls[options.filePath] = (parseAndGenerateServicesCalls[options.filePath] || 0) + 1; } - if ( - extra.singleRun && + const { ast, program } = + parseSettings.singleRun && options.filePath && parseAndGenerateServicesCalls[options.filePath] > 1 - ) { - const isolatedAstAndProgram = createIsolatedProgram(code, extra); - ast = isolatedAstAndProgram.ast; - program = isolatedAstAndProgram.program; - } else { - const astAndProgram = getProgramAndAST( - code, - extra.programs, - shouldProvideParserServices, - extra.createDefaultProgram, - )!; - ast = astAndProgram.ast; - program = astAndProgram.program; - } + ? createIsolatedProgram(parseSettings) + : getProgramAndAST(parseSettings, shouldProvideParserServices)!; /** * Convert the TypeScript AST to an ESTree-compatible one, and optionally preserve * mappings between converted and original AST nodes */ - const preserveNodeMaps = - typeof extra.preserveNodeMaps === 'boolean' ? extra.preserveNodeMaps : true; - const { estree, astMaps } = astConverter(ast, extra, preserveNodeMaps); + const shouldPreserveNodeMaps = + typeof parseSettings.preserveNodeMaps === 'boolean' + ? parseSettings.preserveNodeMaps + : true; + + const { estree, astMaps } = astConverter( + ast, + parseSettings, + shouldPreserveNodeMaps, + ); /** * Even if TypeScript parsed the source code ok, and we had no problems converting the AST, * there may be other syntactic or semantic issues in the code that we can optionally report on. */ - if (program && extra.errorOnTypeScriptSyntacticAndSemanticIssues) { + if (program && parseSettings.errorOnTypeScriptSyntacticAndSemanticIssues) { const error = getFirstSemanticOrSyntacticError(program, ast); if (error) { throw convertError(error); diff --git a/packages/typescript-estree/src/simple-traverse.ts b/packages/typescript-estree/src/simple-traverse.ts index f513e54b14f..2d51cdbe4fa 100644 --- a/packages/typescript-estree/src/simple-traverse.ts +++ b/packages/typescript-estree/src/simple-traverse.ts @@ -1,10 +1,11 @@ import { visitorKeys } from '@typescript-eslint/visitor-keys'; -import { TSESTree } from './ts-estree'; + +import type { TSESTree } from './ts-estree'; // eslint-disable-next-line @typescript-eslint/no-explicit-any function isValidNode(x: any): x is TSESTree.Node { // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access - return x !== null && typeof x === 'object' && typeof x.type === 'string'; + return x != null && typeof x === 'object' && typeof x.type === 'string'; } function getVisitorKeysForNode( diff --git a/packages/typescript-estree/src/ts-estree/estree-to-ts-node-types.ts b/packages/typescript-estree/src/ts-estree/estree-to-ts-node-types.ts index 82d5ace2c2a..c080a83559b 100644 --- a/packages/typescript-estree/src/ts-estree/estree-to-ts-node-types.ts +++ b/packages/typescript-estree/src/ts-estree/estree-to-ts-node-types.ts @@ -1,8 +1,10 @@ -import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/types'; -import * as ts from 'typescript'; -import { TSNode } from './ts-nodes'; +import type { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/types'; +import type * as ts from 'typescript'; + +import type { TSNode } from './ts-nodes'; export interface EstreeToTsNodeTypes { + [AST_NODE_TYPES.AccessorProperty]: ts.PropertyDeclaration; [AST_NODE_TYPES.ArrayExpression]: ts.ArrayLiteralExpression; [AST_NODE_TYPES.ArrayPattern]: | ts.ArrayLiteralExpression @@ -155,6 +157,7 @@ export interface EstreeToTsNodeTypes { | ts.Identifier; [AST_NODE_TYPES.ThrowStatement]: ts.ThrowStatement; [AST_NODE_TYPES.TryStatement]: ts.TryStatement; + [AST_NODE_TYPES.TSAbstractAccessorProperty]: ts.PropertyDeclaration; [AST_NODE_TYPES.TSAbstractPropertyDefinition]: ts.PropertyDeclaration; [AST_NODE_TYPES.TSAbstractMethodDefinition]: | ts.GetAccessorDeclaration @@ -184,6 +187,7 @@ export interface EstreeToTsNodeTypes { [AST_NODE_TYPES.TSInterfaceHeritage]: ts.ExpressionWithTypeArguments; [AST_NODE_TYPES.TSIntersectionType]: ts.IntersectionTypeNode; [AST_NODE_TYPES.TSInstantiationExpression]: ts.ExpressionWithTypeArguments; + [AST_NODE_TYPES.TSSatisfiesExpression]: ts.SatisfiesExpression; [AST_NODE_TYPES.TSLiteralType]: ts.LiteralTypeNode; [AST_NODE_TYPES.TSMappedType]: ts.MappedTypeNode; [AST_NODE_TYPES.TSMethodSignature]: diff --git a/packages/typescript-estree/src/ts-estree/ts-nodes.ts b/packages/typescript-estree/src/ts-estree/ts-nodes.ts index bf5ab185ee1..0ba5414e137 100644 --- a/packages/typescript-estree/src/ts-estree/ts-nodes.ts +++ b/packages/typescript-estree/src/ts-estree/ts-nodes.ts @@ -1,15 +1,21 @@ -import * as ts from 'typescript'; +import type * as ts from 'typescript'; // Workaround to support new TS version features for consumers on old TS versions // Eg: https://github.com/typescript-eslint/typescript-eslint/issues/2388, https://github.com/typescript-eslint/typescript-eslint/issues/2784 declare module 'typescript' { /* eslint-disable @typescript-eslint/no-empty-interface */ + // added in TS 4.0 export interface NamedTupleMember extends ts.Node {} + // added in TS 4.1 export interface TemplateLiteralTypeNode extends ts.Node {} + // added in TS 4.3 export interface PrivateIdentifier extends ts.Node {} export interface ClassStaticBlockDeclaration extends ts.Node {} + // added in TS 4.5 export interface AssertClause extends ts.Node {} export interface AssertEntry extends ts.Node {} + // added in TS 4.9 + export interface SatisfiesExpression extends ts.Node {} /* eslint-enable @typescript-eslint/no-empty-interface */ } @@ -180,6 +186,7 @@ export type TSNode = | ts.UnparsedSource | ts.JsonMinusNumericLiteral | ts.TemplateLiteralTypeNode + | ts.SatisfiesExpression // JSDoc: Unsupported | ts.JSDoc diff --git a/packages/typescript-estree/src/version-check.ts b/packages/typescript-estree/src/version-check.ts index d26f96bc31a..194636cb587 100644 --- a/packages/typescript-estree/src/version-check.ts +++ b/packages/typescript-estree/src/version-check.ts @@ -12,11 +12,18 @@ function semverCheck(version: string): boolean { } const versions = [ - // '3.7', '3.8', '3.9', '4.0', + '4.1', + '4.2', + '4.3', + '4.4', + '4.5', + '4.6', + '4.7', + '4.8', ] as const; type Versions = typeof versions extends ArrayLike ? U : never; diff --git a/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts b/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts index 1d0b6ac64ca..9c4d8a44bcc 100644 --- a/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts +++ b/packages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts @@ -24,7 +24,7 @@ interface CreateFixturePatternConfig { } const fixturesDirPath = path.join(__dirname, '../fixtures'); -const sharedFixturesDirPath = path.join( +export const sharedFixturesDirPath = path.join( __dirname, '../../../shared-fixtures/fixtures', ); @@ -397,6 +397,11 @@ tester.addFixturePatternConfig('typescript/basics', { * SyntaxError: Missing initializer in const declaration. */ 'var-with-definite-assignment', + /** + * [BABEL ERRORED, BUT TS-ESTREE DID NOT] + * SyntaxError: A JSON module can only be imported with `default`. + */ + 'export-with-import-assertions', ], ignoreSourceType: [ /** @@ -432,6 +437,19 @@ tester.addFixturePatternConfig('typescript/decorators/accessor-decorators', { }); tester.addFixturePatternConfig('typescript/decorators/class-decorators', { fileType: 'ts', + ignore: [ + /** + * babel sets the range of the export node to the start of the decorator + * TSESTree sets it to the start of the export keyword + */ + 'export-default-class-decorator', + 'export-named-class-decorator', + /** + * babel sets the range of the export node to the start of the parameter + * TSESTree sets it to the start of the decorator + */ + 'class-parameter-property', + ], }); tester.addFixturePatternConfig('typescript/decorators/method-decorators', { fileType: 'ts', @@ -459,6 +477,11 @@ tester.addFixturePatternConfig('typescript/expressions', { * @see https://github.com/babel/babel/issues/14613 */ 'instantiation-expression', + /** + * TS 4.9 `satisfies` operator has not been implemented in Babel yet. + * @see https://github.com/babel/babel/pull/14211 + */ + 'satisfies-expression', ], }); diff --git a/packages/typescript-estree/tests/ast-alignment/parse.ts b/packages/typescript-estree/tests/ast-alignment/parse.ts index 573c9843422..b4d5ea1c8f9 100644 --- a/packages/typescript-estree/tests/ast-alignment/parse.ts +++ b/packages/typescript-estree/tests/ast-alignment/parse.ts @@ -1,11 +1,13 @@ /* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access */ +import { codeFrameColumns } from '@babel/code-frame'; import type babelParser from '@babel/parser'; import type { ParserPlugin } from '@babel/parser'; -import { codeFrameColumns } from '@babel/code-frame'; import type { File } from '@babel/types'; import type { TSESTree } from '@typescript-eslint/types'; -import { AST, parseAndGenerateServices } from '../../src/parser'; + import type { TSError } from '../../src/node-utils'; +import type { AST } from '../../src/parser'; +import { parseAndGenerateServices } from '../../src/parser'; function createError( message: string, @@ -27,7 +29,6 @@ function parseWithBabelParser(text: string, jsx = true): File { [ 'estree', { - // @ts-expect-error -- this isn't exposed in the types yet classFeatures: true, }, ], diff --git a/packages/typescript-estree/tests/ast-alignment/spec.ts b/packages/typescript-estree/tests/ast-alignment/spec.ts index 57ab33710be..d743571f150 100644 --- a/packages/typescript-estree/tests/ast-alignment/spec.ts +++ b/packages/typescript-estree/tests/ast-alignment/spec.ts @@ -1,6 +1,8 @@ -import fs from 'fs'; import type { File } from '@babel/types'; -import { fixturesToTest } from './fixtures-to-test'; +import fs from 'fs'; +import path from 'path'; + +import { fixturesToTest, sharedFixturesDirPath } from './fixtures-to-test'; import { parse } from './parse'; import { preprocessBabylonAST, @@ -70,22 +72,23 @@ fixturesToTest.forEach(fixture => { /** * No errors, assert the two ASTs match */ - it(`${filename}`, () => { + const relativeFilename = path.relative(sharedFixturesDirPath, filename); + it(`${relativeFilename}`, () => { expect(babelParserResult.ast).toBeTruthy(); expect(typeScriptESTreeResult.ast).toBeTruthy(); /** * Perform some extra formatting steps on the babel AST before comparing */ - expect( - removeLocationDataAndSourceTypeFromProgramNode( - preprocessBabylonAST(babelParserResult.ast as File), - fixture.ignoreSourceType, - ), - ).toEqual( - removeLocationDataAndSourceTypeFromProgramNode( - preprocessTypescriptAST(typeScriptESTreeResult.ast), - fixture.ignoreSourceType, - ), + const babelAst = removeLocationDataAndSourceTypeFromProgramNode( + preprocessBabylonAST(babelParserResult.ast as File), + fixture.ignoreSourceType, ); + const tsestreeAst = removeLocationDataAndSourceTypeFromProgramNode( + preprocessTypescriptAST(typeScriptESTreeResult.ast), + fixture.ignoreSourceType, + ); + + // Received = Babel, Expected = TSESTree + expect(babelAst).toEqual(tsestreeAst); }); }); diff --git a/packages/typescript-estree/tests/ast-alignment/utils.ts b/packages/typescript-estree/tests/ast-alignment/utils.ts index f8c43458708..717a74837b5 100644 --- a/packages/typescript-estree/tests/ast-alignment/utils.ts +++ b/packages/typescript-estree/tests/ast-alignment/utils.ts @@ -1,7 +1,9 @@ // babel types are something we don't really care about /* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/restrict-plus-operands */ import type { File, Identifier, Program, TSTypeQuery } from '@babel/types'; -import { AST_NODE_TYPES, TSESTree } from '../../src/ts-estree'; + +import type { TSESTree } from '../../src/ts-estree'; +import { AST_NODE_TYPES } from '../../src/ts-estree'; import { deeplyCopy, omitDeep } from '../../tools/test-utils'; /** diff --git a/packages/typescript-estree/tests/ast-fixtures.test.ts b/packages/typescript-estree/tests/ast-fixtures.test.ts index 37a7e5cb71f..99cf80dd80b 100644 --- a/packages/typescript-estree/tests/ast-fixtures.test.ts +++ b/packages/typescript-estree/tests/ast-fixtures.test.ts @@ -3,6 +3,7 @@ import glob from 'glob'; import { addSerializer } from 'jest-specific-snapshot'; import makeDir from 'make-dir'; import path from 'path'; + import { parseAndGenerateServices } from '../src/parser'; import { isJSXFileType } from '../tools/test-utils'; import { serializer } from '../tools/tserror-serializer'; diff --git a/packages/typescript-estree/tests/fixtures/invalidFileErrors/tsconfig.extra.json b/packages/typescript-estree/tests/fixtures/invalidFileErrors/tsconfig.extra.json new file mode 100644 index 00000000000..0967ef424bc --- /dev/null +++ b/packages/typescript-estree/tests/fixtures/invalidFileErrors/tsconfig.extra.json @@ -0,0 +1 @@ +{} diff --git a/packages/typescript-estree/tests/lib/__snapshots__/convert.test.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/convert.test.ts.snap index 0f40740978e..a412b6bc0c9 100644 --- a/packages/typescript-estree/tests/lib/__snapshots__/convert.test.ts.snap +++ b/packages/typescript-estree/tests/lib/__snapshots__/convert.test.ts.snap @@ -1,24 +1,24 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`convert deeplyCopy should convert array of nodes 1`] = ` -Object { - "amdDependencies": Array [], - "bindDiagnostics": Array [], +{ + "amdDependencies": [], + "bindDiagnostics": [], "bindSuggestionDiagnostics": undefined, "checkJsDirective": undefined, "commentDirectives": undefined, - "endOfFileToken": Object { - "loc": Object { - "end": Object { + "endOfFileToken": { + "loc": { + "end": { "column": 12, "line": 1, }, - "start": Object { + "start": { "column": 12, "line": 1, }, }, - "range": Array [ + "range": [ 12, 12, ], @@ -35,134 +35,134 @@ Object { "isDeclarationFile": false, "languageVariant": 1, "languageVersion": 99, - "libReferenceDirectives": Array [], - "lineMap": Array [ + "libReferenceDirectives": [], + "lineMap": [ null, ], - "loc": Object { - "end": Object { + "loc": { + "end": { "column": 12, "line": 1, }, - "start": Object { + "start": { "column": 0, "line": 1, }, }, "nodeCount": 8, - "parseDiagnostics": Array [], + "parseDiagnostics": [], "pragmas": Map {}, - "range": Array [ + "range": [ 0, 12, ], - "referencedFiles": Array [], + "referencedFiles": [], "scriptKind": 4, "setExternalModuleIndicator": [Function], - "statements": Array [ - Object { - "expression": Object { - "arguments": Array [], - "callee": Object { - "loc": Object { - "end": Object { + "statements": [ + { + "expression": { + "arguments": [], + "callee": { + "loc": { + "end": { "column": 7, "line": 1, }, - "start": Object { + "start": { "column": 4, "line": 1, }, }, "name": "foo", - "range": Array [ + "range": [ 4, 7, ], "type": "Identifier", }, - "loc": Object { - "end": Object { + "loc": { + "end": { "column": 12, "line": 1, }, - "start": Object { + "start": { "column": 0, "line": 1, }, }, - "range": Array [ + "range": [ 0, 12, ], "type": "NewExpression", - "typeParameters": Object { - "loc": Object { - "end": Object { + "typeArguments": { + "loc": { + "end": { "column": 10, "line": 1, }, - "start": Object { + "start": { "column": 7, "line": 1, }, }, - "params": Array [ - Object { - "loc": Object { - "end": Object { + "params": [ + { + "loc": { + "end": { "column": 9, "line": 1, }, - "start": Object { + "start": { "column": 8, "line": 1, }, }, - "range": Array [ + "range": [ 8, 9, ], "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { + "typeArguments": undefined, + "typeName": { + "loc": { + "end": { "column": 9, "line": 1, }, - "start": Object { + "start": { "column": 8, "line": 1, }, }, "name": "T", - "range": Array [ + "range": [ 8, 9, ], "type": "Identifier", }, - "typeParameters": undefined, }, ], - "range": Array [ + "range": [ 7, 10, ], "type": "TSTypeParameterInstantiation", }, }, - "loc": Object { - "end": Object { + "loc": { + "end": { "column": 12, "line": 1, }, - "start": Object { + "start": { "column": 0, "line": 1, }, }, - "range": Array [ + "range": [ 0, 12, ], @@ -171,68 +171,63 @@ Object { ], "text": "new foo()", "type": "TSSourceFile", - "typeReferenceDirectives": Array [], + "typeReferenceDirectives": [], } `; exports[`convert deeplyCopy should convert node correctly 1`] = ` -Object { - "body": Array [ - Object { - "loc": Object { - "end": Object { +{ + "body": [ + { + "loc": { + "end": { "column": 35, "line": 1, }, - "start": Object { + "start": { "column": 0, "line": 1, }, }, - "localSymbol": undefined, - "locals": undefined, - "modifiers": undefined, - "name": Object { + "name": { "escapedText": "foo", - "loc": Object { - "end": Object { + "loc": { + "end": { "column": 8, "line": 1, }, - "start": Object { + "start": { "column": 5, "line": 1, }, }, "originalKeywordKind": undefined, - "range": Array [ + "range": [ 5, 8, ], "type": "TSUnparsedPrologue", }, - "nextContainer": undefined, - "range": Array [ + "range": [ 0, 35, ], - "symbol": undefined, "type": "TSUnparsedPrologue", "typeAnnotation": null, "typeParameters": null, }, ], - "loc": Object { - "end": Object { + "loc": { + "end": { "column": 35, "line": 1, }, - "start": Object { + "start": { "column": 0, "line": 1, }, }, - "range": Array [ + "range": [ 0, 35, ], @@ -242,174 +237,168 @@ Object { `; exports[`convert deeplyCopy should convert node with decorators correctly 1`] = ` -Object { - "decorators": Array [ - Object { - "expression": Object { - "loc": Object { - "end": Object { +{ + "decorators": [ + { + "expression": { + "loc": { + "end": { "column": 5, "line": 1, }, - "start": Object { + "start": { "column": 1, "line": 1, }, }, "name": "test", - "range": Array [ + "range": [ 1, 5, ], "type": "Identifier", }, - "loc": Object { - "end": Object { + "loc": { + "end": { "column": 5, "line": 1, }, - "start": Object { + "start": { "column": 0, "line": 1, }, }, - "range": Array [ + "range": [ 0, 5, ], "type": "Decorator", }, ], - "heritageClauses": undefined, - "loc": Object { - "end": Object { + "loc": { + "end": { "column": 18, "line": 1, }, - "start": Object { + "start": { "column": 0, "line": 1, }, }, - "localSymbol": undefined, - "locals": undefined, - "members": Array [], - "modifiers": undefined, - "name": Object { - "loc": Object { - "end": Object { + "members": [], + "name": { + "loc": { + "end": { "column": 15, "line": 1, }, - "start": Object { + "start": { "column": 12, "line": 1, }, }, "name": "foo", - "range": Array [ + "range": [ 12, 15, ], "type": "Identifier", }, - "nextContainer": undefined, - "range": Array [ + "range": [ 0, 18, ], - "symbol": undefined, "type": "TSClassDeclaration", "typeParameters": null, } `; exports[`convert deeplyCopy should convert node with type arguments correctly 1`] = ` -Object { - "arguments": Array [], - "expression": Object { - "loc": Object { - "end": Object { +{ + "arguments": [], + "expression": { + "loc": { + "end": { "column": 7, "line": 1, }, - "start": Object { + "start": { "column": 4, "line": 1, }, }, "name": "foo", - "range": Array [ + "range": [ 4, 7, ], "type": "Identifier", }, - "loc": Object { - "end": Object { + "loc": { + "end": { "column": 12, "line": 1, }, - "start": Object { + "start": { "column": 0, "line": 1, }, }, - "range": Array [ + "range": [ 0, 12, ], "type": "TSNewExpression", - "typeParameters": Object { - "loc": Object { - "end": Object { + "typeArguments": { + "loc": { + "end": { "column": 10, "line": 1, }, - "start": Object { + "start": { "column": 7, "line": 1, }, }, - "params": Array [ - Object { - "loc": Object { - "end": Object { + "params": [ + { + "loc": { + "end": { "column": 9, "line": 1, }, - "start": Object { + "start": { "column": 8, "line": 1, }, }, - "range": Array [ + "range": [ 8, 9, ], "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { + "typeArguments": undefined, + "typeName": { + "loc": { + "end": { "column": 9, "line": 1, }, - "start": Object { + "start": { "column": 8, "line": 1, }, }, "name": "T", - "range": Array [ + "range": [ 8, 9, ], "type": "Identifier", }, - "typeParameters": undefined, }, ], - "range": Array [ + "range": [ 7, 10, ], @@ -419,100 +408,94 @@ Object { `; exports[`convert deeplyCopy should convert node with type parameters correctly 1`] = ` -Object { - "heritageClauses": undefined, - "loc": Object { - "end": Object { +{ + "loc": { + "end": { "column": 15, "line": 1, }, - "start": Object { + "start": { "column": 0, "line": 1, }, }, - "localSymbol": undefined, - "locals": undefined, - "members": Array [], - "modifiers": undefined, - "name": Object { - "loc": Object { - "end": Object { + "members": [], + "name": { + "loc": { + "end": { "column": 9, "line": 1, }, - "start": Object { + "start": { "column": 6, "line": 1, }, }, "name": "foo", - "range": Array [ + "range": [ 6, 9, ], "type": "Identifier", }, - "nextContainer": undefined, - "range": Array [ + "range": [ 0, 15, ], - "symbol": undefined, "type": "TSClassDeclaration", - "typeParameters": Object { - "loc": Object { - "end": Object { + "typeParameters": { + "loc": { + "end": { "column": 12, "line": 1, }, - "start": Object { + "start": { "column": 9, "line": 1, }, }, - "params": Array [ - Object { + "params": [ + { "constraint": undefined, "default": undefined, "in": false, - "loc": Object { - "end": Object { + "loc": { + "end": { "column": 11, "line": 1, }, - "start": Object { + "start": { "column": 10, "line": 1, }, }, - "name": Object { - "loc": Object { - "end": Object { + "name": { + "loc": { + "end": { "column": 11, "line": 1, }, - "start": Object { + "start": { "column": 10, "line": 1, }, }, "name": "T", - "range": Array [ + "range": [ 10, 11, ], "type": "Identifier", }, "out": false, - "range": Array [ + "range": [ 10, 11, ], "type": "TSTypeParameter", }, ], - "range": Array [ + "range": [ 9, 12, ], diff --git a/packages/typescript-estree/tests/lib/__snapshots__/parse.test.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/parse.test.ts.snap index e1610759df9..2b406baf12b 100644 --- a/packages/typescript-estree/tests/lib/__snapshots__/parse.test.ts.snap +++ b/packages/typescript-estree/tests/lib/__snapshots__/parse.test.ts.snap @@ -1,130 +1,156 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`parseAndGenerateServices invalid file error messages "parserOptions.extraFileExtensions" is empty the extension does not match 1`] = ` -"\\"parserOptions.project\\" has been set for @typescript-eslint/parser. -The file does not match your project config: other/unknownFileType.unknown. -The extension for the file (.unknown) is non-standard. You should add \\"parserOptions.extraFileExtensions\\" to your config." +"ESLint was configured to run on \`/other/unknownFileType.unknown\` using \`parserOptions.project\`: /tsconfig.json +The extension for the file (\`.unknown\`) is non-standard. You should add \`parserOptions.extraFileExtensions\` to your config." `; exports[`parseAndGenerateServices invalid file error messages "parserOptions.extraFileExtensions" is non-empty invalid extension 1`] = ` -"\\"parserOptions.project\\" has been set for @typescript-eslint/parser. -The file does not match your project config: other/unknownFileType.unknown. -Found unexpected extension \\"unknown\\" specified with the \\"extraFileExtensions\\" option. Did you mean \\".unknown\\"? -The extension for the file (.unknown) is non-standard. It should be added to your existing \\"parserOptions.extraFileExtensions\\"." +"ESLint was configured to run on \`/other/unknownFileType.unknown\` using \`parserOptions.project\`: /tsconfig.json +Found unexpected extension \`unknown\` specified with the \`parserOptions.extraFileExtensions\` option. Did you mean \`.unknown\`? +The extension for the file (\`.unknown\`) is non-standard. It should be added to your existing \`parserOptions.extraFileExtensions\`." `; exports[`parseAndGenerateServices invalid file error messages "parserOptions.extraFileExtensions" is non-empty the extension does not match 1`] = ` -"\\"parserOptions.project\\" has been set for @typescript-eslint/parser. -The file does not match your project config: other/unknownFileType.unknown. -The extension for the file (.unknown) is non-standard. It should be added to your existing \\"parserOptions.extraFileExtensions\\"." +"ESLint was configured to run on \`/other/unknownFileType.unknown\` using \`parserOptions.project\`: /tsconfig.json +The extension for the file (\`.unknown\`) is non-standard. It should be added to your existing \`parserOptions.extraFileExtensions\`." `; exports[`parseAndGenerateServices invalid file error messages "parserOptions.extraFileExtensions" is non-empty the extension matches duplicate extension 1`] = ` -"\\"parserOptions.project\\" has been set for @typescript-eslint/parser. -The file does not match your project config: ts/notIncluded.ts. -You unnecessarily included the extension \\".ts\\" with the \\"extraFileExtensions\\" option. This extension is already handled by the parser by default. -The file must be included in at least one of the projects provided." +"ESLint was configured to run on \`/ts/notIncluded.ts\` using \`parserOptions.project\`: /tsconfig.json +You unnecessarily included the extension \`.ts\` with the \`parserOptions.extraFileExtensions\` option. This extension is already handled by the parser by default. +However, that TSConfig does not include this file. Either: +- Change ESLint's list of included files to not include this file +- Change that TSConfig to include this file +- Create a new TSConfig that includes this file and include it in your parserOptions.project +See the typescript-eslint docs for more info: https://typescript-eslint.io/linting/troubleshooting#i-get-errors-telling-me-eslint-was-configured-to-run--however-that-tsconfig-does-not--none-of-those-tsconfigs-include-this-file" `; exports[`parseAndGenerateServices invalid file error messages "parserOptions.extraFileExtensions" is non-empty the extension matches the file isn't included 1`] = ` -"\\"parserOptions.project\\" has been set for @typescript-eslint/parser. -The file does not match your project config: other/notIncluded.vue. -The file must be included in at least one of the projects provided." +"ESLint was configured to run on \`/other/notIncluded.vue\` using \`parserOptions.project\`: /tsconfig.json +However, that TSConfig does not include this file. Either: +- Change ESLint's list of included files to not include this file +- Change that TSConfig to include this file +- Create a new TSConfig that includes this file and include it in your parserOptions.project +See the typescript-eslint docs for more info: https://typescript-eslint.io/linting/troubleshooting#i-get-errors-telling-me-eslint-was-configured-to-run--however-that-tsconfig-does-not--none-of-those-tsconfigs-include-this-file" `; exports[`parseAndGenerateServices invalid file error messages project includes errors for not included files 1`] = ` -"\\"parserOptions.project\\" has been set for @typescript-eslint/parser. -The file does not match your project config: ts/notIncluded0j1.ts. -The file must be included in at least one of the projects provided." +"ESLint was configured to run on \`/ts/notIncluded0j1.ts\` using \`parserOptions.project\`: /tsconfig.json +However, that TSConfig does not include this file. Either: +- Change ESLint's list of included files to not include this file +- Change that TSConfig to include this file +- Create a new TSConfig that includes this file and include it in your parserOptions.project +See the typescript-eslint docs for more info: https://typescript-eslint.io/linting/troubleshooting#i-get-errors-telling-me-eslint-was-configured-to-run--however-that-tsconfig-does-not--none-of-those-tsconfigs-include-this-file" `; exports[`parseAndGenerateServices invalid file error messages project includes errors for not included files 2`] = ` -"\\"parserOptions.project\\" has been set for @typescript-eslint/parser. -The file does not match your project config: ts/notIncluded02.tsx. -The file must be included in at least one of the projects provided." +"ESLint was configured to run on \`/ts/notIncluded02.tsx\` using \`parserOptions.project\`: /tsconfig.json +However, that TSConfig does not include this file. Either: +- Change ESLint's list of included files to not include this file +- Change that TSConfig to include this file +- Create a new TSConfig that includes this file and include it in your parserOptions.project +See the typescript-eslint docs for more info: https://typescript-eslint.io/linting/troubleshooting#i-get-errors-telling-me-eslint-was-configured-to-run--however-that-tsconfig-does-not--none-of-those-tsconfigs-include-this-file" `; exports[`parseAndGenerateServices invalid file error messages project includes errors for not included files 3`] = ` -"\\"parserOptions.project\\" has been set for @typescript-eslint/parser. -The file does not match your project config: js/notIncluded01.js. -The file must be included in at least one of the projects provided." +"ESLint was configured to run on \`/js/notIncluded01.js\` using \`parserOptions.project\`: /tsconfig.json +However, that TSConfig does not include this file. Either: +- Change ESLint's list of included files to not include this file +- Change that TSConfig to include this file +- Create a new TSConfig that includes this file and include it in your parserOptions.project +See the typescript-eslint docs for more info: https://typescript-eslint.io/linting/troubleshooting#i-get-errors-telling-me-eslint-was-configured-to-run--however-that-tsconfig-does-not--none-of-those-tsconfigs-include-this-file" `; exports[`parseAndGenerateServices invalid file error messages project includes errors for not included files 4`] = ` -"\\"parserOptions.project\\" has been set for @typescript-eslint/parser. -The file does not match your project config: js/notIncluded02.jsx. -The file must be included in at least one of the projects provided." +"ESLint was configured to run on \`/js/notIncluded02.jsx\` using \`parserOptions.project\`: /tsconfig.json +However, that TSConfig does not include this file. Either: +- Change ESLint's list of included files to not include this file +- Change that TSConfig to include this file +- Create a new TSConfig that includes this file and include it in your parserOptions.project +See the typescript-eslint docs for more info: https://typescript-eslint.io/linting/troubleshooting#i-get-errors-telling-me-eslint-was-configured-to-run--however-that-tsconfig-does-not--none-of-those-tsconfigs-include-this-file" +`; + +exports[`parseAndGenerateServices invalid project error messages throws when non of multiple projects include the file 1`] = ` +"ESLint was configured to run on \`/ts/notIncluded0j1.ts\` using \`parserOptions.project\`: +- /tsconfig.json +- /tsconfig.extra.json +However, none of those TSConfigs include this file. Either: +- Change ESLint's list of included files to not include this file +- Change one of those TSConfigs to include this file +- Create a new TSConfig that includes this file and include it in your parserOptions.project +See the typescript-eslint docs for more info: https://typescript-eslint.io/linting/troubleshooting#i-get-errors-telling-me-eslint-was-configured-to-run--however-that-tsconfig-does-not--none-of-those-tsconfigs-include-this-file" `; exports[`parseAndGenerateServices isolated parsing should parse .js file - with JSX content - parserOptions.jsx = false 1`] = ` -Object { - "ast": Object { - "body": Array [ - Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { +{ + "ast": { + "body": [ + { + "declarations": [ + { + "id": { + "loc": { + "end": { "column": 7, "line": 1, }, - "start": Object { + "start": { "column": 6, "line": 1, }, }, "name": "x", - "range": Array [ + "range": [ 6, 7, ], "type": "Identifier", }, - "init": Object { - "children": Array [], + "init": { + "children": [], "closingElement": null, - "loc": Object { - "end": Object { + "loc": { + "end": { "column": 17, "line": 1, }, - "start": Object { + "start": { "column": 10, "line": 1, }, }, - "openingElement": Object { - "attributes": Array [], - "loc": Object { - "end": Object { + "openingElement": { + "attributes": [], + "loc": { + "end": { "column": 17, "line": 1, }, - "start": Object { + "start": { "column": 10, "line": 1, }, }, - "name": Object { - "loc": Object { - "end": Object { + "name": { + "loc": { + "end": { "column": 14, "line": 1, }, - "start": Object { + "start": { "column": 11, "line": 1, }, }, "name": "div", - "range": Array [ + "range": [ 11, 14, ], "type": "JSXIdentifier", }, - "range": Array [ + "range": [ 10, 17, ], @@ -132,23 +158,23 @@ Object { "type": "JSXOpeningElement", "typeParameters": undefined, }, - "range": Array [ + "range": [ 10, 17, ], "type": "JSXElement", }, - "loc": Object { - "end": Object { + "loc": { + "end": { "column": 17, "line": 1, }, - "start": Object { + "start": { "column": 6, "line": 1, }, }, - "range": Array [ + "range": [ 6, 17, ], @@ -156,178 +182,178 @@ Object { }, ], "kind": "const", - "loc": Object { - "end": Object { + "loc": { + "end": { "column": 18, "line": 1, }, - "start": Object { + "start": { "column": 0, "line": 1, }, }, - "range": Array [ + "range": [ 0, 18, ], "type": "VariableDeclaration", }, ], - "comments": Array [], - "loc": Object { - "end": Object { + "comments": [], + "loc": { + "end": { "column": 18, "line": 1, }, - "start": Object { + "start": { "column": 0, "line": 1, }, }, - "range": Array [ + "range": [ 0, 18, ], "sourceType": "script", - "tokens": Array [ - Object { - "loc": Object { - "end": Object { + "tokens": [ + { + "loc": { + "end": { "column": 5, "line": 1, }, - "start": Object { + "start": { "column": 0, "line": 1, }, }, - "range": Array [ + "range": [ 0, 5, ], "type": "Keyword", "value": "const", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 7, "line": 1, }, - "start": Object { + "start": { "column": 6, "line": 1, }, }, - "range": Array [ + "range": [ 6, 7, ], "type": "Identifier", "value": "x", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 9, "line": 1, }, - "start": Object { + "start": { "column": 8, "line": 1, }, }, - "range": Array [ + "range": [ 8, 9, ], "type": "Punctuator", "value": "=", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 11, "line": 1, }, - "start": Object { + "start": { "column": 10, "line": 1, }, }, - "range": Array [ + "range": [ 10, 11, ], "type": "Punctuator", "value": "<", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 14, "line": 1, }, - "start": Object { + "start": { "column": 11, "line": 1, }, }, - "range": Array [ + "range": [ 11, 14, ], "type": "JSXIdentifier", "value": "div", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 16, "line": 1, }, - "start": Object { + "start": { "column": 15, "line": 1, }, }, - "range": Array [ + "range": [ 15, 16, ], "type": "Punctuator", "value": "/", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 17, "line": 1, }, - "start": Object { + "start": { "column": 16, "line": 1, }, }, - "range": Array [ + "range": [ 16, 17, ], "type": "Punctuator", "value": ">", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 18, "line": 1, }, - "start": Object { + "start": { "column": 17, "line": 1, }, }, - "range": Array [ + "range": [ 17, 18, ], @@ -337,84 +363,84 @@ Object { ], "type": "Program", }, - "services": Object { + "services": { "esTreeNodeToTSNodeMap": WeakMap {}, "hasFullTypeInformation": false, - "program": Object {}, + "program": {}, "tsNodeToESTreeNodeMap": WeakMap {}, }, } `; exports[`parseAndGenerateServices isolated parsing should parse .js file - with JSX content - parserOptions.jsx = true 1`] = ` -Object { - "ast": Object { - "body": Array [ - Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { +{ + "ast": { + "body": [ + { + "declarations": [ + { + "id": { + "loc": { + "end": { "column": 7, "line": 1, }, - "start": Object { + "start": { "column": 6, "line": 1, }, }, "name": "x", - "range": Array [ + "range": [ 6, 7, ], "type": "Identifier", }, - "init": Object { - "children": Array [], + "init": { + "children": [], "closingElement": null, - "loc": Object { - "end": Object { + "loc": { + "end": { "column": 17, "line": 1, }, - "start": Object { + "start": { "column": 10, "line": 1, }, }, - "openingElement": Object { - "attributes": Array [], - "loc": Object { - "end": Object { + "openingElement": { + "attributes": [], + "loc": { + "end": { "column": 17, "line": 1, }, - "start": Object { + "start": { "column": 10, "line": 1, }, }, - "name": Object { - "loc": Object { - "end": Object { + "name": { + "loc": { + "end": { "column": 14, "line": 1, }, - "start": Object { + "start": { "column": 11, "line": 1, }, }, "name": "div", - "range": Array [ + "range": [ 11, 14, ], "type": "JSXIdentifier", }, - "range": Array [ + "range": [ 10, 17, ], @@ -422,23 +448,23 @@ Object { "type": "JSXOpeningElement", "typeParameters": undefined, }, - "range": Array [ + "range": [ 10, 17, ], "type": "JSXElement", }, - "loc": Object { - "end": Object { + "loc": { + "end": { "column": 17, "line": 1, }, - "start": Object { + "start": { "column": 6, "line": 1, }, }, - "range": Array [ + "range": [ 6, 17, ], @@ -446,178 +472,178 @@ Object { }, ], "kind": "const", - "loc": Object { - "end": Object { + "loc": { + "end": { "column": 18, "line": 1, }, - "start": Object { + "start": { "column": 0, "line": 1, }, }, - "range": Array [ + "range": [ 0, 18, ], "type": "VariableDeclaration", }, ], - "comments": Array [], - "loc": Object { - "end": Object { + "comments": [], + "loc": { + "end": { "column": 18, "line": 1, }, - "start": Object { + "start": { "column": 0, "line": 1, }, }, - "range": Array [ + "range": [ 0, 18, ], "sourceType": "script", - "tokens": Array [ - Object { - "loc": Object { - "end": Object { + "tokens": [ + { + "loc": { + "end": { "column": 5, "line": 1, }, - "start": Object { + "start": { "column": 0, "line": 1, }, }, - "range": Array [ + "range": [ 0, 5, ], "type": "Keyword", "value": "const", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 7, "line": 1, }, - "start": Object { + "start": { "column": 6, "line": 1, }, }, - "range": Array [ + "range": [ 6, 7, ], "type": "Identifier", "value": "x", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 9, "line": 1, }, - "start": Object { + "start": { "column": 8, "line": 1, }, }, - "range": Array [ + "range": [ 8, 9, ], "type": "Punctuator", "value": "=", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 11, "line": 1, }, - "start": Object { + "start": { "column": 10, "line": 1, }, }, - "range": Array [ + "range": [ 10, 11, ], "type": "Punctuator", "value": "<", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 14, "line": 1, }, - "start": Object { + "start": { "column": 11, "line": 1, }, }, - "range": Array [ + "range": [ 11, 14, ], "type": "JSXIdentifier", "value": "div", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 16, "line": 1, }, - "start": Object { + "start": { "column": 15, "line": 1, }, }, - "range": Array [ + "range": [ 15, 16, ], "type": "Punctuator", "value": "/", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 17, "line": 1, }, - "start": Object { + "start": { "column": 16, "line": 1, }, }, - "range": Array [ + "range": [ 16, 17, ], "type": "Punctuator", "value": ">", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 18, "line": 1, }, - "start": Object { + "start": { "column": 17, "line": 1, }, }, - "range": Array [ + "range": [ 17, 18, ], @@ -627,52 +653,52 @@ Object { ], "type": "Program", }, - "services": Object { + "services": { "esTreeNodeToTSNodeMap": WeakMap {}, "hasFullTypeInformation": false, - "program": Object {}, + "program": {}, "tsNodeToESTreeNodeMap": WeakMap {}, }, } `; exports[`parseAndGenerateServices isolated parsing should parse .js file - without JSX content - parserOptions.jsx = false 1`] = ` -Object { - "ast": Object { - "body": Array [ - Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { +{ + "ast": { + "body": [ + { + "declarations": [ + { + "id": { + "loc": { + "end": { "column": 7, "line": 1, }, - "start": Object { + "start": { "column": 6, "line": 1, }, }, "name": "x", - "range": Array [ + "range": [ 6, 7, ], "type": "Identifier", }, - "init": Object { - "loc": Object { - "end": Object { + "init": { + "loc": { + "end": { "column": 11, "line": 1, }, - "start": Object { + "start": { "column": 10, "line": 1, }, }, - "range": Array [ + "range": [ 10, 11, ], @@ -680,17 +706,17 @@ Object { "type": "Literal", "value": 1, }, - "loc": Object { - "end": Object { + "loc": { + "end": { "column": 11, "line": 1, }, - "start": Object { + "start": { "column": 6, "line": 1, }, }, - "range": Array [ + "range": [ 6, 11, ], @@ -698,106 +724,106 @@ Object { }, ], "kind": "const", - "loc": Object { - "end": Object { + "loc": { + "end": { "column": 11, "line": 1, }, - "start": Object { + "start": { "column": 0, "line": 1, }, }, - "range": Array [ + "range": [ 0, 11, ], "type": "VariableDeclaration", }, ], - "comments": Array [], - "loc": Object { - "end": Object { + "comments": [], + "loc": { + "end": { "column": 11, "line": 1, }, - "start": Object { + "start": { "column": 0, "line": 1, }, }, - "range": Array [ + "range": [ 0, 11, ], "sourceType": "script", - "tokens": Array [ - Object { - "loc": Object { - "end": Object { + "tokens": [ + { + "loc": { + "end": { "column": 5, "line": 1, }, - "start": Object { + "start": { "column": 0, "line": 1, }, }, - "range": Array [ + "range": [ 0, 5, ], "type": "Keyword", "value": "const", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 7, "line": 1, }, - "start": Object { + "start": { "column": 6, "line": 1, }, }, - "range": Array [ + "range": [ 6, 7, ], "type": "Identifier", "value": "x", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 9, "line": 1, }, - "start": Object { + "start": { "column": 8, "line": 1, }, }, - "range": Array [ + "range": [ 8, 9, ], "type": "Punctuator", "value": "=", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 11, "line": 1, }, - "start": Object { + "start": { "column": 10, "line": 1, }, }, - "range": Array [ + "range": [ 10, 11, ], @@ -807,52 +833,52 @@ Object { ], "type": "Program", }, - "services": Object { + "services": { "esTreeNodeToTSNodeMap": WeakMap {}, "hasFullTypeInformation": false, - "program": Object {}, + "program": {}, "tsNodeToESTreeNodeMap": WeakMap {}, }, } `; exports[`parseAndGenerateServices isolated parsing should parse .js file - without JSX content - parserOptions.jsx = true 1`] = ` -Object { - "ast": Object { - "body": Array [ - Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { +{ + "ast": { + "body": [ + { + "declarations": [ + { + "id": { + "loc": { + "end": { "column": 7, "line": 1, }, - "start": Object { + "start": { "column": 6, "line": 1, }, }, "name": "x", - "range": Array [ + "range": [ 6, 7, ], "type": "Identifier", }, - "init": Object { - "loc": Object { - "end": Object { + "init": { + "loc": { + "end": { "column": 11, "line": 1, }, - "start": Object { + "start": { "column": 10, "line": 1, }, }, - "range": Array [ + "range": [ 10, 11, ], @@ -860,17 +886,17 @@ Object { "type": "Literal", "value": 1, }, - "loc": Object { - "end": Object { + "loc": { + "end": { "column": 11, "line": 1, }, - "start": Object { + "start": { "column": 6, "line": 1, }, }, - "range": Array [ + "range": [ 6, 11, ], @@ -878,106 +904,106 @@ Object { }, ], "kind": "const", - "loc": Object { - "end": Object { + "loc": { + "end": { "column": 11, "line": 1, }, - "start": Object { + "start": { "column": 0, "line": 1, }, }, - "range": Array [ + "range": [ 0, 11, ], "type": "VariableDeclaration", }, ], - "comments": Array [], - "loc": Object { - "end": Object { + "comments": [], + "loc": { + "end": { "column": 11, "line": 1, }, - "start": Object { + "start": { "column": 0, "line": 1, }, }, - "range": Array [ + "range": [ 0, 11, ], "sourceType": "script", - "tokens": Array [ - Object { - "loc": Object { - "end": Object { + "tokens": [ + { + "loc": { + "end": { "column": 5, "line": 1, }, - "start": Object { + "start": { "column": 0, "line": 1, }, }, - "range": Array [ + "range": [ 0, 5, ], "type": "Keyword", "value": "const", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 7, "line": 1, }, - "start": Object { + "start": { "column": 6, "line": 1, }, }, - "range": Array [ + "range": [ 6, 7, ], "type": "Identifier", "value": "x", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 9, "line": 1, }, - "start": Object { + "start": { "column": 8, "line": 1, }, }, - "range": Array [ + "range": [ 8, 9, ], "type": "Punctuator", "value": "=", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 11, "line": 1, }, - "start": Object { + "start": { "column": 10, "line": 1, }, }, - "range": Array [ + "range": [ 10, 11, ], @@ -987,83 +1013,83 @@ Object { ], "type": "Program", }, - "services": Object { + "services": { "esTreeNodeToTSNodeMap": WeakMap {}, "hasFullTypeInformation": false, - "program": Object {}, + "program": {}, "tsNodeToESTreeNodeMap": WeakMap {}, }, } `; exports[`parseAndGenerateServices isolated parsing should parse .json file - without JSX content - parserOptions.jsx = false 1`] = ` -Object { - "ast": Object { - "body": Array [ - Object { - "expression": Object { - "loc": Object { - "end": Object { +{ + "ast": { + "body": [ + { + "expression": { + "loc": { + "end": { "column": 10, "line": 1, }, - "start": Object { + "start": { "column": 0, "line": 1, }, }, - "properties": Array [ - Object { + "properties": [ + { "computed": false, - "key": Object { - "loc": Object { - "end": Object { + "key": { + "loc": { + "end": { "column": 5, "line": 1, }, - "start": Object { + "start": { "column": 2, "line": 1, }, }, - "range": Array [ + "range": [ 2, 5, ], - "raw": "\\"x\\"", + "raw": ""x"", "type": "Literal", "value": "x", }, "kind": "init", - "loc": Object { - "end": Object { + "loc": { + "end": { "column": 8, "line": 1, }, - "start": Object { + "start": { "column": 2, "line": 1, }, }, "method": false, - "range": Array [ + "range": [ 2, 8, ], "shorthand": false, "type": "Property", - "value": Object { - "loc": Object { - "end": Object { + "value": { + "loc": { + "end": { "column": 8, "line": 1, }, - "start": Object { + "start": { "column": 7, "line": 1, }, }, - "range": Array [ + "range": [ 7, 8, ], @@ -1073,130 +1099,130 @@ Object { }, }, ], - "range": Array [ + "range": [ 0, 10, ], "type": "ObjectExpression", }, - "loc": Object { - "end": Object { + "loc": { + "end": { "column": 10, "line": 1, }, - "start": Object { + "start": { "column": 0, "line": 1, }, }, - "range": Array [ + "range": [ 0, 10, ], "type": "ExpressionStatement", }, ], - "comments": Array [], - "loc": Object { - "end": Object { + "comments": [], + "loc": { + "end": { "column": 10, "line": 1, }, - "start": Object { + "start": { "column": 0, "line": 1, }, }, - "range": Array [ + "range": [ 0, 10, ], "sourceType": "script", - "tokens": Array [ - Object { - "loc": Object { - "end": Object { + "tokens": [ + { + "loc": { + "end": { "column": 1, "line": 1, }, - "start": Object { + "start": { "column": 0, "line": 1, }, }, - "range": Array [ + "range": [ 0, 1, ], "type": "Punctuator", "value": "{", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 5, "line": 1, }, - "start": Object { + "start": { "column": 2, "line": 1, }, }, - "range": Array [ + "range": [ 2, 5, ], "type": "String", - "value": "\\"x\\"", + "value": ""x"", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 6, "line": 1, }, - "start": Object { + "start": { "column": 5, "line": 1, }, }, - "range": Array [ + "range": [ 5, 6, ], "type": "Punctuator", "value": ":", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 8, "line": 1, }, - "start": Object { + "start": { "column": 7, "line": 1, }, }, - "range": Array [ + "range": [ 7, 8, ], "type": "Numeric", "value": "1", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 10, "line": 1, }, - "start": Object { + "start": { "column": 9, "line": 1, }, }, - "range": Array [ + "range": [ 9, 10, ], @@ -1206,84 +1232,84 @@ Object { ], "type": "Program", }, - "services": Object { + "services": { "esTreeNodeToTSNodeMap": WeakMap {}, "hasFullTypeInformation": false, - "program": Object {}, + "program": {}, "tsNodeToESTreeNodeMap": WeakMap {}, }, } `; exports[`parseAndGenerateServices isolated parsing should parse .jsx file - with JSX content - parserOptions.jsx = false 1`] = ` -Object { - "ast": Object { - "body": Array [ - Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { +{ + "ast": { + "body": [ + { + "declarations": [ + { + "id": { + "loc": { + "end": { "column": 7, "line": 1, }, - "start": Object { + "start": { "column": 6, "line": 1, }, }, "name": "x", - "range": Array [ + "range": [ 6, 7, ], "type": "Identifier", }, - "init": Object { - "children": Array [], + "init": { + "children": [], "closingElement": null, - "loc": Object { - "end": Object { + "loc": { + "end": { "column": 17, "line": 1, }, - "start": Object { + "start": { "column": 10, "line": 1, }, }, - "openingElement": Object { - "attributes": Array [], - "loc": Object { - "end": Object { + "openingElement": { + "attributes": [], + "loc": { + "end": { "column": 17, "line": 1, }, - "start": Object { + "start": { "column": 10, "line": 1, }, }, - "name": Object { - "loc": Object { - "end": Object { + "name": { + "loc": { + "end": { "column": 14, "line": 1, }, - "start": Object { + "start": { "column": 11, "line": 1, }, }, "name": "div", - "range": Array [ + "range": [ 11, 14, ], "type": "JSXIdentifier", }, - "range": Array [ + "range": [ 10, 17, ], @@ -1291,23 +1317,23 @@ Object { "type": "JSXOpeningElement", "typeParameters": undefined, }, - "range": Array [ + "range": [ 10, 17, ], "type": "JSXElement", }, - "loc": Object { - "end": Object { + "loc": { + "end": { "column": 17, "line": 1, }, - "start": Object { + "start": { "column": 6, "line": 1, }, }, - "range": Array [ + "range": [ 6, 17, ], @@ -1315,178 +1341,178 @@ Object { }, ], "kind": "const", - "loc": Object { - "end": Object { + "loc": { + "end": { "column": 18, "line": 1, }, - "start": Object { + "start": { "column": 0, "line": 1, }, }, - "range": Array [ + "range": [ 0, 18, ], "type": "VariableDeclaration", }, ], - "comments": Array [], - "loc": Object { - "end": Object { + "comments": [], + "loc": { + "end": { "column": 18, "line": 1, }, - "start": Object { + "start": { "column": 0, "line": 1, }, }, - "range": Array [ + "range": [ 0, 18, ], "sourceType": "script", - "tokens": Array [ - Object { - "loc": Object { - "end": Object { + "tokens": [ + { + "loc": { + "end": { "column": 5, "line": 1, }, - "start": Object { + "start": { "column": 0, "line": 1, }, }, - "range": Array [ + "range": [ 0, 5, ], "type": "Keyword", "value": "const", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 7, "line": 1, }, - "start": Object { + "start": { "column": 6, "line": 1, }, }, - "range": Array [ + "range": [ 6, 7, ], "type": "Identifier", "value": "x", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 9, "line": 1, }, - "start": Object { + "start": { "column": 8, "line": 1, }, }, - "range": Array [ + "range": [ 8, 9, ], "type": "Punctuator", "value": "=", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 11, "line": 1, }, - "start": Object { + "start": { "column": 10, "line": 1, }, }, - "range": Array [ + "range": [ 10, 11, ], "type": "Punctuator", "value": "<", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 14, "line": 1, }, - "start": Object { + "start": { "column": 11, "line": 1, }, }, - "range": Array [ + "range": [ 11, 14, ], "type": "JSXIdentifier", "value": "div", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 16, "line": 1, }, - "start": Object { + "start": { "column": 15, "line": 1, }, }, - "range": Array [ + "range": [ 15, 16, ], "type": "Punctuator", "value": "/", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 17, "line": 1, }, - "start": Object { + "start": { "column": 16, "line": 1, }, }, - "range": Array [ + "range": [ 16, 17, ], "type": "Punctuator", "value": ">", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 18, "line": 1, }, - "start": Object { + "start": { "column": 17, "line": 1, }, }, - "range": Array [ + "range": [ 17, 18, ], @@ -1496,84 +1522,84 @@ Object { ], "type": "Program", }, - "services": Object { + "services": { "esTreeNodeToTSNodeMap": WeakMap {}, "hasFullTypeInformation": false, - "program": Object {}, + "program": {}, "tsNodeToESTreeNodeMap": WeakMap {}, }, } `; exports[`parseAndGenerateServices isolated parsing should parse .jsx file - with JSX content - parserOptions.jsx = true 1`] = ` -Object { - "ast": Object { - "body": Array [ - Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { +{ + "ast": { + "body": [ + { + "declarations": [ + { + "id": { + "loc": { + "end": { "column": 7, "line": 1, }, - "start": Object { + "start": { "column": 6, "line": 1, }, }, "name": "x", - "range": Array [ + "range": [ 6, 7, ], "type": "Identifier", }, - "init": Object { - "children": Array [], + "init": { + "children": [], "closingElement": null, - "loc": Object { - "end": Object { + "loc": { + "end": { "column": 17, "line": 1, }, - "start": Object { + "start": { "column": 10, "line": 1, }, }, - "openingElement": Object { - "attributes": Array [], - "loc": Object { - "end": Object { + "openingElement": { + "attributes": [], + "loc": { + "end": { "column": 17, "line": 1, }, - "start": Object { + "start": { "column": 10, "line": 1, }, }, - "name": Object { - "loc": Object { - "end": Object { + "name": { + "loc": { + "end": { "column": 14, "line": 1, }, - "start": Object { + "start": { "column": 11, "line": 1, }, }, "name": "div", - "range": Array [ + "range": [ 11, 14, ], "type": "JSXIdentifier", }, - "range": Array [ + "range": [ 10, 17, ], @@ -1581,23 +1607,23 @@ Object { "type": "JSXOpeningElement", "typeParameters": undefined, }, - "range": Array [ + "range": [ 10, 17, ], "type": "JSXElement", }, - "loc": Object { - "end": Object { + "loc": { + "end": { "column": 17, "line": 1, }, - "start": Object { + "start": { "column": 6, "line": 1, }, }, - "range": Array [ + "range": [ 6, 17, ], @@ -1605,178 +1631,178 @@ Object { }, ], "kind": "const", - "loc": Object { - "end": Object { + "loc": { + "end": { "column": 18, "line": 1, }, - "start": Object { + "start": { "column": 0, "line": 1, }, }, - "range": Array [ + "range": [ 0, 18, ], "type": "VariableDeclaration", }, ], - "comments": Array [], - "loc": Object { - "end": Object { + "comments": [], + "loc": { + "end": { "column": 18, "line": 1, }, - "start": Object { + "start": { "column": 0, "line": 1, }, }, - "range": Array [ + "range": [ 0, 18, ], "sourceType": "script", - "tokens": Array [ - Object { - "loc": Object { - "end": Object { + "tokens": [ + { + "loc": { + "end": { "column": 5, "line": 1, }, - "start": Object { + "start": { "column": 0, "line": 1, }, }, - "range": Array [ + "range": [ 0, 5, ], "type": "Keyword", "value": "const", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 7, "line": 1, }, - "start": Object { + "start": { "column": 6, "line": 1, }, }, - "range": Array [ + "range": [ 6, 7, ], "type": "Identifier", "value": "x", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 9, "line": 1, }, - "start": Object { + "start": { "column": 8, "line": 1, }, }, - "range": Array [ + "range": [ 8, 9, ], "type": "Punctuator", "value": "=", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 11, "line": 1, }, - "start": Object { + "start": { "column": 10, "line": 1, }, }, - "range": Array [ + "range": [ 10, 11, ], "type": "Punctuator", "value": "<", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 14, "line": 1, }, - "start": Object { + "start": { "column": 11, "line": 1, }, }, - "range": Array [ + "range": [ 11, 14, ], "type": "JSXIdentifier", "value": "div", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 16, "line": 1, }, - "start": Object { + "start": { "column": 15, "line": 1, }, }, - "range": Array [ + "range": [ 15, 16, ], "type": "Punctuator", "value": "/", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 17, "line": 1, }, - "start": Object { + "start": { "column": 16, "line": 1, }, }, - "range": Array [ + "range": [ 16, 17, ], "type": "Punctuator", "value": ">", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 18, "line": 1, }, - "start": Object { + "start": { "column": 17, "line": 1, }, }, - "range": Array [ + "range": [ 17, 18, ], @@ -1786,52 +1812,52 @@ Object { ], "type": "Program", }, - "services": Object { + "services": { "esTreeNodeToTSNodeMap": WeakMap {}, "hasFullTypeInformation": false, - "program": Object {}, + "program": {}, "tsNodeToESTreeNodeMap": WeakMap {}, }, } `; exports[`parseAndGenerateServices isolated parsing should parse .jsx file - without JSX content - parserOptions.jsx = false 1`] = ` -Object { - "ast": Object { - "body": Array [ - Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { +{ + "ast": { + "body": [ + { + "declarations": [ + { + "id": { + "loc": { + "end": { "column": 7, "line": 1, }, - "start": Object { + "start": { "column": 6, "line": 1, }, }, "name": "x", - "range": Array [ + "range": [ 6, 7, ], "type": "Identifier", }, - "init": Object { - "loc": Object { - "end": Object { + "init": { + "loc": { + "end": { "column": 11, "line": 1, }, - "start": Object { + "start": { "column": 10, "line": 1, }, }, - "range": Array [ + "range": [ 10, 11, ], @@ -1839,17 +1865,17 @@ Object { "type": "Literal", "value": 1, }, - "loc": Object { - "end": Object { + "loc": { + "end": { "column": 11, "line": 1, }, - "start": Object { + "start": { "column": 6, "line": 1, }, }, - "range": Array [ + "range": [ 6, 11, ], @@ -1857,106 +1883,106 @@ Object { }, ], "kind": "const", - "loc": Object { - "end": Object { + "loc": { + "end": { "column": 11, "line": 1, }, - "start": Object { + "start": { "column": 0, "line": 1, }, }, - "range": Array [ + "range": [ 0, 11, ], "type": "VariableDeclaration", }, ], - "comments": Array [], - "loc": Object { - "end": Object { + "comments": [], + "loc": { + "end": { "column": 11, "line": 1, }, - "start": Object { + "start": { "column": 0, "line": 1, }, }, - "range": Array [ + "range": [ 0, 11, ], "sourceType": "script", - "tokens": Array [ - Object { - "loc": Object { - "end": Object { + "tokens": [ + { + "loc": { + "end": { "column": 5, "line": 1, }, - "start": Object { + "start": { "column": 0, "line": 1, }, }, - "range": Array [ + "range": [ 0, 5, ], "type": "Keyword", "value": "const", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 7, "line": 1, }, - "start": Object { + "start": { "column": 6, "line": 1, }, }, - "range": Array [ + "range": [ 6, 7, ], "type": "Identifier", "value": "x", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 9, "line": 1, }, - "start": Object { + "start": { "column": 8, "line": 1, }, }, - "range": Array [ + "range": [ 8, 9, ], "type": "Punctuator", "value": "=", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 11, "line": 1, }, - "start": Object { + "start": { "column": 10, "line": 1, }, }, - "range": Array [ + "range": [ 10, 11, ], @@ -1966,52 +1992,52 @@ Object { ], "type": "Program", }, - "services": Object { + "services": { "esTreeNodeToTSNodeMap": WeakMap {}, "hasFullTypeInformation": false, - "program": Object {}, + "program": {}, "tsNodeToESTreeNodeMap": WeakMap {}, }, } `; exports[`parseAndGenerateServices isolated parsing should parse .jsx file - without JSX content - parserOptions.jsx = true 1`] = ` -Object { - "ast": Object { - "body": Array [ - Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { +{ + "ast": { + "body": [ + { + "declarations": [ + { + "id": { + "loc": { + "end": { "column": 7, "line": 1, }, - "start": Object { + "start": { "column": 6, "line": 1, }, }, "name": "x", - "range": Array [ + "range": [ 6, 7, ], "type": "Identifier", }, - "init": Object { - "loc": Object { - "end": Object { + "init": { + "loc": { + "end": { "column": 11, "line": 1, }, - "start": Object { + "start": { "column": 10, "line": 1, }, }, - "range": Array [ + "range": [ 10, 11, ], @@ -2019,17 +2045,17 @@ Object { "type": "Literal", "value": 1, }, - "loc": Object { - "end": Object { + "loc": { + "end": { "column": 11, "line": 1, }, - "start": Object { + "start": { "column": 6, "line": 1, }, }, - "range": Array [ + "range": [ 6, 11, ], @@ -2037,106 +2063,106 @@ Object { }, ], "kind": "const", - "loc": Object { - "end": Object { + "loc": { + "end": { "column": 11, "line": 1, }, - "start": Object { + "start": { "column": 0, "line": 1, }, }, - "range": Array [ + "range": [ 0, 11, ], "type": "VariableDeclaration", }, ], - "comments": Array [], - "loc": Object { - "end": Object { + "comments": [], + "loc": { + "end": { "column": 11, "line": 1, }, - "start": Object { + "start": { "column": 0, "line": 1, }, }, - "range": Array [ + "range": [ 0, 11, ], "sourceType": "script", - "tokens": Array [ - Object { - "loc": Object { - "end": Object { + "tokens": [ + { + "loc": { + "end": { "column": 5, "line": 1, }, - "start": Object { + "start": { "column": 0, "line": 1, }, }, - "range": Array [ + "range": [ 0, 5, ], "type": "Keyword", "value": "const", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 7, "line": 1, }, - "start": Object { + "start": { "column": 6, "line": 1, }, }, - "range": Array [ + "range": [ 6, 7, ], "type": "Identifier", "value": "x", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 9, "line": 1, }, - "start": Object { + "start": { "column": 8, "line": 1, }, }, - "range": Array [ + "range": [ 8, 9, ], "type": "Punctuator", "value": "=", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 11, "line": 1, }, - "start": Object { + "start": { "column": 10, "line": 1, }, }, - "range": Array [ + "range": [ 10, 11, ], @@ -2146,52 +2172,52 @@ Object { ], "type": "Program", }, - "services": Object { + "services": { "esTreeNodeToTSNodeMap": WeakMap {}, "hasFullTypeInformation": false, - "program": Object {}, + "program": {}, "tsNodeToESTreeNodeMap": WeakMap {}, }, } `; exports[`parseAndGenerateServices isolated parsing should parse .ts file - without JSX content - parserOptions.jsx = false 1`] = ` -Object { - "ast": Object { - "body": Array [ - Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { +{ + "ast": { + "body": [ + { + "declarations": [ + { + "id": { + "loc": { + "end": { "column": 7, "line": 1, }, - "start": Object { + "start": { "column": 6, "line": 1, }, }, "name": "x", - "range": Array [ + "range": [ 6, 7, ], "type": "Identifier", }, - "init": Object { - "loc": Object { - "end": Object { + "init": { + "loc": { + "end": { "column": 11, "line": 1, }, - "start": Object { + "start": { "column": 10, "line": 1, }, }, - "range": Array [ + "range": [ 10, 11, ], @@ -2199,17 +2225,17 @@ Object { "type": "Literal", "value": 1, }, - "loc": Object { - "end": Object { + "loc": { + "end": { "column": 11, "line": 1, }, - "start": Object { + "start": { "column": 6, "line": 1, }, }, - "range": Array [ + "range": [ 6, 11, ], @@ -2217,106 +2243,106 @@ Object { }, ], "kind": "const", - "loc": Object { - "end": Object { + "loc": { + "end": { "column": 11, "line": 1, }, - "start": Object { + "start": { "column": 0, "line": 1, }, }, - "range": Array [ + "range": [ 0, 11, ], "type": "VariableDeclaration", }, ], - "comments": Array [], - "loc": Object { - "end": Object { + "comments": [], + "loc": { + "end": { "column": 11, "line": 1, }, - "start": Object { + "start": { "column": 0, "line": 1, }, }, - "range": Array [ + "range": [ 0, 11, ], "sourceType": "script", - "tokens": Array [ - Object { - "loc": Object { - "end": Object { + "tokens": [ + { + "loc": { + "end": { "column": 5, "line": 1, }, - "start": Object { + "start": { "column": 0, "line": 1, }, }, - "range": Array [ + "range": [ 0, 5, ], "type": "Keyword", "value": "const", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 7, "line": 1, }, - "start": Object { + "start": { "column": 6, "line": 1, }, }, - "range": Array [ + "range": [ 6, 7, ], "type": "Identifier", "value": "x", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 9, "line": 1, }, - "start": Object { + "start": { "column": 8, "line": 1, }, }, - "range": Array [ + "range": [ 8, 9, ], "type": "Punctuator", "value": "=", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 11, "line": 1, }, - "start": Object { + "start": { "column": 10, "line": 1, }, }, - "range": Array [ + "range": [ 10, 11, ], @@ -2326,52 +2352,52 @@ Object { ], "type": "Program", }, - "services": Object { + "services": { "esTreeNodeToTSNodeMap": WeakMap {}, "hasFullTypeInformation": false, - "program": Object {}, + "program": {}, "tsNodeToESTreeNodeMap": WeakMap {}, }, } `; exports[`parseAndGenerateServices isolated parsing should parse .ts file - without JSX content - parserOptions.jsx = true 1`] = ` -Object { - "ast": Object { - "body": Array [ - Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { +{ + "ast": { + "body": [ + { + "declarations": [ + { + "id": { + "loc": { + "end": { "column": 7, "line": 1, }, - "start": Object { + "start": { "column": 6, "line": 1, }, }, "name": "x", - "range": Array [ + "range": [ 6, 7, ], "type": "Identifier", }, - "init": Object { - "loc": Object { - "end": Object { + "init": { + "loc": { + "end": { "column": 11, "line": 1, }, - "start": Object { + "start": { "column": 10, "line": 1, }, }, - "range": Array [ + "range": [ 10, 11, ], @@ -2379,17 +2405,17 @@ Object { "type": "Literal", "value": 1, }, - "loc": Object { - "end": Object { + "loc": { + "end": { "column": 11, "line": 1, }, - "start": Object { + "start": { "column": 6, "line": 1, }, }, - "range": Array [ + "range": [ 6, 11, ], @@ -2397,106 +2423,106 @@ Object { }, ], "kind": "const", - "loc": Object { - "end": Object { + "loc": { + "end": { "column": 11, "line": 1, }, - "start": Object { + "start": { "column": 0, "line": 1, }, }, - "range": Array [ + "range": [ 0, 11, ], "type": "VariableDeclaration", }, ], - "comments": Array [], - "loc": Object { - "end": Object { + "comments": [], + "loc": { + "end": { "column": 11, "line": 1, }, - "start": Object { + "start": { "column": 0, "line": 1, }, }, - "range": Array [ + "range": [ 0, 11, ], "sourceType": "script", - "tokens": Array [ - Object { - "loc": Object { - "end": Object { + "tokens": [ + { + "loc": { + "end": { "column": 5, "line": 1, }, - "start": Object { + "start": { "column": 0, "line": 1, }, }, - "range": Array [ + "range": [ 0, 5, ], "type": "Keyword", "value": "const", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 7, "line": 1, }, - "start": Object { + "start": { "column": 6, "line": 1, }, }, - "range": Array [ + "range": [ 6, 7, ], "type": "Identifier", "value": "x", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 9, "line": 1, }, - "start": Object { + "start": { "column": 8, "line": 1, }, }, - "range": Array [ + "range": [ 8, 9, ], "type": "Punctuator", "value": "=", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 11, "line": 1, }, - "start": Object { + "start": { "column": 10, "line": 1, }, }, - "range": Array [ + "range": [ 10, 11, ], @@ -2506,84 +2532,84 @@ Object { ], "type": "Program", }, - "services": Object { + "services": { "esTreeNodeToTSNodeMap": WeakMap {}, "hasFullTypeInformation": false, - "program": Object {}, + "program": {}, "tsNodeToESTreeNodeMap": WeakMap {}, }, } `; exports[`parseAndGenerateServices isolated parsing should parse .tsx file - with JSX content - parserOptions.jsx = false 1`] = ` -Object { - "ast": Object { - "body": Array [ - Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { +{ + "ast": { + "body": [ + { + "declarations": [ + { + "id": { + "loc": { + "end": { "column": 7, "line": 1, }, - "start": Object { + "start": { "column": 6, "line": 1, }, }, "name": "x", - "range": Array [ + "range": [ 6, 7, ], "type": "Identifier", }, - "init": Object { - "children": Array [], + "init": { + "children": [], "closingElement": null, - "loc": Object { - "end": Object { + "loc": { + "end": { "column": 17, "line": 1, }, - "start": Object { + "start": { "column": 10, "line": 1, }, }, - "openingElement": Object { - "attributes": Array [], - "loc": Object { - "end": Object { + "openingElement": { + "attributes": [], + "loc": { + "end": { "column": 17, "line": 1, }, - "start": Object { + "start": { "column": 10, "line": 1, }, }, - "name": Object { - "loc": Object { - "end": Object { + "name": { + "loc": { + "end": { "column": 14, "line": 1, }, - "start": Object { + "start": { "column": 11, "line": 1, }, }, "name": "div", - "range": Array [ + "range": [ 11, 14, ], "type": "JSXIdentifier", }, - "range": Array [ + "range": [ 10, 17, ], @@ -2591,23 +2617,23 @@ Object { "type": "JSXOpeningElement", "typeParameters": undefined, }, - "range": Array [ + "range": [ 10, 17, ], "type": "JSXElement", }, - "loc": Object { - "end": Object { + "loc": { + "end": { "column": 17, "line": 1, }, - "start": Object { + "start": { "column": 6, "line": 1, }, }, - "range": Array [ + "range": [ 6, 17, ], @@ -2615,178 +2641,178 @@ Object { }, ], "kind": "const", - "loc": Object { - "end": Object { + "loc": { + "end": { "column": 18, "line": 1, }, - "start": Object { + "start": { "column": 0, "line": 1, }, }, - "range": Array [ + "range": [ 0, 18, ], "type": "VariableDeclaration", }, ], - "comments": Array [], - "loc": Object { - "end": Object { + "comments": [], + "loc": { + "end": { "column": 18, "line": 1, }, - "start": Object { + "start": { "column": 0, "line": 1, }, }, - "range": Array [ + "range": [ 0, 18, ], "sourceType": "script", - "tokens": Array [ - Object { - "loc": Object { - "end": Object { + "tokens": [ + { + "loc": { + "end": { "column": 5, "line": 1, }, - "start": Object { + "start": { "column": 0, "line": 1, }, }, - "range": Array [ + "range": [ 0, 5, ], "type": "Keyword", "value": "const", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 7, "line": 1, }, - "start": Object { + "start": { "column": 6, "line": 1, }, }, - "range": Array [ + "range": [ 6, 7, ], "type": "Identifier", "value": "x", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 9, "line": 1, }, - "start": Object { + "start": { "column": 8, "line": 1, }, }, - "range": Array [ + "range": [ 8, 9, ], "type": "Punctuator", "value": "=", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 11, "line": 1, }, - "start": Object { + "start": { "column": 10, "line": 1, }, }, - "range": Array [ + "range": [ 10, 11, ], "type": "Punctuator", "value": "<", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 14, "line": 1, }, - "start": Object { + "start": { "column": 11, "line": 1, }, }, - "range": Array [ + "range": [ 11, 14, ], "type": "JSXIdentifier", "value": "div", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 16, "line": 1, }, - "start": Object { + "start": { "column": 15, "line": 1, }, }, - "range": Array [ + "range": [ 15, 16, ], "type": "Punctuator", "value": "/", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 17, "line": 1, }, - "start": Object { + "start": { "column": 16, "line": 1, }, }, - "range": Array [ + "range": [ 16, 17, ], "type": "Punctuator", "value": ">", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 18, "line": 1, }, - "start": Object { + "start": { "column": 17, "line": 1, }, }, - "range": Array [ + "range": [ 17, 18, ], @@ -2796,84 +2822,84 @@ Object { ], "type": "Program", }, - "services": Object { + "services": { "esTreeNodeToTSNodeMap": WeakMap {}, "hasFullTypeInformation": false, - "program": Object {}, + "program": {}, "tsNodeToESTreeNodeMap": WeakMap {}, }, } `; exports[`parseAndGenerateServices isolated parsing should parse .tsx file - with JSX content - parserOptions.jsx = true 1`] = ` -Object { - "ast": Object { - "body": Array [ - Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { +{ + "ast": { + "body": [ + { + "declarations": [ + { + "id": { + "loc": { + "end": { "column": 7, "line": 1, }, - "start": Object { + "start": { "column": 6, "line": 1, }, }, "name": "x", - "range": Array [ + "range": [ 6, 7, ], "type": "Identifier", }, - "init": Object { - "children": Array [], + "init": { + "children": [], "closingElement": null, - "loc": Object { - "end": Object { + "loc": { + "end": { "column": 17, "line": 1, }, - "start": Object { + "start": { "column": 10, "line": 1, }, }, - "openingElement": Object { - "attributes": Array [], - "loc": Object { - "end": Object { + "openingElement": { + "attributes": [], + "loc": { + "end": { "column": 17, "line": 1, }, - "start": Object { + "start": { "column": 10, "line": 1, }, }, - "name": Object { - "loc": Object { - "end": Object { + "name": { + "loc": { + "end": { "column": 14, "line": 1, }, - "start": Object { + "start": { "column": 11, "line": 1, }, }, "name": "div", - "range": Array [ + "range": [ 11, 14, ], "type": "JSXIdentifier", }, - "range": Array [ + "range": [ 10, 17, ], @@ -2881,23 +2907,23 @@ Object { "type": "JSXOpeningElement", "typeParameters": undefined, }, - "range": Array [ + "range": [ 10, 17, ], "type": "JSXElement", }, - "loc": Object { - "end": Object { + "loc": { + "end": { "column": 17, "line": 1, }, - "start": Object { + "start": { "column": 6, "line": 1, }, }, - "range": Array [ + "range": [ 6, 17, ], @@ -2905,178 +2931,178 @@ Object { }, ], "kind": "const", - "loc": Object { - "end": Object { + "loc": { + "end": { "column": 18, "line": 1, }, - "start": Object { + "start": { "column": 0, "line": 1, }, }, - "range": Array [ + "range": [ 0, 18, ], "type": "VariableDeclaration", }, ], - "comments": Array [], - "loc": Object { - "end": Object { + "comments": [], + "loc": { + "end": { "column": 18, "line": 1, }, - "start": Object { + "start": { "column": 0, "line": 1, }, }, - "range": Array [ + "range": [ 0, 18, ], "sourceType": "script", - "tokens": Array [ - Object { - "loc": Object { - "end": Object { + "tokens": [ + { + "loc": { + "end": { "column": 5, "line": 1, }, - "start": Object { + "start": { "column": 0, "line": 1, }, }, - "range": Array [ + "range": [ 0, 5, ], "type": "Keyword", "value": "const", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 7, "line": 1, }, - "start": Object { + "start": { "column": 6, "line": 1, }, }, - "range": Array [ + "range": [ 6, 7, ], "type": "Identifier", "value": "x", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 9, "line": 1, }, - "start": Object { + "start": { "column": 8, "line": 1, }, }, - "range": Array [ + "range": [ 8, 9, ], "type": "Punctuator", "value": "=", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 11, "line": 1, }, - "start": Object { + "start": { "column": 10, "line": 1, }, }, - "range": Array [ + "range": [ 10, 11, ], "type": "Punctuator", "value": "<", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 14, "line": 1, }, - "start": Object { + "start": { "column": 11, "line": 1, }, }, - "range": Array [ + "range": [ 11, 14, ], "type": "JSXIdentifier", "value": "div", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 16, "line": 1, }, - "start": Object { + "start": { "column": 15, "line": 1, }, }, - "range": Array [ + "range": [ 15, 16, ], "type": "Punctuator", "value": "/", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 17, "line": 1, }, - "start": Object { + "start": { "column": 16, "line": 1, }, }, - "range": Array [ + "range": [ 16, 17, ], "type": "Punctuator", "value": ">", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 18, "line": 1, }, - "start": Object { + "start": { "column": 17, "line": 1, }, }, - "range": Array [ + "range": [ 17, 18, ], @@ -3086,52 +3112,52 @@ Object { ], "type": "Program", }, - "services": Object { + "services": { "esTreeNodeToTSNodeMap": WeakMap {}, "hasFullTypeInformation": false, - "program": Object {}, + "program": {}, "tsNodeToESTreeNodeMap": WeakMap {}, }, } `; exports[`parseAndGenerateServices isolated parsing should parse .tsx file - without JSX content - parserOptions.jsx = false 1`] = ` -Object { - "ast": Object { - "body": Array [ - Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { +{ + "ast": { + "body": [ + { + "declarations": [ + { + "id": { + "loc": { + "end": { "column": 7, "line": 1, }, - "start": Object { + "start": { "column": 6, "line": 1, }, }, "name": "x", - "range": Array [ + "range": [ 6, 7, ], "type": "Identifier", }, - "init": Object { - "loc": Object { - "end": Object { + "init": { + "loc": { + "end": { "column": 11, "line": 1, }, - "start": Object { + "start": { "column": 10, "line": 1, }, }, - "range": Array [ + "range": [ 10, 11, ], @@ -3139,17 +3165,17 @@ Object { "type": "Literal", "value": 1, }, - "loc": Object { - "end": Object { + "loc": { + "end": { "column": 11, "line": 1, }, - "start": Object { + "start": { "column": 6, "line": 1, }, }, - "range": Array [ + "range": [ 6, 11, ], @@ -3157,106 +3183,106 @@ Object { }, ], "kind": "const", - "loc": Object { - "end": Object { + "loc": { + "end": { "column": 11, "line": 1, }, - "start": Object { + "start": { "column": 0, "line": 1, }, }, - "range": Array [ + "range": [ 0, 11, ], "type": "VariableDeclaration", }, ], - "comments": Array [], - "loc": Object { - "end": Object { + "comments": [], + "loc": { + "end": { "column": 11, "line": 1, }, - "start": Object { + "start": { "column": 0, "line": 1, }, }, - "range": Array [ + "range": [ 0, 11, ], "sourceType": "script", - "tokens": Array [ - Object { - "loc": Object { - "end": Object { + "tokens": [ + { + "loc": { + "end": { "column": 5, "line": 1, }, - "start": Object { + "start": { "column": 0, "line": 1, }, }, - "range": Array [ + "range": [ 0, 5, ], "type": "Keyword", "value": "const", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 7, "line": 1, }, - "start": Object { + "start": { "column": 6, "line": 1, }, }, - "range": Array [ + "range": [ 6, 7, ], "type": "Identifier", "value": "x", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 9, "line": 1, }, - "start": Object { + "start": { "column": 8, "line": 1, }, }, - "range": Array [ + "range": [ 8, 9, ], "type": "Punctuator", "value": "=", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 11, "line": 1, }, - "start": Object { + "start": { "column": 10, "line": 1, }, }, - "range": Array [ + "range": [ 10, 11, ], @@ -3266,52 +3292,52 @@ Object { ], "type": "Program", }, - "services": Object { + "services": { "esTreeNodeToTSNodeMap": WeakMap {}, "hasFullTypeInformation": false, - "program": Object {}, + "program": {}, "tsNodeToESTreeNodeMap": WeakMap {}, }, } `; exports[`parseAndGenerateServices isolated parsing should parse .tsx file - without JSX content - parserOptions.jsx = true 1`] = ` -Object { - "ast": Object { - "body": Array [ - Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { +{ + "ast": { + "body": [ + { + "declarations": [ + { + "id": { + "loc": { + "end": { "column": 7, "line": 1, }, - "start": Object { + "start": { "column": 6, "line": 1, }, }, "name": "x", - "range": Array [ + "range": [ 6, 7, ], "type": "Identifier", }, - "init": Object { - "loc": Object { - "end": Object { + "init": { + "loc": { + "end": { "column": 11, "line": 1, }, - "start": Object { + "start": { "column": 10, "line": 1, }, }, - "range": Array [ + "range": [ 10, 11, ], @@ -3319,17 +3345,17 @@ Object { "type": "Literal", "value": 1, }, - "loc": Object { - "end": Object { + "loc": { + "end": { "column": 11, "line": 1, }, - "start": Object { + "start": { "column": 6, "line": 1, }, }, - "range": Array [ + "range": [ 6, 11, ], @@ -3337,106 +3363,106 @@ Object { }, ], "kind": "const", - "loc": Object { - "end": Object { + "loc": { + "end": { "column": 11, "line": 1, }, - "start": Object { + "start": { "column": 0, "line": 1, }, }, - "range": Array [ + "range": [ 0, 11, ], "type": "VariableDeclaration", }, ], - "comments": Array [], - "loc": Object { - "end": Object { + "comments": [], + "loc": { + "end": { "column": 11, "line": 1, }, - "start": Object { + "start": { "column": 0, "line": 1, }, }, - "range": Array [ + "range": [ 0, 11, ], "sourceType": "script", - "tokens": Array [ - Object { - "loc": Object { - "end": Object { + "tokens": [ + { + "loc": { + "end": { "column": 5, "line": 1, }, - "start": Object { + "start": { "column": 0, "line": 1, }, }, - "range": Array [ + "range": [ 0, 5, ], "type": "Keyword", "value": "const", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 7, "line": 1, }, - "start": Object { + "start": { "column": 6, "line": 1, }, }, - "range": Array [ + "range": [ 6, 7, ], "type": "Identifier", "value": "x", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 9, "line": 1, }, - "start": Object { + "start": { "column": 8, "line": 1, }, }, - "range": Array [ + "range": [ 8, 9, ], "type": "Punctuator", "value": "=", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 11, "line": 1, }, - "start": Object { + "start": { "column": 10, "line": 1, }, }, - "range": Array [ + "range": [ 10, 11, ], @@ -3446,84 +3472,84 @@ Object { ], "type": "Program", }, - "services": Object { + "services": { "esTreeNodeToTSNodeMap": WeakMap {}, "hasFullTypeInformation": false, - "program": Object {}, + "program": {}, "tsNodeToESTreeNodeMap": WeakMap {}, }, } `; exports[`parseAndGenerateServices isolated parsing should parse .vue file - with JSX content - parserOptions.jsx = true 1`] = ` -Object { - "ast": Object { - "body": Array [ - Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { +{ + "ast": { + "body": [ + { + "declarations": [ + { + "id": { + "loc": { + "end": { "column": 7, "line": 1, }, - "start": Object { + "start": { "column": 6, "line": 1, }, }, "name": "x", - "range": Array [ + "range": [ 6, 7, ], "type": "Identifier", }, - "init": Object { - "children": Array [], + "init": { + "children": [], "closingElement": null, - "loc": Object { - "end": Object { + "loc": { + "end": { "column": 17, "line": 1, }, - "start": Object { + "start": { "column": 10, "line": 1, }, }, - "openingElement": Object { - "attributes": Array [], - "loc": Object { - "end": Object { + "openingElement": { + "attributes": [], + "loc": { + "end": { "column": 17, "line": 1, }, - "start": Object { + "start": { "column": 10, "line": 1, }, }, - "name": Object { - "loc": Object { - "end": Object { + "name": { + "loc": { + "end": { "column": 14, "line": 1, }, - "start": Object { + "start": { "column": 11, "line": 1, }, }, "name": "div", - "range": Array [ + "range": [ 11, 14, ], "type": "JSXIdentifier", }, - "range": Array [ + "range": [ 10, 17, ], @@ -3531,23 +3557,23 @@ Object { "type": "JSXOpeningElement", "typeParameters": undefined, }, - "range": Array [ + "range": [ 10, 17, ], "type": "JSXElement", }, - "loc": Object { - "end": Object { + "loc": { + "end": { "column": 17, "line": 1, }, - "start": Object { + "start": { "column": 6, "line": 1, }, }, - "range": Array [ + "range": [ 6, 17, ], @@ -3555,178 +3581,178 @@ Object { }, ], "kind": "const", - "loc": Object { - "end": Object { + "loc": { + "end": { "column": 18, "line": 1, }, - "start": Object { + "start": { "column": 0, "line": 1, }, }, - "range": Array [ + "range": [ 0, 18, ], "type": "VariableDeclaration", }, ], - "comments": Array [], - "loc": Object { - "end": Object { + "comments": [], + "loc": { + "end": { "column": 18, "line": 1, }, - "start": Object { + "start": { "column": 0, "line": 1, }, }, - "range": Array [ + "range": [ 0, 18, ], "sourceType": "script", - "tokens": Array [ - Object { - "loc": Object { - "end": Object { + "tokens": [ + { + "loc": { + "end": { "column": 5, "line": 1, }, - "start": Object { + "start": { "column": 0, "line": 1, }, }, - "range": Array [ + "range": [ 0, 5, ], "type": "Keyword", "value": "const", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 7, "line": 1, }, - "start": Object { + "start": { "column": 6, "line": 1, }, }, - "range": Array [ + "range": [ 6, 7, ], "type": "Identifier", "value": "x", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 9, "line": 1, }, - "start": Object { + "start": { "column": 8, "line": 1, }, }, - "range": Array [ + "range": [ 8, 9, ], "type": "Punctuator", "value": "=", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 11, "line": 1, }, - "start": Object { + "start": { "column": 10, "line": 1, }, }, - "range": Array [ + "range": [ 10, 11, ], "type": "Punctuator", "value": "<", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 14, "line": 1, }, - "start": Object { + "start": { "column": 11, "line": 1, }, }, - "range": Array [ + "range": [ 11, 14, ], "type": "JSXIdentifier", "value": "div", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 16, "line": 1, }, - "start": Object { + "start": { "column": 15, "line": 1, }, }, - "range": Array [ + "range": [ 15, 16, ], "type": "Punctuator", "value": "/", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 17, "line": 1, }, - "start": Object { + "start": { "column": 16, "line": 1, }, }, - "range": Array [ + "range": [ 16, 17, ], "type": "Punctuator", "value": ">", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 18, "line": 1, }, - "start": Object { + "start": { "column": 17, "line": 1, }, }, - "range": Array [ + "range": [ 17, 18, ], @@ -3736,52 +3762,52 @@ Object { ], "type": "Program", }, - "services": Object { + "services": { "esTreeNodeToTSNodeMap": WeakMap {}, "hasFullTypeInformation": false, - "program": Object {}, + "program": {}, "tsNodeToESTreeNodeMap": WeakMap {}, }, } `; exports[`parseAndGenerateServices isolated parsing should parse .vue file - without JSX content - parserOptions.jsx = false 1`] = ` -Object { - "ast": Object { - "body": Array [ - Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { +{ + "ast": { + "body": [ + { + "declarations": [ + { + "id": { + "loc": { + "end": { "column": 7, "line": 1, }, - "start": Object { + "start": { "column": 6, "line": 1, }, }, "name": "x", - "range": Array [ + "range": [ 6, 7, ], "type": "Identifier", }, - "init": Object { - "loc": Object { - "end": Object { + "init": { + "loc": { + "end": { "column": 11, "line": 1, }, - "start": Object { + "start": { "column": 10, "line": 1, }, }, - "range": Array [ + "range": [ 10, 11, ], @@ -3789,17 +3815,17 @@ Object { "type": "Literal", "value": 1, }, - "loc": Object { - "end": Object { + "loc": { + "end": { "column": 11, "line": 1, }, - "start": Object { + "start": { "column": 6, "line": 1, }, }, - "range": Array [ + "range": [ 6, 11, ], @@ -3807,106 +3833,106 @@ Object { }, ], "kind": "const", - "loc": Object { - "end": Object { + "loc": { + "end": { "column": 11, "line": 1, }, - "start": Object { + "start": { "column": 0, "line": 1, }, }, - "range": Array [ + "range": [ 0, 11, ], "type": "VariableDeclaration", }, ], - "comments": Array [], - "loc": Object { - "end": Object { + "comments": [], + "loc": { + "end": { "column": 11, "line": 1, }, - "start": Object { + "start": { "column": 0, "line": 1, }, }, - "range": Array [ + "range": [ 0, 11, ], "sourceType": "script", - "tokens": Array [ - Object { - "loc": Object { - "end": Object { + "tokens": [ + { + "loc": { + "end": { "column": 5, "line": 1, }, - "start": Object { + "start": { "column": 0, "line": 1, }, }, - "range": Array [ + "range": [ 0, 5, ], "type": "Keyword", "value": "const", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 7, "line": 1, }, - "start": Object { + "start": { "column": 6, "line": 1, }, }, - "range": Array [ + "range": [ 6, 7, ], "type": "Identifier", "value": "x", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 9, "line": 1, }, - "start": Object { + "start": { "column": 8, "line": 1, }, }, - "range": Array [ + "range": [ 8, 9, ], "type": "Punctuator", "value": "=", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 11, "line": 1, }, - "start": Object { + "start": { "column": 10, "line": 1, }, }, - "range": Array [ + "range": [ 10, 11, ], @@ -3916,52 +3942,52 @@ Object { ], "type": "Program", }, - "services": Object { + "services": { "esTreeNodeToTSNodeMap": WeakMap {}, "hasFullTypeInformation": false, - "program": Object {}, + "program": {}, "tsNodeToESTreeNodeMap": WeakMap {}, }, } `; exports[`parseAndGenerateServices isolated parsing should parse .vue file - without JSX content - parserOptions.jsx = true 1`] = ` -Object { - "ast": Object { - "body": Array [ - Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { +{ + "ast": { + "body": [ + { + "declarations": [ + { + "id": { + "loc": { + "end": { "column": 7, "line": 1, }, - "start": Object { + "start": { "column": 6, "line": 1, }, }, "name": "x", - "range": Array [ + "range": [ 6, 7, ], "type": "Identifier", }, - "init": Object { - "loc": Object { - "end": Object { + "init": { + "loc": { + "end": { "column": 11, "line": 1, }, - "start": Object { + "start": { "column": 10, "line": 1, }, }, - "range": Array [ + "range": [ 10, 11, ], @@ -3969,17 +3995,17 @@ Object { "type": "Literal", "value": 1, }, - "loc": Object { - "end": Object { + "loc": { + "end": { "column": 11, "line": 1, }, - "start": Object { + "start": { "column": 6, "line": 1, }, }, - "range": Array [ + "range": [ 6, 11, ], @@ -3987,106 +4013,106 @@ Object { }, ], "kind": "const", - "loc": Object { - "end": Object { + "loc": { + "end": { "column": 11, "line": 1, }, - "start": Object { + "start": { "column": 0, "line": 1, }, }, - "range": Array [ + "range": [ 0, 11, ], "type": "VariableDeclaration", }, ], - "comments": Array [], - "loc": Object { - "end": Object { + "comments": [], + "loc": { + "end": { "column": 11, "line": 1, }, - "start": Object { + "start": { "column": 0, "line": 1, }, }, - "range": Array [ + "range": [ 0, 11, ], "sourceType": "script", - "tokens": Array [ - Object { - "loc": Object { - "end": Object { + "tokens": [ + { + "loc": { + "end": { "column": 5, "line": 1, }, - "start": Object { + "start": { "column": 0, "line": 1, }, }, - "range": Array [ + "range": [ 0, 5, ], "type": "Keyword", "value": "const", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 7, "line": 1, }, - "start": Object { + "start": { "column": 6, "line": 1, }, }, - "range": Array [ + "range": [ 6, 7, ], "type": "Identifier", "value": "x", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 9, "line": 1, }, - "start": Object { + "start": { "column": 8, "line": 1, }, }, - "range": Array [ + "range": [ 8, 9, ], "type": "Punctuator", "value": "=", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 11, "line": 1, }, - "start": Object { + "start": { "column": 10, "line": 1, }, }, - "range": Array [ + "range": [ 10, 11, ], @@ -4096,38 +4122,38 @@ Object { ], "type": "Program", }, - "services": Object { + "services": { "esTreeNodeToTSNodeMap": WeakMap {}, "hasFullTypeInformation": false, - "program": Object {}, + "program": {}, "tsNodeToESTreeNodeMap": WeakMap {}, }, } `; exports[`parseWithNodeMaps() general output should not contain loc 1`] = ` -Object { - "body": Array [ - Object { - "declarations": Array [ - Object { - "id": Object { +{ + "body": [ + { + "declarations": [ + { + "id": { "name": "foo", - "range": Array [ + "range": [ 4, 7, ], "type": "Identifier", }, - "init": Object { + "init": { "name": "bar", - "range": Array [ + "range": [ 10, 13, ], "type": "Identifier", }, - "range": Array [ + "range": [ 4, 13, ], @@ -4135,14 +4161,14 @@ Object { }, ], "kind": "let", - "range": Array [ + "range": [ 0, 14, ], "type": "VariableDeclaration", }, ], - "range": Array [ + "range": [ 0, 14, ], @@ -4152,18 +4178,18 @@ Object { `; exports[`parseWithNodeMaps() general output should not contain range 1`] = ` -Object { - "body": Array [ - Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { +{ + "body": [ + { + "declarations": [ + { + "id": { + "loc": { + "end": { "column": 7, "line": 1, }, - "start": Object { + "start": { "column": 4, "line": 1, }, @@ -4171,13 +4197,13 @@ Object { "name": "foo", "type": "Identifier", }, - "init": Object { - "loc": Object { - "end": Object { + "init": { + "loc": { + "end": { "column": 13, "line": 1, }, - "start": Object { + "start": { "column": 10, "line": 1, }, @@ -4185,12 +4211,12 @@ Object { "name": "bar", "type": "Identifier", }, - "loc": Object { - "end": Object { + "loc": { + "end": { "column": 13, "line": 1, }, - "start": Object { + "start": { "column": 4, "line": 1, }, @@ -4199,12 +4225,12 @@ Object { }, ], "kind": "let", - "loc": Object { - "end": Object { + "loc": { + "end": { "column": 14, "line": 1, }, - "start": Object { + "start": { "column": 0, "line": 1, }, @@ -4212,12 +4238,12 @@ Object { "type": "VariableDeclaration", }, ], - "loc": Object { - "end": Object { + "loc": { + "end": { "column": 14, "line": 1, }, - "start": Object { + "start": { "column": 0, "line": 1, }, @@ -4228,58 +4254,58 @@ Object { `; exports[`parseWithNodeMaps() general output tokens, comments, locs, and ranges when called with those options 1`] = ` -Object { - "body": Array [ - Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { +{ + "body": [ + { + "declarations": [ + { + "id": { + "loc": { + "end": { "column": 7, "line": 1, }, - "start": Object { + "start": { "column": 4, "line": 1, }, }, "name": "foo", - "range": Array [ + "range": [ 4, 7, ], "type": "Identifier", }, - "init": Object { - "loc": Object { - "end": Object { + "init": { + "loc": { + "end": { "column": 13, "line": 1, }, - "start": Object { + "start": { "column": 10, "line": 1, }, }, "name": "bar", - "range": Array [ + "range": [ 10, 13, ], "type": "Identifier", }, - "loc": Object { - "end": Object { + "loc": { + "end": { "column": 13, "line": 1, }, - "start": Object { + "start": { "column": 4, "line": 1, }, }, - "range": Array [ + "range": [ 4, 13, ], @@ -4287,124 +4313,124 @@ Object { }, ], "kind": "let", - "loc": Object { - "end": Object { + "loc": { + "end": { "column": 14, "line": 1, }, - "start": Object { + "start": { "column": 0, "line": 1, }, }, - "range": Array [ + "range": [ 0, 14, ], "type": "VariableDeclaration", }, ], - "comments": Array [], - "loc": Object { - "end": Object { + "comments": [], + "loc": { + "end": { "column": 14, "line": 1, }, - "start": Object { + "start": { "column": 0, "line": 1, }, }, - "range": Array [ + "range": [ 0, 14, ], "sourceType": "script", - "tokens": Array [ - Object { - "loc": Object { - "end": Object { + "tokens": [ + { + "loc": { + "end": { "column": 3, "line": 1, }, - "start": Object { + "start": { "column": 0, "line": 1, }, }, - "range": Array [ + "range": [ 0, 3, ], "type": "Keyword", "value": "let", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 7, "line": 1, }, - "start": Object { + "start": { "column": 4, "line": 1, }, }, - "range": Array [ + "range": [ 4, 7, ], "type": "Identifier", "value": "foo", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 9, "line": 1, }, - "start": Object { + "start": { "column": 8, "line": 1, }, }, - "range": Array [ + "range": [ 8, 9, ], "type": "Punctuator", "value": "=", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 13, "line": 1, }, - "start": Object { + "start": { "column": 10, "line": 1, }, }, - "range": Array [ + "range": [ 10, 13, ], "type": "Identifier", "value": "bar", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 14, "line": 1, }, - "start": Object { + "start": { "column": 13, "line": 1, }, }, - "range": Array [ + "range": [ 13, 14, ], @@ -4417,21 +4443,21 @@ Object { `; exports[`parseWithNodeMaps() non string code should correctly convert code to a string for parse() 1`] = ` -Object { - "body": Array [ - Object { - "expression": Object { - "loc": Object { - "end": Object { +{ + "body": [ + { + "expression": { + "loc": { + "end": { "column": 5, "line": 1, }, - "start": Object { + "start": { "column": 0, "line": 1, }, }, - "range": Array [ + "range": [ 0, 5, ], @@ -4439,52 +4465,52 @@ Object { "type": "Literal", "value": 12345, }, - "loc": Object { - "end": Object { + "loc": { + "end": { "column": 5, "line": 1, }, - "start": Object { + "start": { "column": 0, "line": 1, }, }, - "range": Array [ + "range": [ 0, 5, ], "type": "ExpressionStatement", }, ], - "comments": Array [], - "loc": Object { - "end": Object { + "comments": [], + "loc": { + "end": { "column": 5, "line": 1, }, - "start": Object { + "start": { "column": 0, "line": 1, }, }, - "range": Array [ + "range": [ 0, 5, ], "sourceType": "script", - "tokens": Array [ - Object { - "loc": Object { - "end": Object { + "tokens": [ + { + "loc": { + "end": { "column": 5, "line": 1, }, - "start": Object { + "start": { "column": 0, "line": 1, }, }, - "range": Array [ + "range": [ 0, 5, ], @@ -4497,21 +4523,21 @@ Object { `; exports[`parseWithNodeMaps() non string code should correctly convert code to a string for parseAndGenerateServices() 1`] = ` -Object { - "body": Array [ - Object { - "expression": Object { - "loc": Object { - "end": Object { +{ + "body": [ + { + "expression": { + "loc": { + "end": { "column": 5, "line": 1, }, - "start": Object { + "start": { "column": 0, "line": 1, }, }, - "range": Array [ + "range": [ 0, 5, ], @@ -4519,52 +4545,52 @@ Object { "type": "Literal", "value": 12345, }, - "loc": Object { - "end": Object { + "loc": { + "end": { "column": 5, "line": 1, }, - "start": Object { + "start": { "column": 0, "line": 1, }, }, - "range": Array [ + "range": [ 0, 5, ], "type": "ExpressionStatement", }, ], - "comments": Array [], - "loc": Object { - "end": Object { + "comments": [], + "loc": { + "end": { "column": 5, "line": 1, }, - "start": Object { + "start": { "column": 0, "line": 1, }, }, - "range": Array [ + "range": [ 0, 5, ], "sourceType": "script", - "tokens": Array [ - Object { - "loc": Object { - "end": Object { + "tokens": [ + { + "loc": { + "end": { "column": 5, "line": 1, }, - "start": Object { + "start": { "column": 0, "line": 1, }, }, - "range": Array [ + "range": [ 0, 5, ], diff --git a/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.test.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.test.ts.snap index 6cabb17f516..204da250a86 100644 --- a/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.test.ts.snap +++ b/packages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.test.ts.snap @@ -1346,10 +1346,10 @@ exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" e exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/jsx/embedded-tags.src 1`] = ` TSError { - "column": 16, - "index": 16, + "column": 40, + "index": 40, "lineNumber": 1, - "message": "'{' expected.", + "message": "Unexpected token. Did you mean \`{'>'}\` or \`>\`?", } `; @@ -1368,7 +1368,7 @@ TSError { "column": 5, "index": 5, "lineNumber": 1, - "message": "'{' expected.", + "message": "'{' or JSX element expected.", } `; @@ -2224,6 +2224,12 @@ exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" e exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/decorators/class-decorators/class-decorator-factory.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/decorators/class-decorators/class-parameter-property.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/decorators/class-decorators/export-default-class-decorator.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + +exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/decorators/class-decorators/export-named-class-decorator.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; + exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/decorators/method-decorators/method-decorator-factory-instance-member.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; exports[`Parse all fixtures with "errorOnTypeScriptSyntacticAndSemanticIssues" enabled fixtures/typescript/decorators/method-decorators/method-decorator-factory-static-member.src 1`] = `"TEST OUTPUT: No semantic or syntactic issues found"`; diff --git a/packages/typescript-estree/tests/lib/__snapshots__/semanticInfo.test.ts.snap b/packages/typescript-estree/tests/lib/__snapshots__/semanticInfo.test.ts.snap index 9da83d40a89..e0b0c94ee05 100644 --- a/packages/typescript-estree/tests/lib/__snapshots__/semanticInfo.test.ts.snap +++ b/packages/typescript-estree/tests/lib/__snapshots__/semanticInfo.test.ts.snap @@ -1,23 +1,23 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`semanticInfo fixtures/export-file.src 1`] = ` -Object { - "body": Array [ - Object { - "declaration": Object { - "elements": Array [ - Object { - "loc": Object { - "end": Object { +{ + "body": [ + { + "declaration": { + "elements": [ + { + "loc": { + "end": { "column": 17, "line": 1, }, - "start": Object { + "start": { "column": 16, "line": 1, }, }, - "range": Array [ + "range": [ 16, 17, ], @@ -25,18 +25,18 @@ Object { "type": "Literal", "value": 3, }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 20, "line": 1, }, - "start": Object { + "start": { "column": 19, "line": 1, }, }, - "range": Array [ + "range": [ 19, 20, ], @@ -44,18 +44,18 @@ Object { "type": "Literal", "value": 4, }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 23, "line": 1, }, - "start": Object { + "start": { "column": 22, "line": 1, }, }, - "range": Array [ + "range": [ 22, 23, ], @@ -64,231 +64,231 @@ Object { "value": 5, }, ], - "loc": Object { - "end": Object { + "loc": { + "end": { "column": 24, "line": 1, }, - "start": Object { + "start": { "column": 15, "line": 1, }, }, - "range": Array [ + "range": [ 15, 24, ], "type": "ArrayExpression", }, "exportKind": "value", - "loc": Object { - "end": Object { + "loc": { + "end": { "column": 25, "line": 1, }, - "start": Object { + "start": { "column": 0, "line": 1, }, }, - "range": Array [ + "range": [ 0, 25, ], "type": "ExportDefaultDeclaration", }, ], - "comments": Array [], - "loc": Object { - "end": Object { + "comments": [], + "loc": { + "end": { "column": 25, "line": 1, }, - "start": Object { + "start": { "column": 0, "line": 1, }, }, - "range": Array [ + "range": [ 0, 25, ], "sourceType": "module", - "tokens": Array [ - Object { - "loc": Object { - "end": Object { + "tokens": [ + { + "loc": { + "end": { "column": 6, "line": 1, }, - "start": Object { + "start": { "column": 0, "line": 1, }, }, - "range": Array [ + "range": [ 0, 6, ], "type": "Keyword", "value": "export", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 14, "line": 1, }, - "start": Object { + "start": { "column": 7, "line": 1, }, }, - "range": Array [ + "range": [ 7, 14, ], "type": "Keyword", "value": "default", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 16, "line": 1, }, - "start": Object { + "start": { "column": 15, "line": 1, }, }, - "range": Array [ + "range": [ 15, 16, ], "type": "Punctuator", "value": "[", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 17, "line": 1, }, - "start": Object { + "start": { "column": 16, "line": 1, }, }, - "range": Array [ + "range": [ 16, 17, ], "type": "Numeric", "value": "3", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 18, "line": 1, }, - "start": Object { + "start": { "column": 17, "line": 1, }, }, - "range": Array [ + "range": [ 17, 18, ], "type": "Punctuator", "value": ",", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 20, "line": 1, }, - "start": Object { + "start": { "column": 19, "line": 1, }, }, - "range": Array [ + "range": [ 19, 20, ], "type": "Numeric", "value": "4", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 21, "line": 1, }, - "start": Object { + "start": { "column": 20, "line": 1, }, }, - "range": Array [ + "range": [ 20, 21, ], "type": "Punctuator", "value": ",", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 23, "line": 1, }, - "start": Object { + "start": { "column": 22, "line": 1, }, }, - "range": Array [ + "range": [ 22, 23, ], "type": "Numeric", "value": "5", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 24, "line": 1, }, - "start": Object { + "start": { "column": 23, "line": 1, }, }, - "range": Array [ + "range": [ 23, 24, ], "type": "Punctuator", "value": "]", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 25, "line": 1, }, - "start": Object { + "start": { "column": 24, "line": 1, }, }, - "range": Array [ + "range": [ 24, 25, ], @@ -301,75 +301,75 @@ Object { `; exports[`semanticInfo fixtures/import-file.src 1`] = ` -Object { - "body": Array [ - Object { - "assertions": Array [], +{ + "body": [ + { + "assertions": [], "importKind": "value", - "loc": Object { - "end": Object { + "loc": { + "end": { "column": 36, "line": 1, }, - "start": Object { + "start": { "column": 0, "line": 1, }, }, - "range": Array [ + "range": [ 0, 36, ], - "source": Object { - "loc": Object { - "end": Object { + "source": { + "loc": { + "end": { "column": 35, "line": 1, }, - "start": Object { + "start": { "column": 16, "line": 1, }, }, - "range": Array [ + "range": [ 16, 35, ], - "raw": "\\"./export-file.src\\"", + "raw": ""./export-file.src"", "type": "Literal", "value": "./export-file.src", }, - "specifiers": Array [ - Object { - "loc": Object { - "end": Object { + "specifiers": [ + { + "loc": { + "end": { "column": 10, "line": 1, }, - "start": Object { + "start": { "column": 7, "line": 1, }, }, - "local": Object { - "loc": Object { - "end": Object { + "local": { + "loc": { + "end": { "column": 10, "line": 1, }, - "start": Object { + "start": { "column": 7, "line": 1, }, }, "name": "arr", - "range": Array [ + "range": [ 7, 10, ], "type": "Identifier", }, - "range": Array [ + "range": [ 7, 10, ], @@ -378,21 +378,21 @@ Object { ], "type": "ImportDeclaration", }, - Object { - "expression": Object { - "arguments": Array [ - Object { - "loc": Object { - "end": Object { + { + "expression": { + "arguments": [ + { + "loc": { + "end": { "column": 10, "line": 2, }, - "start": Object { + "start": { "column": 9, "line": 2, }, }, - "range": Array [ + "range": [ 46, 47, ], @@ -400,18 +400,18 @@ Object { "type": "Literal", "value": 6, }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 13, "line": 2, }, - "start": Object { + "start": { "column": 12, "line": 2, }, }, - "range": Array [ + "range": [ 49, 50, ], @@ -420,358 +420,358 @@ Object { "value": 7, }, ], - "callee": Object { + "callee": { "computed": false, - "loc": Object { - "end": Object { + "loc": { + "end": { "column": 8, "line": 2, }, - "start": Object { + "start": { "column": 0, "line": 2, }, }, - "object": Object { - "loc": Object { - "end": Object { + "object": { + "loc": { + "end": { "column": 3, "line": 2, }, - "start": Object { + "start": { "column": 0, "line": 2, }, }, "name": "arr", - "range": Array [ + "range": [ 37, 40, ], "type": "Identifier", }, "optional": false, - "property": Object { - "loc": Object { - "end": Object { + "property": { + "loc": { + "end": { "column": 8, "line": 2, }, - "start": Object { + "start": { "column": 4, "line": 2, }, }, "name": "push", - "range": Array [ + "range": [ 41, 45, ], "type": "Identifier", }, - "range": Array [ + "range": [ 37, 45, ], "type": "MemberExpression", }, - "loc": Object { - "end": Object { + "loc": { + "end": { "column": 14, "line": 2, }, - "start": Object { + "start": { "column": 0, "line": 2, }, }, "optional": false, - "range": Array [ + "range": [ 37, 51, ], "type": "CallExpression", }, - "loc": Object { - "end": Object { + "loc": { + "end": { "column": 15, "line": 2, }, - "start": Object { + "start": { "column": 0, "line": 2, }, }, - "range": Array [ + "range": [ 37, 52, ], "type": "ExpressionStatement", }, ], - "comments": Array [], - "loc": Object { - "end": Object { + "comments": [], + "loc": { + "end": { "column": 15, "line": 2, }, - "start": Object { + "start": { "column": 0, "line": 1, }, }, - "range": Array [ + "range": [ 0, 52, ], "sourceType": "module", - "tokens": Array [ - Object { - "loc": Object { - "end": Object { + "tokens": [ + { + "loc": { + "end": { "column": 6, "line": 1, }, - "start": Object { + "start": { "column": 0, "line": 1, }, }, - "range": Array [ + "range": [ 0, 6, ], "type": "Keyword", "value": "import", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 10, "line": 1, }, - "start": Object { + "start": { "column": 7, "line": 1, }, }, - "range": Array [ + "range": [ 7, 10, ], "type": "Identifier", "value": "arr", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 15, "line": 1, }, - "start": Object { + "start": { "column": 11, "line": 1, }, }, - "range": Array [ + "range": [ 11, 15, ], "type": "Identifier", "value": "from", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 35, "line": 1, }, - "start": Object { + "start": { "column": 16, "line": 1, }, }, - "range": Array [ + "range": [ 16, 35, ], "type": "String", - "value": "\\"./export-file.src\\"", + "value": ""./export-file.src"", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 36, "line": 1, }, - "start": Object { + "start": { "column": 35, "line": 1, }, }, - "range": Array [ + "range": [ 35, 36, ], "type": "Punctuator", "value": ";", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 3, "line": 2, }, - "start": Object { + "start": { "column": 0, "line": 2, }, }, - "range": Array [ + "range": [ 37, 40, ], "type": "Identifier", "value": "arr", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 4, "line": 2, }, - "start": Object { + "start": { "column": 3, "line": 2, }, }, - "range": Array [ + "range": [ 40, 41, ], "type": "Punctuator", "value": ".", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 8, "line": 2, }, - "start": Object { + "start": { "column": 4, "line": 2, }, }, - "range": Array [ + "range": [ 41, 45, ], "type": "Identifier", "value": "push", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 9, "line": 2, }, - "start": Object { + "start": { "column": 8, "line": 2, }, }, - "range": Array [ + "range": [ 45, 46, ], "type": "Punctuator", "value": "(", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 10, "line": 2, }, - "start": Object { + "start": { "column": 9, "line": 2, }, }, - "range": Array [ + "range": [ 46, 47, ], "type": "Numeric", "value": "6", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 11, "line": 2, }, - "start": Object { + "start": { "column": 10, "line": 2, }, }, - "range": Array [ + "range": [ 47, 48, ], "type": "Punctuator", "value": ",", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 13, "line": 2, }, - "start": Object { + "start": { "column": 12, "line": 2, }, }, - "range": Array [ + "range": [ 49, 50, ], "type": "Numeric", "value": "7", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 14, "line": 2, }, - "start": Object { + "start": { "column": 13, "line": 2, }, }, - "range": Array [ + "range": [ 50, 51, ], "type": "Punctuator", "value": ")", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 15, "line": 2, }, - "start": Object { + "start": { "column": 14, "line": 2, }, }, - "range": Array [ + "range": [ 51, 52, ], @@ -784,43 +784,43 @@ Object { `; exports[`semanticInfo fixtures/isolated-file.src 1`] = ` -Object { - "body": Array [ - Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { +{ + "body": [ + { + "declarations": [ + { + "id": { + "loc": { + "end": { "column": 7, "line": 1, }, - "start": Object { + "start": { "column": 6, "line": 1, }, }, "name": "x", - "range": Array [ + "range": [ 6, 7, ], "type": "Identifier", }, - "init": Object { - "elements": Array [ - Object { - "loc": Object { - "end": Object { + "init": { + "elements": [ + { + "loc": { + "end": { "column": 12, "line": 1, }, - "start": Object { + "start": { "column": 11, "line": 1, }, }, - "range": Array [ + "range": [ 11, 12, ], @@ -828,18 +828,18 @@ Object { "type": "Literal", "value": 3, }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 15, "line": 1, }, - "start": Object { + "start": { "column": 14, "line": 1, }, }, - "range": Array [ + "range": [ 14, 15, ], @@ -847,18 +847,18 @@ Object { "type": "Literal", "value": 4, }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 18, "line": 1, }, - "start": Object { + "start": { "column": 17, "line": 1, }, }, - "range": Array [ + "range": [ 17, 18, ], @@ -867,33 +867,33 @@ Object { "value": 5, }, ], - "loc": Object { - "end": Object { + "loc": { + "end": { "column": 19, "line": 1, }, - "start": Object { + "start": { "column": 10, "line": 1, }, }, - "range": Array [ + "range": [ 10, 19, ], "type": "ArrayExpression", }, - "loc": Object { - "end": Object { + "loc": { + "end": { "column": 19, "line": 1, }, - "start": Object { + "start": { "column": 6, "line": 1, }, }, - "range": Array [ + "range": [ 6, 19, ], @@ -901,232 +901,232 @@ Object { }, ], "kind": "const", - "loc": Object { - "end": Object { + "loc": { + "end": { "column": 20, "line": 1, }, - "start": Object { + "start": { "column": 0, "line": 1, }, }, - "range": Array [ + "range": [ 0, 20, ], "type": "VariableDeclaration", }, ], - "comments": Array [], - "loc": Object { - "end": Object { + "comments": [], + "loc": { + "end": { "column": 20, "line": 1, }, - "start": Object { + "start": { "column": 0, "line": 1, }, }, - "range": Array [ + "range": [ 0, 20, ], "sourceType": "script", - "tokens": Array [ - Object { - "loc": Object { - "end": Object { + "tokens": [ + { + "loc": { + "end": { "column": 5, "line": 1, }, - "start": Object { + "start": { "column": 0, "line": 1, }, }, - "range": Array [ + "range": [ 0, 5, ], "type": "Keyword", "value": "const", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 7, "line": 1, }, - "start": Object { + "start": { "column": 6, "line": 1, }, }, - "range": Array [ + "range": [ 6, 7, ], "type": "Identifier", "value": "x", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 9, "line": 1, }, - "start": Object { + "start": { "column": 8, "line": 1, }, }, - "range": Array [ + "range": [ 8, 9, ], "type": "Punctuator", "value": "=", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 11, "line": 1, }, - "start": Object { + "start": { "column": 10, "line": 1, }, }, - "range": Array [ + "range": [ 10, 11, ], "type": "Punctuator", "value": "[", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 12, "line": 1, }, - "start": Object { + "start": { "column": 11, "line": 1, }, }, - "range": Array [ + "range": [ 11, 12, ], "type": "Numeric", "value": "3", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 13, "line": 1, }, - "start": Object { + "start": { "column": 12, "line": 1, }, }, - "range": Array [ + "range": [ 12, 13, ], "type": "Punctuator", "value": ",", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 15, "line": 1, }, - "start": Object { + "start": { "column": 14, "line": 1, }, }, - "range": Array [ + "range": [ 14, 15, ], "type": "Numeric", "value": "4", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 16, "line": 1, }, - "start": Object { + "start": { "column": 15, "line": 1, }, }, - "range": Array [ + "range": [ 15, 16, ], "type": "Punctuator", "value": ",", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 18, "line": 1, }, - "start": Object { + "start": { "column": 17, "line": 1, }, }, - "range": Array [ + "range": [ 17, 18, ], "type": "Numeric", "value": "5", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 19, "line": 1, }, - "start": Object { + "start": { "column": 18, "line": 1, }, }, - "range": Array [ + "range": [ 18, 19, ], "type": "Punctuator", "value": "]", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 20, "line": 1, }, - "start": Object { + "start": { "column": 19, "line": 1, }, }, - "range": Array [ + "range": [ 19, 20, ], @@ -1139,42 +1139,42 @@ Object { `; exports[`semanticInfo fixtures/non-existent-estree-nodes.src 1`] = ` -Object { - "body": Array [ - Object { - "declarations": Array [ - Object { - "id": Object { - "loc": Object { - "end": Object { +{ + "body": [ + { + "declarations": [ + { + "id": { + "loc": { + "end": { "column": 12, "line": 1, }, - "start": Object { + "start": { "column": 6, "line": 1, }, }, "name": "binExp", - "range": Array [ + "range": [ 6, 12, ], "type": "Identifier", }, - "init": Object { - "left": Object { - "loc": Object { - "end": Object { + "init": { + "left": { + "loc": { + "end": { "column": 17, "line": 1, }, - "start": Object { + "start": { "column": 16, "line": 1, }, }, - "range": Array [ + "range": [ 16, 17, ], @@ -1182,33 +1182,33 @@ Object { "type": "Literal", "value": 3, }, - "loc": Object { - "end": Object { + "loc": { + "end": { "column": 21, "line": 1, }, - "start": Object { + "start": { "column": 16, "line": 1, }, }, "operator": "+", - "range": Array [ + "range": [ 16, 21, ], - "right": Object { - "loc": Object { - "end": Object { + "right": { + "loc": { + "end": { "column": 21, "line": 1, }, - "start": Object { + "start": { "column": 20, "line": 1, }, }, - "range": Array [ + "range": [ 20, 21, ], @@ -1218,17 +1218,17 @@ Object { }, "type": "BinaryExpression", }, - "loc": Object { - "end": Object { + "loc": { + "end": { "column": 22, "line": 1, }, - "start": Object { + "start": { "column": 6, "line": 1, }, }, - "range": Array [ + "range": [ 6, 22, ], @@ -1236,40 +1236,40 @@ Object { }, ], "kind": "const", - "loc": Object { - "end": Object { + "loc": { + "end": { "column": 23, "line": 1, }, - "start": Object { + "start": { "column": 0, "line": 1, }, }, - "range": Array [ + "range": [ 0, 23, ], "type": "VariableDeclaration", }, - Object { - "body": Object { - "body": Array [ - Object { + { + "body": { + "body": [ + { "computed": true, "declare": false, - "key": Object { - "loc": Object { - "end": Object { + "key": { + "loc": { + "end": { "column": 9, "line": 4, }, - "start": Object { + "start": { "column": 3, "line": 4, }, }, - "range": Array [ + "range": [ 40, 46, ], @@ -1277,51 +1277,51 @@ Object { "type": "Literal", "value": "test", }, - "loc": Object { - "end": Object { + "loc": { + "end": { "column": 19, "line": 4, }, - "start": Object { + "start": { "column": 2, "line": 4, }, }, "override": false, - "range": Array [ + "range": [ 39, 56, ], "static": false, "type": "PropertyDefinition", - "typeAnnotation": Object { - "loc": Object { - "end": Object { + "typeAnnotation": { + "loc": { + "end": { "column": 18, "line": 4, }, - "start": Object { + "start": { "column": 10, "line": 4, }, }, - "range": Array [ + "range": [ 47, 55, ], "type": "TSTypeAnnotation", - "typeAnnotation": Object { - "loc": Object { - "end": Object { + "typeAnnotation": { + "loc": { + "end": { "column": 18, "line": 4, }, - "start": Object { + "start": { "column": 12, "line": 4, }, }, - "range": Array [ + "range": [ 49, 55, ], @@ -1331,51 +1331,51 @@ Object { "value": null, }, ], - "loc": Object { - "end": Object { + "loc": { + "end": { "column": 1, "line": 5, }, - "start": Object { + "start": { "column": 10, "line": 3, }, }, - "range": Array [ + "range": [ 35, 58, ], "type": "ClassBody", }, - "id": Object { - "loc": Object { - "end": Object { + "id": { + "loc": { + "end": { "column": 9, "line": 3, }, - "start": Object { + "start": { "column": 6, "line": 3, }, }, "name": "Bar", - "range": Array [ + "range": [ 31, 34, ], "type": "Identifier", }, - "loc": Object { - "end": Object { + "loc": { + "end": { "column": 1, "line": 5, }, - "start": Object { + "start": { "column": 0, "line": 3, }, }, - "range": Array [ + "range": [ 25, 58, ], @@ -1383,359 +1383,359 @@ Object { "type": "ClassDeclaration", }, ], - "comments": Array [], - "loc": Object { - "end": Object { + "comments": [], + "loc": { + "end": { "column": 0, "line": 6, }, - "start": Object { + "start": { "column": 0, "line": 1, }, }, - "range": Array [ + "range": [ 0, 59, ], "sourceType": "script", - "tokens": Array [ - Object { - "loc": Object { - "end": Object { + "tokens": [ + { + "loc": { + "end": { "column": 5, "line": 1, }, - "start": Object { + "start": { "column": 0, "line": 1, }, }, - "range": Array [ + "range": [ 0, 5, ], "type": "Keyword", "value": "const", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 12, "line": 1, }, - "start": Object { + "start": { "column": 6, "line": 1, }, }, - "range": Array [ + "range": [ 6, 12, ], "type": "Identifier", "value": "binExp", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 14, "line": 1, }, - "start": Object { + "start": { "column": 13, "line": 1, }, }, - "range": Array [ + "range": [ 13, 14, ], "type": "Punctuator", "value": "=", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 16, "line": 1, }, - "start": Object { + "start": { "column": 15, "line": 1, }, }, - "range": Array [ + "range": [ 15, 16, ], "type": "Punctuator", "value": "(", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 17, "line": 1, }, - "start": Object { + "start": { "column": 16, "line": 1, }, }, - "range": Array [ + "range": [ 16, 17, ], "type": "Numeric", "value": "3", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 19, "line": 1, }, - "start": Object { + "start": { "column": 18, "line": 1, }, }, - "range": Array [ + "range": [ 18, 19, ], "type": "Punctuator", "value": "+", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 21, "line": 1, }, - "start": Object { + "start": { "column": 20, "line": 1, }, }, - "range": Array [ + "range": [ 20, 21, ], "type": "Numeric", "value": "5", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 22, "line": 1, }, - "start": Object { + "start": { "column": 21, "line": 1, }, }, - "range": Array [ + "range": [ 21, 22, ], "type": "Punctuator", "value": ")", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 23, "line": 1, }, - "start": Object { + "start": { "column": 22, "line": 1, }, }, - "range": Array [ + "range": [ 22, 23, ], "type": "Punctuator", "value": ";", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 5, "line": 3, }, - "start": Object { + "start": { "column": 0, "line": 3, }, }, - "range": Array [ + "range": [ 25, 30, ], "type": "Keyword", "value": "class", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 9, "line": 3, }, - "start": Object { + "start": { "column": 6, "line": 3, }, }, - "range": Array [ + "range": [ 31, 34, ], "type": "Identifier", "value": "Bar", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 11, "line": 3, }, - "start": Object { + "start": { "column": 10, "line": 3, }, }, - "range": Array [ + "range": [ 35, 36, ], "type": "Punctuator", "value": "{", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 3, "line": 4, }, - "start": Object { + "start": { "column": 2, "line": 4, }, }, - "range": Array [ + "range": [ 39, 40, ], "type": "Punctuator", "value": "[", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 9, "line": 4, }, - "start": Object { + "start": { "column": 3, "line": 4, }, }, - "range": Array [ + "range": [ 40, 46, ], "type": "String", "value": "'test'", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 10, "line": 4, }, - "start": Object { + "start": { "column": 9, "line": 4, }, }, - "range": Array [ + "range": [ 46, 47, ], "type": "Punctuator", "value": "]", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 11, "line": 4, }, - "start": Object { + "start": { "column": 10, "line": 4, }, }, - "range": Array [ + "range": [ 47, 48, ], "type": "Punctuator", "value": ":", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 18, "line": 4, }, - "start": Object { + "start": { "column": 12, "line": 4, }, }, - "range": Array [ + "range": [ 49, 55, ], "type": "Identifier", "value": "string", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 19, "line": 4, }, - "start": Object { + "start": { "column": 18, "line": 4, }, }, - "range": Array [ + "range": [ 55, 56, ], "type": "Punctuator", "value": ";", }, - Object { - "loc": Object { - "end": Object { + { + "loc": { + "end": { "column": 1, "line": 5, }, - "start": Object { + "start": { "column": 0, "line": 5, }, }, - "range": Array [ + "range": [ 57, 58, ], diff --git a/packages/typescript-estree/tests/lib/convert.test.ts b/packages/typescript-estree/tests/lib/convert.test.ts index ad60019b200..fb3ac3f6313 100644 --- a/packages/typescript-estree/tests/lib/convert.test.ts +++ b/packages/typescript-estree/tests/lib/convert.test.ts @@ -1,6 +1,6 @@ -// deeplyCopy is private internal -/* eslint-disable @typescript-eslint/no-explicit-any */ +import { AST_NODE_TYPES } from '@typescript-eslint/types'; import * as ts from 'typescript'; + import type { TSNode } from '../../src'; import { Converter } from '../../src/convert'; @@ -39,9 +39,11 @@ describe('convert', () => { const instance = new Converter(ast, { errorOnUnknownASTType: false, shouldPreserveNodeMaps: false, - }) as any; + }); - expect(instance.deeplyCopy(ast.statements[0])).toMatchSnapshot(); + expect( + instance['deeplyCopy'](ast.statements[0] as ts.ClassDeclaration), + ).toMatchSnapshot(); }); it('deeplyCopy should convert node with type parameters correctly', () => { @@ -50,9 +52,11 @@ describe('convert', () => { const instance = new Converter(ast, { errorOnUnknownASTType: false, shouldPreserveNodeMaps: false, - }) as any; + }); - expect(instance.deeplyCopy(ast.statements[0])).toMatchSnapshot(); + expect( + instance['deeplyCopy'](ast.statements[0] as ts.ClassDeclaration), + ).toMatchSnapshot(); }); it('deeplyCopy should convert node with type arguments correctly', () => { @@ -61,10 +65,13 @@ describe('convert', () => { const instance = new Converter(ast, { errorOnUnknownASTType: false, shouldPreserveNodeMaps: false, - }) as any; + }); expect( - instance.deeplyCopy((ast.statements[0] as any).expression), + instance['deeplyCopy']( + (ast.statements[0] as ts.ExpressionStatement) + .expression as ts.NewExpression, + ), ).toMatchSnapshot(); }); @@ -74,8 +81,8 @@ describe('convert', () => { const instance = new Converter(ast, { errorOnUnknownASTType: false, shouldPreserveNodeMaps: false, - }) as any; - expect(instance.deeplyCopy(ast)).toMatchSnapshot(); + }); + expect(instance['deeplyCopy'](ast)).toMatchSnapshot(); }); it('deeplyCopy should fail on unknown node', () => { @@ -84,9 +91,9 @@ describe('convert', () => { const instance = new Converter(ast, { errorOnUnknownASTType: true, shouldPreserveNodeMaps: false, - }) as any; + }); - expect(() => instance.deeplyCopy(ast)).toThrow( + expect(() => instance['deeplyCopy'](ast)).toThrow( 'Unknown AST_NODE_TYPE: "TSSourceFile"', ); }); @@ -200,8 +207,13 @@ describe('convert', () => { shouldPreserveNodeMaps: true, }); - const tsNode = ts.createNode(ts.SyntaxKind.AsKeyword, 0, 10); - const convertedNode = (instance as any).createNode(tsNode, { + const tsNode: ts.KeywordToken = { + ...ts.factory.createToken(ts.SyntaxKind.AbstractKeyword), + end: 10, + pos: 0, + }; + const convertedNode = instance['createNode'](tsNode, { + type: AST_NODE_TYPES.TSAbstractKeyword, range: [0, 20], loc: { start: { @@ -215,17 +227,18 @@ describe('convert', () => { }, }); expect(convertedNode).toEqual({ + type: AST_NODE_TYPES.TSAbstractKeyword, + range: [0, 20], loc: { - end: { - column: 25, - line: 15, - }, start: { - column: 20, line: 10, + column: 20, + }, + end: { + line: 15, + column: 25, }, }, - range: [0, 20], }); }); diff --git a/packages/typescript-estree/tests/lib/parse.moduleResolver.default-program-error.test.ts b/packages/typescript-estree/tests/lib/parse.moduleResolver.default-program-error.test.ts new file mode 100644 index 00000000000..25557a24ef5 --- /dev/null +++ b/packages/typescript-estree/tests/lib/parse.moduleResolver.default-program-error.test.ts @@ -0,0 +1,32 @@ +import * as parser from '../../src'; +import type { TSESTreeOptions } from '../../src/parser-options'; +import { createAndPrepareParseConfig } from '../../tools/test-utils'; + +beforeEach(() => { + jest.clearAllMocks(); +}); + +describe('parseAndGenerateServices', () => { + describe('moduleResolver', () => { + const { code, config } = createAndPrepareParseConfig(); + + const withDefaultProgramConfig: TSESTreeOptions = { + ...config, + project: './tsconfig.defaultProgram.json', + createDefaultProgram: true, + }; + + describe('when file is not in the project and createDefaultProgram=true', () => { + it('returns error because __PLACEHOLDER__ can not be resolved', () => { + expect( + parser + .parseAndGenerateServices(code, withDefaultProgramConfig) + .services.program.getSemanticDiagnostics(), + ).toHaveProperty( + [0, 'messageText'], + "Cannot find module '__PLACEHOLDER__' or its corresponding type declarations.", + ); + }); + }); + }); +}); diff --git a/packages/typescript-estree/tests/lib/parse.moduleResolver.default-program-success.test.ts b/packages/typescript-estree/tests/lib/parse.moduleResolver.default-program-success.test.ts new file mode 100644 index 00000000000..9bebf21de1a --- /dev/null +++ b/packages/typescript-estree/tests/lib/parse.moduleResolver.default-program-success.test.ts @@ -0,0 +1,34 @@ +import { resolve } from 'path'; + +import * as parser from '../../src'; +import type { TSESTreeOptions } from '../../src/parser-options'; +import { createAndPrepareParseConfig } from '../../tools/test-utils'; + +beforeEach(() => { + jest.clearAllMocks(); +}); + +describe('parseAndGenerateServices', () => { + describe('moduleResolver', () => { + const { code, config, projectDirectory } = createAndPrepareParseConfig(); + + const withDefaultProgramConfig: TSESTreeOptions = { + ...config, + project: './tsconfig.defaultProgram.json', + createDefaultProgram: true, + }; + + describe('when file is not in the project and createDefaultProgram=true', () => { + it('resolves __PLACEHOLDER__ correctly', () => { + expect( + parser + .parseAndGenerateServices(code, { + ...withDefaultProgramConfig, + moduleResolver: resolve(projectDirectory, './moduleResolver.js'), + }) + .services.program.getSemanticDiagnostics(), + ).toHaveLength(0); + }); + }); + }); +}); diff --git a/packages/typescript-estree/tests/lib/parse.moduleResolver.placeholder-error.test.ts b/packages/typescript-estree/tests/lib/parse.moduleResolver.placeholder-error.test.ts new file mode 100644 index 00000000000..699c88f0f23 --- /dev/null +++ b/packages/typescript-estree/tests/lib/parse.moduleResolver.placeholder-error.test.ts @@ -0,0 +1,42 @@ +import { resolve } from 'path'; + +import * as parser from '../../src'; +import { createAndPrepareParseConfig } from '../../tools/test-utils'; + +beforeEach(() => { + jest.clearAllMocks(); +}); + +describe('parseAndGenerateServices', () => { + describe('moduleResolver', () => { + const { code, config, projectDirectory } = createAndPrepareParseConfig(); + + describe('when file is in the project', () => { + it('returns error if __PLACEHOLDER__ can not be resolved', () => { + expect( + parser + .parseAndGenerateServices(code, config) + .services.program.getSemanticDiagnostics(), + ).toHaveProperty( + [0, 'messageText'], + "Cannot find module '__PLACEHOLDER__' or its corresponding type declarations.", + ); + }); + + it('throws error if moduleResolver can not be found', () => { + expect(() => + parser.parseAndGenerateServices(code, { + ...config, + moduleResolver: resolve( + projectDirectory, + './this_moduleResolver_does_not_exist.js', + ), + }), + ).toThrowErrorMatchingInlineSnapshot(` + "Could not find the provided parserOptions.moduleResolver. + Hint: use an absolute path if you are not in control over where the ESLint instance runs." + `); + }); + }); + }); +}); diff --git a/packages/typescript-estree/tests/lib/parse.moduleResolver.placeholder-success.test.ts b/packages/typescript-estree/tests/lib/parse.moduleResolver.placeholder-success.test.ts new file mode 100644 index 00000000000..eebc01b9369 --- /dev/null +++ b/packages/typescript-estree/tests/lib/parse.moduleResolver.placeholder-success.test.ts @@ -0,0 +1,27 @@ +import { resolve } from 'path'; + +import * as parser from '../../src'; +import { createAndPrepareParseConfig } from '../../tools/test-utils'; + +beforeEach(() => { + jest.clearAllMocks(); +}); + +describe('parseAndGenerateServices', () => { + describe('moduleResolver', () => { + const { code, config, projectDirectory } = createAndPrepareParseConfig(); + + describe('when file is in the project', () => { + it('resolves __PLACEHOLDER__ correctly', () => { + expect( + parser + .parseAndGenerateServices(code, { + ...config, + moduleResolver: resolve(projectDirectory, './moduleResolver.js'), + }) + .services.program.getSemanticDiagnostics(), + ).toHaveLength(0); + }); + }); + }); +}); diff --git a/packages/typescript-estree/tests/lib/parse.test.ts b/packages/typescript-estree/tests/lib/parse.test.ts index cd573fcd291..0f286efdb19 100644 --- a/packages/typescript-estree/tests/lib/parse.test.ts +++ b/packages/typescript-estree/tests/lib/parse.test.ts @@ -1,13 +1,86 @@ +import type { CacheDurationSeconds } from '@typescript-eslint/types'; import debug from 'debug'; +import * as globbyModule from 'globby'; import { join, resolve } from 'path'; +import type * as typescriptModule from 'typescript'; + import * as parser from '../../src'; -import * as astConverter from '../../src/ast-converter'; -import { TSESTreeOptions } from '../../src/parser-options'; -import * as sharedParserUtils from '../../src/create-program/shared'; +import * as astConverterModule from '../../src/ast-converter'; +import * as sharedParserUtilsModule from '../../src/create-program/shared'; +import type { TSESTreeOptions } from '../../src/parser-options'; +import { clearGlobResolutionCache } from '../../src/parseSettings/resolveProjectList'; import { createSnapshotTestBlock } from '../../tools/test-utils'; const FIXTURES_DIR = join(__dirname, '../fixtures/simpleProject'); +// we can't spy on the exports of an ES module - so we instead have to mock the entire module +jest.mock('../../src/ast-converter', () => { + const astConverterActual = jest.requireActual( + '../../src/ast-converter', + ); + + return { + ...astConverterActual, + __esModule: true, + astConverter: jest.fn(astConverterActual.astConverter), + }; +}); +jest.mock('../../src/create-program/shared', () => { + const sharedActual = jest.requireActual( + '../../src/create-program/shared', + ); + + return { + ...sharedActual, + __esModule: true, + createDefaultCompilerOptionsFromExtra: jest.fn( + sharedActual.createDefaultCompilerOptionsFromExtra, + ), + }; +}); + +// Tests in CI by default run with lowercase program file names, +// resulting in path.relative results starting with many "../"s +jest.mock('typescript', () => { + const ts = jest.requireActual('typescript'); + return { + ...ts, + sys: { + ...ts.sys, + useCaseSensitiveFileNames: true, + }, + }; +}); + +jest.mock('globby', () => { + const globby = jest.requireActual('globby'); + return { + ...globby, + sync: jest.fn(globby.sync), + }; +}); + +const hrtimeSpy = jest.spyOn(process, 'hrtime'); + +const astConverterMock = jest.mocked(astConverterModule.astConverter); +const createDefaultCompilerOptionsFromExtra = jest.mocked( + sharedParserUtilsModule.createDefaultCompilerOptionsFromExtra, +); +const globbySyncMock = jest.mocked(globbyModule.sync); + +/** + * Aligns paths between environments, node for windows uses `\`, for linux and mac uses `/` + */ +function alignErrorPath(error: Error): never { + error.message = error.message.replace(/\\(?!["])/gm, '/'); + throw error; +} + +beforeEach(() => { + jest.clearAllMocks(); + clearGlobResolutionCache(); +}); + describe('parseWithNodeMaps()', () => { describe('basic functionality', () => { it('should parse an empty string', () => { @@ -25,10 +98,10 @@ describe('parseWithNodeMaps()', () => { it('should simple code', () => { const result = parser.parseWithNodeMaps('1;'); expect(result.ast).toMatchInlineSnapshot(` - Object { - "body": Array [ - Object { - "expression": Object { + { + "body": [ + { + "expression": { "raw": "1", "type": "Literal", "value": 1, @@ -114,8 +187,6 @@ describe('parseWithNodeMaps()', () => { describe('loggerFn should be propagated to ast-converter', () => { it('output tokens, comments, locs, and ranges when called with those options', () => { - const spy = jest.spyOn(astConverter, 'astConverter'); - const loggerFn = jest.fn(() => {}); parser.parseWithNodeMaps('let foo = bar;', { @@ -126,8 +197,8 @@ describe('parseWithNodeMaps()', () => { loc: true, }); - expect(spy).toHaveBeenCalled(); - expect(spy.mock.calls[0][1]).toMatchObject({ + expect(astConverterMock).toHaveBeenCalled(); + expect(astConverterMock.mock.calls[0][1]).toMatchObject({ code: 'let foo = bar;', comment: true, comments: [], @@ -342,6 +413,7 @@ describe('parseAndGenerateServices', () => { let result: | parser.ParseAndGenerateServicesResult | undefined; + // eslint-disable-next-line jest/valid-expect const exp = expect(() => { result = parser.parseAndGenerateServices(code, { ...config, @@ -505,14 +577,7 @@ describe('parseAndGenerateServices', () => { filePath: join(PROJECT_DIR, filePath), }); } catch (error) { - /** - * Aligns paths between environments, node for windows uses `\`, for linux and mac uses `/` - */ - (error as Error).message = (error as Error).message.replace( - /\\(?!["])/gm, - '/', - ); - throw error; + throw alignErrorPath(error as Error); } }; @@ -583,6 +648,33 @@ describe('parseAndGenerateServices', () => { }); }); + describe('invalid project error messages', () => { + it('throws when non of multiple projects include the file', () => { + const PROJECT_DIR = resolve(FIXTURES_DIR, '../invalidFileErrors'); + const code = 'var a = true'; + const config: TSESTreeOptions = { + comment: true, + tokens: true, + range: true, + loc: true, + tsconfigRootDir: PROJECT_DIR, + project: ['./**/tsconfig.json', './**/tsconfig.extra.json'], + }; + const testParse = (filePath: string) => (): void => { + try { + parser.parseAndGenerateServices(code, { + ...config, + filePath: join(PROJECT_DIR, filePath), + }); + } catch (error) { + throw alignErrorPath(error as Error); + } + }; + + expect(testParse('ts/notIncluded0j1.ts')).toThrowErrorMatchingSnapshot(); + }); + }); + describe('debug options', () => { const debugEnable = jest.fn(); beforeEach(() => { @@ -625,16 +717,11 @@ describe('parseAndGenerateServices', () => { }); it('should turn on typescript debugger', () => { - const spy = jest.spyOn( - sharedParserUtils, - 'createDefaultCompilerOptionsFromExtra', - ); - parser.parseAndGenerateServices('const x = 1;', { debugLevel: ['typescript'], }); - expect(spy).toHaveBeenCalled(); - expect(spy).toHaveReturnedWith( + expect(createDefaultCompilerOptionsFromExtra).toHaveBeenCalled(); + expect(createDefaultCompilerOptionsFromExtra).toHaveReturnedWith( expect.objectContaining({ extendedDiagnostics: true, }), @@ -678,97 +765,68 @@ describe('parseAndGenerateServices', () => { it('ignores a folder when given a string glob', () => { const ignore = ['**/ignoreme/**']; + // cspell:disable-next-line expect(testParse('ignoreme', ignore)).toThrow(); + // cspell:disable-next-line expect(testParse('includeme', ignore)).not.toThrow(); }); }); - describe('moduleResolver', () => { - beforeEach(() => { - parser.clearCaches(); - }); - - const PROJECT_DIR = resolve(FIXTURES_DIR, '../moduleResolver'); - const code = ` - import { something } from '__PLACEHOLDER__'; - - something(); - `; - const config: TSESTreeOptions = { - comment: true, - tokens: true, - range: true, - loc: true, - project: './tsconfig.json', - tsconfigRootDir: PROJECT_DIR, - filePath: resolve(PROJECT_DIR, 'file.ts'), - }; - const withDefaultProgramConfig: TSESTreeOptions = { - ...config, - project: './tsconfig.defaultProgram.json', - createDefaultProgram: true, - }; + describe('cacheLifetime', () => { + describe('glob', () => { + function doParse(lifetime: CacheDurationSeconds): void { + parser.parseAndGenerateServices('const x = 1', { + cacheLifetime: { + glob: lifetime, + }, + filePath: join(FIXTURES_DIR, 'file.ts'), + tsconfigRootDir: FIXTURES_DIR, + project: ['./**/tsconfig.json', './**/tsconfig.extra.json'], + }); + } - describe('when file is in the project', () => { - it('returns error if __PLACEHOLDER__ can not be resolved', () => { - expect( - parser - .parseAndGenerateServices(code, config) - .services.program.getSemanticDiagnostics(), - ).toHaveProperty( - [0, 'messageText'], - "Cannot find module '__PLACEHOLDER__' or its corresponding type declarations.", - ); + it('should cache globs if the lifetime is non-zero', () => { + doParse(30); + expect(globbySyncMock).toHaveBeenCalledTimes(1); + doParse(30); + // shouldn't call globby again due to the caching + expect(globbySyncMock).toHaveBeenCalledTimes(1); }); - it('throws error if moduleResolver can not be found', () => { - expect(() => - parser.parseAndGenerateServices(code, { - ...config, - moduleResolver: resolve( - PROJECT_DIR, - './this_moduleResolver_does_not_exist.js', - ), - }), - ).toThrowErrorMatchingInlineSnapshot(` - "Could not find the provided parserOptions.moduleResolver. - Hint: use an absolute path if you are not in control over where the ESLint instance runs." - `); + it('should not cache globs if the lifetime is zero', () => { + doParse(0); + expect(globbySyncMock).toHaveBeenCalledTimes(1); + doParse(0); + // should call globby again because we specified immediate cache expiry + expect(globbySyncMock).toHaveBeenCalledTimes(2); }); - it('resolves __PLACEHOLDER__ correctly', () => { - expect( - parser - .parseAndGenerateServices(code, { - ...config, - moduleResolver: resolve(PROJECT_DIR, './moduleResolver.js'), - }) - .services.program.getSemanticDiagnostics(), - ).toHaveLength(0); - }); - }); + it('should evict the cache if the entry expires', () => { + hrtimeSpy.mockReturnValueOnce([1, 0]); - describe('when file is not in the project and createDefaultProgram=true', () => { - it('returns error because __PLACEHOLDER__ can not be resolved', () => { - expect( - parser - .parseAndGenerateServices(code, withDefaultProgramConfig) - .services.program.getSemanticDiagnostics(), - ).toHaveProperty( - [0, 'messageText'], - "Cannot find module '__PLACEHOLDER__' or its corresponding type declarations.", - ); + doParse(30); + expect(globbySyncMock).toHaveBeenCalledTimes(1); + + // wow so much time has passed + hrtimeSpy.mockReturnValueOnce([Number.MAX_VALUE, 0]); + + doParse(30); + // shouldn't call globby again due to the caching + expect(globbySyncMock).toHaveBeenCalledTimes(2); }); - it('resolves __PLACEHOLDER__ correctly', () => { - expect( - parser - .parseAndGenerateServices(code, { - ...withDefaultProgramConfig, - moduleResolver: resolve(PROJECT_DIR, './moduleResolver.js'), - }) - .services.program.getSemanticDiagnostics(), - ).toHaveLength(0); + it('should infinitely cache if passed Infinity', () => { + hrtimeSpy.mockReturnValueOnce([1, 0]); + + doParse('Infinity'); + expect(globbySyncMock).toHaveBeenCalledTimes(1); + + // wow so much time has passed + hrtimeSpy.mockReturnValueOnce([Number.MAX_VALUE, 0]); + + doParse('Infinity'); + // shouldn't call globby again due to the caching + expect(globbySyncMock).toHaveBeenCalledTimes(1); }); }); }); diff --git a/packages/typescript-estree/tests/lib/persistentParse.test.ts b/packages/typescript-estree/tests/lib/persistentParse.test.ts index b79f66aaa5c..63e81d7e260 100644 --- a/packages/typescript-estree/tests/lib/persistentParse.test.ts +++ b/packages/typescript-estree/tests/lib/persistentParse.test.ts @@ -1,7 +1,8 @@ import fs from 'fs'; import path from 'path'; import tmp from 'tmp'; -import { clearWatchCaches } from '../../src/create-program/createWatchProgram'; + +import { clearWatchCaches } from '../../src/create-program/getWatchProgramsForProjects'; import { parseAndGenerateServices } from '../../src/parser'; const CONTENTS = { diff --git a/packages/typescript-estree/tests/lib/semantic-diagnostics-enabled.test.ts b/packages/typescript-estree/tests/lib/semantic-diagnostics-enabled.test.ts index eefd71a587e..a512e56f93c 100644 --- a/packages/typescript-estree/tests/lib/semantic-diagnostics-enabled.test.ts +++ b/packages/typescript-estree/tests/lib/semantic-diagnostics-enabled.test.ts @@ -1,6 +1,7 @@ import { readFileSync } from 'fs'; import glob from 'glob'; import path from 'path'; + import * as parser from '../../src'; import { formatSnapshotName, isJSXFileType } from '../../tools/test-utils'; import { serializer } from '../../tools/tserror-serializer'; diff --git a/packages/typescript-estree/tests/lib/semanticInfo-singleRun.test.ts b/packages/typescript-estree/tests/lib/semanticInfo-singleRun.test.ts index 869af64f24b..b605dd6ea5f 100644 --- a/packages/typescript-estree/tests/lib/semanticInfo-singleRun.test.ts +++ b/packages/typescript-estree/tests/lib/semanticInfo-singleRun.test.ts @@ -1,11 +1,13 @@ import glob from 'glob'; import * as path from 'path'; + +import { getCanonicalFileName } from '../../src/create-program/shared'; +import { createProgramFromConfigFile as createProgramFromConfigFileOriginal } from '../../src/create-program/useProvidedPrograms'; import { + clearParseAndGenerateServicesCalls, clearProgramCache, parseAndGenerateServices, - clearParseAndGenerateServicesCalls, } from '../../src/parser'; -import { getCanonicalFileName } from '../../src/create-program/shared'; const mockProgram = { getSourceFile(): void { @@ -59,16 +61,18 @@ jest.mock('../../src/create-program/useProvidedPrograms.ts', () => { }; }); -jest.mock('../../src/create-program/createWatchProgram', () => { +jest.mock('../../src/create-program/getWatchProgramsForProjects', () => { return { - ...jest.requireActual('../../src/create-program/createWatchProgram'), - getProgramsForProjects: jest.fn(() => [mockProgram]), + ...jest.requireActual( + '../../src/create-program/getWatchProgramsForProjects', + ), + getWatchProgramsForProjects: jest.fn(() => [mockProgram]), }; }); -const { - createProgramFromConfigFile, -} = require('../../src/create-program/useProvidedPrograms'); +const createProgramFromConfigFile = jest.mocked( + createProgramFromConfigFileOriginal, +); const FIXTURES_DIR = './tests/fixtures/semanticInfo'; const testFiles = glob.sync(`**/*.src.ts`, { @@ -94,7 +98,7 @@ describe('semanticInfo - singleRun', () => { // ensure caches are clean for each test clearProgramCache(); // ensure invocations of mock are clean for each test - (createProgramFromConfigFile as jest.Mock).mockClear(); + createProgramFromConfigFile.mockClear(); // Do not track invocations per file across tests clearParseAndGenerateServicesCalls(); }); @@ -229,7 +233,7 @@ describe('semanticInfo - singleRun', () => { const optionsWithReversedTsconfigs = { ...options, // Now the matching tsconfig comes first - project: options.project.reverse(), + project: [...options.project].reverse(), }; const resultProgram = parseAndGenerateServices( @@ -245,7 +249,7 @@ describe('semanticInfo - singleRun', () => { expect(createProgramFromConfigFile).toHaveBeenNthCalledWith( 1, - resolvedProject(tsconfigs[0]), + resolvedProject(tsconfigs[1]), ); // Restore process data diff --git a/packages/typescript-estree/tests/lib/semanticInfo.test.ts b/packages/typescript-estree/tests/lib/semanticInfo.test.ts index c003d8d0046..9c8aacf6668 100644 --- a/packages/typescript-estree/tests/lib/semanticInfo.test.ts +++ b/packages/typescript-estree/tests/lib/semanticInfo.test.ts @@ -2,14 +2,13 @@ import * as fs from 'fs'; import glob from 'glob'; import * as path from 'path'; import * as ts from 'typescript'; -import { clearWatchCaches } from '../../src/create-program/createWatchProgram'; + +import { clearWatchCaches } from '../../src/create-program/getWatchProgramsForProjects'; import { createProgramFromConfigFile as createProgram } from '../../src/create-program/useProvidedPrograms'; -import { - parseAndGenerateServices, - ParseAndGenerateServicesResult, -} from '../../src/parser'; -import { TSESTreeOptions } from '../../src/parser-options'; -import { TSESTree } from '../../src/ts-estree'; +import type { ParseAndGenerateServicesResult } from '../../src/parser'; +import { parseAndGenerateServices } from '../../src/parser'; +import type { TSESTreeOptions } from '../../src/parser-options'; +import type { TSESTree } from '../../src/ts-estree'; import { createSnapshotTestBlock, formatSnapshotName, @@ -241,7 +240,9 @@ describe('semanticInfo', () => { `function M() { return Base }`, createOptions(''), ), - ).toThrow(/The file does not match your project config: estree.ts/); + ).toThrow( + /ESLint was configured to run on `\/estree\.ts` using/, + ); }); it('non-existent project file', () => { @@ -364,7 +365,7 @@ function testIsolatedFile( const declaration = (parseResult.ast.body[0] as TSESTree.VariableDeclaration) .declarations[0]; const arrayMember = (declaration.init! as TSESTree.ArrayExpression) - .elements[0]; + .elements[0]!; expect(parseResult).toHaveProperty('services.esTreeNodeToTSNodeMap'); // get corresponding TS node diff --git a/packages/typescript-estree/tests/lib/warn-on-unsupported-ts.test.ts b/packages/typescript-estree/tests/lib/warn-on-unsupported-ts.test.ts index 581d28a7e96..79a319e9f8d 100644 --- a/packages/typescript-estree/tests/lib/warn-on-unsupported-ts.test.ts +++ b/packages/typescript-estree/tests/lib/warn-on-unsupported-ts.test.ts @@ -1,4 +1,5 @@ import semver from 'semver'; + import * as parser from '../../src/parser'; jest.mock('semver'); diff --git a/packages/typescript-estree/tests/snapshots/comments/type-assertion-regression-test.src.ts.shot b/packages/typescript-estree/tests/snapshots/comments/type-assertion-regression-test.src.ts.shot index d341354418b..42ecf786329 100644 --- a/packages/typescript-estree/tests/snapshots/comments/type-assertion-regression-test.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/comments/type-assertion-regression-test.src.ts.shot @@ -74,6 +74,7 @@ Object { 16, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -92,7 +93,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, }, "loc": Object { diff --git a/packages/typescript-estree/tests/snapshots/jsx/embedded-tags.src.js.shot b/packages/typescript-estree/tests/snapshots/jsx/embedded-tags.src.js.shot index d778d382e99..02c6e82f663 100644 --- a/packages/typescript-estree/tests/snapshots/jsx/embedded-tags.src.js.shot +++ b/packages/typescript-estree/tests/snapshots/jsx/embedded-tags.src.js.shot @@ -2,9 +2,9 @@ exports[`jsx embedded-tags.src 1`] = ` TSError { - "column": 16, - "index": 16, + "column": 40, + "index": 40, "lineNumber": 1, - "message": "'{' expected.", + "message": "Unexpected token. Did you mean \`{'>'}\` or \`>\`?", } `; diff --git a/packages/typescript-estree/tests/snapshots/jsx/invalid-attribute.src.js.shot b/packages/typescript-estree/tests/snapshots/jsx/invalid-attribute.src.js.shot index b0eaf47f8e9..0a637a76255 100644 --- a/packages/typescript-estree/tests/snapshots/jsx/invalid-attribute.src.js.shot +++ b/packages/typescript-estree/tests/snapshots/jsx/invalid-attribute.src.js.shot @@ -5,6 +5,6 @@ TSError { "column": 5, "index": 5, "lineNumber": 1, - "message": "'{' expected.", + "message": "'{' or JSX element expected.", } `; diff --git a/packages/typescript-estree/tests/snapshots/tsx/react-typed-props.src.tsx.shot b/packages/typescript-estree/tests/snapshots/tsx/react-typed-props.src.tsx.shot index cf0793e2573..759b87daf35 100644 --- a/packages/typescript-estree/tests/snapshots/tsx/react-typed-props.src.tsx.shot +++ b/packages/typescript-estree/tests/snapshots/tsx/react-typed-props.src.tsx.shot @@ -532,6 +532,7 @@ Object { 105, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -550,7 +551,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, }, }, diff --git a/packages/typescript-estree/tests/snapshots/typescript/basics/abstract-class-with-abstract-method.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/basics/abstract-class-with-abstract-method.src.ts.shot index 4fce3551bf9..c8495af876c 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/basics/abstract-class-with-abstract-method.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/basics/abstract-class-with-abstract-method.src.ts.shot @@ -100,25 +100,7 @@ Object { 83, ], "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 36, - "line": 2, - }, - "start": Object { - "column": 29, - "line": 2, - }, - }, - "name": "Promise", - "range": Array [ - 68, - 75, - ], - "type": "Identifier", - }, - "typeParameters": Object { + "typeArguments": Object { "loc": Object { "end": Object { "column": 44, @@ -154,6 +136,24 @@ Object { ], "type": "TSTypeParameterInstantiation", }, + "typeName": Object { + "loc": Object { + "end": Object { + "column": 36, + "line": 2, + }, + "start": Object { + "column": 29, + "line": 2, + }, + }, + "name": "Promise", + "range": Array [ + 68, + 75, + ], + "type": "Identifier", + }, }, }, "type": "TSEmptyBodyFunctionExpression", diff --git a/packages/typescript-estree/tests/snapshots/typescript/basics/abstract-class-with-optional-method.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/basics/abstract-class-with-optional-method.src.ts.shot index a9672cf2757..585faa2c5ad 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/basics/abstract-class-with-optional-method.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/basics/abstract-class-with-optional-method.src.ts.shot @@ -101,25 +101,7 @@ Object { 75, ], "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 28, - "line": 2, - }, - "start": Object { - "column": 21, - "line": 2, - }, - }, - "name": "Promise", - "range": Array [ - 60, - 67, - ], - "type": "Identifier", - }, - "typeParameters": Object { + "typeArguments": Object { "loc": Object { "end": Object { "column": 36, @@ -155,6 +137,24 @@ Object { ], "type": "TSTypeParameterInstantiation", }, + "typeName": Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 2, + }, + "start": Object { + "column": 21, + "line": 2, + }, + }, + "name": "Promise", + "range": Array [ + 60, + 67, + ], + "type": "Identifier", + }, }, }, "type": "TSEmptyBodyFunctionExpression", diff --git a/packages/typescript-estree/tests/snapshots/typescript/basics/arrow-function-with-type-parameters.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/basics/arrow-function-with-type-parameters.src.ts.shot index b233dae579e..a690c724352 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/basics/arrow-function-with-type-parameters.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/basics/arrow-function-with-type-parameters.src.ts.shot @@ -123,6 +123,7 @@ Object { 8, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -141,7 +142,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, }, }, @@ -182,6 +182,7 @@ Object { 12, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -200,7 +201,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, }, "type": "ArrowFunctionExpression", diff --git a/packages/typescript-estree/tests/snapshots/typescript/basics/cast-as-multi.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/basics/cast-as-multi.src.ts.shot index ab6b513bd47..17d1093bf29 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/basics/cast-as-multi.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/basics/cast-as-multi.src.ts.shot @@ -88,6 +88,7 @@ Object { 13, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -106,7 +107,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, }, "loc": Object { diff --git a/packages/typescript-estree/tests/snapshots/typescript/basics/class-with-extends-generic-multiple.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/basics/class-with-extends-generic-multiple.src.ts.shot index 4b163281504..54413a95378 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/basics/class-with-extends-generic-multiple.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/basics/class-with-extends-generic-multiple.src.ts.shot @@ -100,6 +100,7 @@ Object { 36, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -118,7 +119,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, Object { "loc": Object { @@ -136,6 +136,7 @@ Object { 39, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -154,7 +155,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, ], "range": Array [ @@ -193,6 +193,7 @@ Object { 21, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -211,7 +212,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, "default": undefined, "in": false, diff --git a/packages/typescript-estree/tests/snapshots/typescript/basics/class-with-extends-generic.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/basics/class-with-extends-generic.src.ts.shot index 1b34e17f7eb..2804fd559b1 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/basics/class-with-extends-generic.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/basics/class-with-extends-generic.src.ts.shot @@ -100,6 +100,7 @@ Object { 26, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -118,7 +119,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, ], "range": Array [ diff --git a/packages/typescript-estree/tests/snapshots/typescript/basics/class-with-generic-method-default.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/basics/class-with-generic-method-default.src.ts.shot index d648e1c98cf..f0dc1f93b2f 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/basics/class-with-generic-method-default.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/basics/class-with-generic-method-default.src.ts.shot @@ -113,6 +113,7 @@ Object { 28, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -131,7 +132,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, "in": false, "loc": Object { diff --git a/packages/typescript-estree/tests/snapshots/typescript/basics/class-with-implements-generic-multiple.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/basics/class-with-implements-generic-multiple.src.ts.shot index 651f3c663b7..4c1315fdf3e 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/basics/class-with-implements-generic-multiple.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/basics/class-with-implements-generic-multiple.src.ts.shot @@ -103,6 +103,7 @@ Object { 26, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -121,7 +122,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, Object { "loc": Object { @@ -139,6 +139,7 @@ Object { 29, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -157,7 +158,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, ], "range": Array [ diff --git a/packages/typescript-estree/tests/snapshots/typescript/basics/class-with-implements-generic.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/basics/class-with-implements-generic.src.ts.shot index 55a31001fd1..4e1b5bdc39c 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/basics/class-with-implements-generic.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/basics/class-with-implements-generic.src.ts.shot @@ -103,6 +103,7 @@ Object { 26, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -121,7 +122,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, ], "range": Array [ diff --git a/packages/typescript-estree/tests/snapshots/typescript/basics/class-with-mixin-reference.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/basics/class-with-mixin-reference.src.ts.shot index 47dd1de2f0d..01d4e63032c 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/basics/class-with-mixin-reference.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/basics/class-with-mixin-reference.src.ts.shot @@ -103,6 +103,7 @@ Object { 44, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -121,7 +122,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, }, }, @@ -160,25 +160,7 @@ Object { 35, ], "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 32, - "line": 1, - }, - "start": Object { - "column": 21, - "line": 1, - }, - }, - "name": "Constructor", - "range": Array [ - 21, - 32, - ], - "type": "Identifier", - }, - "typeParameters": Object { + "typeArguments": Object { "loc": Object { "end": Object { "column": 35, @@ -206,6 +188,7 @@ Object { 34, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -224,7 +207,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, ], "range": Array [ @@ -233,6 +215,24 @@ Object { ], "type": "TSTypeParameterInstantiation", }, + "typeName": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "name": "Constructor", + "range": Array [ + 21, + 32, + ], + "type": "Identifier", + }, }, "default": undefined, "in": false, diff --git a/packages/typescript-estree/tests/snapshots/typescript/basics/class-with-mixin.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/basics/class-with-mixin.src.ts.shot index 8a991733611..ea445701495 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/basics/class-with-mixin.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/basics/class-with-mixin.src.ts.shot @@ -175,6 +175,7 @@ Object { 45, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -193,7 +194,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, }, }, @@ -232,25 +232,7 @@ Object { 36, ], "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 32, - "line": 1, - }, - "start": Object { - "column": 21, - "line": 1, - }, - }, - "name": "Constructor", - "range": Array [ - 21, - 32, - ], - "type": "Identifier", - }, - "typeParameters": Object { + "typeArguments": Object { "loc": Object { "end": Object { "column": 36, @@ -287,6 +269,24 @@ Object { ], "type": "TSTypeParameterInstantiation", }, + "typeName": Object { + "loc": Object { + "end": Object { + "column": 32, + "line": 1, + }, + "start": Object { + "column": 21, + "line": 1, + }, + }, + "name": "Constructor", + "range": Array [ + 21, + 32, + ], + "type": "Identifier", + }, }, "default": undefined, "in": false, @@ -476,7 +476,7 @@ Object { 111, ], "type": "CallExpression", - "typeParameters": Object { + "typeArguments": Object { "loc": Object { "end": Object { "column": 22, @@ -792,6 +792,7 @@ Object { 205, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -810,7 +811,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, }, "type": "TSConstructorType", diff --git a/packages/typescript-estree/tests/snapshots/typescript/basics/class-with-type-parameter-default.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/basics/class-with-type-parameter-default.src.ts.shot index b062afebf38..ee5dfbdcf4e 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/basics/class-with-type-parameter-default.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/basics/class-with-type-parameter-default.src.ts.shot @@ -86,6 +86,7 @@ Object { 17, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -104,7 +105,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, "in": false, "loc": Object { diff --git a/packages/typescript-estree/tests/snapshots/typescript/basics/const-assertions.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/basics/const-assertions.src.ts.shot index 1f6a79883fb..2e848aee4fe 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/basics/const-assertions.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/basics/const-assertions.src.ts.shot @@ -75,6 +75,7 @@ Object { 32, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -93,7 +94,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, }, "loc": Object { @@ -240,6 +240,7 @@ Object { 88, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -258,7 +259,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, }, "loc": Object { @@ -425,6 +425,7 @@ Object { 162, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -443,7 +444,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, }, "loc": Object { @@ -552,6 +552,7 @@ Object { 192, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -570,7 +571,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, }, "loc": Object { @@ -717,6 +717,7 @@ Object { 240, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -735,7 +736,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, }, "loc": Object { @@ -902,6 +902,7 @@ Object { 303, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -920,7 +921,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, }, "loc": Object { diff --git a/packages/typescript-estree/tests/snapshots/typescript/basics/function-with-type-parameters-with-constraint.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/basics/function-with-type-parameters-with-constraint.src.ts.shot index 114fd02b9e6..7d5eab6f78b 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/basics/function-with-type-parameters-with-constraint.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/basics/function-with-type-parameters-with-constraint.src.ts.shot @@ -139,6 +139,7 @@ Object { 29, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -157,7 +158,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, }, }, @@ -198,6 +198,7 @@ Object { 33, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -216,7 +217,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, }, "type": "FunctionDeclaration", diff --git a/packages/typescript-estree/tests/snapshots/typescript/basics/function-with-type-parameters.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/basics/function-with-type-parameters.src.ts.shot index defa0485d9e..7ef3c7a9e17 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/basics/function-with-type-parameters.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/basics/function-with-type-parameters.src.ts.shot @@ -139,6 +139,7 @@ Object { 18, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -157,7 +158,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, }, }, @@ -198,6 +198,7 @@ Object { 22, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -216,7 +217,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, }, "type": "FunctionDeclaration", diff --git a/packages/typescript-estree/tests/snapshots/typescript/basics/function-with-types-assignation.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/basics/function-with-types-assignation.src.ts.shot index 45304c8dd08..15a0eb7d7d7 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/basics/function-with-types-assignation.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/basics/function-with-types-assignation.src.ts.shot @@ -296,25 +296,7 @@ Object { 69, ], "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 61, - "line": 1, - }, - "start": Object { - "column": 56, - "line": 1, - }, - }, - "name": "Array", - "range": Array [ - 56, - 61, - ], - "type": "Identifier", - }, - "typeParameters": Object { + "typeArguments": Object { "loc": Object { "end": Object { "column": 69, @@ -350,6 +332,24 @@ Object { ], "type": "TSTypeParameterInstantiation", }, + "typeName": Object { + "loc": Object { + "end": Object { + "column": 61, + "line": 1, + }, + "start": Object { + "column": 56, + "line": 1, + }, + }, + "name": "Array", + "range": Array [ + 56, + 61, + ], + "type": "Identifier", + }, }, }, }, diff --git a/packages/typescript-estree/tests/snapshots/typescript/basics/interface-with-extends-type-parameters.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/basics/interface-with-extends-type-parameters.src.ts.shot index 5ac92facdff..b880c427018 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/basics/interface-with-extends-type-parameters.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/basics/interface-with-extends-type-parameters.src.ts.shot @@ -85,6 +85,7 @@ Object { 30, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -103,7 +104,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, ], "range": Array [ diff --git a/packages/typescript-estree/tests/snapshots/typescript/basics/interface-with-method.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/basics/interface-with-method.src.ts.shot index fdc32c02335..131c70ad4a5 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/basics/interface-with-method.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/basics/interface-with-method.src.ts.shot @@ -212,6 +212,7 @@ Object { 54, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -230,7 +231,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, }, }, @@ -271,6 +271,7 @@ Object { 58, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -289,7 +290,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, }, "type": "TSMethodSignature", diff --git a/packages/typescript-estree/tests/snapshots/typescript/basics/keyof-operator.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/basics/keyof-operator.src.ts.shot index 485bdef6f27..72fbd5a7e86 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/basics/keyof-operator.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/basics/keyof-operator.src.ts.shot @@ -70,6 +70,7 @@ Object { 18, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -88,7 +89,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, }, }, diff --git a/packages/typescript-estree/tests/snapshots/typescript/basics/nested-type-arguments.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/basics/nested-type-arguments.src.ts.shot index 3419aedd5b9..42add33d94f 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/basics/nested-type-arguments.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/basics/nested-type-arguments.src.ts.shot @@ -55,25 +55,7 @@ Object { 44, ], "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 1, - }, - "start": Object { - "column": 17, - "line": 1, - }, - }, - "name": "Array", - "range": Array [ - 17, - 22, - ], - "type": "Identifier", - }, - "typeParameters": Object { + "typeArguments": Object { "loc": Object { "end": Object { "column": 44, @@ -101,25 +83,7 @@ Object { 43, ], "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 28, - "line": 1, - }, - "start": Object { - "column": 23, - "line": 1, - }, - }, - "name": "Array", - "range": Array [ - 23, - 28, - ], - "type": "Identifier", - }, - "typeParameters": Object { + "typeArguments": Object { "loc": Object { "end": Object { "column": 43, @@ -147,25 +111,7 @@ Object { 42, ], "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 34, - "line": 1, - }, - "start": Object { - "column": 29, - "line": 1, - }, - }, - "name": "Array", - "range": Array [ - 29, - 34, - ], - "type": "Identifier", - }, - "typeParameters": Object { + "typeArguments": Object { "loc": Object { "end": Object { "column": 42, @@ -201,6 +147,24 @@ Object { ], "type": "TSTypeParameterInstantiation", }, + "typeName": Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 1, + }, + "start": Object { + "column": 29, + "line": 1, + }, + }, + "name": "Array", + "range": Array [ + 29, + 34, + ], + "type": "Identifier", + }, }, ], "range": Array [ @@ -209,6 +173,24 @@ Object { ], "type": "TSTypeParameterInstantiation", }, + "typeName": Object { + "loc": Object { + "end": Object { + "column": 28, + "line": 1, + }, + "start": Object { + "column": 23, + "line": 1, + }, + }, + "name": "Array", + "range": Array [ + 23, + 28, + ], + "type": "Identifier", + }, }, ], "range": Array [ @@ -217,6 +199,24 @@ Object { ], "type": "TSTypeParameterInstantiation", }, + "typeName": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "name": "Array", + "range": Array [ + 17, + 22, + ], + "type": "Identifier", + }, }, }, }, diff --git a/packages/typescript-estree/tests/snapshots/typescript/basics/never-type-param.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/basics/never-type-param.src.ts.shot index fd30d755822..60870cc5f21 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/basics/never-type-param.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/basics/never-type-param.src.ts.shot @@ -55,25 +55,7 @@ Object { 15, ], "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 8, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, - }, - }, - "name": "X", - "range": Array [ - 7, - 8, - ], - "type": "Identifier", - }, - "typeParameters": Object { + "typeArguments": Object { "loc": Object { "end": Object { "column": 15, @@ -109,6 +91,24 @@ Object { ], "type": "TSTypeParameterInstantiation", }, + "typeName": Object { + "loc": Object { + "end": Object { + "column": 8, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "name": "X", + "range": Array [ + 7, + 8, + ], + "type": "Identifier", + }, }, }, }, @@ -221,7 +221,7 @@ Object { 42, ], "type": "CallExpression", - "typeParameters": Object { + "typeArguments": Object { "loc": Object { "end": Object { "column": 23, diff --git a/packages/typescript-estree/tests/snapshots/typescript/basics/non-null-assertion-operator.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/basics/non-null-assertion-operator.src.ts.shot index 3abb8a86713..a47399e13e9 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/basics/non-null-assertion-operator.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/basics/non-null-assertion-operator.src.ts.shot @@ -305,6 +305,7 @@ Object { 33, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -323,7 +324,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, }, }, diff --git a/packages/typescript-estree/tests/snapshots/typescript/basics/readonly-arrays.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/basics/readonly-arrays.src.ts.shot index a56985c288d..d6d30c08092 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/basics/readonly-arrays.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/basics/readonly-arrays.src.ts.shot @@ -306,25 +306,7 @@ Object { 39, ], "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 31, - "line": 1, - }, - "start": Object { - "column": 18, - "line": 1, - }, - }, - "name": "ReadonlyArray", - "range": Array [ - 18, - 31, - ], - "type": "Identifier", - }, - "typeParameters": Object { + "typeArguments": Object { "loc": Object { "end": Object { "column": 39, @@ -360,6 +342,24 @@ Object { ], "type": "TSTypeParameterInstantiation", }, + "typeName": Object { + "loc": Object { + "end": Object { + "column": 31, + "line": 1, + }, + "start": Object { + "column": 18, + "line": 1, + }, + }, + "name": "ReadonlyArray", + "range": Array [ + 18, + 31, + ], + "type": "Identifier", + }, }, }, }, diff --git a/packages/typescript-estree/tests/snapshots/typescript/basics/symbol-type-param.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/basics/symbol-type-param.src.ts.shot index fa61ef84dd9..9acb4366fe9 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/basics/symbol-type-param.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/basics/symbol-type-param.src.ts.shot @@ -103,25 +103,7 @@ Object { 38, ], "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 22, - "line": 1, - }, - "start": Object { - "column": 19, - "line": 1, - }, - }, - "name": "Map", - "range": Array [ - 19, - 22, - ], - "type": "Identifier", - }, - "typeParameters": Object { + "typeArguments": Object { "loc": Object { "end": Object { "column": 38, @@ -174,6 +156,24 @@ Object { ], "type": "TSTypeParameterInstantiation", }, + "typeName": Object { + "loc": Object { + "end": Object { + "column": 22, + "line": 1, + }, + "start": Object { + "column": 19, + "line": 1, + }, + }, + "name": "Map", + "range": Array [ + 19, + 22, + ], + "type": "Identifier", + }, }, }, }, diff --git a/packages/typescript-estree/tests/snapshots/typescript/basics/type-alias-declaration-with-constrained-type-parameter.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/basics/type-alias-declaration-with-constrained-type-parameter.src.ts.shot index d2c6248a377..de523feefb4 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/basics/type-alias-declaration-with-constrained-type-parameter.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/basics/type-alias-declaration-with-constrained-type-parameter.src.ts.shot @@ -70,25 +70,7 @@ Object { 38, ], "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 35, - "line": 1, - }, - "start": Object { - "column": 28, - "line": 1, - }, - }, - "name": "Success", - "range": Array [ - 28, - 35, - ], - "type": "Identifier", - }, - "typeParameters": Object { + "typeArguments": Object { "loc": Object { "end": Object { "column": 38, @@ -116,6 +98,7 @@ Object { 37, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -134,7 +117,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, ], "range": Array [ @@ -143,6 +125,24 @@ Object { ], "type": "TSTypeParameterInstantiation", }, + "typeName": Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 1, + }, + "start": Object { + "column": 28, + "line": 1, + }, + }, + "name": "Success", + "range": Array [ + 28, + 35, + ], + "type": "Identifier", + }, }, Object { "loc": Object { @@ -160,6 +160,7 @@ Object { 48, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -178,7 +179,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, ], }, diff --git a/packages/typescript-estree/tests/snapshots/typescript/basics/type-alias-declaration.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/basics/type-alias-declaration.src.ts.shot index 169e2a2c6f6..2b637162ddc 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/basics/type-alias-declaration.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/basics/type-alias-declaration.src.ts.shot @@ -70,25 +70,7 @@ Object { 27, ], "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 24, - "line": 1, - }, - "start": Object { - "column": 17, - "line": 1, - }, - }, - "name": "Success", - "range": Array [ - 17, - 24, - ], - "type": "Identifier", - }, - "typeParameters": Object { + "typeArguments": Object { "loc": Object { "end": Object { "column": 27, @@ -116,6 +98,7 @@ Object { 26, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -134,7 +117,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, ], "range": Array [ @@ -143,6 +125,24 @@ Object { ], "type": "TSTypeParameterInstantiation", }, + "typeName": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 1, + }, + "start": Object { + "column": 17, + "line": 1, + }, + }, + "name": "Success", + "range": Array [ + 17, + 24, + ], + "type": "Identifier", + }, }, Object { "loc": Object { @@ -160,6 +160,7 @@ Object { 37, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -178,7 +179,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, ], }, diff --git a/packages/typescript-estree/tests/snapshots/typescript/basics/type-import-type-with-type-parameters-in-type-reference.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/basics/type-import-type-with-type-parameters-in-type-reference.src.ts.shot index 3d1549888bc..1f8e6e2b79b 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/basics/type-import-type-with-type-parameters-in-type-reference.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/basics/type-import-type-with-type-parameters-in-type-reference.src.ts.shot @@ -53,25 +53,7 @@ Object { 29, ], "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 10, - "line": 1, - }, - "start": Object { - "column": 9, - "line": 1, - }, - }, - "name": "A", - "range": Array [ - 9, - 10, - ], - "type": "Identifier", - }, - "typeParameters": Object { + "typeArguments": Object { "loc": Object { "end": Object { "column": 29, @@ -198,6 +180,24 @@ Object { ], "type": "TSTypeParameterInstantiation", }, + "typeName": Object { + "loc": Object { + "end": Object { + "column": 10, + "line": 1, + }, + "start": Object { + "column": 9, + "line": 1, + }, + }, + "name": "A", + "range": Array [ + 9, + 10, + ], + "type": "Identifier", + }, }, }, ], diff --git a/packages/typescript-estree/tests/snapshots/typescript/basics/type-import-type.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/basics/type-import-type.src.ts.shot index 1afe1ff0424..9daed89f01a 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/basics/type-import-type.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/basics/type-import-type.src.ts.shot @@ -227,6 +227,7 @@ Object { 53, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -245,7 +246,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, ], "range": Array [ diff --git a/packages/typescript-estree/tests/snapshots/typescript/basics/type-parameters-comments-heritage.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/basics/type-parameters-comments-heritage.src.ts.shot index 9ac707ba48f..f29012a17a7 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/basics/type-parameters-comments-heritage.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/basics/type-parameters-comments-heritage.src.ts.shot @@ -100,6 +100,7 @@ Object { 60, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -118,7 +119,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, ], "range": Array [ @@ -284,6 +284,7 @@ Object { 150, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -302,7 +303,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, ], "range": Array [ @@ -488,6 +488,7 @@ Object { 230, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -506,7 +507,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, ], "range": Array [ @@ -691,6 +691,7 @@ Object { 324, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -709,7 +710,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, ], "range": Array [ diff --git a/packages/typescript-estree/tests/snapshots/typescript/basics/type-parameters-comments.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/basics/type-parameters-comments.src.ts.shot index 23e4e8cfe5c..b11723eb26a 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/basics/type-parameters-comments.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/basics/type-parameters-comments.src.ts.shot @@ -40,7 +40,7 @@ Object { 42, ], "type": "CallExpression", - "typeParameters": Object { + "typeArguments": Object { "loc": Object { "end": Object { "column": 40, @@ -68,6 +68,7 @@ Object { 22, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -86,7 +87,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, ], "range": Array [ @@ -313,6 +313,7 @@ Object { 129, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -331,7 +332,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, "in": false, "loc": Object { diff --git a/packages/typescript-estree/tests/snapshots/typescript/basics/type-reference-comments.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/basics/type-reference-comments.src.ts.shot index 50ce8ec40fd..26328330d89 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/basics/type-reference-comments.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/basics/type-reference-comments.src.ts.shot @@ -77,6 +77,42 @@ Object { 74, ], "type": "TSTypeReference", + "typeArguments": Object { + "loc": Object { + "end": Object { + "column": 50, + "line": 2, + }, + "start": Object { + "column": 29, + "line": 2, + }, + }, + "params": Array [ + Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 2, + }, + "start": Object { + "column": 30, + "line": 2, + }, + }, + "range": Array [ + 54, + 57, + ], + "type": "TSAnyKeyword", + }, + ], + "range": Array [ + 53, + 74, + ], + "type": "TSTypeParameterInstantiation", + }, "typeName": Object { "left": Object { "loc": Object { @@ -130,42 +166,6 @@ Object { }, "type": "TSQualifiedName", }, - "typeParameters": Object { - "loc": Object { - "end": Object { - "column": 50, - "line": 2, - }, - "start": Object { - "column": 29, - "line": 2, - }, - }, - "params": Array [ - Object { - "loc": Object { - "end": Object { - "column": 33, - "line": 2, - }, - "start": Object { - "column": 30, - "line": 2, - }, - }, - "range": Array [ - 54, - 57, - ], - "type": "TSAnyKeyword", - }, - ], - "range": Array [ - 53, - 74, - ], - "type": "TSTypeParameterInstantiation", - }, }, }, "value": null, diff --git a/packages/typescript-estree/tests/snapshots/typescript/basics/typed-method-signature.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/basics/typed-method-signature.src.ts.shot index 45a7d851587..0c4b5ec0773 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/basics/typed-method-signature.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/basics/typed-method-signature.src.ts.shot @@ -255,6 +255,7 @@ Object { 50, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -273,7 +274,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, }, }, @@ -314,6 +314,7 @@ Object { 54, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -332,7 +333,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, }, "type": "TSMethodSignature", diff --git a/packages/typescript-estree/tests/snapshots/typescript/basics/typed-this.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/basics/typed-this.src.ts.shot index bfd4fd36e9e..c71945d7ddb 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/basics/typed-this.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/basics/typed-this.src.ts.shot @@ -184,6 +184,7 @@ Object { 70, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -202,7 +203,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, }, }, diff --git a/packages/typescript-estree/tests/snapshots/typescript/basics/var-with-dotted-type.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/basics/var-with-dotted-type.src.ts.shot index ff107189850..4ab3afe6781 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/basics/var-with-dotted-type.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/basics/var-with-dotted-type.src.ts.shot @@ -55,6 +55,7 @@ Object { 14, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "left": Object { "left": Object { @@ -143,7 +144,6 @@ Object { }, "type": "TSQualifiedName", }, - "typeParameters": undefined, }, }, }, diff --git a/packages/typescript-estree/tests/snapshots/typescript/decorators/class-decorators/class-parameter-property.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/decorators/class-decorators/class-parameter-property.src.ts.shot new file mode 100644 index 00000000000..81ff4dcfe3d --- /dev/null +++ b/packages/typescript-estree/tests/snapshots/typescript/decorators/class-decorators/class-parameter-property.src.ts.shot @@ -0,0 +1,543 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`typescript decorators class-decorators class-parameter-property.src 1`] = ` +Object { + "body": Array [ + Object { + "body": Object { + "body": Array [ + Object { + "computed": false, + "key": Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "name": "constructor", + "range": Array [ + 12, + 23, + ], + "type": "Identifier", + }, + "kind": "constructor", + "loc": Object { + "end": Object { + "column": 38, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "override": false, + "range": Array [ + 12, + 48, + ], + "static": false, + "type": "MethodDefinition", + "value": Object { + "async": false, + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 38, + "line": 2, + }, + "start": Object { + "column": 36, + "line": 2, + }, + }, + "range": Array [ + 46, + 48, + ], + "type": "BlockStatement", + }, + "expression": false, + "generator": false, + "id": null, + "loc": Object { + "end": Object { + "column": 38, + "line": 2, + }, + "start": Object { + "column": 13, + "line": 2, + }, + }, + "params": Array [ + Object { + "accessibility": "private", + "decorators": Array [ + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "name": "d", + "range": Array [ + 25, + 26, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 14, + "line": 2, + }, + }, + "range": Array [ + 24, + 26, + ], + "type": "Decorator", + }, + ], + "export": undefined, + "loc": Object { + "end": Object { + "column": 34, + "line": 2, + }, + "start": Object { + "column": 14, + "line": 2, + }, + }, + "override": undefined, + "parameter": Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 2, + }, + "start": Object { + "column": 25, + "line": 2, + }, + }, + "name": "x", + "range": Array [ + 35, + 44, + ], + "type": "Identifier", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 2, + }, + "start": Object { + "column": 26, + "line": 2, + }, + }, + "range": Array [ + 36, + 44, + ], + "type": "TSTypeAnnotation", + "typeAnnotation": Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 2, + }, + "start": Object { + "column": 28, + "line": 2, + }, + }, + "range": Array [ + 38, + 44, + ], + "type": "TSNumberKeyword", + }, + }, + }, + "range": Array [ + 24, + 44, + ], + "readonly": undefined, + "static": undefined, + "type": "TSParameterProperty", + }, + ], + "range": Array [ + 23, + 48, + ], + "type": "FunctionExpression", + }, + }, + ], + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 50, + ], + "type": "ClassBody", + }, + "id": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "name": "A", + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 50, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + ], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 0, + "line": 4, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 51, + ], + "sourceType": "script", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 5, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 5, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 6, + "line": 1, + }, + }, + "range": Array [ + 6, + 7, + ], + "type": "Identifier", + "value": "A", + }, + Object { + "loc": Object { + "end": Object { + "column": 9, + "line": 1, + }, + "start": Object { + "column": 8, + "line": 1, + }, + }, + "range": Array [ + 8, + 9, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 13, + "line": 2, + }, + "start": Object { + "column": 2, + "line": 2, + }, + }, + "range": Array [ + 12, + 23, + ], + "type": "Identifier", + "value": "constructor", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 13, + "line": 2, + }, + }, + "range": Array [ + 23, + 24, + ], + "type": "Punctuator", + "value": "(", + }, + Object { + "loc": Object { + "end": Object { + "column": 15, + "line": 2, + }, + "start": Object { + "column": 14, + "line": 2, + }, + }, + "range": Array [ + 24, + 25, + ], + "type": "Punctuator", + "value": "@", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Identifier", + "value": "d", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 2, + }, + "start": Object { + "column": 17, + "line": 2, + }, + }, + "range": Array [ + 27, + 34, + ], + "type": "Keyword", + "value": "private", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 2, + }, + "start": Object { + "column": 25, + "line": 2, + }, + }, + "range": Array [ + 35, + 36, + ], + "type": "Identifier", + "value": "x", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 2, + }, + "start": Object { + "column": 26, + "line": 2, + }, + }, + "range": Array [ + 36, + 37, + ], + "type": "Punctuator", + "value": ":", + }, + Object { + "loc": Object { + "end": Object { + "column": 34, + "line": 2, + }, + "start": Object { + "column": 28, + "line": 2, + }, + }, + "range": Array [ + 38, + 44, + ], + "type": "Identifier", + "value": "number", + }, + Object { + "loc": Object { + "end": Object { + "column": 35, + "line": 2, + }, + "start": Object { + "column": 34, + "line": 2, + }, + }, + "range": Array [ + 44, + 45, + ], + "type": "Punctuator", + "value": ")", + }, + Object { + "loc": Object { + "end": Object { + "column": 37, + "line": 2, + }, + "start": Object { + "column": 36, + "line": 2, + }, + }, + "range": Array [ + 46, + 47, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 38, + "line": 2, + }, + "start": Object { + "column": 37, + "line": 2, + }, + }, + "range": Array [ + 47, + 48, + ], + "type": "Punctuator", + "value": "}", + }, + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 3, + }, + }, + "range": Array [ + 49, + 50, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; diff --git a/packages/typescript-estree/tests/snapshots/typescript/decorators/class-decorators/export-default-class-decorator.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/decorators/class-decorators/export-default-class-decorator.src.ts.shot new file mode 100644 index 00000000000..031962dfb27 --- /dev/null +++ b/packages/typescript-estree/tests/snapshots/typescript/decorators/class-decorators/export-default-class-decorator.src.ts.shot @@ -0,0 +1,280 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`typescript decorators class-decorators export-default-class-decorator.src 1`] = ` +Object { + "body": Array [ + Object { + "declaration": Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 27, + "line": 2, + }, + "start": Object { + "column": 25, + "line": 2, + }, + }, + "range": Array [ + 33, + 35, + ], + "type": "ClassBody", + }, + "decorators": Array [ + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "name": "sealed", + "range": Array [ + 1, + 7, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 7, + ], + "type": "Decorator", + }, + ], + "id": Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 2, + }, + "start": Object { + "column": 21, + "line": 2, + }, + }, + "name": "Qux", + "range": Array [ + 29, + 32, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 27, + "line": 2, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "range": Array [ + 23, + 35, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + "exportKind": "value", + "loc": Object { + "end": Object { + "column": 27, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 8, + 35, + ], + "type": "ExportDefaultDeclaration", + }, + ], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 0, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 36, + ], + "sourceType": "module", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "@", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 7, + ], + "type": "Identifier", + "value": "sealed", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 8, + 14, + ], + "type": "Keyword", + "value": "export", + }, + Object { + "loc": Object { + "end": Object { + "column": 14, + "line": 2, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "range": Array [ + 15, + 22, + ], + "type": "Keyword", + "value": "default", + }, + Object { + "loc": Object { + "end": Object { + "column": 20, + "line": 2, + }, + "start": Object { + "column": 15, + "line": 2, + }, + }, + "range": Array [ + 23, + 28, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 24, + "line": 2, + }, + "start": Object { + "column": 21, + "line": 2, + }, + }, + "range": Array [ + 29, + 32, + ], + "type": "Identifier", + "value": "Qux", + }, + Object { + "loc": Object { + "end": Object { + "column": 26, + "line": 2, + }, + "start": Object { + "column": 25, + "line": 2, + }, + }, + "range": Array [ + 33, + 34, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 27, + "line": 2, + }, + "start": Object { + "column": 26, + "line": 2, + }, + }, + "range": Array [ + 34, + 35, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; diff --git a/packages/typescript-estree/tests/snapshots/typescript/decorators/class-decorators/export-named-class-decorator.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/decorators/class-decorators/export-named-class-decorator.src.ts.shot new file mode 100644 index 00000000000..f3b1a4c1ed5 --- /dev/null +++ b/packages/typescript-estree/tests/snapshots/typescript/decorators/class-decorators/export-named-class-decorator.src.ts.shot @@ -0,0 +1,265 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`typescript decorators class-decorators export-named-class-decorator.src 1`] = ` +Object { + "body": Array [ + Object { + "assertions": Array [], + "declaration": Object { + "body": Object { + "body": Array [], + "loc": Object { + "end": Object { + "column": 19, + "line": 2, + }, + "start": Object { + "column": 17, + "line": 2, + }, + }, + "range": Array [ + 25, + 27, + ], + "type": "ClassBody", + }, + "decorators": Array [ + Object { + "expression": Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "name": "sealed", + "range": Array [ + 1, + 7, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 7, + ], + "type": "Decorator", + }, + ], + "id": Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 13, + "line": 2, + }, + }, + "name": "Qux", + "range": Array [ + 21, + 24, + ], + "type": "Identifier", + }, + "loc": Object { + "end": Object { + "column": 19, + "line": 2, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "range": Array [ + 15, + 27, + ], + "superClass": null, + "type": "ClassDeclaration", + }, + "exportKind": "value", + "loc": Object { + "end": Object { + "column": 19, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 8, + 27, + ], + "source": null, + "specifiers": Array [], + "type": "ExportNamedDeclaration", + }, + ], + "comments": Array [], + "loc": Object { + "end": Object { + "column": 0, + "line": 3, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 28, + ], + "sourceType": "module", + "tokens": Array [ + Object { + "loc": Object { + "end": Object { + "column": 1, + "line": 1, + }, + "start": Object { + "column": 0, + "line": 1, + }, + }, + "range": Array [ + 0, + 1, + ], + "type": "Punctuator", + "value": "@", + }, + Object { + "loc": Object { + "end": Object { + "column": 7, + "line": 1, + }, + "start": Object { + "column": 1, + "line": 1, + }, + }, + "range": Array [ + 1, + 7, + ], + "type": "Identifier", + "value": "sealed", + }, + Object { + "loc": Object { + "end": Object { + "column": 6, + "line": 2, + }, + "start": Object { + "column": 0, + "line": 2, + }, + }, + "range": Array [ + 8, + 14, + ], + "type": "Keyword", + "value": "export", + }, + Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 2, + }, + "start": Object { + "column": 7, + "line": 2, + }, + }, + "range": Array [ + 15, + 20, + ], + "type": "Keyword", + "value": "class", + }, + Object { + "loc": Object { + "end": Object { + "column": 16, + "line": 2, + }, + "start": Object { + "column": 13, + "line": 2, + }, + }, + "range": Array [ + 21, + 24, + ], + "type": "Identifier", + "value": "Qux", + }, + Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 2, + }, + "start": Object { + "column": 17, + "line": 2, + }, + }, + "range": Array [ + 25, + 26, + ], + "type": "Punctuator", + "value": "{", + }, + Object { + "loc": Object { + "end": Object { + "column": 19, + "line": 2, + }, + "start": Object { + "column": 18, + "line": 2, + }, + }, + "range": Array [ + 26, + 27, + ], + "type": "Punctuator", + "value": "}", + }, + ], + "type": "Program", +} +`; diff --git a/packages/typescript-estree/tests/snapshots/typescript/decorators/parameter-decorators/parameter-decorator-constructor.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/decorators/parameter-decorators/parameter-decorator-constructor.src.ts.shot index 400c54bbc48..be179168a89 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/decorators/parameter-decorators/parameter-decorator-constructor.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/decorators/parameter-decorators/parameter-decorator-constructor.src.ts.shot @@ -347,6 +347,7 @@ Object { 69, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -365,7 +366,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, }, }, diff --git a/packages/typescript-estree/tests/snapshots/typescript/errorRecovery/decorator-on-variable.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/errorRecovery/decorator-on-variable.src.ts.shot index aa52b8264e8..da9ce1e5a23 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/errorRecovery/decorator-on-variable.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/errorRecovery/decorator-on-variable.src.ts.shot @@ -60,62 +60,6 @@ Object { "type": "VariableDeclarator", }, ], - "decorators": Array [ - Object { - "expression": Object { - "arguments": Array [], - "callee": Object { - "loc": Object { - "end": Object { - "column": 5, - "line": 1, - }, - "start": Object { - "column": 1, - "line": 1, - }, - }, - "name": "deco", - "range": Array [ - 1, - 5, - ], - "type": "Identifier", - }, - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 1, - "line": 1, - }, - }, - "optional": false, - "range": Array [ - 1, - 7, - ], - "type": "CallExpression", - }, - "loc": Object { - "end": Object { - "column": 7, - "line": 1, - }, - "start": Object { - "column": 0, - "line": 1, - }, - }, - "range": Array [ - 0, - 7, - ], - "type": "Decorator", - }, - ], "kind": "const", "loc": Object { "end": Object { diff --git a/packages/typescript-estree/tests/snapshots/typescript/errorRecovery/empty-type-arguments-in-call-expression.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/errorRecovery/empty-type-arguments-in-call-expression.src.ts.shot index 5a448875170..86e68d7a860 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/errorRecovery/empty-type-arguments-in-call-expression.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/errorRecovery/empty-type-arguments-in-call-expression.src.ts.shot @@ -40,7 +40,7 @@ Object { 7, ], "type": "CallExpression", - "typeParameters": Object { + "typeArguments": Object { "loc": Object { "end": Object { "column": 5, diff --git a/packages/typescript-estree/tests/snapshots/typescript/errorRecovery/empty-type-arguments-in-new-expression.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/errorRecovery/empty-type-arguments-in-new-expression.src.ts.shot index ccbb6a7f946..ceff4957b75 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/errorRecovery/empty-type-arguments-in-new-expression.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/errorRecovery/empty-type-arguments-in-new-expression.src.ts.shot @@ -39,7 +39,7 @@ Object { 11, ], "type": "NewExpression", - "typeParameters": Object { + "typeArguments": Object { "loc": Object { "end": Object { "column": 9, diff --git a/packages/typescript-estree/tests/snapshots/typescript/errorRecovery/empty-type-arguments.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/errorRecovery/empty-type-arguments.src.ts.shot index 91099f034a0..f4f9f0cc469 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/errorRecovery/empty-type-arguments.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/errorRecovery/empty-type-arguments.src.ts.shot @@ -55,41 +55,41 @@ Object { 16, ], "type": "TSTypeReference", - "typeName": Object { + "typeArguments": Object { "loc": Object { "end": Object { - "column": 14, + "column": 16, "line": 1, }, "start": Object { - "column": 11, + "column": 14, "line": 1, }, }, - "name": "Foo", + "params": Array [], "range": Array [ - 11, 14, + 16, ], - "type": "Identifier", + "type": "TSTypeParameterInstantiation", }, - "typeParameters": Object { + "typeName": Object { "loc": Object { "end": Object { - "column": 16, + "column": 14, "line": 1, }, "start": Object { - "column": 14, + "column": 11, "line": 1, }, }, - "params": Array [], + "name": "Foo", "range": Array [ + 11, 14, - 16, ], - "type": "TSTypeParameterInstantiation", + "type": "Identifier", }, }, }, diff --git a/packages/typescript-estree/tests/snapshots/typescript/expressions/call-expression-type-arguments.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/expressions/call-expression-type-arguments.src.ts.shot index d980c2f742e..5cf31ad23dd 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/expressions/call-expression-type-arguments.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/expressions/call-expression-type-arguments.src.ts.shot @@ -40,7 +40,7 @@ Object { 8, ], "type": "CallExpression", - "typeParameters": Object { + "typeArguments": Object { "loc": Object { "end": Object { "column": 6, @@ -68,6 +68,7 @@ Object { 5, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -86,7 +87,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, ], "range": Array [ @@ -149,7 +149,7 @@ Object { 23, ], "type": "CallExpression", - "typeParameters": Object { + "typeArguments": Object { "loc": Object { "end": Object { "column": 11, diff --git a/packages/typescript-estree/tests/snapshots/typescript/expressions/instantiation-expression.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/expressions/instantiation-expression.src.ts.shot index 25904ece493..015af04b8e6 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/expressions/instantiation-expression.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/expressions/instantiation-expression.src.ts.shot @@ -66,6 +66,7 @@ Object { 3, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -84,7 +85,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, ], "range": Array [ @@ -174,6 +174,7 @@ Object { 11, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -192,7 +193,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, ], "range": Array [ @@ -245,6 +245,7 @@ Object { 15, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -263,7 +264,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, ], "range": Array [ @@ -354,6 +354,7 @@ Object { 22, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -372,7 +373,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, ], "range": Array [ @@ -398,7 +398,7 @@ Object { 29, ], "type": "CallExpression", - "typeParameters": Object { + "typeArguments": Object { "loc": Object { "end": Object { "column": 9, @@ -426,6 +426,7 @@ Object { 26, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -444,7 +445,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, ], "range": Array [ @@ -537,6 +537,7 @@ Object { 35, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -555,7 +556,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, ], "range": Array [ @@ -608,6 +608,7 @@ Object { 39, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -626,7 +627,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, ], "range": Array [ @@ -804,6 +804,7 @@ Object { 53, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -822,7 +823,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, ], "range": Array [ @@ -848,7 +848,7 @@ Object { 60, ], "type": "CallExpression", - "typeParameters": Object { + "typeArguments": Object { "loc": Object { "end": Object { "column": 12, @@ -876,6 +876,7 @@ Object { 57, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -894,7 +895,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, ], "range": Array [ @@ -985,6 +985,7 @@ Object { 70, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -1003,7 +1004,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, ], "range": Array [ @@ -1028,7 +1028,7 @@ Object { 77, ], "type": "NewExpression", - "typeParameters": Object { + "typeArguments": Object { "loc": Object { "end": Object { "column": 13, @@ -1056,6 +1056,7 @@ Object { 74, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -1074,7 +1075,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, ], "range": Array [ diff --git a/packages/typescript-estree/tests/snapshots/typescript/expressions/new-expression-type-arguments.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/expressions/new-expression-type-arguments.src.ts.shot index 481bb783af7..1479a6bc69b 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/expressions/new-expression-type-arguments.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/expressions/new-expression-type-arguments.src.ts.shot @@ -59,7 +59,7 @@ Object { 20, ], "type": "NewExpression", - "typeParameters": Object { + "typeArguments": Object { "loc": Object { "end": Object { "column": 18, @@ -87,6 +87,7 @@ Object { 17, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -105,7 +106,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, ], "range": Array [ diff --git a/packages/typescript-estree/tests/snapshots/typescript/expressions/optional-call-expression-type-arguments.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/expressions/optional-call-expression-type-arguments.src.ts.shot index e5c1aeba3c9..cb50ee08e2a 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/expressions/optional-call-expression-type-arguments.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/expressions/optional-call-expression-type-arguments.src.ts.shot @@ -78,7 +78,7 @@ Object { 13, ], "type": "CallExpression", - "typeParameters": Object { + "typeArguments": Object { "loc": Object { "end": Object { "column": 11, @@ -106,6 +106,7 @@ Object { 10, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -124,7 +125,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, ], "range": Array [ @@ -241,7 +241,7 @@ Object { 33, ], "type": "CallExpression", - "typeParameters": Object { + "typeArguments": Object { "loc": Object { "end": Object { "column": 16, diff --git a/packages/typescript-estree/tests/snapshots/typescript/expressions/tagged-template-expression-type-arguments.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/expressions/tagged-template-expression-type-arguments.src.ts.shot index b6f11be9a43..b61964c308b 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/expressions/tagged-template-expression-type-arguments.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/expressions/tagged-template-expression-type-arguments.src.ts.shot @@ -108,6 +108,7 @@ Object { 7, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -126,7 +127,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, ], "range": Array [ diff --git a/packages/typescript-estree/tests/snapshots/typescript/namespaces-and-modules/declare-namespace-with-exported-function.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/namespaces-and-modules/declare-namespace-with-exported-function.src.ts.shot index 1d6f5b2efda..03e91b22536 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/namespaces-and-modules/declare-namespace-with-exported-function.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/namespaces-and-modules/declare-namespace-with-exported-function.src.ts.shot @@ -131,25 +131,7 @@ Object { 81, ], "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 53, - "line": 2, - }, - "start": Object { - "column": 44, - "line": 2, - }, - }, - "name": "Selection", - "range": Array [ - 67, - 76, - ], - "type": "Identifier", - }, - "typeParameters": Object { + "typeArguments": Object { "loc": Object { "end": Object { "column": 58, @@ -185,6 +167,24 @@ Object { ], "type": "TSTypeParameterInstantiation", }, + "typeName": Object { + "loc": Object { + "end": Object { + "column": 53, + "line": 2, + }, + "start": Object { + "column": 44, + "line": 2, + }, + }, + "name": "Selection", + "range": Array [ + 67, + 76, + ], + "type": "Identifier", + }, }, }, "type": "TSDeclareFunction", diff --git a/packages/typescript-estree/tests/snapshots/typescript/namespaces-and-modules/module-with-default-exports.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/namespaces-and-modules/module-with-default-exports.src.ts.shot index 70ff82a2ec7..2e8e9d5fd2b 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/namespaces-and-modules/module-with-default-exports.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/namespaces-and-modules/module-with-default-exports.src.ts.shot @@ -118,6 +118,7 @@ Object { 63, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -136,7 +137,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, }, "type": "FunctionExpression", diff --git a/packages/typescript-estree/tests/snapshots/typescript/types/conditional-infer-nested.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/types/conditional-infer-nested.src.ts.shot index 693f5d114a9..3a4ce9d219f 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/types/conditional-infer-nested.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/types/conditional-infer-nested.src.ts.shot @@ -54,6 +54,7 @@ Object { 22, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -72,7 +73,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, "extendsType": Object { "elementType": Object { @@ -164,6 +164,7 @@ Object { 54, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -182,7 +183,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, "extendsType": Object { "loc": Object { @@ -257,6 +257,7 @@ Object { 84, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -275,7 +276,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, "extendsType": Object { "loc": Object { @@ -293,25 +293,7 @@ Object { 109, ], "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 23, - "line": 4, - }, - "start": Object { - "column": 16, - "line": 4, - }, - }, - "name": "Promise", - "range": Array [ - 93, - 100, - ], - "type": "Identifier", - }, - "typeParameters": Object { + "typeArguments": Object { "loc": Object { "end": Object { "column": 32, @@ -386,6 +368,24 @@ Object { ], "type": "TSTypeParameterInstantiation", }, + "typeName": Object { + "loc": Object { + "end": Object { + "column": 23, + "line": 4, + }, + "start": Object { + "column": 16, + "line": 4, + }, + }, + "name": "Promise", + "range": Array [ + 93, + 100, + ], + "type": "Identifier", + }, }, "falseType": Object { "loc": Object { @@ -403,6 +403,7 @@ Object { 125, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -421,7 +422,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, "loc": Object { "end": Object { @@ -453,6 +453,7 @@ Object { 113, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -471,7 +472,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, "type": "TSConditionalType", }, @@ -505,6 +505,7 @@ Object { 74, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -523,7 +524,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, "type": "TSConditionalType", }, @@ -557,6 +557,7 @@ Object { 46, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -575,7 +576,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, "type": "TSConditionalType", }, diff --git a/packages/typescript-estree/tests/snapshots/typescript/types/conditional-infer-simple.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/types/conditional-infer-simple.src.ts.shot index 48cb6977cbf..c470074a80c 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/types/conditional-infer-simple.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/types/conditional-infer-simple.src.ts.shot @@ -54,6 +54,7 @@ Object { 15, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -72,7 +73,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, "extendsType": Object { "loc": Object { @@ -368,6 +368,7 @@ Object { 54, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -386,7 +387,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, "type": "TSConditionalType", }, diff --git a/packages/typescript-estree/tests/snapshots/typescript/types/conditional-infer-with-constraint.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/types/conditional-infer-with-constraint.src.ts.shot index f4a26f22e90..f21adcbf28f 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/types/conditional-infer-with-constraint.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/types/conditional-infer-with-constraint.src.ts.shot @@ -54,6 +54,7 @@ Object { 14, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -72,7 +73,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, "extendsType": Object { "elementTypes": Array [ @@ -212,25 +212,7 @@ Object { 65, ], "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 62, - "line": 1, - }, - "start": Object { - "column": 50, - "line": 1, - }, - }, - "name": "MustBeNumber", - "range": Array [ - 50, - 62, - ], - "type": "Identifier", - }, - "typeParameters": Object { + "typeArguments": Object { "loc": Object { "end": Object { "column": 65, @@ -258,6 +240,7 @@ Object { 64, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -276,7 +259,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, ], "range": Array [ @@ -285,6 +267,24 @@ Object { ], "type": "TSTypeParameterInstantiation", }, + "typeName": Object { + "loc": Object { + "end": Object { + "column": 62, + "line": 1, + }, + "start": Object { + "column": 50, + "line": 1, + }, + }, + "name": "MustBeNumber", + "range": Array [ + 50, + 62, + ], + "type": "Identifier", + }, }, "type": "TSConditionalType", }, @@ -398,6 +398,7 @@ Object { 89, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -416,7 +417,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, "extendsType": Object { "elementTypes": Array [ @@ -628,25 +628,7 @@ Object { 164, ], "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 86, - "line": 2, - }, - "start": Object { - "column": 74, - "line": 2, - }, - }, - "name": "MustBeNumber", - "range": Array [ - 149, - 161, - ], - "type": "Identifier", - }, - "typeParameters": Object { + "typeArguments": Object { "loc": Object { "end": Object { "column": 89, @@ -674,6 +656,7 @@ Object { 163, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -692,7 +675,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, ], "range": Array [ @@ -701,6 +683,24 @@ Object { ], "type": "TSTypeParameterInstantiation", }, + "typeName": Object { + "loc": Object { + "end": Object { + "column": 86, + "line": 2, + }, + "start": Object { + "column": 74, + "line": 2, + }, + }, + "name": "MustBeNumber", + "range": Array [ + 149, + 161, + ], + "type": "Identifier", + }, }, "type": "TSConditionalType", }, @@ -814,6 +814,7 @@ Object { 188, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -832,7 +833,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, "extendsType": Object { "elementTypes": Array [ @@ -1028,25 +1028,7 @@ Object { 248, ], "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 71, - "line": 3, - }, - "start": Object { - "column": 59, - "line": 3, - }, - }, - "name": "MustBeNumber", - "range": Array [ - 233, - 245, - ], - "type": "Identifier", - }, - "typeParameters": Object { + "typeArguments": Object { "loc": Object { "end": Object { "column": 74, @@ -1074,6 +1056,7 @@ Object { 247, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -1092,7 +1075,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, ], "range": Array [ @@ -1101,6 +1083,24 @@ Object { ], "type": "TSTypeParameterInstantiation", }, + "typeName": Object { + "loc": Object { + "end": Object { + "column": 71, + "line": 3, + }, + "start": Object { + "column": 59, + "line": 3, + }, + }, + "name": "MustBeNumber", + "range": Array [ + 233, + 245, + ], + "type": "Identifier", + }, }, "type": "TSConditionalType", }, @@ -1214,6 +1214,7 @@ Object { 272, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -1232,7 +1233,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, "extendsType": Object { "elementTypes": Array [ @@ -1428,25 +1428,7 @@ Object { 332, ], "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 71, - "line": 4, - }, - "start": Object { - "column": 59, - "line": 4, - }, - }, - "name": "MustBeNumber", - "range": Array [ - 317, - 329, - ], - "type": "Identifier", - }, - "typeParameters": Object { + "typeArguments": Object { "loc": Object { "end": Object { "column": 74, @@ -1474,6 +1456,7 @@ Object { 331, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -1492,7 +1475,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, ], "range": Array [ @@ -1501,6 +1483,24 @@ Object { ], "type": "TSTypeParameterInstantiation", }, + "typeName": Object { + "loc": Object { + "end": Object { + "column": 71, + "line": 4, + }, + "start": Object { + "column": 59, + "line": 4, + }, + }, + "name": "MustBeNumber", + "range": Array [ + 317, + 329, + ], + "type": "Identifier", + }, }, "type": "TSConditionalType", }, @@ -1614,6 +1614,7 @@ Object { 356, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -1632,7 +1633,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, "extendsType": Object { "elementTypes": Array [ @@ -1844,6 +1844,7 @@ Object { 417, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -1862,7 +1863,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, "type": "TSConditionalType", }, diff --git a/packages/typescript-estree/tests/snapshots/typescript/types/conditional-infer.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/types/conditional-infer.src.ts.shot index 9534b875bd9..9552388947c 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/types/conditional-infer.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/types/conditional-infer.src.ts.shot @@ -54,6 +54,7 @@ Object { 19, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -72,7 +73,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, "extendsType": Object { "elementType": Object { @@ -163,6 +163,7 @@ Object { 47, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -181,7 +182,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, "loc": Object { "end": Object { @@ -213,6 +213,7 @@ Object { 43, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -231,7 +232,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, "type": "TSConditionalType", }, diff --git a/packages/typescript-estree/tests/snapshots/typescript/types/constructor-generic.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/types/constructor-generic.src.ts.shot index 43b72d5dff0..c821d7955a8 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/types/constructor-generic.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/types/constructor-generic.src.ts.shot @@ -101,6 +101,7 @@ Object { 19, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -119,7 +120,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, }, }, @@ -160,6 +160,7 @@ Object { 25, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -178,7 +179,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, }, "type": "TSConstructorType", diff --git a/packages/typescript-estree/tests/snapshots/typescript/types/constructor-in-generic.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/types/constructor-in-generic.src.ts.shot index e74c46c3f4c..88594a4a869 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/types/constructor-in-generic.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/types/constructor-in-generic.src.ts.shot @@ -55,25 +55,7 @@ Object { 30, ], "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, - }, - }, - "name": "Array", - "range": Array [ - 7, - 12, - ], - "type": "Identifier", - }, - "typeParameters": Object { + "typeArguments": Object { "loc": Object { "end": Object { "column": 30, @@ -145,6 +127,24 @@ Object { ], "type": "TSTypeParameterInstantiation", }, + "typeName": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "name": "Array", + "range": Array [ + 7, + 12, + ], + "type": "Identifier", + }, }, }, }, diff --git a/packages/typescript-estree/tests/snapshots/typescript/types/function-generic.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/types/function-generic.src.ts.shot index 3d0a9285487..cc88a2f7feb 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/types/function-generic.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/types/function-generic.src.ts.shot @@ -100,6 +100,7 @@ Object { 15, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -118,7 +119,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, }, }, @@ -159,6 +159,7 @@ Object { 21, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -177,7 +178,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, }, "type": "TSFunctionType", diff --git a/packages/typescript-estree/tests/snapshots/typescript/types/function-in-generic.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/types/function-in-generic.src.ts.shot index 8f523988734..acb793583f3 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/types/function-in-generic.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/types/function-in-generic.src.ts.shot @@ -55,25 +55,7 @@ Object { 24, ], "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, - }, - }, - "name": "Array", - "range": Array [ - 7, - 12, - ], - "type": "Identifier", - }, - "typeParameters": Object { + "typeArguments": Object { "loc": Object { "end": Object { "column": 24, @@ -144,6 +126,24 @@ Object { ], "type": "TSTypeParameterInstantiation", }, + "typeName": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "name": "Array", + "range": Array [ + 7, + 12, + ], + "type": "Identifier", + }, }, }, }, diff --git a/packages/typescript-estree/tests/snapshots/typescript/types/indexed.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/types/indexed.src.ts.shot index 460df7a1501..34bc87fd5ba 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/types/indexed.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/types/indexed.src.ts.shot @@ -56,6 +56,7 @@ Object { 10, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -74,7 +75,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, "loc": Object { "end": Object { @@ -102,6 +102,7 @@ Object { 8, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -120,7 +121,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, "range": Array [ 7, diff --git a/packages/typescript-estree/tests/snapshots/typescript/types/intersection-type.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/types/intersection-type.src.ts.shot index 7e56c87cf8b..c6b3a43d96e 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/types/intersection-type.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/types/intersection-type.src.ts.shot @@ -70,6 +70,7 @@ Object { 22, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -88,7 +89,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, Object { "loc": Object { @@ -174,25 +174,7 @@ Object { 46, ], "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 43, - "line": 1, - }, - "start": Object { - "column": 33, - "line": 1, - }, - }, - "name": "LinkedList", - "range": Array [ - 33, - 43, - ], - "type": "Identifier", - }, - "typeParameters": Object { + "typeArguments": Object { "loc": Object { "end": Object { "column": 46, @@ -220,6 +202,7 @@ Object { 45, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -238,7 +221,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, ], "range": Array [ @@ -247,6 +229,24 @@ Object { ], "type": "TSTypeParameterInstantiation", }, + "typeName": Object { + "loc": Object { + "end": Object { + "column": 43, + "line": 1, + }, + "start": Object { + "column": 33, + "line": 1, + }, + }, + "name": "LinkedList", + "range": Array [ + 33, + 43, + ], + "type": "Identifier", + }, }, }, }, diff --git a/packages/typescript-estree/tests/snapshots/typescript/types/mapped-named-type.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/types/mapped-named-type.src.ts.shot index ad9603c0953..c60747efcb1 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/types/mapped-named-type.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/types/mapped-named-type.src.ts.shot @@ -106,6 +106,7 @@ Object { 45, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -124,7 +125,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, "loc": Object { "end": Object { @@ -152,6 +152,7 @@ Object { 43, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -170,7 +171,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, "range": Array [ 42, @@ -212,6 +212,7 @@ Object { 32, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -230,7 +231,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, }, "default": undefined, diff --git a/packages/typescript-estree/tests/snapshots/typescript/types/optional-variance-in-and-out.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/types/optional-variance-in-and-out.src.ts.shot index 26e233652d4..c99c214153d 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/types/optional-variance-in-and-out.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/types/optional-variance-in-and-out.src.ts.shot @@ -98,6 +98,7 @@ Object { 32, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -116,7 +117,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, }, }, @@ -157,6 +157,7 @@ Object { 38, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -175,7 +176,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, }, "type": "TSFunctionType", diff --git a/packages/typescript-estree/tests/snapshots/typescript/types/optional-variance-in-out.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/types/optional-variance-in-out.src.ts.shot index 9639322188c..d2610b5babf 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/types/optional-variance-in-out.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/types/optional-variance-in-out.src.ts.shot @@ -98,6 +98,7 @@ Object { 32, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -116,7 +117,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, }, }, @@ -157,6 +157,7 @@ Object { 38, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -175,7 +176,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, }, "type": "TSFunctionType", diff --git a/packages/typescript-estree/tests/snapshots/typescript/types/optional-variance-in.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/types/optional-variance-in.src.ts.shot index bf2e85f702f..3d4aec65cf1 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/types/optional-variance-in.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/types/optional-variance-in.src.ts.shot @@ -98,6 +98,7 @@ Object { 27, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -116,7 +117,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, }, }, diff --git a/packages/typescript-estree/tests/snapshots/typescript/types/optional-variance-out.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/types/optional-variance-out.src.ts.shot index 04c6769229f..3006be0a995 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/types/optional-variance-out.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/types/optional-variance-out.src.ts.shot @@ -85,6 +85,7 @@ Object { 30, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -103,7 +104,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, }, "type": "TSFunctionType", diff --git a/packages/typescript-estree/tests/snapshots/typescript/types/reference-generic-nested.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/types/reference-generic-nested.src.ts.shot index 8e22e5de774..34f705456f0 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/types/reference-generic-nested.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/types/reference-generic-nested.src.ts.shot @@ -55,25 +55,7 @@ Object { 27, ], "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, - }, - }, - "name": "Array", - "range": Array [ - 7, - 12, - ], - "type": "Identifier", - }, - "typeParameters": Object { + "typeArguments": Object { "loc": Object { "end": Object { "column": 27, @@ -101,25 +83,7 @@ Object { 26, ], "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 18, - "line": 1, - }, - "start": Object { - "column": 13, - "line": 1, - }, - }, - "name": "Array", - "range": Array [ - 13, - 18, - ], - "type": "Identifier", - }, - "typeParameters": Object { + "typeArguments": Object { "loc": Object { "end": Object { "column": 26, @@ -155,6 +119,24 @@ Object { ], "type": "TSTypeParameterInstantiation", }, + "typeName": Object { + "loc": Object { + "end": Object { + "column": 18, + "line": 1, + }, + "start": Object { + "column": 13, + "line": 1, + }, + }, + "name": "Array", + "range": Array [ + 13, + 18, + ], + "type": "Identifier", + }, }, ], "range": Array [ @@ -163,6 +145,24 @@ Object { ], "type": "TSTypeParameterInstantiation", }, + "typeName": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "name": "Array", + "range": Array [ + 7, + 12, + ], + "type": "Identifier", + }, }, }, }, diff --git a/packages/typescript-estree/tests/snapshots/typescript/types/reference-generic.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/types/reference-generic.src.ts.shot index 87577d72d64..2504f817331 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/types/reference-generic.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/types/reference-generic.src.ts.shot @@ -55,25 +55,7 @@ Object { 20, ], "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 12, - "line": 1, - }, - "start": Object { - "column": 7, - "line": 1, - }, - }, - "name": "Array", - "range": Array [ - 7, - 12, - ], - "type": "Identifier", - }, - "typeParameters": Object { + "typeArguments": Object { "loc": Object { "end": Object { "column": 20, @@ -109,6 +91,24 @@ Object { ], "type": "TSTypeParameterInstantiation", }, + "typeName": Object { + "loc": Object { + "end": Object { + "column": 12, + "line": 1, + }, + "start": Object { + "column": 7, + "line": 1, + }, + }, + "name": "Array", + "range": Array [ + 7, + 12, + ], + "type": "Identifier", + }, }, }, }, diff --git a/packages/typescript-estree/tests/snapshots/typescript/types/reference.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/types/reference.src.ts.shot index 3f0393901da..dbec4286024 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/types/reference.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/types/reference.src.ts.shot @@ -55,6 +55,7 @@ Object { 8, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -73,7 +74,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, }, }, diff --git a/packages/typescript-estree/tests/snapshots/typescript/types/template-literal-type-3.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/types/template-literal-type-3.src.ts.shot index c4d2582a33c..5dcd418e5d9 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/types/template-literal-type-3.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/types/template-literal-type-3.src.ts.shot @@ -385,6 +385,7 @@ Object { 88, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -403,7 +404,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, Object { "loc": Object { @@ -421,6 +421,7 @@ Object { 96, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -439,7 +440,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, ], }, diff --git a/packages/typescript-estree/tests/snapshots/typescript/types/template-literal-type-4.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/types/template-literal-type-4.src.ts.shot index 44900a50b51..b4c52188991 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/types/template-literal-type-4.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/types/template-literal-type-4.src.ts.shot @@ -182,25 +182,7 @@ Object { 61, ], "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 58, - "line": 1, - }, - "start": Object { - "column": 49, - "line": 1, - }, - }, - "name": "Uppercase", - "range": Array [ - 49, - 58, - ], - "type": "Identifier", - }, - "typeParameters": Object { + "typeArguments": Object { "loc": Object { "end": Object { "column": 61, @@ -228,6 +210,7 @@ Object { 60, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -246,7 +229,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, ], "range": Array [ @@ -255,6 +237,24 @@ Object { ], "type": "TSTypeParameterInstantiation", }, + "typeName": Object { + "loc": Object { + "end": Object { + "column": 58, + "line": 1, + }, + "start": Object { + "column": 49, + "line": 1, + }, + }, + "name": "Uppercase", + "range": Array [ + 49, + 58, + ], + "type": "Identifier", + }, }, Object { "loc": Object { @@ -272,25 +272,7 @@ Object { 79, ], "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 76, - "line": 1, - }, - "start": Object { - "column": 67, - "line": 1, - }, - }, - "name": "Lowercase", - "range": Array [ - 67, - 76, - ], - "type": "Identifier", - }, - "typeParameters": Object { + "typeArguments": Object { "loc": Object { "end": Object { "column": 79, @@ -318,6 +300,7 @@ Object { 78, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -336,7 +319,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, ], "range": Array [ @@ -345,6 +327,24 @@ Object { ], "type": "TSTypeParameterInstantiation", }, + "typeName": Object { + "loc": Object { + "end": Object { + "column": 76, + "line": 1, + }, + "start": Object { + "column": 67, + "line": 1, + }, + }, + "name": "Lowercase", + "range": Array [ + 67, + 76, + ], + "type": "Identifier", + }, }, Object { "loc": Object { @@ -362,25 +362,7 @@ Object { 98, ], "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 95, - "line": 1, - }, - "start": Object { - "column": 85, - "line": 1, - }, - }, - "name": "Capitalize", - "range": Array [ - 85, - 95, - ], - "type": "Identifier", - }, - "typeParameters": Object { + "typeArguments": Object { "loc": Object { "end": Object { "column": 98, @@ -408,6 +390,7 @@ Object { 97, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -426,7 +409,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, ], "range": Array [ @@ -435,6 +417,24 @@ Object { ], "type": "TSTypeParameterInstantiation", }, + "typeName": Object { + "loc": Object { + "end": Object { + "column": 95, + "line": 1, + }, + "start": Object { + "column": 85, + "line": 1, + }, + }, + "name": "Capitalize", + "range": Array [ + 85, + 95, + ], + "type": "Identifier", + }, }, Object { "loc": Object { @@ -452,25 +452,7 @@ Object { 119, ], "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 116, - "line": 1, - }, - "start": Object { - "column": 104, - "line": 1, - }, - }, - "name": "Uncapitalize", - "range": Array [ - 104, - 116, - ], - "type": "Identifier", - }, - "typeParameters": Object { + "typeArguments": Object { "loc": Object { "end": Object { "column": 119, @@ -498,6 +480,7 @@ Object { 118, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -516,7 +499,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, ], "range": Array [ @@ -525,6 +507,24 @@ Object { ], "type": "TSTypeParameterInstantiation", }, + "typeName": Object { + "loc": Object { + "end": Object { + "column": 116, + "line": 1, + }, + "start": Object { + "column": 104, + "line": 1, + }, + }, + "name": "Uncapitalize", + "range": Array [ + 104, + 116, + ], + "type": "Identifier", + }, }, ], }, @@ -653,25 +653,7 @@ Object { 165, ], "type": "TSTypeReference", - "typeName": Object { - "loc": Object { - "end": Object { - "column": 33, - "line": 2, - }, - "start": Object { - "column": 13, - "line": 2, - }, - }, - "name": "EnthusiasticGreeting", - "range": Array [ - 136, - 156, - ], - "type": "Identifier", - }, - "typeParameters": Object { + "typeArguments": Object { "loc": Object { "end": Object { "column": 42, @@ -726,6 +708,24 @@ Object { ], "type": "TSTypeParameterInstantiation", }, + "typeName": Object { + "loc": Object { + "end": Object { + "column": 33, + "line": 2, + }, + "start": Object { + "column": 13, + "line": 2, + }, + }, + "name": "EnthusiasticGreeting", + "range": Array [ + 136, + 156, + ], + "type": "Identifier", + }, }, }, ], diff --git a/packages/typescript-estree/tests/snapshots/typescript/types/this-type-expanded.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/types/this-type-expanded.src.ts.shot index 5543bc1a3a0..df1458937b6 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/types/this-type-expanded.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/types/this-type-expanded.src.ts.shot @@ -515,6 +515,7 @@ Object { 117, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -533,7 +534,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, }, }, @@ -1240,6 +1240,7 @@ Object { 263, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -1258,7 +1259,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, }, }, @@ -1497,6 +1497,7 @@ Object { 353, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -1515,7 +1516,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, }, }, @@ -1736,6 +1736,7 @@ Object { 412, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -1754,7 +1755,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, }, }, diff --git a/packages/typescript-estree/tests/snapshots/typescript/types/type-operator.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/types/type-operator.src.ts.shot index 3b8b707334e..891294f42d9 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/types/type-operator.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/types/type-operator.src.ts.shot @@ -72,6 +72,7 @@ Object { 14, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -90,7 +91,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, }, }, diff --git a/packages/typescript-estree/tests/snapshots/typescript/types/typeof-this.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/types/typeof-this.src.ts.shot index c708076ab55..611ee570c90 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/types/typeof-this.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/types/typeof-this.src.ts.shot @@ -72,7 +72,7 @@ Object { 21, ], "type": "TSTypeQuery", - "typeParameters": undefined, + "typeArguments": undefined, }, }, }, @@ -215,7 +215,7 @@ Object { 47, ], "type": "TSTypeQuery", - "typeParameters": undefined, + "typeArguments": undefined, }, }, }, diff --git a/packages/typescript-estree/tests/snapshots/typescript/types/typeof-with-type-parameters.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/types/typeof-with-type-parameters.src.ts.shot index 4215d60c393..553ad089dd8 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/types/typeof-with-type-parameters.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/types/typeof-with-type-parameters.src.ts.shot @@ -108,7 +108,7 @@ Object { 20, ], "type": "TSTypeQuery", - "typeParameters": Object { + "typeArguments": Object { "loc": Object { "end": Object { "column": 20, @@ -136,6 +136,7 @@ Object { 19, ], "type": "TSTypeReference", + "typeArguments": undefined, "typeName": Object { "loc": Object { "end": Object { @@ -154,7 +155,6 @@ Object { ], "type": "Identifier", }, - "typeParameters": undefined, }, ], "range": Array [ diff --git a/packages/typescript-estree/tests/snapshots/typescript/types/typeof.src.ts.shot b/packages/typescript-estree/tests/snapshots/typescript/types/typeof.src.ts.shot index 43036c5b34a..238f4a5b8db 100644 --- a/packages/typescript-estree/tests/snapshots/typescript/types/typeof.src.ts.shot +++ b/packages/typescript-estree/tests/snapshots/typescript/types/typeof.src.ts.shot @@ -108,7 +108,7 @@ Object { 17, ], "type": "TSTypeQuery", - "typeParameters": undefined, + "typeArguments": undefined, }, }, }, diff --git a/packages/typescript-estree/tools/test-utils.ts b/packages/typescript-estree/tools/test-utils.ts index 65e1cb131e1..aef5601ebe2 100644 --- a/packages/typescript-estree/tools/test-utils.ts +++ b/packages/typescript-estree/tools/test-utils.ts @@ -1,9 +1,15 @@ +import { join, resolve } from 'path'; + import type { + ParseAndGenerateServicesResult, TSESTree, TSESTreeOptions, - ParseAndGenerateServicesResult, } from '../src'; -import { parse as parserParse, parseAndGenerateServices } from '../src'; +import { + clearCaches, + parse as parserParse, + parseAndGenerateServices, +} from '../src'; export function parseCodeAndGenerateServices( code: string, @@ -86,7 +92,7 @@ type UnknownObject = Record; function isObjectLike(value: unknown | null): value is UnknownObject { return ( - typeof value === 'object' && !(value instanceof RegExp) && value !== null + typeof value === 'object' && !(value instanceof RegExp) && value != null ); } @@ -153,3 +159,41 @@ export function omitDeep( return visit(root as UnknownObject, null); } + +interface CreateAndPrepareParseConfig { + code: string; + config: TSESTreeOptions; + projectDirectory: string; +} + +const FIXTURES_DIR = join(__dirname, '../tests/fixtures/simpleProject'); + +export function createAndPrepareParseConfig(): CreateAndPrepareParseConfig { + beforeEach(() => { + clearCaches(); + }); + + const projectDirectory = resolve(FIXTURES_DIR, '../moduleResolver'); + + const code = ` + import { something } from '__PLACEHOLDER__'; + + something(); + `; + + const config: TSESTreeOptions = { + comment: true, + filePath: resolve(projectDirectory, 'file.ts'), + loc: true, + project: './tsconfig.json', + range: true, + tokens: true, + tsconfigRootDir: projectDirectory, + }; + + return { + code, + config, + projectDirectory, + }; +} diff --git a/packages/typescript-estree/tools/tserror-serializer.ts b/packages/typescript-estree/tools/tserror-serializer.ts index b56ed97e837..dc6cfd1771c 100644 --- a/packages/typescript-estree/tools/tserror-serializer.ts +++ b/packages/typescript-estree/tools/tserror-serializer.ts @@ -1,6 +1,7 @@ -import { TSError } from '../src/node-utils'; import type { Plugin } from 'pretty-format'; +import { TSError } from '../src/node-utils'; + export const serializer: Plugin = { test: (val: unknown): val is TSError => val instanceof TSError, serialize(val: TSError, config, indentation, depth, refs, printer) { diff --git a/packages/utils/CHANGELOG.md b/packages/utils/CHANGELOG.md index daa12050bc3..ec49364f3e7 100644 --- a/packages/utils/CHANGELOG.md +++ b/packages/utils/CHANGELOG.md @@ -3,7 +3,7 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. -# [5.31.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.7...v5.31.0) (2022-07-25) +# [5.50.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.49.0...v5.50.0) (2023-01-31) **Note:** Version bump only for package @typescript-eslint/utils @@ -11,7 +11,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline -## [5.30.7](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.6...v5.30.7) (2022-07-18) +# [5.49.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.48.2...v5.49.0) (2023-01-23) **Note:** Version bump only for package @typescript-eslint/utils @@ -19,7 +19,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline -## [5.30.6](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.5...v5.30.6) (2022-07-11) +## [5.48.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.48.1...v5.48.2) (2023-01-16) **Note:** Version bump only for package @typescript-eslint/utils @@ -27,7 +27,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline -## [5.30.5](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.4...v5.30.5) (2022-07-04) +## [5.48.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.48.0...v5.48.1) (2023-01-09) **Note:** Version bump only for package @typescript-eslint/utils @@ -35,256 +35,270 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline -## [5.30.4](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.3...v5.30.4) (2022-07-03) +# [5.48.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.47.1...v5.48.0) (2023-01-02) **Note:** Version bump only for package @typescript-eslint/utils +## [5.47.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.47.0...v5.47.1) (2022-12-26) +**Note:** Version bump only for package @typescript-eslint/utils +# [5.47.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.46.1...v5.47.0) (2022-12-19) +**Note:** Version bump only for package @typescript-eslint/utils -## [5.30.3](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.2...v5.30.3) (2022-07-01) +## [5.46.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.46.0...v5.46.1) (2022-12-12) **Note:** Version bump only for package @typescript-eslint/utils +# [5.46.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.45.1...v5.46.0) (2022-12-08) +**Note:** Version bump only for package @typescript-eslint/utils +## [5.45.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.45.0...v5.45.1) (2022-12-05) +**Note:** Version bump only for package @typescript-eslint/utils -## [5.30.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.1...v5.30.2) (2022-07-01) +# [5.45.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.44.0...v5.45.0) (2022-11-28) **Note:** Version bump only for package @typescript-eslint/utils +# [5.44.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.43.0...v5.44.0) (2022-11-21) +**Note:** Version bump only for package @typescript-eslint/utils +# [5.43.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.42.1...v5.43.0) (2022-11-14) +**Note:** Version bump only for package @typescript-eslint/utils -## 5.30.1 (2022-07-01) +## [5.42.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.42.0...v5.42.1) (2022-11-07) **Note:** Version bump only for package @typescript-eslint/utils +# [5.42.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.41.0...v5.42.0) (2022-10-31) +### Features +- **utils:** add `RuleTester` API for top-level dependency constraints ([#5896](https://github.com/typescript-eslint/typescript-eslint/issues/5896)) ([0520d53](https://github.com/typescript-eslint/typescript-eslint/commit/0520d53536af411d66ce2ce0dd478365e67adbac)) - -# [5.30.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.29.0...v5.30.0) (2022-06-27) +# [5.41.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.40.1...v5.41.0) (2022-10-24) **Note:** Version bump only for package @typescript-eslint/utils +## [5.40.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.40.0...v5.40.1) (2022-10-17) +### Bug Fixes +- **utils:** add missing dependency on `@types/semver` ([#5825](https://github.com/typescript-eslint/typescript-eslint/issues/5825)) ([17b8879](https://github.com/typescript-eslint/typescript-eslint/commit/17b887933a0640d6fe843622e0520c0315144bb7)) +# [5.40.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.39.0...v5.40.0) (2022-10-10) -# [5.29.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.28.0...v5.29.0) (2022-06-20) +### Features -**Note:** Version bump only for package @typescript-eslint/utils +- **utils:** add dependency constraint filtering for `RuleTester` ([#5750](https://github.com/typescript-eslint/typescript-eslint/issues/5750)) ([121f4c0](https://github.com/typescript-eslint/typescript-eslint/commit/121f4c0e7252def95d917e4734e933e53e29d501)) +# [5.39.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.38.1...v5.39.0) (2022-10-03) +**Note:** Version bump only for package @typescript-eslint/utils +## [5.38.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.38.0...v5.38.1) (2022-09-26) +**Note:** Version bump only for package @typescript-eslint/utils -# [5.28.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.27.1...v5.28.0) (2022-06-13) +# [5.38.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.37.0...v5.38.0) (2022-09-19) +**Note:** Version bump only for package @typescript-eslint/utils -### Features +# [5.37.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.36.2...v5.37.0) (2022-09-12) -* **eslint-plugin:** [consistent-generic-constructors] add rule ([#4924](https://github.com/typescript-eslint/typescript-eslint/issues/4924)) ([921cdf1](https://github.com/typescript-eslint/typescript-eslint/commit/921cdf17e548845311d0591249616ec844503926)) +**Note:** Version bump only for package @typescript-eslint/utils +## [5.36.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.36.1...v5.36.2) (2022-09-05) +**Note:** Version bump only for package @typescript-eslint/utils +## [5.36.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.36.0...v5.36.1) (2022-08-30) +**Note:** Version bump only for package @typescript-eslint/utils -## [5.27.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.27.0...v5.27.1) (2022-06-06) +# [5.36.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.35.1...v5.36.0) (2022-08-30) -**Note:** Version bump only for package @typescript-eslint/utils +### Features +- support TypeScript 4.8 ([#5551](https://github.com/typescript-eslint/typescript-eslint/issues/5551)) ([81450ed](https://github.com/typescript-eslint/typescript-eslint/commit/81450ed7eaede74b384e9a91a84e9b4d34513866)) +## [5.35.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.35.0...v5.35.1) (2022-08-24) +**Note:** Version bump only for package @typescript-eslint/utils +# [5.35.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.34.0...v5.35.0) (2022-08-24) -# [5.27.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.26.0...v5.27.0) (2022-05-30) +**Note:** Version bump only for package @typescript-eslint/utils +# [5.34.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.33.1...v5.34.0) (2022-08-22) ### Features -* [4.7] support new extensions ([#5027](https://github.com/typescript-eslint/typescript-eslint/issues/5027)) ([efc147b](https://github.com/typescript-eslint/typescript-eslint/commit/efc147b04dce52ab17415b6a4ae4076b944b9036)) +- **eslint-plugin:** [prefer-optional-chain] support suggesting `!foo || !foo.bar` as a valid match for the rule ([#5266](https://github.com/typescript-eslint/typescript-eslint/issues/5266)) ([aca935c](https://github.com/typescript-eslint/typescript-eslint/commit/aca935c9696712d4aff18144c4690db4d6ba9bf9)) +## [5.33.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.33.0...v5.33.1) (2022-08-15) +**Note:** Version bump only for package @typescript-eslint/utils +# [5.33.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.32.0...v5.33.0) (2022-08-08) +**Note:** Version bump only for package @typescript-eslint/utils -# [5.26.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.25.0...v5.26.0) (2022-05-23) +# [5.32.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.31.0...v5.32.0) (2022-08-01) **Note:** Version bump only for package @typescript-eslint/utils +# [5.31.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.7...v5.31.0) (2022-07-25) +**Note:** Version bump only for package @typescript-eslint/utils +## [5.30.7](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.6...v5.30.7) (2022-07-18) +**Note:** Version bump only for package @typescript-eslint/utils -# [5.25.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.24.0...v5.25.0) (2022-05-17) - +## [5.30.6](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.5...v5.30.6) (2022-07-11) -### Features +**Note:** Version bump only for package @typescript-eslint/utils -* update to TypeScript 4.7-rc ([#4829](https://github.com/typescript-eslint/typescript-eslint/issues/4829)) ([6fe783c](https://github.com/typescript-eslint/typescript-eslint/commit/6fe783c20aebe26ef42b526e4a59a9be84dd5643)) +## [5.30.5](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.4...v5.30.5) (2022-07-04) +**Note:** Version bump only for package @typescript-eslint/utils +## [5.30.4](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.3...v5.30.4) (2022-07-03) +**Note:** Version bump only for package @typescript-eslint/utils +## [5.30.3](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.2...v5.30.3) (2022-07-01) -# [5.24.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.23.0...v5.24.0) (2022-05-16) +**Note:** Version bump only for package @typescript-eslint/utils +## [5.30.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.1...v5.30.2) (2022-07-01) -### Features +**Note:** Version bump only for package @typescript-eslint/utils -* **eslint-plugin:** add new 'strict' config ([#4706](https://github.com/typescript-eslint/typescript-eslint/issues/4706)) ([4a500b2](https://github.com/typescript-eslint/typescript-eslint/commit/4a500b2d92a91873dbb729793d1ee1c36ef06ed8)) +## 5.30.1 (2022-07-01) +**Note:** Version bump only for package @typescript-eslint/utils +# [5.30.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.29.0...v5.30.0) (2022-06-27) +**Note:** Version bump only for package @typescript-eslint/utils +# [5.29.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.28.0...v5.29.0) (2022-06-20) -# [5.23.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.22.0...v5.23.0) (2022-05-09) +**Note:** Version bump only for package @typescript-eslint/utils +# [5.28.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.27.1...v5.28.0) (2022-06-13) ### Features -* **utils:** update eslint types ([#4896](https://github.com/typescript-eslint/typescript-eslint/issues/4896)) ([da48527](https://github.com/typescript-eslint/typescript-eslint/commit/da485279f13cb95db1ee131a4f9c5367d54020fe)) +- **eslint-plugin:** [consistent-generic-constructors] add rule ([#4924](https://github.com/typescript-eslint/typescript-eslint/issues/4924)) ([921cdf1](https://github.com/typescript-eslint/typescript-eslint/commit/921cdf17e548845311d0591249616ec844503926)) +## [5.27.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.27.0...v5.27.1) (2022-06-06) + +**Note:** Version bump only for package @typescript-eslint/utils +# [5.27.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.26.0...v5.27.0) (2022-05-30) +### Features +- [4.7] support new extensions ([#5027](https://github.com/typescript-eslint/typescript-eslint/issues/5027)) ([efc147b](https://github.com/typescript-eslint/typescript-eslint/commit/efc147b04dce52ab17415b6a4ae4076b944b9036)) -# [5.22.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.21.0...v5.22.0) (2022-05-02) +# [5.26.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.25.0...v5.26.0) (2022-05-23) **Note:** Version bump only for package @typescript-eslint/utils +# [5.25.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.24.0...v5.25.0) (2022-05-17) +### Features +- update to TypeScript 4.7-rc ([#4829](https://github.com/typescript-eslint/typescript-eslint/issues/4829)) ([6fe783c](https://github.com/typescript-eslint/typescript-eslint/commit/6fe783c20aebe26ef42b526e4a59a9be84dd5643)) +# [5.24.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.23.0...v5.24.0) (2022-05-16) -# [5.21.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.20.0...v5.21.0) (2022-04-25) - -**Note:** Version bump only for package @typescript-eslint/utils +### Features +- **eslint-plugin:** add new 'strict' config ([#4706](https://github.com/typescript-eslint/typescript-eslint/issues/4706)) ([4a500b2](https://github.com/typescript-eslint/typescript-eslint/commit/4a500b2d92a91873dbb729793d1ee1c36ef06ed8)) +# [5.23.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.22.0...v5.23.0) (2022-05-09) +### Features +- **utils:** update eslint types ([#4896](https://github.com/typescript-eslint/typescript-eslint/issues/4896)) ([da48527](https://github.com/typescript-eslint/typescript-eslint/commit/da485279f13cb95db1ee131a4f9c5367d54020fe)) -# [5.20.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.19.0...v5.20.0) (2022-04-18) +# [5.22.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.21.0...v5.22.0) (2022-05-02) **Note:** Version bump only for package @typescript-eslint/utils +# [5.21.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.20.0...v5.21.0) (2022-04-25) +**Note:** Version bump only for package @typescript-eslint/utils +# [5.20.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.19.0...v5.20.0) (2022-04-18) +**Note:** Version bump only for package @typescript-eslint/utils # [5.19.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.18.0...v5.19.0) (2022-04-11) **Note:** Version bump only for package @typescript-eslint/utils - - - - # [5.18.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.17.0...v5.18.0) (2022-04-04) **Note:** Version bump only for package @typescript-eslint/utils - - - - # [5.17.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.16.0...v5.17.0) (2022-03-28) **Note:** Version bump only for package @typescript-eslint/utils - - - - # [5.16.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.15.0...v5.16.0) (2022-03-21) - ### Bug Fixes -* **utils:** RuleTester: Only call afterAll if defined ([#4656](https://github.com/typescript-eslint/typescript-eslint/issues/4656)) ([0fe0683](https://github.com/typescript-eslint/typescript-eslint/commit/0fe0683effe4c7390806a72c6aa7795445a67929)) - - - - +- **utils:** RuleTester: Only call afterAll if defined ([#4656](https://github.com/typescript-eslint/typescript-eslint/issues/4656)) ([0fe0683](https://github.com/typescript-eslint/typescript-eslint/commit/0fe0683effe4c7390806a72c6aa7795445a67929)) # [5.15.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.14.0...v5.15.0) (2022-03-14) **Note:** Version bump only for package @typescript-eslint/utils - - - - # [5.14.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.13.0...v5.14.0) (2022-03-07) **Note:** Version bump only for package @typescript-eslint/utils - - - - # [5.13.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.12.1...v5.13.0) (2022-02-28) - ### Features -* **eslint-plugin:** add extension rule `space-before-blocks` ([#1606](https://github.com/typescript-eslint/typescript-eslint/issues/1606)) ([#4184](https://github.com/typescript-eslint/typescript-eslint/issues/4184)) ([208b6d0](https://github.com/typescript-eslint/typescript-eslint/commit/208b6d02252dff2bf272329d3e4a4a82e56c52c0)) -* **utils:** expose `ast-utils`' helpers ([#4503](https://github.com/typescript-eslint/typescript-eslint/issues/4503)) ([f106e4b](https://github.com/typescript-eslint/typescript-eslint/commit/f106e4b95e824ebb68141bce3d3207448d50c860)) -* **utils:** extract `isNotTokenOfTypeWithConditions` out of `ast-utils`' `predicates` ([#4502](https://github.com/typescript-eslint/typescript-eslint/issues/4502)) ([66501d6](https://github.com/typescript-eslint/typescript-eslint/commit/66501d6dd7e97c22c671efaa6d1ba8237907e417)) - - - - +- **eslint-plugin:** add extension rule `space-before-blocks` ([#1606](https://github.com/typescript-eslint/typescript-eslint/issues/1606)) ([#4184](https://github.com/typescript-eslint/typescript-eslint/issues/4184)) ([208b6d0](https://github.com/typescript-eslint/typescript-eslint/commit/208b6d02252dff2bf272329d3e4a4a82e56c52c0)) +- **utils:** expose `ast-utils`' helpers ([#4503](https://github.com/typescript-eslint/typescript-eslint/issues/4503)) ([f106e4b](https://github.com/typescript-eslint/typescript-eslint/commit/f106e4b95e824ebb68141bce3d3207448d50c860)) +- **utils:** extract `isNotTokenOfTypeWithConditions` out of `ast-utils`' `predicates` ([#4502](https://github.com/typescript-eslint/typescript-eslint/issues/4502)) ([66501d6](https://github.com/typescript-eslint/typescript-eslint/commit/66501d6dd7e97c22c671efaa6d1ba8237907e417)) ## [5.12.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.12.0...v5.12.1) (2022-02-21) **Note:** Version bump only for package @typescript-eslint/utils - - - - # [5.12.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.11.0...v5.12.0) (2022-02-14) **Note:** Version bump only for package @typescript-eslint/utils - - - - # [5.11.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.10.2...v5.11.0) (2022-02-07) **Note:** Version bump only for package @typescript-eslint/utils - - - - ## [5.10.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.10.1...v5.10.2) (2022-01-31) **Note:** Version bump only for package @typescript-eslint/utils - - - - ## [5.10.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.10.0...v5.10.1) (2022-01-24) **Note:** Version bump only for package @typescript-eslint/utils - - - - # [5.10.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.9.1...v5.10.0) (2022-01-17) - ### Features -* rename `experimental-utils` to `utils` and make `experimental-utils` an alias to the new package ([#4172](https://github.com/typescript-eslint/typescript-eslint/issues/4172)) ([1d55a75](https://github.com/typescript-eslint/typescript-eslint/commit/1d55a7511b38d8e2b2eabe59f639e0a865e6c93f)) +- rename `experimental-utils` to `utils` and make `experimental-utils` an alias to the new package ([#4172](https://github.com/typescript-eslint/typescript-eslint/issues/4172)) ([1d55a75](https://github.com/typescript-eslint/typescript-eslint/commit/1d55a7511b38d8e2b2eabe59f639e0a865e6c93f)) diff --git a/packages/utils/LICENSE b/packages/utils/LICENSE index 7e7370143b2..a1164108d4d 100644 --- a/packages/utils/LICENSE +++ b/packages/utils/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2019 TypeScript ESLint and other contributors +Copyright (c) 2019 typescript-eslint and other contributors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/packages/utils/README.md b/packages/utils/README.md index d517cc457a5..8013675d962 100644 --- a/packages/utils/README.md +++ b/packages/utils/README.md @@ -1,27 +1,10 @@ -

Utils for ESLint Plugins

+# `@typescript-eslint/utils` -

Utilities for working with TypeScript + ESLint together.

+> Utilities for working with TypeScript + ESLint together. -

- CI - NPM Version - NPM Downloads -

+[![NPM Version](https://img.shields.io/npm/v/@typescript-eslint/utils.svg?style=flat-square)](https://www.npmjs.com/package/@typescript-eslint/utils) +[![NPM Downloads](https://img.shields.io/npm/dm/@typescript-eslint/utils.svg?style=flat-square)](https://www.npmjs.com/package/@typescript-eslint/utils) -## Exports +👉 See **https://typescript-eslint.io/architecture/utils** for documentation on this package. -| Name | Description | -| -------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| [`ASTUtils`](./src/ast-utils) | Tools for operating on the ESTree AST. Also includes the [`eslint-utils`](https://www.npmjs.com/package/eslint-utils) package, correctly typed to work with the types found in `TSESTree` | -| [`ESLintUtils`](./src/eslint-utils) | Tools for creating ESLint rules with TypeScript. | -| `JSONSchema` | Types from the [`@types/json-schema`](https://www.npmjs.com/package/@types/json-schema) package, re-exported to save you having to manually import them. Also ensures you're using the same version of the types as this package. | -| [`TSESLint`](./src/ts-eslint) | Types for ESLint, correctly typed to work with the types found in `TSESTree`. | -| [`TSESLintScope`](./src/ts-eslint-scope) | The [`eslint-scope`](https://www.npmjs.com/package/eslint-scope) package, correctly typed to work with the types found in both `TSESTree` and `TSESLint` | -| [`TSESTree`](../types/src/ts-estree.ts) | Types for the TypeScript flavor of ESTree created by `@typescript-eslint/typescript-estree`. | -| [`AST_NODE_TYPES`](../types/src/ast-node-types.ts) | An enum with the names of every single _node_ found in `TSESTree`. | -| [`AST_TOKEN_TYPES`](../types/src/ast-token-types.ts) | An enum with the names of every single _token_ found in `TSESTree`. | -| [`ParserServices`](../typescript-estree/src/parser-options.ts) | Typing for the parser services provided when parsing a file using `@typescript-eslint/typescript-estree`. | - -## Contributing - -[See the contributing guide here](../../CONTRIBUTING.md) +> See https://typescript-eslint.io for general documentation on typescript-eslint, the tooling that allows you to run ESLint and Prettier on TypeScript code. diff --git a/packages/utils/package.json b/packages/utils/package.json index c0507bc0e84..13e83257c67 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/utils", - "version": "5.31.0", + "version": "5.50.0", "description": "Utilities for working with TypeScript + ESLint together", "keywords": [ "eslint", @@ -34,22 +34,25 @@ "clean": "tsc -b tsconfig.build.json --clean", "postclean": "rimraf dist && rimraf _ts3.4 && rimraf coverage", "format": "prettier --write \"./**/*.{ts,mts,cts,tsx,js,mjs,cjs,jsx,json,md,css}\" --ignore-path ../../.prettierignore", - "lint": "eslint . --ignore-path='../../.eslintignore'", + "lint": "nx lint", "test": "jest --coverage", "typecheck": "tsc -p tsconfig.json --noEmit" }, "dependencies": { "@types/json-schema": "^7.0.9", - "@typescript-eslint/scope-manager": "5.31.0", - "@typescript-eslint/types": "5.31.0", - "@typescript-eslint/typescript-estree": "5.31.0", + "@types/semver": "^7.3.12", + "@typescript-eslint/scope-manager": "5.50.0", + "@typescript-eslint/types": "5.50.0", + "@typescript-eslint/typescript-estree": "5.50.0", "eslint-scope": "^5.1.1", - "eslint-utils": "^3.0.0" + "eslint-utils": "^3.0.0", + "semver": "^7.3.7" }, "peerDependencies": { "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" }, "devDependencies": { + "@typescript-eslint/parser": "5.50.0", "typescript": "*" }, "funding": { diff --git a/packages/utils/project.json b/packages/utils/project.json index b55a371ba33..c38b32ab3a2 100644 --- a/packages/utils/project.json +++ b/packages/utils/project.json @@ -1,5 +1,15 @@ { - "root": "packages/utils", + "name": "utils", + "$schema": "../../node_modules/nx/schemas/project-schema.json", "type": "library", - "implicitDependencies": [] + "implicitDependencies": [], + "targets": { + "lint": { + "executor": "@nrwl/linter:eslint", + "outputs": ["{options.outputFile}"], + "options": { + "lintFilePatterns": ["packages/utils/**/*.ts"] + } + } + } } diff --git a/packages/utils/src/ast-utils/eslint-utils/ReferenceTracker.ts b/packages/utils/src/ast-utils/eslint-utils/ReferenceTracker.ts index a8d1acb3ca9..893c16ffc0c 100644 --- a/packages/utils/src/ast-utils/eslint-utils/ReferenceTracker.ts +++ b/packages/utils/src/ast-utils/eslint-utils/ReferenceTracker.ts @@ -1,7 +1,8 @@ /* eslint-disable @typescript-eslint/no-namespace */ import * as eslintUtils from 'eslint-utils'; -import { TSESTree } from '../../ts-estree'; -import * as TSESLint from '../../ts-eslint'; + +import type * as TSESLint from '../../ts-eslint'; +import type { TSESTree } from '../../ts-estree'; const ReferenceTrackerREAD: unique symbol = eslintUtils.ReferenceTracker.READ; const ReferenceTrackerCALL: unique symbol = eslintUtils.ReferenceTracker.CALL; diff --git a/packages/utils/src/ast-utils/eslint-utils/astUtilities.ts b/packages/utils/src/ast-utils/eslint-utils/astUtilities.ts index 69f6d5e0190..6410d0b49de 100644 --- a/packages/utils/src/ast-utils/eslint-utils/astUtilities.ts +++ b/packages/utils/src/ast-utils/eslint-utils/astUtilities.ts @@ -1,6 +1,7 @@ import * as eslintUtils from 'eslint-utils'; -import * as TSESLint from '../../ts-eslint'; -import { TSESTree } from '../../ts-estree'; + +import type * as TSESLint from '../../ts-eslint'; +import type { TSESTree } from '../../ts-estree'; /** * Get the proper location of a given function node to report. diff --git a/packages/utils/src/ast-utils/eslint-utils/predicates.ts b/packages/utils/src/ast-utils/eslint-utils/predicates.ts index ad89e4730fc..9d1534882d1 100644 --- a/packages/utils/src/ast-utils/eslint-utils/predicates.ts +++ b/packages/utils/src/ast-utils/eslint-utils/predicates.ts @@ -1,5 +1,6 @@ import * as eslintUtils from 'eslint-utils'; -import { TSESTree } from '../../ts-estree'; + +import type { TSESTree } from '../../ts-estree'; type IsSpecificTokenFunction = ( token: TSESTree.Token, diff --git a/packages/utils/src/ast-utils/eslint-utils/scopeAnalysis.ts b/packages/utils/src/ast-utils/eslint-utils/scopeAnalysis.ts index fa3efc70a77..61ab8e33a41 100644 --- a/packages/utils/src/ast-utils/eslint-utils/scopeAnalysis.ts +++ b/packages/utils/src/ast-utils/eslint-utils/scopeAnalysis.ts @@ -1,6 +1,7 @@ import * as eslintUtils from 'eslint-utils'; -import { TSESTree } from '../../ts-estree'; -import * as TSESLint from '../../ts-eslint'; + +import type * as TSESLint from '../../ts-eslint'; +import type { TSESTree } from '../../ts-estree'; /** * Get the variable of a given name. diff --git a/packages/utils/src/ast-utils/helpers.ts b/packages/utils/src/ast-utils/helpers.ts index fa2b8bb9f5c..64e7e796eed 100644 --- a/packages/utils/src/ast-utils/helpers.ts +++ b/packages/utils/src/ast-utils/helpers.ts @@ -1,75 +1,74 @@ -import { AST_NODE_TYPES, AST_TOKEN_TYPES, TSESTree } from '../ts-estree'; +import type { AST_NODE_TYPES, AST_TOKEN_TYPES, TSESTree } from '../ts-estree'; -type ObjectEntry = [keyof BaseType, BaseType[keyof BaseType]]; +type ObjectEntry = BaseType extends unknown + ? [keyof BaseType, BaseType[keyof BaseType]] + : never; type ObjectEntries = Array>; export const isNodeOfType = (nodeType: NodeType) => ( node: TSESTree.Node | null | undefined, - ): node is TSESTree.Node & { type: NodeType } => + ): node is Extract => node?.type === nodeType; export const isNodeOfTypes = (nodeTypes: NodeTypes) => ( node: TSESTree.Node | null | undefined, - ): node is TSESTree.Node & { type: NodeTypes[number] } => + ): node is Extract => !!node && nodeTypes.includes(node.type); export const isNodeOfTypeWithConditions = < NodeType extends AST_NODE_TYPES, - Conditions extends Partial, + ExtractedNode extends Extract, + Conditions extends Partial, >( nodeType: NodeType, conditions: Conditions, ): (( node: TSESTree.Node | null | undefined, -) => node is TSESTree.Node & { type: NodeType } & Conditions) => { +) => node is ExtractedNode & Conditions) => { const entries = Object.entries(conditions) as ObjectEntries; return ( node: TSESTree.Node | null | undefined, - ): node is TSESTree.Node & { type: NodeType } & Conditions => + ): node is ExtractedNode & Conditions => node?.type === nodeType && - entries.every(([key, value]) => node[key] === value); + entries.every(([key, value]) => node[key as keyof TSESTree.Node] === value); }; export const isTokenOfTypeWithConditions = < TokenType extends AST_TOKEN_TYPES, + ExtractedToken extends Extract, Conditions extends Partial, >( tokenType: TokenType, conditions: Conditions, ): (( token: TSESTree.Token | null | undefined, -) => token is TSESTree.Token & { type: TokenType } & Conditions) => { +) => token is ExtractedToken & Conditions) => { const entries = Object.entries(conditions) as ObjectEntries; return ( token: TSESTree.Token | null | undefined, - ): token is TSESTree.Token & { type: TokenType } & Conditions => + ): token is ExtractedToken & Conditions => token?.type === tokenType && - entries.every(([key, value]) => token[key] === value); + entries.every( + ([key, value]) => token[key as keyof TSESTree.Token] === value, + ); }; export const isNotTokenOfTypeWithConditions = < TokenType extends AST_TOKEN_TYPES, - Conditions extends Partial, + ExtractedToken extends Extract, + Conditions extends Partial, >( tokenType: TokenType, conditions: Conditions, ): (( token: TSESTree.Token | null | undefined, - ) => token is Exclude< - TSESTree.Token, - TSESTree.Token & { type: TokenType } & Conditions - >) => - ( - token, - ): token is Exclude< - TSESTree.Token, - TSESTree.Token & { type: TokenType } & Conditions - > => + ) => token is Exclude) => + (token): token is Exclude => !isTokenOfTypeWithConditions(tokenType, conditions)(token); diff --git a/packages/utils/src/ast-utils/misc.ts b/packages/utils/src/ast-utils/misc.ts index 72a7898c31c..df59075db96 100644 --- a/packages/utils/src/ast-utils/misc.ts +++ b/packages/utils/src/ast-utils/misc.ts @@ -1,4 +1,4 @@ -import { TSESTree } from '../ts-estree'; +import type { TSESTree } from '../ts-estree'; const LINEBREAK_MATCHER = /\r\n|[\r\n\u2028\u2029]/; diff --git a/packages/utils/src/ast-utils/predicates.ts b/packages/utils/src/ast-utils/predicates.ts index 10e50522d67..36e08ee5c42 100644 --- a/packages/utils/src/ast-utils/predicates.ts +++ b/packages/utils/src/ast-utils/predicates.ts @@ -1,5 +1,5 @@ -import { AST_NODE_TYPES, AST_TOKEN_TYPES, TSESTree } from '../ts-estree'; - +import type { TSESTree } from '../ts-estree'; +import { AST_NODE_TYPES, AST_TOKEN_TYPES } from '../ts-estree'; import { isNodeOfType, isNodeOfTypes, @@ -139,6 +139,20 @@ const isAwaitKeyword = isTokenOfTypeWithConditions(AST_TOKEN_TYPES.Identifier, { value: 'await', }); +/** + * Checks if a possible token is the `type` keyword. + */ +const isTypeKeyword = isTokenOfTypeWithConditions(AST_TOKEN_TYPES.Identifier, { + value: 'type', +}); + +/** + * Checks if a possible token is the `import` keyword. + */ +const isImportKeyword = isTokenOfTypeWithConditions(AST_TOKEN_TYPES.Keyword, { + value: 'import', +}); + const isLoop = isNodeOfTypes([ AST_NODE_TYPES.DoWhileStatement, AST_NODE_TYPES.ForStatement, @@ -156,6 +170,7 @@ export { isFunctionOrFunctionType, isFunctionType, isIdentifier, + isImportKeyword, isLoop, isLogicalOrOperator, isNonNullAssertionPunctuator, @@ -167,5 +182,6 @@ export { isTSConstructorType, isTSFunctionType, isTypeAssertion, + isTypeKeyword, isVariableDeclarator, }; diff --git a/packages/utils/src/eslint-utils/InferTypesFromRule.ts b/packages/utils/src/eslint-utils/InferTypesFromRule.ts index 1fd2e752baa..bcb80ec7e48 100644 --- a/packages/utils/src/eslint-utils/InferTypesFromRule.ts +++ b/packages/utils/src/eslint-utils/InferTypesFromRule.ts @@ -1,4 +1,4 @@ -import { RuleCreateFunction, RuleModule } from '../ts-eslint'; +import type { RuleCreateFunction, RuleModule } from '../ts-eslint'; /** * Uses type inference to fetch the TOptions type from the given RuleModule diff --git a/packages/utils/src/eslint-utils/RuleCreator.ts b/packages/utils/src/eslint-utils/RuleCreator.ts index 2bd24323e78..dedf3043121 100644 --- a/packages/utils/src/eslint-utils/RuleCreator.ts +++ b/packages/utils/src/eslint-utils/RuleCreator.ts @@ -1,8 +1,8 @@ -import { +import type { + RuleContext, + RuleListener, RuleMetaData, RuleMetaDataDocs, - RuleListener, - RuleContext, RuleModule, } from '../ts-eslint/Rule'; import { applyDefault } from './applyDefault'; @@ -95,13 +95,14 @@ function createRule< TRuleListener > { return { - meta, create( context: Readonly>, ): TRuleListener { const optionsWithDefault = applyDefault(defaultOptions, context.options); return create(context, optionsWithDefault); }, + defaultOptions, + meta, }; } diff --git a/packages/utils/src/eslint-utils/RuleTester.ts b/packages/utils/src/eslint-utils/RuleTester.ts deleted file mode 100644 index d0c0ada27bc..00000000000 --- a/packages/utils/src/eslint-utils/RuleTester.ts +++ /dev/null @@ -1,129 +0,0 @@ -import * as path from 'path'; -import * as TSESLint from '../ts-eslint'; - -const parser = '@typescript-eslint/parser'; - -type RuleTesterConfig = Omit & { - parser: typeof parser; -}; - -class RuleTester extends TSESLint.RuleTester { - readonly #options: RuleTesterConfig; - - // as of eslint 6 you have to provide an absolute path to the parser - // but that's not as clean to type, this saves us trying to manually enforce - // that contributors require.resolve everything - constructor(options: RuleTesterConfig) { - super({ - ...options, - parserOptions: { - ...options.parserOptions, - warnOnUnsupportedTypeScriptVersion: - options.parserOptions?.warnOnUnsupportedTypeScriptVersion ?? false, - }, - parser: require.resolve(options.parser), - }); - - this.#options = options; - - // make sure that the parser doesn't hold onto file handles between tests - // on linux (i.e. our CI env), there can be very a limited number of watch handles available - if (typeof afterAll !== 'undefined') { - afterAll(() => { - try { - // instead of creating a hard dependency, just use a soft require - // a bit weird, but if they're using this tooling, it'll be installed - // eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access - require(parser).clearCaches(); - } catch { - // ignored - } - }); - } - } - private getFilename(options?: TSESLint.ParserOptions): string { - if (options) { - const filename = `file.ts${options.ecmaFeatures?.jsx ? 'x' : ''}`; - if (options.project) { - return path.join( - options.tsconfigRootDir != null - ? options.tsconfigRootDir - : process.cwd(), - filename, - ); - } - - return filename; - } else if (this.#options.parserOptions) { - return this.getFilename(this.#options.parserOptions); - } - - return 'file.ts'; - } - - // as of eslint 6 you have to provide an absolute path to the parser - // If you don't do that at the test level, the test will fail somewhat cryptically... - // This is a lot more explicit - run>( - name: string, - rule: TSESLint.RuleModule, - testsReadonly: TSESLint.RunTests, - ): void { - const errorMessage = `Do not set the parser at the test level unless you want to use a parser other than ${parser}`; - - const tests = { ...testsReadonly }; - - // standardize the valid tests as objects - tests.valid = tests.valid.map(test => { - if (typeof test === 'string') { - return { - code: test, - }; - } - return test; - }); - - tests.valid = tests.valid.map(test => { - if (typeof test !== 'string') { - if (test.parser === parser) { - throw new Error(errorMessage); - } - if (!test.filename) { - return { - ...test, - filename: this.getFilename(test.parserOptions), - }; - } - } - return test; - }); - tests.invalid = tests.invalid.map(test => { - if (test.parser === parser) { - throw new Error(errorMessage); - } - if (!test.filename) { - return { - ...test, - filename: this.getFilename(test.parserOptions), - }; - } - return test; - }); - - super.run(name, rule, tests); - } -} - -/** - * Simple no-op tag to mark code samples as "should not format with prettier" - * for the internal/plugin-test-formatting lint rule - */ -function noFormat(strings: TemplateStringsArray, ...keys: string[]): string { - const lastIndex = strings.length - 1; - return ( - strings.slice(0, lastIndex).reduce((p, s, i) => p + s + keys[i], '') + - strings[lastIndex] - ); -} - -export { noFormat, RuleTester }; diff --git a/packages/utils/src/eslint-utils/applyDefault.ts b/packages/utils/src/eslint-utils/applyDefault.ts index 85cd3b3653b..f16ae798715 100644 --- a/packages/utils/src/eslint-utils/applyDefault.ts +++ b/packages/utils/src/eslint-utils/applyDefault.ts @@ -16,7 +16,7 @@ function applyDefault( JSON.stringify(defaultOptions), ) as AsMutable; - if (userOptions === null || userOptions === undefined) { + if (userOptions == null) { return options; } diff --git a/packages/utils/src/eslint-utils/batchedSingleLineTests.ts b/packages/utils/src/eslint-utils/batchedSingleLineTests.ts index 8eaef6e3f5e..fcd15210e48 100644 --- a/packages/utils/src/eslint-utils/batchedSingleLineTests.ts +++ b/packages/utils/src/eslint-utils/batchedSingleLineTests.ts @@ -1,4 +1,7 @@ -import { ValidTestCase, InvalidTestCase } from '../ts-eslint'; +import type { + InvalidTestCase, + ValidTestCase, +} from '../eslint-utils/rule-tester/RuleTester'; /** * Converts a batch of single line tests into a number of separate test cases. diff --git a/packages/utils/src/eslint-utils/getParserServices.ts b/packages/utils/src/eslint-utils/getParserServices.ts index 27ad579272b..cb04d6cc93d 100644 --- a/packages/utils/src/eslint-utils/getParserServices.ts +++ b/packages/utils/src/eslint-utils/getParserServices.ts @@ -1,5 +1,5 @@ -import * as TSESLint from '../ts-eslint'; -import { ParserServices } from '../ts-estree'; +import type * as TSESLint from '../ts-eslint'; +import type { ParserServices } from '../ts-estree'; const ERROR_MESSAGE = 'You have used a rule which requires parserServices to be generated. You must therefore provide a value for the "parserOptions.project" property for @typescript-eslint/parser.'; @@ -17,8 +17,7 @@ function getParserServices< // backwards compatibility check // old versions of the parser would not return any parserServices unless parserOptions.project was set if ( - !context.parserServices || - !context.parserServices.program || + !context.parserServices?.program || !context.parserServices.esTreeNodeToTSNodeMap || !context.parserServices.tsNodeToESTreeNodeMap ) { diff --git a/packages/utils/src/eslint-utils/index.ts b/packages/utils/src/eslint-utils/index.ts index fc8e410428e..a3d0cb75245 100644 --- a/packages/utils/src/eslint-utils/index.ts +++ b/packages/utils/src/eslint-utils/index.ts @@ -3,6 +3,6 @@ export * from './batchedSingleLineTests'; export * from './getParserServices'; export * from './InferTypesFromRule'; export * from './RuleCreator'; -export * from './RuleTester'; +export * from './rule-tester/RuleTester'; export * from './deepMerge'; export * from './nullThrows'; diff --git a/packages/utils/src/eslint-utils/nullThrows.ts b/packages/utils/src/eslint-utils/nullThrows.ts index df644c2befb..1a79b2e09d4 100644 --- a/packages/utils/src/eslint-utils/nullThrows.ts +++ b/packages/utils/src/eslint-utils/nullThrows.ts @@ -18,7 +18,7 @@ function nullThrows(value: T | null | undefined, message: string): T { // so ignore it in coverage metrics. /* istanbul ignore if */ - if (value === null || value === undefined) { + if (value == null) { throw new Error(`Non-null Assertion Failed: ${message}`); } diff --git a/packages/utils/src/eslint-utils/rule-tester/RuleTester.ts b/packages/utils/src/eslint-utils/rule-tester/RuleTester.ts new file mode 100644 index 00000000000..7350de3a975 --- /dev/null +++ b/packages/utils/src/eslint-utils/rule-tester/RuleTester.ts @@ -0,0 +1,318 @@ +import type * as TSESLintParserType from '@typescript-eslint/parser'; +import assert from 'assert'; +import { version as eslintVersion } from 'eslint/package.json'; +import * as path from 'path'; +import * as semver from 'semver'; + +import type { ParserOptions } from '../../ts-eslint/ParserOptions'; +import type { RuleModule } from '../../ts-eslint/Rule'; +import type { RuleTesterTestFrameworkFunction } from '../../ts-eslint/RuleTester'; +import * as BaseRuleTester from '../../ts-eslint/RuleTester'; +import { deepMerge } from '../deepMerge'; +import type { DependencyConstraint } from './dependencyConstraints'; +import { satisfiesAllDependencyConstraints } from './dependencyConstraints'; + +const TS_ESLINT_PARSER = '@typescript-eslint/parser'; +const ERROR_MESSAGE = `Do not set the parser at the test level unless you want to use a parser other than ${TS_ESLINT_PARSER}`; + +type RuleTesterConfig = Omit & { + parser: typeof TS_ESLINT_PARSER; + /** + * Constraints that must pass in the current environment for any tests to run + */ + dependencyConstraints?: DependencyConstraint; +}; + +interface InvalidTestCase< + TMessageIds extends string, + TOptions extends Readonly, +> extends BaseRuleTester.InvalidTestCase { + /** + * Constraints that must pass in the current environment for the test to run + */ + dependencyConstraints?: DependencyConstraint; +} +interface ValidTestCase> + extends BaseRuleTester.ValidTestCase { + /** + * Constraints that must pass in the current environment for the test to run + */ + dependencyConstraints?: DependencyConstraint; +} +interface RunTests< + TMessageIds extends string, + TOptions extends Readonly, +> { + // RuleTester.run also accepts strings for valid cases + readonly valid: readonly (ValidTestCase | string)[]; + readonly invalid: readonly InvalidTestCase[]; +} + +type AfterAll = (fn: () => void) => void; + +function isDescribeWithSkip( + value: unknown, +): value is RuleTesterTestFrameworkFunction & { + skip: RuleTesterTestFrameworkFunction; +} { + return ( + typeof value === 'object' && + value != null && + 'skip' in value && + typeof (value as Record).skip === 'function' + ); +} + +class RuleTester extends BaseRuleTester.RuleTester { + readonly #baseOptions: RuleTesterConfig; + + static #afterAll: AfterAll | undefined; + /** + * If you supply a value to this property, the rule tester will call this instead of using the version defined on + * the global namespace. + */ + static get afterAll(): AfterAll { + return ( + this.#afterAll ?? + (typeof afterAll === 'function' ? afterAll : (): void => {}) + ); + } + static set afterAll(value: AfterAll | undefined) { + this.#afterAll = value; + } + + private get staticThis(): typeof RuleTester { + // the cast here is due to https://github.com/microsoft/TypeScript/issues/3841 + return this.constructor as typeof RuleTester; + } + + constructor(baseOptions: RuleTesterConfig) { + // eslint will hard-error if you include non-standard top-level properties + const { dependencyConstraints: _, ...baseOptionsSafeForESLint } = + baseOptions; + super({ + ...baseOptionsSafeForESLint, + parserOptions: { + ...baseOptions.parserOptions, + warnOnUnsupportedTypeScriptVersion: + baseOptions.parserOptions?.warnOnUnsupportedTypeScriptVersion ?? + false, + }, + // as of eslint 6 you have to provide an absolute path to the parser + // but that's not as clean to type, this saves us trying to manually enforce + // that contributors require.resolve everything + parser: require.resolve(baseOptions.parser), + }); + + this.#baseOptions = baseOptions; + + // make sure that the parser doesn't hold onto file handles between tests + // on linux (i.e. our CI env), there can be very a limited number of watch handles available + this.staticThis.afterAll(() => { + try { + // instead of creating a hard dependency, just use a soft require + // a bit weird, but if they're using this tooling, it'll be installed + const parser = require(TS_ESLINT_PARSER) as typeof TSESLintParserType; + parser.clearCaches(); + } catch { + // ignored on purpose + } + }); + } + private getFilename(testOptions?: ParserOptions): string { + const resolvedOptions = deepMerge( + this.#baseOptions.parserOptions, + testOptions, + ) as ParserOptions; + const filename = `file.ts${resolvedOptions.ecmaFeatures?.jsx ? 'x' : ''}`; + if (resolvedOptions.project) { + return path.join( + resolvedOptions.tsconfigRootDir != null + ? resolvedOptions.tsconfigRootDir + : process.cwd(), + filename, + ); + } + return filename; + } + + // as of eslint 6 you have to provide an absolute path to the parser + // If you don't do that at the test level, the test will fail somewhat cryptically... + // This is a lot more explicit + run>( + name: string, + rule: RuleModule, + testsReadonly: RunTests, + ): void { + if ( + this.#baseOptions.dependencyConstraints && + !satisfiesAllDependencyConstraints( + this.#baseOptions.dependencyConstraints, + ) + ) { + if (isDescribeWithSkip(this.staticThis.describe)) { + // for frameworks like mocha or jest that have a "skip" version of their function + // we can provide a nice skipped test! + this.staticThis.describe.skip(name, () => { + this.staticThis.it( + 'All tests skipped due to unsatisfied constructor dependency constraints', + () => {}, + ); + }); + } else { + // otherwise just declare an empty test + this.staticThis.describe(name, () => { + this.staticThis.it( + 'All tests skipped due to unsatisfied constructor dependency constraints', + () => { + // some frameworks error if there are no assertions + assert.equal(true, true); + }, + ); + }); + } + + // don't run any tests because we don't match the base constraint + return; + } + + const tests = { + // standardize the valid tests as objects + valid: testsReadonly.valid.map(test => { + if (typeof test === 'string') { + return { + code: test, + }; + } + return test; + }), + invalid: testsReadonly.invalid, + }; + + // convenience iterator to make it easy to loop all tests without a concat + const allTestsIterator = { + *[Symbol.iterator](): Generator, void, unknown> { + for (const test of tests.valid) { + yield test; + } + for (const test of tests.invalid) { + yield test; + } + }, + }; + + /* + Automatically add a filename to the tests to enable type-aware tests to "just work". + This saves users having to verbosely and manually add the filename to every + single test case. + Hugely helps with the string-based valid test cases as it means they don't + need to be made objects! + Also removes dependencyConstraints, which we support but ESLint core doesn't. + */ + const normalizeTest = < + T extends + | ValidTestCase + | InvalidTestCase, + >({ + dependencyConstraints: _, + ...test + }: T): Omit => { + if (test.parser === TS_ESLINT_PARSER) { + throw new Error(ERROR_MESSAGE); + } + if (!test.filename) { + return { + ...test, + filename: this.getFilename(test.parserOptions), + }; + } + return test; + }; + tests.valid = tests.valid.map(normalizeTest); + tests.invalid = tests.invalid.map(normalizeTest); + + const hasOnly = ((): boolean => { + for (const test of allTestsIterator) { + if (test.only) { + return true; + } + } + return false; + })(); + // if there is an `only: true` - don't apply constraints - assume that + // we are in "local development" mode rather than "CI validation" mode + if (!hasOnly) { + /* + Automatically skip tests that don't satisfy the dependency constraints. + */ + const hasConstraints = ((): boolean => { + for (const test of allTestsIterator) { + if ( + test.dependencyConstraints && + Object.keys(test.dependencyConstraints).length > 0 + ) { + return true; + } + } + return false; + })(); + if (hasConstraints) { + // The `only: boolean` test property was only added in ESLint v7.29.0. + if (semver.satisfies(eslintVersion, '>=7.29.0')) { + /* + Mark all satisfactory tests as `only: true`, and all other tests as + `only: false`. + When multiple tests are marked as "only", test frameworks like jest and mocha + will run all of those tests and will just skip the other tests. + + We do this instead of just omitting the tests entirely because it gives the + test framework the opportunity to log the test as skipped rather than the test + just disappearing. + */ + const maybeMarkAsOnly = < + T extends + | ValidTestCase + | InvalidTestCase, + >( + test: T, + ): T => { + return { + ...test, + only: satisfiesAllDependencyConstraints( + test.dependencyConstraints, + ), + }; + }; + + tests.valid = tests.valid.map(maybeMarkAsOnly); + tests.invalid = tests.invalid.map(maybeMarkAsOnly); + } else { + // On older versions we just fallback to raw array filtering like SAVAGES + tests.valid = tests.valid.filter(test => + satisfiesAllDependencyConstraints(test.dependencyConstraints), + ); + tests.invalid = tests.invalid.filter(test => + satisfiesAllDependencyConstraints(test.dependencyConstraints), + ); + } + } + } + + super.run(name, rule, tests); + } +} + +/** + * Simple no-op tag to mark code samples as "should not format with prettier" + * for the internal/plugin-test-formatting lint rule + */ +function noFormat(strings: TemplateStringsArray, ...keys: string[]): string { + const lastIndex = strings.length - 1; + return ( + strings.slice(0, lastIndex).reduce((p, s, i) => p + s + keys[i], '') + + strings[lastIndex] + ); +} + +export { noFormat, RuleTester }; +export type { InvalidTestCase, ValidTestCase, RunTests }; diff --git a/packages/utils/src/eslint-utils/rule-tester/dependencyConstraints.ts b/packages/utils/src/eslint-utils/rule-tester/dependencyConstraints.ts new file mode 100644 index 00000000000..0bc1f5fc5ce --- /dev/null +++ b/packages/utils/src/eslint-utils/rule-tester/dependencyConstraints.ts @@ -0,0 +1,63 @@ +import * as semver from 'semver'; + +interface SemverVersionConstraint { + readonly range: string; + readonly options?: Parameters[2]; +} +type AtLeastVersionConstraint = + | `${number}` + | `${number}.${number}` + | `${number}.${number}.${number}` + | `${number}.${number}.${number}-${string}`; +type VersionConstraint = SemverVersionConstraint | AtLeastVersionConstraint; +interface DependencyConstraint { + /** + * Passing a string for the value is shorthand for a '>=' constraint + */ + readonly [packageName: string]: VersionConstraint; +} + +const BASE_SATISFIES_OPTIONS: semver.RangeOptions = { + includePrerelease: true, +}; + +function satisfiesDependencyConstraint( + packageName: string, + constraintIn: DependencyConstraint[string], +): boolean { + const constraint: SemverVersionConstraint = + typeof constraintIn === 'string' + ? { + range: `>=${constraintIn}`, + } + : constraintIn; + + return semver.satisfies( + (require(`${packageName}/package.json`) as { version: string }).version, + constraint.range, + typeof constraint.options === 'object' + ? { ...BASE_SATISFIES_OPTIONS, ...constraint.options } + : constraint.options, + ); +} + +function satisfiesAllDependencyConstraints( + dependencyConstraints: DependencyConstraint | undefined, +): boolean { + if (dependencyConstraints == null) { + return true; + } + + for (const [packageName, constraint] of Object.entries( + dependencyConstraints, + )) { + if (!satisfiesDependencyConstraint(packageName, constraint)) { + return false; + } + } + + return true; +} + +export { satisfiesAllDependencyConstraints }; +export type { DependencyConstraint }; diff --git a/packages/utils/src/ts-eslint-scope/Definition.ts b/packages/utils/src/ts-eslint-scope/Definition.ts index 1999c4f4863..3e35ecc9fc2 100644 --- a/packages/utils/src/ts-eslint-scope/Definition.ts +++ b/packages/utils/src/ts-eslint-scope/Definition.ts @@ -2,7 +2,8 @@ import { Definition as ESLintDefinition, ParameterDefinition as ESLintParameterDefinition, } from 'eslint-scope/lib/definition'; -import { TSESTree } from '../ts-estree'; + +import type { TSESTree } from '../ts-estree'; interface Definition { type: string; diff --git a/packages/utils/src/ts-eslint-scope/Options.ts b/packages/utils/src/ts-eslint-scope/Options.ts index a450e225b7f..0b1600ae1cb 100644 --- a/packages/utils/src/ts-eslint-scope/Options.ts +++ b/packages/utils/src/ts-eslint-scope/Options.ts @@ -1,4 +1,4 @@ -import { TSESTree } from '../ts-estree'; +import type { TSESTree } from '../ts-estree'; type PatternVisitorCallback = ( pattern: TSESTree.Identifier, diff --git a/packages/utils/src/ts-eslint-scope/PatternVisitor.ts b/packages/utils/src/ts-eslint-scope/PatternVisitor.ts index 8563f6d934b..75840211e28 100644 --- a/packages/utils/src/ts-eslint-scope/PatternVisitor.ts +++ b/packages/utils/src/ts-eslint-scope/PatternVisitor.ts @@ -1,11 +1,12 @@ import ESLintPatternVisitor from 'eslint-scope/lib/pattern-visitor'; -import { TSESTree } from '../ts-estree'; -import { ScopeManager } from './ScopeManager'; -import { + +import type { TSESTree } from '../ts-estree'; +import type { PatternVisitorCallback, PatternVisitorOptions, Visitor, } from './Options'; +import type { ScopeManager } from './ScopeManager'; interface PatternVisitor extends Visitor { options: PatternVisitorOptions; diff --git a/packages/utils/src/ts-eslint-scope/Reference.ts b/packages/utils/src/ts-eslint-scope/Reference.ts index 8d5c295f910..d2dd6554977 100644 --- a/packages/utils/src/ts-eslint-scope/Reference.ts +++ b/packages/utils/src/ts-eslint-scope/Reference.ts @@ -1,7 +1,8 @@ import ESLintReference from 'eslint-scope/lib/reference'; -import { TSESTree } from '../ts-estree'; -import { Scope } from './Scope'; -import { Variable } from './Variable'; + +import type { TSESTree } from '../ts-estree'; +import type { Scope } from './Scope'; +import type { Variable } from './Variable'; export type ReferenceFlag = 0x1 | 0x2 | 0x3; diff --git a/packages/utils/src/ts-eslint-scope/Referencer.ts b/packages/utils/src/ts-eslint-scope/Referencer.ts index 1d1180f21f8..3bd6b27b20d 100644 --- a/packages/utils/src/ts-eslint-scope/Referencer.ts +++ b/packages/utils/src/ts-eslint-scope/Referencer.ts @@ -1,13 +1,14 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ import ESLintReferencer from 'eslint-scope/lib/referencer'; -import { TSESTree } from '../ts-estree'; -import { + +import type { TSESTree } from '../ts-estree'; +import type { PatternVisitorCallback, PatternVisitorOptions, Visitor, } from './Options'; -import { Scope } from './Scope'; -import { ScopeManager } from './ScopeManager'; +import type { Scope } from './Scope'; +import type { ScopeManager } from './ScopeManager'; interface Referencer extends Visitor { isInnerMethodDefinition: boolean; diff --git a/packages/utils/src/ts-eslint-scope/Scope.ts b/packages/utils/src/ts-eslint-scope/Scope.ts index 9b2c711d2dc..e0f3320043a 100644 --- a/packages/utils/src/ts-eslint-scope/Scope.ts +++ b/packages/utils/src/ts-eslint-scope/Scope.ts @@ -1,23 +1,24 @@ /* eslint-disable @typescript-eslint/no-empty-interface, @typescript-eslint/no-explicit-any */ import { - Scope as ESLintScope, + BlockScope as ESLintBlockScope, + CatchScope as ESLintCatchScope, + ClassScope as ESLintClassScope, + ForScope as ESLintForScope, + FunctionExpressionNameScope as ESLintFunctionExpressionNameScope, + FunctionScope as ESLintFunctionScope, GlobalScope as ESLintGlobalScope, ModuleScope as ESLintModuleScope, - FunctionExpressionNameScope as ESLintFunctionExpressionNameScope, - CatchScope as ESLintCatchScope, - WithScope as ESLintWithScope, - BlockScope as ESLintBlockScope, + Scope as ESLintScope, SwitchScope as ESLintSwitchScope, - FunctionScope as ESLintFunctionScope, - ForScope as ESLintForScope, - ClassScope as ESLintClassScope, + WithScope as ESLintWithScope, } from 'eslint-scope/lib/scope'; -import { TSESTree } from '../ts-estree'; -import { Definition } from './Definition'; -import { Reference, ReferenceFlag } from './Reference'; -import { ScopeManager } from './ScopeManager'; -import { Variable } from './Variable'; + +import type { TSESTree } from '../ts-estree'; +import type { Definition } from './Definition'; +import type { Reference, ReferenceFlag } from './Reference'; +import type { ScopeManager } from './ScopeManager'; +import type { Variable } from './Variable'; type ScopeType = | 'block' diff --git a/packages/utils/src/ts-eslint-scope/ScopeManager.ts b/packages/utils/src/ts-eslint-scope/ScopeManager.ts index 9f971d79764..c7bbb2425c9 100644 --- a/packages/utils/src/ts-eslint-scope/ScopeManager.ts +++ b/packages/utils/src/ts-eslint-scope/ScopeManager.ts @@ -1,8 +1,9 @@ import ESLintScopeManager from 'eslint-scope/lib/scope-manager'; -import { TSESTree } from '../ts-estree'; -import { EcmaVersion } from '../ts-eslint'; -import { Scope } from './Scope'; -import { Variable } from './Variable'; + +import type { EcmaVersion } from '../ts-eslint'; +import type { TSESTree } from '../ts-estree'; +import type { Scope } from './Scope'; +import type { Variable } from './Variable'; interface ScopeManagerOptions { directive?: boolean; diff --git a/packages/utils/src/ts-eslint-scope/Variable.ts b/packages/utils/src/ts-eslint-scope/Variable.ts index c9ff75f95d5..192c9f89550 100644 --- a/packages/utils/src/ts-eslint-scope/Variable.ts +++ b/packages/utils/src/ts-eslint-scope/Variable.ts @@ -1,8 +1,9 @@ import ESLintVariable from 'eslint-scope/lib/variable'; -import { TSESTree } from '../ts-estree'; -import { Reference } from './Reference'; -import { Definition } from './Definition'; -import { Scope } from './Scope'; + +import type { TSESTree } from '../ts-estree'; +import type { Definition } from './Definition'; +import type { Reference } from './Reference'; +import type { Scope } from './Scope'; interface Variable { name: string; diff --git a/packages/utils/src/ts-eslint-scope/analyze.ts b/packages/utils/src/ts-eslint-scope/analyze.ts index 51d69ba8cbe..1543f93fa1a 100644 --- a/packages/utils/src/ts-eslint-scope/analyze.ts +++ b/packages/utils/src/ts-eslint-scope/analyze.ts @@ -1,7 +1,8 @@ import { analyze as ESLintAnalyze } from 'eslint-scope'; -import { EcmaVersion } from '../ts-eslint'; -import { TSESTree } from '../ts-estree'; -import { ScopeManager } from './ScopeManager'; + +import type { EcmaVersion } from '../ts-eslint'; +import type { TSESTree } from '../ts-estree'; +import type { ScopeManager } from './ScopeManager'; interface AnalysisOptions { optimistic?: boolean; diff --git a/packages/utils/src/ts-eslint/AST.ts b/packages/utils/src/ts-eslint/AST.ts index 5a0ea09d843..4cace04f13f 100644 --- a/packages/utils/src/ts-eslint/AST.ts +++ b/packages/utils/src/ts-eslint/AST.ts @@ -1,6 +1,6 @@ /* eslint-disable @typescript-eslint/no-namespace */ -import { TSESTree, AST_TOKEN_TYPES } from '../ts-estree'; +import type { AST_TOKEN_TYPES, TSESTree } from '../ts-estree'; namespace AST { export type TokenType = AST_TOKEN_TYPES; diff --git a/packages/utils/src/ts-eslint/CLIEngine.ts b/packages/utils/src/ts-eslint/CLIEngine.ts index 9cc1c97b5c7..9ad4f5c76ed 100644 --- a/packages/utils/src/ts-eslint/CLIEngine.ts +++ b/packages/utils/src/ts-eslint/CLIEngine.ts @@ -1,8 +1,10 @@ /* eslint-disable @typescript-eslint/no-namespace */ +/* eslint-disable deprecation/deprecation -- "uses" deprecated API to define the deprecated API */ import { CLIEngine as ESLintCLIEngine } from 'eslint'; -import { Linter } from './Linter'; -import { RuleListener, RuleMetaData, RuleModule } from './Rule'; + +import type { Linter } from './Linter'; +import type { RuleListener, RuleMetaData, RuleModule } from './Rule'; declare class CLIEngineBase { /** diff --git a/packages/utils/src/ts-eslint/ESLint.ts b/packages/utils/src/ts-eslint/ESLint.ts index 9686c5e8be1..d5e0420a56f 100644 --- a/packages/utils/src/ts-eslint/ESLint.ts +++ b/packages/utils/src/ts-eslint/ESLint.ts @@ -1,7 +1,8 @@ /* eslint-disable @typescript-eslint/no-namespace */ import { ESLint as ESLintESLint } from 'eslint'; -import { Linter } from './Linter'; + +import type { Linter } from './Linter'; declare class ESLintBase { /** diff --git a/packages/utils/src/ts-eslint/Linter.ts b/packages/utils/src/ts-eslint/Linter.ts index c2a8e67fe3a..4e1a13aba77 100644 --- a/packages/utils/src/ts-eslint/Linter.ts +++ b/packages/utils/src/ts-eslint/Linter.ts @@ -1,16 +1,17 @@ /* eslint-disable @typescript-eslint/no-namespace */ import { Linter as ESLintLinter } from 'eslint'; -import { TSESTree, ParserServices } from '../ts-estree'; -import { ParserOptions as TSParserOptions } from './ParserOptions'; -import { + +import type { ParserServices, TSESTree } from '../ts-estree'; +import type { ParserOptions as TSParserOptions } from './ParserOptions'; +import type { RuleCreateFunction, RuleFix, RuleModule, SharedConfigurationSettings, } from './Rule'; -import { Scope } from './Scope'; -import { SourceCode } from './SourceCode'; +import type { Scope } from './Scope'; +import type { SourceCode } from './SourceCode'; declare class LinterBase { /** diff --git a/packages/utils/src/ts-eslint/Rule.ts b/packages/utils/src/ts-eslint/Rule.ts index 25d29bddf11..ff305386321 100644 --- a/packages/utils/src/ts-eslint/Rule.ts +++ b/packages/utils/src/ts-eslint/Rule.ts @@ -433,6 +433,11 @@ interface RuleModule< // for extending base rules TRuleListener extends RuleListener = RuleListener, > { + /** + * Default options the rule will be run with + */ + defaultOptions: TOptions; + /** * Metadata about the rule */ diff --git a/packages/utils/src/ts-eslint/RuleTester.ts b/packages/utils/src/ts-eslint/RuleTester.ts index 35acfd45f12..6c0b98b795f 100644 --- a/packages/utils/src/ts-eslint/RuleTester.ts +++ b/packages/utils/src/ts-eslint/RuleTester.ts @@ -1,8 +1,9 @@ import { RuleTester as ESLintRuleTester } from 'eslint'; -import { AST_NODE_TYPES, AST_TOKEN_TYPES } from '../ts-estree'; -import { Linter } from './Linter'; -import { ParserOptions } from './ParserOptions'; -import { + +import type { AST_NODE_TYPES, AST_TOKEN_TYPES } from '../ts-estree'; +import type { Linter } from './Linter'; +import type { ParserOptions } from './ParserOptions'; +import type { RuleCreateFunction, RuleModule, SharedConfigurationSettings, @@ -124,6 +125,15 @@ interface TestCaseError { // readonly message?: string | RegExp; } +/** + * @param text a string describing the rule + * @param callback the test callback + */ +type RuleTesterTestFrameworkFunction = ( + text: string, + callback: () => void, +) => void; + interface RunTests< TMessageIds extends string, TOptions extends Readonly, @@ -160,23 +170,26 @@ declare class RuleTesterBase { /** * If you supply a value to this property, the rule tester will call this instead of using the version defined on * the global namespace. - * @param text a string describing the rule - * @param callback the test callback */ - static describe?: (text: string, callback: () => void) => void; + static get describe(): RuleTesterTestFrameworkFunction; + static set describe(value: RuleTesterTestFrameworkFunction | undefined); + + /** + * If you supply a value to this property, the rule tester will call this instead of using the version defined on + * the global namespace. + */ + static get it(): RuleTesterTestFrameworkFunction; + static set it(value: RuleTesterTestFrameworkFunction | undefined); /** * If you supply a value to this property, the rule tester will call this instead of using the version defined on * the global namespace. - * @param text a string describing the test case - * @param callback the test callback */ - static it?: (text: string, callback: () => void) => void; + static get itOnly(): RuleTesterTestFrameworkFunction; + static set itOnly(value: RuleTesterTestFrameworkFunction | undefined); /** * Define a rule for one particular run of tests. - * @param name The name of the rule to define. - * @param rule The rule definition. */ defineRule>( name: string, @@ -193,6 +206,7 @@ export { SuggestionOutput, RuleTester, RuleTesterConfig, + RuleTesterTestFrameworkFunction, RunTests, TestCaseError, ValidTestCase, diff --git a/packages/utils/src/ts-eslint/SourceCode.ts b/packages/utils/src/ts-eslint/SourceCode.ts index 17893d25b50..a44cdee3676 100644 --- a/packages/utils/src/ts-eslint/SourceCode.ts +++ b/packages/utils/src/ts-eslint/SourceCode.ts @@ -1,8 +1,9 @@ /* eslint-disable @typescript-eslint/no-namespace */ import { SourceCode as ESLintSourceCode } from 'eslint'; -import { ParserServices, TSESTree } from '../ts-estree'; -import { Scope } from './Scope'; + +import type { ParserServices, TSESTree } from '../ts-estree'; +import type { Scope } from './Scope'; declare class TokenStore { /** @@ -388,10 +389,25 @@ namespace SourceCode { } export type FilterPredicate = (token: TSESTree.Token) => boolean; + export type GetFilterPredicate = + // https://github.com/prettier/prettier/issues/14275 + // prettier-ignore + TFilter extends (( + token: TSESTree.Token, + ) => token is infer U extends TSESTree.Token) + ? U + : TDefault; + export type GetFilterPredicateFromOptions = + TOptions extends { filter?: FilterPredicate } + ? GetFilterPredicate + : GetFilterPredicate; export type ReturnTypeFromOptions = T extends { includeComments: true } - ? TSESTree.Token - : Exclude; + ? GetFilterPredicateFromOptions + : GetFilterPredicateFromOptions< + T, + Exclude + >; export type CursorWithSkipOptions = | number diff --git a/packages/utils/tests/eslint-utils/nullThrows.test.ts b/packages/utils/tests/eslint-utils/nullThrows.test.ts new file mode 100644 index 00000000000..7997fecaa6d --- /dev/null +++ b/packages/utils/tests/eslint-utils/nullThrows.test.ts @@ -0,0 +1,31 @@ +import { nullThrows, NullThrowsReasons } from '../../src/eslint-utils'; + +describe('nullThrows', () => { + it('returns a falsy value when it exists', () => { + const value = 0; + + const actual = nullThrows(value, NullThrowsReasons.MissingParent); + + expect(actual).toBe(value); + }); + + it('returns a truthy value when it exists', () => { + const value = { abc: 'def' }; + + const actual = nullThrows(value, NullThrowsReasons.MissingParent); + + expect(actual).toBe(value); + }); + + it('throws an error when the value is null', () => { + expect(() => nullThrows(null, NullThrowsReasons.MissingParent)).toThrow( + NullThrowsReasons.MissingParent, + ); + }); + + it('throws an error when the value is undefined', () => { + expect(() => + nullThrows(undefined, NullThrowsReasons.MissingParent), + ).toThrow(NullThrowsReasons.MissingParent); + }); +}); diff --git a/packages/utils/tests/eslint-utils/rule-tester/RuleTester.test.ts b/packages/utils/tests/eslint-utils/rule-tester/RuleTester.test.ts new file mode 100644 index 00000000000..57ac48b38c1 --- /dev/null +++ b/packages/utils/tests/eslint-utils/rule-tester/RuleTester.test.ts @@ -0,0 +1,737 @@ +import * as parser from '@typescript-eslint/parser'; +import eslintPackageJson from 'eslint/package.json'; + +import * as dependencyConstraintsModule from '../../../src/eslint-utils/rule-tester/dependencyConstraints'; +import { RuleTester } from '../../../src/eslint-utils/rule-tester/RuleTester'; +import type { RuleModule } from '../../../src/ts-eslint'; +import { RuleTester as BaseRuleTester } from '../../../src/ts-eslint'; + +// we can't spy on the exports of an ES module - so we instead have to mock the entire module +jest.mock('../../../src/eslint-utils/rule-tester/dependencyConstraints', () => { + const dependencyConstraints = jest.requireActual< + typeof dependencyConstraintsModule + >('../../../src/eslint-utils/rule-tester/dependencyConstraints'); + + return { + ...dependencyConstraints, + __esModule: true, + satisfiesAllDependencyConstraints: jest.fn( + dependencyConstraints.satisfiesAllDependencyConstraints, + ), + }; +}); +const satisfiesAllDependencyConstraintsMock = jest.mocked( + dependencyConstraintsModule.satisfiesAllDependencyConstraints, +); + +jest.mock( + 'totally-real-dependency/package.json', + () => ({ + version: '10.0.0', + }), + { + // this is not a real module that will exist + virtual: true, + }, +); +jest.mock( + 'totally-real-dependency-prerelease/package.json', + () => ({ + version: '10.0.0-rc.1', + }), + { + // this is not a real module that will exist + virtual: true, + }, +); + +// mock the eslint package.json so that we can manipulate the version in the test +jest.mock('eslint/package.json', () => { + return { + // make the version a getter so we can spy on it and change the return value + get version(): string { + // fix the version so the test is stable on older ESLint versions + return '8.0.0'; + }, + }; +}); + +jest.mock('@typescript-eslint/parser', () => { + return { + __esModule: true, + clearCaches: jest.fn(), + }; +}); + +/* eslint-disable jest/prefer-spy-on -- + need to specifically assign to the properties or else it will use the + global value */ +RuleTester.afterAll = jest.fn(); +RuleTester.describe = jest.fn(); +RuleTester.it = jest.fn(); +RuleTester.itOnly = jest.fn(); +/* eslint-enable jest/prefer-spy-on */ + +const mockedAfterAll = jest.mocked(RuleTester.afterAll); +const mockedDescribe = jest.mocked(RuleTester.describe); +const mockedIt = jest.mocked(RuleTester.it); +const _mockedItOnly = jest.mocked(RuleTester.itOnly); +const runSpy = jest.spyOn(BaseRuleTester.prototype, 'run'); +const mockedParserClearCaches = jest.mocked(parser.clearCaches); + +const eslintVersionSpy = jest.spyOn(eslintPackageJson, 'version', 'get'); + +beforeEach(() => { + jest.clearAllMocks(); +}); + +const NOOP_RULE: RuleModule<'error', []> = { + meta: { + messages: { + error: 'error', + }, + type: 'problem', + schema: {}, + }, + defaultOptions: [], + create() { + return {}; + }, +}; + +describe('RuleTester', () => { + it('automatically sets the filename for tests', () => { + const ruleTester = new RuleTester({ + parser: '@typescript-eslint/parser', + parserOptions: { + project: 'tsconfig.json', + tsconfigRootDir: '/some/path/that/totally/exists/', + }, + }); + + ruleTester.run('my-rule', NOOP_RULE, { + invalid: [ + { + code: 'invalid tests should work as well', + errors: [], + }, + ], + valid: [ + 'string based valid test', + { + code: 'object based valid test', + }, + { + code: "explicit filename shouldn't be overwritten", + filename: '/set/in/the/test.ts', + }, + { + code: 'jsx should have the correct filename', + parserOptions: { + ecmaFeatures: { + jsx: true, + }, + }, + }, + { + code: 'type-aware parser options should override the constructor config', + parserOptions: { + project: 'tsconfig.test-specific.json', + tsconfigRootDir: '/set/in/the/test/', + }, + }, + ], + }); + + expect(runSpy.mock.lastCall?.[2]).toMatchInlineSnapshot(` + { + "invalid": [ + { + "code": "invalid tests should work as well", + "errors": [], + "filename": "/some/path/that/totally/exists/file.ts", + }, + ], + "valid": [ + { + "code": "string based valid test", + "filename": "/some/path/that/totally/exists/file.ts", + }, + { + "code": "object based valid test", + "filename": "/some/path/that/totally/exists/file.ts", + }, + { + "code": "explicit filename shouldn't be overwritten", + "filename": "/set/in/the/test.ts", + }, + { + "code": "jsx should have the correct filename", + "filename": "/some/path/that/totally/exists/file.tsx", + "parserOptions": { + "ecmaFeatures": { + "jsx": true, + }, + }, + }, + { + "code": "type-aware parser options should override the constructor config", + "filename": "/set/in/the/test/file.ts", + "parserOptions": { + "project": "tsconfig.test-specific.json", + "tsconfigRootDir": "/set/in/the/test/", + }, + }, + ], + } + `); + }); + + it('schedules the parser caches to be cleared afterAll', () => { + // it should schedule the afterAll + expect(mockedAfterAll).toHaveBeenCalledTimes(0); + const _ruleTester = new RuleTester({ + parser: '@typescript-eslint/parser', + parserOptions: { + project: 'tsconfig.json', + tsconfigRootDir: '/some/path/that/totally/exists/', + }, + }); + expect(mockedAfterAll).toHaveBeenCalledTimes(1); + + // the provided callback should clear the caches + const callback = mockedAfterAll.mock.calls[0][0]; + expect(typeof callback).toBe('function'); + expect(mockedParserClearCaches).not.toHaveBeenCalled(); + callback(); + expect(mockedParserClearCaches).toHaveBeenCalledTimes(1); + }); + + it('throws an error if you attempt to set the parser to ts-eslint at the test level', () => { + const ruleTester = new RuleTester({ + parser: '@typescript-eslint/parser', + parserOptions: { + project: 'tsconfig.json', + tsconfigRootDir: '/some/path/that/totally/exists/', + }, + }); + + expect(() => + ruleTester.run('my-rule', NOOP_RULE, { + valid: [ + { + code: 'object based valid test', + parser: '@typescript-eslint/parser', + }, + ], + + invalid: [], + }), + ).toThrowErrorMatchingInlineSnapshot( + `"Do not set the parser at the test level unless you want to use a parser other than @typescript-eslint/parser"`, + ); + }); + + describe('checks dependencies as specified', () => { + it('does not check dependencies if there are no dependency constraints', () => { + const ruleTester = new RuleTester({ + parser: '@typescript-eslint/parser', + }); + + ruleTester.run('my-rule', NOOP_RULE, { + valid: [ + 'const x = 1;', + { code: 'const x = 2;' }, + // empty object is ignored + { code: 'const x = 3;', dependencyConstraints: {} }, + ], + invalid: [], + }); + + expect(satisfiesAllDependencyConstraintsMock).not.toHaveBeenCalled(); + }); + + describe('does not check dependencies if is an "only" manually set', () => { + it('in the valid section', () => { + const ruleTester = new RuleTester({ + parser: '@typescript-eslint/parser', + }); + + ruleTester.run('my-rule', NOOP_RULE, { + valid: [ + 'const x = 1;', + { code: 'const x = 2;' }, + { + code: 'const x = 3;', + // eslint-disable-next-line eslint-plugin/no-only-tests -- intentional only for test purposes + only: true, + }, + { + code: 'const x = 4;', + dependencyConstraints: { + 'totally-real-dependency': '999', + }, + }, + ], + invalid: [], + }); + + expect(satisfiesAllDependencyConstraintsMock).not.toHaveBeenCalled(); + }); + + it('in the invalid section', () => { + const ruleTester = new RuleTester({ + parser: '@typescript-eslint/parser', + }); + + ruleTester.run('my-rule', NOOP_RULE, { + valid: [ + 'const x = 1;', + { code: 'const x = 2;' }, + { + code: 'const x = 4;', + dependencyConstraints: { + 'totally-real-dependency': '999', + }, + }, + ], + invalid: [ + { + code: 'const x = 3;', + errors: [], + // eslint-disable-next-line eslint-plugin/no-only-tests -- intentional only for test purposes + only: true, + }, + ], + }); + + expect(satisfiesAllDependencyConstraintsMock).not.toHaveBeenCalled(); + }); + }); + + it('correctly handles string-based at-least', () => { + const ruleTester = new RuleTester({ + parser: '@typescript-eslint/parser', + }); + + ruleTester.run('my-rule', NOOP_RULE, { + invalid: [ + { + code: 'failing - major', + errors: [], + dependencyConstraints: { + 'totally-real-dependency': '999', + }, + }, + { + code: 'failing - major.minor', + errors: [], + dependencyConstraints: { + 'totally-real-dependency': '999.0', + }, + }, + { + code: 'failing - major.minor.patch', + errors: [], + dependencyConstraints: { + 'totally-real-dependency': '999.0.0', + }, + }, + ], + valid: [ + { + code: 'passing - major', + dependencyConstraints: { + 'totally-real-dependency': '10', + }, + }, + { + code: 'passing - major.minor', + dependencyConstraints: { + 'totally-real-dependency': '10.0', + }, + }, + { + code: 'passing - major.minor.patch', + dependencyConstraints: { + 'totally-real-dependency': '10.0.0', + }, + }, + ], + }); + + expect(runSpy.mock.lastCall?.[2]).toMatchInlineSnapshot(` + { + "invalid": [ + { + "code": "failing - major", + "errors": [], + "filename": "file.ts", + }, + { + "code": "failing - major.minor", + "errors": [], + "filename": "file.ts", + }, + { + "code": "failing - major.minor.patch", + "errors": [], + "filename": "file.ts", + }, + ], + "valid": [ + { + "code": "passing - major", + "filename": "file.ts", + }, + { + "code": "passing - major.minor", + "filename": "file.ts", + }, + { + "code": "passing - major.minor.patch", + "filename": "file.ts", + }, + ], + } + `); + }); + + it('correctly handles object-based semver', () => { + const ruleTester = new RuleTester({ + parser: '@typescript-eslint/parser', + }); + + ruleTester.run('my-rule', NOOP_RULE, { + invalid: [ + { + code: 'failing - major', + errors: [], + dependencyConstraints: { + 'totally-real-dependency': { + range: '^999', + }, + }, + }, + { + code: 'failing - major.minor', + errors: [], + dependencyConstraints: { + 'totally-real-dependency': { + range: '>=999.0', + }, + }, + }, + + { + code: 'failing with options', + errors: [], + dependencyConstraints: { + 'totally-real-dependency-prerelease': { + range: '^10', + options: { + includePrerelease: false, + }, + }, + }, + }, + ], + valid: [ + { + code: 'passing - major', + dependencyConstraints: { + 'totally-real-dependency': { + range: '^10', + }, + }, + }, + { + code: 'passing - major.minor', + dependencyConstraints: { + 'totally-real-dependency': { + range: '<999', + }, + }, + }, + ], + }); + + expect(runSpy.mock.lastCall?.[2]).toMatchInlineSnapshot(` + { + "invalid": [ + { + "code": "failing - major", + "errors": [], + "filename": "file.ts", + }, + { + "code": "failing - major.minor", + "errors": [], + "filename": "file.ts", + }, + { + "code": "failing with options", + "errors": [], + "filename": "file.ts", + }, + ], + "valid": [ + { + "code": "passing - major", + "filename": "file.ts", + }, + { + "code": "passing - major.minor", + "filename": "file.ts", + }, + ], + } + `); + }); + + it('tests without versions should always be run', () => { + const ruleTester = new RuleTester({ + parser: '@typescript-eslint/parser', + }); + + ruleTester.run('my-rule', NOOP_RULE, { + invalid: [ + { + code: 'no constraints is always run', + errors: [], + }, + { + code: 'empty object is always run', + errors: [], + dependencyConstraints: {}, + }, + { + code: 'failing constraint', + errors: [], + dependencyConstraints: { + 'totally-real-dependency': '99999', + }, + }, + ], + valid: [ + 'string based is always run', + { + code: 'no constraints is always run', + }, + { + code: 'empty object is always run', + dependencyConstraints: {}, + }, + { + code: 'passing constraint', + dependencyConstraints: { + 'totally-real-dependency': '10', + }, + }, + ], + }); + + expect(runSpy.mock.lastCall?.[2]).toMatchInlineSnapshot(` + { + "invalid": [ + { + "code": "no constraints is always run", + "errors": [], + "filename": "file.ts", + }, + { + "code": "empty object is always run", + "errors": [], + "filename": "file.ts", + }, + { + "code": "failing constraint", + "errors": [], + "filename": "file.ts", + }, + ], + "valid": [ + { + "code": "string based is always run", + "filename": "file.ts", + }, + { + "code": "no constraints is always run", + "filename": "file.ts", + }, + { + "code": "empty object is always run", + "filename": "file.ts", + }, + { + "code": "passing constraint", + "filename": "file.ts", + }, + ], + } + `); + }); + + it('uses filter instead of "only" for old ESLint versions', () => { + // need it twice because ESLint internally fetches this value once :( + eslintVersionSpy.mockReturnValueOnce('1.0.0'); + eslintVersionSpy.mockReturnValueOnce('1.0.0'); + + const ruleTester = new RuleTester({ + parser: '@typescript-eslint/parser', + }); + + ruleTester.run('my-rule', NOOP_RULE, { + invalid: [ + { + code: 'failing', + errors: [], + dependencyConstraints: { + 'totally-real-dependency': '999', + }, + }, + { + code: 'passing', + errors: [], + dependencyConstraints: { + 'totally-real-dependency': '10', + }, + }, + ], + valid: [ + 'always passing string test', + { + code: 'failing', + dependencyConstraints: { + 'totally-real-dependency': '999', + }, + }, + { + code: 'passing', + dependencyConstraints: { + 'totally-real-dependency': '10', + }, + }, + ], + }); + + expect(runSpy.mock.lastCall?.[2]).toMatchInlineSnapshot(` + { + "invalid": [ + { + "code": "failing", + "errors": [], + "filename": "file.ts", + }, + { + "code": "passing", + "errors": [], + "filename": "file.ts", + }, + ], + "valid": [ + { + "code": "always passing string test", + "filename": "file.ts", + }, + { + "code": "failing", + "filename": "file.ts", + }, + { + "code": "passing", + "filename": "file.ts", + }, + ], + } + `); + }); + + describe('constructor constraints', () => { + it('skips all tests if a constructor constraint is not satisifed', () => { + const ruleTester = new RuleTester({ + parser: '@typescript-eslint/parser', + dependencyConstraints: { + 'totally-real-dependency': '999', + }, + }); + + ruleTester.run('my-rule', NOOP_RULE, { + invalid: [ + { + code: 'failing - major', + errors: [], + }, + ], + valid: [ + { + code: 'passing - major', + }, + ], + }); + + // trigger the describe block + expect(mockedDescribe.mock.calls.length).toBeGreaterThanOrEqual(1); + mockedDescribe.mock.lastCall?.[1](); + expect(mockedDescribe.mock.calls).toMatchInlineSnapshot(` + [ + [ + "my-rule", + [Function], + ], + ] + `); + expect(mockedIt.mock.lastCall).toMatchInlineSnapshot(` + [ + "All tests skipped due to unsatisfied constructor dependency constraints", + [Function], + ] + `); + }); + + it('does not skip all tests if a constructor constraint is satisifed', () => { + const ruleTester = new RuleTester({ + parser: '@typescript-eslint/parser', + dependencyConstraints: { + 'totally-real-dependency': '10', + }, + }); + + ruleTester.run('my-rule', NOOP_RULE, { + invalid: [ + { + code: 'valid', + errors: [], + }, + ], + valid: [ + { + code: 'valid', + }, + ], + }); + + // trigger the describe block + expect(mockedDescribe.mock.calls.length).toBeGreaterThanOrEqual(1); + mockedDescribe.mock.lastCall?.[1](); + expect(mockedDescribe.mock.calls).toMatchInlineSnapshot(` + [ + [ + "my-rule", + [Function], + ], + [ + "valid", + [Function], + ], + [ + "invalid", + [Function], + ], + ] + `); + // expect(mockedIt.mock.lastCall).toMatchInlineSnapshot(`undefined`); + }); + }); + }); +}); diff --git a/packages/visitor-keys/CHANGELOG.md b/packages/visitor-keys/CHANGELOG.md index 6cbcb6b7a47..a7c260ce870 100644 --- a/packages/visitor-keys/CHANGELOG.md +++ b/packages/visitor-keys/CHANGELOG.md @@ -3,7 +3,7 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. -# [5.31.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.7...v5.31.0) (2022-07-25) +# [5.50.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.49.0...v5.50.0) (2023-01-31) **Note:** Version bump only for package @typescript-eslint/visitor-keys @@ -11,18 +11,15 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline -## [5.30.7](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.6...v5.30.7) (2022-07-18) - - -### Bug Fixes +# [5.49.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.48.2...v5.49.0) (2023-01-23) -* expose types supporting old versions of typescript ([#5339](https://github.com/typescript-eslint/typescript-eslint/issues/5339)) ([4ba9bdb](https://github.com/typescript-eslint/typescript-eslint/commit/4ba9bdb93f87e6bc370f13aa1de48f435abe3f88)) +**Note:** Version bump only for package @typescript-eslint/visitor-keys -## [5.30.6](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.5...v5.30.6) (2022-07-11) +## [5.48.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.48.1...v5.48.2) (2023-01-16) **Note:** Version bump only for package @typescript-eslint/visitor-keys @@ -30,7 +27,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline -## [5.30.5](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.4...v5.30.5) (2022-07-04) +## [5.48.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.48.0...v5.48.1) (2023-01-09) **Note:** Version bump only for package @typescript-eslint/visitor-keys @@ -38,953 +35,625 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline -## [5.30.4](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.3...v5.30.4) (2022-07-03) +# [5.48.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.47.1...v5.48.0) (2023-01-02) **Note:** Version bump only for package @typescript-eslint/visitor-keys +## [5.47.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.47.0...v5.47.1) (2022-12-26) +**Note:** Version bump only for package @typescript-eslint/visitor-keys - - -## [5.30.3](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.2...v5.30.3) (2022-07-01) +# [5.47.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.46.1...v5.47.0) (2022-12-19) **Note:** Version bump only for package @typescript-eslint/visitor-keys +## [5.46.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.46.0...v5.46.1) (2022-12-12) +**Note:** Version bump only for package @typescript-eslint/visitor-keys +# [5.46.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.45.1...v5.46.0) (2022-12-08) +**Note:** Version bump only for package @typescript-eslint/visitor-keys -## [5.30.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.1...v5.30.2) (2022-07-01) +## [5.45.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.45.0...v5.45.1) (2022-12-05) **Note:** Version bump only for package @typescript-eslint/visitor-keys +# [5.45.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.44.0...v5.45.0) (2022-11-28) +### Features +- support Auto Accessor syntax ([#5926](https://github.com/typescript-eslint/typescript-eslint/issues/5926)) ([becd1f8](https://github.com/typescript-eslint/typescript-eslint/commit/becd1f8581c0013399dfe71be6c265e96cedb57a)) +# [5.44.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.43.0...v5.44.0) (2022-11-21) -## 5.30.1 (2022-07-01) +### Features -**Note:** Version bump only for package @typescript-eslint/visitor-keys +- support parsing `satisfies` operators ([#5717](https://github.com/typescript-eslint/typescript-eslint/issues/5717)) ([20d7cae](https://github.com/typescript-eslint/typescript-eslint/commit/20d7caee35ab84ae6381fdf04338c9e2b9e2bc48)) +# [5.43.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.42.1...v5.43.0) (2022-11-14) +**Note:** Version bump only for package @typescript-eslint/visitor-keys +## [5.42.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.42.0...v5.42.1) (2022-11-07) +**Note:** Version bump only for package @typescript-eslint/visitor-keys -# [5.30.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.29.0...v5.30.0) (2022-06-27) +# [5.42.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.41.0...v5.42.0) (2022-10-31) **Note:** Version bump only for package @typescript-eslint/visitor-keys +# [5.41.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.40.1...v5.41.0) (2022-10-24) +**Note:** Version bump only for package @typescript-eslint/visitor-keys +## [5.40.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.40.0...v5.40.1) (2022-10-17) +**Note:** Version bump only for package @typescript-eslint/visitor-keys -# [5.29.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.28.0...v5.29.0) (2022-06-20) +# [5.40.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.39.0...v5.40.0) (2022-10-10) **Note:** Version bump only for package @typescript-eslint/visitor-keys +# [5.39.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.38.1...v5.39.0) (2022-10-03) +**Note:** Version bump only for package @typescript-eslint/visitor-keys +## [5.38.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.38.0...v5.38.1) (2022-09-26) +**Note:** Version bump only for package @typescript-eslint/visitor-keys -# [5.28.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.27.1...v5.28.0) (2022-06-13) +# [5.38.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.37.0...v5.38.0) (2022-09-19) +**Note:** Version bump only for package @typescript-eslint/visitor-keys -### Bug Fixes +# [5.37.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.36.2...v5.37.0) (2022-09-12) -* [TS4.7] allow visiting of typeParameters in TSTypeQuery ([#5166](https://github.com/typescript-eslint/typescript-eslint/issues/5166)) ([dc1f930](https://github.com/typescript-eslint/typescript-eslint/commit/dc1f9309cf04aa7314e758980ac687558482f47f)) +**Note:** Version bump only for package @typescript-eslint/visitor-keys +## [5.36.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.36.1...v5.36.2) (2022-09-05) +**Note:** Version bump only for package @typescript-eslint/visitor-keys +## [5.36.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.36.0...v5.36.1) (2022-08-30) +**Note:** Version bump only for package @typescript-eslint/visitor-keys -## [5.27.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.27.0...v5.27.1) (2022-06-06) +# [5.36.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.35.1...v5.36.0) (2022-08-30) **Note:** Version bump only for package @typescript-eslint/visitor-keys +## [5.35.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.35.0...v5.35.1) (2022-08-24) +**Note:** Version bump only for package @typescript-eslint/visitor-keys +# [5.35.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.34.0...v5.35.0) (2022-08-24) +**Note:** Version bump only for package @typescript-eslint/visitor-keys -# [5.27.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.26.0...v5.27.0) (2022-05-30) - +# [5.34.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.33.1...v5.34.0) (2022-08-22) -### Features +**Note:** Version bump only for package @typescript-eslint/visitor-keys -* [4.7] support new extensions ([#5027](https://github.com/typescript-eslint/typescript-eslint/issues/5027)) ([efc147b](https://github.com/typescript-eslint/typescript-eslint/commit/efc147b04dce52ab17415b6a4ae4076b944b9036)) +## [5.33.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.33.0...v5.33.1) (2022-08-15) +**Note:** Version bump only for package @typescript-eslint/visitor-keys +# [5.33.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.32.0...v5.33.0) (2022-08-08) +**Note:** Version bump only for package @typescript-eslint/visitor-keys +# [5.32.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.31.0...v5.32.0) (2022-08-01) -# [5.26.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.25.0...v5.26.0) (2022-05-23) +**Note:** Version bump only for package @typescript-eslint/visitor-keys +# [5.31.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.7...v5.31.0) (2022-07-25) -### Features +**Note:** Version bump only for package @typescript-eslint/visitor-keys -* [4.7] support instantiation expressions ([#4938](https://github.com/typescript-eslint/typescript-eslint/issues/4938)) ([79fbc77](https://github.com/typescript-eslint/typescript-eslint/commit/79fbc7743ae5dce3190f8168776e0204755390ad)) +## [5.30.7](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.6...v5.30.7) (2022-07-18) +### Bug Fixes +- expose types supporting old versions of typescript ([#5339](https://github.com/typescript-eslint/typescript-eslint/issues/5339)) ([4ba9bdb](https://github.com/typescript-eslint/typescript-eslint/commit/4ba9bdb93f87e6bc370f13aa1de48f435abe3f88)) +## [5.30.6](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.5...v5.30.6) (2022-07-11) +**Note:** Version bump only for package @typescript-eslint/visitor-keys -# [5.25.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.24.0...v5.25.0) (2022-05-17) +## [5.30.5](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.4...v5.30.5) (2022-07-04) **Note:** Version bump only for package @typescript-eslint/visitor-keys +## [5.30.4](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.3...v5.30.4) (2022-07-03) +**Note:** Version bump only for package @typescript-eslint/visitor-keys +## [5.30.3](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.2...v5.30.3) (2022-07-01) +**Note:** Version bump only for package @typescript-eslint/visitor-keys -# [5.24.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.23.0...v5.24.0) (2022-05-16) +## [5.30.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.1...v5.30.2) (2022-07-01) **Note:** Version bump only for package @typescript-eslint/visitor-keys +## 5.30.1 (2022-07-01) +**Note:** Version bump only for package @typescript-eslint/visitor-keys +# [5.30.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.29.0...v5.30.0) (2022-06-27) +**Note:** Version bump only for package @typescript-eslint/visitor-keys -# [5.23.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.22.0...v5.23.0) (2022-05-09) +# [5.29.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.28.0...v5.29.0) (2022-06-20) **Note:** Version bump only for package @typescript-eslint/visitor-keys +# [5.28.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.27.1...v5.28.0) (2022-06-13) +### Bug Fixes +- [TS4.7] allow visiting of typeParameters in TSTypeQuery ([#5166](https://github.com/typescript-eslint/typescript-eslint/issues/5166)) ([dc1f930](https://github.com/typescript-eslint/typescript-eslint/commit/dc1f9309cf04aa7314e758980ac687558482f47f)) +## [5.27.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.27.0...v5.27.1) (2022-06-06) -# [5.22.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.21.0...v5.22.0) (2022-05-02) +**Note:** Version bump only for package @typescript-eslint/visitor-keys +# [5.27.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.26.0...v5.27.0) (2022-05-30) ### Features -* **ast-spec:** add fixture test framework and some initial fixtures ([#3258](https://github.com/typescript-eslint/typescript-eslint/issues/3258)) ([f3cf87b](https://github.com/typescript-eslint/typescript-eslint/commit/f3cf87bf20fd0542f92a96a318aa9ee5bf23c1f6)) - +- [4.7] support new extensions ([#5027](https://github.com/typescript-eslint/typescript-eslint/issues/5027)) ([efc147b](https://github.com/typescript-eslint/typescript-eslint/commit/efc147b04dce52ab17415b6a4ae4076b944b9036)) +# [5.26.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.25.0...v5.26.0) (2022-05-23) +### Features +- [4.7] support instantiation expressions ([#4938](https://github.com/typescript-eslint/typescript-eslint/issues/4938)) ([79fbc77](https://github.com/typescript-eslint/typescript-eslint/commit/79fbc7743ae5dce3190f8168776e0204755390ad)) -# [5.21.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.20.0...v5.21.0) (2022-04-25) +# [5.25.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.24.0...v5.25.0) (2022-05-17) **Note:** Version bump only for package @typescript-eslint/visitor-keys +# [5.24.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.23.0...v5.24.0) (2022-05-16) +**Note:** Version bump only for package @typescript-eslint/visitor-keys - - -# [5.20.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.19.0...v5.20.0) (2022-04-18) +# [5.23.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.22.0...v5.23.0) (2022-05-09) **Note:** Version bump only for package @typescript-eslint/visitor-keys +# [5.22.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.21.0...v5.22.0) (2022-05-02) +### Features +- **ast-spec:** add fixture test framework and some initial fixtures ([#3258](https://github.com/typescript-eslint/typescript-eslint/issues/3258)) ([f3cf87b](https://github.com/typescript-eslint/typescript-eslint/commit/f3cf87bf20fd0542f92a96a318aa9ee5bf23c1f6)) - -# [5.19.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.18.0...v5.19.0) (2022-04-11) +# [5.21.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.20.0...v5.21.0) (2022-04-25) **Note:** Version bump only for package @typescript-eslint/visitor-keys +# [5.20.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.19.0...v5.20.0) (2022-04-18) +**Note:** Version bump only for package @typescript-eslint/visitor-keys +# [5.19.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.18.0...v5.19.0) (2022-04-11) +**Note:** Version bump only for package @typescript-eslint/visitor-keys # [5.18.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.17.0...v5.18.0) (2022-04-04) - ### Bug Fixes -* **visitor-keys:** add missing visitor keys ([#4731](https://github.com/typescript-eslint/typescript-eslint/issues/4731)) ([bb575a0](https://github.com/typescript-eslint/typescript-eslint/commit/bb575a0763f39b9b988a7c20afee7b5eeb64cba7)) - - - - +- **visitor-keys:** add missing visitor keys ([#4731](https://github.com/typescript-eslint/typescript-eslint/issues/4731)) ([bb575a0](https://github.com/typescript-eslint/typescript-eslint/commit/bb575a0763f39b9b988a7c20afee7b5eeb64cba7)) # [5.17.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.16.0...v5.17.0) (2022-03-28) **Note:** Version bump only for package @typescript-eslint/visitor-keys - - - - # [5.16.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.15.0...v5.16.0) (2022-03-21) **Note:** Version bump only for package @typescript-eslint/visitor-keys - - - - # [5.15.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.14.0...v5.15.0) (2022-03-14) **Note:** Version bump only for package @typescript-eslint/visitor-keys - - - - # [5.14.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.13.0...v5.14.0) (2022-03-07) **Note:** Version bump only for package @typescript-eslint/visitor-keys - - - - # [5.13.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.12.1...v5.13.0) (2022-02-28) **Note:** Version bump only for package @typescript-eslint/visitor-keys - - - - ## [5.12.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.12.0...v5.12.1) (2022-02-21) **Note:** Version bump only for package @typescript-eslint/visitor-keys - - - - # [5.12.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.11.0...v5.12.0) (2022-02-14) **Note:** Version bump only for package @typescript-eslint/visitor-keys - - - - # [5.11.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.10.2...v5.11.0) (2022-02-07) **Note:** Version bump only for package @typescript-eslint/visitor-keys - - - - ## [5.10.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.10.1...v5.10.2) (2022-01-31) **Note:** Version bump only for package @typescript-eslint/visitor-keys - - - - ## [5.10.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.10.0...v5.10.1) (2022-01-24) **Note:** Version bump only for package @typescript-eslint/visitor-keys - - - - # [5.10.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.9.1...v5.10.0) (2022-01-17) **Note:** Version bump only for package @typescript-eslint/visitor-keys - - - - ## [5.9.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.9.0...v5.9.1) (2022-01-10) **Note:** Version bump only for package @typescript-eslint/visitor-keys - - - - # [5.9.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.8.1...v5.9.0) (2022-01-03) **Note:** Version bump only for package @typescript-eslint/visitor-keys - - - - ## [5.8.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.8.0...v5.8.1) (2021-12-27) **Note:** Version bump only for package @typescript-eslint/visitor-keys - - - - # [5.8.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.7.0...v5.8.0) (2021-12-20) **Note:** Version bump only for package @typescript-eslint/visitor-keys - - - - # [5.7.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.6.0...v5.7.0) (2021-12-13) **Note:** Version bump only for package @typescript-eslint/visitor-keys - - - - # [5.6.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.5.0...v5.6.0) (2021-12-06) **Note:** Version bump only for package @typescript-eslint/visitor-keys - - - - # [5.5.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.4.0...v5.5.0) (2021-11-29) - ### Bug Fixes -* **visitor-keys:** add missing import assertion keys ([#4178](https://github.com/typescript-eslint/typescript-eslint/issues/4178)) ([9c38b7f](https://github.com/typescript-eslint/typescript-eslint/commit/9c38b7f7fc3ce471a8f720c4a2fbce01f3ee12a4)) - - - - +- **visitor-keys:** add missing import assertion keys ([#4178](https://github.com/typescript-eslint/typescript-eslint/issues/4178)) ([9c38b7f](https://github.com/typescript-eslint/typescript-eslint/commit/9c38b7f7fc3ce471a8f720c4a2fbce01f3ee12a4)) # [5.4.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.3.1...v5.4.0) (2021-11-15) - ### Features -* **typescript-estree:** support Import Assertions ([#4074](https://github.com/typescript-eslint/typescript-eslint/issues/4074)) ([ae0fb5a](https://github.com/typescript-eslint/typescript-eslint/commit/ae0fb5a591958216b7df656e66b1dfe464898167)) - - - - +- **typescript-estree:** support Import Assertions ([#4074](https://github.com/typescript-eslint/typescript-eslint/issues/4074)) ([ae0fb5a](https://github.com/typescript-eslint/typescript-eslint/commit/ae0fb5a591958216b7df656e66b1dfe464898167)) ## [5.3.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.3.0...v5.3.1) (2021-11-08) **Note:** Version bump only for package @typescript-eslint/visitor-keys - - - - # [5.3.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.2.0...v5.3.0) (2021-11-01) **Note:** Version bump only for package @typescript-eslint/visitor-keys - - - - # [5.2.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.1.0...v5.2.0) (2021-10-25) **Note:** Version bump only for package @typescript-eslint/visitor-keys - - - - # [5.1.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.0.0...v5.1.0) (2021-10-18) **Note:** Version bump only for package @typescript-eslint/visitor-keys - - - - # [5.0.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.33.0...v5.0.0) (2021-10-11) - ### Features -* align class property representation with ESTree ([#3806](https://github.com/typescript-eslint/typescript-eslint/issues/3806)) ([22fa5c0](https://github.com/typescript-eslint/typescript-eslint/commit/22fa5c0c4705ed2898f00b7cacc5dd642d859275)), closes [#3430](https://github.com/typescript-eslint/typescript-eslint/issues/3430) [#3077](https://github.com/typescript-eslint/typescript-eslint/issues/3077) -* remove `TSParenthesizedType` ([#3340](https://github.com/typescript-eslint/typescript-eslint/issues/3340)) ([c8ee432](https://github.com/typescript-eslint/typescript-eslint/commit/c8ee43269faea4c04ec02eaa2b81a0aa6eec5d3e)), closes [#3136](https://github.com/typescript-eslint/typescript-eslint/issues/3136) -* support `PrivateIdentifier` ([#3808](https://github.com/typescript-eslint/typescript-eslint/issues/3808)) ([0eefe5e](https://github.com/typescript-eslint/typescript-eslint/commit/0eefe5e49d21af3f1e3e2d9a90c2e49929863ac2)), closes [#3430](https://github.com/typescript-eslint/typescript-eslint/issues/3430) [#2933](https://github.com/typescript-eslint/typescript-eslint/issues/2933) -* **eslint-plugin:** removed value from abstract property nodes ([#3765](https://github.com/typescript-eslint/typescript-eslint/issues/3765)) ([5823524](https://github.com/typescript-eslint/typescript-eslint/commit/58235241714596b641a1e8b39c569e561e0039b4)), closes [#3748](https://github.com/typescript-eslint/typescript-eslint/issues/3748) - - - - +- align class property representation with ESTree ([#3806](https://github.com/typescript-eslint/typescript-eslint/issues/3806)) ([22fa5c0](https://github.com/typescript-eslint/typescript-eslint/commit/22fa5c0c4705ed2898f00b7cacc5dd642d859275)), closes [#3430](https://github.com/typescript-eslint/typescript-eslint/issues/3430) [#3077](https://github.com/typescript-eslint/typescript-eslint/issues/3077) +- remove `TSParenthesizedType` ([#3340](https://github.com/typescript-eslint/typescript-eslint/issues/3340)) ([c8ee432](https://github.com/typescript-eslint/typescript-eslint/commit/c8ee43269faea4c04ec02eaa2b81a0aa6eec5d3e)), closes [#3136](https://github.com/typescript-eslint/typescript-eslint/issues/3136) +- support `PrivateIdentifier` ([#3808](https://github.com/typescript-eslint/typescript-eslint/issues/3808)) ([0eefe5e](https://github.com/typescript-eslint/typescript-eslint/commit/0eefe5e49d21af3f1e3e2d9a90c2e49929863ac2)), closes [#3430](https://github.com/typescript-eslint/typescript-eslint/issues/3430) [#2933](https://github.com/typescript-eslint/typescript-eslint/issues/2933) +- **eslint-plugin:** removed value from abstract property nodes ([#3765](https://github.com/typescript-eslint/typescript-eslint/issues/3765)) ([5823524](https://github.com/typescript-eslint/typescript-eslint/commit/58235241714596b641a1e8b39c569e561e0039b4)), closes [#3748](https://github.com/typescript-eslint/typescript-eslint/issues/3748) # [4.33.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.32.0...v4.33.0) (2021-10-04) **Note:** Version bump only for package @typescript-eslint/visitor-keys - - - - # [4.32.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.31.2...v4.32.0) (2021-09-27) **Note:** Version bump only for package @typescript-eslint/visitor-keys - - - - ## [4.31.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.31.1...v4.31.2) (2021-09-20) **Note:** Version bump only for package @typescript-eslint/visitor-keys - - - - ## [4.31.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.31.0...v4.31.1) (2021-09-13) **Note:** Version bump only for package @typescript-eslint/visitor-keys - - - - # [4.31.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.30.0...v4.31.0) (2021-09-06) **Note:** Version bump only for package @typescript-eslint/visitor-keys - - - - # [4.30.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.29.3...v4.30.0) (2021-08-30) - ### Bug Fixes -* **visitor-keys:** add key to StaticBlock (v5) ([#3812](https://github.com/typescript-eslint/typescript-eslint/issues/3812)) ([fa35e22](https://github.com/typescript-eslint/typescript-eslint/commit/fa35e22702207baf07acb3eec11d3383721bf6b6)) - +- **visitor-keys:** add key to StaticBlock (v5) ([#3812](https://github.com/typescript-eslint/typescript-eslint/issues/3812)) ([fa35e22](https://github.com/typescript-eslint/typescript-eslint/commit/fa35e22702207baf07acb3eec11d3383721bf6b6)) ### Features -* **typescript-estree:** add support for class static blocks ([#3730](https://github.com/typescript-eslint/typescript-eslint/issues/3730)) ([f81831b](https://github.com/typescript-eslint/typescript-eslint/commit/f81831bd279a32da6dbab0f1c061053ea43965f6)) - - - - +- **typescript-estree:** add support for class static blocks ([#3730](https://github.com/typescript-eslint/typescript-eslint/issues/3730)) ([f81831b](https://github.com/typescript-eslint/typescript-eslint/commit/f81831bd279a32da6dbab0f1c061053ea43965f6)) ## [4.29.3](https://github.com/typescript-eslint/typescript-eslint/compare/v4.29.2...v4.29.3) (2021-08-23) **Note:** Version bump only for package @typescript-eslint/visitor-keys - - - - ## [4.29.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.29.1...v4.29.2) (2021-08-16) **Note:** Version bump only for package @typescript-eslint/visitor-keys - - - - ## [4.29.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.29.0...v4.29.1) (2021-08-09) **Note:** Version bump only for package @typescript-eslint/visitor-keys - - - - # [4.29.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.5...v4.29.0) (2021-08-02) **Note:** Version bump only for package @typescript-eslint/visitor-keys - - - - ## [4.28.5](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.4...v4.28.5) (2021-07-26) **Note:** Version bump only for package @typescript-eslint/visitor-keys - - - - ## [4.28.4](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.3...v4.28.4) (2021-07-19) **Note:** Version bump only for package @typescript-eslint/visitor-keys - - - - ## [4.28.3](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.2...v4.28.3) (2021-07-12) **Note:** Version bump only for package @typescript-eslint/visitor-keys - - - - ## [4.28.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.1...v4.28.2) (2021-07-05) **Note:** Version bump only for package @typescript-eslint/visitor-keys - - - - ## [4.28.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.28.0...v4.28.1) (2021-06-28) **Note:** Version bump only for package @typescript-eslint/visitor-keys - - - - # [4.28.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.27.0...v4.28.0) (2021-06-21) **Note:** Version bump only for package @typescript-eslint/visitor-keys - - - - # [4.27.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.26.1...v4.27.0) (2021-06-14) **Note:** Version bump only for package @typescript-eslint/visitor-keys - - - - ## [4.26.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.26.0...v4.26.1) (2021-06-07) **Note:** Version bump only for package @typescript-eslint/visitor-keys - - - - # [4.26.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.25.0...v4.26.0) (2021-05-31) **Note:** Version bump only for package @typescript-eslint/visitor-keys - - - - # [4.25.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.24.0...v4.25.0) (2021-05-24) **Note:** Version bump only for package @typescript-eslint/visitor-keys - - - - # [4.24.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.23.0...v4.24.0) (2021-05-17) **Note:** Version bump only for package @typescript-eslint/visitor-keys - - - - # [4.23.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.22.1...v4.23.0) (2021-05-10) - ### Features -* refactor to split AST specification out as its own module ([#2911](https://github.com/typescript-eslint/typescript-eslint/issues/2911)) ([25ea953](https://github.com/typescript-eslint/typescript-eslint/commit/25ea953cc60b118bd385c71e0a9b61c286c26fcf)) - - - - +- refactor to split AST specification out as its own module ([#2911](https://github.com/typescript-eslint/typescript-eslint/issues/2911)) ([25ea953](https://github.com/typescript-eslint/typescript-eslint/commit/25ea953cc60b118bd385c71e0a9b61c286c26fcf)) ## [4.22.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.22.0...v4.22.1) (2021-05-04) **Note:** Version bump only for package @typescript-eslint/visitor-keys - - - - # [4.22.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.21.0...v4.22.0) (2021-04-12) **Note:** Version bump only for package @typescript-eslint/visitor-keys - - - - # [4.21.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.20.0...v4.21.0) (2021-04-05) **Note:** Version bump only for package @typescript-eslint/visitor-keys - - - - # [4.20.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.19.0...v4.20.0) (2021-03-29) **Note:** Version bump only for package @typescript-eslint/visitor-keys - - - - # [4.19.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.18.0...v4.19.0) (2021-03-22) **Note:** Version bump only for package @typescript-eslint/visitor-keys - - - - # [4.18.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.17.0...v4.18.0) (2021-03-15) **Note:** Version bump only for package @typescript-eslint/visitor-keys - - - - # [4.17.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.16.1...v4.17.0) (2021-03-08) **Note:** Version bump only for package @typescript-eslint/visitor-keys - - - - ## [4.16.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.16.0...v4.16.1) (2021-03-01) **Note:** Version bump only for package @typescript-eslint/visitor-keys - - - - # [4.16.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.15.2...v4.16.0) (2021-03-01) - ### Features -* TypeScript 4.2 syntax support ([#3112](https://github.com/typescript-eslint/typescript-eslint/issues/3112)) ([2ebfb21](https://github.com/typescript-eslint/typescript-eslint/commit/2ebfb21ba6c88c793cfbd0e231e5803b2381694c)) - - - - +- TypeScript 4.2 syntax support ([#3112](https://github.com/typescript-eslint/typescript-eslint/issues/3112)) ([2ebfb21](https://github.com/typescript-eslint/typescript-eslint/commit/2ebfb21ba6c88c793cfbd0e231e5803b2381694c)) ## [4.15.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.15.1...v4.15.2) (2021-02-22) - ### Bug Fixes -* add missing intrinsic keyword node to AST ([#3081](https://github.com/typescript-eslint/typescript-eslint/issues/3081)) ([409bf0b](https://github.com/typescript-eslint/typescript-eslint/commit/409bf0bb3e2ac4d8782408d436ebdefb42dba38b)) - - - - +- add missing intrinsic keyword node to AST ([#3081](https://github.com/typescript-eslint/typescript-eslint/issues/3081)) ([409bf0b](https://github.com/typescript-eslint/typescript-eslint/commit/409bf0bb3e2ac4d8782408d436ebdefb42dba38b)) ## [4.15.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.15.0...v4.15.1) (2021-02-15) **Note:** Version bump only for package @typescript-eslint/visitor-keys - - - - # [4.15.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.14.2...v4.15.0) (2021-02-08) **Note:** Version bump only for package @typescript-eslint/visitor-keys - - - - ## [4.14.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.14.1...v4.14.2) (2021-02-01) **Note:** Version bump only for package @typescript-eslint/visitor-keys - - - - ## [4.14.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.14.0...v4.14.1) (2021-01-25) **Note:** Version bump only for package @typescript-eslint/visitor-keys - - - - # [4.14.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.13.0...v4.14.0) (2021-01-18) **Note:** Version bump only for package @typescript-eslint/visitor-keys - - - - # [4.13.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.12.0...v4.13.0) (2021-01-11) **Note:** Version bump only for package @typescript-eslint/visitor-keys - - - - # [4.12.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.11.1...v4.12.0) (2021-01-04) **Note:** Version bump only for package @typescript-eslint/visitor-keys - - - - ## [4.11.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.11.0...v4.11.1) (2020-12-28) **Note:** Version bump only for package @typescript-eslint/visitor-keys - - - - # [4.11.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.10.0...v4.11.0) (2020-12-21) **Note:** Version bump only for package @typescript-eslint/visitor-keys - - - - # [4.10.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.9.1...v4.10.0) (2020-12-14) **Note:** Version bump only for package @typescript-eslint/visitor-keys - - - - ## [4.9.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.9.0...v4.9.1) (2020-12-07) **Note:** Version bump only for package @typescript-eslint/visitor-keys - - - - # [4.9.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.8.2...v4.9.0) (2020-11-30) **Note:** Version bump only for package @typescript-eslint/visitor-keys - - - - ## [4.8.2](https://github.com/typescript-eslint/typescript-eslint/compare/v4.8.1...v4.8.2) (2020-11-23) **Note:** Version bump only for package @typescript-eslint/visitor-keys - - - - ## [4.8.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.8.0...v4.8.1) (2020-11-17) **Note:** Version bump only for package @typescript-eslint/visitor-keys - - - - # [4.8.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.7.0...v4.8.0) (2020-11-16) **Note:** Version bump only for package @typescript-eslint/visitor-keys - - - - # [4.7.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.6.1...v4.7.0) (2020-11-09) - ### Features -* support TS4.1 features ([#2748](https://github.com/typescript-eslint/typescript-eslint/issues/2748)) ([2be354b](https://github.com/typescript-eslint/typescript-eslint/commit/2be354bb15f9013a2da1b13a0c0836e9ef057e16)), closes [#2583](https://github.com/typescript-eslint/typescript-eslint/issues/2583) - - - - +- support TS4.1 features ([#2748](https://github.com/typescript-eslint/typescript-eslint/issues/2748)) ([2be354b](https://github.com/typescript-eslint/typescript-eslint/commit/2be354bb15f9013a2da1b13a0c0836e9ef057e16)), closes [#2583](https://github.com/typescript-eslint/typescript-eslint/issues/2583) ## [4.6.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.6.0...v4.6.1) (2020-11-02) **Note:** Version bump only for package @typescript-eslint/visitor-keys - - - - # [4.6.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.5.0...v4.6.0) (2020-10-26) **Note:** Version bump only for package @typescript-eslint/visitor-keys - - - - # [4.5.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.4.1...v4.5.0) (2020-10-19) **Note:** Version bump only for package @typescript-eslint/visitor-keys - - - - ## [4.4.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.4.0...v4.4.1) (2020-10-12) **Note:** Version bump only for package @typescript-eslint/visitor-keys - - - - # [4.4.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.3.0...v4.4.0) (2020-10-05) **Note:** Version bump only for package @typescript-eslint/visitor-keys - - - - # [4.3.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.2.0...v4.3.0) (2020-09-28) **Note:** Version bump only for package @typescript-eslint/visitor-keys - - - - # [4.2.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.1.1...v4.2.0) (2020-09-21) **Note:** Version bump only for package @typescript-eslint/visitor-keys - - - - ## [4.1.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.1.0...v4.1.1) (2020-09-14) **Note:** Version bump only for package @typescript-eslint/visitor-keys - - - - # [4.1.0](https://github.com/typescript-eslint/typescript-eslint/compare/v4.0.1...v4.1.0) (2020-09-07) **Note:** Version bump only for package @typescript-eslint/visitor-keys - - - - ## [4.0.1](https://github.com/typescript-eslint/typescript-eslint/compare/v4.0.0...v4.0.1) (2020-08-31) **Note:** Version bump only for package @typescript-eslint/visitor-keys - - - - # [4.0.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.10.1...v4.0.0) (2020-08-31) - ### Bug Fixes -* correct decorator traversal for AssignmentPattern ([#2375](https://github.com/typescript-eslint/typescript-eslint/issues/2375)) ([d738fa4](https://github.com/typescript-eslint/typescript-eslint/commit/d738fa4eff0a5c4cfc9b30b1c0502f8d1e78d7b6)) - +- correct decorator traversal for AssignmentPattern ([#2375](https://github.com/typescript-eslint/typescript-eslint/issues/2375)) ([d738fa4](https://github.com/typescript-eslint/typescript-eslint/commit/d738fa4eff0a5c4cfc9b30b1c0502f8d1e78d7b6)) ### Features -* support ESTree optional chaining representation ([#2308](https://github.com/typescript-eslint/typescript-eslint/issues/2308)) ([e9d2ab6](https://github.com/typescript-eslint/typescript-eslint/commit/e9d2ab638b6767700b52797e74b814ea059beaae)) - +- support ESTree optional chaining representation ([#2308](https://github.com/typescript-eslint/typescript-eslint/issues/2308)) ([e9d2ab6](https://github.com/typescript-eslint/typescript-eslint/commit/e9d2ab638b6767700b52797e74b814ea059beaae)) ### BREAKING CHANGES -* - Removed decorators property from several Nodes that could never semantically have them (FunctionDeclaration, TSEnumDeclaration, and TSInterfaceDeclaration) -- Removed AST_NODE_TYPES.Import. This is a minor breaking change as the node type that used this was removed ages ago. - - - +- - Removed decorators property from several Nodes that could never semantically have them (FunctionDeclaration, TSEnumDeclaration, and TSInterfaceDeclaration) +* Removed AST_NODE_TYPES.Import. This is a minor breaking change as the node type that used this was removed ages ago. ## [3.10.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.10.0...v3.10.1) (2020-08-25) **Note:** Version bump only for package @typescript-eslint/visitor-keys - - - - # [3.10.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.9.1...v3.10.0) (2020-08-24) **Note:** Version bump only for package @typescript-eslint/visitor-keys - - - - ## [3.9.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.9.0...v3.9.1) (2020-08-17) **Note:** Version bump only for package @typescript-eslint/visitor-keys - - - - # [3.9.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.8.0...v3.9.0) (2020-08-10) - ### Features -* **typescript-estree:** support TSv4 labelled tuple members ([#2378](https://github.com/typescript-eslint/typescript-eslint/issues/2378)) ([00d84ff](https://github.com/typescript-eslint/typescript-eslint/commit/00d84ffbcbe9d0ec98bdb2f2ce59959a27ce4dbe)) - - - - +- **typescript-estree:** support TSv4 labelled tuple members ([#2378](https://github.com/typescript-eslint/typescript-eslint/issues/2378)) ([00d84ff](https://github.com/typescript-eslint/typescript-eslint/commit/00d84ffbcbe9d0ec98bdb2f2ce59959a27ce4dbe)) # [3.8.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.7.1...v3.8.0) (2020-08-03) **Note:** Version bump only for package @typescript-eslint/visitor-keys - - - - ## [3.7.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.7.0...v3.7.1) (2020-07-27) **Note:** Version bump only for package @typescript-eslint/visitor-keys - - - - # [3.7.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.6.1...v3.7.0) (2020-07-20) **Note:** Version bump only for package @typescript-eslint/visitor-keys - - - - ## [3.6.1](https://github.com/typescript-eslint/typescript-eslint/compare/v3.6.0...v3.6.1) (2020-07-13) **Note:** Version bump only for package @typescript-eslint/visitor-keys - - - - # [3.6.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.5.0...v3.6.0) (2020-07-06) **Note:** Version bump only for package @typescript-eslint/visitor-keys - - - - # [3.5.0](https://github.com/typescript-eslint/typescript-eslint/compare/v3.4.0...v3.5.0) (2020-06-29) - ### Features -* split visitor keys into their own package ([#2230](https://github.com/typescript-eslint/typescript-eslint/issues/2230)) ([689dae3](https://github.com/typescript-eslint/typescript-eslint/commit/689dae37392d527c64ae83db2a4c3e6b7fecece7)) +- split visitor keys into their own package ([#2230](https://github.com/typescript-eslint/typescript-eslint/issues/2230)) ([689dae3](https://github.com/typescript-eslint/typescript-eslint/commit/689dae37392d527c64ae83db2a4c3e6b7fecece7)) diff --git a/packages/visitor-keys/LICENSE b/packages/visitor-keys/LICENSE index 7e7370143b2..a1164108d4d 100644 --- a/packages/visitor-keys/LICENSE +++ b/packages/visitor-keys/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2019 TypeScript ESLint and other contributors +Copyright (c) 2019 typescript-eslint and other contributors Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/packages/visitor-keys/README.md b/packages/visitor-keys/README.md index 839c20c4954..1745172a6f2 100644 --- a/packages/visitor-keys/README.md +++ b/packages/visitor-keys/README.md @@ -1,13 +1,10 @@ -

TypeScript-ESTree Visitor Keys

+# `@typescript-eslint/visitor-keys` -

Visitor keys used to help traverse the TypeScript-ESTree AST

+> Visitor keys used to help traverse the TypeScript-ESTree AST. -

- CI - NPM Version - NPM Downloads -

+## ✋ Internal Package -## Contributing +This is an _internal package_ to the [typescript-eslint monorepo](https://github.com/typescript-eslint/typescript-eslint). +You likely don't want to use it directly. -[See the contributing guide here](../../CONTRIBUTING.md) +👉 See **https://typescript-eslint.io** for docs on typescript-eslint. diff --git a/packages/visitor-keys/package.json b/packages/visitor-keys/package.json index eccaeefe1f2..14527dc3f80 100644 --- a/packages/visitor-keys/package.json +++ b/packages/visitor-keys/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/visitor-keys", - "version": "5.31.0", + "version": "5.50.0", "description": "Visitor keys used to help traverse the TypeScript-ESTree AST", "keywords": [ "eslint", @@ -34,12 +34,12 @@ "clean": "tsc -b tsconfig.build.json --clean", "postclean": "rimraf dist && rimraf _ts3.4 && rimraf coverage", "format": "prettier --write \"./**/*.{ts,mts,cts,tsx,js,mjs,cjs,jsx,json,md,css}\" --ignore-path ../../.prettierignore", - "lint": "eslint . --ignore-path='../../.eslintignore'", + "lint": "nx lint", "test": "jest --coverage", "typecheck": "tsc -p tsconfig.json --noEmit" }, "dependencies": { - "@typescript-eslint/types": "5.31.0", + "@typescript-eslint/types": "5.50.0", "eslint-visitor-keys": "^3.3.0" }, "devDependencies": { diff --git a/packages/visitor-keys/project.json b/packages/visitor-keys/project.json index e531f19f69d..ab99ec943a6 100644 --- a/packages/visitor-keys/project.json +++ b/packages/visitor-keys/project.json @@ -1,5 +1,15 @@ { - "root": "packages/visitor-keys", + "name": "visitor-keys", + "$schema": "../../node_modules/nx/schemas/project-schema.json", "type": "library", - "implicitDependencies": [] + "implicitDependencies": [], + "targets": { + "lint": { + "executor": "@nrwl/linter:eslint", + "outputs": ["{options.outputFile}"], + "options": { + "lintFilePatterns": ["packages/visitor-keys/**/*.ts"] + } + } + } } diff --git a/packages/visitor-keys/src/get-keys.ts b/packages/visitor-keys/src/get-keys.ts index f1219ca196a..99a4145e55b 100644 --- a/packages/visitor-keys/src/get-keys.ts +++ b/packages/visitor-keys/src/get-keys.ts @@ -1,4 +1,4 @@ -import { TSESTree } from '@typescript-eslint/types'; +import type { TSESTree } from '@typescript-eslint/types'; import { getKeys as getKeysOriginal } from 'eslint-visitor-keys'; const getKeys: (node: TSESTree.Node) => ReadonlyArray = getKeysOriginal; diff --git a/packages/visitor-keys/src/visitor-keys.ts b/packages/visitor-keys/src/visitor-keys.ts index 1909c8aa854..6934453d32f 100644 --- a/packages/visitor-keys/src/visitor-keys.ts +++ b/packages/visitor-keys/src/visitor-keys.ts @@ -1,4 +1,4 @@ -import { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/types'; +import type { AST_NODE_TYPES, TSESTree } from '@typescript-eslint/types'; import * as eslintVisitorKeys from 'eslint-visitor-keys'; interface VisitorKeys { @@ -10,91 +10,197 @@ type GetNodeTypeKeys = Exclude< 'type' | 'loc' | 'range' | 'parent' >; +type KeysDefinedInESLintVisitorKeysCore = + | AST_NODE_TYPES.AssignmentExpression + | AST_NODE_TYPES.AssignmentPattern + | AST_NODE_TYPES.ArrayExpression + | AST_NODE_TYPES.ArrayPattern + | AST_NODE_TYPES.ArrowFunctionExpression + | AST_NODE_TYPES.AwaitExpression + | AST_NODE_TYPES.BlockStatement + | AST_NODE_TYPES.BinaryExpression + | AST_NODE_TYPES.BreakStatement + | AST_NODE_TYPES.CallExpression + | AST_NODE_TYPES.CatchClause + | AST_NODE_TYPES.ChainExpression + | AST_NODE_TYPES.ClassBody + | AST_NODE_TYPES.ClassDeclaration + | AST_NODE_TYPES.ClassExpression + | AST_NODE_TYPES.ConditionalExpression + | AST_NODE_TYPES.ContinueStatement + | AST_NODE_TYPES.DebuggerStatement + | AST_NODE_TYPES.DoWhileStatement + | AST_NODE_TYPES.EmptyStatement + | AST_NODE_TYPES.ExportAllDeclaration + | AST_NODE_TYPES.ExportDefaultDeclaration + | AST_NODE_TYPES.ExportNamedDeclaration + | AST_NODE_TYPES.ExportSpecifier + | AST_NODE_TYPES.ExpressionStatement + // | AST_NODE_TYPES.ExperimentalRestProperty + // | AST_NODE_TYPES.ExperimentalSpreadProperty + | AST_NODE_TYPES.ForStatement + | AST_NODE_TYPES.ForInStatement + | AST_NODE_TYPES.ForOfStatement + | AST_NODE_TYPES.FunctionDeclaration + | AST_NODE_TYPES.FunctionExpression + | AST_NODE_TYPES.Identifier + | AST_NODE_TYPES.IfStatement + | AST_NODE_TYPES.ImportDeclaration + | AST_NODE_TYPES.ImportDefaultSpecifier + | AST_NODE_TYPES.ImportExpression + | AST_NODE_TYPES.ImportNamespaceSpecifier + | AST_NODE_TYPES.ImportSpecifier + | AST_NODE_TYPES.JSXAttribute + | AST_NODE_TYPES.JSXClosingElement + | AST_NODE_TYPES.JSXElement + | AST_NODE_TYPES.JSXEmptyExpression + | AST_NODE_TYPES.JSXExpressionContainer + | AST_NODE_TYPES.JSXIdentifier + | AST_NODE_TYPES.JSXMemberExpression + | AST_NODE_TYPES.JSXNamespacedName + | AST_NODE_TYPES.JSXOpeningElement + | AST_NODE_TYPES.JSXSpreadAttribute + | AST_NODE_TYPES.JSXText + | AST_NODE_TYPES.JSXFragment + | AST_NODE_TYPES.JSXClosingFragment + | AST_NODE_TYPES.JSXOpeningFragment + | AST_NODE_TYPES.Literal + | AST_NODE_TYPES.LabeledStatement + | AST_NODE_TYPES.LogicalExpression + | AST_NODE_TYPES.MemberExpression + | AST_NODE_TYPES.MetaProperty + | AST_NODE_TYPES.MethodDefinition + | AST_NODE_TYPES.NewExpression + | AST_NODE_TYPES.ObjectExpression + | AST_NODE_TYPES.ObjectPattern + | AST_NODE_TYPES.PrivateIdentifier + | AST_NODE_TYPES.Program + | AST_NODE_TYPES.Property + | AST_NODE_TYPES.PropertyDefinition + | AST_NODE_TYPES.RestElement + | AST_NODE_TYPES.ReturnStatement + | AST_NODE_TYPES.SequenceExpression + | AST_NODE_TYPES.SpreadElement + | AST_NODE_TYPES.StaticBlock + | AST_NODE_TYPES.Super + | AST_NODE_TYPES.SwitchStatement + | AST_NODE_TYPES.SwitchCase + | AST_NODE_TYPES.TaggedTemplateExpression + | AST_NODE_TYPES.TemplateElement + | AST_NODE_TYPES.TemplateLiteral + | AST_NODE_TYPES.ThisExpression + | AST_NODE_TYPES.ThrowStatement + | AST_NODE_TYPES.TryStatement + | AST_NODE_TYPES.UnaryExpression + | AST_NODE_TYPES.UpdateExpression + | AST_NODE_TYPES.VariableDeclaration + | AST_NODE_TYPES.VariableDeclarator + | AST_NODE_TYPES.WhileStatement + | AST_NODE_TYPES.WithStatement + | AST_NODE_TYPES.YieldExpression; + // strictly type the arrays of keys provided to make sure we keep this config in sync with the type defs type AdditionalKeys = { - readonly [T in AST_NODE_TYPES]?: readonly GetNodeTypeKeys[]; + readonly // require keys for all nodes NOT defined in `eslint-visitor-keys` + [T in Exclude< + AST_NODE_TYPES, + KeysDefinedInESLintVisitorKeysCore + >]: readonly GetNodeTypeKeys[]; +} & { + readonly // optionally allow keys for all nodes defined in `eslint-visitor-keys` + [T in KeysDefinedInESLintVisitorKeysCore]?: readonly GetNodeTypeKeys[]; }; -const additionalKeys: AdditionalKeys = { - // Stage 3 Import Assertions - ImportAttribute: ['key', 'value'], +/** + * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! IMPORTANT NOTE !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + * + * The key arrays should be sorted in the order in which you would want to visit + * the child keys - don't just sort them alphabetically. + */ + +// eslint-disable-next-line @typescript-eslint/explicit-function-return-type -- TODO - add ignore IIFE option +const SharedVisitorKeys = (() => { + const FunctionType = ['typeParameters', 'params', 'returnType'] as const; + const AnonymousFunction = [...FunctionType, 'body'] as const; + const AbstractPropertyDefinition = [ + 'decorators', + 'key', + 'typeAnnotation', + ] as const; + + return { + AnonymousFunction, + Function: ['id', ...AnonymousFunction], + FunctionType, + + ClassDeclaration: [ + 'decorators', + 'id', + 'typeParameters', + 'superClass', + 'superTypeParameters', + 'implements', + 'body', + ], + + AbstractPropertyDefinition: ['decorators', 'key', 'typeAnnotation'], + PropertyDefinition: [...AbstractPropertyDefinition, 'value'], + TypeAssertion: ['expression', 'typeAnnotation'], + } as const; +})(); - // Additional Properties. +const additionalKeys: AdditionalKeys = { + AccessorProperty: SharedVisitorKeys.PropertyDefinition, ArrayPattern: ['decorators', 'elements', 'typeAnnotation'], - ArrowFunctionExpression: ['typeParameters', 'params', 'returnType', 'body'], + ArrowFunctionExpression: SharedVisitorKeys.AnonymousFunction, AssignmentPattern: ['decorators', 'left', 'right', 'typeAnnotation'], CallExpression: ['callee', 'typeArguments', 'arguments'], - ClassDeclaration: [ - 'decorators', - 'id', - 'typeParameters', - 'superClass', - 'superTypeParameters', - 'implements', - 'body', - ], - ClassExpression: [ - 'decorators', - 'id', - 'typeParameters', - 'superClass', - 'superTypeParameters', - 'implements', - 'body', - ], + ClassDeclaration: SharedVisitorKeys.ClassDeclaration, + ClassExpression: SharedVisitorKeys.ClassDeclaration, + Decorator: ['expression'], ExportAllDeclaration: ['exported', 'source', 'assertions'], ExportNamedDeclaration: ['declaration', 'specifiers', 'source', 'assertions'], - FunctionDeclaration: ['id', 'typeParameters', 'params', 'returnType', 'body'], - FunctionExpression: ['id', 'typeParameters', 'params', 'returnType', 'body'], + FunctionDeclaration: SharedVisitorKeys.Function, + FunctionExpression: SharedVisitorKeys.Function, Identifier: ['decorators', 'typeAnnotation'], + ImportAttribute: ['key', 'value'], ImportDeclaration: ['specifiers', 'source', 'assertions'], ImportExpression: ['source', 'attributes'], + JSXClosingFragment: [], + JSXOpeningElement: ['name', 'typeParameters', 'attributes'], + JSXOpeningFragment: [], + JSXSpreadChild: ['expression'], MethodDefinition: ['decorators', 'key', 'value', 'typeParameters'], NewExpression: ['callee', 'typeArguments', 'arguments'], ObjectPattern: ['decorators', 'properties', 'typeAnnotation'], - PropertyDefinition: ['decorators', 'key', 'typeAnnotation', 'value'], + PropertyDefinition: SharedVisitorKeys.PropertyDefinition, RestElement: ['decorators', 'argument', 'typeAnnotation'], - TaggedTemplateExpression: ['tag', 'typeParameters', 'quasi'], StaticBlock: ['body'], - - // JSX - JSXOpeningElement: ['name', 'typeParameters', 'attributes'], - JSXClosingFragment: [], - JSXOpeningFragment: [], - JSXSpreadChild: ['expression'], - - // Additional Nodes. - Decorator: ['expression'], - - // TS-prefixed nodes + TaggedTemplateExpression: ['tag', 'typeParameters', 'quasi'], + TSAbstractAccessorProperty: SharedVisitorKeys.AbstractPropertyDefinition, TSAbstractKeyword: [], TSAbstractMethodDefinition: ['key', 'value'], - TSAbstractPropertyDefinition: ['decorators', 'key', 'typeAnnotation'], + TSAbstractPropertyDefinition: SharedVisitorKeys.AbstractPropertyDefinition, TSAnyKeyword: [], TSArrayType: ['elementType'], - TSAsExpression: ['expression', 'typeAnnotation'], + TSAsExpression: SharedVisitorKeys.TypeAssertion, TSAsyncKeyword: [], TSBigIntKeyword: [], TSBooleanKeyword: [], - TSCallSignatureDeclaration: ['typeParameters', 'params', 'returnType'], + TSCallSignatureDeclaration: SharedVisitorKeys.FunctionType, TSClassImplements: ['expression', 'typeParameters'], TSConditionalType: ['checkType', 'extendsType', 'trueType', 'falseType'], - TSConstructorType: ['typeParameters', 'params', 'returnType'], - TSConstructSignatureDeclaration: ['typeParameters', 'params', 'returnType'], - TSDeclareFunction: ['id', 'typeParameters', 'params', 'returnType', 'body'], + TSConstructorType: SharedVisitorKeys.FunctionType, + TSConstructSignatureDeclaration: SharedVisitorKeys.FunctionType, + TSDeclareFunction: SharedVisitorKeys.Function, TSDeclareKeyword: [], - TSEmptyBodyFunctionExpression: [ - 'id', - 'typeParameters', - 'params', - 'returnType', - ], + TSEmptyBodyFunctionExpression: ['id', ...SharedVisitorKeys.FunctionType], TSEnumDeclaration: ['id', 'members'], TSEnumMember: ['id', 'initializer'], TSExportAssignment: ['expression'], TSExportKeyword: [], TSExternalModuleReference: ['expression'], - TSFunctionType: ['typeParameters', 'params', 'returnType'], + TSFunctionType: SharedVisitorKeys.FunctionType, TSImportEqualsDeclaration: ['id', 'moduleReference'], TSImportType: ['parameter', 'qualifier', 'typeParameters'], TSIndexedAccessType: ['indexType', 'objectType'], @@ -127,6 +233,12 @@ const additionalKeys: AdditionalKeys = { TSQualifiedName: ['left', 'right'], TSReadonlyKeyword: [], TSRestType: ['typeAnnotation'], + TSSatisfiesExpression: [ + // this is intentionally different to SharedVisitorKeys.TypeAssertion because + // the type annotation comes first in the source code + 'typeAnnotation', + 'expression', + ], TSStaticKeyword: [], TSStringKeyword: [], TSSymbolKeyword: [], @@ -135,7 +247,7 @@ const additionalKeys: AdditionalKeys = { TSTupleType: ['elementTypes'], TSTypeAliasDeclaration: ['id', 'typeParameters', 'typeAnnotation'], TSTypeAnnotation: ['typeAnnotation'], - TSTypeAssertion: ['typeAnnotation', 'expression'], + TSTypeAssertion: SharedVisitorKeys.TypeAssertion, TSTypeLiteral: ['members'], TSTypeOperator: ['typeAnnotation'], TSTypeParameter: ['name', 'constraint', 'default'], @@ -148,7 +260,7 @@ const additionalKeys: AdditionalKeys = { TSUnionType: ['types'], TSUnknownKeyword: [], TSVoidKeyword: [], -} as const; +}; const visitorKeys: VisitorKeys = eslintVisitorKeys.unionWith(additionalKeys); diff --git a/packages/visitor-keys/tests/visitor-keys.test.ts b/packages/visitor-keys/tests/visitor-keys.test.ts index ca727a5de33..784b0533c43 100644 --- a/packages/visitor-keys/tests/visitor-keys.test.ts +++ b/packages/visitor-keys/tests/visitor-keys.test.ts @@ -1,4 +1,5 @@ import { AST_NODE_TYPES } from '@typescript-eslint/types'; + import { visitorKeys } from '../src'; const types = new Set(Object.keys(AST_NODE_TYPES)); diff --git a/packages/website-eslint/CHANGELOG.md b/packages/website-eslint/CHANGELOG.md index 637e723e221..ea36b42047a 100644 --- a/packages/website-eslint/CHANGELOG.md +++ b/packages/website-eslint/CHANGELOG.md @@ -3,7 +3,7 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. -# [5.31.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.7...v5.31.0) (2022-07-25) +# [5.50.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.49.0...v5.50.0) (2023-01-31) **Note:** Version bump only for package @typescript-eslint/website-eslint @@ -11,7 +11,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline -## [5.30.7](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.6...v5.30.7) (2022-07-18) +# [5.49.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.48.2...v5.49.0) (2023-01-23) **Note:** Version bump only for package @typescript-eslint/website-eslint @@ -19,7 +19,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline -## [5.30.6](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.5...v5.30.6) (2022-07-11) +## [5.48.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.48.1...v5.48.2) (2023-01-16) **Note:** Version bump only for package @typescript-eslint/website-eslint @@ -27,7 +27,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline -## [5.30.5](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.4...v5.30.5) (2022-07-04) +## [5.48.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.48.0...v5.48.1) (2023-01-09) **Note:** Version bump only for package @typescript-eslint/website-eslint @@ -35,292 +35,274 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline -## [5.30.4](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.3...v5.30.4) (2022-07-03) +# [5.48.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.47.1...v5.48.0) (2023-01-02) **Note:** Version bump only for package @typescript-eslint/website-eslint +## [5.47.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.47.0...v5.47.1) (2022-12-26) +**Note:** Version bump only for package @typescript-eslint/website-eslint +# [5.47.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.46.1...v5.47.0) (2022-12-19) +**Note:** Version bump only for package @typescript-eslint/website-eslint -## [5.30.3](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.2...v5.30.3) (2022-07-01) +## [5.46.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.46.0...v5.46.1) (2022-12-12) **Note:** Version bump only for package @typescript-eslint/website-eslint +# [5.46.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.45.1...v5.46.0) (2022-12-08) +**Note:** Version bump only for package @typescript-eslint/website-eslint +## [5.45.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.45.0...v5.45.1) (2022-12-05) +**Note:** Version bump only for package @typescript-eslint/website-eslint -## [5.30.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.1...v5.30.2) (2022-07-01) +# [5.45.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.44.0...v5.45.0) (2022-11-28) **Note:** Version bump only for package @typescript-eslint/website-eslint +# [5.44.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.43.0...v5.44.0) (2022-11-21) +**Note:** Version bump only for package @typescript-eslint/website-eslint +# [5.43.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.42.1...v5.43.0) (2022-11-14) +**Note:** Version bump only for package @typescript-eslint/website-eslint -## 5.30.1 (2022-07-01) +## [5.42.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.42.0...v5.42.1) (2022-11-07) **Note:** Version bump only for package @typescript-eslint/website-eslint +# [5.42.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.41.0...v5.42.0) (2022-10-31) +**Note:** Version bump only for package @typescript-eslint/website-eslint +# [5.41.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.40.1...v5.41.0) (2022-10-24) +**Note:** Version bump only for package @typescript-eslint/website-eslint -# [5.30.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.29.0...v5.30.0) (2022-06-27) +## [5.40.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.40.0...v5.40.1) (2022-10-17) **Note:** Version bump only for package @typescript-eslint/website-eslint +# [5.40.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.39.0...v5.40.0) (2022-10-10) +**Note:** Version bump only for package @typescript-eslint/website-eslint +# [5.39.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.38.1...v5.39.0) (2022-10-03) +**Note:** Version bump only for package @typescript-eslint/website-eslint -# [5.29.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.28.0...v5.29.0) (2022-06-20) +## [5.38.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.38.0...v5.38.1) (2022-09-26) **Note:** Version bump only for package @typescript-eslint/website-eslint +# [5.38.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.37.0...v5.38.0) (2022-09-19) +**Note:** Version bump only for package @typescript-eslint/website-eslint +# [5.37.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.36.2...v5.37.0) (2022-09-12) +**Note:** Version bump only for package @typescript-eslint/website-eslint -# [5.28.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.27.1...v5.28.0) (2022-06-13) +## [5.36.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.36.1...v5.36.2) (2022-09-05) **Note:** Version bump only for package @typescript-eslint/website-eslint +## [5.36.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.36.0...v5.36.1) (2022-08-30) +**Note:** Version bump only for package @typescript-eslint/website-eslint +# [5.36.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.35.1...v5.36.0) (2022-08-30) +**Note:** Version bump only for package @typescript-eslint/website-eslint -## [5.27.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.27.0...v5.27.1) (2022-06-06) +## [5.35.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.35.0...v5.35.1) (2022-08-24) **Note:** Version bump only for package @typescript-eslint/website-eslint +# [5.35.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.34.0...v5.35.0) (2022-08-24) +**Note:** Version bump only for package @typescript-eslint/website-eslint +# [5.34.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.33.1...v5.34.0) (2022-08-22) +**Note:** Version bump only for package @typescript-eslint/website-eslint -# [5.27.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.26.0...v5.27.0) (2022-05-30) +## [5.33.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.33.0...v5.33.1) (2022-08-15) +**Note:** Version bump only for package @typescript-eslint/website-eslint -### Features +# [5.33.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.32.0...v5.33.0) (2022-08-08) -* [4.7] support new extensions ([#5027](https://github.com/typescript-eslint/typescript-eslint/issues/5027)) ([efc147b](https://github.com/typescript-eslint/typescript-eslint/commit/efc147b04dce52ab17415b6a4ae4076b944b9036)) +**Note:** Version bump only for package @typescript-eslint/website-eslint +# [5.32.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.31.0...v5.32.0) (2022-08-01) +**Note:** Version bump only for package @typescript-eslint/website-eslint +# [5.31.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.7...v5.31.0) (2022-07-25) +**Note:** Version bump only for package @typescript-eslint/website-eslint -# [5.26.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.25.0...v5.26.0) (2022-05-23) +## [5.30.7](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.6...v5.30.7) (2022-07-18) **Note:** Version bump only for package @typescript-eslint/website-eslint +## [5.30.6](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.5...v5.30.6) (2022-07-11) +**Note:** Version bump only for package @typescript-eslint/website-eslint +## [5.30.5](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.4...v5.30.5) (2022-07-04) +**Note:** Version bump only for package @typescript-eslint/website-eslint -# [5.25.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.24.0...v5.25.0) (2022-05-17) +## [5.30.4](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.3...v5.30.4) (2022-07-03) **Note:** Version bump only for package @typescript-eslint/website-eslint +## [5.30.3](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.2...v5.30.3) (2022-07-01) +**Note:** Version bump only for package @typescript-eslint/website-eslint +## [5.30.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.1...v5.30.2) (2022-07-01) +**Note:** Version bump only for package @typescript-eslint/website-eslint -# [5.24.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.23.0...v5.24.0) (2022-05-16) +## 5.30.1 (2022-07-01) **Note:** Version bump only for package @typescript-eslint/website-eslint +# [5.30.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.29.0...v5.30.0) (2022-06-27) +**Note:** Version bump only for package @typescript-eslint/website-eslint +# [5.29.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.28.0...v5.29.0) (2022-06-20) +**Note:** Version bump only for package @typescript-eslint/website-eslint -# [5.23.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.22.0...v5.23.0) (2022-05-09) +# [5.28.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.27.1...v5.28.0) (2022-06-13) **Note:** Version bump only for package @typescript-eslint/website-eslint +## [5.27.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.27.0...v5.27.1) (2022-06-06) + +**Note:** Version bump only for package @typescript-eslint/website-eslint +# [5.27.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.26.0...v5.27.0) (2022-05-30) +### Features +- [4.7] support new extensions ([#5027](https://github.com/typescript-eslint/typescript-eslint/issues/5027)) ([efc147b](https://github.com/typescript-eslint/typescript-eslint/commit/efc147b04dce52ab17415b6a4ae4076b944b9036)) -# [5.22.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.21.0...v5.22.0) (2022-05-02) +# [5.26.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.25.0...v5.26.0) (2022-05-23) **Note:** Version bump only for package @typescript-eslint/website-eslint +# [5.25.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.24.0...v5.25.0) (2022-05-17) +**Note:** Version bump only for package @typescript-eslint/website-eslint +# [5.24.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.23.0...v5.24.0) (2022-05-16) +**Note:** Version bump only for package @typescript-eslint/website-eslint -# [5.21.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.20.0...v5.21.0) (2022-04-25) +# [5.23.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.22.0...v5.23.0) (2022-05-09) **Note:** Version bump only for package @typescript-eslint/website-eslint +# [5.22.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.21.0...v5.22.0) (2022-05-02) +**Note:** Version bump only for package @typescript-eslint/website-eslint +# [5.21.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.20.0...v5.21.0) (2022-04-25) +**Note:** Version bump only for package @typescript-eslint/website-eslint # [5.20.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.19.0...v5.20.0) (2022-04-18) **Note:** Version bump only for package @typescript-eslint/website-eslint - - - - # [5.19.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.18.0...v5.19.0) (2022-04-11) **Note:** Version bump only for package @typescript-eslint/website-eslint - - - - # [5.18.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.17.0...v5.18.0) (2022-04-04) **Note:** Version bump only for package @typescript-eslint/website-eslint - - - - # [5.17.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.16.0...v5.17.0) (2022-03-28) **Note:** Version bump only for package @typescript-eslint/website-eslint - - - - # [5.16.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.15.0...v5.16.0) (2022-03-21) **Note:** Version bump only for package @typescript-eslint/website-eslint - - - - # [5.15.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.14.0...v5.15.0) (2022-03-14) **Note:** Version bump only for package @typescript-eslint/website-eslint - - - - # [5.14.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.13.0...v5.14.0) (2022-03-07) **Note:** Version bump only for package @typescript-eslint/website-eslint - - - - # [5.13.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.12.1...v5.13.0) (2022-02-28) **Note:** Version bump only for package @typescript-eslint/website-eslint - - - - ## [5.12.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.12.0...v5.12.1) (2022-02-21) **Note:** Version bump only for package @typescript-eslint/website-eslint - - - - # [5.12.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.11.0...v5.12.0) (2022-02-14) **Note:** Version bump only for package @typescript-eslint/website-eslint - - - - # [5.11.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.10.2...v5.11.0) (2022-02-07) **Note:** Version bump only for package @typescript-eslint/website-eslint - - - - ## [5.10.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.10.1...v5.10.2) (2022-01-31) **Note:** Version bump only for package @typescript-eslint/website-eslint - - - - ## [5.10.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.10.0...v5.10.1) (2022-01-24) **Note:** Version bump only for package @typescript-eslint/website-eslint - - - - # [5.10.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.9.1...v5.10.0) (2022-01-17) - ### Features -* rename `experimental-utils` to `utils` and make `experimental-utils` an alias to the new package ([#4172](https://github.com/typescript-eslint/typescript-eslint/issues/4172)) ([1d55a75](https://github.com/typescript-eslint/typescript-eslint/commit/1d55a7511b38d8e2b2eabe59f639e0a865e6c93f)) - - - - +- rename `experimental-utils` to `utils` and make `experimental-utils` an alias to the new package ([#4172](https://github.com/typescript-eslint/typescript-eslint/issues/4172)) ([1d55a75](https://github.com/typescript-eslint/typescript-eslint/commit/1d55a7511b38d8e2b2eabe59f639e0a865e6c93f)) ## [5.9.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.9.0...v5.9.1) (2022-01-10) **Note:** Version bump only for package @typescript-eslint/website-eslint - - - - # [5.9.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.8.1...v5.9.0) (2022-01-03) **Note:** Version bump only for package @typescript-eslint/website-eslint - - - - ## [5.8.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.8.0...v5.8.1) (2021-12-27) **Note:** Version bump only for package @typescript-eslint/website-eslint - - - - # [5.8.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.7.0...v5.8.0) (2021-12-20) **Note:** Version bump only for package @typescript-eslint/website-eslint - - - - # [5.7.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.6.0...v5.7.0) (2021-12-13) **Note:** Version bump only for package @typescript-eslint/website-eslint - - - - # [5.6.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.5.0...v5.6.0) (2021-12-06) **Note:** Version bump only for package @typescript-eslint/website-eslint - - - - # [5.5.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.4.0...v5.5.0) (2021-11-29) **Note:** Version bump only for package @typescript-eslint/website-eslint diff --git a/packages/website-eslint/package.json b/packages/website-eslint/package.json index 28493ffc35a..6bb1f6d3f90 100644 --- a/packages/website-eslint/package.json +++ b/packages/website-eslint/package.json @@ -1,6 +1,6 @@ { "name": "@typescript-eslint/website-eslint", - "version": "5.31.0", + "version": "5.50.0", "private": true, "description": "ESLint which works in browsers.", "engines": { @@ -16,19 +16,19 @@ "format": "prettier --write \"./**/*.{ts,mts,cts,tsx,js,mjs,cjs,jsx,json,md,css}\" --ignore-path ../../.prettierignore" }, "dependencies": { - "@typescript-eslint/types": "5.31.0", - "@typescript-eslint/utils": "5.31.0" + "@typescript-eslint/types": "5.50.0", + "@typescript-eslint/utils": "5.50.0" }, "devDependencies": { - "@rollup/plugin-commonjs": "^22.0.0", - "@rollup/plugin-json": "^4.1.0", - "@rollup/plugin-node-resolve": "^13.3.0", - "@rollup/pluginutils": "^4.2.1", - "@typescript-eslint/eslint-plugin": "5.31.0", - "@typescript-eslint/parser": "5.31.0", - "@typescript-eslint/scope-manager": "5.31.0", - "@typescript-eslint/typescript-estree": "5.31.0", - "@typescript-eslint/visitor-keys": "5.31.0", + "@rollup/plugin-commonjs": "^23.0.0", + "@rollup/plugin-json": "^5.0.0", + "@rollup/plugin-node-resolve": "^15.0.0", + "@rollup/pluginutils": "^5.0.0", + "@typescript-eslint/eslint-plugin": "5.50.0", + "@typescript-eslint/parser": "5.50.0", + "@typescript-eslint/scope-manager": "5.50.0", + "@typescript-eslint/typescript-estree": "5.50.0", + "@typescript-eslint/visitor-keys": "5.50.0", "eslint": "*", "rollup": "^2.75.4", "rollup-plugin-terser": "^7.0.2", diff --git a/packages/website-eslint/project.json b/packages/website-eslint/project.json index ac6ff89fcb8..862c5b948f1 100644 --- a/packages/website-eslint/project.json +++ b/packages/website-eslint/project.json @@ -1,5 +1,6 @@ { - "root": "packages/website-eslint", + "name": "website-eslint", + "$schema": "../../node_modules/nx/schemas/project-schema.json", "type": "library", "implicitDependencies": [] } diff --git a/packages/website-eslint/rollup.config.js b/packages/website-eslint/rollup.config.js index 4175b1e754e..825b60cec25 100644 --- a/packages/website-eslint/rollup.config.js +++ b/packages/website-eslint/rollup.config.js @@ -27,15 +27,19 @@ module.exports = { match: [ /eslint\/lib\/(rule-tester|eslint|cli-engine|init)\//u, /eslint\/lib\/cli\.js$/, - /utils\/dist\/eslint-utils\/RuleTester\.js$/, + /utils\/dist\/eslint-utils\/rule-tester\/RuleTester\.js$/, /utils\/dist\/ts-eslint\/CLIEngine\.js$/, /utils\/dist\/ts-eslint\/RuleTester\.js$/, - /typescript-estree\/dist\/create-program\/createWatchProgram\.js/, + /typescript-estree\/dist\/create-program\/getWatchProgramsForProjects\.js/, /typescript-estree\/dist\/create-program\/createProjectProgram\.js/, /typescript-estree\/dist\/create-program\/createIsolatedProgram\.js/, /utils\/dist\/ts-eslint\/ESLint\.js/, // 'eslint/lib/shared/ajv.js', // 'eslint/lib/shared/runtime-info.js', + /ajv\/lib\/definition_schema\.js/, + /stream/, + /os/, + /fs/, ], target: './src/mock/empty.js', }, @@ -64,6 +68,14 @@ module.exports = { match: /semver$/u, target: './src/mock/semver.js', }, + { + match: /^globby$/u, + target: './src/mock/globby.js', + }, + { + match: /^is-glob$/u, + target: './src/mock/is-glob.js', + }, ], replace: [ { diff --git a/packages/website-eslint/src/mock/globby.js b/packages/website-eslint/src/mock/globby.js new file mode 100644 index 00000000000..80c2ae2d9e1 --- /dev/null +++ b/packages/website-eslint/src/mock/globby.js @@ -0,0 +1,4 @@ +export function sync() { + // the website config is static and doesn't use glob config + return []; +} diff --git a/packages/website-eslint/src/mock/is-glob.js b/packages/website-eslint/src/mock/is-glob.js new file mode 100644 index 00000000000..e35771f6460 --- /dev/null +++ b/packages/website-eslint/src/mock/is-glob.js @@ -0,0 +1,4 @@ +export default function isGlob() { + // the website config is static and doesn't use glob config + return false; +} diff --git a/packages/website-eslint/src/mock/semver.js b/packages/website-eslint/src/mock/semver.js index ba292927fe9..a7671aaaf06 100644 --- a/packages/website-eslint/src/mock/semver.js +++ b/packages/website-eslint/src/mock/semver.js @@ -1,4 +1,7 @@ import satisfies from 'semver/functions/satisfies'; import major from 'semver/functions/major'; +// just in case someone adds a import * as semver usage export { satisfies, major }; + +export default { satisfies, major }; diff --git a/packages/website/.eslintrc.js b/packages/website/.eslintrc.js index 8b30fb62498..323ce34a38d 100644 --- a/packages/website/.eslintrc.js +++ b/packages/website/.eslintrc.js @@ -9,6 +9,7 @@ module.exports = { overrides: [ { files: [ + './*.config.*', './src/pages/*.tsx', './src/components/**/*.tsx', './src/components/hooks/*.ts', @@ -22,7 +23,7 @@ module.exports = { 'react/jsx-no-target-blank': 'off', 'react/no-unescaped-entities': 'off', '@typescript-eslint/internal/prefer-ast-types-enum': 'off', - 'react-hooks/exhaustive-deps': 'off', // TODO: enable it later + 'react/jsx-curly-brace-presence': 'error', }, settings: { react: { diff --git a/packages/website/CHANGELOG.md b/packages/website/CHANGELOG.md index f7a084c3dbe..547367d081f 100644 --- a/packages/website/CHANGELOG.md +++ b/packages/website/CHANGELOG.md @@ -3,7 +3,7 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. -# [5.31.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.7...v5.31.0) (2022-07-25) +# [5.50.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.49.0...v5.50.0) (2023-01-31) **Note:** Version bump only for package website @@ -11,7 +11,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline -## [5.30.7](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.6...v5.30.7) (2022-07-18) +# [5.49.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.48.2...v5.49.0) (2023-01-23) **Note:** Version bump only for package website @@ -19,7 +19,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline -## [5.30.6](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.5...v5.30.6) (2022-07-11) +## [5.48.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.48.1...v5.48.2) (2023-01-16) **Note:** Version bump only for package website @@ -27,7 +27,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline -## [5.30.5](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.4...v5.30.5) (2022-07-04) +## [5.48.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.48.0...v5.48.1) (2023-01-09) **Note:** Version bump only for package website @@ -35,323 +35,319 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline -## [5.30.4](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.3...v5.30.4) (2022-07-03) +# [5.48.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.47.1...v5.48.0) (2023-01-02) **Note:** Version bump only for package website +## [5.47.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.47.0...v5.47.1) (2022-12-26) +**Note:** Version bump only for package website +# [5.47.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.46.1...v5.47.0) (2022-12-19) +**Note:** Version bump only for package website -## [5.30.3](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.2...v5.30.3) (2022-07-01) +## [5.46.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.46.0...v5.46.1) (2022-12-12) **Note:** Version bump only for package website +# [5.46.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.45.1...v5.46.0) (2022-12-08) +**Note:** Version bump only for package website +## [5.45.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.45.0...v5.45.1) (2022-12-05) +**Note:** Version bump only for package website -## [5.30.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.1...v5.30.2) (2022-07-01) +# [5.45.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.44.0...v5.45.0) (2022-11-28) **Note:** Version bump only for package website +# [5.44.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.43.0...v5.44.0) (2022-11-21) +**Note:** Version bump only for package website +# [5.43.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.42.1...v5.43.0) (2022-11-14) +**Note:** Version bump only for package website -## 5.30.1 (2022-07-01) +## [5.42.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.42.0...v5.42.1) (2022-11-07) **Note:** Version bump only for package website +# [5.42.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.41.0...v5.42.0) (2022-10-31) +### Bug Fixes +- **eslint-plugin:** enable react/jsx-curly-brace-presence lint rule in website package ([#5894](https://github.com/typescript-eslint/typescript-eslint/issues/5894)) ([344322a](https://github.com/typescript-eslint/typescript-eslint/commit/344322add846d03c6c9981e486b09e6ba1196555)) +### Features -# [5.30.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.29.0...v5.30.0) (2022-06-27) +- **scope-manager:** ignore ECMA version ([#5881](https://github.com/typescript-eslint/typescript-eslint/issues/5881)) ([3b8d449](https://github.com/typescript-eslint/typescript-eslint/commit/3b8d449696c319690536a18a48ef32749dc2f559)) +- **website:** Add a happy message to playground output pane when no errors or AST ([#5868](https://github.com/typescript-eslint/typescript-eslint/issues/5868)) ([#5873](https://github.com/typescript-eslint/typescript-eslint/issues/5873)) ([c4e0d86](https://github.com/typescript-eslint/typescript-eslint/commit/c4e0d8678e0398f3ab85510f40ad6f97832b9e6d)) -**Note:** Version bump only for package website +### Reverts +- Revert "feat(scope-manager): ignore ECMA version" (#5888) ([2ee81df](https://github.com/typescript-eslint/typescript-eslint/commit/2ee81df5a365d82ef4b3dfc124d4ec39c7bcb725)), closes [#5888](https://github.com/typescript-eslint/typescript-eslint/issues/5888) [#5881](https://github.com/typescript-eslint/typescript-eslint/issues/5881) +# [5.41.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.40.1...v5.41.0) (2022-10-24) +**Note:** Version bump only for package website +## [5.40.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.40.0...v5.40.1) (2022-10-17) -# [5.29.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.28.0...v5.29.0) (2022-06-20) +**Note:** Version bump only for package website +# [5.40.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.39.0...v5.40.0) (2022-10-10) ### Features -* **website:** open issue with rule name if only one rule is enabled ([#5190](https://github.com/typescript-eslint/typescript-eslint/issues/5190)) ([b229ee4](https://github.com/typescript-eslint/typescript-eslint/commit/b229ee4ace1417d2d4f7d6cafa039f073e845c3a)) - - +- **website:** store options TypeScript, Enable jsx and AST Viewer in browser's local storage ([#5769](https://github.com/typescript-eslint/typescript-eslint/issues/5769)) ([77d2336](https://github.com/typescript-eslint/typescript-eslint/commit/77d2336594ca10b47c0f7978ae64f87d24a25d33)) +# [5.39.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.38.1...v5.39.0) (2022-10-03) +**Note:** Version bump only for package website -# [5.28.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.27.1...v5.28.0) (2022-06-13) +## [5.38.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.38.0...v5.38.1) (2022-09-26) **Note:** Version bump only for package website +# [5.38.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.37.0...v5.38.0) (2022-09-19) +### Features +- **website:** add warning on top of formatting rule docs pages ([#5598](https://github.com/typescript-eslint/typescript-eslint/issues/5598)) ([5dfa2e9](https://github.com/typescript-eslint/typescript-eslint/commit/5dfa2e9a33491905e99d8940dbdac0b31ada4858)) +# [5.37.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.36.2...v5.37.0) (2022-09-12) -## [5.27.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.27.0...v5.27.1) (2022-06-06) +### Bug Fixes -**Note:** Version bump only for package website +- **website:** Use extended base rule name from file's meta ([#5621](https://github.com/typescript-eslint/typescript-eslint/issues/5621)) ([7fd2f89](https://github.com/typescript-eslint/typescript-eslint/commit/7fd2f89ae732ca12ec83fad278362032473ff3ca)) +### Features +- **docs:** always expanding collapsible sidebar menus under docs ([#5608](https://github.com/typescript-eslint/typescript-eslint/issues/5608)) ([8176fb1](https://github.com/typescript-eslint/typescript-eslint/commit/8176fb15299943cbf20385eb0ea7ba877e193285)) +## [5.36.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.36.1...v5.36.2) (2022-09-05) +**Note:** Version bump only for package website -# [5.27.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.26.0...v5.27.0) (2022-05-30) +## [5.36.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.36.0...v5.36.1) (2022-08-30) +**Note:** Version bump only for package website + +# [5.36.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.35.1...v5.36.0) (2022-08-30) ### Features -* [4.7] support new extensions ([#5027](https://github.com/typescript-eslint/typescript-eslint/issues/5027)) ([efc147b](https://github.com/typescript-eslint/typescript-eslint/commit/efc147b04dce52ab17415b6a4ae4076b944b9036)) +- support TypeScript 4.8 ([#5551](https://github.com/typescript-eslint/typescript-eslint/issues/5551)) ([81450ed](https://github.com/typescript-eslint/typescript-eslint/commit/81450ed7eaede74b384e9a91a84e9b4d34513866)) +## [5.35.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.35.0...v5.35.1) (2022-08-24) +### Bug Fixes +- **eslint-plugin:** correct rule schemas to pass ajv validation ([#5531](https://github.com/typescript-eslint/typescript-eslint/issues/5531)) ([dbf8b56](https://github.com/typescript-eslint/typescript-eslint/commit/dbf8b569dbada29e4a295d6c265976e55de1b2aa)) - -# [5.26.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.25.0...v5.26.0) (2022-05-23) +# [5.35.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.34.0...v5.35.0) (2022-08-24) **Note:** Version bump only for package website +# [5.34.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.33.1...v5.34.0) (2022-08-22) +### Features +- **eslint-plugin:** [prefer-optional-chain] support suggesting `!foo || !foo.bar` as a valid match for the rule ([#5266](https://github.com/typescript-eslint/typescript-eslint/issues/5266)) ([aca935c](https://github.com/typescript-eslint/typescript-eslint/commit/aca935c9696712d4aff18144c4690db4d6ba9bf9)) - -# [5.25.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.24.0...v5.25.0) (2022-05-17) +## [5.33.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.33.0...v5.33.1) (2022-08-15) **Note:** Version bump only for package website +# [5.33.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.32.0...v5.33.0) (2022-08-08) +**Note:** Version bump only for package website +# [5.32.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.31.0...v5.32.0) (2022-08-01) +**Note:** Version bump only for package website -# [5.24.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.23.0...v5.24.0) (2022-05-16) +# [5.31.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.7...v5.31.0) (2022-07-25) +**Note:** Version bump only for package website -### Features +## [5.30.7](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.6...v5.30.7) (2022-07-18) -* **eslint-plugin:** add new 'strict' config ([#4706](https://github.com/typescript-eslint/typescript-eslint/issues/4706)) ([4a500b2](https://github.com/typescript-eslint/typescript-eslint/commit/4a500b2d92a91873dbb729793d1ee1c36ef06ed8)) +**Note:** Version bump only for package website +## [5.30.6](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.5...v5.30.6) (2022-07-11) +**Note:** Version bump only for package website +## [5.30.5](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.4...v5.30.5) (2022-07-04) +**Note:** Version bump only for package website -# [5.23.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.22.0...v5.23.0) (2022-05-09) +## [5.30.4](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.3...v5.30.4) (2022-07-03) **Note:** Version bump only for package website +## [5.30.3](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.2...v5.30.3) (2022-07-01) +**Note:** Version bump only for package website +## [5.30.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.30.1...v5.30.2) (2022-07-01) +**Note:** Version bump only for package website -# [5.22.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.21.0...v5.22.0) (2022-05-02) +## 5.30.1 (2022-07-01) **Note:** Version bump only for package website +# [5.30.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.29.0...v5.30.0) (2022-06-27) +**Note:** Version bump only for package website +# [5.29.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.28.0...v5.29.0) (2022-06-20) +### Features -# [5.21.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.20.0...v5.21.0) (2022-04-25) +- **website:** open issue with rule name if only one rule is enabled ([#5190](https://github.com/typescript-eslint/typescript-eslint/issues/5190)) ([b229ee4](https://github.com/typescript-eslint/typescript-eslint/commit/b229ee4ace1417d2d4f7d6cafa039f073e845c3a)) + +# [5.28.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.27.1...v5.28.0) (2022-06-13) **Note:** Version bump only for package website +## [5.27.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.27.0...v5.27.1) (2022-06-06) +**Note:** Version bump only for package website +# [5.27.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.26.0...v5.27.0) (2022-05-30) +### Features -# [5.20.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.19.0...v5.20.0) (2022-04-18) +- [4.7] support new extensions ([#5027](https://github.com/typescript-eslint/typescript-eslint/issues/5027)) ([efc147b](https://github.com/typescript-eslint/typescript-eslint/commit/efc147b04dce52ab17415b6a4ae4076b944b9036)) + +# [5.26.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.25.0...v5.26.0) (2022-05-23) **Note:** Version bump only for package website +# [5.25.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.24.0...v5.25.0) (2022-05-17) +**Note:** Version bump only for package website +# [5.24.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.23.0...v5.24.0) (2022-05-16) +### Features -# [5.19.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.18.0...v5.19.0) (2022-04-11) +- **eslint-plugin:** add new 'strict' config ([#4706](https://github.com/typescript-eslint/typescript-eslint/issues/4706)) ([4a500b2](https://github.com/typescript-eslint/typescript-eslint/commit/4a500b2d92a91873dbb729793d1ee1c36ef06ed8)) + +# [5.23.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.22.0...v5.23.0) (2022-05-09) **Note:** Version bump only for package website +# [5.22.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.21.0...v5.22.0) (2022-05-02) +**Note:** Version bump only for package website +# [5.21.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.20.0...v5.21.0) (2022-04-25) +**Note:** Version bump only for package website -# [5.18.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.17.0...v5.18.0) (2022-04-04) +# [5.20.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.19.0...v5.20.0) (2022-04-18) **Note:** Version bump only for package website +# [5.19.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.18.0...v5.19.0) (2022-04-11) +**Note:** Version bump only for package website +# [5.18.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.17.0...v5.18.0) (2022-04-04) +**Note:** Version bump only for package website # [5.17.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.16.0...v5.17.0) (2022-03-28) - ### Bug Fixes -* code container hiding navigation menu ([#4707](https://github.com/typescript-eslint/typescript-eslint/issues/4707)) ([96bc69a](https://github.com/typescript-eslint/typescript-eslint/commit/96bc69a652c7f6f474a39f1e9783e7fbd446696a)) -* revert "chore: Bump cypress from 8.3.0 to 9.5.2", and ignore cypress for now ([#4740](https://github.com/typescript-eslint/typescript-eslint/issues/4740)) ([cf5f5c4](https://github.com/typescript-eslint/typescript-eslint/commit/cf5f5c441ab0c4fb056bd688795ffc55e026627a)), closes [#4710](https://github.com/typescript-eslint/typescript-eslint/issues/4710) - - - - +- code container hiding navigation menu ([#4707](https://github.com/typescript-eslint/typescript-eslint/issues/4707)) ([96bc69a](https://github.com/typescript-eslint/typescript-eslint/commit/96bc69a652c7f6f474a39f1e9783e7fbd446696a)) +- revert "chore: Bump cypress from 8.3.0 to 9.5.2", and ignore cypress for now ([#4740](https://github.com/typescript-eslint/typescript-eslint/issues/4740)) ([cf5f5c4](https://github.com/typescript-eslint/typescript-eslint/commit/cf5f5c441ab0c4fb056bd688795ffc55e026627a)), closes [#4710](https://github.com/typescript-eslint/typescript-eslint/issues/4710) # [5.16.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.15.0...v5.16.0) (2022-03-21) **Note:** Version bump only for package website - - - - # [5.15.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.14.0...v5.15.0) (2022-03-14) **Note:** Version bump only for package website - - - - # [5.14.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.13.0...v5.14.0) (2022-03-07) **Note:** Version bump only for package website - - - - # [5.13.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.12.1...v5.13.0) (2022-02-28) - ### Features -* **eslint-plugin:** [no-misused-promises] check more places for checksVoidReturn ([#4541](https://github.com/typescript-eslint/typescript-eslint/issues/4541)) ([052cf51](https://github.com/typescript-eslint/typescript-eslint/commit/052cf51fe663283afe89dc7bf97c947e750df095)) - - - - +- **eslint-plugin:** [no-misused-promises] check more places for checksVoidReturn ([#4541](https://github.com/typescript-eslint/typescript-eslint/issues/4541)) ([052cf51](https://github.com/typescript-eslint/typescript-eslint/commit/052cf51fe663283afe89dc7bf97c947e750df095)) ## [5.12.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.12.0...v5.12.1) (2022-02-21) **Note:** Version bump only for package website - - - - # [5.12.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.11.0...v5.12.0) (2022-02-14) **Note:** Version bump only for package website - - - - # [5.11.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.10.2...v5.11.0) (2022-02-07) **Note:** Version bump only for package website - - - - ## [5.10.2](https://github.com/typescript-eslint/typescript-eslint/compare/v5.10.1...v5.10.2) (2022-01-31) **Note:** Version bump only for package website - - - - ## [5.10.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.10.0...v5.10.1) (2022-01-24) **Note:** Version bump only for package website - - - - # [5.10.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.9.1...v5.10.0) (2022-01-17) **Note:** Version bump only for package website - - - - ## [5.9.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.9.0...v5.9.1) (2022-01-10) **Note:** Version bump only for package website - - - - # [5.9.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.8.1...v5.9.0) (2022-01-03) **Note:** Version bump only for package website - - - - ## [5.8.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.8.0...v5.8.1) (2021-12-27) **Note:** Version bump only for package website - - - - # [5.8.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.7.0...v5.8.0) (2021-12-20) **Note:** Version bump only for package website - - - - # [5.7.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.6.0...v5.7.0) (2021-12-13) **Note:** Version bump only for package website - - - - # [5.6.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.5.0...v5.6.0) (2021-12-06) - ### Features -* **scope-manager:** support TS4.5 import/export specifier kind ([#4234](https://github.com/typescript-eslint/typescript-eslint/issues/4234)) ([833f822](https://github.com/typescript-eslint/typescript-eslint/commit/833f8221ce00aecb7d08c519bab9568353850f48)) - - - - +- **scope-manager:** support TS4.5 import/export specifier kind ([#4234](https://github.com/typescript-eslint/typescript-eslint/issues/4234)) ([833f822](https://github.com/typescript-eslint/typescript-eslint/commit/833f8221ce00aecb7d08c519bab9568353850f48)) # [5.5.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.4.0...v5.5.0) (2021-11-29) **Note:** Version bump only for package website - - - - # [5.4.0](https://github.com/typescript-eslint/typescript-eslint/compare/v5.3.1...v5.4.0) (2021-11-15) - ### Bug Fixes -* landing page title duplication ([#4123](https://github.com/typescript-eslint/typescript-eslint/issues/4123)) ([844c25e](https://github.com/typescript-eslint/typescript-eslint/commit/844c25e7b6ef9d79aec99d538252e82557f012d3)) - - - - +- landing page title duplication ([#4123](https://github.com/typescript-eslint/typescript-eslint/issues/4123)) ([844c25e](https://github.com/typescript-eslint/typescript-eslint/commit/844c25e7b6ef9d79aec99d538252e82557f012d3)) ## [5.3.1](https://github.com/typescript-eslint/typescript-eslint/compare/v5.3.0...v5.3.1) (2021-11-08) diff --git a/packages/website/README.md b/packages/website/README.md index fd7bb57cb42..7f4c12e2372 100644 --- a/packages/website/README.md +++ b/packages/website/README.md @@ -1,5 +1,7 @@ # Website +[![Netlify Status](https://api.netlify.com/api/v1/badges/128d21c7-b2fe-45ad-b141-9878fcf5de3a/deploy-status)](https://app.netlify.com/sites/typescript-eslint/deploys) + This website is built using [Docusaurus 2](https://v2.docusaurus.io/), a modern static website generator. ## Installation @@ -26,4 +28,11 @@ This command generates static content into the `build` directory and can be serv ## Deployment -The website is deployed automatically using Netlify. Each pull request into the `main` branch will have a unique preview deployment generated for it. +### Production + +The website is deployed from the `website` branch automatically using Netlify. +That branch gets updated from the `main` branch whenever a new stable version is released (generally weekly). + +### Pull Requests + +Each pull request into the `main` branch will have a unique preview deployment generated for it. diff --git a/packages/website/blog/2022-09-18-automated-rule-docs-with-docusaurus-and-remark.md b/packages/website/blog/2022-09-18-automated-rule-docs-with-docusaurus-and-remark.md new file mode 100644 index 00000000000..a1c5d205a02 --- /dev/null +++ b/packages/website/blog/2022-09-18-automated-rule-docs-with-docusaurus-and-remark.md @@ -0,0 +1,228 @@ +--- +authors: + - image_url: https://www.joshuakgoldberg.com/img/josh.jpg + name: Josh Goldberg + title: typescript-eslint Maintainer + url: https://github.com/JoshuaKGoldberg +description: How typescript-eslint generates much of the docs pages for each of its lint rules. +slug: automated-rule-docs-with-docusaurus-and-remark +tags: [documentation, docusaurus, remark] +title: Automated Rule Docs With Docusaurus and Remark +--- + +The typescript-eslint website at https://typescript-eslint.io is the canonical location for documentation on how to use ESLint on TypeScript code. +The site includes a documentation page for each of the over 100 ESLint rules exposed by its ESLint plugin. +Each of those rule docs pages includes a description of the rule, any options it allows, links to its source code, and other important information about its usage. + +Until recently, keeping descriptions of rules consistent between their source code and docs pages was a cumbersome manual chore. +We'd written a suite of Jest tests to verify they matched -- but those tests didn't capture everything, often failed with cryptic messages, and were missed by less experienced contributors. + +We're happy to say that now, we've overhauled rule docs pages to automatically generate metadata information from rule source code. +That means the pages always display up-to-date information without developers needing to manually rewrite docs on rule changes. +Hooray! 🎉 + +This blog post gives an overview of the [chore to generate rule docs options automatically](https://github.com/typescript-eslint/typescript-eslint/pull/5386). + + + +## Tools in Play + +https://typescript-eslint.io is built on [Docusaurus](https://docusaurus.io), a powerful static site generator tailored to documentation websites and blogs. +Docusaurus comes with sensible defaults, extensive configuration options, and thoroughly fleshed out documentation. +We're big fans. +❤️ + +[Docusaurus blogs](https://docusaurus.io/docs/blog) support writing blog posts in [MDX](https://mdxjs.com), a rich superset of Markdown that allows inserting JSX components. +Docusaurus supports MDX using [remark](https://remark.js.org), a Markdown processor powered by plugins. +Remark plugins take in Markdown files in a format known as an Abstract Syntax Tree (or AST), and output modified versions of those ASTs. + +You can see what Remark's AST equivalent of a Markdown document looks like by visiting [AST Explorer](https://astexplorer.net) and selecting the Markdown language. + +
+ +![A screenshot of the astexplorer.net interface. The left pane shows a snippet of Markdown source with one paragraph highlighted. The right pane shows its AST structure in a collapsible JSON format, with the paragraph's corresponding AST node automatically highlighted.](./ast-explorer-remark.png) + +
+ + astexplorer.net showing the default snippet with the paragraph highlighted + +
+
+ +Lastly, Remark and several other packages around parsing and modifying ASTs are built on the [`unified` project](https://github.com/unifiedjs/unified). +The unified AST format adheres to the [`unist` specification](https://github.com/syntax-tree/unist). + +### Custom Remark Plugins + +Remark allows projects to register any number of custom Remark plugins for transforming Markdown contents. +For example, typescript-eslint.io already uses [`remark-docusaurus-tabs`](https://www.npmjs.com/package/remark-docusaurus-tabs). + +The relevant parts of [typescript-eslint.io's Docusaurus config](https://github.com/typescript-eslint/typescript-eslint/blob/39829c01906f326fec94e9b3a5fdb1730eb02002/packages/website/docusaurusConfig.ts) specify the `remark-docusaurus-tabs` plugin and the custom `./plugins/generated-rule-docs` plugin: + +```ts +import tabsPlugin from 'remark-docusaurus-tabs'; + +import { generatedRuleDocs } from './plugins/generated-rule-docs'; + +export = { + presets: [ + [ + 'classic', + { + beforeDefaultRemarkPlugins: [tabsPlugin, generatedRuleDocs], + }, + ], + ], +}; +``` + +Those plugins are specified inside the [`beforeDefaultRemarkPlugins`](https://docusaurus.io/docs/api/plugins/@docusaurus/plugin-content-blog#beforeDefaultRemarkPlugins) option, so they run before the Docusaurus internal Remark plugin generates the tables of contents for the docs pages. This allows the headings that our custom plugin inserts to be present in the table of contents. + +## Automated Changes + +The typescript-eslint.io website's documentation contents are all stored as `.md`, or Markdown files. +Most of those `.md` files correspond to a lint rule under the same name. +The [`@typescript-eslint/no-for-in-array` rule](https://typescript-eslint.io/rules/no-for-in-array), for example, is documented in the [`no-for-in-array.md` file](https://github.com/typescript-eslint/typescript-eslint/blob/39829c01906f326fec94e9b3a5fdb1730eb02002/packages/eslint-plugin/docs/rules/no-for-in-array.md). + +Our Remark plugin: + +1. Takes in the AST and metadata of a documentation file +2. Tries to find the corresponding typescript-eslint rule for the file's name +3. If one was found, applies a set of modifications to the AST + +The rest of this section of the blog post will give a high-level overview of what kinds of AST modifications take place. +You can dive into [the source code of our plugin](https://github.com/typescript-eslint/typescript-eslint/blob/39829c01906f326fec94e9b3a5fdb1730eb02002/packages/website/plugins/generated-rule-docs.ts) for more details if you're curious. + +### Matching Docs to Rules + +The [`@typescript-eslint/eslint-plugin` package](https://www.npmjs.com/package/@typescript-eslint/eslint-plugin) exports an object with a `rules` property containing all the typescript-eslint lint rules. +Properties have names like `"array-type"` that map to the rule object exported by files like [`array-type.ts`](https://github.com/typescript-eslint/typescript-eslint/blob/39829c01906f326fec94e9b3a5fdb1730eb02002/packages/eslint-plugin/src/rules/array-type.ts#L86). + +Remark plugins are able to access the name of the file they're modifying by accessing `file.stem`, as in the following code snippet. +Names of rule docs files can then be matched up with rules exported by the ESLint plugin object. +Docs files that don't correspond to a rule don't have any AST modifications done in this plugin: + +```ts +import * as eslintPlugin from '@typescript-eslint/eslint-plugin'; +import type { Plugin } from 'unified'; + +export const generatedRuleDocs: Plugin = () => { + return async (root, file) => { + if (file.stem == null) { + return; + } + + const rule = eslintPlugin.rules[file.stem]; + const meta = rule?.meta; + if (!meta?.docs) { + return; + } + + // ... (rest of the plugin here!) ... + }; +}; +``` + +### Removing an AST Node + +The first AST modification our plugin does is to remove a node that exists in `.md` docs files but doesn't need to exist in the typescript-eslint.io website. +The `.md` source files start with a callout to let people know to go to the website: + +```md +> 🛑 This file is source code, not the primary documentation location! 🛑 +> +> See **https://typescript-eslint.io/rules/adjacent-overload-signatures** for documentation. +``` + +That blockquote and other root-level nodes are stored as an array under the `children` property of the AST root node: + +```ts +root.children.splice( + root.children.findIndex(v => v.type === 'blockquote'), + 1, +); +``` + +:::info Historical context +Before typescript-eslint.io existed, the canonical documentation URL for typescript-eslint's lint rules was the GitHub link to their corresponding `.md` file. +Now that we have a rich documentation site and have automated much of what used to be in those `.md` files, they're no longer a good place to look for documentation. +::: + +### Adding an AST Node + +Most of the modifications in our plugin are to add more nodes to the AST. +The rule's `meta.docs` property contains a plethora of information about the rule. + +For example, `meta.docs.description` is a plain-text description of what the rule does. +We add a blockquote containing the rule's description as text. +Inline code (text surrounded by `` ` `` backticks) is rendered as a Markdown `inlineCode` node: + +```ts +root.children.unshift({ + children: [ + { + children: meta.docs.description + .split(/`(.+?)`/) + .map((value, index, array) => ({ + type: index % 2 === 0 ? 'text' : 'inlineCode', + value: index === array.length - 1 ? `${value}.` : value, + })), + type: 'paragraph', + }, + ], + type: 'blockquote', +}); +``` + +For example, [typescript-eslint.io/rules/array-type](https://typescript-eslint.io/rules/array-type) has the equivalent of this blockquote added now: + +```md +> Require using either `T[]` or `Array` for arrays. +``` + +Quite a few other modifications to the AST involve adding AST nodes that are expected to exist on the page. +It ensures expected headings such as _`## How to Use`_ and _`## Options`_ exist, inserting them if not. + +### Adding a JSX AST Node + +Remember when the concept of MDX files including JSX tags was mentioned earlier in this blog post, and then never referenced again? +We did end up injecting one React component as a JSX tag in the plugin. + +In our [MDX component configuration](https://github.com/typescript-eslint/typescript-eslint/blob/39829c01906f326fec94e9b3a5fdb1730eb02002/packages/website/src/theme/MDXComponents/index.tsx#L2), `'rule-attributes'` maps to a [`RulesAttribute` React component](https://github.com/typescript-eslint/typescript-eslint/blob/39829c01906f326fec94e9b3a5fdb1730eb02002/packages/website/src/theme/MDXComponents/RuleAttributes.tsx#L7) that renders a list of rule metadata. +That list is a little too complex to easily render directly in Markdown. + +MDX builds on Remark and additionally supports nodes of type `'jsx'` that include raw JSX syntax: + +```ts +const attributesH2Index = root.children.findIndex( + child => nodeIsHeading(child) && child.depth === 2, +); + +root.children.splice(attributesH2Index, 0, { + type: 'jsx', + value: ``, +}); + +function nodeIsHeading(node: unist.Node): node is mdast.Heading { + return node.type === 'heading'; +} +``` + +## What's Next + +We're relieved that we no longer have to manually update scores of documentation on every code change. +This plugin's automation frees up our documentation time to focus on improving the contents of the pages themselves. +You can query our [issue tracker](https://github.com/typescript-eslint/typescript-eslint/issues) for [issues with the `documentation` label](https://github.com/typescript-eslint/typescript-eslint/issues?q=is%3Aopen+is%3Aissue+label%3Adocumentation) to see what's coming up next. +I'm excited to focus in particular on [Docs: Proofread rule docs for clarity (#4861)](https://github.com/typescript-eslint/typescript-eslint/issues/4861). + +## Appreciation and Thanks + +We'd like to extend thanks to [Joshua Chen](https://github.com/Josh-Cena), one of the Docusaurus maintainers who also has been helping us with Docusaurus — and helped proofread [this blog post's PR](https://github.com/typescript-eslint/typescript-eslint/pull/5593). +Without Joshua, this change would have taken us a great deal longer (if we'd have been able to tackle it at all). +Thanks Joshua! 🤗 + +## Supporting typescript-eslint + +If you enjoyed this blog post and/or or use typescript-eslint, please consider [supporting us on Open Collective](https://opencollective.com/typescript-eslint). +We're a small volunteer team and could use your support to make the ESLint experience on TypeScript great. +Thanks! 💖 diff --git a/packages/website/blog/2022-12-05-asts-and-typescript-eslint.md b/packages/website/blog/2022-12-05-asts-and-typescript-eslint.md new file mode 100644 index 00000000000..47cb9374c90 --- /dev/null +++ b/packages/website/blog/2022-12-05-asts-and-typescript-eslint.md @@ -0,0 +1,124 @@ +--- +authors: + - image_url: https://www.joshuakgoldberg.com/img/josh.jpg + name: Josh Goldberg + title: typescript-eslint Maintainer + url: https://github.com/JoshuaKGoldberg +description: Describing what an AST (Abstract Syntax Tree) is and why it's useful for ESLint and TypeScript tooling. +slug: asts-and-typescript-eslint +tags: [ast, abstract syntax tree, parser, parsing, prettier] +title: ASTs and typescript-eslint +--- + +Programmers who work with tools like [ESLint](https://eslint.org) and [Prettier](https://prettier.io) often refer to ASTs. +But what is an AST, why is it useful for these kinds of tools, and how does that interact with ESLint and TypeScript tooling? +Let's dig in! + +## What's an AST? + +_Static analysis_ tools are those that look at code without running it. +They typically _parse_ code, or transform it from a string into a standard format they can reason about known as an **Abstract Syntax Tree** (AST). +ASTs are called such because although they might contain information on the location of constructs within source code, they are an abstract representation that cares more about the semantic structure. + +> In other words, an AST is a description of your code's syntax. + +### An Example AST + +Take this single line of code: + +```js +1 + 2; +``` + +ESLint's AST format, **[ESTree]**, would describe that line of code as an object like: + +```json +{ + "type": "ExpressionStatement", + "expression": { + "type": "BinaryExpression", + "left": { + "type": "Literal", + "value": 1, + "raw": "1" + }, + "operator": "+", + "right": { + "type": "Literal", + "value": 2, + "raw": "2" + } + } +} +``` + +Each piece of code described within an AST description is referred to as a **node**, or AST node. +Each node is given a **node type** indicating the type of code syntax it represents +That code snippet includes four nodes of the following types: + +- _ExpressionStatement_: `1 + 2;` +- _BinaryExpression_: `1 + 2` +- _Literal_: `1` +- _Literal_: `2` + +That ESTree object representation of the code is what static analysis tools such as [ESLint](https://eslint.org) and [Prettier](https://prettier.io) work with. + +## AST Formats + +ESTree is more broadly used than just for ESLint -- it is a popular community standard. +ESLint's built-in parser that outputs an ESTree-shaped AST is also a separate package, called **[Espree]**. + +TypeScript has its own separate AST format, often referred to as the TypeScript AST. +Because TypeScript is developed separately and with different goals from ESLint, ESTree, and Espree, its AST also represents nodes differently in many cases. + +- TS's AST is optimized for its use case of parsing incomplete code and typechecking. +- ESTree is unoptimized and intended for "general purpose" use-cases of traversing the AST. + +ESLint rules are by default only given nodes in the ESTree AST format - which has no knowledge of TypeScript-specific syntax such as interfaces. +On the other hand, TypeScript's type checking APIs require nodes in the TypeScript AST format. + +### Enter TSESTree + +To resolve the incompatibilities between ESTrees and the TypeScript AST typescript-eslint provides its own [`@typescript-eslint/parser` package](https://typescript-eslint.io/architecture/Parser.mdx) which: + +1. First parses TypeScript syntax into a TypeScript AST +1. Creates an ESTree AST based on that TypeScript AST +1. Keeps track of equivalent nodes across each AST + +By creating both an ESTree AST and a TypeScript AST, the typescript-eslint parser allows ESLint rules to work with TypeScript code. +That's why the [Getting Started guide](https://typescript-eslint.io/getting-started) for typescript-eslint has you specify `parser: '@typescript-eslint/parser'` in your ESLint config! + +We commonly refer to the ESTree format that also includes TypeScript-specific syntax as **TSESTree**. + +### AST Playground + +The [typescript-eslint playground](https://typescript-eslint.io/play#showAST=es) contains an AST explorer that generates an interactive AST for any code entered into the playground. +You can activate it under _Options_ > _AST Explorer_ on its left sidebar by selecting the value of _AST Viewer_. + +## Further Resources + +You can play more with various other ASTs on [astexplorer.net], including those for other languages such as CSS and HTML. + +The [AST Wikipedia article](https://en.wikipedia.org/wiki/Abstract_syntax_tree) has a great deal more context and history on ASTs. + +### Glossary + +Putting together all the terms introduces in this article: + +- **AST (Abstract Syntax Tree)**: An object representation of your code's syntax. +- **Espree**: ESLint's built-in parser that outputs an ESTree-shaped AST. +- **ESTree**: The AST specification used by ESLint and other common JavaScript tools. +- **Node Type**: What kind of code syntax an AST node refers to, such as _BinaryExpression_ or _Literal_. +- **Node**: A single range of code syntax in an AST. +- **Parser**: A tool that reads in a string and outputs an AST. +- **TSESTree**: Our extension to the ESTree AST format that also includes TypeScript-specific syntax. + +### TypeScript Lint Rules and ASTs + +Interested in how these ASTs work with ESLint rules? +We collaborated with our friends at Sourcegraph on a [Tour de Source on typescript-eslint](https://sourcegraph.com/notebooks/Tm90ZWJvb2s6MTA2OA==). +Read on to learn how ESLint rules use ASTs to analyze code files and, thanks to `@typescript-eslint/parser`, call TypeScript's type checking APIs to analyze code. + +[astexplorer.net]: https://astexplorer.net +[espree]: https://github.com/eslint/espree +[estree]: https://github.com/ESTree/ESTree diff --git a/packages/website/blog/ast-explorer-remark.png b/packages/website/blog/ast-explorer-remark.png new file mode 100644 index 00000000000..f90013e74fb Binary files /dev/null and b/packages/website/blog/ast-explorer-remark.png differ diff --git a/packages/website/cypress/integration/index.spec.js b/packages/website/cypress/integration/index.spec.js deleted file mode 100644 index 250878da795..00000000000 --- a/packages/website/cypress/integration/index.spec.js +++ /dev/null @@ -1,15 +0,0 @@ -import { checkAccessibility } from '../utils'; - -describe('Index', () => { - it('has no accessibility issues detected by aXe', () => { - cy.visit('/'); - cy.injectAxe(); - - // 1. Check accessibility in default, light mode - checkAccessibility(); - - // 2. Check accessibility in dark mode - cy.get('[class*=toggleButton]').click(); - checkAccessibility(); - }); -}); diff --git a/packages/website/cypress/plugins/index.js b/packages/website/cypress/plugins/index.js deleted file mode 100644 index f27e2b46f7d..00000000000 --- a/packages/website/cypress/plugins/index.js +++ /dev/null @@ -1,17 +0,0 @@ -/// - -/** - * @type {Cypress.PluginConfig} - */ -module.exports = on => { - on('task', { - log(message) { - console.log(message); - return null; - }, - table(message) { - console.table(message); - return null; - }, - }); -}; diff --git a/packages/website/cypress/support/commands.js b/packages/website/cypress/support/commands.js deleted file mode 100644 index 46bfe99c37f..00000000000 --- a/packages/website/cypress/support/commands.js +++ /dev/null @@ -1 +0,0 @@ -import 'cypress-axe'; diff --git a/packages/website/cypress/support/index.js b/packages/website/cypress/support/index.js deleted file mode 100644 index 1221b17e096..00000000000 --- a/packages/website/cypress/support/index.js +++ /dev/null @@ -1 +0,0 @@ -import './commands'; diff --git a/packages/website/cypress/utils.js b/packages/website/cypress/utils.js deleted file mode 100644 index f60a8143c7e..00000000000 --- a/packages/website/cypress/utils.js +++ /dev/null @@ -1,28 +0,0 @@ -function terminalLog(violations) { - cy.task( - 'log', - `${violations.length} accessibility violation${ - violations.length === 1 ? '' : 's' - } detected`, - ); - for (const violation of violations) { - cy.task('log', JSON.stringify(violation, null, 4)); - } - - cy.task( - 'table', - violations.map(({ description, id, impact, nodes }) => ({ - description, - id, - impact, - nodes: nodes.length, - })), - ); -} - -export function checkAccessibility() { - // Wait for any pending paints and ticks to clear - cy.wait(500); - - cy.checkA11y(undefined, undefined, terminalLog); -} diff --git a/packages/website/data/sponsors.json b/packages/website/data/sponsors.json index 30bdac33d5d..f7c3f749e9d 100644 --- a/packages/website/data/sponsors.json +++ b/packages/website/data/sponsors.json @@ -3,7 +3,6 @@ "id": "Indeed", "image": "https://images.opencollective.com/indeed/4b8725e/logo.png", "name": "Indeed", - "tier": "sponsor", "totalDonations": 1005000, "website": "https://Indeed.com" }, @@ -11,110 +10,125 @@ "id": "Nx (by Nrwl)", "image": "https://images.opencollective.com/nx/0efbe42/logo.png", "name": "Nx (by Nrwl)", - "tier": "sponsor", - "totalDonations": 450000, + "totalDonations": 625000, "website": "https://nx.dev" }, { "id": "ESLint", "image": "https://images.opencollective.com/eslint/96b09dc/logo.png", "name": "ESLint", - "tier": "sponsor", - "totalDonations": 155000, + "totalDonations": 260000, "website": "https://eslint.org/" }, + { + "id": "Hugging Face", + "image": "https://images.opencollective.com/huggingface/5c934ee/logo.png", + "name": "Hugging Face", + "totalDonations": 200000, + "website": "https://huggingface.co" + }, { "id": "Airbnb", "image": "https://images.opencollective.com/airbnb/d327d66/logo.png", "name": "Airbnb", - "tier": "sponsor", - "totalDonations": 120800, + "totalDonations": 155800, "website": "https://www.airbnb.com/" }, + { + "id": "GitBook", + "image": "https://images.opencollective.com/gitbook/d35a8e7/logo.png", + "name": "GitBook", + "totalDonations": 140000, + "website": "https://www.gitbook.com" + }, + { + "id": "Codecademy", + "image": "https://images.opencollective.com/codecademy/d56a48d/logo.png", + "name": "Codecademy", + "totalDonations": 130000, + "website": "https://codecademy.com" + }, + { + "id": "n8n.io - n8n GmbH", + "image": "https://images.opencollective.com/n8n/dca2f0c/logo.png", + "name": "n8n.io - n8n GmbH", + "totalDonations": 120000, + "website": "https://n8n.io" + }, { "id": "Coinbase", "image": "https://images.opencollective.com/coinbase/a202856/logo.png", "name": "Coinbase", - "tier": "sponsor", "totalDonations": 120000, "website": "https://blog.coinbase.com/engineering-and-security/home" }, { - "id": "n8n.io - n8n GmbH", - "image": "https://images.opencollective.com/n8n/dca2f0c/logo.png", - "name": "n8n.io - n8n GmbH", - "tier": "sponsor", - "totalDonations": 95000, - "website": "https://n8n.io" + "id": "Sentry", + "image": "https://images.opencollective.com/sentry/9620d33/logo.png", + "name": "Sentry", + "totalDonations": 114800, + "website": "https://sentry.io/welcome/" }, { "id": "EY Doberman", "image": "https://images.opencollective.com/ey-doberman/b269462/logo.png", "name": "EY Doberman", - "tier": "sponsor", "totalDonations": 80400, "website": "https://doberman.co" }, { - "id": "GitBook", - "image": "https://images.opencollective.com/gitbook/d35a8e7/logo.png", - "name": "GitBook", - "tier": "sponsor", - "totalDonations": 70000, - "website": "https://www.gitbook.com" + "id": "Sourcegraph", + "image": "https://images.opencollective.com/sourcegraph/67e40ff/logo.png", + "name": "Sourcegraph", + "totalDonations": 80000, + "website": "https://about.sourcegraph.com" }, { - "id": "Codecademy", - "image": "https://images.opencollective.com/codecademy/d56a48d/logo.png", - "name": "Codecademy", - "tier": "sponsor", + "id": "Codiga", + "image": "https://images.opencollective.com/codiga/1065f9f/logo.png", + "name": "Codiga", "totalDonations": 60000, - "website": "https://codecademy.com" - }, - { - "id": "GitHub", - "image": "https://images.opencollective.com/guest-f9980024/avatar.png", - "name": "GitHub", - "tier": "supporter", - "totalDonations": 56674 + "website": "https://www.codiga.io" }, { "id": "Future Processing", "image": "https://images.opencollective.com/future-processing/1410d26/logo.png", "name": "Future Processing", - "tier": "supporter", "totalDonations": 54000, "website": "https://www.future-processing.com/" }, - { - "id": "Sentry", - "image": "https://images.opencollective.com/sentry/9620d33/logo.png", - "name": "Sentry", - "tier": "supporter", - "totalDonations": 50000, - "website": "https://sentry.io/welcome/" - }, { "id": "Whitebox", "image": "https://images.opencollective.com/whiteboxinc/ef0d11d/logo.png", "name": "Whitebox", - "tier": "supporter", "totalDonations": 40000, "website": "https://whitebox.com" }, + { + "id": "STORIS", + "image": "https://images.opencollective.com/storis/dfb0e13/logo.png", + "name": "STORIS", + "totalDonations": 31500, + "website": "https://www.storis.com/" + }, { "id": "Monito", "image": "https://images.opencollective.com/monito/50fc878/logo.png", "name": "Monito", - "tier": "supporter", "totalDonations": 30000, "website": "https://www.monito.com" }, + { + "id": "DeepSource", + "image": "https://images.opencollective.com/deepsource/0f18cea/logo.png", + "name": "DeepSource", + "totalDonations": 30000, + "website": "https://deepsource.io/" + }, { "id": "revo.js", "image": "https://images.opencollective.com/revojsro/82623a7/logo.png", "name": "revo.js", - "tier": "supporter", "totalDonations": 23000, "website": "https://revojs.ro" }, @@ -122,46 +136,55 @@ "id": "Ian MacLeod", "image": "https://images.opencollective.com/nevir/35c52ef/avatar.png", "name": "Ian MacLeod", - "tier": "supporter", "totalDonations": 22000, "website": "https://twitter.com/nevir" }, { - "id": "STORIS", - "image": "https://images.opencollective.com/storis/dfb0e13/logo.png", - "name": "STORIS", - "tier": "supporter", - "totalDonations": 21000, - "website": "https://www.storis.com/" + "id": "tRPC", + "image": "https://images.opencollective.com/trpc/82704a8/logo.png", + "name": "tRPC", + "totalDonations": 20000, + "website": "https://trpc.io" + }, + { + "id": "David Johnston", + "image": "https://images.opencollective.com/blacksheepcode/976d69a/avatar.png", + "name": "David Johnston", + "totalDonations": 16500, + "website": "https://blacksheepcode.com" }, { - "id": "Michael Ranciglio", - "image": "https://images.opencollective.com/michael-ranciglio/avatar.png", - "name": "Michael Ranciglio", - "tier": "supporter", - "totalDonations": 16500 + "id": "THANKS.DEV", + "image": "https://images.opencollective.com/thanks-dev/ed78b39/logo.png", + "name": "THANKS.DEV", + "totalDonations": 14761, + "website": "https://thanks.dev" }, { "id": "Joe Alden", "image": "https://images.opencollective.com/joealden/44a6738/avatar.png", "name": "Joe Alden", - "tier": "contributor", "totalDonations": 14000, "website": "https://joealden.com" }, { - "id": "David Johnston", - "image": "https://images.opencollective.com/blacksheepcode/976d69a/avatar.png", - "name": "David Johnston", - "tier": "contributor", - "totalDonations": 13000, - "website": "https://blacksheepcode.com" + "id": "Evil Martians", + "image": "https://images.opencollective.com/evilmartians/707ab4d/logo.png", + "name": "Evil Martians", + "totalDonations": 11500, + "website": "https://evilmartians.com/" + }, + { + "id": "Balsa", + "image": "https://images.opencollective.com/balsa/77de498/logo.png", + "name": "Balsa", + "totalDonations": 11500, + "website": "https://balsa.com" }, { "id": "Gianfranco Palumbo", "image": "https://images.opencollective.com/gianpaj/5d62d25/avatar.png", "name": "Gianfranco Palumbo", - "tier": "contributor", "totalDonations": 10000, "website": "http://gian.xyz" }, @@ -169,94 +192,14 @@ "id": "The Guardian", "image": "https://images.opencollective.com/gdndevelopers/0b72bf0/logo.png", "name": "The Guardian", - "tier": "contributor", "totalDonations": 10000, "website": "https://www.theguardian.com/" }, - { - "id": "Yuta Fukazawa", - "image": "https://images.opencollective.com/yuta-fukazawa/a337601/avatar.png", - "name": "Yuta Fukazawa", - "tier": "contributor", - "totalDonations": 10000 - }, - { - "id": "Sourcegraph", - "image": "https://images.opencollective.com/sourcegraph/8587b83/logo.png", - "name": "Sourcegraph", - "tier": "sponsor", - "totalDonations": 10000, - "website": "https://about.sourcegraph.com" - }, { "id": "Laserhub", "image": "https://images.opencollective.com/laserhub/bae6275/logo.png", "name": "Laserhub", - "tier": "contributor", "totalDonations": 10000, "website": "https://laserhub.com/" - }, - { - "id": "Tripwire, Inc.", - "image": "https://images.opencollective.com/tripwire/7599e30/logo.png", - "name": "Tripwire, Inc.", - "tier": "contributor", - "totalDonations": 8500, - "website": "https://tripwire.com" - }, - { - "id": "Evil Martians", - "image": "https://images.opencollective.com/evilmartians/707ab4d/logo.png", - "name": "Evil Martians", - "tier": "contributor", - "totalDonations": 8000, - "website": "https://evilmartians.com/" - }, - { - "id": "Balsa", - "image": "https://images.opencollective.com/balsa/77de498/logo.png", - "name": "Balsa", - "tier": "contributor", - "totalDonations": 8000, - "website": "https://balsa.com" - }, - { - "id": "Jeffrey Rennie", - "image": "https://images.opencollective.com/jeffrey-rennie/avatar.png", - "name": "Jeffrey Rennie", - "tier": "contributor", - "totalDonations": 7500 - }, - { - "id": "Pete Gonzalez", - "image": "https://images.opencollective.com/octogonz/513f01a/avatar.png", - "name": "Pete Gonzalez", - "tier": "contributor", - "totalDonations": 5000, - "website": "https://github.com/octogonz" - }, - { - "id": "Niklas Fiekas", - "image": "https://images.opencollective.com/niklas-fiekas/ffec4a8/avatar.png", - "name": "Niklas Fiekas", - "tier": "contributor", - "totalDonations": 5000, - "website": "https://backscattering.de" - }, - { - "id": "Corellium", - "image": "https://images.opencollective.com/corellium/aa8c228/logo.png", - "name": "Corellium", - "tier": "contributor", - "totalDonations": 4800, - "website": "https://www.corellium.com" - }, - { - "id": "Alexey Berezin", - "image": "https://images.opencollective.com/beraliv/034d971/avatar.png", - "name": "Alexey Berezin", - "tier": "contributor", - "totalDonations": 1500, - "website": "https://beraliv.dev" } ] diff --git a/packages/website/docusaurusConfig.ts b/packages/website/docusaurusConfig.ts index 89a97f1c81e..ab543e80783 100644 --- a/packages/website/docusaurusConfig.ts +++ b/packages/website/docusaurusConfig.ts @@ -1,18 +1,20 @@ import type { MDXPlugin } from '@docusaurus/mdx-loader'; import type { Options as PluginContentDocsOptions } from '@docusaurus/plugin-content-docs'; +import type { Options as PluginPwaOptions } from '@docusaurus/plugin-pwa'; import type { Options as PresetClassicOptions } from '@docusaurus/preset-classic'; +import npm2yarnPlugin from '@docusaurus/remark-plugin-npm2yarn'; import type { UserThemeConfig as ThemeCommonConfig } from '@docusaurus/theme-common'; import type { UserThemeConfig as AlgoliaThemeConfig } from '@docusaurus/theme-search-algolia'; import type { Config } from '@docusaurus/types'; - -import { rulesMeta } from './rulesMeta'; -import npm2yarnPlugin from '@docusaurus/remark-plugin-npm2yarn'; import tabsPlugin from 'remark-docusaurus-tabs'; + +import { version } from './package.json'; import { generatedRuleDocs } from './plugins/generated-rule-docs'; +import { rulesMeta } from './rulesMeta'; const remarkPlugins: MDXPlugin[] = [[npm2yarnPlugin, { sync: true }]]; -const beforeDefaultRemarkPlugins: MDXPlugin[] = [[tabsPlugin, {}]]; +const beforeDefaultRemarkPlugins: MDXPlugin[] = [tabsPlugin]; const githubUrl = 'https://github.com/typescript-eslint/typescript-eslint'; @@ -23,13 +25,14 @@ const presetClassicOptions: PresetClassicOptions = { sidebarPath: require.resolve('./sidebars/sidebar.rules.js'), routeBasePath: 'rules', editUrl: `${githubUrl}/edit/main/packages/website/`, - beforeDefaultRemarkPlugins, - remarkPlugins: [...remarkPlugins, [generatedRuleDocs, {}]], + beforeDefaultRemarkPlugins: [ + ...beforeDefaultRemarkPlugins, + generatedRuleDocs, + ], + remarkPlugins: remarkPlugins, exclude: ['TEMPLATE.md'], breadcrumbs: false, }, - // TODO enable this - blog: false, pages: { beforeDefaultRemarkPlugins, remarkPlugins, @@ -42,7 +45,7 @@ const presetClassicOptions: PresetClassicOptions = { const pluginContentDocsOptions: PluginContentDocsOptions = { id: 'base-docs', path: '../../docs', - routeBasePath: 'docs', + routeBasePath: '/', sidebarPath: require.resolve('./sidebars/sidebar.base.js'), editUrl: `${githubUrl}/edit/main/packages/website/`, beforeDefaultRemarkPlugins, @@ -52,8 +55,8 @@ const pluginContentDocsOptions: PluginContentDocsOptions = { const themeConfig: ThemeCommonConfig & AlgoliaThemeConfig = { algolia: { - appId: 'BH4D9OD16A', - apiKey: '1ad6b47d4e742c4c0653877b5511c602', + appId: 'N1HUB2TU6A', + apiKey: '74d42ed10d0f7b327d74d774570035c7', indexName: 'typescript-eslint', }, metadata: [ @@ -63,28 +66,34 @@ const themeConfig: ThemeCommonConfig & AlgoliaThemeConfig = { ], image: 'img/logo-twitter-card.png', navbar: { - title: 'TypeScript ESLint', - // hideOnScroll: true, + title: 'typescript-eslint', logo: { - alt: 'TypeScript ESLint logo', + alt: '', height: '32px', src: 'img/logo.svg', width: '32px', }, - // style: 'primary', items: [ { - to: 'docs/', - activeBasePath: 'docs', - label: 'Getting started', + to: 'getting-started/', + label: 'Docs', position: 'left', }, { to: 'rules/', - activeBasePath: 'rules', label: 'Rules', position: 'left', }, + { + to: 'blog/', + label: 'Blog', + position: 'left', + }, + { + position: 'right', + value: `v${version}`, + type: 'html', + }, { to: 'play', activeBasePath: 'play', @@ -133,8 +142,7 @@ const themeConfig: ThemeCommonConfig & AlgoliaThemeConfig = { ], }, ], - // style: 'primary', - copyright: `Copyright © ${new Date().getFullYear()} TypeScript ESLint, Inc. Built with Docusaurus.`, + copyright: `Copyright © ${new Date().getFullYear()} typescript-eslint, Inc. Built with Docusaurus.`, }, prism: { theme: { @@ -166,9 +174,67 @@ const themeConfig: ThemeCommonConfig & AlgoliaThemeConfig = { }, }; +const pluginPwaOptions: PluginPwaOptions = { + debug: true, + offlineModeActivationStrategies: [ + 'appInstalled', + 'queryString', + 'standalone', + ], + pwaHead: [ + { + href: '/img/logo.svg', + rel: 'icon', + tagName: 'link', + }, + { + href: '/manifest.json', + rel: 'manifest', + tagName: 'link', + }, + { + content: '#443FD4', + name: 'theme-color', + tagName: 'meta', + }, + { + content: 'yes', + name: 'apple-mobile-web-app-capable', + tagName: 'meta', + }, + { + content: '#443FD4', + name: 'apple-mobile-web-app-status-bar-style', + tagName: 'meta', + }, + { + href: '/img/logo.png', + rel: 'apple-touch-icon', + tagName: 'link', + }, + { + color: '#443FD4', + href: '/img/logo.png', + rel: 'mask-icon', + tagName: 'link', + }, + { + content: '/img/logo.png', + name: 'msapplication-TileImage', + tagName: 'meta', + }, + { + content: '#443FD4', + name: 'msapplication-TileColor', + tagName: 'meta', + }, + ], +}; + const config: Config = { - title: 'TypeScript ESLint', - tagline: 'Tooling which enables ESLint to support TypeScript', + title: 'typescript-eslint', + tagline: + 'The tooling that enables ESLint and Prettier to support TypeScript.', url: 'https://typescript-eslint.io', baseUrl: '/', onBrokenLinks: 'throw', @@ -184,6 +250,7 @@ const config: Config = { plugins: [ require.resolve('./webpack.plugin'), ['@docusaurus/plugin-content-docs', pluginContentDocsOptions], + ['@docusaurus/plugin-pwa', pluginPwaOptions], ], themeConfig, // Misleading API name, but these are just tags @@ -209,6 +276,11 @@ const config: Config = { rel: 'manifest', href: '/img/favicon/site.webmanifest', }, + { + color: '#2656c7', + href: '/img/favicon/safari-pinned-tab.svg', + rel: 'mask-icon', + }, ], }; diff --git a/packages/website/package.json b/packages/website/package.json index ee5a05772d9..8f4ee2b74aa 100644 --- a/packages/website/package.json +++ b/packages/website/package.json @@ -1,52 +1,61 @@ { "name": "website", - "version": "5.31.0", + "version": "5.50.0", "private": true, "scripts": { "build": "docusaurus build", "clear": "docusaurus clear", "format": "prettier --write \"./**/*.{md,mdx,ts,js,tsx,jsx}\" --ignore-path ../../.prettierignore", - "lint": "eslint . --ignore-path ../../.eslintignore", + "lint": "nx lint", "serve": "docusaurus serve", "start": "docusaurus start", "swizzle": "docusaurus swizzle", - "test": "cypress run", - "test:open": "cypress open" + "test": "playwright test", + "typecheck": "tsc" }, "dependencies": { "@babel/runtime": "^7.18.3", - "@docusaurus/core": "2.0.0-beta.21", - "@docusaurus/preset-classic": "2.0.0-beta.21", - "@docusaurus/remark-plugin-npm2yarn": "2.0.0-beta.21", - "@docusaurus/theme-common": "2.0.0-beta.21", + "@docusaurus/core": "~2.2.0", + "@docusaurus/plugin-pwa": "~2.2.0", + "@docusaurus/preset-classic": "~2.2.0", + "@docusaurus/remark-plugin-npm2yarn": "~2.2.0", + "@docusaurus/theme-common": "~2.2.0", "@mdx-js/react": "1.6.22", - "@typescript-eslint/website-eslint": "5.31.0", + "@typescript-eslint/parser": "5.50.0", + "@typescript-eslint/website-eslint": "5.50.0", "clsx": "^1.1.1", "eslint": "*", + "json-schema": "^0.4.0", + "json-schema-to-typescript": "^11.0.1", "json5": "^2.2.1", "konamimojisplosion": "^0.5.1", "lzstring.ts": "^2.0.2", + "prettier": "*", "prism-react-renderer": "^1.3.3", "react": "^18.1.0", "react-dom": "^18.1.0", + "react-split-pane": "^0.1.92", "remark-docusaurus-tabs": "^0.2.0", "typescript": "*" }, + "resolutions": { + "react": "^18.0.0" + }, "devDependencies": { - "@docusaurus/module-type-aliases": "^2.0.0-beta.21", + "@axe-core/playwright": "^4.4.5", + "@docusaurus/module-type-aliases": "~2.2.0", + "@playwright/test": "^1.27.1", "@types/react": "^18.0.9", "@types/react-helmet": "^6.1.5", "@types/react-router-dom": "^5.3.3", - "@typescript-eslint/eslint-plugin": "5.31.0", + "@typescript-eslint/eslint-plugin": "5.50.0", "copy-webpack-plugin": "^11.0.0", - "cypress": "8.3.0", - "cypress-axe": "^0.14.0", "eslint-plugin-jsx-a11y": "^6.5.1", "eslint-plugin-react": "^7.29.4", "eslint-plugin-react-hooks": "^4.5.0", "globby": "^11.1.0", "monaco-editor": "^0.33.0", - "webpack": "^5.72.1" + "webpack": "^5.74.0" }, "browserslist": { "production": [ diff --git a/packages/website/playwright.config.ts b/packages/website/playwright.config.ts new file mode 100644 index 00000000000..ad85c7391d9 --- /dev/null +++ b/packages/website/playwright.config.ts @@ -0,0 +1,30 @@ +import type { PlaywrightTestConfig } from '@playwright/test'; +import { devices } from '@playwright/test'; + +const config: PlaywrightTestConfig = { + forbidOnly: !!process.env.CI, + fullyParallel: true, + reporter: 'html', + retries: 0, + testDir: './tests', + use: { + baseURL: 'http://localhost:3000', + trace: 'on-first-retry', + }, + projects: [ + { + name: 'chromium', + use: { + ...devices['Desktop Chrome'], + }, + }, + ], + webServer: { + command: 'yarn start', + port: 3000, + reuseExistingServer: !process.env.CI, + }, + workers: process.env.CI ? 1 : undefined, +}; + +export default config; diff --git a/packages/website/plugins/generated-rule-docs.ts b/packages/website/plugins/generated-rule-docs.ts index f074db04355..90f0b3fa6f7 100644 --- a/packages/website/plugins/generated-rule-docs.ts +++ b/packages/website/plugins/generated-rule-docs.ts @@ -1,61 +1,424 @@ -import type * as unist from 'unist'; +import * as eslintPlugin from '@typescript-eslint/eslint-plugin'; +import * as tseslintParser from '@typescript-eslint/parser'; +import * as fs from 'fs'; +import type { JSONSchema7 } from 'json-schema'; +import type { JSONSchema } from 'json-schema-to-typescript'; +import { compile } from 'json-schema-to-typescript'; import type * as mdast from 'mdast'; +import { EOL } from 'os'; +import * as path from 'path'; +import { format } from 'prettier'; import type { Plugin } from 'unified'; +import type * as unist from 'unist'; -import * as eslintPlugin from '@typescript-eslint/eslint-plugin'; +/** + * Rules whose options schema generate annoyingly complex schemas. + * + * @remarks These need to be typed in manually in their .md docs file. + * @todo Get these schemas printing nicely in their .md docs files! + */ +const COMPLICATED_RULE_OPTIONS = new Set([ + 'member-ordering', + 'naming-convention', +]); + +const sourceUrlPrefix = + 'https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/'; -const generatedRuleDocs: Plugin = () => { - return (root, file) => { - if (file.stem == null) { +const eslintPluginDirectory = path.resolve( + path.join(__dirname, '../../eslint-plugin'), +); + +function nodeIsParent(node: unist.Node): node is unist.Parent { + return 'children' in node; +} + +export const generatedRuleDocs: Plugin = () => { + return async (root, file) => { + if (!nodeIsParent(root) || file.stem == null) { return; } - const docs = eslintPlugin.rules[file.stem]?.meta.docs; - if (!docs) { + const rule = eslintPlugin.rules[file.stem]; + const meta = rule?.meta; + if (!meta?.docs) { return; } - const parent = root as unist.Parent; - // 1. Remove the " 🛑 This file is source code, not the primary documentation location! 🛑" - parent.children.splice( - parent.children.findIndex(v => v.type === 'blockquote'), + root.children.splice( + root.children.findIndex(v => v.type === 'blockquote'), 1, ); // 2. Add a description of the rule at the top of the file - parent.children.unshift({ - children: [ - { - children: docs.description - .split(/`(.+?)`/) - .map((value, index, array) => ({ - type: index % 2 === 0 ? 'text' : 'inlineCode', - value: index === array.length - 1 ? `${value}.` : value, - })), + root.children.unshift( + { + children: [ + { + children: meta.docs.description + .split(/`(.+?)`/) + .map((value, index, array) => ({ + type: index % 2 === 0 ? 'text' : 'inlineCode', + value: index === array.length - 1 ? `${value}.` : value, + })), + type: 'paragraph', + }, + ], + type: 'blockquote', + } as mdast.Blockquote, + { + type: 'jsx', + value: ``, + } as unist.Node, + ); + + // 3. Add a notice about formatting rules being 🤢 + if (meta.type === 'layout') { + const warningNode = { + value: ` + + We strongly recommend you do not use this rule or any other formatting linter rules. + Use a separate dedicated formatter instead. + See What About Formatting? for more information. + +`, + type: 'jsx', + }; + root.children.unshift(warningNode); + } + + // 4. Make sure the appropriate headers exist to place content under + const [howToUseH2Index, optionsH2Index] = ((): [number, number] => { + let howToUseH2Index = root.children.findIndex( + createH2TextFilter('How to Use'), + ); + let optionsH2Index = root.children.findIndex( + createH2TextFilter('Options'), + ); + const relatedToH2Index = root.children.findIndex( + createH2TextFilter('Related To'), + ); + let whenNotToUseItH2Index = root.children.findIndex( + createH2TextFilter('When Not To Use It'), + ); + + if (meta.docs.extendsBaseRule) { + if (howToUseH2Index === -1) { + if (optionsH2Index !== -1) { + howToUseH2Index = optionsH2Index; + optionsH2Index += 1; + + if (whenNotToUseItH2Index !== -1) { + whenNotToUseItH2Index += 1; + } + } else { + howToUseH2Index = + whenNotToUseItH2Index === -1 + ? root.children.length + : ++whenNotToUseItH2Index; + } + + root.children.splice(howToUseH2Index, 0, { + children: [ + { + type: 'text', + value: 'How to Use', + }, + ], + depth: 2, + type: 'heading', + } as mdast.Heading); + } + } + + if (optionsH2Index === -1) { + optionsH2Index = + whenNotToUseItH2Index === -1 + ? relatedToH2Index === -1 + ? root.children.length + : relatedToH2Index + : whenNotToUseItH2Index; + root.children.splice(optionsH2Index, 0, { + children: [ + { + type: 'text', + value: 'Options', + }, + ], + depth: 2, + type: 'heading', + } as mdast.Heading); + + optionsH2Index += 1; + } + + return [howToUseH2Index, optionsH2Index]; + })(); + + // 5. Add a description of how to use / options for the rule + const optionLevel = meta.docs.recommended === 'error' ? 'error' : 'warn'; + + if (meta.docs.extendsBaseRule) { + const extendsBaseRuleName = + typeof meta.docs.extendsBaseRule === 'string' + ? meta.docs.extendsBaseRule + : file.stem; + + root.children.splice(optionsH2Index + 1, 0, { + children: [ + { + value: 'See ', + type: 'text', + }, + { + children: [ + { + type: 'inlineCode', + value: `eslint/${extendsBaseRuleName}`, + }, + { + type: 'text', + value: ' options', + }, + ], + type: 'link', + url: `https://eslint.org/docs/rules/${extendsBaseRuleName}#options`, + }, + { + type: 'text', + value: '.', + }, + ], + type: 'paragraph', + } as mdast.Paragraph); + + root.children.splice(howToUseH2Index + 1, 0, { + lang: 'js', + type: 'code', + meta: 'title=".eslintrc.cjs"', + value: `module.exports = { + "rules": { + // Note: you must disable the base rule as it can report incorrect errors + "${extendsBaseRuleName}": "off", + "@typescript-eslint/${file.stem}": "${optionLevel}" + } +};`, + } as mdast.Code); + } else { + // For non-extended rules, the code snippet is placed before the first h2 + // (i.e. at the end of the initial explanation) + const firstH2Index = root.children.findIndex( + child => nodeIsHeading(child) && child.depth === 2, + ); + root.children.splice(firstH2Index, 0, { + lang: 'js', + type: 'code', + meta: 'title=".eslintrc.cjs"', + value: `module.exports = { + "rules": { + "@typescript-eslint/${file.stem}": "${optionLevel}" + } +};`, + } as mdast.Code); + + if (meta.schema.length === 0) { + root.children.splice(optionsH2Index + 1, 0, { + children: [ + { + type: 'text', + value: 'This rule is not configurable.', + }, + ], type: 'paragraph', - }, - ], - type: 'blockquote', - } as mdast.Blockquote); - - // 3. Add a rule attributes list... - const h2Idx = - // ...before the first h2, if it exists... - parent.children.findIndex( - child => - child.type === 'heading' && (child as mdast.Heading).depth === 2, - ) ?? - // ...or at the very end, if not. - parent.children.length; - - // The actual content will be injected on client side. - const attrNode = { - type: 'jsx', - value: ``, - }; - parent.children.splice(h2Idx, 0, attrNode); + } as mdast.Paragraph); + } else if (!COMPLICATED_RULE_OPTIONS.has(file.stem)) { + const optionsSchema: JSONSchema = + meta.schema instanceof Array + ? meta.schema[0] + : meta.schema.type === 'array' + ? { + ...(meta.schema.definitions + ? { definitions: meta.schema.definitions } + : {}), + ...(meta.schema.$defs + ? { $defs: (meta.schema as JSONSchema7).$defs } + : {}), + ...(meta.schema.prefixItems as [JSONSchema])[0], + } + : meta.schema; + + root.children.splice( + optionsH2Index + 2, + 0, + { + children: [ + { + type: 'text', + value: `This rule accepts an options ${ + 'enum' in optionsSchema + ? 'string of the following possible values' + : 'object with the following properties' + }:`, + } as mdast.Text, + ], + type: 'paragraph', + } as mdast.Paragraph, + { + lang: 'ts', + type: 'code', + value: [ + ( + await compile( + { + title: `Options`, + ...optionsSchema, + }, + file.stem, + { + additionalProperties: false, + bannerComment: '', + declareExternallyReferenced: true, + }, + ) + ).replace(/^export /gm, ''), + format( + `const defaultOptions: Options = ${JSON.stringify( + rule.defaultOptions, + )};`, + { + parser: tseslintParser.parse, + }, + ), + ] + .join(EOL) + .trim(), + } as mdast.Code, + ); + } + } + + // 6. Add a link to view the rule's source and test code + root.children.push( + { + children: [ + { + type: 'text', + value: 'Resources', + }, + ], + depth: 2, + type: 'heading', + } as mdast.Heading, + { + children: [ + { + children: [ + { + children: [ + { + type: 'link', + url: `${sourceUrlPrefix}src/rules/${file.stem}.ts`, + children: [ + { + type: 'text', + value: 'Rule source', + }, + ], + }, + ], + type: 'paragraph', + }, + ], + type: 'listItem', + }, + { + children: [ + { + children: [ + { + type: 'link', + url: getUrlForRuleTest(file.stem), + children: [ + { + type: 'text', + value: 'Test source', + }, + ], + }, + ], + type: 'paragraph', + }, + ], + type: 'listItem', + }, + ], + type: 'list', + } as mdast.List, + ); + + // 7. Also add a notice about coming from ESLint core for extension rules + if (meta.docs.extendsBaseRule) { + root.children.push({ + children: [ + { + type: 'jsx', + value: '', + }, + { + type: 'text', + value: 'Taken with ❤️ ', + }, + { + type: 'link', + title: null, + url: `https://github.com/eslint/eslint/blob/main/docs/src/rules/${ + meta.docs.extendsBaseRule === true + ? file.stem + : meta.docs.extendsBaseRule + }.md`, + children: [ + { + type: 'text', + value: 'from ESLint core', + }, + ], + }, + { + type: 'jsx', + value: '', + }, + ], + type: 'paragraph', + } as mdast.Paragraph); + } }; }; -export { generatedRuleDocs }; +function nodeIsHeading(node: unist.Node): node is mdast.Heading { + return node.type === 'heading'; +} + +function createH2TextFilter( + text: string, +): (node: unist.Node) => node is mdast.Heading { + return (node: unist.Node): node is mdast.Heading => + nodeIsHeading(node) && + node.depth === 2 && + node.children.length === 1 && + node.children[0].type === 'text' && + node.children[0].value === text; +} + +function getUrlForRuleTest(ruleName: string): string { + for (const localPath of [ + `tests/rules/${ruleName}.test.ts`, + `tests/rules/${ruleName}/`, + ]) { + if (fs.existsSync(`${eslintPluginDirectory}/${localPath}`)) { + return `${sourceUrlPrefix}${localPath}`; + } + } + + throw new Error(`Could not find test file for ${ruleName}.`); +} diff --git a/packages/website/project.json b/packages/website/project.json index 9bfd9e8a8aa..e7e7b0eabbf 100644 --- a/packages/website/project.json +++ b/packages/website/project.json @@ -1,5 +1,15 @@ { - "root": "packages/website", + "name": "website", + "$schema": "../../node_modules/nx/schemas/project-schema.json", "type": "library", - "implicitDependencies": [] + "implicitDependencies": [], + "targets": { + "lint": { + "executor": "@nrwl/linter:eslint", + "outputs": ["{options.outputFile}"], + "options": { + "lintFilePatterns": ["packages/website/**/*.ts"] + } + } + } } diff --git a/packages/website/sidebars/sidebar.base.js b/packages/website/sidebars/sidebar.base.js index 5b16af7f5f9..2a097b02a70 100644 --- a/packages/website/sidebars/sidebar.base.js +++ b/packages/website/sidebars/sidebar.base.js @@ -1,11 +1,12 @@ module.exports = { docs: [ { - collapsed: false, + collapsible: false, items: [ { label: 'Linting with Type Information', items: ['linting/typed-linting/monorepos'], + collapsible: false, link: { id: 'linting/typed-linting', type: 'doc', @@ -19,8 +20,10 @@ module.exports = { id: 'linting/troubleshooting', type: 'doc', }, + collapsible: false, type: 'category', items: [ + 'linting/troubleshooting/performance-troubleshooting', 'linting/troubleshooting/formatting', 'linting/troubleshooting/tslint', ], @@ -33,21 +36,69 @@ module.exports = { label: 'Getting Started', type: 'category', }, + 'custom-rules', { + items: [ + 'architecture/eslint-plugin', + 'architecture/eslint-plugin-tslint', + 'architecture/parser', + 'architecture/scope-manager', + 'architecture/typescript-estree', + 'architecture/utils', + ], + label: 'Architecture', + link: { + id: 'architecture', + type: 'doc', + }, type: 'category', - label: 'Development', - collapsed: false, + }, + { + items: [ + 'contributing/discussions', + 'contributing/issues', + 'contributing/local-development', + 'contributing/pull-requests', + ], + label: 'Contributing', + link: { + id: 'contributing', + type: 'doc', + }, + type: 'category', + }, + { items: [ + 'maintenance/branding', { - label: 'Architecture', + collapsible: false, + items: ['maintenance/issues/rule-deprecations'], + label: 'Issues', + link: { + id: 'maintenance/issues', + type: 'doc', + }, + type: 'category', + }, + 'maintenance/pull-requests', + 'maintenance/releases', + { + collapsible: false, + items: ['maintenance/versioning/dependant-version-upgrades'], + label: 'Versioning', + link: { + id: 'maintenance/versioning', + type: 'doc', + }, type: 'category', - items: [ - 'development/architecture/asts', - 'development/architecture/packages', - ], }, - 'development/custom-rules', ], + label: 'Maintenance', + link: { + id: 'maintenance', + type: 'doc', + }, + type: 'category', }, ], }; diff --git a/packages/website/sidebars/sidebar.rules.js b/packages/website/sidebars/sidebar.rules.js index 4399d2da65f..e698d7cda05 100644 --- a/packages/website/sidebars/sidebar.rules.js +++ b/packages/website/sidebars/sidebar.rules.js @@ -10,9 +10,25 @@ const rules = Object.entries(plugin.rules).map(([name, rule]) => { }; }); -const notDeprecatedRules = rules.filter(rule => !rule.meta.deprecated); +const deprecatedRules = new Set(rules.filter(rule => rule.meta.deprecated)); -const deprecatedRules = rules.filter(rule => rule.meta.deprecated); +const formattingRules = new Set( + rules.filter(rule => !rule.meta.deprecated && rule.meta.type === 'layout'), +); + +const extensionRules = new Set( + rules.filter( + rule => rule.meta.docs?.extendsBaseRule && !formattingRules.has(rule), + ), +); + +const typescriptRules = rules.filter( + rule => + !rule.meta.deprecated && + !extensionRules.has(rule) && + !deprecatedRules.has(rule) && + !formattingRules.has(rule), +); const paths = globby .sync('*.md', { @@ -31,34 +47,38 @@ const paths = globby ); }); +function createCategory(label, rules, additionalItems = []) { + return { + items: [ + ...rules.map(rule => { + return { + type: 'doc', + id: rule.name, + label: rule.name, + }; + }), + ...additionalItems, + ], + label, + type: 'category', + }; +} + module.exports = { someSidebar: [ 'README', { - type: 'category', - label: 'Rules', - collapsible: true, + ...createCategory('TypeScript Rules', Array.from(typescriptRules)), collapsed: false, - items: notDeprecatedRules.map(item => { - return { - type: 'doc', - id: item.name, - label: item.name, - }; - }), }, { - type: 'category', - label: 'Deprecated', - collapsible: true, + ...createCategory('Extension Rules', Array.from(extensionRules)), collapsed: false, - items: [...deprecatedRules, ...paths].map(item => { - return { - type: 'doc', - id: item.name, - label: item.name, - }; - }), }, + createCategory('Formatting Rules', Array.from(formattingRules)), + createCategory('Deprecated Rules', [ + ...Array.from(deprecatedRules), + ...paths, + ]), ], }; diff --git a/packages/website/src/components/ASTViewerESTree.tsx b/packages/website/src/components/ASTViewerESTree.tsx index 855235eba0b..29b5550cd14 100644 --- a/packages/website/src/components/ASTViewerESTree.tsx +++ b/packages/website/src/components/ASTViewerESTree.tsx @@ -1,11 +1,10 @@ +import type { TSESTree } from '@typescript-eslint/utils'; import React, { useMemo } from 'react'; import ASTViewer from './ast/ASTViewer'; -import type { ASTViewerBaseProps } from './ast/types'; -import type { TSESTree } from '@typescript-eslint/utils'; - import { serialize } from './ast/serializer/serializer'; import { createESTreeSerializer } from './ast/serializer/serializerESTree'; +import type { ASTViewerBaseProps } from './ast/types'; export interface ASTESTreeViewerProps extends ASTViewerBaseProps { readonly value: TSESTree.BaseNode; diff --git a/packages/website/src/components/ASTViewerScope.tsx b/packages/website/src/components/ASTViewerScope.tsx index 9d5dff8fc5a..e16365bfc3c 100644 --- a/packages/website/src/components/ASTViewerScope.tsx +++ b/packages/website/src/components/ASTViewerScope.tsx @@ -1,10 +1,9 @@ import React, { useMemo } from 'react'; import ASTViewer from './ast/ASTViewer'; -import type { ASTViewerBaseProps } from './ast/types'; - import { serialize } from './ast/serializer/serializer'; import { createScopeSerializer } from './ast/serializer/serializerScope'; +import type { ASTViewerBaseProps } from './ast/types'; export interface ASTScopeViewerProps extends ASTViewerBaseProps { readonly value: Record; diff --git a/packages/website/src/components/ASTViewerTS.tsx b/packages/website/src/components/ASTViewerTS.tsx index 8cd3f15ce5a..30dda954a43 100644 --- a/packages/website/src/components/ASTViewerTS.tsx +++ b/packages/website/src/components/ASTViewerTS.tsx @@ -1,10 +1,10 @@ import React, { useEffect, useState } from 'react'; +import type { SourceFile } from 'typescript'; import ASTViewer from './ast/ASTViewer'; -import type { ASTViewerBaseProps, ASTViewerModelMap } from './ast/types'; -import type { SourceFile } from 'typescript'; import { serialize } from './ast/serializer/serializer'; import { createTsSerializer } from './ast/serializer/serializerTS'; +import type { ASTViewerBaseProps, ASTViewerModelMap } from './ast/types'; export interface ASTTsViewerProps extends ASTViewerBaseProps { readonly value: SourceFile; @@ -53,7 +53,17 @@ export default function ASTViewerTS({ ['TypeFlags', typeFlags], ); setModel(serialize(value, scopeSerializer)); - }, [value, syntaxKind]); + }, [ + value, + syntaxKind, + nodeFlags, + tokenFlags, + modifierFlags, + objectFlags, + symbolFlags, + flowFlags, + typeFlags, + ]); return ( diff --git a/packages/website/src/components/EditorTabs.tsx b/packages/website/src/components/EditorTabs.tsx index a0b81e9dc05..6edbee22422 100644 --- a/packages/website/src/components/EditorTabs.tsx +++ b/packages/website/src/components/EditorTabs.tsx @@ -1,7 +1,8 @@ +import EditIcon from '@site/src/icons/edit.svg'; import React from 'react'; -import type { TabType } from './types'; + import styles from './Playground.module.css'; -import EditIcon from '@site/src/icons/edit.svg'; +import type { TabType } from './types'; export interface FileTabsProps { readonly tabs: TabType[]; diff --git a/packages/website/src/components/ErrorsViewer.tsx b/packages/website/src/components/ErrorsViewer.tsx index 6d7621d096a..0789b84d78c 100644 --- a/packages/website/src/components/ErrorsViewer.tsx +++ b/packages/website/src/components/ErrorsViewer.tsx @@ -1,13 +1,13 @@ -import React, { useEffect, useState } from 'react'; -import type Monaco from 'monaco-editor'; +import IconExternalLink from '@theme/Icon/ExternalLink'; import clsx from 'clsx'; +import type Monaco from 'monaco-editor'; +import React, { useEffect, useState } from 'react'; -import type { ErrorItem, ErrorGroup } from './types'; -import IconExternalLink from '@theme/IconExternalLink'; import styles from './ErrorsViewer.module.css'; +import type { ErrorGroup, ErrorItem } from './types'; export interface ErrorsViewerProps { - readonly value?: ErrorGroup[]; + readonly value?: ErrorGroup[] | Error; } export interface ErrorBlockProps { @@ -91,6 +91,18 @@ function ErrorBlock({ ); } +function SuccessBlock(): JSX.Element { + return ( +
+
+
+
All is ok!
+
+
+
+ ); +} + export default function ErrorsViewer({ value, }: ErrorsViewerProps): JSX.Element { @@ -100,33 +112,50 @@ export default function ErrorsViewer({ setIsLocked(false); }, [value]); + if (value && !Array.isArray(value)) { + return ( +
+
+

ESLint internal error

+ {value?.stack} +
+
+ ); + } + return (
- {value?.map(({ group, uri, items }) => { - return ( -
-

- {group} - {uri && ( - <> - {' - '} - - docs - - - )} -

- {items.map((item, index) => ( - - ))} -
- ); - })} + {value?.length ? ( + value.map(({ group, uri, items }) => { + return ( +
+

+ {group} + {uri && ( + <> + {' - '} + + docs + + + )} +

+ {items.map((item, index) => ( + + ))} +
+ ); + }) + ) : ( +
+ +
+ )}
); } diff --git a/packages/website/src/components/FinancialContributors/Sponsor.tsx b/packages/website/src/components/FinancialContributors/Sponsor.tsx index f43b0d3d81e..c50ab89b609 100644 --- a/packages/website/src/components/FinancialContributors/Sponsor.tsx +++ b/packages/website/src/components/FinancialContributors/Sponsor.tsx @@ -1,21 +1,17 @@ import React from 'react'; -import { SponsorData, SponsorIncludeOptions } from './types'; +import styles from './styles.module.css'; +import type { SponsorData } from './types'; interface SponsorProps { - className?: string; - include?: SponsorIncludeOptions; + includeName?: boolean; sponsor: SponsorData; } -export function Sponsor({ - className, - include = {}, - sponsor, -}: SponsorProps): JSX.Element { +export function Sponsor({ includeName, sponsor }: SponsorProps): JSX.Element { let children = {`${sponsor.name}; - if (include.name) { + if (includeName) { children = ( <> {children} @@ -24,19 +20,15 @@ export function Sponsor({ ); } - if (include.link) { - children = ( - - {children} - - ); - } - - return children; + return ( + + {children} + + ); } diff --git a/packages/website/src/components/FinancialContributors/Sponsors/index.tsx b/packages/website/src/components/FinancialContributors/Sponsors/index.tsx index 2e47b077d5b..6c2d8874593 100644 --- a/packages/website/src/components/FinancialContributors/Sponsors/index.tsx +++ b/packages/website/src/components/FinancialContributors/Sponsors/index.tsx @@ -1,39 +1,35 @@ -import sponsors from '@site/data/sponsors.json'; import clsx from 'clsx'; import React from 'react'; -import styles from './styles.module.css'; import { Sponsor } from '../Sponsor'; -import { SponsorIncludeOptions } from '../types'; +import type { SponsorData } from '../types'; +import styles from './styles.module.css'; interface SponsorsProps { className: string; - description: string; - include?: SponsorIncludeOptions; + includeName?: boolean; expanded?: boolean; - tier?: string; + sponsors: SponsorData[]; title: string; + tier: string; } export function Sponsors({ className, - description, - include, - tier, + includeName, title, + tier, + sponsors, }: SponsorsProps): JSX.Element { return (

{title}

-

{description}

    - {sponsors - .filter(sponsor => sponsor.tier === tier) - .map(sponsor => ( -
  • - -
  • - ))} + {sponsors.map(sponsor => ( +
  • + +
  • + ))}
); diff --git a/packages/website/src/components/FinancialContributors/Sponsors/styles.module.css b/packages/website/src/components/FinancialContributors/Sponsors/styles.module.css index 9c337f1ead6..526e1ab745e 100644 --- a/packages/website/src/components/FinancialContributors/Sponsors/styles.module.css +++ b/packages/website/src/components/FinancialContributors/Sponsors/styles.module.css @@ -7,19 +7,20 @@ display: flex; flex-wrap: wrap; justify-content: center; - align-items: flex-end; + align-items: stretch; max-width: 800px; - margin: 10px auto; padding: 0; } .sponsorsTier li { list-style: none; margin: 5px; - max-width: 120px; + max-width: 130px; } .sponsorsTier img { + background: white; + display: block; margin: auto; } @@ -29,30 +30,45 @@ border: none; } -.tier-sponsor { - gap: 16px; +.tier-platinum-sponsor { + gap: 32px 16px; } -.tier-sponsor img { +.tier-platinum-sponsor img { display: inline-block; - max-height: 120px; - width: 120px; + max-height: 130px; + max-width: 130px; + width: 130px; } -.tier-supporter, -.tier-contributor { +.tier-gold-supporter, +.tier-silver-supporter { align-items: center; - gap: 4px 16px; } -.tier-supporter img { - max-height: 60px; - width: 60px; +.tier-gold-supporter { + font-size: 0.95rem; + line-height: 1; + gap: 12px; + padding-top: 12px; +} + +.tier-gold-supporter img { + max-height: 75px; + max-width: 75px; + width: 75px; } -.tier-contributor img { - max-height: 30px; - width: 30px; +.tier-silver-supporter { + gap: 4px 16px; + margin: auto; + max-width: 75%; +} + +.tier-silver-supporter img { + max-height: 45px; + max-width: 45px; + width: 45px; } @media screen and (min-width: 700px) { @@ -66,6 +82,9 @@ .tierArea { margin: 16px 0; width: auto; - padding: 0 60px; + } + + .tier-gold-supporter { + margin-bottom: 0; } } diff --git a/packages/website/src/components/FinancialContributors/index.tsx b/packages/website/src/components/FinancialContributors/index.tsx index 9665632df41..0460e1e8694 100644 --- a/packages/website/src/components/FinancialContributors/index.tsx +++ b/packages/website/src/components/FinancialContributors/index.tsx @@ -1,46 +1,65 @@ import Link from '@docusaurus/Link'; +import sponsors from '@site/data/sponsors.json'; import clsx from 'clsx'; import React from 'react'; -import styles from './styles.module.css'; import { Sponsors } from './Sponsors'; +import styles from './styles.module.css'; export function FinancialContributors(): JSX.Element { return ( <>

- The TypeScript ESLint project would not be possible without the generous + The typescript-eslint project would not be possible without the generous support of our financial contributors.

- - Become a financial contributor - +
+ + Become a financial sponsor + +
+ + See all financial sponsors + + + Docs + +
+
); } diff --git a/packages/website/src/components/FinancialContributors/styles.module.css b/packages/website/src/components/FinancialContributors/styles.module.css index b4de958b902..667e6a7e60c 100644 --- a/packages/website/src/components/FinancialContributors/styles.module.css +++ b/packages/website/src/components/FinancialContributors/styles.module.css @@ -2,27 +2,44 @@ display: inline-flex; flex-direction: column; gap: 8px; + height: 100%; +} + +.linksArea { + display: flex; + gap: 16px; + align-items: center; + flex-direction: column; + margin: 48px 24px 24px; +} + +.tierOtherArea { + padding: 0; } .become { - margin: 8px 0 24px; - font-size: 1rem; + font-size: 1.25rem; + padding: 0.75rem 1.75rem; +} + +.linksMore { + display: flex; + gap: 0.5rem; +} + +[data-theme='dark'] .linksArea a { + --ifm-font-color-base: var(--ifm-color-white); + --ifm-button-color: var(--ifm-color-white); } @media screen and (min-width: 1150px) { .sponsorsContainer { display: grid; - grid-template-columns: 55% 45%; + grid-template-columns: 50% 50%; margin: auto; max-width: 100%; } - .tierArea { - margin: 16px 0; - width: auto; - padding: 0 60px; - } - .tierSponsorArea { grid-area: 1 / 1 / 3 / 2; } @@ -31,7 +48,20 @@ grid-area: 1 / 2 / 2 / 3; } + .tierSponsorArea, + .tierSupporterArea { + padding: 0 60px; + } + .tierOtherArea { grid-area: 2 / 2 / 3 / 3; } + + .sponsorLink { + display: flex; + } + + .linksArea { + margin: 24px; + } } diff --git a/packages/website/src/components/FinancialContributors/types.ts b/packages/website/src/components/FinancialContributors/types.ts index fb20cb4623a..7bfc3911f39 100644 --- a/packages/website/src/components/FinancialContributors/types.ts +++ b/packages/website/src/components/FinancialContributors/types.ts @@ -7,8 +7,3 @@ export interface SponsorData { totalDonations: number; website?: string; } - -export interface SponsorIncludeOptions { - link?: boolean; - name?: boolean; -} diff --git a/packages/website/src/components/OptionsSelector.tsx b/packages/website/src/components/OptionsSelector.tsx index b9b78edfad0..fe573ef86ab 100644 --- a/packages/website/src/components/OptionsSelector.tsx +++ b/packages/website/src/components/OptionsSelector.tsx @@ -1,23 +1,18 @@ /* eslint-disable jsx-a11y/label-has-associated-control */ -import React, { useCallback } from 'react'; - import { NavbarSecondaryMenuFiller, useWindowSize, } from '@docusaurus/theme-common'; - -import Expander from './layout/Expander'; -import Dropdown from './inputs/Dropdown'; -import Checkbox from './inputs/Checkbox'; -import Tooltip from './inputs/Tooltip'; import CopyIcon from '@site/src/icons/copy.svg'; +import React, { useCallback } from 'react'; import useDebouncedToggle from './hooks/useDebouncedToggle'; - +import Checkbox from './inputs/Checkbox'; +import Dropdown from './inputs/Dropdown'; +import Tooltip from './inputs/Tooltip'; +import Expander from './layout/Expander'; import { createMarkdown, createMarkdownParams } from './lib/markdown'; - import styles from './OptionsSelector.module.css'; - import type { ConfigModel } from './types'; export interface OptionsSelectorParams { @@ -56,7 +51,7 @@ function OptionsSelectorContent({ .then(() => { setCopyLink(true); }); - }, []); + }, [setCopyLink]); const copyMarkdownToClipboard = useCallback(() => { if (isLoading) { @@ -65,7 +60,7 @@ function OptionsSelectorContent({ void navigator.clipboard.writeText(createMarkdown(state)).then(() => { setCopyMarkdown(true); }); - }, [state, isLoading]); + }, [isLoading, state, setCopyMarkdown]); const openIssue = useCallback(() => { if (isLoading) { diff --git a/packages/website/src/components/Playground.module.css b/packages/website/src/components/Playground.module.css index 98289955209..d6189b238f5 100644 --- a/packages/website/src/components/Playground.module.css +++ b/packages/website/src/components/Playground.module.css @@ -4,19 +4,21 @@ } .options { - width: 20rem; background: var(--playground-main-color); overflow: auto; + z-index: 1; } .sourceCode { height: 100%; - width: 50%; border: 1px solid var(--playground-secondary-color); } .codeBlocks { display: flex; + flex-grow: 1; + flex-shrink: 1; + flex-basis: 0; flex-direction: row; height: 100%; width: calc(100vw - 20rem); @@ -24,7 +26,7 @@ .astViewer { height: 100%; - width: 50%; + width: 100%; border: 1px solid var(--playground-secondary-color); padding: 0; overflow: auto; @@ -98,7 +100,6 @@ .astViewer, .sourceCode { height: 30rem; - width: 100%; } .astViewer { diff --git a/packages/website/src/components/Playground.tsx b/packages/website/src/components/Playground.tsx index d5fade82343..2a643a93976 100644 --- a/packages/website/src/components/Playground.tsx +++ b/packages/website/src/components/Playground.tsx @@ -1,40 +1,38 @@ -import React, { useCallback, useReducer, useState } from 'react'; -import type Monaco from 'monaco-editor'; -import clsx from 'clsx'; import { useColorMode } from '@docusaurus/theme-common'; +import ASTViewerScope from '@site/src/components/ASTViewerScope'; +import ConfigEslint from '@site/src/components/config/ConfigEslint'; +import ConfigTypeScript from '@site/src/components/config/ConfigTypeScript'; +import { + defaultEslintConfig, + defaultTsConfig, +} from '@site/src/components/config/utils'; +import EditorTabs from '@site/src/components/EditorTabs'; +import ErrorsViewer from '@site/src/components/ErrorsViewer'; +import type { TSESTree } from '@typescript-eslint/utils'; +import clsx from 'clsx'; +import type Monaco from 'monaco-editor'; +import React, { useCallback, useReducer, useState } from 'react'; +import type { SourceFile } from 'typescript'; -import styles from './Playground.module.css'; -import Loader from './layout/Loader'; - -import useHashState from './hooks/useHashState'; -import OptionsSelector from './OptionsSelector'; -import { LoadingEditor } from './editor/LoadingEditor'; -import { EditorEmbed } from './editor/EditorEmbed'; -import { shallowEqual } from './lib/shallowEqual'; - +import { useMediaQuery } from '../hooks/useMediaQuery'; import ASTViewerESTree from './ASTViewerESTree'; import ASTViewerTS from './ASTViewerTS'; - +import { EditorEmbed } from './editor/EditorEmbed'; +import { LoadingEditor } from './editor/LoadingEditor'; +import useHashState from './hooks/useHashState'; +import Loader from './layout/Loader'; +import { shallowEqual } from './lib/shallowEqual'; +import OptionsSelector from './OptionsSelector'; +import styles from './Playground.module.css'; +import ConditionalSplitPane from './SplitPane/ConditionalSplitPane'; import type { + ConfigModel, + ErrorGroup, RuleDetails, SelectedRange, - ErrorGroup, TabType, - ConfigModel, } from './types'; -import type { TSESTree } from '@typescript-eslint/utils'; -import type { SourceFile } from 'typescript'; -import ASTViewerScope from '@site/src/components/ASTViewerScope'; -import ErrorsViewer from '@site/src/components/ErrorsViewer'; -import EditorTabs from '@site/src/components/EditorTabs'; -import ConfigEslint from '@site/src/components/config/ConfigEslint'; -import ConfigTypeScript from '@site/src/components/config/ConfigTypeScript'; -import { - defaultEslintConfig, - defaultTsConfig, -} from '@site/src/components/config/utils'; - function rangeReducer( prevState: T, action: T, @@ -66,7 +64,7 @@ function Playground(): JSX.Element { const [esAst, setEsAst] = useState(); const [tsAst, setTsAST] = useState(); const [scope, setScope] = useState | null>(); - const [markers, setMarkers] = useState(); + const [markers, setMarkers] = useState(); const [ruleNames, setRuleNames] = useState([]); const [isLoading, setIsLoading] = useState(true); const [tsVersions, setTSVersion] = useState([]); @@ -74,6 +72,7 @@ function Playground(): JSX.Element { const [position, setPosition] = useState(null); const [activeTab, setTab] = useState('code'); const [showModal, setShowModal] = useState(false); + const enableSplitPanes = useMediaQuery('(min-width: 996px)'); const updateModal = useCallback( (config?: Partial) => { @@ -85,6 +84,15 @@ function Playground(): JSX.Element { [setState], ); + const onLoaded = useCallback( + (ruleNames: RuleDetails[], tsVersions: readonly string[]): void => { + setRuleNames(ruleNames); + setTSVersion(tsVersions); + setIsLoading(false); + }, + [], + ); + return (
{ruleNames.length > 0 && ( @@ -100,73 +108,86 @@ function Playground(): JSX.Element { config={state.tsconfig} onClose={updateModal} /> -
- -
-
- {isLoading && } - setShowModal(activeTab)} - /> -
- -
- { - setRuleNames(ruleNames); - setTSVersion(tsVersions); - setIsLoading(false); - }} - onSelect={setPosition} - /> -
-
- {(state.showAST === 'ts' && tsAst && ( - +
+ - )) || - (state.showAST === 'scope' && scope && ( - + +
+ {isLoading && } + setShowModal(activeTab)} /> - )) || - (state.showAST === 'es' && esAst && ( - + +
+ - )) || } -
+
+
+ {(state.showAST === 'ts' && tsAst && ( + + )) || + (state.showAST === 'scope' && scope && ( + + )) || + (state.showAST === 'es' && esAst && ( + + )) || } +
+ +
); diff --git a/packages/website/src/components/RulesTable/index.tsx b/packages/website/src/components/RulesTable/index.tsx index 6629637a44b..7b7033abe92 100644 --- a/packages/website/src/components/RulesTable/index.tsx +++ b/packages/website/src/components/RulesTable/index.tsx @@ -1,8 +1,8 @@ -import React, { useState, useMemo } from 'react'; -import clsx from 'clsx'; import Link from '@docusaurus/Link'; -import { useRulesMeta } from '@site/src/hooks/useRulesMeta'; import type { RulesMeta } from '@site/rulesMeta'; +import { useRulesMeta } from '@site/src/hooks/useRulesMeta'; +import clsx from 'clsx'; +import React, { useMemo, useState } from 'react'; import styles from './styles.module.css'; @@ -15,9 +15,11 @@ function interpolateCode(text: string): (JSX.Element | string)[] | string { } function RuleRow({ rule }: { rule: RulesMeta[number] }): JSX.Element | null { - if (!rule.docs || !rule.docs.url) { + if (!rule.docs?.url) { return null; } + const { fixable, hasSuggestions } = rule; + const { recommended, requiresTypeChecking } = rule.docs; return ( @@ -27,19 +29,38 @@ function RuleRow({ rule }: { rule: RulesMeta[number] }): JSX.Element | null {
{interpolateCode(rule.docs.description)} - - {rule.docs.recommended === 'strict' - ? '🔒' - : rule.docs.recommended - ? '✅' - : ''} + + {recommended === 'strict' ? '🔒' : recommended ? '✅' : ''} - - {rule.fixable ? '🔧\n' : '\n'} - {rule.hasSuggestions ? '🛠' : ''} + + {fixable ? '🔧\n' : '\n'} + {hasSuggestions ? '💡' : ''} - - {rule.docs.requiresTypeChecking ? '💭' : ''} + + {requiresTypeChecking ? '💭' : ''} ); @@ -168,7 +189,7 @@ export default function RulesTable({ Rule - ✅{'\n'}🔒 - 🔧{'\n'}🛠 - 💭 + + ✅{'\n'}🔒 + + + 🔧{'\n'}💡 + + + 💭 + diff --git a/packages/website/src/components/RulesTable/styles.module.css b/packages/website/src/components/RulesTable/styles.module.css index 6e2cc5ac27e..4b0d2cd6b63 100644 --- a/packages/website/src/components/RulesTable/styles.module.css +++ b/packages/website/src/components/RulesTable/styles.module.css @@ -111,9 +111,24 @@ .rulesTable, .ruleCol { width: 100%; + overflow: visible; + border-collapse: separate; + border-spacing: 0; +} + +.rulesTable thead { + background-color: #f7f7f7; + position: sticky; + top: var(--ifm-navbar-height); + box-shadow: 0 5px 5px var(--gray-border-shadow); +} + +[data-theme='dark'] .rulesTable th { + background-color: #2b2b2d; } .attrCol { min-width: 2.5em; text-align: center; + cursor: default; } diff --git a/packages/website/src/components/SplitPane/ConditionalSplitPane.tsx b/packages/website/src/components/SplitPane/ConditionalSplitPane.tsx new file mode 100644 index 00000000000..22c9aa14b5d --- /dev/null +++ b/packages/website/src/components/SplitPane/ConditionalSplitPane.tsx @@ -0,0 +1,28 @@ +import clsx from 'clsx'; +import React from 'react'; +import SplitPane, { type SplitPaneProps } from 'react-split-pane'; + +import splitPaneStyles from './SplitPane.module.css'; + +export interface ConditionalSplitPaneProps { + render: boolean; +} + +function ConditionalSplitPane({ + render, + children, + ...props +}: ConditionalSplitPaneProps & SplitPaneProps): JSX.Element { + return render ? ( + + {children} + + ) : ( + <>{children} + ); +} + +export default ConditionalSplitPane; diff --git a/packages/website/src/components/SplitPane/SplitPane.module.css b/packages/website/src/components/SplitPane/SplitPane.module.css new file mode 100644 index 00000000000..09537f1b1b5 --- /dev/null +++ b/packages/website/src/components/SplitPane/SplitPane.module.css @@ -0,0 +1,24 @@ +.resizer { + background: var(--ifm-color-emphasis-700); + opacity: 0.2; + z-index: 1; + box-sizing: border-box; + background-clip: padding-box; +} + +.resizer:hover { + transition: all 2s ease; +} + +.resizer.vertical { + width: 11px; + margin: 0 -5px; + border-left: 5px solid rgba(255, 255, 255, 0); + border-right: 5px solid rgba(255, 255, 255, 0); + cursor: col-resize; +} + +.resizer.vertical:hover { + border-left: 5px solid var(--ifm-color-emphasis-700); + border-right: 5px solid var(--ifm-color-emphasis-700); +} diff --git a/packages/website/src/components/ast/ASTViewer.tsx b/packages/website/src/components/ast/ASTViewer.tsx index 65edd757b7d..8cffd9371d0 100644 --- a/packages/website/src/components/ast/ASTViewer.tsx +++ b/packages/website/src/components/ast/ASTViewer.tsx @@ -1,9 +1,8 @@ import React, { useEffect, useState } from 'react'; -import styles from './ASTViewer.module.css'; - -import type { SelectedPosition, ASTViewerProps } from './types'; +import styles from './ASTViewer.module.css'; import { ElementItem } from './Elements'; +import type { ASTViewerProps, SelectedPosition } from './types'; function ASTViewer({ position, diff --git a/packages/website/src/components/ast/Elements.tsx b/packages/website/src/components/ast/Elements.tsx index def515f54ef..b8a9d7c823c 100644 --- a/packages/website/src/components/ast/Elements.tsx +++ b/packages/website/src/components/ast/Elements.tsx @@ -1,20 +1,17 @@ import React, { useCallback, useEffect, useState } from 'react'; +import styles from './ASTViewer.module.css'; +import HiddenItem from './HiddenItem'; +import ItemGroup from './ItemGroup'; +import { SimpleItem } from './SimpleItem'; import type { - GenericParams, ASTViewerModelMap, ASTViewerModelMapComplex, ASTViewerModelMapSimple, + GenericParams, } from './types'; - import { hasChildInRange, isArrayInRange, isInRange } from './utils'; -import styles from './ASTViewer.module.css'; - -import ItemGroup from './ItemGroup'; -import HiddenItem from './HiddenItem'; -import { SimpleItem } from './SimpleItem'; - export function ComplexItem({ data, onSelectNode, @@ -33,7 +30,7 @@ export function ComplexItem({ } } }, - [data], + [data.model.range, onSelectNode], ); useEffect(() => { @@ -47,10 +44,10 @@ export function ComplexItem({ level !== 'ast' && selected && !hasChildInRange(selection, data.model), ); - if (selected && !isExpanded) { + if (selected) { setIsExpanded(selected); } - }, [selection, data]); + }, [selection, data, level]); return ( ) => { e.preventDefault(); - props.onClick?.(e); + onClickProps?.(e); }, - [props.onClick], + [onClickProps], ); const onMouseEnter = useCallback(() => { - props.onHover?.(true); - }, [props.onHover]); + onHover?.(true); + }, [onHover]); const onMouseLeave = useCallback(() => { - props.onHover?.(false); - }, [props.onHover]); + onHover?.(false); + }, [onHover]); return props.onClick || props.onHover ? ( <> diff --git a/packages/website/src/components/ast/PropertyValue.tsx b/packages/website/src/components/ast/PropertyValue.tsx index 6539042d9af..9f8061d9b0c 100644 --- a/packages/website/src/components/ast/PropertyValue.tsx +++ b/packages/website/src/components/ast/PropertyValue.tsx @@ -1,4 +1,5 @@ import React from 'react'; + import styles from './ASTViewer.module.css'; import type { ASTViewerModelMap } from './types'; diff --git a/packages/website/src/components/ast/SimpleItem.tsx b/packages/website/src/components/ast/SimpleItem.tsx index c6e597dc8e9..23a25a8a57d 100644 --- a/packages/website/src/components/ast/SimpleItem.tsx +++ b/packages/website/src/components/ast/SimpleItem.tsx @@ -1,8 +1,8 @@ +import Tooltip from '@site/src/components/inputs/Tooltip'; import React, { useCallback } from 'react'; + import ItemGroup from './ItemGroup'; -import Tooltip from '@site/src/components/inputs/Tooltip'; import PropertyValue from './PropertyValue'; - import type { ASTViewerModelMapSimple, OnSelectNodeFn } from './types'; export interface SimpleItemProps { @@ -20,7 +20,7 @@ export function SimpleItem({ onSelectNode(state ? data.model.range : null); } }, - [data], + [data.model.range, onSelectNode], ); return ( diff --git a/packages/website/src/components/ast/serializer/serializer.ts b/packages/website/src/components/ast/serializer/serializer.ts index 697dba624fb..f6c75be3302 100644 --- a/packages/website/src/components/ast/serializer/serializer.ts +++ b/packages/website/src/components/ast/serializer/serializer.ts @@ -1,6 +1,6 @@ import type { - ASTViewerModelSimple, ASTViewerModelMap, + ASTViewerModelSimple, Serializer, } from '../types'; import { isRecord, objType } from '../utils'; @@ -26,7 +26,7 @@ function getSimpleModel(data: unknown): ASTViewerModelSimple { value: String(data), type: 'regexp', }; - } else if (typeof data === 'undefined' || data === null) { + } else if (data == null) { return { value: String(data), type: 'undefined', diff --git a/packages/website/src/components/ast/serializer/serializerESTree.ts b/packages/website/src/components/ast/serializer/serializerESTree.ts index 76aabfd024b..d88af8955d9 100644 --- a/packages/website/src/components/ast/serializer/serializerESTree.ts +++ b/packages/website/src/components/ast/serializer/serializerESTree.ts @@ -1,5 +1,6 @@ -import type { ASTViewerModel, Serializer } from '../types'; import type { TSESTree } from '@typescript-eslint/utils'; + +import type { ASTViewerModel, Serializer } from '../types'; import { isRecord } from '../utils'; export const propsToFilter = ['parent', 'comments', 'tokens']; diff --git a/packages/website/src/components/ast/serializer/serializerScope.ts b/packages/website/src/components/ast/serializer/serializerScope.ts index b000aba7db1..c41021da99a 100644 --- a/packages/website/src/components/ast/serializer/serializerScope.ts +++ b/packages/website/src/components/ast/serializer/serializerScope.ts @@ -1,5 +1,6 @@ -import type { ASTViewerModel, Serializer, SelectedRange } from '../types'; import type { TSESTree } from '@typescript-eslint/utils'; + +import type { ASTViewerModel, SelectedRange, Serializer } from '../types'; import { isRecord } from '../utils'; function isESTreeNode( diff --git a/packages/website/src/components/ast/serializer/serializerTS.ts b/packages/website/src/components/ast/serializer/serializerTS.ts index 66cffe82b92..fe00cbb55d1 100644 --- a/packages/website/src/components/ast/serializer/serializerTS.ts +++ b/packages/website/src/components/ast/serializer/serializerTS.ts @@ -1,5 +1,6 @@ -import type { ASTViewerModel, Serializer, SelectedPosition } from '../types'; -import type { SourceFile, Node, Type, Symbol as TSSymbol } from 'typescript'; +import type { Node, SourceFile, Symbol as TSSymbol, Type } from 'typescript'; + +import type { ASTViewerModel, SelectedPosition, Serializer } from '../types'; import { isRecord } from '../utils'; export function getLineAndCharacterFor( diff --git a/packages/website/src/components/ast/types.ts b/packages/website/src/components/ast/types.ts index 76f5164d07b..7711d597344 100644 --- a/packages/website/src/components/ast/types.ts +++ b/packages/website/src/components/ast/types.ts @@ -1,5 +1,6 @@ +import type Monaco from 'monaco-editor'; + import type { SelectedPosition, SelectedRange } from '../types'; -import Monaco from 'monaco-editor'; export type OnSelectNodeFn = (node: SelectedRange | null) => void; diff --git a/packages/website/src/components/ast/utils.ts b/packages/website/src/components/ast/utils.ts index bfe21860afd..de55a5c0720 100644 --- a/packages/website/src/components/ast/utils.ts +++ b/packages/website/src/components/ast/utils.ts @@ -1,5 +1,9 @@ -import type { SelectedPosition, SelectedRange } from './types'; -import { ASTViewerModel, ASTViewerModelComplex } from './types'; +import type { + ASTViewerModel, + ASTViewerModelComplex, + SelectedPosition, + SelectedRange, +} from './types'; export function isWithinRange( loc: SelectedPosition, @@ -16,7 +20,6 @@ export function isWithinRange( export function objType(obj: unknown): string { const type = Object.prototype.toString.call(obj).slice(8, -1); - // @ts-expect-error: this is correct check if (type === 'Object' && obj && typeof obj[Symbol.iterator] === 'function') { return 'Iterable'; } diff --git a/packages/website/src/components/config/ConfigEditor.tsx b/packages/website/src/components/config/ConfigEditor.tsx index 4f0f9d93995..0d4915d281b 100644 --- a/packages/website/src/components/config/ConfigEditor.tsx +++ b/packages/website/src/components/config/ConfigEditor.tsx @@ -1,13 +1,12 @@ -import React, { useCallback, useEffect, useReducer, useState } from 'react'; +import Dropdown from '@site/src/components/inputs/Dropdown'; +import Modal from '@site/src/components/modals/Modal'; import clsx from 'clsx'; +import React, { useCallback, useEffect, useReducer, useState } from 'react'; -import styles from './ConfigEditor.module.css'; - -import Text from '../inputs/Text'; -import Checkbox from '../inputs/Checkbox'; import useFocus from '../hooks/useFocus'; -import Modal from '@site/src/components/modals/Modal'; -import Dropdown from '@site/src/components/inputs/Dropdown'; +import Checkbox from '../inputs/Checkbox'; +import Text from '../inputs/Text'; +import styles from './ConfigEditor.module.css'; export interface ConfigOptionsField { key: string; @@ -90,26 +89,27 @@ function isDefault(value: unknown, defaults?: unknown[]): boolean { } function ConfigEditor(props: ConfigEditorProps): JSX.Element { + const { onClose: onCloseProps, isOpen, values } = props; const [filter, setFilter] = useState(''); const [config, setConfig] = useReducer(reducerObject, {}); const [filterInput, setFilterFocus] = useFocus(); const onClose = useCallback(() => { - props.onClose(config); - }, [props.onClose, config]); + onCloseProps(config); + }, [onCloseProps, config]); useEffect(() => { - setConfig({ type: 'init', config: props.values }); - }, [props.values]); + setConfig({ type: 'init', config: values }); + }, [values]); useEffect(() => { - if (props.isOpen) { + if (isOpen) { setFilterFocus(); } - }, [props.isOpen]); + }, [isOpen, setFilterFocus]); return ( - +
{item.key} - {item.label &&
} - {item.label && {item.label}} + {item.label && ( + <> +
+ {item.label} + + )}
{item.type === 'boolean' && ( ([]); const [configObject, updateConfigObject] = useState(); useEffect(() => { - if (props.isOpen) { - updateConfigObject(parseESLintRC(props.config)); + if (isOpen) { + updateConfigObject(parseESLintRC(config)); } - }, [props.isOpen, props.config]); + }, [isOpen, config]); useEffect(() => { updateOptions([ { heading: 'Rules', - fields: props.ruleOptions + fields: ruleOptions .filter(item => item.name.startsWith('@typescript')) .map(item => ({ key: item.name, @@ -51,7 +53,7 @@ function ConfigEslint(props: ConfigEslintProps): JSX.Element { }, { heading: 'Core rules', - fields: props.ruleOptions + fields: ruleOptions .filter(item => !item.name.startsWith('@typescript')) .map(item => ({ key: item.name, @@ -61,7 +63,7 @@ function ConfigEslint(props: ConfigEslintProps): JSX.Element { })), }, ]); - }, [props.ruleOptions]); + }, [ruleOptions]); const onClose = useCallback( (newConfig: Record) => { @@ -75,14 +77,14 @@ function ConfigEslint(props: ConfigEslintProps): JSX.Element { .filter(checkOptions), ); if (!shallowEqual(cfg, configObject?.rules)) { - props.onClose({ + onCloseProps({ eslintrc: toJson({ ...(configObject ?? {}), rules: cfg }), }); } else { - props.onClose(); + onCloseProps(); } }, - [props.onClose, configObject], + [onCloseProps, configObject], ); return ( @@ -90,7 +92,7 @@ function ConfigEslint(props: ConfigEslintProps): JSX.Element { header="Eslint Config" options={options} values={configObject?.rules ?? {}} - isOpen={props.isOpen} + isOpen={isOpen} onClose={onClose} /> ); diff --git a/packages/website/src/components/config/ConfigTypeScript.tsx b/packages/website/src/components/config/ConfigTypeScript.tsx index 91a4781d14f..40cd634ffb1 100644 --- a/packages/website/src/components/config/ConfigTypeScript.tsx +++ b/packages/website/src/components/config/ConfigTypeScript.tsx @@ -1,8 +1,9 @@ import React, { useCallback, useEffect, useState } from 'react'; -import ConfigEditor, { ConfigOptionsType } from './ConfigEditor'; -import type { ConfigModel, TSConfig } from '../types'; import { shallowEqual } from '../lib/shallowEqual'; +import type { ConfigModel, TSConfig } from '../types'; +import type { ConfigOptionsType } from './ConfigEditor'; +import ConfigEditor from './ConfigEditor'; import { getTypescriptOptions, parseTSConfig, toJson } from './utils'; interface ConfigTypeScriptProps { @@ -12,14 +13,15 @@ interface ConfigTypeScriptProps { } function ConfigTypeScript(props: ConfigTypeScriptProps): JSX.Element { + const { onClose: onCloseProps, isOpen, config } = props; const [tsConfigOptions, updateOptions] = useState([]); const [configObject, updateConfigObject] = useState(); useEffect(() => { - if (props.isOpen) { - updateConfigObject(parseTSConfig(props.config)); + if (isOpen) { + updateConfigObject(parseTSConfig(config)); } - }, [props.isOpen, props.config]); + }, [isOpen, config]); useEffect(() => { if (window.ts) { @@ -53,20 +55,20 @@ function ConfigTypeScript(props: ConfigTypeScriptProps): JSX.Element { ), ); } - }, [props.isOpen]); + }, [isOpen]); const onClose = useCallback( (newConfig: Record) => { const cfg = { ...newConfig }; if (!shallowEqual(cfg, configObject?.compilerOptions)) { - props.onClose({ + onCloseProps({ tsconfig: toJson({ ...(configObject ?? {}), compilerOptions: cfg }), }); } else { - props.onClose(); + onCloseProps(); } }, - [props.onClose, configObject], + [onCloseProps, configObject], ); return ( @@ -74,7 +76,7 @@ function ConfigTypeScript(props: ConfigTypeScriptProps): JSX.Element { header="TypeScript Config" options={tsConfigOptions} values={configObject?.compilerOptions ?? {}} - isOpen={props.isOpen} + isOpen={isOpen} onClose={onClose} /> ); diff --git a/packages/website/src/components/config/utils.ts b/packages/website/src/components/config/utils.ts index d068f9e13ff..990811f1cca 100644 --- a/packages/website/src/components/config/utils.ts +++ b/packages/website/src/components/config/utils.ts @@ -1,7 +1,6 @@ +import { isRecord } from '@site/src/components/ast/utils'; import type { EslintRC, TSConfig } from '@site/src/components/types'; - import { parse } from 'json5'; -import { isRecord } from '@site/src/components/ast/utils'; export interface OptionDeclarations { name: string; diff --git a/packages/website/src/components/editor/LoadedEditor.tsx b/packages/website/src/components/editor/LoadedEditor.tsx index f325fb91e6d..e641d77baa5 100644 --- a/packages/website/src/components/editor/LoadedEditor.tsx +++ b/packages/website/src/components/editor/LoadedEditor.tsx @@ -1,33 +1,25 @@ -import React, { - useCallback, - useMemo, - useEffect, - useRef, - useState, -} from 'react'; import type Monaco from 'monaco-editor'; -import type { SandboxInstance } from './useSandboxServices'; -import type { CommonEditorProps } from './types'; -import type { TabType } from '../types'; -import type { WebLinter } from '../linter/WebLinter'; +import type React from 'react'; +import { useCallback, useEffect, useMemo, useRef, useState } from 'react'; +import { + parseESLintRC, + parseTSConfig, + tryParseEslintModule, +} from '../config/utils'; import { debounce } from '../lib/debounce'; -import { createProvideCodeActions } from './createProvideCodeActions'; +import type { LintCodeAction } from '../linter/utils'; +import { parseLintResults, parseMarkers } from '../linter/utils'; +import type { WebLinter } from '../linter/WebLinter'; +import type { TabType } from '../types'; import { createCompilerOptions, getEslintSchema, getTsConfigSchema, } from './config'; -import { - parseMarkers, - parseLintResults, - LintCodeAction, -} from '../linter/utils'; -import { - tryParseEslintModule, - parseESLintRC, - parseTSConfig, -} from '../config/utils'; +import { createProvideCodeActions } from './createProvideCodeActions'; +import type { CommonEditorProps } from './types'; +import type { SandboxInstance } from './useSandboxServices'; export interface LoadedEditorProps extends CommonEditorProps { readonly main: typeof Monaco; @@ -55,7 +47,8 @@ export const LoadedEditor: React.FC = ({ webLinter, activeTab, }) => { - const [decorations, setDecorations] = useState([]); + const [_, setDecorations] = useState([]); + const codeActions = useRef(new Map()).current; const [tabs] = useState>(() => { const tabsDefault = { @@ -83,7 +76,12 @@ export const LoadedEditor: React.FC = ({ resource: model.uri, }); onMarkersChange(parseMarkers(markers, codeActions, sandboxInstance.editor)); - }, []); + }, [ + codeActions, + onMarkersChange, + sandboxInstance.editor, + sandboxInstance.monaco.editor, + ]); useEffect(() => { const newPath = jsx ? '/input.tsx' : '/input.ts'; @@ -100,7 +98,13 @@ export const LoadedEditor: React.FC = ({ tabs.code.dispose(); tabs.code = newModel; } - }, [jsx]); + }, [ + jsx, + sandboxInstance.editor, + sandboxInstance.monaco.Uri, + sandboxInstance.monaco.editor, + tabs, + ]); useEffect(() => { const config = createCompilerOptions( @@ -109,48 +113,73 @@ export const LoadedEditor: React.FC = ({ ); webLinter.updateCompilerOptions(config); sandboxInstance.setCompilerSettings(config); - }, [jsx, tsconfig]); + }, [jsx, sandboxInstance, tsconfig, webLinter]); useEffect(() => { webLinter.updateRules(parseESLintRC(eslintrc).rules); - }, [eslintrc]); + }, [eslintrc, webLinter]); useEffect(() => { sandboxInstance.editor.setModel(tabs[activeTab]); updateMarkers(); - }, [activeTab]); + }, [activeTab, sandboxInstance.editor, tabs, updateMarkers]); - useEffect( - debounce(() => { + useEffect(() => { + const lintEditor = debounce(() => { // eslint-disable-next-line no-console console.info('[Editor] linting triggered'); webLinter.updateParserOptions(jsx, sourceType); - const messages = webLinter.lint(code); + try { + const messages = webLinter.lint(code); - const markers = parseLintResults(messages, codeActions, ruleId => - sandboxInstance.monaco.Uri.parse(webLinter.rulesUrl.get(ruleId) ?? ''), - ); + const markers = parseLintResults(messages, codeActions, ruleId => + sandboxInstance.monaco.Uri.parse( + webLinter.rulesUrl.get(ruleId) ?? '', + ), + ); - sandboxInstance.monaco.editor.setModelMarkers( - tabs.code, - 'eslint', - markers, - ); + sandboxInstance.monaco.editor.setModelMarkers( + tabs.code, + 'eslint', + markers, + ); - // fallback when event is not preset, ts < 4.0.5 - if (!sandboxInstance.monaco.editor.onDidChangeMarkers) { - updateMarkers(); + // fallback when event is not preset, ts < 4.0.5 + if (!sandboxInstance.monaco.editor.onDidChangeMarkers) { + updateMarkers(); + } + } catch (e) { + onMarkersChange(e as Error); } onEsASTChange(webLinter.storedAST); onTsASTChange(webLinter.storedTsAST); onScopeChange(webLinter.storedScope); onSelect(sandboxInstance.editor.getPosition()); - }, 500), - [code, jsx, tsconfig, eslintrc, sourceType, webLinter], - ); + }, 500); + + lintEditor(); + }, [ + code, + jsx, + tsconfig, + eslintrc, + sourceType, + webLinter, + onEsASTChange, + onTsASTChange, + onScopeChange, + onSelect, + sandboxInstance.editor, + sandboxInstance.monaco.editor, + sandboxInstance.monaco.Uri, + codeActions, + tabs.code, + updateMarkers, + onMarkersChange, + ]); useEffect(() => { // configure the JSON language support with schemas and schema associations @@ -224,7 +253,20 @@ export const LoadedEditor: React.FC = ({ } } }; - }, []); + }, [ + codeActions, + main.languages, + onChange, + onSelect, + sandboxInstance.editor, + sandboxInstance.monaco.editor, + sandboxInstance.monaco.languages.json.jsonDefaults, + tabs.code, + tabs.eslintrc, + tabs.tsconfig, + updateMarkers, + webLinter.ruleNames, + ]); const resize = useMemo(() => { return debounce(() => sandboxInstance.editor.layout(), 1); @@ -234,6 +276,22 @@ export const LoadedEditor: React.FC = ({ resize(); }, [resize, showAST]); + const domNode = sandboxInstance.editor.getContainerDomNode(); + const resizeObserver = useMemo(() => { + return new ResizeObserver(() => { + resize(); + }); + }, [resize]); + + useEffect(() => { + if (domNode) { + resizeObserver.observe(domNode); + + return (): void => resizeObserver.unobserve(domNode); + } + return (): void => {}; + }, [domNode, resizeObserver]); + useEffect(() => { window.addEventListener('resize', resize); return (): void => { @@ -250,7 +308,7 @@ export const LoadedEditor: React.FC = ({ }, ]); } - }, [code]); + }, [code, tabs.code]); useEffect(() => { if (tsconfig !== tabs.tsconfig.getValue()) { @@ -261,7 +319,7 @@ export const LoadedEditor: React.FC = ({ }, ]); } - }, [tsconfig]); + }, [tabs.tsconfig, tsconfig]); useEffect(() => { if (eslintrc !== tabs.eslintrc.getValue()) { @@ -272,7 +330,7 @@ export const LoadedEditor: React.FC = ({ }, ]); } - }, [eslintrc]); + }, [eslintrc, tabs.eslintrc]); useEffect(() => { sandboxInstance.monaco.editor.setTheme(darkTheme ? 'vs-dark' : 'vs-light'); @@ -280,9 +338,9 @@ export const LoadedEditor: React.FC = ({ useEffect(() => { if (sandboxInstance.editor.getModel() === tabs.code) { - setDecorations( + setDecorations(prevDecorations => sandboxInstance.editor.deltaDecorations( - decorations, + prevDecorations, decoration && showAST ? [ { @@ -302,7 +360,7 @@ export const LoadedEditor: React.FC = ({ ), ); } - }, [decoration, sandboxInstance, showAST]); + }, [decoration, sandboxInstance, showAST, tabs.code]); return null; }; diff --git a/packages/website/src/components/editor/LoadingEditor.tsx b/packages/website/src/components/editor/LoadingEditor.tsx index b64a4985dee..813593ae3b8 100644 --- a/packages/website/src/components/editor/LoadingEditor.tsx +++ b/packages/website/src/components/editor/LoadingEditor.tsx @@ -1,8 +1,9 @@ import React from 'react'; -import type { CommonEditorProps } from './types'; import { LoadedEditor } from './LoadedEditor'; -import { SandboxServicesProps, useSandboxServices } from './useSandboxServices'; +import type { CommonEditorProps } from './types'; +import type { SandboxServicesProps } from './useSandboxServices'; +import { useSandboxServices } from './useSandboxServices'; export type LoadingEditorProps = CommonEditorProps & SandboxServicesProps; diff --git a/packages/website/src/components/editor/config.ts b/packages/website/src/components/editor/config.ts index e2c5b7fe6bb..2428a550269 100644 --- a/packages/website/src/components/editor/config.ts +++ b/packages/website/src/components/editor/config.ts @@ -1,5 +1,6 @@ -import type Monaco from 'monaco-editor'; import type { JSONSchema4 } from '@typescript-eslint/utils/dist/json-schema'; +import type Monaco from 'monaco-editor'; + import { getTypescriptOptions } from '../config/utils'; export function createCompilerOptions( diff --git a/packages/website/src/components/editor/createProvideCodeActions.ts b/packages/website/src/components/editor/createProvideCodeActions.ts index 26045a46793..242d52e3d1e 100644 --- a/packages/website/src/components/editor/createProvideCodeActions.ts +++ b/packages/website/src/components/editor/createProvideCodeActions.ts @@ -1,9 +1,7 @@ import type Monaco from 'monaco-editor'; -import { - createEditOperation, - createURI, - LintCodeAction, -} from '../linter/utils'; + +import type { LintCodeAction } from '../linter/utils'; +import { createEditOperation, createURI } from '../linter/utils'; export function createProvideCodeActions( fixes: Map, diff --git a/packages/website/src/components/editor/loadSandbox.ts b/packages/website/src/components/editor/loadSandbox.ts index ac342d8e290..c92c806e4c1 100644 --- a/packages/website/src/components/editor/loadSandbox.ts +++ b/packages/website/src/components/editor/loadSandbox.ts @@ -1,9 +1,12 @@ -import type * as TsWorker from '../../vendor/tsWorker'; -import type * as SandboxFactory from '../../vendor/sandbox'; import type { LintUtils } from '@typescript-eslint/website-eslint'; +import type MonacoType from 'monaco-editor'; +import type * as TSType from 'typescript'; + +import type * as SandboxFactory from '../../vendor/sandbox'; +import type * as TsWorker from '../../vendor/tsWorker'; -type Monaco = typeof import('monaco-editor'); -type TS = typeof import('typescript'); +type Monaco = typeof MonacoType; +type TS = typeof TSType; declare global { type WindowRequireCb = ( diff --git a/packages/website/src/components/editor/types.ts b/packages/website/src/components/editor/types.ts index 7b904b4bf5f..22bb1f4a7fd 100644 --- a/packages/website/src/components/editor/types.ts +++ b/packages/website/src/components/editor/types.ts @@ -1,8 +1,9 @@ -import type Monaco from 'monaco-editor'; -import type { ConfigModel, SelectedRange, ErrorGroup, TabType } from '../types'; import type { TSESTree } from '@typescript-eslint/utils'; +import type Monaco from 'monaco-editor'; import type { SourceFile } from 'typescript'; +import type { ConfigModel, ErrorGroup, SelectedRange, TabType } from '../types'; + export interface CommonEditorProps extends ConfigModel { readonly darkTheme: boolean; readonly activeTab: TabType; @@ -11,6 +12,6 @@ export interface CommonEditorProps extends ConfigModel { readonly onTsASTChange: (value: undefined | SourceFile) => void; readonly onEsASTChange: (value: undefined | TSESTree.Program) => void; readonly onScopeChange: (value: undefined | Record) => void; - readonly onMarkersChange: (value: ErrorGroup[]) => void; + readonly onMarkersChange: (value: ErrorGroup[] | Error) => void; readonly onSelect: (position: Monaco.Position | null) => void; } diff --git a/packages/website/src/components/editor/useSandboxServices.ts b/packages/website/src/components/editor/useSandboxServices.ts index c786e999604..73c336676b3 100644 --- a/packages/website/src/components/editor/useSandboxServices.ts +++ b/packages/website/src/components/editor/useSandboxServices.ts @@ -1,17 +1,16 @@ +import { useColorMode } from '@docusaurus/theme-common'; +import { createCompilerOptions } from '@site/src/components/editor/config'; +import type Monaco from 'monaco-editor'; import { useEffect, useState } from 'react'; -import type Monaco from 'monaco-editor'; -import type { RuleDetails } from '../types'; import type { createTypeScriptSandbox, SandboxConfig, } from '../../vendor/sandbox'; - import { WebLinter } from '../linter/WebLinter'; -import { sandboxSingleton } from './loadSandbox'; +import type { RuleDetails } from '../types'; import { editorEmbedId } from './EditorEmbed'; -import { useColorMode } from '@docusaurus/theme-common'; -import { createCompilerOptions } from '@site/src/components/editor/config'; +import { sandboxSingleton } from './loadSandbox'; export interface SandboxServicesProps { readonly jsx?: boolean; @@ -33,6 +32,7 @@ export interface SandboxServices { export const useSandboxServices = ( props: SandboxServicesProps, ): Error | SandboxServices | undefined => { + const { onLoaded } = props; const [services, setServices] = useState(); const [loadedTs, setLoadedTs] = useState(props.ts); const { colorMode } = useColorMode(); @@ -110,7 +110,7 @@ export const useSandboxServices = ( const webLinter = new WebLinter(system, compilerOptions, lintUtils); - props.onLoaded( + onLoaded( webLinter.ruleNames, Array.from( new Set([...sandboxInstance.supportedVersions, window.ts.version]), @@ -145,7 +145,7 @@ export const useSandboxServices = ( model.dispose(); } }; - }, [props.ts]); + }, [props.ts, colorMode, props.jsx, onLoaded]); return services; }; diff --git a/packages/website/src/components/hooks/useDebouncedToggle.ts b/packages/website/src/components/hooks/useDebouncedToggle.ts index 73b655d28e7..d857f4aea2c 100644 --- a/packages/website/src/components/hooks/useDebouncedToggle.ts +++ b/packages/website/src/components/hooks/useDebouncedToggle.ts @@ -1,4 +1,4 @@ -import { useRef, useCallback, useState } from 'react'; +import { useCallback, useRef, useState } from 'react'; export default function useDebouncedToggle( value: T, @@ -19,7 +19,7 @@ export default function useDebouncedToggle( setState(value); }, timeout); }, - [timeoutIdRef], + [timeout, value], ); return [state, update]; diff --git a/packages/website/src/components/hooks/useFocus.ts b/packages/website/src/components/hooks/useFocus.ts index 405ad5a19ac..5849b95f2db 100644 --- a/packages/website/src/components/hooks/useFocus.ts +++ b/packages/website/src/components/hooks/useFocus.ts @@ -1,4 +1,5 @@ -import React, { useRef } from 'react'; +import type React from 'react'; +import { useRef } from 'react'; function useFocus(): [React.RefObject, () => void] { const htmlElRef = useRef(null); diff --git a/packages/website/src/components/hooks/useHashState.ts b/packages/website/src/components/hooks/useHashState.ts index dc2a8a439f7..21538642891 100644 --- a/packages/website/src/components/hooks/useHashState.ts +++ b/packages/website/src/components/hooks/useHashState.ts @@ -1,10 +1,10 @@ +import { toJsonConfig } from '@site/src/components/config/utils'; +import * as lz from 'lzstring.ts'; import { useCallback, useEffect, useState } from 'react'; -import type { ConfigModel } from '../types'; - -import * as lz from 'lzstring.ts'; +import { hasOwnProperty } from '../lib/has-own-property'; import { shallowEqual } from '../lib/shallowEqual'; -import { toJsonConfig } from '@site/src/components/config/utils'; +import type { ConfigModel } from '../types'; function writeQueryParam(value: string): string { return lz.LZString.compressToEncodedURIComponent(value); @@ -115,16 +115,69 @@ const writeStateToUrl = (newState: ConfigModel): string => { return ''; }; +const retrieveStateFromLocalStorage = (): Partial | undefined => { + try { + const configString = window.localStorage.getItem('config'); + if (!configString) { + return undefined; + } + + const config: unknown = JSON.parse(configString); + if (typeof config !== 'object' || !config) { + return undefined; + } + + const state: Partial = {}; + if (hasOwnProperty('ts', config)) { + const ts = config.ts; + if (typeof ts === 'string') { + state.ts = ts; + } + } + if (hasOwnProperty('jsx', config)) { + const jsx = config.jsx; + if (typeof jsx === 'boolean') { + state.jsx = jsx; + } + } + if (hasOwnProperty('showAST', config)) { + const showAST = config.showAST; + if (typeof showAST === 'boolean') { + state.showAST = showAST; + } else if (typeof showAST === 'string') { + state.showAST = readShowAST(showAST); + } + } + + return state; + } catch (e) { + // eslint-disable-next-line no-console + console.warn(e); + } + return undefined; +}; + +const writeStateToLocalStorage = (newState: ConfigModel): void => { + const config: Partial = { + ts: newState.ts, + jsx: newState.jsx, + showAST: newState.showAST, + }; + window.localStorage.setItem('config', JSON.stringify(config)); +}; + function useHashState( initialState: ConfigModel, ): [ConfigModel, (cfg: Partial) => void] { const [hash, setHash] = useState(window.location.hash.slice(1)); const [state, setState] = useState(() => ({ ...initialState, + ...retrieveStateFromLocalStorage(), ...parseStateFromUrl(window.location.hash.slice(1)), })); const [tmpState, setTmpState] = useState>(() => ({ ...initialState, + ...retrieveStateFromLocalStorage(), ...parseStateFromUrl(window.location.hash.slice(1)), })); @@ -142,6 +195,7 @@ function useHashState( useEffect(() => { const newState = { ...state, ...tmpState }; if (!shallowEqual(newState, state)) { + writeStateToLocalStorage(newState); const newHash = writeStateToUrl(newState); setState(newState); setHash(newHash); diff --git a/packages/website/src/components/inputs/Checkbox.tsx b/packages/website/src/components/inputs/Checkbox.tsx index ed5a473b157..0134bfa4001 100644 --- a/packages/website/src/components/inputs/Checkbox.tsx +++ b/packages/website/src/components/inputs/Checkbox.tsx @@ -1,4 +1,4 @@ -import React, { createRef, useEffect } from 'react'; +import React, { useCallback } from 'react'; export interface CheckboxProps { readonly name: string; @@ -10,17 +10,18 @@ export interface CheckboxProps { } function Checkbox(props: CheckboxProps): JSX.Element { - const checkboxRef = createRef(); + const { indeterminate } = props; - useEffect(() => { - if (!checkboxRef.current) { - return; - } + const checkboxRef = useCallback( + (node: HTMLInputElement | null) => { + if (!node) { + return; + } - if (props.indeterminate !== checkboxRef.current.indeterminate) { - checkboxRef.current.indeterminate = props.indeterminate ?? false; - } - }, [props.indeterminate]); + node.indeterminate = indeterminate ?? false; + }, + [indeterminate], + ); return ( { readonly value: T; diff --git a/packages/website/src/components/inputs/Tooltip.tsx b/packages/website/src/components/inputs/Tooltip.tsx index 5756321e071..fcef27e9dc2 100644 --- a/packages/website/src/components/inputs/Tooltip.tsx +++ b/packages/website/src/components/inputs/Tooltip.tsx @@ -1,6 +1,7 @@ +import clsx from 'clsx'; import React from 'react'; + import styles from './Tooltip.module.css'; -import clsx from 'clsx'; export interface TooltipProps { readonly children: JSX.Element | (JSX.Element | false)[]; diff --git a/packages/website/src/components/layout/Expander.tsx b/packages/website/src/components/layout/Expander.tsx index 247b972d0df..90948f956b3 100644 --- a/packages/website/src/components/layout/Expander.tsx +++ b/packages/website/src/components/layout/Expander.tsx @@ -1,9 +1,9 @@ -import React from 'react'; +import { Collapsible, useCollapsible } from '@docusaurus/theme-common'; +import ArrowIcon from '@site/src/icons/arrow.svg'; import clsx from 'clsx'; -import { useCollapsible, Collapsible } from '@docusaurus/theme-common'; -import styles from './Expander.module.css'; +import React from 'react'; -import ArrowIcon from '@site/src/icons/arrow.svg'; +import styles from './Expander.module.css'; export interface ExpanderProps { readonly children?: React.ReactNode; diff --git a/packages/website/src/components/layout/Loader.tsx b/packages/website/src/components/layout/Loader.tsx index 8781b89a76c..86d067c4213 100644 --- a/packages/website/src/components/layout/Loader.tsx +++ b/packages/website/src/components/layout/Loader.tsx @@ -1,5 +1,6 @@ -import * as React from 'react'; import clsx from 'clsx'; +import * as React from 'react'; + import styles from './Loader.module.css'; function Loader(): JSX.Element { diff --git a/packages/website/src/components/lib/has-own-property.ts b/packages/website/src/components/lib/has-own-property.ts new file mode 100644 index 00000000000..eca42ee42fc --- /dev/null +++ b/packages/website/src/components/lib/has-own-property.ts @@ -0,0 +1,9 @@ +export function hasOwnProperty< + Container extends object, + Key extends PropertyKey, +>( + property: Key, + object: Container, +): object is Container & Record { + return property in object; +} diff --git a/packages/website/src/components/linter/CompilerHost.ts b/packages/website/src/components/linter/CompilerHost.ts index ddf360a2a25..addbff4de35 100644 --- a/packages/website/src/components/linter/CompilerHost.ts +++ b/packages/website/src/components/linter/CompilerHost.ts @@ -1,5 +1,5 @@ -import type { System, SourceFile, CompilerHost } from 'typescript'; import type { LintUtils } from '@typescript-eslint/website-eslint'; +import type { CompilerHost, SourceFile, System } from 'typescript'; /** * Creates an in-memory CompilerHost -which is essentially an extra wrapper to System diff --git a/packages/website/src/components/linter/WebLinter.ts b/packages/website/src/components/linter/WebLinter.ts index eaece6e236f..378e34ed136 100644 --- a/packages/website/src/components/linter/WebLinter.ts +++ b/packages/website/src/components/linter/WebLinter.ts @@ -1,15 +1,14 @@ +import { createVirtualCompilerHost } from '@site/src/components/linter/CompilerHost'; +import { parseSettings } from '@site/src/components/linter/config'; +import type { ParserOptions } from '@typescript-eslint/types'; +import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; +import type { LintUtils } from '@typescript-eslint/website-eslint'; import type { + CompilerHost, CompilerOptions, SourceFile, - CompilerHost, System, } from 'typescript'; -import type { TSESLint, TSESTree } from '@typescript-eslint/utils'; -import type { ParserOptions } from '@typescript-eslint/types'; -import type { LintUtils } from '@typescript-eslint/website-eslint'; - -import { createVirtualCompilerHost } from '@site/src/components/linter/CompilerHost'; -import { extra } from '@site/src/components/linter/config'; const PARSER_NAME = '@typescript-eslint/parser'; @@ -107,7 +106,7 @@ export class WebLinter { const { estree: ast, astMaps } = this.lintUtils.astConverter( tsAst, - { ...extra, code, jsx: isJsx }, + { ...parseSettings, code, jsx: isJsx }, true, ); diff --git a/packages/website/src/components/linter/config.ts b/packages/website/src/components/linter/config.ts index cad38a3e28f..f077f3786ee 100644 --- a/packages/website/src/components/linter/config.ts +++ b/packages/website/src/components/linter/config.ts @@ -1,12 +1,11 @@ -import type { Extra } from '@typescript-eslint/typescript-estree/dist/parser-options'; +import type { ParseSettings } from '@typescript-eslint/typescript-estree/dist/parseSettings'; -export const extra: Extra = { +export const parseSettings: ParseSettings = { code: '', comment: true, comments: [], createDefaultProgram: false, debugLevel: new Set(), - errorOnTypeScriptSyntacticAndSemanticIssues: false, errorOnUnknownASTType: false, extraFileExtensions: [], filePath: '', @@ -17,9 +16,9 @@ export const extra: Extra = { preserveNodeMaps: true, projects: [], range: true, - strict: false, tokens: [], tsconfigRootDir: '/', + errorOnTypeScriptSyntacticAndSemanticIssues: false, EXPERIMENTAL_useSourceOfProjectReferenceRedirect: false, singleRun: false, programs: null, diff --git a/packages/website/src/components/linter/utils.ts b/packages/website/src/components/linter/utils.ts index 8f8d0f23fbd..e2a4b3ed1c7 100644 --- a/packages/website/src/components/linter/utils.ts +++ b/packages/website/src/components/linter/utils.ts @@ -1,6 +1,7 @@ +import type { TSESLint } from '@typescript-eslint/utils'; import type Monaco from 'monaco-editor'; + import type { ErrorGroup } from '../types'; -import type { TSESLint } from '@typescript-eslint/utils'; export interface LintCodeAction { message: string; diff --git a/packages/website/src/components/modals/Modal.tsx b/packages/website/src/components/modals/Modal.tsx index 6e95d4ea858..ffc8ca55fef 100644 --- a/packages/website/src/components/modals/Modal.tsx +++ b/packages/website/src/components/modals/Modal.tsx @@ -1,8 +1,10 @@ /* eslint-disable jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions */ -import React, { MouseEvent, useCallback, useEffect } from 'react'; +import CloseIcon from '@site/src/icons/close.svg'; import clsx from 'clsx'; +import type { MouseEvent } from 'react'; +import React, { useCallback, useEffect } from 'react'; + import styles from './Modal.module.css'; -import CloseIcon from '@site/src/icons/close.svg'; interface ModalProps { readonly header: string; @@ -12,10 +14,16 @@ interface ModalProps { } function Modal(props: ModalProps): JSX.Element { + const { onClose } = props; + useEffect(() => { const closeOnEscapeKeyDown = (e: KeyboardEvent): void => { - if (e.key === 'Escape' || e.keyCode === 27) { - props.onClose(); + if ( + e.key === 'Escape' || + // eslint-disable-next-line deprecation/deprecation -- intentional fallback for old browsers + e.keyCode === 27 + ) { + onClose(); } }; @@ -23,15 +31,15 @@ function Modal(props: ModalProps): JSX.Element { return (): void => { document.body.removeEventListener('keydown', closeOnEscapeKeyDown); }; - }, []); + }, [onClose]); const onClick = useCallback( (e: MouseEvent) => { if (e.currentTarget === e.target) { - props.onClose(); + onClose(); } }, - [props.onClose], + [onClose], ); return ( diff --git a/packages/website/src/css/custom.css b/packages/website/src/css/custom.css index 73d46606cb5..8979a32a8e2 100644 --- a/packages/website/src/css/custom.css +++ b/packages/website/src/css/custom.css @@ -9,18 +9,21 @@ /* You can override the default Infima variables here. */ html:root { - --ifm-color-primary: #3578e5; - --ifm-color-primary-dark: #1b62d4; - --ifm-color-primary-darker: #1751af; - --ifm-color-primary-darkest: #123f89; - --ifm-color-primary-light: #1b62d4; - --ifm-color-primary-lighter: #80aaef; - --ifm-color-primary-lightest: #a5c3f3; + --color-blurple: #2656c7; + --color-blurple-shadow: #111e80; + + --ifm-color-primary: #3535e5; + --ifm-color-primary-dark: #1b43d4; + --ifm-color-primary-darker: var(--color-blurple); + --ifm-color-primary-darkest: var(--color-blurple-shadow); + --ifm-color-primary-light: #1b3ad4; + --ifm-color-primary-lighter: #8096ef; + --ifm-color-primary-lightest: #a5c2f3; --ifm-code-font-size: 95%; --ifm-color-info: var(--ifm-color-primary-dark); --ifm-link-color: var(--ifm-color-primary-dark); - --code-line-decoration: rgba(53, 120, 229, 0.1); + --code-line-decoration: rgba(112, 53, 229, 0.1); --code-editor-bg: #ffffff; --docsearch-muted-color: #666; @@ -29,15 +32,16 @@ html:root { html[data-theme='dark']:root { --ifm-color-feedback-background: #f0f8ff; - --ifm-color-primary: #4e89e8; - --ifm-color-primary-dark: #144697; - --ifm-color-primary-darker: #0e336e; - --ifm-color-primary-darkest: #0b2652; - --ifm-color-primary-light: #699bec; - --ifm-color-primary-lighter: #77a4ed; - --ifm-color-primary-lightest: #a0c0f3; - - --ifm-code-background: rgb(40, 42, 54); + --ifm-color-primary: #3255bb; + --ifm-color-primary-dark: #1f459d; + --ifm-color-primary-darker: #1f417f; + --ifm-color-primary-darkest: #163162; + --ifm-color-primary-light: #889dfa; + --ifm-color-primary-lighter: #b1c5fd; + --ifm-color-primary-lightest: #c5d1ff; + + --ifm-button-background-color: var(--ifm-color-primary-dark); + --ifm-code-background: rgb(43, 40, 54); --ifm-code-color: rgb(248, 248, 242); --ifm-color-info: var(--ifm-color-primary-light); --ifm-link-color: var(--ifm-color-primary-light); @@ -47,6 +51,7 @@ html[data-theme='dark']:root { --code-line-decoration: rgba(255, 255, 255, 0.1); --code-editor-bg: #1e1e1e; + --ifm-tabs-color-active: var(--ifm-color-primary-light); --ifm-toc-border-color: var(--ifm-background-surface-color); --ifm-footer-background-color: var(--ifm-background-surface-color); @@ -62,6 +67,8 @@ html[data-theme='dark']:root { --docsearch-muted-color: #aaa; --docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.3); + + --gray-border-shadow: var(--ifm-color-secondary-dark); } .header-github-link:hover { diff --git a/packages/website/src/hooks/useMediaQuery.ts b/packages/website/src/hooks/useMediaQuery.ts new file mode 100644 index 00000000000..1bd928c4a4b --- /dev/null +++ b/packages/website/src/hooks/useMediaQuery.ts @@ -0,0 +1,46 @@ +// Modified from https://github.com/antonioru/beautiful-react-hooks/blob/master/src/useMediaQuery.ts + +import { useEffect, useState } from 'react'; + +/** + * Accepts a media query string then uses the + * [window.matchMedia](https://developer.mozilla.org/en-US/docs/Web/API/Window/matchMedia) API to determine if it + * matches with the current document.
+ * It also monitor the document changes to detect when it matches or stops matching the media query.
+ * Returns the validity state of the given media query. + * + */ +const useMediaQuery = (mediaQuery: string): boolean => { + const [isVerified, setIsVerified] = useState( + !!window.matchMedia(mediaQuery).matches, + ); + + useEffect(() => { + const mediaQueryList = window.matchMedia(mediaQuery); + const documentChangeHandler = (): void => + setIsVerified(!!mediaQueryList.matches); + + try { + mediaQueryList.addEventListener('change', documentChangeHandler); + } catch (e) { + // Safari isn't supporting mediaQueryList.addEventListener + // eslint-disable-next-line deprecation/deprecation + mediaQueryList.addListener(documentChangeHandler); + } + + documentChangeHandler(); + return () => { + try { + mediaQueryList.removeEventListener('change', documentChangeHandler); + } catch (e) { + // Safari isn't supporting mediaQueryList.removeEventListener + // eslint-disable-next-line deprecation/deprecation + mediaQueryList.removeListener(documentChangeHandler); + } + }; + }, [mediaQuery]); + + return isVerified; +}; + +export { useMediaQuery }; diff --git a/packages/website/src/pages/index.tsx b/packages/website/src/pages/index.tsx index 0d713efb8ac..e82e7e7495b 100644 --- a/packages/website/src/pages/index.tsx +++ b/packages/website/src/pages/index.tsx @@ -1,9 +1,11 @@ -import React from 'react'; -import clsx from 'clsx'; -import Layout from '@theme/Layout'; import Link from '@docusaurus/Link'; -import useDocusaurusContext from '@docusaurus/useDocusaurusContext'; import useBaseUrl from '@docusaurus/useBaseUrl'; +import useDocusaurusContext from '@docusaurus/useDocusaurusContext'; +import Heading from '@theme/Heading'; +import Layout from '@theme/Layout'; +import clsx from 'clsx'; +import React from 'react'; + import { FinancialContributors } from '../components/FinancialContributors'; import styles from './styles.module.css'; @@ -107,10 +109,20 @@ const features: FeatureItem[] = [ function Feature({ title, description }: FeatureItem): JSX.Element { return (
-

{title}

+
+ + {title} + +
{description}
- + Get Started
@@ -124,10 +136,14 @@ function Home(): JSX.Element {
+

{siteConfig.title}

{siteConfig.tagline}

- + Get Started
-

Financial Contributors

+ + Financial Contributors +
diff --git a/packages/website/src/pages/play.tsx b/packages/website/src/pages/play.tsx index 7d6a3ef62df..9983ed770e5 100644 --- a/packages/website/src/pages/play.tsx +++ b/packages/website/src/pages/play.tsx @@ -1,14 +1,18 @@ -import React, { lazy, Suspense } from 'react'; -import Layout from '@theme/Layout'; import BrowserOnly from '@docusaurus/BrowserOnly'; import Loader from '@site/src/components/layout/Loader'; +import Layout from '@theme/Layout'; +import React, { lazy, Suspense } from 'react'; function Play(): JSX.Element { return ( }> {(): JSX.Element => { - const Playground = lazy(() => import('../components/Playground')); + const Playground = lazy( + () => + // @ts-expect-error: This does not follow Node resolution + import('../components/Playground') as Promise<() => JSX.Element>, + ); return ( }> diff --git a/packages/website/src/pages/styles.module.css b/packages/website/src/pages/styles.module.css index 4553800e8ad..eec92f56346 100644 --- a/packages/website/src/pages/styles.module.css +++ b/packages/website/src/pages/styles.module.css @@ -6,17 +6,22 @@ */ .hero { - background-color: var(--ifm-color-primary-darkest); + background-color: var(--color-blurple-shadow); background-image: linear-gradient( 135deg, - var(--ifm-color-primary-darker) 0%, - var(--ifm-color-primary-darkest) 100% + var(--color-blurple) 0%, + var(--color-blurple-shadow) 100% ); --ifm-font-color-base: var(--ifm-color-white); --ifm-button-color: var(--ifm-color-white); text-align: center; } +.hero__logo { + height: 10rem; + width: 10rem; +} + .hero__subtitle { margin-bottom: 24px; } @@ -30,9 +35,27 @@ } .buttons a { + --ifm-font-color-base: var(--ifm-color-white); + --ifm-button-color: var(--ifm-color-white); margin: 1rem 1rem; } +.buttonCentered { + margin: auto; +} + +.buttonPrimary { + border: var(--ifm-button-border-width) solid var(--ifm-button-color); +} + +.buttonPrimary:hover { + box-shadow: 0 2px 8px var(--ifm-button-color); +} + +[data-theme='dark'] .buttonPrimary { + border: var(--ifm-button-border-width) solid var(--ifm-button-color); +} + .lightBackground { background: var(--ifm-color-emphasis-100); } diff --git a/packages/website/src/theme/CodeBlock/Content/String.tsx b/packages/website/src/theme/CodeBlock/Content/String.tsx index f26a6ec5b9c..9ea2df703b2 100644 --- a/packages/website/src/theme/CodeBlock/Content/String.tsx +++ b/packages/website/src/theme/CodeBlock/Content/String.tsx @@ -1,22 +1,21 @@ // Change: added `copiedCode` which filters out the removed lines -import React from 'react'; -import clsx from 'clsx'; +import { usePrismTheme, useThemeConfig } from '@docusaurus/theme-common'; import { - useThemeConfig, + containsLineNumbers, parseCodeBlockTitle, parseLanguage, parseLines, - containsLineNumbers, - usePrismTheme, useCodeWordWrap, -} from '@docusaurus/theme-common'; -import Highlight, { defaultProps, type Language } from 'prism-react-renderer'; -import Line from '@theme/CodeBlock/Line'; -import CopyButton from '@theme/CodeBlock/CopyButton'; -import WordWrapButton from '@theme/CodeBlock/WordWrapButton'; +} from '@docusaurus/theme-common/internal'; import Container from '@theme/CodeBlock/Container'; import type { Props } from '@theme/CodeBlock/Content/String'; +import CopyButton from '@theme/CodeBlock/CopyButton'; +import Line from '@theme/CodeBlock/Line'; +import WordWrapButton from '@theme/CodeBlock/WordWrapButton'; +import clsx from 'clsx'; +import Highlight, { type Language, defaultProps } from 'prism-react-renderer'; +import React from 'react'; import styles from './styles.module.css'; diff --git a/packages/website/src/theme/MDXComponents/Feature.module.css b/packages/website/src/theme/MDXComponents/Feature.module.css new file mode 100644 index 00000000000..aeef8f51e0a --- /dev/null +++ b/packages/website/src/theme/MDXComponents/Feature.module.css @@ -0,0 +1,22 @@ +.feature { + background-color: var(--token-background); + border-radius: var(--ifm-code-border-radius); + box-shadow: var(--ifm-global-shadow-lw); + color: var(--token-color) !important; + display: flex; + flex-basis: 30%; + flex-grow: 1; + flex-shrink: 3; + font-size: 0.8rem; + margin: 0 0 1rem; + min-width: 15rem; + padding: 0.75rem 1rem; +} + +.emoji { + margin-right: 0.5rem; +} + +.children { + margin: 0; +} diff --git a/packages/website/src/theme/MDXComponents/Feature.tsx b/packages/website/src/theme/MDXComponents/Feature.tsx new file mode 100644 index 00000000000..64aac69a68e --- /dev/null +++ b/packages/website/src/theme/MDXComponents/Feature.tsx @@ -0,0 +1,17 @@ +import React from 'react'; + +import styles from './Feature.module.css'; + +export interface FeatureProps { + children: React.ReactNode; + emoji: string; +} + +export function Feature({ children, emoji }: FeatureProps): JSX.Element { + return ( +
+
{emoji}
+

{children}

+
+ ); +} diff --git a/packages/website/src/theme/MDXComponents/RuleAttributes.module.css b/packages/website/src/theme/MDXComponents/RuleAttributes.module.css index 97c07287bab..bd8bc627c3b 100644 --- a/packages/website/src/theme/MDXComponents/RuleAttributes.module.css +++ b/packages/website/src/theme/MDXComponents/RuleAttributes.module.css @@ -1,7 +1,9 @@ -.taskList { - list-style: none; +.features { + display: flex; + gap: 0 1rem; + flex-wrap: wrap; } -:not(.taskList > li) > .taskList { - padding-left: 0; +.features + h2 { + margin-top: 1rem; } diff --git a/packages/website/src/theme/MDXComponents/RuleAttributes.tsx b/packages/website/src/theme/MDXComponents/RuleAttributes.tsx index 74726a63fc3..075d0a6af8e 100644 --- a/packages/website/src/theme/MDXComponents/RuleAttributes.tsx +++ b/packages/website/src/theme/MDXComponents/RuleAttributes.tsx @@ -1,73 +1,109 @@ -import React from 'react'; -import type { TSESLint } from '@typescript-eslint/utils'; +import type { RuleMetaDataDocs } from '@site/../utils/dist/ts-eslint/Rule'; import { useRulesMeta } from '@site/src/hooks/useRulesMeta'; +import React from 'react'; +import type { FeatureProps } from './Feature'; +import { Feature } from './Feature'; import styles from './RuleAttributes.module.css'; -export function RuleAttributes({ name }: { name: string }): JSX.Element | null { +const getRecommendation = (docs: RuleMetaDataDocs): [string, string] => { + return docs.recommended === 'strict' + ? ['🔒', 'strict'] + : docs.requiresTypeChecking + ? ['🧠', 'recommended-requiring-type-checking'] + : ['✅', 'recommended']; +}; + +export function RuleAttributes({ name }: { name: string }): React.ReactNode { const rules = useRulesMeta(); const rule = rules.find(rule => rule.name === name); - if (!rule) { + if (!rule?.docs) { return null; } + + const features: FeatureProps[] = []; + + if (rule.docs.recommended) { + const [emoji, recommendation] = getRecommendation(rule.docs); + features.push({ + children: ( + <> + Extending{' '} + + + "plugin:@typescript-eslint/{recommendation}" + + {' '} + in an{' '} + + ESLint configuration + {' '} + enables this rule. + + ), + emoji, + }); + } + + if (rule.fixable) { + features.push({ + children: ( + <> + Some problems reported by this rule are automatically fixable by the{' '} + + --fix ESLint command line option + + . + + ), + emoji: '🔧', + }); + } + + if (rule.hasSuggestions) { + features.push({ + children: ( + <> + Some problems reported by this rule are manually fixable by editor{' '} + + suggestions + + . + + ), + emoji: '💡', + }); + } + + if (rule.docs.requiresTypeChecking) { + features.push({ + children: ( + <> + This rule requires{' '} + + type information + {' '} + to run. + + ), + emoji: '💭', + }); + } + return ( - <> -

Attributes

-
    -
  • - - Included in configs -
      -
    • - - ✅ Recommended -
    • -
    • - - 🔒 Strict -
    • -
    -
  • -
  • - - Fixable -
      -
    • - - 🔧 Automated Fixer -
    • -
    • - - 🛠 Suggestion Fixer -
    • -
    -
  • -
  • - - 💭 Requires type information -
  • -
- +
+ {features.map(feature => ( + + ))} +
); } diff --git a/packages/website/src/theme/MDXComponents/index.tsx b/packages/website/src/theme/MDXComponents/index.tsx index 2ef24ef1c72..70fa555536b 100644 --- a/packages/website/src/theme/MDXComponents/index.tsx +++ b/packages/website/src/theme/MDXComponents/index.tsx @@ -1,4 +1,5 @@ import MDXComponents from '@theme-original/MDXComponents'; + import { RuleAttributes } from './RuleAttributes'; // eslint-disable-next-line import/no-default-export diff --git a/packages/website/static/img/favicon.ico b/packages/website/static/img/favicon.ico index 96667461e99..528a066360e 100644 Binary files a/packages/website/static/img/favicon.ico and b/packages/website/static/img/favicon.ico differ diff --git a/packages/website/static/img/favicon/android-chrome-192x192.png b/packages/website/static/img/favicon/android-chrome-192x192.png index a4bb6b78638..75bd264e6a6 100644 Binary files a/packages/website/static/img/favicon/android-chrome-192x192.png and b/packages/website/static/img/favicon/android-chrome-192x192.png differ diff --git a/packages/website/static/img/favicon/android-chrome-512x512.png b/packages/website/static/img/favicon/android-chrome-512x512.png new file mode 100644 index 00000000000..4e42dbefc7d Binary files /dev/null and b/packages/website/static/img/favicon/android-chrome-512x512.png differ diff --git a/packages/website/static/img/favicon/apple-touch-icon.png b/packages/website/static/img/favicon/apple-touch-icon.png index 0f5470bfdf9..332e607643d 100644 Binary files a/packages/website/static/img/favicon/apple-touch-icon.png and b/packages/website/static/img/favicon/apple-touch-icon.png differ diff --git a/packages/website/static/img/favicon/favicon-16x16.png b/packages/website/static/img/favicon/favicon-16x16.png index c0edc07eb36..d2d807d3fb5 100644 Binary files a/packages/website/static/img/favicon/favicon-16x16.png and b/packages/website/static/img/favicon/favicon-16x16.png differ diff --git a/packages/website/static/img/favicon/favicon-32x32.png b/packages/website/static/img/favicon/favicon-32x32.png index f5291135a81..27519606a96 100644 Binary files a/packages/website/static/img/favicon/favicon-32x32.png and b/packages/website/static/img/favicon/favicon-32x32.png differ diff --git a/packages/website/static/img/favicon/mstile-150x150.png b/packages/website/static/img/favicon/mstile-150x150.png index 3cc8878a6c5..230f6529948 100644 Binary files a/packages/website/static/img/favicon/mstile-150x150.png and b/packages/website/static/img/favicon/mstile-150x150.png differ diff --git a/packages/website/static/img/favicon/mstile-310x310.png b/packages/website/static/img/favicon/mstile-310x310.png index d27d66fffc5..9f9f3bb9f43 100644 Binary files a/packages/website/static/img/favicon/mstile-310x310.png and b/packages/website/static/img/favicon/mstile-310x310.png differ diff --git a/packages/website/static/img/favicon/safari-pinned-tab.svg b/packages/website/static/img/favicon/safari-pinned-tab.svg new file mode 100644 index 00000000000..0d301134d71 --- /dev/null +++ b/packages/website/static/img/favicon/safari-pinned-tab.svg @@ -0,0 +1,28 @@ + + + + +Created by potrace 1.14, written by Peter Selinger 2001-2017 + + + + + + + diff --git a/packages/website/static/img/favicon/site.webmanifest b/packages/website/static/img/favicon/site.webmanifest index ba9eb3dcb7b..938ae458ef3 100644 --- a/packages/website/static/img/favicon/site.webmanifest +++ b/packages/website/static/img/favicon/site.webmanifest @@ -1,14 +1,19 @@ { - "name": "TypeScript ESLint", - "short_name": "TypeScript ESLint", + "background_color": "#443fd4", + "display": "standalone", "icons": [ { "src": "/android-chrome-192x192.png", "sizes": "192x192", "type": "image/png" + }, + { + "src": "/android-chrome-512x512.png", + "sizes": "512x512", + "type": "image/png" } ], - "theme_color": "#443fd4", - "background_color": "#443fd4", - "display": "standalone" + "name": "typescript-eslint", + "short_name": "typescript-eslint", + "theme_color": "#443fd4" } diff --git a/packages/website/static/img/logo-twitter-card.png b/packages/website/static/img/logo-twitter-card.png index b63a3826299..7e276da9a38 100644 Binary files a/packages/website/static/img/logo-twitter-card.png and b/packages/website/static/img/logo-twitter-card.png differ diff --git a/packages/website/static/img/logo.png b/packages/website/static/img/logo.png index 25cfdacea6e..0d7ce9aee1a 100644 Binary files a/packages/website/static/img/logo.png and b/packages/website/static/img/logo.png differ diff --git a/packages/website/static/img/logo.svg b/packages/website/static/img/logo.svg index 557d2dbcac0..bfe61aecb7c 100644 --- a/packages/website/static/img/logo.svg +++ b/packages/website/static/img/logo.svg @@ -1,5 +1,22 @@ - - - - + + + + + + diff --git a/packages/website/static/img/logo_maskable.png b/packages/website/static/img/logo_maskable.png new file mode 100644 index 00000000000..837410e605c Binary files /dev/null and b/packages/website/static/img/logo_maskable.png differ diff --git a/packages/website/static/img/typescript.svg b/packages/website/static/img/typescript.svg index 557d2dbcac0..c6f06b4ead4 100644 --- a/packages/website/static/img/typescript.svg +++ b/packages/website/static/img/typescript.svg @@ -1,5 +1,5 @@ - + diff --git a/packages/website/static/manifest.json b/packages/website/static/manifest.json new file mode 100644 index 00000000000..3eccbd4b236 --- /dev/null +++ b/packages/website/static/manifest.json @@ -0,0 +1,24 @@ +{ + "background_color": "#443FD4", + "description": "Documentation for typescript-eslint: the tooling that enables ESLint to support TypeScript.", + "display": "standalone", + "icons": [ + { + "sizes": "300x300", + "src": "/img/logo_maskable.png", + "type": "image/png", + "purpose": "maskable" + }, + { + "sizes": "any", + "src": "/img/logo.svg", + "type": "image/svg+xml" + } + ], + "id": "/?source=pwa", + "name": "typescript-eslint", + "scope": "/", + "short_name": "typescript-eslint", + "start_url": "/?source=pwa", + "theme_color": "#443FD4" +} diff --git a/packages/website/tests/index.spec.ts b/packages/website/tests/index.spec.ts new file mode 100644 index 00000000000..e0a99f3d12c --- /dev/null +++ b/packages/website/tests/index.spec.ts @@ -0,0 +1,22 @@ +import AxeBuilder from '@axe-core/playwright'; +import { expect, test } from '@playwright/test'; + +test.describe('Website', () => { + test('Axe', async ({ page }) => { + await page.goto('/'); + await new AxeBuilder({ page }).analyze(); + }); + + test('should have no errors', async ({ page }) => { + const errorMessages: string[] = []; + page.on('console', msg => { + if (['error', 'warning'].includes(msg.type())) { + errorMessages.push(`[${msg.type()}] ${msg.text()}`); + } + }); + await page.goto('/'); + expect(errorMessages).toStrictEqual([ + "[error] Warning: ReactDOM.render is no longer supported in React 18. Use createRoot instead. Until you switch to the new API, your app will behave as if it's running React 17. Learn more: https://reactjs.org/link/switch-to-createroot", + ]); + }); +}); diff --git a/packages/website/tests/playground.spec.ts b/packages/website/tests/playground.spec.ts new file mode 100644 index 00000000000..e7aa1d2e057 --- /dev/null +++ b/packages/website/tests/playground.spec.ts @@ -0,0 +1,65 @@ +import AxeBuilder from '@axe-core/playwright'; +import type { Page } from '@playwright/test'; +import { expect, test } from '@playwright/test'; + +test.describe('Playground', () => { + test.beforeEach(async ({ page }) => { + await page.goto('/play'); + }); + + test('Accessibility', async ({ page }) => { + await new AxeBuilder({ page }).analyze(); + }); + + test('Usage', async ({ page }) => { + // 1. Type some valid code in the playground + await writeInEditor(page, 'let value: string[];'); + + // 2. Enable a lint rule + await page.getByRole('tab', { name: 'eslintrc' }).click(); + await page.getByRole('button', { name: 'Visual Editor' }).click(); + await page + .getByLabel( + '@typescript-eslint/array-type Require consistently using either `T[]` or `Array` for arrays', + ) + .check(); + await page.getByRole('button', { name: 'Close' }).click(); + + // 3. Make sure it still says "All is ok!" + await expect(page.getByText('All is ok!')).toBeVisible(); + + // 4. Change the code to violate the lint rule + await page.getByRole('tab', { name: 'code' }).click(); + await writeInEditor(page, 'let value: Array;'); + + // 5. Make sure it now says the complaint + await expect( + page.getByText( + `Array type using 'Array' is forbidden. Use 'string[]' instead. 1:12 - 1:25`, + ), + ).toBeVisible(); + + // 6. Press the 'fix' button to autofix that complaint + await page.getByRole('button', { name: 'fix' }).click(); + + // 7. Make sure the code is updated, and it says "All is ok!" + await expect(page.getByText('let value: string[];')).toBeVisible(); + await expect(page.getByText('All is ok!')).toBeVisible(); + }); +}); + +async function writeInEditor(page: Page, text: string): Promise { + const monacoEditor = page.locator('.monaco-editor').nth(0); + await monacoEditor.click(); + + // Select all existing text and delete it first... + await page.keyboard.down('Control'); + await page.keyboard.down('A'); + await page.keyboard.up('Control'); + await page.keyboard.up('A'); + await page.keyboard.down('Delete'); + await page.keyboard.up('Delete'); + + // ...and then type in the text + await page.keyboard.type(text); +} diff --git a/packages/website/tsconfig.json b/packages/website/tsconfig.json index 13f1948404e..82eff535cb8 100644 --- a/packages/website/tsconfig.json +++ b/packages/website/tsconfig.json @@ -1,8 +1,8 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { - "module": "commonjs", - "moduleResolution": "node", + "module": "CommonJS", + "moduleResolution": "NodeNext", "allowJs": true, "esModuleInterop": true, "jsx": "react", @@ -16,11 +16,5 @@ }, "types": ["@docusaurus/module-type-aliases", "@docusaurus/theme-classic"] }, - "include": [ - "src/", - "plugins/", - "typings", - "./docusaurusConfig.ts", - "./rulesMeta.ts" - ] + "include": ["src", "tests", "plugins", "typings", "./*.ts"] } diff --git a/patches/react-split-pane+0.1.92.patch b/patches/react-split-pane+0.1.92.patch new file mode 100644 index 00000000000..b00ff2919e7 --- /dev/null +++ b/patches/react-split-pane+0.1.92.patch @@ -0,0 +1,12 @@ +diff --git a/node_modules/react-split-pane/index.d.ts b/node_modules/react-split-pane/index.d.ts +index d116f54..9329094 100644 +--- a/node_modules/react-split-pane/index.d.ts ++++ b/node_modules/react-split-pane/index.d.ts +@@ -25,6 +25,7 @@ export type SplitPaneProps = { + pane2Style?: React.CSSProperties; + resizerClassName?: string; + step?: number; ++ children?: React.ReactNode; + }; + + export type SplitPaneState = { diff --git a/patches/tsutils+3.21.0.patch b/patches/tsutils+3.21.0.patch new file mode 100644 index 00000000000..0b2e3ee1036 --- /dev/null +++ b/patches/tsutils+3.21.0.patch @@ -0,0 +1,13 @@ +diff --git a/node_modules/tsutils/util/util.d.ts b/node_modules/tsutils/util/util.d.ts +index 97cedda..4a63900 100644 +--- a/node_modules/tsutils/util/util.d.ts ++++ b/node_modules/tsutils/util/util.d.ts +@@ -9,7 +9,7 @@ export declare function isJsDocKind(kind: ts.SyntaxKind): boolean; + export declare function isKeywordKind(kind: ts.SyntaxKind): boolean; + export declare function isThisParameter(parameter: ts.ParameterDeclaration): boolean; + export declare function getModifier(node: ts.Node, kind: ts.Modifier['kind']): ts.Modifier | undefined; +-export declare function hasModifier(modifiers: ts.ModifiersArray | undefined, ...kinds: Array): boolean; ++export declare function hasModifier(modifiers: Iterable | undefined, ...kinds: Array): boolean; + export declare function isParameterProperty(node: ts.ParameterDeclaration): boolean; + export declare function hasAccessModifier(node: ts.ClassElement | ts.ParameterDeclaration): boolean; + export declare const isNodeFlagSet: (node: ts.Node, flag: ts.NodeFlags) => boolean; diff --git a/patches/typescript+4.9.3.patch b/patches/typescript+4.9.3.patch new file mode 100644 index 00000000000..520a9fde936 --- /dev/null +++ b/patches/typescript+4.9.3.patch @@ -0,0 +1,51 @@ +diff --git a/node_modules/typescript/lib/typescript.d.ts b/node_modules/typescript/lib/typescript.d.ts +index 54e4c65..aa00912 100644 +--- a/node_modules/typescript/lib/typescript.d.ts ++++ b/node_modules/typescript/lib/typescript.d.ts +@@ -428,8 +428,8 @@ declare namespace ts { + JSDocFunctionType = 320, + JSDocVariadicType = 321, + JSDocNamepathType = 322, ++ /** @deprecated This was only added in 4.7 */ + JSDoc = 323, +- /** @deprecated Use SyntaxKind.JSDoc */ + JSDocComment = 323, + JSDocText = 324, + JSDocTypeLiteral = 325, +@@ -4395,7 +4395,13 @@ declare namespace ts { + function symbolName(symbol: Symbol): string; + function getNameOfJSDocTypedef(declaration: JSDocTypedefTag): Identifier | PrivateIdentifier | undefined; + function getNameOfDeclaration(declaration: Declaration | Expression | undefined): DeclarationName | undefined; ++ /** ++ * @deprecated don't use this directly as it does not exist pre-4.8; instead use getModifiers from `@typescript-eslint/type-utils`. ++ */ + function getDecorators(node: HasDecorators): readonly Decorator[] | undefined; ++ /** ++ * @deprecated don't use this directly as it does not exist pre-4.8; instead use getDecorators from `@typescript-eslint/type-utils`. ++ */ + function getModifiers(node: HasModifiers): readonly Modifier[] | undefined; + /** + * Gets the JSDoc parameter tags for the node if present. +@@ -4857,7 +4863,13 @@ declare namespace ts { + } + declare namespace ts { + function setTextRange(range: T, location: TextRange | undefined): T; ++ /** ++ * @deprecated don't use this directly as it does not exist pre-4.8; instead use getModifiers from `@typescript-eslint/type-utils`. ++ */ + function canHaveModifiers(node: Node): node is HasModifiers; ++ /** ++ * @deprecated don't use this directly as it does not exist pre-4.8; instead use getDecorators from `@typescript-eslint/type-utils`. ++ */ + function canHaveDecorators(node: Node): node is HasDecorators; + } + declare namespace ts { +@@ -7958,7 +7970,7 @@ declare namespace ts { + * const decorators = ts.canHaveDecorators(node) ? ts.getDecorators(node) : undefined; + * ``` + */ +- readonly decorators?: undefined; ++ readonly decorators?: NodeArray | undefined; + /** + * @deprecated `modifiers` has been removed from `Node` and moved to the `Node` subtypes that support them. + * Use `ts.canHaveModifiers()` to test whether a `Node` can have modifiers. diff --git a/tests/integration/fixtures/vue-sfc/Hello.vue b/tests/integration/fixtures/vue-sfc/Hello.vue index 1ee0282919b..7855ce53597 100644 --- a/tests/integration/fixtures/vue-sfc/Hello.vue +++ b/tests/integration/fixtures/vue-sfc/Hello.vue @@ -3,7 +3,7 @@
- Hello {{ (name as any) }}{{ exclamationMarks }} + Hello {{ name as any }}{{ exclamationMarks }}
diff --git a/tests/integration/tests/__snapshots__/eslint-v6.test.ts.snap b/tests/integration/tests/__snapshots__/eslint-v6.test.ts.snap index 944108b5b19..4bb27abfcc9 100644 --- a/tests/integration/tests/__snapshots__/eslint-v6.test.ts.snap +++ b/tests/integration/tests/__snapshots__/eslint-v6.test.ts.snap @@ -1,14 +1,14 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`eslint-v6 should lint successfully 1`] = ` -Array [ - Object { +[ + { "errorCount": 1, "filePath": "/index.ts", "fixableErrorCount": 0, "fixableWarningCount": 0, - "messages": Array [ - Object { + "messages": [ + { "column": 15, "endColumn": 18, "endLine": 1, diff --git a/tests/integration/tests/__snapshots__/markdown.test.ts.snap b/tests/integration/tests/__snapshots__/markdown.test.ts.snap index 71b087d0b6d..3d27b64f09b 100644 --- a/tests/integration/tests/__snapshots__/markdown.test.ts.snap +++ b/tests/integration/tests/__snapshots__/markdown.test.ts.snap @@ -1,15 +1,15 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`markdown should lint successfully 1`] = ` -Array [ - Object { +[ + { "errorCount": 10, "fatalErrorCount": 0, "filePath": "/Doc.md", "fixableErrorCount": 0, "fixableWarningCount": 0, - "messages": Array [ - Object { + "messages": [ + { "column": 3, "endColumn": 14, "endLine": 9, @@ -20,7 +20,7 @@ Array [ "ruleId": "no-console", "severity": 2, }, - Object { + { "column": 20, "endColumn": 23, "endLine": 28, @@ -30,11 +30,11 @@ Array [ "nodeType": "TSAnyKeyword", "ruleId": "@typescript-eslint/no-explicit-any", "severity": 2, - "suggestions": Array [ - Object { + "suggestions": [ + { "desc": "Use \`unknown\` instead, this will force you to explicitly, and safely assert the type is correct.", - "fix": Object { - "range": Array [ + "fix": { + "range": [ 51, 54, ], @@ -42,10 +42,10 @@ Array [ }, "messageId": "suggestUnknown", }, - Object { + { "desc": "Use \`never\` instead, this is useful when instantiating generic type parameters that you don't need to know the type of.", - "fix": Object { - "range": Array [ + "fix": { + "range": [ 51, 54, ], @@ -55,7 +55,7 @@ Array [ }, ], }, - Object { + { "column": 3, "endColumn": 14, "endLine": 29, @@ -66,7 +66,7 @@ Array [ "ruleId": "no-console", "severity": 2, }, - Object { + { "column": 3, "endColumn": 14, "endLine": 46, @@ -77,7 +77,7 @@ Array [ "ruleId": "no-console", "severity": 2, }, - Object { + { "column": 17, "endColumn": 20, "endLine": 54, @@ -87,11 +87,11 @@ Array [ "nodeType": "TSAnyKeyword", "ruleId": "@typescript-eslint/no-explicit-any", "severity": 2, - "suggestions": Array [ - Object { + "suggestions": [ + { "desc": "Use \`unknown\` instead, this will force you to explicitly, and safely assert the type is correct.", - "fix": Object { - "range": Array [ + "fix": { + "range": [ 16, 19, ], @@ -99,10 +99,10 @@ Array [ }, "messageId": "suggestUnknown", }, - Object { + { "desc": "Use \`never\` instead, this is useful when instantiating generic type parameters that you don't need to know the type of.", - "fix": Object { - "range": Array [ + "fix": { + "range": [ 16, 19, ], @@ -112,7 +112,7 @@ Array [ }, ], }, - Object { + { "column": 3, "endColumn": 14, "endLine": 55, @@ -123,7 +123,7 @@ Array [ "ruleId": "no-console", "severity": 2, }, - Object { + { "column": 17, "endColumn": 20, "endLine": 63, @@ -133,11 +133,11 @@ Array [ "nodeType": "TSAnyKeyword", "ruleId": "@typescript-eslint/no-explicit-any", "severity": 2, - "suggestions": Array [ - Object { + "suggestions": [ + { "desc": "Use \`unknown\` instead, this will force you to explicitly, and safely assert the type is correct.", - "fix": Object { - "range": Array [ + "fix": { + "range": [ 16, 19, ], @@ -145,10 +145,10 @@ Array [ }, "messageId": "suggestUnknown", }, - Object { + { "desc": "Use \`never\` instead, this is useful when instantiating generic type parameters that you don't need to know the type of.", - "fix": Object { - "range": Array [ + "fix": { + "range": [ 16, 19, ], @@ -158,7 +158,7 @@ Array [ }, ], }, - Object { + { "column": 3, "endColumn": 14, "endLine": 64, @@ -169,7 +169,7 @@ Array [ "ruleId": "no-console", "severity": 2, }, - Object { + { "column": 17, "endColumn": 20, "endLine": 72, @@ -179,11 +179,11 @@ Array [ "nodeType": "TSAnyKeyword", "ruleId": "@typescript-eslint/no-explicit-any", "severity": 2, - "suggestions": Array [ - Object { + "suggestions": [ + { "desc": "Use \`unknown\` instead, this will force you to explicitly, and safely assert the type is correct.", - "fix": Object { - "range": Array [ + "fix": { + "range": [ 16, 19, ], @@ -191,10 +191,10 @@ Array [ }, "messageId": "suggestUnknown", }, - Object { + { "desc": "Use \`never\` instead, this is useful when instantiating generic type parameters that you don't need to know the type of.", - "fix": Object { - "range": Array [ + "fix": { + "range": [ 16, 19, ], @@ -204,7 +204,7 @@ Array [ }, ], }, - Object { + { "column": 3, "endColumn": 14, "endLine": 73, @@ -227,11 +227,11 @@ function MyComp() { console.log('test'); return (
- + - - - + + +
); } @@ -247,11 +247,11 @@ function MyComp(): any { console.log('test'); return (
- + - - - + + +
); } @@ -292,8 +292,8 @@ function foo(): any { } \`\`\` ", - "suppressedMessages": Array [], - "usedDeprecatedRules": Array [], + "suppressedMessages": [], + "usedDeprecatedRules": [], "warningCount": 0, }, ] diff --git a/tests/integration/tests/__snapshots__/recommended-does-not-require-program.test.ts.snap b/tests/integration/tests/__snapshots__/recommended-does-not-require-program.test.ts.snap index 82306d001b3..40e5fd8d3da 100644 --- a/tests/integration/tests/__snapshots__/recommended-does-not-require-program.test.ts.snap +++ b/tests/integration/tests/__snapshots__/recommended-does-not-require-program.test.ts.snap @@ -1,15 +1,15 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`recommended-does-not-require-program should lint successfully 1`] = ` -Array [ - Object { +[ + { "errorCount": 0, "fatalErrorCount": 0, "filePath": "/index.ts", "fixableErrorCount": 0, "fixableWarningCount": 0, - "messages": Array [ - Object { + "messages": [ + { "column": 7, "endColumn": 15, "endLine": 1, @@ -20,7 +20,7 @@ Array [ "ruleId": "@typescript-eslint/no-unused-vars", "severity": 1, }, - Object { + { "column": 12, "endColumn": 15, "endLine": 1, @@ -30,11 +30,11 @@ Array [ "nodeType": "TSAnyKeyword", "ruleId": "@typescript-eslint/no-explicit-any", "severity": 1, - "suggestions": Array [ - Object { + "suggestions": [ + { "desc": "Use \`unknown\` instead, this will force you to explicitly, and safely assert the type is correct.", - "fix": Object { - "range": Array [ + "fix": { + "range": [ 11, 14, ], @@ -42,10 +42,10 @@ Array [ }, "messageId": "suggestUnknown", }, - Object { + { "desc": "Use \`never\` instead, this is useful when instantiating generic type parameters that you don't need to know the type of.", - "fix": Object { - "range": Array [ + "fix": { + "range": [ 11, 14, ], @@ -58,8 +58,8 @@ Array [ ], "output": "const foo: any = true; ", - "suppressedMessages": Array [], - "usedDeprecatedRules": Array [], + "suppressedMessages": [], + "usedDeprecatedRules": [], "warningCount": 2, }, ] diff --git a/tests/integration/tests/__snapshots__/typescript-and-tslint-plugins-together.test.ts.snap b/tests/integration/tests/__snapshots__/typescript-and-tslint-plugins-together.test.ts.snap index 482d041b4ac..c0d12dd74d1 100644 --- a/tests/integration/tests/__snapshots__/typescript-and-tslint-plugins-together.test.ts.snap +++ b/tests/integration/tests/__snapshots__/typescript-and-tslint-plugins-together.test.ts.snap @@ -1,15 +1,15 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`typescript-and-tslint-plugins-together should lint successfully 1`] = ` -Array [ - Object { +[ + { "errorCount": 1, "fatalErrorCount": 1, "filePath": "/index.ts", "fixableErrorCount": 0, "fixableWarningCount": 0, - "messages": Array [ - Object { + "messages": [ + { "fatal": true, "message": "Parsing error: Cannot read file '/usr/linked/tsconfig.json'.", "ruleId": null, @@ -19,8 +19,8 @@ Array [ "source": "// prettier-ignore const noSemi = true ", - "suppressedMessages": Array [], - "usedDeprecatedRules": Array [], + "suppressedMessages": [], + "usedDeprecatedRules": [], "warningCount": 0, }, ] diff --git a/tests/integration/tests/__snapshots__/vue-jsx.test.ts.snap b/tests/integration/tests/__snapshots__/vue-jsx.test.ts.snap index f969fdfc9fb..7cd8ff12fa3 100644 --- a/tests/integration/tests/__snapshots__/vue-jsx.test.ts.snap +++ b/tests/integration/tests/__snapshots__/vue-jsx.test.ts.snap @@ -1,15 +1,15 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`vue-jsx should lint successfully 1`] = ` -Array [ - Object { +[ + { "errorCount": 1, "fatalErrorCount": 0, "filePath": "/Jsx.vue", "fixableErrorCount": 0, "fixableWarningCount": 0, - "messages": Array [ - Object { + "messages": [ + { "column": 17, "endColumn": 20, "endLine": 17, @@ -19,11 +19,11 @@ Array [ "nodeType": "TSAnyKeyword", "ruleId": "@typescript-eslint/no-explicit-any", "severity": 2, - "suggestions": Array [ - Object { + "suggestions": [ + { "desc": "Use \`unknown\` instead, this will force you to explicitly, and safely assert the type is correct.", - "fix": Object { - "range": Array [ + "fix": { + "range": [ 394, 397, ], @@ -31,10 +31,10 @@ Array [ }, "messageId": "suggestUnknown", }, - Object { + { "desc": "Use \`never\` instead, this is useful when instantiating generic type parameters that you don't need to know the type of.", - "fix": Object { - "range": Array [ + "fix": { + "range": [ 394, 397, ], @@ -45,7 +45,7 @@ Array [ ], }, ], - "source": " ", - "suppressedMessages": Array [], - "usedDeprecatedRules": Array [], + "suppressedMessages": [], + "usedDeprecatedRules": [], "warningCount": 0, }, ] diff --git a/tests/integration/tests/__snapshots__/vue-sfc.test.ts.snap b/tests/integration/tests/__snapshots__/vue-sfc.test.ts.snap index c019630df43..107788a6336 100644 --- a/tests/integration/tests/__snapshots__/vue-sfc.test.ts.snap +++ b/tests/integration/tests/__snapshots__/vue-sfc.test.ts.snap @@ -1,15 +1,15 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`vue-sfc should lint successfully 1`] = ` -Array [ - Object { +[ + { "errorCount": 1, "fatalErrorCount": 1, "filePath": "/Hello.vue", "fixableErrorCount": 0, "fixableWarningCount": 0, - "messages": Array [ - Object { + "messages": [ + { "fatal": true, "message": "Parsing error: Cannot read file '/usr/linked/tsconfig.json'.", "ruleId": null, @@ -21,14 +21,14 @@ Array [
- Hello {{ (name as any) }}{{ exclamationMarks }} + Hello {{ name as any }}{{ exclamationMarks }}
- - + +
- ", - "suppressedMessages": Array [], - "usedDeprecatedRules": Array [], + "suppressedMessages": [], + "usedDeprecatedRules": [], "warningCount": 0, }, - Object { + { "errorCount": 1, "fatalErrorCount": 1, "filePath": "/Utility.vue", "fixableErrorCount": 0, "fixableWarningCount": 0, - "messages": Array [ - Object { + "messages": [ + { "fatal": true, "message": "Parsing error: Cannot read file '/usr/linked/tsconfig.json'.", "ruleId": null, "severity": 2, }, ], - "source": " ", - "suppressedMessages": Array [], - "usedDeprecatedRules": Array [], + "suppressedMessages": [], + "usedDeprecatedRules": [], "warningCount": 0, }, - Object { + { "errorCount": 1, "fatalErrorCount": 1, "filePath": "/World.vue", "fixableErrorCount": 0, "fixableWarningCount": 0, - "messages": Array [ - Object { + "messages": [ + { "fatal": true, "message": "Parsing error: Cannot read file '/usr/linked/tsconfig.json'.", "ruleId": null, @@ -111,15 +111,15 @@ export default class Utility { "source": " - ", - "suppressedMessages": Array [], - "usedDeprecatedRules": Array [], + "suppressedMessages": [], + "usedDeprecatedRules": [], "warningCount": 0, }, ] diff --git a/tools/generate-contributors.ts b/tools/generate-contributors.ts index 93e2a36c9c0..10304672121 100644 --- a/tools/generate-contributors.ts +++ b/tools/generate-contributors.ts @@ -2,8 +2,8 @@ // https://developer.github.com/v3/repos/#list-contributors // this endpoint returns a list of contributors sorted by number of contributions -import * as fs from 'fs'; import fetch from 'cross-fetch'; +import * as fs from 'fs'; import * as path from 'path'; const IGNORED_USERS = new Set([ diff --git a/tools/generate-sponsors.ts b/tools/generate-sponsors.ts index 2893bbcb1e3..cbec8141ddc 100644 --- a/tools/generate-sponsors.ts +++ b/tools/generate-sponsors.ts @@ -92,22 +92,9 @@ interface MemberAccount { website: string; } -interface MemberAccountAndTier extends MemberAccount { - tier?: Tier; -} - const excludedNames = new Set([ 'Guest', // Apparent anonymous donor equivalent without an avatar 'Josh Goldberg', // Team member 💖 - - // These names *seem* to be spam websites, but we're not sure. - // If your name is mistakenly on this list, we're sorry; please let us know! - '420HUBS.COM', - 'Deal Empire', - 'Florian Studio', - 'java', - 'Loyalty Leo', - 'Penalty.com', ]); async function requestGraphql(key: keyof typeof queries): Promise { @@ -130,13 +117,12 @@ async function main(): Promise { ]); const accountsById = account.orders.nodes.reduce< - Record + Record >((accumulator, account) => { const name = account.fromAccount.name || account.fromAccount.id; accumulator[name] = { ...accumulator[name], ...account.fromAccount, - tier: account.tier, }; return accumulator; }, {}); @@ -154,25 +140,24 @@ async function main(): Promise { const allSponsorsConfig = collective.members.nodes .map(member => { const name = member.account.name || member.account.id; - const fromAccount: MemberAccountAndTier = { + const fromAccount = { ...member.account, ...accountsById[name], }; const totalDonations = totalDonationsById[name]; - const slug = fromAccount.tier?.slug ?? 'contributor'; + const website = fromAccount.website; return { id: name, image: fromAccount.imageUrl, name: fromAccount.name, - tier: getReportedTierSlug(slug, totalDonations), totalDonations, twitterHandle: fromAccount.twitterHandle, - website: fromAccount.website, + website, }; }) - .filter(({ id, tier }) => { - if (uniqueNames.has(id) || !tier) { + .filter(({ id, totalDonations, website }) => { + if (uniqueNames.has(id) || totalDonations < 10000 || !website) { return false; } @@ -205,36 +190,6 @@ async function stringifyObject( }); } -function getReportedTierSlug(slug: string, totalDonations: number): string { - // Sponsors: Donors of $750 and/or a monthly amount of $100 or more - if ( - totalDonations >= 750_00 || - (slug === 'sponsor' && totalDonations >= 100_00) - ) { - return 'sponsor'; - } - - // Gold Supporters: Donors of $150 and/or a monthly amount of $10 or more. - // We also only show gold supporters who have donated at least twice. - if ( - totalDonations >= 150_00 || - (slug === 'gold-supporter' && totalDonations >= 20_00) - ) { - return 'supporter'; - } - - // Supporters: Donors of $50 and/or a monthly amount of $3 or more. - // We also only show supporters who have donated at least twice. - if ( - totalDonations >= 50_00 || - (slug === 'supporter' && totalDonations >= 6_00) - ) { - return 'contributor'; - } - - return undefined; -} - main().catch(error => { console.error(error); process.exitCode = 1; diff --git a/tools/generate-website-dts.ts b/tools/generate-website-dts.ts index 0d9356a56aa..134945cfc85 100644 --- a/tools/generate-website-dts.ts +++ b/tools/generate-website-dts.ts @@ -1,5 +1,5 @@ -import * as fs from 'fs'; import fetch from 'cross-fetch'; +import * as fs from 'fs'; import * as path from 'path'; const baseHost = 'https://www.staging-typescript.org'; diff --git a/tools/postinstall.ts b/tools/postinstall.ts new file mode 100644 index 00000000000..badd3f0137a --- /dev/null +++ b/tools/postinstall.ts @@ -0,0 +1,37 @@ +import * as execa from 'execa'; + +/** + * In certain circumstances we want to skip the below the steps and it may not always + * be possible to use --ignore-scripts (e.g. if another tool is what is invoking the + * install command, such as when nx migrate runs). We therefore use and env var for this. + */ + +if (process.env.SKIP_POSTINSTALL) { + console.log( + '\nSkipping postinstall script because $SKIP_POSTINSTALL is set...\n', + ); + // eslint-disable-next-line no-process-exit + process.exit(0); +} + +void (async function (): Promise { + // Apply patches to installed node_modules + await $`yarn patch-package`; + + // Install git hooks + await $`yarn husky install`; + + // Clean any caches that may be invalid now + await $`yarn clean`; + + // Build all the packages ready for use + await $`yarn build`; +})(); + +async function $(cmd: TemplateStringsArray): Promise { + const command = cmd.join(); + console.log(`\n$ ${command}`); + return execa.command(command, { + stdio: 'inherit', + }); +} diff --git a/workspace.json b/workspace.json deleted file mode 100644 index 152f3d9f6d0..00000000000 --- a/workspace.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "version": 2, - "projects": { - "@typescript-eslint/ast-spec": "packages/ast-spec", - "@typescript-eslint/eslint-plugin": "packages/eslint-plugin", - "@typescript-eslint/eslint-plugin-internal": "packages/eslint-plugin-internal", - "@typescript-eslint/eslint-plugin-tslint": "packages/eslint-plugin-tslint", - "@typescript-eslint/experimental-utils": "packages/experimental-utils", - "@typescript-eslint/parser": "packages/parser", - "@typescript-eslint/scope-manager": "packages/scope-manager", - "@typescript-eslint/shared-fixtures": "packages/shared-fixtures", - "@typescript-eslint/type-utils": "packages/type-utils", - "@typescript-eslint/types": "packages/types", - "@typescript-eslint/typescript-estree": "packages/typescript-estree", - "@typescript-eslint/utils": "packages/utils", - "@typescript-eslint/visitor-keys": "packages/visitor-keys", - "@typescript-eslint/website-eslint": "packages/website-eslint", - "website": "packages/website" - } -} diff --git a/yarn.lock b/yarn.lock index a134bc0088c..1c5ec83ed4a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,17 +2,24 @@ # yarn lockfile v1 -"@algolia/autocomplete-core@1.6.3": - version "1.6.3" - resolved "https://registry.yarnpkg.com/@algolia/autocomplete-core/-/autocomplete-core-1.6.3.tgz#76832fffb6405ac2c87bac5a040b8a31a1cdef80" - integrity sha512-dqQqRt01fX3YuVFrkceHsoCnzX0bLhrrg8itJI1NM68KjrPYQPYsE+kY8EZTCM4y8VDnhqJErR73xe/ZsV+qAA== +"@algolia/autocomplete-core@1.7.1": + version "1.7.1" + resolved "https://registry.yarnpkg.com/@algolia/autocomplete-core/-/autocomplete-core-1.7.1.tgz#025538b8a9564a9f3dd5bcf8a236d6951c76c7d1" + integrity sha512-eiZw+fxMzNQn01S8dA/hcCpoWCOCwcIIEUtHHdzN5TGB3IpzLbuhqFeTfh2OUhhgkE8Uo17+wH+QJ/wYyQmmzg== dependencies: - "@algolia/autocomplete-shared" "1.6.3" + "@algolia/autocomplete-shared" "1.7.1" -"@algolia/autocomplete-shared@1.6.3": - version "1.6.3" - resolved "https://registry.yarnpkg.com/@algolia/autocomplete-shared/-/autocomplete-shared-1.6.3.tgz#52085ce89a755977841ed0a463aa31ce8f1dea97" - integrity sha512-UV46bnkTztyADFaETfzFC5ryIdGVb2zpAoYgu0tfcuYWjhg1KbLXveFffZIrGVoboqmAk1b+jMrl6iCja1i3lg== +"@algolia/autocomplete-preset-algolia@1.7.1": + version "1.7.1" + resolved "https://registry.yarnpkg.com/@algolia/autocomplete-preset-algolia/-/autocomplete-preset-algolia-1.7.1.tgz#7dadc5607097766478014ae2e9e1c9c4b3f957c8" + integrity sha512-pJwmIxeJCymU1M6cGujnaIYcY3QPOVYZOXhFkWVM7IxKzy272BwCvMFMyc5NpG/QmiObBxjo7myd060OeTNJXg== + dependencies: + "@algolia/autocomplete-shared" "1.7.1" + +"@algolia/autocomplete-shared@1.7.1": + version "1.7.1" + resolved "https://registry.yarnpkg.com/@algolia/autocomplete-shared/-/autocomplete-shared-1.7.1.tgz#95c3a0b4b78858fed730cf9c755b7d1cd0c82c74" + integrity sha512-eTmGVqY3GeyBTT8IWiB2K5EuURAqhnumfktAEoHxfDY2o7vg2rSnO16ZtIG0fMgt3py28Vwgq42/bVEuaQV7pg== "@algolia/cache-browser-local-storage@4.13.1": version "4.13.1" @@ -130,33 +137,49 @@ dependencies: "@jridgewell/trace-mapping" "^0.3.0" -"@babel/code-frame@*", "@babel/code-frame@^7.0.0", "@babel/code-frame@^7.10.4", "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.16.0", "@babel/code-frame@^7.16.7", "@babel/code-frame@^7.8.3": +"@apideck/better-ajv-errors@^0.3.1": + version "0.3.6" + resolved "https://registry.yarnpkg.com/@apideck/better-ajv-errors/-/better-ajv-errors-0.3.6.tgz#957d4c28e886a64a8141f7522783be65733ff097" + integrity sha512-P+ZygBLZtkp0qqOAJJVX4oX/sFo5JR3eBWwwuqHHhK0GIgQOKWrAfiAaWX0aArHkRWHMuggFEgAZNxVPwPZYaA== + dependencies: + json-schema "^0.4.0" + jsonpointer "^5.0.0" + leven "^3.1.0" + +"@axe-core/playwright@^4.4.5": + version "4.4.5" + resolved "https://registry.yarnpkg.com/@axe-core/playwright/-/playwright-4.4.5.tgz#196513ceb78ae42fa047de6bc757bec670eb13a0" + integrity sha512-oyh8TuAjPc6GIut3E+BiJU19jAEuzhf1ZMB7nrJqfGWsU6kWP0ymRwuj6TX3JJTT5mL3m+yFhph5RhCr/MkQ1g== + dependencies: + axe-core "^4.4.3" + +"@babel/code-frame@*", "@babel/code-frame@^7.0.0", "@babel/code-frame@^7.10.4", "@babel/code-frame@^7.12.13", "@babel/code-frame@^7.16.0", "@babel/code-frame@^7.18.6", "@babel/code-frame@^7.8.3": version "7.18.6" resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.18.6.tgz#3b25d38c89600baa2dcc219edfa88a74eb2c427a" integrity sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q== dependencies: "@babel/highlight" "^7.18.6" -"@babel/compat-data@^7.13.11", "@babel/compat-data@^7.17.10": - version "7.17.10" - resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.17.10.tgz#711dc726a492dfc8be8220028b1b92482362baab" - integrity sha512-GZt/TCsG70Ms19gfZO1tM4CVnXsPgEPBCpJu+Qz3L0LUDsY5nZqFZglIoPC1kIYOtNBZlrnFT+klg12vFGZXrw== +"@babel/compat-data@^7.17.7", "@babel/compat-data@^7.18.8", "@babel/compat-data@^7.19.3", "@babel/compat-data@^7.20.0": + version "7.20.1" + resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.20.1.tgz#f2e6ef7790d8c8dbf03d379502dcc246dcce0b30" + integrity sha512-EWZ4mE2diW3QALKvDMiXnbZpRvlj+nayZ112nK93SnhqOtpdsbVD4W+2tEoT3YNBAG9RBR0ISY758ZkOgsn6pQ== -"@babel/core@*", "@babel/core@^7.11.6", "@babel/core@^7.12.3", "@babel/core@^7.15.5", "@babel/core@^7.18.2": - version "7.18.5" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.18.5.tgz#c597fa680e58d571c28dda9827669c78cdd7f000" - integrity sha512-MGY8vg3DxMnctw0LdvSEojOsumc70g0t18gNyUdAZqB1Rpd1Bqo/svHGvt+UJ6JcGX+DIekGFDxxIWofBxLCnQ== +"@babel/core@*", "@babel/core@^7.11.1", "@babel/core@^7.11.6", "@babel/core@^7.12.3", "@babel/core@^7.15.5", "@babel/core@^7.18.6", "@babel/core@^7.20.2": + version "7.20.2" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.20.2.tgz#8dc9b1620a673f92d3624bd926dc49a52cf25b92" + integrity sha512-w7DbG8DtMrJcFOi4VrLm+8QM4az8Mo+PuLBKLp2zrYRCow8W/f9xiXm5sN53C8HksCyDQwCKha9JiDoIyPjT2g== dependencies: "@ampproject/remapping" "^2.1.0" - "@babel/code-frame" "^7.16.7" - "@babel/generator" "^7.18.2" - "@babel/helper-compilation-targets" "^7.18.2" - "@babel/helper-module-transforms" "^7.18.0" - "@babel/helpers" "^7.18.2" - "@babel/parser" "^7.18.5" - "@babel/template" "^7.16.7" - "@babel/traverse" "^7.18.5" - "@babel/types" "^7.18.4" + "@babel/code-frame" "^7.18.6" + "@babel/generator" "^7.20.2" + "@babel/helper-compilation-targets" "^7.20.0" + "@babel/helper-module-transforms" "^7.20.2" + "@babel/helpers" "^7.20.1" + "@babel/parser" "^7.20.2" + "@babel/template" "^7.18.10" + "@babel/traverse" "^7.20.1" + "@babel/types" "^7.20.2" convert-source-map "^1.7.0" debug "^4.1.0" gensync "^1.0.0-beta.2" @@ -185,225 +208,229 @@ semver "^5.4.1" source-map "^0.5.0" -"@babel/eslint-parser@*", "@babel/eslint-parser@^7.18.2": - version "7.18.2" - resolved "https://registry.yarnpkg.com/@babel/eslint-parser/-/eslint-parser-7.18.2.tgz#e14dee36c010edfb0153cf900c2b0815e82e3245" - integrity sha512-oFQYkE8SuH14+uR51JVAmdqwKYXGRjEXx7s+WiagVjqQ+HPE+nnwyF2qlVG8evUsUHmPcA+6YXMEDbIhEyQc5A== +"@babel/eslint-parser@*", "@babel/eslint-parser@^7.19.1": + version "7.19.1" + resolved "https://registry.yarnpkg.com/@babel/eslint-parser/-/eslint-parser-7.19.1.tgz#4f68f6b0825489e00a24b41b6a1ae35414ecd2f4" + integrity sha512-AqNf2QWt1rtu2/1rLswy6CDP7H9Oh3mMhk177Y67Rg8d7RD9WfOLLv8CGn6tisFvS2htm86yIe1yLF6I1UDaGQ== dependencies: - eslint-scope "^5.1.1" + "@nicolo-ribaudo/eslint-scope-5-internals" "5.1.1-v1" eslint-visitor-keys "^2.1.0" semver "^6.3.0" -"@babel/generator@^7.12.5", "@babel/generator@^7.18.2", "@babel/generator@^7.7.2": - version "7.18.2" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.18.2.tgz#33873d6f89b21efe2da63fe554460f3df1c5880d" - integrity sha512-W1lG5vUwFvfMd8HVXqdfbuG7RuaSrTCCD8cl8fP8wOivdbtbIg2Db3IWUcgvfxKbbn6ZBGYRW/Zk1MIwK49mgw== +"@babel/generator@^7.12.5", "@babel/generator@^7.18.7", "@babel/generator@^7.20.1", "@babel/generator@^7.20.2", "@babel/generator@^7.7.2": + version "7.20.4" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.20.4.tgz#4d9f8f0c30be75fd90a0562099a26e5839602ab8" + integrity sha512-luCf7yk/cm7yab6CAW1aiFnmEfBJplb/JojV56MYEK7ziWfGmFlTfmL9Ehwfy4gFhbjBfWO1wj7/TuSbVNEEtA== dependencies: - "@babel/types" "^7.18.2" - "@jridgewell/gen-mapping" "^0.3.0" + "@babel/types" "^7.20.2" + "@jridgewell/gen-mapping" "^0.3.2" jsesc "^2.5.1" -"@babel/helper-annotate-as-pure@^7.16.7": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.16.7.tgz#bb2339a7534a9c128e3102024c60760a3a7f3862" - integrity sha512-s6t2w/IPQVTAET1HitoowRGXooX8mCgtuP5195wD/QJPV6wYjpujCGF7JuMODVX2ZAJOf1GT6DT9MHEZvLOFSw== +"@babel/helper-annotate-as-pure@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.18.6.tgz#eaa49f6f80d5a33f9a5dd2276e6d6e451be0a6bb" + integrity sha512-duORpUiYrEpzKIop6iNbjnwKLAKnJ47csTyRACyEmWj0QdUrm5aqNJGHSSEQSUAvNW0ojX0dOmK9dZduvkfeXA== dependencies: - "@babel/types" "^7.16.7" + "@babel/types" "^7.18.6" -"@babel/helper-builder-binary-assignment-operator-visitor@^7.16.7": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.16.7.tgz#38d138561ea207f0f69eb1626a418e4f7e6a580b" - integrity sha512-C6FdbRaxYjwVu/geKW4ZeQ0Q31AftgRcdSnZ5/jsH6BzCJbtvXvhpfkbkThYSuutZA7nCXpPR6AD9zd1dprMkA== +"@babel/helper-builder-binary-assignment-operator-visitor@^7.18.6": + version "7.18.9" + resolved "https://registry.yarnpkg.com/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.18.9.tgz#acd4edfd7a566d1d51ea975dff38fd52906981bb" + integrity sha512-yFQ0YCHoIqarl8BCRwBL8ulYUaZpz3bNsA7oFepAzee+8/+ImtADXNOmO5vJvsPff3qi+hvpkY/NYBTrBQgdNw== dependencies: - "@babel/helper-explode-assignable-expression" "^7.16.7" - "@babel/types" "^7.16.7" + "@babel/helper-explode-assignable-expression" "^7.18.6" + "@babel/types" "^7.18.9" -"@babel/helper-compilation-targets@^7.13.0", "@babel/helper-compilation-targets@^7.16.7", "@babel/helper-compilation-targets@^7.17.10", "@babel/helper-compilation-targets@^7.18.2": - version "7.18.2" - resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.18.2.tgz#67a85a10cbd5fc7f1457fec2e7f45441dc6c754b" - integrity sha512-s1jnPotJS9uQnzFtiZVBUxe67CuBa679oWFHpxYYnTpRL/1ffhyX44R9uYiXoa/pLXcY9H2moJta0iaanlk/rQ== +"@babel/helper-compilation-targets@^7.17.7", "@babel/helper-compilation-targets@^7.18.9", "@babel/helper-compilation-targets@^7.19.0", "@babel/helper-compilation-targets@^7.19.3", "@babel/helper-compilation-targets@^7.20.0": + version "7.20.0" + resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.20.0.tgz#6bf5374d424e1b3922822f1d9bdaa43b1a139d0a" + integrity sha512-0jp//vDGp9e8hZzBc6N/KwA5ZK3Wsm/pfm4CrY7vzegkVxc65SgSn6wYOnwHe9Js9HRQ1YTCKLGPzDtaS3RoLQ== dependencies: - "@babel/compat-data" "^7.17.10" - "@babel/helper-validator-option" "^7.16.7" - browserslist "^4.20.2" + "@babel/compat-data" "^7.20.0" + "@babel/helper-validator-option" "^7.18.6" + browserslist "^4.21.3" semver "^6.3.0" -"@babel/helper-create-class-features-plugin@^7.17.12", "@babel/helper-create-class-features-plugin@^7.18.0": - version "7.18.0" - resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.18.0.tgz#fac430912606331cb075ea8d82f9a4c145a4da19" - integrity sha512-Kh8zTGR9de3J63e5nS0rQUdRs/kbtwoeQQ0sriS0lItjC96u8XXZN6lKpuyWd2coKSU13py/y+LTmThLuVX0Pg== - dependencies: - "@babel/helper-annotate-as-pure" "^7.16.7" - "@babel/helper-environment-visitor" "^7.16.7" - "@babel/helper-function-name" "^7.17.9" - "@babel/helper-member-expression-to-functions" "^7.17.7" - "@babel/helper-optimise-call-expression" "^7.16.7" - "@babel/helper-replace-supers" "^7.16.7" - "@babel/helper-split-export-declaration" "^7.16.7" - -"@babel/helper-create-regexp-features-plugin@^7.16.7", "@babel/helper-create-regexp-features-plugin@^7.17.12": - version "7.17.12" - resolved "https://registry.yarnpkg.com/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.17.12.tgz#bb37ca467f9694bbe55b884ae7a5cc1e0084e4fd" - integrity sha512-b2aZrV4zvutr9AIa6/gA3wsZKRwTKYoDxYiFKcESS3Ug2GTXzwBEvMuuFLhCQpEnRXs1zng4ISAXSUxxKBIcxw== - dependencies: - "@babel/helper-annotate-as-pure" "^7.16.7" - regexpu-core "^5.0.1" - -"@babel/helper-define-polyfill-provider@^0.3.0", "@babel/helper-define-polyfill-provider@^0.3.1": - version "0.3.1" - resolved "https://registry.yarnpkg.com/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.3.1.tgz#52411b445bdb2e676869e5a74960d2d3826d2665" - integrity sha512-J9hGMpJQmtWmj46B3kBHmL38UhJGhYX7eqkcq+2gsstyYt341HmPeWspihX43yVRA0mS+8GGk2Gckc7bY/HCmA== - dependencies: - "@babel/helper-compilation-targets" "^7.13.0" - "@babel/helper-module-imports" "^7.12.13" - "@babel/helper-plugin-utils" "^7.13.0" - "@babel/traverse" "^7.13.0" +"@babel/helper-create-class-features-plugin@^7.18.6": + version "7.18.9" + resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.18.9.tgz#d802ee16a64a9e824fcbf0a2ffc92f19d58550ce" + integrity sha512-WvypNAYaVh23QcjpMR24CwZY2Nz6hqdOcFdPbNpV56hL5H6KiFheO7Xm1aPdlLQ7d5emYZX7VZwPp9x3z+2opw== + dependencies: + "@babel/helper-annotate-as-pure" "^7.18.6" + "@babel/helper-environment-visitor" "^7.18.9" + "@babel/helper-function-name" "^7.18.9" + "@babel/helper-member-expression-to-functions" "^7.18.9" + "@babel/helper-optimise-call-expression" "^7.18.6" + "@babel/helper-replace-supers" "^7.18.9" + "@babel/helper-split-export-declaration" "^7.18.6" + +"@babel/helper-create-regexp-features-plugin@^7.18.6", "@babel/helper-create-regexp-features-plugin@^7.19.0": + version "7.19.0" + resolved "https://registry.yarnpkg.com/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.19.0.tgz#7976aca61c0984202baca73d84e2337a5424a41b" + integrity sha512-htnV+mHX32DF81amCDrwIDr8nrp1PTm+3wfBN9/v8QJOLEioOCOG7qNyq0nHeFiWbT3Eb7gsPwEmV64UCQ1jzw== + dependencies: + "@babel/helper-annotate-as-pure" "^7.18.6" + regexpu-core "^5.1.0" + +"@babel/helper-define-polyfill-provider@^0.3.1", "@babel/helper-define-polyfill-provider@^0.3.2", "@babel/helper-define-polyfill-provider@^0.3.3": + version "0.3.3" + resolved "https://registry.yarnpkg.com/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.3.3.tgz#8612e55be5d51f0cd1f36b4a5a83924e89884b7a" + integrity sha512-z5aQKU4IzbqCC1XH0nAqfsFLMVSo22SBKUc0BxGrLkolTdPTructy0ToNnlO2zA4j9Q/7pjMZf0DSY+DSTYzww== + dependencies: + "@babel/helper-compilation-targets" "^7.17.7" + "@babel/helper-plugin-utils" "^7.16.7" debug "^4.1.1" lodash.debounce "^4.0.8" resolve "^1.14.2" semver "^6.1.2" -"@babel/helper-environment-visitor@^7.16.7", "@babel/helper-environment-visitor@^7.18.2": - version "7.18.2" - resolved "https://registry.yarnpkg.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.18.2.tgz#8a6d2dedb53f6bf248e31b4baf38739ee4a637bd" - integrity sha512-14GQKWkX9oJzPiQQ7/J36FTXcD4kSp8egKjO9nINlSKiHITRA9q/R74qu8S9xlc/b/yjsJItQUeeh3xnGN0voQ== - -"@babel/helper-explode-assignable-expression@^7.16.7": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.16.7.tgz#12a6d8522fdd834f194e868af6354e8650242b7a" - integrity sha512-KyUenhWMC8VrxzkGP0Jizjo4/Zx+1nNZhgocs+gLzyZyB8SHidhoq9KK/8Ato4anhwsivfkBLftky7gvzbZMtQ== - dependencies: - "@babel/types" "^7.16.7" - -"@babel/helper-function-name@^7.16.7", "@babel/helper-function-name@^7.17.9": - version "7.17.9" - resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.17.9.tgz#136fcd54bc1da82fcb47565cf16fd8e444b1ff12" - integrity sha512-7cRisGlVtiVqZ0MW0/yFB4atgpGLWEHUVYnb448hZK4x+vih0YO5UoS11XIYtZYqHd0dIPMdUSv8q5K4LdMnIg== - dependencies: - "@babel/template" "^7.16.7" - "@babel/types" "^7.17.0" +"@babel/helper-environment-visitor@^7.18.9": + version "7.18.9" + resolved "https://registry.yarnpkg.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.18.9.tgz#0c0cee9b35d2ca190478756865bb3528422f51be" + integrity sha512-3r/aACDJ3fhQ/EVgFy0hpj8oHyHpQc+LPtJoY9SzTThAsStm4Ptegq92vqKoE3vD706ZVFWITnMnxucw+S9Ipg== -"@babel/helper-hoist-variables@^7.16.7": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.16.7.tgz#86bcb19a77a509c7b77d0e22323ef588fa58c246" - integrity sha512-m04d/0Op34H5v7pbZw6pSKP7weA6lsMvfiIAMeIvkY/R4xQtBSMFEigu9QTZ2qB/9l22vsxtM8a+Q8CzD255fg== +"@babel/helper-explode-assignable-expression@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.18.6.tgz#41f8228ef0a6f1a036b8dfdfec7ce94f9a6bc096" + integrity sha512-eyAYAsQmB80jNfg4baAtLeWAQHfHFiR483rzFK+BhETlGZaQC9bsfrugfXDCbRHLQbIA7U5NxhhOxN7p/dWIcg== dependencies: - "@babel/types" "^7.16.7" + "@babel/types" "^7.18.6" -"@babel/helper-member-expression-to-functions@^7.17.7": - version "7.17.7" - resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.17.7.tgz#a34013b57d8542a8c4ff8ba3f747c02452a4d8c4" - integrity sha512-thxXgnQ8qQ11W2wVUObIqDL4p148VMxkt5T/qpN5k2fboRyzFGFmKsTGViquyM5QHKUy48OZoca8kw4ajaDPyw== +"@babel/helper-function-name@^7.18.9", "@babel/helper-function-name@^7.19.0": + version "7.19.0" + resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.19.0.tgz#941574ed5390682e872e52d3f38ce9d1bef4648c" + integrity sha512-WAwHBINyrpqywkUH0nTnNgI5ina5TFn85HKS0pbPDfxFfhyR/aNQEn4hGi1P1JyT//I0t4OgXUlofzWILRvS5w== dependencies: - "@babel/types" "^7.17.0" + "@babel/template" "^7.18.10" + "@babel/types" "^7.19.0" -"@babel/helper-module-imports@^7.12.13", "@babel/helper-module-imports@^7.16.7": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.16.7.tgz#25612a8091a999704461c8a222d0efec5d091437" - integrity sha512-LVtS6TqjJHFc+nYeITRo6VLXve70xmq7wPhWTqDJusJEgGmkAACWwMiTNrvfoQo6hEhFwAIixNkvB0jPXDL8Wg== +"@babel/helper-hoist-variables@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.18.6.tgz#d4d2c8fb4baeaa5c68b99cc8245c56554f926678" + integrity sha512-UlJQPkFqFULIcyW5sbzgbkxn2FKRgwWiRexcuaR8RNJRy8+LLveqPjwZV/bwrLZCN0eUHD/x8D0heK1ozuoo6Q== dependencies: - "@babel/types" "^7.16.7" + "@babel/types" "^7.18.6" -"@babel/helper-module-transforms@^7.12.1", "@babel/helper-module-transforms@^7.18.0": - version "7.18.0" - resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.18.0.tgz#baf05dec7a5875fb9235bd34ca18bad4e21221cd" - integrity sha512-kclUYSUBIjlvnzN2++K9f2qzYKFgjmnmjwL4zlmU5f8ZtzgWe8s0rUPSTGy2HmK4P8T52MQsS+HTQAgZd3dMEA== +"@babel/helper-member-expression-to-functions@^7.18.9": + version "7.18.9" + resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.18.9.tgz#1531661e8375af843ad37ac692c132841e2fd815" + integrity sha512-RxifAh2ZoVU67PyKIO4AMi1wTenGfMR/O/ae0CCRqwgBAt5v7xjdtRw7UoSbsreKrQn5t7r89eruK/9JjYHuDg== dependencies: - "@babel/helper-environment-visitor" "^7.16.7" - "@babel/helper-module-imports" "^7.16.7" - "@babel/helper-simple-access" "^7.17.7" - "@babel/helper-split-export-declaration" "^7.16.7" - "@babel/helper-validator-identifier" "^7.16.7" - "@babel/template" "^7.16.7" - "@babel/traverse" "^7.18.0" - "@babel/types" "^7.18.0" + "@babel/types" "^7.18.9" -"@babel/helper-optimise-call-expression@^7.16.7": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.16.7.tgz#a34e3560605abbd31a18546bd2aad3e6d9a174f2" - integrity sha512-EtgBhg7rd/JcnpZFXpBy0ze1YRfdm7BnBX4uKMBd3ixa3RGAE002JZB66FJyNH7g0F38U05pXmA5P8cBh7z+1w== +"@babel/helper-module-imports@^7.10.4", "@babel/helper-module-imports@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.18.6.tgz#1e3ebdbbd08aad1437b428c50204db13c5a3ca6e" + integrity sha512-0NFvs3VkuSYbFi1x2Vd6tKrywq+z/cLeYC/RJNFrIX/30Bf5aiGYbtvGXolEktzJH8o5E5KJ3tT+nkxuuZFVlA== + dependencies: + "@babel/types" "^7.18.6" + +"@babel/helper-module-transforms@^7.12.1", "@babel/helper-module-transforms@^7.18.6", "@babel/helper-module-transforms@^7.19.0", "@babel/helper-module-transforms@^7.20.2": + version "7.20.2" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.20.2.tgz#ac53da669501edd37e658602a21ba14c08748712" + integrity sha512-zvBKyJXRbmK07XhMuujYoJ48B5yvvmM6+wcpv6Ivj4Yg6qO7NOZOSnvZN9CRl1zz1Z4cKf8YejmCMh8clOoOeA== + dependencies: + "@babel/helper-environment-visitor" "^7.18.9" + "@babel/helper-module-imports" "^7.18.6" + "@babel/helper-simple-access" "^7.20.2" + "@babel/helper-split-export-declaration" "^7.18.6" + "@babel/helper-validator-identifier" "^7.19.1" + "@babel/template" "^7.18.10" + "@babel/traverse" "^7.20.1" + "@babel/types" "^7.20.2" + +"@babel/helper-optimise-call-expression@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.18.6.tgz#9369aa943ee7da47edab2cb4e838acf09d290ffe" + integrity sha512-HP59oD9/fEHQkdcbgFCnbmgH5vIQTJbxh2yf+CdM89/glUNnuzr87Q8GIjGEnOktTROemO0Pe0iPAYbqZuOUiA== dependencies: - "@babel/types" "^7.16.7" + "@babel/types" "^7.18.6" "@babel/helper-plugin-utils@7.10.4": version "7.10.4" resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.10.4.tgz#2f75a831269d4f677de49986dff59927533cf375" integrity sha512-O4KCvQA6lLiMU9l2eawBPMf1xPP8xPfB3iEQw150hOVTqj/rfXz0ThTb4HEzqQfs2Bmo5Ay8BzxfzVtBrr9dVg== -"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.13.0", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.16.7", "@babel/helper-plugin-utils@^7.17.12", "@babel/helper-plugin-utils@^7.8.0", "@babel/helper-plugin-utils@^7.8.3": - version "7.17.12" - resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.17.12.tgz#86c2347da5acbf5583ba0a10aed4c9bf9da9cf96" - integrity sha512-JDkf04mqtN3y4iAbO1hv9U2ARpPyPL1zqyWs/2WG1pgSq9llHFjStX5jdxb84himgJm+8Ng+x0oiWF/nw/XQKA== +"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.16.7", "@babel/helper-plugin-utils@^7.17.12", "@babel/helper-plugin-utils@^7.18.6", "@babel/helper-plugin-utils@^7.18.9", "@babel/helper-plugin-utils@^7.19.0", "@babel/helper-plugin-utils@^7.8.0", "@babel/helper-plugin-utils@^7.8.3": + version "7.19.0" + resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.19.0.tgz#4796bb14961521f0f8715990bee2fb6e51ce21bf" + integrity sha512-40Ryx7I8mT+0gaNxm8JGTZFUITNqdLAgdg0hXzeVZxVD6nFsdhQvip6v8dqkRHzsz1VFpFAaOCHNn0vKBL7Czw== -"@babel/helper-remap-async-to-generator@^7.16.8": - version "7.16.8" - resolved "https://registry.yarnpkg.com/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.16.8.tgz#29ffaade68a367e2ed09c90901986918d25e57e3" - integrity sha512-fm0gH7Flb8H51LqJHy3HJ3wnE1+qtYR2A99K06ahwrawLdOFsCEWjZOrYricXJHoPSudNKxrMBUPEIPxiIIvBw== +"@babel/helper-remap-async-to-generator@^7.18.6", "@babel/helper-remap-async-to-generator@^7.18.9": + version "7.18.9" + resolved "https://registry.yarnpkg.com/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.18.9.tgz#997458a0e3357080e54e1d79ec347f8a8cd28519" + integrity sha512-dI7q50YKd8BAv3VEfgg7PS7yD3Rtbi2J1XMXaalXO0W0164hYLnh8zpjRS0mte9MfVp/tltvr/cfdXPvJr1opA== dependencies: - "@babel/helper-annotate-as-pure" "^7.16.7" - "@babel/helper-wrap-function" "^7.16.8" - "@babel/types" "^7.16.8" + "@babel/helper-annotate-as-pure" "^7.18.6" + "@babel/helper-environment-visitor" "^7.18.9" + "@babel/helper-wrap-function" "^7.18.9" + "@babel/types" "^7.18.9" -"@babel/helper-replace-supers@^7.16.7": - version "7.18.2" - resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.18.2.tgz#41fdfcc9abaf900e18ba6e5931816d9062a7b2e0" - integrity sha512-XzAIyxx+vFnrOxiQrToSUOzUOn0e1J2Li40ntddek1Y69AXUTXoDJ40/D5RdjFu7s7qHiaeoTiempZcbuVXh2Q== +"@babel/helper-replace-supers@^7.18.6", "@babel/helper-replace-supers@^7.18.9": + version "7.18.9" + resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.18.9.tgz#1092e002feca980fbbb0bd4d51b74a65c6a500e6" + integrity sha512-dNsWibVI4lNT6HiuOIBr1oyxo40HvIVmbwPUm3XZ7wMh4k2WxrxTqZwSqw/eEmXDS9np0ey5M2bz9tBmO9c+YQ== dependencies: - "@babel/helper-environment-visitor" "^7.18.2" - "@babel/helper-member-expression-to-functions" "^7.17.7" - "@babel/helper-optimise-call-expression" "^7.16.7" - "@babel/traverse" "^7.18.2" - "@babel/types" "^7.18.2" + "@babel/helper-environment-visitor" "^7.18.9" + "@babel/helper-member-expression-to-functions" "^7.18.9" + "@babel/helper-optimise-call-expression" "^7.18.6" + "@babel/traverse" "^7.18.9" + "@babel/types" "^7.18.9" -"@babel/helper-simple-access@^7.17.7", "@babel/helper-simple-access@^7.18.2": - version "7.18.2" - resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.18.2.tgz#4dc473c2169ac3a1c9f4a51cfcd091d1c36fcff9" - integrity sha512-7LIrjYzndorDY88MycupkpQLKS1AFfsVRm2k/9PtKScSy5tZq0McZTj+DiMRynboZfIqOKvo03pmhTaUgiD6fQ== +"@babel/helper-simple-access@^7.18.6", "@babel/helper-simple-access@^7.20.2": + version "7.20.2" + resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.20.2.tgz#0ab452687fe0c2cfb1e2b9e0015de07fc2d62dd9" + integrity sha512-+0woI/WPq59IrqDYbVGfshjT5Dmk/nnbdpcF8SnMhhXObpTq2KNBdLFRFrkVdbDOyUmHBCxzm5FHV1rACIkIbA== dependencies: - "@babel/types" "^7.18.2" + "@babel/types" "^7.20.2" -"@babel/helper-skip-transparent-expression-wrappers@^7.16.0": - version "7.16.0" - resolved "https://registry.yarnpkg.com/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.16.0.tgz#0ee3388070147c3ae051e487eca3ebb0e2e8bb09" - integrity sha512-+il1gTy0oHwUsBQZyJvukbB4vPMdcYBrFHa0Uc4AizLxbq6BOYC51Rv4tWocX9BLBDLZ4kc6qUFpQ6HRgL+3zw== +"@babel/helper-skip-transparent-expression-wrappers@^7.18.9": + version "7.18.9" + resolved "https://registry.yarnpkg.com/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.18.9.tgz#778d87b3a758d90b471e7b9918f34a9a02eb5818" + integrity sha512-imytd2gHi3cJPsybLRbmFrF7u5BIEuI2cNheyKi3/iOBC63kNn3q8Crn2xVuESli0aM4KYsyEqKyS7lFL8YVtw== dependencies: - "@babel/types" "^7.16.0" + "@babel/types" "^7.18.9" -"@babel/helper-split-export-declaration@^7.16.7": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.16.7.tgz#0b648c0c42da9d3920d85ad585f2778620b8726b" - integrity sha512-xbWoy/PFoxSWazIToT9Sif+jJTlrMcndIsaOKvTA6u7QEo7ilkRZpjew18/W3c7nm8fXdUDXh02VXTbZ0pGDNw== +"@babel/helper-split-export-declaration@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.18.6.tgz#7367949bc75b20c6d5a5d4a97bba2824ae8ef075" + integrity sha512-bde1etTx6ZyTmobl9LLMMQsaizFVZrquTEHOqKeQESMKo4PlObf+8+JA25ZsIpZhT/WEd39+vOdLXAFG/nELpA== dependencies: - "@babel/types" "^7.16.7" + "@babel/types" "^7.18.6" -"@babel/helper-validator-identifier@^7.16.7", "@babel/helper-validator-identifier@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.18.6.tgz#9c97e30d31b2b8c72a1d08984f2ca9b574d7a076" - integrity sha512-MmetCkz9ej86nJQV+sFCxoGGrUbU3q02kgLciwkrt9QqEB7cP39oKEY0PakknEO0Gu20SskMRi+AYZ3b1TpN9g== +"@babel/helper-string-parser@^7.19.4": + version "7.19.4" + resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.19.4.tgz#38d3acb654b4701a9b77fb0615a96f775c3a9e63" + integrity sha512-nHtDoQcuqFmwYNYPz3Rah5ph2p8PFeFCsZk9A/48dPc/rGocJ5J3hAAZ7pb76VWX3fZKu+uEr/FhH5jLx7umrw== -"@babel/helper-validator-option@^7.16.7": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.16.7.tgz#b203ce62ce5fe153899b617c08957de860de4d23" - integrity sha512-TRtenOuRUVo9oIQGPC5G9DgK4743cdxvtOw0weQNpZXaS16SCBi5MNjZF8vba3ETURjZpTbVn7Vvcf2eAwFozQ== +"@babel/helper-validator-identifier@^7.18.6", "@babel/helper-validator-identifier@^7.19.1": + version "7.19.1" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz#7eea834cf32901ffdc1a7ee555e2f9c27e249ca2" + integrity sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w== + +"@babel/helper-validator-option@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.18.6.tgz#bf0d2b5a509b1f336099e4ff36e1a63aa5db4db8" + integrity sha512-XO7gESt5ouv/LRJdrVjkShckw6STTaB7l9BrpBaAHDeF5YZT+01PCwmR0SJHnkW6i8OwW/EVWRShfi4j2x+KQw== -"@babel/helper-wrap-function@^7.16.8": - version "7.16.8" - resolved "https://registry.yarnpkg.com/@babel/helper-wrap-function/-/helper-wrap-function-7.16.8.tgz#58afda087c4cd235de92f7ceedebca2c41274200" - integrity sha512-8RpyRVIAW1RcDDGTA+GpPAwV22wXCfKOoM9bet6TLkGIFTkRQSkH1nMQ5Yet4MpoXe1ZwHPVtNasc2w0uZMqnw== +"@babel/helper-wrap-function@^7.18.9": + version "7.18.9" + resolved "https://registry.yarnpkg.com/@babel/helper-wrap-function/-/helper-wrap-function-7.18.9.tgz#ae1feddc6ebbaa2fd79346b77821c3bd73a39646" + integrity sha512-cG2ru3TRAL6a60tfQflpEfs4ldiPwF6YW3zfJiRgmoFVIaC1vGnBBgatfec+ZUziPHkHSaXAuEck3Cdkf3eRpQ== dependencies: - "@babel/helper-function-name" "^7.16.7" - "@babel/template" "^7.16.7" - "@babel/traverse" "^7.16.8" - "@babel/types" "^7.16.8" + "@babel/helper-function-name" "^7.18.9" + "@babel/template" "^7.18.6" + "@babel/traverse" "^7.18.9" + "@babel/types" "^7.18.9" -"@babel/helpers@^7.12.5", "@babel/helpers@^7.18.2": - version "7.18.2" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.18.2.tgz#970d74f0deadc3f5a938bfa250738eb4ac889384" - integrity sha512-j+d+u5xT5utcQSzrh9p+PaJX94h++KN+ng9b9WEJq7pkUPAd61FGqhjuUEdfknb3E/uDBb7ruwEeKkIxNJPIrg== +"@babel/helpers@^7.12.5", "@babel/helpers@^7.20.1": + version "7.20.1" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.20.1.tgz#2ab7a0fcb0a03b5bf76629196ed63c2d7311f4c9" + integrity sha512-J77mUVaDTUJFZ5BpP6mMn6OIl3rEWymk2ZxDBQJUG3P+PbmyMcF3bYWvz0ma69Af1oobDqT/iAsvzhB58xhQUg== dependencies: - "@babel/template" "^7.16.7" - "@babel/traverse" "^7.18.2" - "@babel/types" "^7.18.2" + "@babel/template" "^7.18.10" + "@babel/traverse" "^7.20.1" + "@babel/types" "^7.20.0" "@babel/highlight@^7.18.6": version "7.18.6" @@ -414,99 +441,100 @@ chalk "^2.0.0" js-tokens "^4.0.0" -"@babel/parser@*", "@babel/parser@^7.1.0", "@babel/parser@^7.12.7", "@babel/parser@^7.14.7", "@babel/parser@^7.16.7", "@babel/parser@^7.18.0", "@babel/parser@^7.18.3", "@babel/parser@^7.18.5": - version "7.18.5" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.18.5.tgz#337062363436a893a2d22faa60be5bb37091c83c" - integrity sha512-YZWVaglMiplo7v8f1oMQ5ZPQr0vn7HPeZXxXWsxXJRjGVrzUFn9OxFQl1sb5wzfootjA/yChhW84BV+383FSOw== +"@babel/parser@*", "@babel/parser@^7.1.0", "@babel/parser@^7.12.7", "@babel/parser@^7.14.7", "@babel/parser@^7.18.10", "@babel/parser@^7.18.8", "@babel/parser@^7.20.1", "@babel/parser@^7.20.2", "@babel/parser@^7.20.7": + version "7.20.7" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.20.7.tgz#66fe23b3c8569220817d5feb8b9dcdc95bb4f71b" + integrity sha512-T3Z9oHybU+0vZlY9CiDSJQTD5ZapcW18ZctFMi0MOAl/4BjFF4ul7NVSARLdbGO5vDqy9eQiGTV0LtKfvCYvcg== -"@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@^7.17.12": - version "7.17.12" - resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.17.12.tgz#1dca338caaefca368639c9ffb095afbd4d420b1e" - integrity sha512-xCJQXl4EeQ3J9C4yOmpTrtVGmzpm2iSzyxbkZHw7UCnZBftHpF/hpII80uWVyVrc40ytIClHjgWGTG1g/yB+aw== +"@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.18.6.tgz#da5b8f9a580acdfbe53494dba45ea389fb09a4d2" + integrity sha512-Dgxsyg54Fx1d4Nge8UnvTrED63vrwOdPmyvPzlNN/boaliRP54pm3pGzZD1SJUwrBA+Cs/xdG8kXX6Mn/RfISQ== dependencies: - "@babel/helper-plugin-utils" "^7.17.12" + "@babel/helper-plugin-utils" "^7.18.6" -"@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@^7.17.12": - version "7.17.12" - resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.17.12.tgz#0d498ec8f0374b1e2eb54b9cb2c4c78714c77753" - integrity sha512-/vt0hpIw0x4b6BLKUkwlvEoiGZYYLNZ96CzyHYPbtG2jZGz6LBe7/V+drYrc/d+ovrF9NBi0pmtvmNb/FsWtRQ== +"@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@^7.18.9": + version "7.18.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.18.9.tgz#a11af19aa373d68d561f08e0a57242350ed0ec50" + integrity sha512-AHrP9jadvH7qlOj6PINbgSuphjQUAK7AOT7DPjBo9EHoLhQTnnK5u45e1Hd4DbSQEO9nqPWtQ89r+XEOWFScKg== dependencies: - "@babel/helper-plugin-utils" "^7.17.12" - "@babel/helper-skip-transparent-expression-wrappers" "^7.16.0" - "@babel/plugin-proposal-optional-chaining" "^7.17.12" + "@babel/helper-plugin-utils" "^7.18.9" + "@babel/helper-skip-transparent-expression-wrappers" "^7.18.9" + "@babel/plugin-proposal-optional-chaining" "^7.18.9" -"@babel/plugin-proposal-async-generator-functions@^7.17.12": - version "7.17.12" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.17.12.tgz#094a417e31ce7e692d84bab06c8e2a607cbeef03" - integrity sha512-RWVvqD1ooLKP6IqWTA5GyFVX2isGEgC5iFxKzfYOIy/QEFdxYyCybBDtIGjipHpb9bDWHzcqGqFakf+mVmBTdQ== +"@babel/plugin-proposal-async-generator-functions@^7.19.1": + version "7.19.1" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.19.1.tgz#34f6f5174b688529342288cd264f80c9ea9fb4a7" + integrity sha512-0yu8vNATgLy4ivqMNBIwb1HebCelqN7YX8SL3FDXORv/RqT0zEEWUCH4GH44JsSrvCu6GqnAdR5EBFAPeNBB4Q== dependencies: - "@babel/helper-plugin-utils" "^7.17.12" - "@babel/helper-remap-async-to-generator" "^7.16.8" + "@babel/helper-environment-visitor" "^7.18.9" + "@babel/helper-plugin-utils" "^7.19.0" + "@babel/helper-remap-async-to-generator" "^7.18.9" "@babel/plugin-syntax-async-generators" "^7.8.4" -"@babel/plugin-proposal-class-properties@^7.17.12": - version "7.17.12" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.17.12.tgz#84f65c0cc247d46f40a6da99aadd6438315d80a4" - integrity sha512-U0mI9q8pW5Q9EaTHFPwSVusPMV/DV9Mm8p7csqROFLtIE9rBF5piLqyrBGigftALrBcsBGu4m38JneAe7ZDLXw== +"@babel/plugin-proposal-class-properties@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.18.6.tgz#b110f59741895f7ec21a6fff696ec46265c446a3" + integrity sha512-cumfXOF0+nzZrrN8Rf0t7M+tF6sZc7vhQwYQck9q1/5w2OExlD+b4v4RpMJFaV1Z7WcDRgO6FqvxqxGlwo+RHQ== dependencies: - "@babel/helper-create-class-features-plugin" "^7.17.12" - "@babel/helper-plugin-utils" "^7.17.12" + "@babel/helper-create-class-features-plugin" "^7.18.6" + "@babel/helper-plugin-utils" "^7.18.6" -"@babel/plugin-proposal-class-static-block@^7.18.0": - version "7.18.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-static-block/-/plugin-proposal-class-static-block-7.18.0.tgz#7d02253156e3c3793bdb9f2faac3a1c05f0ba710" - integrity sha512-t+8LsRMMDE74c6sV7KShIw13sqbqd58tlqNrsWoWBTIMw7SVQ0cZ905wLNS/FBCy/3PyooRHLFFlfrUNyyz5lA== +"@babel/plugin-proposal-class-static-block@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-static-block/-/plugin-proposal-class-static-block-7.18.6.tgz#8aa81d403ab72d3962fc06c26e222dacfc9b9020" + integrity sha512-+I3oIiNxrCpup3Gi8n5IGMwj0gOCAjcJUSQEcotNnCCPMEnixawOQ+KeJPlgfjzx+FKQ1QSyZOWe7wmoJp7vhw== dependencies: - "@babel/helper-create-class-features-plugin" "^7.18.0" - "@babel/helper-plugin-utils" "^7.17.12" + "@babel/helper-create-class-features-plugin" "^7.18.6" + "@babel/helper-plugin-utils" "^7.18.6" "@babel/plugin-syntax-class-static-block" "^7.14.5" -"@babel/plugin-proposal-dynamic-import@^7.16.7": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.16.7.tgz#c19c897eaa46b27634a00fee9fb7d829158704b2" - integrity sha512-I8SW9Ho3/8DRSdmDdH3gORdyUuYnk1m4cMxUAdu5oy4n3OfN8flDEH+d60iG7dUfi0KkYwSvoalHzzdRzpWHTg== +"@babel/plugin-proposal-dynamic-import@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.18.6.tgz#72bcf8d408799f547d759298c3c27c7e7faa4d94" + integrity sha512-1auuwmK+Rz13SJj36R+jqFPMJWyKEDd7lLSdOj4oJK0UTgGueSAtkrCvz9ewmgyU/P941Rv2fQwZJN8s6QruXw== dependencies: - "@babel/helper-plugin-utils" "^7.16.7" + "@babel/helper-plugin-utils" "^7.18.6" "@babel/plugin-syntax-dynamic-import" "^7.8.3" -"@babel/plugin-proposal-export-namespace-from@^7.17.12": - version "7.17.12" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-export-namespace-from/-/plugin-proposal-export-namespace-from-7.17.12.tgz#b22864ccd662db9606edb2287ea5fd1709f05378" - integrity sha512-j7Ye5EWdwoXOpRmo5QmRyHPsDIe6+u70ZYZrd7uz+ebPYFKfRcLcNu3Ro0vOlJ5zuv8rU7xa+GttNiRzX56snQ== +"@babel/plugin-proposal-export-namespace-from@^7.18.9": + version "7.18.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-export-namespace-from/-/plugin-proposal-export-namespace-from-7.18.9.tgz#5f7313ab348cdb19d590145f9247540e94761203" + integrity sha512-k1NtHyOMvlDDFeb9G5PhUXuGj8m/wiwojgQVEhJ/fsVsMCpLyOP4h0uGEjYJKrRI+EVPlb5Jk+Gt9P97lOGwtA== dependencies: - "@babel/helper-plugin-utils" "^7.17.12" + "@babel/helper-plugin-utils" "^7.18.9" "@babel/plugin-syntax-export-namespace-from" "^7.8.3" -"@babel/plugin-proposal-json-strings@^7.17.12": - version "7.17.12" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.17.12.tgz#f4642951792437233216d8c1af370bb0fbff4664" - integrity sha512-rKJ+rKBoXwLnIn7n6o6fulViHMrOThz99ybH+hKHcOZbnN14VuMnH9fo2eHE69C8pO4uX1Q7t2HYYIDmv8VYkg== +"@babel/plugin-proposal-json-strings@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.18.6.tgz#7e8788c1811c393aff762817e7dbf1ebd0c05f0b" + integrity sha512-lr1peyn9kOdbYc0xr0OdHTZ5FMqS6Di+H0Fz2I/JwMzGmzJETNeOFq2pBySw6X/KFL5EWDjlJuMsUGRFb8fQgQ== dependencies: - "@babel/helper-plugin-utils" "^7.17.12" + "@babel/helper-plugin-utils" "^7.18.6" "@babel/plugin-syntax-json-strings" "^7.8.3" -"@babel/plugin-proposal-logical-assignment-operators@^7.17.12": - version "7.17.12" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-logical-assignment-operators/-/plugin-proposal-logical-assignment-operators-7.17.12.tgz#c64a1bcb2b0a6d0ed2ff674fd120f90ee4b88a23" - integrity sha512-EqFo2s1Z5yy+JeJu7SFfbIUtToJTVlC61/C7WLKDntSw4Sz6JNAIfL7zQ74VvirxpjB5kz/kIx0gCcb+5OEo2Q== +"@babel/plugin-proposal-logical-assignment-operators@^7.18.9": + version "7.18.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-logical-assignment-operators/-/plugin-proposal-logical-assignment-operators-7.18.9.tgz#8148cbb350483bf6220af06fa6db3690e14b2e23" + integrity sha512-128YbMpjCrP35IOExw2Fq+x55LMP42DzhOhX2aNNIdI9avSWl2PI0yuBWarr3RYpZBSPtabfadkH2yeRiMD61Q== dependencies: - "@babel/helper-plugin-utils" "^7.17.12" + "@babel/helper-plugin-utils" "^7.18.9" "@babel/plugin-syntax-logical-assignment-operators" "^7.10.4" -"@babel/plugin-proposal-nullish-coalescing-operator@^7.17.12": - version "7.17.12" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.17.12.tgz#1e93079bbc2cbc756f6db6a1925157c4a92b94be" - integrity sha512-ws/g3FSGVzv+VH86+QvgtuJL/kR67xaEIF2x0iPqdDfYW6ra6JF3lKVBkWynRLcNtIC1oCTfDRVxmm2mKzy+ag== +"@babel/plugin-proposal-nullish-coalescing-operator@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.18.6.tgz#fdd940a99a740e577d6c753ab6fbb43fdb9467e1" + integrity sha512-wQxQzxYeJqHcfppzBDnm1yAY0jSRkUXR2z8RePZYrKwMKgMlE8+Z6LUno+bd6LvbGh8Gltvy74+9pIYkr+XkKA== dependencies: - "@babel/helper-plugin-utils" "^7.17.12" + "@babel/helper-plugin-utils" "^7.18.6" "@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.3" -"@babel/plugin-proposal-numeric-separator@^7.16.7": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.16.7.tgz#d6b69f4af63fb38b6ca2558442a7fb191236eba9" - integrity sha512-vQgPMknOIgiuVqbokToyXbkY/OmmjAzr/0lhSIbG/KmnzXPGwW/AdhdKpi+O4X/VkWiWjnkKOBiqJrTaC98VKw== +"@babel/plugin-proposal-numeric-separator@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.18.6.tgz#899b14fbafe87f053d2c5ff05b36029c62e13c75" + integrity sha512-ozlZFogPqoLm8WBr5Z8UckIoE4YQ5KESVcNudyXOR8uqIkliTEgJ3RoketfG6pmzLdeZF0H/wjE9/cCEitBl7Q== dependencies: - "@babel/helper-plugin-utils" "^7.16.7" + "@babel/helper-plugin-utils" "^7.18.6" "@babel/plugin-syntax-numeric-separator" "^7.10.4" "@babel/plugin-proposal-object-rest-spread@7.12.1": @@ -518,59 +546,59 @@ "@babel/plugin-syntax-object-rest-spread" "^7.8.0" "@babel/plugin-transform-parameters" "^7.12.1" -"@babel/plugin-proposal-object-rest-spread@^7.18.0": - version "7.18.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.18.0.tgz#79f2390c892ba2a68ec112eb0d895cfbd11155e8" - integrity sha512-nbTv371eTrFabDfHLElkn9oyf9VG+VKK6WMzhY2o4eHKaG19BToD9947zzGMO6I/Irstx9d8CwX6njPNIAR/yw== +"@babel/plugin-proposal-object-rest-spread@^7.18.9": + version "7.18.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.18.9.tgz#f9434f6beb2c8cae9dfcf97d2a5941bbbf9ad4e7" + integrity sha512-kDDHQ5rflIeY5xl69CEqGEZ0KY369ehsCIEbTGb4siHG5BE9sga/T0r0OUwyZNLMmZE79E1kbsqAjwFCW4ds6Q== dependencies: - "@babel/compat-data" "^7.17.10" - "@babel/helper-compilation-targets" "^7.17.10" - "@babel/helper-plugin-utils" "^7.17.12" + "@babel/compat-data" "^7.18.8" + "@babel/helper-compilation-targets" "^7.18.9" + "@babel/helper-plugin-utils" "^7.18.9" "@babel/plugin-syntax-object-rest-spread" "^7.8.3" - "@babel/plugin-transform-parameters" "^7.17.12" + "@babel/plugin-transform-parameters" "^7.18.8" -"@babel/plugin-proposal-optional-catch-binding@^7.16.7": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.16.7.tgz#c623a430674ffc4ab732fd0a0ae7722b67cb74cf" - integrity sha512-eMOH/L4OvWSZAE1VkHbr1vckLG1WUcHGJSLqqQwl2GaUqG6QjddvrOaTUMNYiv77H5IKPMZ9U9P7EaHwvAShfA== +"@babel/plugin-proposal-optional-catch-binding@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.18.6.tgz#f9400d0e6a3ea93ba9ef70b09e72dd6da638a2cb" + integrity sha512-Q40HEhs9DJQyaZfUjjn6vE8Cv4GmMHCYuMGIWUnlxH6400VGxOuwWsPt4FxXxJkC/5eOzgn0z21M9gMT4MOhbw== dependencies: - "@babel/helper-plugin-utils" "^7.16.7" + "@babel/helper-plugin-utils" "^7.18.6" "@babel/plugin-syntax-optional-catch-binding" "^7.8.3" -"@babel/plugin-proposal-optional-chaining@^7.17.12": - version "7.17.12" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.17.12.tgz#f96949e9bacace3a9066323a5cf90cfb9de67174" - integrity sha512-7wigcOs/Z4YWlK7xxjkvaIw84vGhDv/P1dFGQap0nHkc8gFKY/r+hXc8Qzf5k1gY7CvGIcHqAnOagVKJJ1wVOQ== +"@babel/plugin-proposal-optional-chaining@^7.18.9": + version "7.18.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.18.9.tgz#e8e8fe0723f2563960e4bf5e9690933691915993" + integrity sha512-v5nwt4IqBXihxGsW2QmCWMDS3B3bzGIk/EQVZz2ei7f3NJl8NzAJVvUmpDW5q1CRNY+Beb/k58UAH1Km1N411w== dependencies: - "@babel/helper-plugin-utils" "^7.17.12" - "@babel/helper-skip-transparent-expression-wrappers" "^7.16.0" + "@babel/helper-plugin-utils" "^7.18.9" + "@babel/helper-skip-transparent-expression-wrappers" "^7.18.9" "@babel/plugin-syntax-optional-chaining" "^7.8.3" -"@babel/plugin-proposal-private-methods@^7.17.12": - version "7.17.12" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-private-methods/-/plugin-proposal-private-methods-7.17.12.tgz#c2ca3a80beb7539289938da005ad525a038a819c" - integrity sha512-SllXoxo19HmxhDWm3luPz+cPhtoTSKLJE9PXshsfrOzBqs60QP0r8OaJItrPhAj0d7mZMnNF0Y1UUggCDgMz1A== +"@babel/plugin-proposal-private-methods@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-private-methods/-/plugin-proposal-private-methods-7.18.6.tgz#5209de7d213457548a98436fa2882f52f4be6bea" + integrity sha512-nutsvktDItsNn4rpGItSNV2sz1XwS+nfU0Rg8aCx3W3NOKVzdMjJRu0O5OkgDp3ZGICSTbgRpxZoWsxoKRvbeA== dependencies: - "@babel/helper-create-class-features-plugin" "^7.17.12" - "@babel/helper-plugin-utils" "^7.17.12" + "@babel/helper-create-class-features-plugin" "^7.18.6" + "@babel/helper-plugin-utils" "^7.18.6" -"@babel/plugin-proposal-private-property-in-object@^7.17.12": - version "7.17.12" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.17.12.tgz#b02efb7f106d544667d91ae97405a9fd8c93952d" - integrity sha512-/6BtVi57CJfrtDNKfK5b66ydK2J5pXUKBKSPD2G1whamMuEnZWgoOIfO8Vf9F/DoD4izBLD/Au4NMQfruzzykg== +"@babel/plugin-proposal-private-property-in-object@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.18.6.tgz#a64137b232f0aca3733a67eb1a144c192389c503" + integrity sha512-9Rysx7FOctvT5ouj5JODjAFAkgGoudQuLPamZb0v1TGLpapdNaftzifU8NTWQm0IRjqoYypdrSmyWgkocDQ8Dw== dependencies: - "@babel/helper-annotate-as-pure" "^7.16.7" - "@babel/helper-create-class-features-plugin" "^7.17.12" - "@babel/helper-plugin-utils" "^7.17.12" + "@babel/helper-annotate-as-pure" "^7.18.6" + "@babel/helper-create-class-features-plugin" "^7.18.6" + "@babel/helper-plugin-utils" "^7.18.6" "@babel/plugin-syntax-private-property-in-object" "^7.14.5" -"@babel/plugin-proposal-unicode-property-regex@^7.17.12", "@babel/plugin-proposal-unicode-property-regex@^7.4.4": - version "7.17.12" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.17.12.tgz#3dbd7a67bd7f94c8238b394da112d86aaf32ad4d" - integrity sha512-Wb9qLjXf3ZazqXA7IvI7ozqRIXIGPtSo+L5coFmEkhTQK18ao4UDDD0zdTGAarmbLj2urpRwrc6893cu5Bfh0A== +"@babel/plugin-proposal-unicode-property-regex@^7.18.6", "@babel/plugin-proposal-unicode-property-regex@^7.4.4": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.18.6.tgz#af613d2cd5e643643b65cded64207b15c85cb78e" + integrity sha512-2BShG/d5yoZyXZfVePH91urL5wTG6ASZU9M4o03lKK8u8UW1y08OMttBSOADTcJrnPMpvDXRG3G8fyLh4ovs8w== dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.17.12" - "@babel/helper-plugin-utils" "^7.17.12" + "@babel/helper-create-regexp-features-plugin" "^7.18.6" + "@babel/helper-plugin-utils" "^7.18.6" "@babel/plugin-syntax-async-generators@^7.8.4": version "7.8.4" @@ -614,12 +642,12 @@ dependencies: "@babel/helper-plugin-utils" "^7.8.3" -"@babel/plugin-syntax-import-assertions@^7.17.12": - version "7.17.12" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-import-assertions/-/plugin-syntax-import-assertions-7.17.12.tgz#58096a92b11b2e4e54b24c6a0cc0e5e607abcedd" - integrity sha512-n/loy2zkq9ZEM8tEOwON9wTQSTNDTDEz6NujPtJGLU7qObzT1N4c4YZZf8E6ATB2AjNQg/Ib2AIpO03EZaCehw== +"@babel/plugin-syntax-import-assertions@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-import-assertions/-/plugin-syntax-import-assertions-7.18.6.tgz#cd6190500a4fa2fe31990a963ffab4b63e4505e4" + integrity sha512-/DU3RXad9+bZwrgWJQKbr39gYbJpLJHezqEzRzi/BHRlJ9zsQb4CK2CA/5apllXNomwA1qHwzvHl+AdEmC5krQ== dependencies: - "@babel/helper-plugin-utils" "^7.17.12" + "@babel/helper-plugin-utils" "^7.18.6" "@babel/plugin-syntax-import-meta@^7.8.3": version "7.10.4" @@ -642,12 +670,12 @@ dependencies: "@babel/helper-plugin-utils" "^7.10.4" -"@babel/plugin-syntax-jsx@^7.17.12": - version "7.17.12" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.17.12.tgz#834035b45061983a491f60096f61a2e7c5674a47" - integrity sha512-spyY3E3AURfxh/RHtjx5j6hs8am5NbUBGfcZ2vB3uShSpZdQyXSf5rR5Mk76vbtlAZOelyVQ71Fg0x9SG4fsog== +"@babel/plugin-syntax-jsx@^7.18.6", "@babel/plugin-syntax-jsx@^7.7.2": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.18.6.tgz#a8feef63b010150abd97f1649ec296e849943ca0" + integrity sha512-6mmljtAedFGTWu2p/8WIORGwy+61PLgOMPOdazc7YoJ9ZCWUyFy3A6CpPkRKLKD1ToAesxX8KGEViAiLo9N+7Q== dependencies: - "@babel/helper-plugin-utils" "^7.17.12" + "@babel/helper-plugin-utils" "^7.18.6" "@babel/plugin-syntax-logical-assignment-operators@^7.10.4", "@babel/plugin-syntax-logical-assignment-operators@^7.8.3": version "7.10.4" @@ -705,198 +733,199 @@ dependencies: "@babel/helper-plugin-utils" "^7.14.5" -"@babel/plugin-syntax-typescript@^7.17.12", "@babel/plugin-syntax-typescript@^7.7.2": - version "7.17.12" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.17.12.tgz#b54fc3be6de734a56b87508f99d6428b5b605a7b" - integrity sha512-TYY0SXFiO31YXtNg3HtFwNJHjLsAyIIhAhNWkQ5whPPS7HWUFlg9z0Ta4qAQNjQbP1wsSt/oKkmZ/4/WWdMUpw== - dependencies: - "@babel/helper-plugin-utils" "^7.17.12" - -"@babel/plugin-transform-arrow-functions@^7.17.12": - version "7.17.12" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.17.12.tgz#dddd783b473b1b1537ef46423e3944ff24898c45" - integrity sha512-PHln3CNi/49V+mza4xMwrg+WGYevSF1oaiXaC2EQfdp4HWlSjRsrDXWJiQBKpP7749u6vQ9mcry2uuFOv5CXvA== - dependencies: - "@babel/helper-plugin-utils" "^7.17.12" - -"@babel/plugin-transform-async-to-generator@^7.17.12": - version "7.17.12" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.17.12.tgz#dbe5511e6b01eee1496c944e35cdfe3f58050832" - integrity sha512-J8dbrWIOO3orDzir57NRsjg4uxucvhby0L/KZuGsWDj0g7twWK3g7JhJhOrXtuXiw8MeiSdJ3E0OW9H8LYEzLQ== +"@babel/plugin-syntax-typescript@^7.18.6", "@babel/plugin-syntax-typescript@^7.7.2": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.18.6.tgz#1c09cd25795c7c2b8a4ba9ae49394576d4133285" + integrity sha512-mAWAuq4rvOepWCBid55JuRNvpTNf2UGVgoz4JV0fXEKolsVZDzsa4NqCef758WZJj/GDu0gVGItjKFiClTAmZA== dependencies: - "@babel/helper-module-imports" "^7.16.7" - "@babel/helper-plugin-utils" "^7.17.12" - "@babel/helper-remap-async-to-generator" "^7.16.8" + "@babel/helper-plugin-utils" "^7.18.6" -"@babel/plugin-transform-block-scoped-functions@^7.16.7": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.16.7.tgz#4d0d57d9632ef6062cdf354bb717102ee042a620" - integrity sha512-JUuzlzmF40Z9cXyytcbZEZKckgrQzChbQJw/5PuEHYeqzCsvebDx0K0jWnIIVcmmDOAVctCgnYs0pMcrYj2zJg== +"@babel/plugin-transform-arrow-functions@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.18.6.tgz#19063fcf8771ec7b31d742339dac62433d0611fe" + integrity sha512-9S9X9RUefzrsHZmKMbDXxweEH+YlE8JJEuat9FdvW9Qh1cw7W64jELCtWNkPBPX5En45uy28KGvA/AySqUh8CQ== dependencies: - "@babel/helper-plugin-utils" "^7.16.7" + "@babel/helper-plugin-utils" "^7.18.6" -"@babel/plugin-transform-block-scoping@^7.17.12": - version "7.17.12" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.17.12.tgz#68fc3c4b3bb7dfd809d97b7ed19a584052a2725c" - integrity sha512-jw8XW/B1i7Lqwqj2CbrViPcZijSxfguBWZP2aN59NHgxUyO/OcO1mfdCxH13QhN5LbWhPkX+f+brKGhZTiqtZQ== +"@babel/plugin-transform-async-to-generator@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.18.6.tgz#ccda3d1ab9d5ced5265fdb13f1882d5476c71615" + integrity sha512-ARE5wZLKnTgPW7/1ftQmSi1CmkqqHo2DNmtztFhvgtOWSDfq0Cq9/9L+KnZNYSNrydBekhW3rwShduf59RoXag== dependencies: - "@babel/helper-plugin-utils" "^7.17.12" + "@babel/helper-module-imports" "^7.18.6" + "@babel/helper-plugin-utils" "^7.18.6" + "@babel/helper-remap-async-to-generator" "^7.18.6" -"@babel/plugin-transform-classes@^7.17.12": - version "7.17.12" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.17.12.tgz#da889e89a4d38375eeb24985218edeab93af4f29" - integrity sha512-cvO7lc7pZat6BsvH6l/EGaI8zpl8paICaoGk+7x7guvtfak/TbIf66nYmJOH13EuG0H+Xx3M+9LQDtSvZFKXKw== - dependencies: - "@babel/helper-annotate-as-pure" "^7.16.7" - "@babel/helper-environment-visitor" "^7.16.7" - "@babel/helper-function-name" "^7.17.9" - "@babel/helper-optimise-call-expression" "^7.16.7" - "@babel/helper-plugin-utils" "^7.17.12" - "@babel/helper-replace-supers" "^7.16.7" - "@babel/helper-split-export-declaration" "^7.16.7" +"@babel/plugin-transform-block-scoped-functions@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.18.6.tgz#9187bf4ba302635b9d70d986ad70f038726216a8" + integrity sha512-ExUcOqpPWnliRcPqves5HJcJOvHvIIWfuS4sroBUenPuMdmW+SMHDakmtS7qOo13sVppmUijqeTv7qqGsvURpQ== + dependencies: + "@babel/helper-plugin-utils" "^7.18.6" + +"@babel/plugin-transform-block-scoping@^7.18.9": + version "7.18.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.18.9.tgz#f9b7e018ac3f373c81452d6ada8bd5a18928926d" + integrity sha512-5sDIJRV1KtQVEbt/EIBwGy4T01uYIo4KRB3VUqzkhrAIOGx7AoctL9+Ux88btY0zXdDyPJ9mW+bg+v+XEkGmtw== + dependencies: + "@babel/helper-plugin-utils" "^7.18.9" + +"@babel/plugin-transform-classes@^7.19.0": + version "7.19.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.19.0.tgz#0e61ec257fba409c41372175e7c1e606dc79bb20" + integrity sha512-YfeEE9kCjqTS9IitkgfJuxjcEtLUHMqa8yUJ6zdz8vR7hKuo6mOy2C05P0F1tdMmDCeuyidKnlrw/iTppHcr2A== + dependencies: + "@babel/helper-annotate-as-pure" "^7.18.6" + "@babel/helper-compilation-targets" "^7.19.0" + "@babel/helper-environment-visitor" "^7.18.9" + "@babel/helper-function-name" "^7.19.0" + "@babel/helper-optimise-call-expression" "^7.18.6" + "@babel/helper-plugin-utils" "^7.19.0" + "@babel/helper-replace-supers" "^7.18.9" + "@babel/helper-split-export-declaration" "^7.18.6" globals "^11.1.0" -"@babel/plugin-transform-computed-properties@^7.17.12": - version "7.17.12" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.17.12.tgz#bca616a83679698f3258e892ed422546e531387f" - integrity sha512-a7XINeplB5cQUWMg1E/GI1tFz3LfK021IjV1rj1ypE+R7jHm+pIHmHl25VNkZxtx9uuYp7ThGk8fur1HHG7PgQ== +"@babel/plugin-transform-computed-properties@^7.18.9": + version "7.18.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.18.9.tgz#2357a8224d402dad623caf6259b611e56aec746e" + integrity sha512-+i0ZU1bCDymKakLxn5srGHrsAPRELC2WIbzwjLhHW9SIE1cPYkLCL0NlnXMZaM1vhfgA2+M7hySk42VBvrkBRw== dependencies: - "@babel/helper-plugin-utils" "^7.17.12" + "@babel/helper-plugin-utils" "^7.18.9" -"@babel/plugin-transform-destructuring@^7.18.0": - version "7.18.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.18.0.tgz#dc4f92587e291b4daa78aa20cc2d7a63aa11e858" - integrity sha512-Mo69klS79z6KEfrLg/1WkmVnB8javh75HX4pi2btjvlIoasuxilEyjtsQW6XPrubNd7AQy0MMaNIaQE4e7+PQw== +"@babel/plugin-transform-destructuring@^7.18.13": + version "7.18.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.18.13.tgz#9e03bc4a94475d62b7f4114938e6c5c33372cbf5" + integrity sha512-TodpQ29XekIsex2A+YJPj5ax2plkGa8YYY6mFjCohk/IG9IY42Rtuj1FuDeemfg2ipxIFLzPeA83SIBnlhSIow== dependencies: - "@babel/helper-plugin-utils" "^7.17.12" + "@babel/helper-plugin-utils" "^7.18.9" -"@babel/plugin-transform-dotall-regex@^7.16.7", "@babel/plugin-transform-dotall-regex@^7.4.4": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.16.7.tgz#6b2d67686fab15fb6a7fd4bd895d5982cfc81241" - integrity sha512-Lyttaao2SjZF6Pf4vk1dVKv8YypMpomAbygW+mU5cYP3S5cWTfCJjG8xV6CFdzGFlfWK81IjL9viiTvpb6G7gQ== +"@babel/plugin-transform-dotall-regex@^7.18.6", "@babel/plugin-transform-dotall-regex@^7.4.4": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.18.6.tgz#b286b3e7aae6c7b861e45bed0a2fafd6b1a4fef8" + integrity sha512-6S3jpun1eEbAxq7TdjLotAsl4WpQI9DxfkycRcKrjhQYzU87qpXdknpBg/e+TdcMehqGnLFi7tnFUBR02Vq6wg== dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.16.7" - "@babel/helper-plugin-utils" "^7.16.7" + "@babel/helper-create-regexp-features-plugin" "^7.18.6" + "@babel/helper-plugin-utils" "^7.18.6" -"@babel/plugin-transform-duplicate-keys@^7.17.12": - version "7.17.12" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.17.12.tgz#a09aa709a3310013f8e48e0e23bc7ace0f21477c" - integrity sha512-EA5eYFUG6xeerdabina/xIoB95jJ17mAkR8ivx6ZSu9frKShBjpOGZPn511MTDTkiCO+zXnzNczvUM69YSf3Zw== +"@babel/plugin-transform-duplicate-keys@^7.18.9": + version "7.18.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.18.9.tgz#687f15ee3cdad6d85191eb2a372c4528eaa0ae0e" + integrity sha512-d2bmXCtZXYc59/0SanQKbiWINadaJXqtvIQIzd4+hNwkWBgyCd5F/2t1kXoUdvPMrxzPvhK6EMQRROxsue+mfw== dependencies: - "@babel/helper-plugin-utils" "^7.17.12" + "@babel/helper-plugin-utils" "^7.18.9" -"@babel/plugin-transform-exponentiation-operator@^7.16.7": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.16.7.tgz#efa9862ef97e9e9e5f653f6ddc7b665e8536fe9b" - integrity sha512-8UYLSlyLgRixQvlYH3J2ekXFHDFLQutdy7FfFAMm3CPZ6q9wHCwnUyiXpQCe3gVVnQlHc5nsuiEVziteRNTXEA== +"@babel/plugin-transform-exponentiation-operator@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.18.6.tgz#421c705f4521888c65e91fdd1af951bfefd4dacd" + integrity sha512-wzEtc0+2c88FVR34aQmiz56dxEkxr2g8DQb/KfaFa1JYXOFVsbhvAonFN6PwVWj++fKmku8NP80plJ5Et4wqHw== dependencies: - "@babel/helper-builder-binary-assignment-operator-visitor" "^7.16.7" - "@babel/helper-plugin-utils" "^7.16.7" + "@babel/helper-builder-binary-assignment-operator-visitor" "^7.18.6" + "@babel/helper-plugin-utils" "^7.18.6" -"@babel/plugin-transform-for-of@^7.18.1": - version "7.18.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.18.1.tgz#ed14b657e162b72afbbb2b4cdad277bf2bb32036" - integrity sha512-+TTB5XwvJ5hZbO8xvl2H4XaMDOAK57zF4miuC9qQJgysPNEAZZ9Z69rdF5LJkozGdZrjBIUAIyKUWRMmebI7vg== +"@babel/plugin-transform-for-of@^7.18.8": + version "7.18.8" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.18.8.tgz#6ef8a50b244eb6a0bdbad0c7c61877e4e30097c1" + integrity sha512-yEfTRnjuskWYo0k1mHUqrVWaZwrdq8AYbfrpqULOJOaucGSp4mNMVps+YtA8byoevxS/urwU75vyhQIxcCgiBQ== dependencies: - "@babel/helper-plugin-utils" "^7.17.12" + "@babel/helper-plugin-utils" "^7.18.6" -"@babel/plugin-transform-function-name@^7.16.7": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.16.7.tgz#5ab34375c64d61d083d7d2f05c38d90b97ec65cf" - integrity sha512-SU/C68YVwTRxqWj5kgsbKINakGag0KTgq9f2iZEXdStoAbOzLHEBRYzImmA6yFo8YZhJVflvXmIHUO7GWHmxxA== +"@babel/plugin-transform-function-name@^7.18.9": + version "7.18.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.18.9.tgz#cc354f8234e62968946c61a46d6365440fc764e0" + integrity sha512-WvIBoRPaJQ5yVHzcnJFor7oS5Ls0PYixlTYE63lCj2RtdQEl15M68FXQlxnG6wdraJIXRdR7KI+hQ7q/9QjrCQ== dependencies: - "@babel/helper-compilation-targets" "^7.16.7" - "@babel/helper-function-name" "^7.16.7" - "@babel/helper-plugin-utils" "^7.16.7" + "@babel/helper-compilation-targets" "^7.18.9" + "@babel/helper-function-name" "^7.18.9" + "@babel/helper-plugin-utils" "^7.18.9" -"@babel/plugin-transform-literals@^7.17.12": - version "7.17.12" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-literals/-/plugin-transform-literals-7.17.12.tgz#97131fbc6bbb261487105b4b3edbf9ebf9c830ae" - integrity sha512-8iRkvaTjJciWycPIZ9k9duu663FT7VrBdNqNgxnVXEFwOIp55JWcZd23VBRySYbnS3PwQ3rGiabJBBBGj5APmQ== +"@babel/plugin-transform-literals@^7.18.9": + version "7.18.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-literals/-/plugin-transform-literals-7.18.9.tgz#72796fdbef80e56fba3c6a699d54f0de557444bc" + integrity sha512-IFQDSRoTPnrAIrI5zoZv73IFeZu2dhu6irxQjY9rNjTT53VmKg9fenjvoiOWOkJ6mm4jKVPtdMzBY98Fp4Z4cg== dependencies: - "@babel/helper-plugin-utils" "^7.17.12" + "@babel/helper-plugin-utils" "^7.18.9" -"@babel/plugin-transform-member-expression-literals@^7.16.7": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.16.7.tgz#6e5dcf906ef8a098e630149d14c867dd28f92384" - integrity sha512-mBruRMbktKQwbxaJof32LT9KLy2f3gH+27a5XSuXo6h7R3vqltl0PgZ80C8ZMKw98Bf8bqt6BEVi3svOh2PzMw== +"@babel/plugin-transform-member-expression-literals@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.18.6.tgz#ac9fdc1a118620ac49b7e7a5d2dc177a1bfee88e" + integrity sha512-qSF1ihLGO3q+/g48k85tUjD033C29TNTVB2paCwZPVmOsjn9pClvYYrM2VeJpBY2bcNkuny0YUyTNRyRxJ54KA== dependencies: - "@babel/helper-plugin-utils" "^7.16.7" + "@babel/helper-plugin-utils" "^7.18.6" -"@babel/plugin-transform-modules-amd@^7.18.0": - version "7.18.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.18.0.tgz#7ef1002e67e36da3155edc8bf1ac9398064c02ed" - integrity sha512-h8FjOlYmdZwl7Xm2Ug4iX2j7Qy63NANI+NQVWQzv6r25fqgg7k2dZl03p95kvqNclglHs4FZ+isv4p1uXMA+QA== +"@babel/plugin-transform-modules-amd@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.18.6.tgz#8c91f8c5115d2202f277549848874027d7172d21" + integrity sha512-Pra5aXsmTsOnjM3IajS8rTaLCy++nGM4v3YR4esk5PCsyg9z8NA5oQLwxzMUtDBd8F+UmVza3VxoAaWCbzH1rg== dependencies: - "@babel/helper-module-transforms" "^7.18.0" - "@babel/helper-plugin-utils" "^7.17.12" + "@babel/helper-module-transforms" "^7.18.6" + "@babel/helper-plugin-utils" "^7.18.6" babel-plugin-dynamic-import-node "^2.3.3" -"@babel/plugin-transform-modules-commonjs@^7.18.2": - version "7.18.2" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.18.2.tgz#1aa8efa2e2a6e818b6a7f2235fceaf09bdb31e9e" - integrity sha512-f5A865gFPAJAEE0K7F/+nm5CmAE3y8AWlMBG9unu5j9+tk50UQVK0QS8RNxSp7MJf0wh97uYyLWt3Zvu71zyOQ== +"@babel/plugin-transform-modules-commonjs@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.18.6.tgz#afd243afba166cca69892e24a8fd8c9f2ca87883" + integrity sha512-Qfv2ZOWikpvmedXQJDSbxNqy7Xr/j2Y8/KfijM0iJyKkBTmWuvCA1yeH1yDM7NJhBW/2aXxeucLj6i80/LAJ/Q== dependencies: - "@babel/helper-module-transforms" "^7.18.0" - "@babel/helper-plugin-utils" "^7.17.12" - "@babel/helper-simple-access" "^7.18.2" + "@babel/helper-module-transforms" "^7.18.6" + "@babel/helper-plugin-utils" "^7.18.6" + "@babel/helper-simple-access" "^7.18.6" babel-plugin-dynamic-import-node "^2.3.3" -"@babel/plugin-transform-modules-systemjs@^7.18.0": - version "7.18.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.18.0.tgz#50ecdb43de97c8483824402f7125edb94cddb09a" - integrity sha512-vwKpxdHnlM5tIrRt/eA0bzfbi7gUBLN08vLu38np1nZevlPySRe6yvuATJB5F/WPJ+ur4OXwpVYq9+BsxqAQuQ== +"@babel/plugin-transform-modules-systemjs@^7.19.0": + version "7.19.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.19.0.tgz#5f20b471284430f02d9c5059d9b9a16d4b085a1f" + integrity sha512-x9aiR0WXAWmOWsqcsnrzGR+ieaTMVyGyffPVA7F8cXAGt/UxefYv6uSHZLkAFChN5M5Iy1+wjE+xJuPt22H39A== dependencies: - "@babel/helper-hoist-variables" "^7.16.7" - "@babel/helper-module-transforms" "^7.18.0" - "@babel/helper-plugin-utils" "^7.17.12" - "@babel/helper-validator-identifier" "^7.16.7" + "@babel/helper-hoist-variables" "^7.18.6" + "@babel/helper-module-transforms" "^7.19.0" + "@babel/helper-plugin-utils" "^7.19.0" + "@babel/helper-validator-identifier" "^7.18.6" babel-plugin-dynamic-import-node "^2.3.3" -"@babel/plugin-transform-modules-umd@^7.18.0": - version "7.18.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.18.0.tgz#56aac64a2c2a1922341129a4597d1fd5c3ff020f" - integrity sha512-d/zZ8I3BWli1tmROLxXLc9A6YXvGK8egMxHp+E/rRwMh1Kip0AP77VwZae3snEJ33iiWwvNv2+UIIhfalqhzZA== +"@babel/plugin-transform-modules-umd@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.18.6.tgz#81d3832d6034b75b54e62821ba58f28ed0aab4b9" + integrity sha512-dcegErExVeXcRqNtkRU/z8WlBLnvD4MRnHgNs3MytRO1Mn1sHRyhbcpYbVMGclAqOjdW+9cfkdZno9dFdfKLfQ== dependencies: - "@babel/helper-module-transforms" "^7.18.0" - "@babel/helper-plugin-utils" "^7.17.12" + "@babel/helper-module-transforms" "^7.18.6" + "@babel/helper-plugin-utils" "^7.18.6" -"@babel/plugin-transform-named-capturing-groups-regex@^7.17.12": - version "7.17.12" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.17.12.tgz#9c4a5a5966e0434d515f2675c227fd8cc8606931" - integrity sha512-vWoWFM5CKaTeHrdUJ/3SIOTRV+MBVGybOC9mhJkaprGNt5demMymDW24yC74avb915/mIRe3TgNb/d8idvnCRA== +"@babel/plugin-transform-named-capturing-groups-regex@^7.19.1": + version "7.19.1" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.19.1.tgz#ec7455bab6cd8fb05c525a94876f435a48128888" + integrity sha512-oWk9l9WItWBQYS4FgXD4Uyy5kq898lvkXpXQxoJEY1RnvPk4R/Dvu2ebXU9q8lP+rlMwUQTFf2Ok6d78ODa0kw== dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.17.12" - "@babel/helper-plugin-utils" "^7.17.12" + "@babel/helper-create-regexp-features-plugin" "^7.19.0" + "@babel/helper-plugin-utils" "^7.19.0" -"@babel/plugin-transform-new-target@^7.17.12": - version "7.17.12" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.17.12.tgz#10842cd605a620944e81ea6060e9e65c265742e3" - integrity sha512-CaOtzk2fDYisbjAD4Sd1MTKGVIpRtx9bWLyj24Y/k6p4s4gQ3CqDGJauFJxt8M/LEx003d0i3klVqnN73qvK3w== +"@babel/plugin-transform-new-target@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.18.6.tgz#d128f376ae200477f37c4ddfcc722a8a1b3246a8" + integrity sha512-DjwFA/9Iu3Z+vrAn+8pBUGcjhxKguSMlsFqeCKbhb9BAV756v0krzVK04CRDi/4aqmk8BsHb4a/gFcaA5joXRw== dependencies: - "@babel/helper-plugin-utils" "^7.17.12" + "@babel/helper-plugin-utils" "^7.18.6" -"@babel/plugin-transform-object-super@^7.16.7": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.16.7.tgz#ac359cf8d32cf4354d27a46867999490b6c32a94" - integrity sha512-14J1feiQVWaGvRxj2WjyMuXS2jsBkgB3MdSN5HuC2G5nRspa5RK9COcs82Pwy5BuGcjb+fYaUj94mYcOj7rCvw== +"@babel/plugin-transform-object-super@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.18.6.tgz#fb3c6ccdd15939b6ff7939944b51971ddc35912c" + integrity sha512-uvGz6zk+pZoS1aTZrOvrbj6Pp/kK2mp45t2B+bTDre2UgsZZ8EZLSJtUg7m/no0zOJUWgFONpB7Zv9W2tSaFlA== dependencies: - "@babel/helper-plugin-utils" "^7.16.7" - "@babel/helper-replace-supers" "^7.16.7" + "@babel/helper-plugin-utils" "^7.18.6" + "@babel/helper-replace-supers" "^7.18.6" -"@babel/plugin-transform-parameters@^7.12.1", "@babel/plugin-transform-parameters@^7.17.12": - version "7.17.12" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.17.12.tgz#eb467cd9586ff5ff115a9880d6fdbd4a846b7766" - integrity sha512-6qW4rWo1cyCdq1FkYri7AHpauchbGLXpdwnYsfxFb+KtddHENfsY5JZb35xUwkK5opOLcJ3BNd2l7PhRYGlwIA== +"@babel/plugin-transform-parameters@^7.12.1", "@babel/plugin-transform-parameters@^7.18.8": + version "7.18.8" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.18.8.tgz#ee9f1a0ce6d78af58d0956a9378ea3427cccb48a" + integrity sha512-ivfbE3X2Ss+Fj8nnXvKJS6sjRG4gzwPMsP+taZC+ZzEGjAYlvENixmt1sZ5Ca6tWls+BlKSGKPJ6OOXvXCbkFg== dependencies: - "@babel/helper-plugin-utils" "^7.17.12" + "@babel/helper-plugin-utils" "^7.18.6" -"@babel/plugin-transform-property-literals@^7.16.7": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.16.7.tgz#2dadac85155436f22c696c4827730e0fe1057a55" - integrity sha512-z4FGr9NMGdoIl1RqavCqGG+ZuYjfZ/hkCIeuH6Do7tXmSm0ls11nYVSJqFEUOSJbDab5wC6lRE/w6YjVcr6Hqw== +"@babel/plugin-transform-property-literals@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.18.6.tgz#e22498903a483448e94e032e9bbb9c5ccbfc93a3" + integrity sha512-cYcs6qlgafTud3PAzrrRNbQtfpQ8+y/+M5tKmksS9+M1ckbH6kzY8MrexEM9mcA6JDsukE19iIRvAyYl463sMg== dependencies: - "@babel/helper-plugin-utils" "^7.16.7" + "@babel/helper-plugin-utils" "^7.18.6" "@babel/plugin-transform-react-constant-elements@^7.14.5": version "7.17.12" @@ -905,158 +934,158 @@ dependencies: "@babel/helper-plugin-utils" "^7.17.12" -"@babel/plugin-transform-react-display-name@^7.16.7": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-display-name/-/plugin-transform-react-display-name-7.16.7.tgz#7b6d40d232f4c0f550ea348593db3b21e2404340" - integrity sha512-qgIg8BcZgd0G/Cz916D5+9kqX0c7nPZyXaP8R2tLNN5tkyIZdG5fEwBrxwplzSnjC1jvQmyMNVwUCZPcbGY7Pg== +"@babel/plugin-transform-react-display-name@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-display-name/-/plugin-transform-react-display-name-7.18.6.tgz#8b1125f919ef36ebdfff061d664e266c666b9415" + integrity sha512-TV4sQ+T013n61uMoygyMRm+xf04Bd5oqFpv2jAEQwSZ8NwQA7zeRPg1LMVg2PWi3zWBz+CLKD+v5bcpZ/BS0aA== dependencies: - "@babel/helper-plugin-utils" "^7.16.7" + "@babel/helper-plugin-utils" "^7.18.6" -"@babel/plugin-transform-react-jsx-development@^7.16.7": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-jsx-development/-/plugin-transform-react-jsx-development-7.16.7.tgz#43a00724a3ed2557ed3f276a01a929e6686ac7b8" - integrity sha512-RMvQWvpla+xy6MlBpPlrKZCMRs2AGiHOGHY3xRwl0pEeim348dDyxeH4xBsMPbIMhujeq7ihE702eM2Ew0Wo+A== +"@babel/plugin-transform-react-jsx-development@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-jsx-development/-/plugin-transform-react-jsx-development-7.18.6.tgz#dbe5c972811e49c7405b630e4d0d2e1380c0ddc5" + integrity sha512-SA6HEjwYFKF7WDjWcMcMGUimmw/nhNRDWxr+KaLSCrkD/LMDBvWRmHAYgE1HDeF8KUuI8OAu+RT6EOtKxSW2qA== dependencies: - "@babel/plugin-transform-react-jsx" "^7.16.7" + "@babel/plugin-transform-react-jsx" "^7.18.6" -"@babel/plugin-transform-react-jsx@^7.16.7", "@babel/plugin-transform-react-jsx@^7.17.12": - version "7.17.12" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-jsx/-/plugin-transform-react-jsx-7.17.12.tgz#2aa20022709cd6a3f40b45d60603d5f269586dba" - integrity sha512-Lcaw8bxd1DKht3thfD4A12dqo1X16he1Lm8rIv8sTwjAYNInRS1qHa9aJoqvzpscItXvftKDCfaEQzwoVyXpEQ== +"@babel/plugin-transform-react-jsx@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-jsx/-/plugin-transform-react-jsx-7.18.6.tgz#2721e96d31df96e3b7ad48ff446995d26bc028ff" + integrity sha512-Mz7xMPxoy9kPS/JScj6fJs03TZ/fZ1dJPlMjRAgTaxaS0fUBk8FV/A2rRgfPsVCZqALNwMexD+0Uaf5zlcKPpw== dependencies: - "@babel/helper-annotate-as-pure" "^7.16.7" - "@babel/helper-module-imports" "^7.16.7" - "@babel/helper-plugin-utils" "^7.17.12" - "@babel/plugin-syntax-jsx" "^7.17.12" - "@babel/types" "^7.17.12" + "@babel/helper-annotate-as-pure" "^7.18.6" + "@babel/helper-module-imports" "^7.18.6" + "@babel/helper-plugin-utils" "^7.18.6" + "@babel/plugin-syntax-jsx" "^7.18.6" + "@babel/types" "^7.18.6" -"@babel/plugin-transform-react-pure-annotations@^7.16.7": - version "7.18.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-pure-annotations/-/plugin-transform-react-pure-annotations-7.18.0.tgz#ef82c8e310913f3522462c9ac967d395092f1954" - integrity sha512-6+0IK6ouvqDn9bmEG7mEyF/pwlJXVj5lwydybpyyH3D0A7Hftk+NCTdYjnLNZksn261xaOV5ksmp20pQEmc2RQ== +"@babel/plugin-transform-react-pure-annotations@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-pure-annotations/-/plugin-transform-react-pure-annotations-7.18.6.tgz#561af267f19f3e5d59291f9950fd7b9663d0d844" + integrity sha512-I8VfEPg9r2TRDdvnHgPepTKvuRomzA8+u+nhY7qSI1fR2hRNebasZEETLyM5mAUr0Ku56OkXJ0I7NHJnO6cJiQ== dependencies: - "@babel/helper-annotate-as-pure" "^7.16.7" - "@babel/helper-plugin-utils" "^7.17.12" + "@babel/helper-annotate-as-pure" "^7.18.6" + "@babel/helper-plugin-utils" "^7.18.6" -"@babel/plugin-transform-regenerator@^7.18.0": - version "7.18.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.18.0.tgz#44274d655eb3f1af3f3a574ba819d3f48caf99d5" - integrity sha512-C8YdRw9uzx25HSIzwA7EM7YP0FhCe5wNvJbZzjVNHHPGVcDJ3Aie+qGYYdS1oVQgn+B3eAIJbWFLrJ4Jipv7nw== +"@babel/plugin-transform-regenerator@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.18.6.tgz#585c66cb84d4b4bf72519a34cfce761b8676ca73" + integrity sha512-poqRI2+qiSdeldcz4wTSTXBRryoq3Gc70ye7m7UD5Ww0nE29IXqMl6r7Nd15WBgRd74vloEMlShtH6CKxVzfmQ== dependencies: - "@babel/helper-plugin-utils" "^7.17.12" + "@babel/helper-plugin-utils" "^7.18.6" regenerator-transform "^0.15.0" -"@babel/plugin-transform-reserved-words@^7.17.12": - version "7.17.12" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.17.12.tgz#7dbd349f3cdffba751e817cf40ca1386732f652f" - integrity sha512-1KYqwbJV3Co03NIi14uEHW8P50Md6KqFgt0FfpHdK6oyAHQVTosgPuPSiWud1HX0oYJ1hGRRlk0fP87jFpqXZA== +"@babel/plugin-transform-reserved-words@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.18.6.tgz#b1abd8ebf8edaa5f7fe6bbb8d2133d23b6a6f76a" + integrity sha512-oX/4MyMoypzHjFrT1CdivfKZ+XvIPMFXwwxHp/r0Ddy2Vuomt4HDFGmft1TAY2yiTKiNSsh3kjBAzcM8kSdsjA== dependencies: - "@babel/helper-plugin-utils" "^7.17.12" + "@babel/helper-plugin-utils" "^7.18.6" -"@babel/plugin-transform-runtime@^7.18.2": - version "7.18.2" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.18.2.tgz#04637de1e45ae8847ff14b9beead09c33d34374d" - integrity sha512-mr1ufuRMfS52ttq+1G1PD8OJNqgcTFjq3hwn8SZ5n1x1pBhi0E36rYMdTK0TsKtApJ4lDEdfXJwtGobQMHSMPg== +"@babel/plugin-transform-runtime@^7.18.6": + version "7.18.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.18.9.tgz#d9e4b1b25719307bfafbf43065ed7fb3a83adb8f" + integrity sha512-wS8uJwBt7/b/mzE13ktsJdmS4JP/j7PQSaADtnb4I2wL0zK51MQ0pmF8/Jy0wUIS96fr+fXT6S/ifiPXnvrlSg== dependencies: - "@babel/helper-module-imports" "^7.16.7" - "@babel/helper-plugin-utils" "^7.17.12" - babel-plugin-polyfill-corejs2 "^0.3.0" - babel-plugin-polyfill-corejs3 "^0.5.0" - babel-plugin-polyfill-regenerator "^0.3.0" + "@babel/helper-module-imports" "^7.18.6" + "@babel/helper-plugin-utils" "^7.18.9" + babel-plugin-polyfill-corejs2 "^0.3.1" + babel-plugin-polyfill-corejs3 "^0.5.2" + babel-plugin-polyfill-regenerator "^0.3.1" semver "^6.3.0" -"@babel/plugin-transform-shorthand-properties@^7.16.7": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.16.7.tgz#e8549ae4afcf8382f711794c0c7b6b934c5fbd2a" - integrity sha512-hah2+FEnoRoATdIb05IOXf+4GzXYTq75TVhIn1PewihbpyrNWUt2JbudKQOETWw6QpLe+AIUpJ5MVLYTQbeeUg== - dependencies: - "@babel/helper-plugin-utils" "^7.16.7" - -"@babel/plugin-transform-spread@^7.17.12": - version "7.17.12" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-spread/-/plugin-transform-spread-7.17.12.tgz#c112cad3064299f03ea32afed1d659223935d1f5" - integrity sha512-9pgmuQAtFi3lpNUstvG9nGfk9DkrdmWNp9KeKPFmuZCpEnxRzYlS8JgwPjYj+1AWDOSvoGN0H30p1cBOmT/Svg== +"@babel/plugin-transform-shorthand-properties@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.18.6.tgz#6d6df7983d67b195289be24909e3f12a8f664dc9" + integrity sha512-eCLXXJqv8okzg86ywZJbRn19YJHU4XUa55oz2wbHhaQVn/MM+XhukiT7SYqp/7o00dg52Rj51Ny+Ecw4oyoygw== dependencies: - "@babel/helper-plugin-utils" "^7.17.12" - "@babel/helper-skip-transparent-expression-wrappers" "^7.16.0" + "@babel/helper-plugin-utils" "^7.18.6" -"@babel/plugin-transform-sticky-regex@^7.16.7": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.16.7.tgz#c84741d4f4a38072b9a1e2e3fd56d359552e8660" - integrity sha512-NJa0Bd/87QV5NZZzTuZG5BPJjLYadeSZ9fO6oOUoL4iQx+9EEuw/eEM92SrsT19Yc2jgB1u1hsjqDtH02c3Drw== +"@babel/plugin-transform-spread@^7.19.0": + version "7.19.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-spread/-/plugin-transform-spread-7.19.0.tgz#dd60b4620c2fec806d60cfaae364ec2188d593b6" + integrity sha512-RsuMk7j6n+r752EtzyScnWkQyuJdli6LdO5Klv8Yx0OfPVTcQkIUfS8clx5e9yHXzlnhOZF3CbQ8C2uP5j074w== dependencies: - "@babel/helper-plugin-utils" "^7.16.7" + "@babel/helper-plugin-utils" "^7.19.0" + "@babel/helper-skip-transparent-expression-wrappers" "^7.18.9" -"@babel/plugin-transform-template-literals@^7.18.2": - version "7.18.2" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.18.2.tgz#31ed6915721864847c48b656281d0098ea1add28" - integrity sha512-/cmuBVw9sZBGZVOMkpAEaVLwm4JmK2GZ1dFKOGGpMzEHWFmyZZ59lUU0PdRr8YNYeQdNzTDwuxP2X2gzydTc9g== +"@babel/plugin-transform-sticky-regex@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.18.6.tgz#c6706eb2b1524028e317720339583ad0f444adcc" + integrity sha512-kfiDrDQ+PBsQDO85yj1icueWMfGfJFKN1KCkndygtu/C9+XUfydLC8Iv5UYJqRwy4zk8EcplRxEOeLyjq1gm6Q== dependencies: - "@babel/helper-plugin-utils" "^7.17.12" + "@babel/helper-plugin-utils" "^7.18.6" -"@babel/plugin-transform-typeof-symbol@^7.17.12": - version "7.17.12" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.17.12.tgz#0f12f57ac35e98b35b4ed34829948d42bd0e6889" - integrity sha512-Q8y+Jp7ZdtSPXCThB6zjQ74N3lj0f6TDh1Hnf5B+sYlzQ8i5Pjp8gW0My79iekSpT4WnI06blqP6DT0OmaXXmw== +"@babel/plugin-transform-template-literals@^7.18.9": + version "7.18.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.18.9.tgz#04ec6f10acdaa81846689d63fae117dd9c243a5e" + integrity sha512-S8cOWfT82gTezpYOiVaGHrCbhlHgKhQt8XH5ES46P2XWmX92yisoZywf5km75wv5sYcXDUCLMmMxOLCtthDgMA== dependencies: - "@babel/helper-plugin-utils" "^7.17.12" + "@babel/helper-plugin-utils" "^7.18.9" -"@babel/plugin-transform-typescript@^7.17.12": - version "7.18.1" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.18.1.tgz#5fd8b86130bad95c4a24377b41ab989a9ccad22d" - integrity sha512-F+RJmL479HJmC0KeqqwEGZMg1P7kWArLGbAKfEi9yPthJyMNjF+DjxFF/halfQvq1Q9GFM4TUbYDNV8xe4Ctqg== +"@babel/plugin-transform-typeof-symbol@^7.18.9": + version "7.18.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.18.9.tgz#c8cea68263e45addcd6afc9091429f80925762c0" + integrity sha512-SRfwTtF11G2aemAZWivL7PD+C9z52v9EvMqH9BuYbabyPuKUvSWks3oCg6041pT925L4zVFqaVBeECwsmlguEw== dependencies: - "@babel/helper-create-class-features-plugin" "^7.18.0" - "@babel/helper-plugin-utils" "^7.17.12" - "@babel/plugin-syntax-typescript" "^7.17.12" + "@babel/helper-plugin-utils" "^7.18.9" -"@babel/plugin-transform-unicode-escapes@^7.16.7": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.16.7.tgz#da8717de7b3287a2c6d659750c964f302b31ece3" - integrity sha512-TAV5IGahIz3yZ9/Hfv35TV2xEm+kaBDaZQCn2S/hG9/CZ0DktxJv9eKfPc7yYCvOYR4JGx1h8C+jcSOvgaaI/Q== +"@babel/plugin-transform-typescript@^7.18.6": + version "7.18.8" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.18.8.tgz#303feb7a920e650f2213ef37b36bbf327e6fa5a0" + integrity sha512-p2xM8HI83UObjsZGofMV/EdYjamsDm6MoN3hXPYIT0+gxIoopE+B7rPYKAxfrz9K9PK7JafTTjqYC6qipLExYA== dependencies: - "@babel/helper-plugin-utils" "^7.16.7" + "@babel/helper-create-class-features-plugin" "^7.18.6" + "@babel/helper-plugin-utils" "^7.18.6" + "@babel/plugin-syntax-typescript" "^7.18.6" -"@babel/plugin-transform-unicode-regex@^7.16.7": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.16.7.tgz#0f7aa4a501198976e25e82702574c34cfebe9ef2" - integrity sha512-oC5tYYKw56HO75KZVLQ+R/Nl3Hro9kf8iG0hXoaHP7tjAyCpvqBiSNe6vGrZni1Z6MggmUOC6A7VP7AVmw225Q== +"@babel/plugin-transform-unicode-escapes@^7.18.10": + version "7.18.10" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.18.10.tgz#1ecfb0eda83d09bbcb77c09970c2dd55832aa246" + integrity sha512-kKAdAI+YzPgGY/ftStBFXTI1LZFju38rYThnfMykS+IXy8BVx+res7s2fxf1l8I35DV2T97ezo6+SGrXz6B3iQ== dependencies: - "@babel/helper-create-regexp-features-plugin" "^7.16.7" - "@babel/helper-plugin-utils" "^7.16.7" + "@babel/helper-plugin-utils" "^7.18.9" -"@babel/preset-env@^7.15.6", "@babel/preset-env@^7.18.2": - version "7.18.2" - resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.18.2.tgz#f47d3000a098617926e674c945d95a28cb90977a" - integrity sha512-PfpdxotV6afmXMU47S08F9ZKIm2bJIQ0YbAAtDfIENX7G1NUAXigLREh69CWDjtgUy7dYn7bsMzkgdtAlmS68Q== - dependencies: - "@babel/compat-data" "^7.17.10" - "@babel/helper-compilation-targets" "^7.18.2" - "@babel/helper-plugin-utils" "^7.17.12" - "@babel/helper-validator-option" "^7.16.7" - "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression" "^7.17.12" - "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining" "^7.17.12" - "@babel/plugin-proposal-async-generator-functions" "^7.17.12" - "@babel/plugin-proposal-class-properties" "^7.17.12" - "@babel/plugin-proposal-class-static-block" "^7.18.0" - "@babel/plugin-proposal-dynamic-import" "^7.16.7" - "@babel/plugin-proposal-export-namespace-from" "^7.17.12" - "@babel/plugin-proposal-json-strings" "^7.17.12" - "@babel/plugin-proposal-logical-assignment-operators" "^7.17.12" - "@babel/plugin-proposal-nullish-coalescing-operator" "^7.17.12" - "@babel/plugin-proposal-numeric-separator" "^7.16.7" - "@babel/plugin-proposal-object-rest-spread" "^7.18.0" - "@babel/plugin-proposal-optional-catch-binding" "^7.16.7" - "@babel/plugin-proposal-optional-chaining" "^7.17.12" - "@babel/plugin-proposal-private-methods" "^7.17.12" - "@babel/plugin-proposal-private-property-in-object" "^7.17.12" - "@babel/plugin-proposal-unicode-property-regex" "^7.17.12" +"@babel/plugin-transform-unicode-regex@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.18.6.tgz#194317225d8c201bbae103364ffe9e2cea36cdca" + integrity sha512-gE7A6Lt7YLnNOL3Pb9BNeZvi+d8l7tcRrG4+pwJjK9hD2xX4mEvjlQW60G9EEmfXVYRPv9VRQcyegIVHCql/AA== + dependencies: + "@babel/helper-create-regexp-features-plugin" "^7.18.6" + "@babel/helper-plugin-utils" "^7.18.6" + +"@babel/preset-env@^7.11.0", "@babel/preset-env@^7.15.6", "@babel/preset-env@^7.18.6": + version "7.19.3" + resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.19.3.tgz#52cd19abaecb3f176a4ff9cc5e15b7bf06bec754" + integrity sha512-ziye1OTc9dGFOAXSWKUqQblYHNlBOaDl8wzqf2iKXJAltYiR3hKHUKmkt+S9PppW7RQpq4fFCrwwpIDj/f5P4w== + dependencies: + "@babel/compat-data" "^7.19.3" + "@babel/helper-compilation-targets" "^7.19.3" + "@babel/helper-plugin-utils" "^7.19.0" + "@babel/helper-validator-option" "^7.18.6" + "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression" "^7.18.6" + "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining" "^7.18.9" + "@babel/plugin-proposal-async-generator-functions" "^7.19.1" + "@babel/plugin-proposal-class-properties" "^7.18.6" + "@babel/plugin-proposal-class-static-block" "^7.18.6" + "@babel/plugin-proposal-dynamic-import" "^7.18.6" + "@babel/plugin-proposal-export-namespace-from" "^7.18.9" + "@babel/plugin-proposal-json-strings" "^7.18.6" + "@babel/plugin-proposal-logical-assignment-operators" "^7.18.9" + "@babel/plugin-proposal-nullish-coalescing-operator" "^7.18.6" + "@babel/plugin-proposal-numeric-separator" "^7.18.6" + "@babel/plugin-proposal-object-rest-spread" "^7.18.9" + "@babel/plugin-proposal-optional-catch-binding" "^7.18.6" + "@babel/plugin-proposal-optional-chaining" "^7.18.9" + "@babel/plugin-proposal-private-methods" "^7.18.6" + "@babel/plugin-proposal-private-property-in-object" "^7.18.6" + "@babel/plugin-proposal-unicode-property-regex" "^7.18.6" "@babel/plugin-syntax-async-generators" "^7.8.4" "@babel/plugin-syntax-class-properties" "^7.12.13" "@babel/plugin-syntax-class-static-block" "^7.14.5" "@babel/plugin-syntax-dynamic-import" "^7.8.3" "@babel/plugin-syntax-export-namespace-from" "^7.8.3" - "@babel/plugin-syntax-import-assertions" "^7.17.12" + "@babel/plugin-syntax-import-assertions" "^7.18.6" "@babel/plugin-syntax-json-strings" "^7.8.3" "@babel/plugin-syntax-logical-assignment-operators" "^7.10.4" "@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.3" @@ -1066,44 +1095,44 @@ "@babel/plugin-syntax-optional-chaining" "^7.8.3" "@babel/plugin-syntax-private-property-in-object" "^7.14.5" "@babel/plugin-syntax-top-level-await" "^7.14.5" - "@babel/plugin-transform-arrow-functions" "^7.17.12" - "@babel/plugin-transform-async-to-generator" "^7.17.12" - "@babel/plugin-transform-block-scoped-functions" "^7.16.7" - "@babel/plugin-transform-block-scoping" "^7.17.12" - "@babel/plugin-transform-classes" "^7.17.12" - "@babel/plugin-transform-computed-properties" "^7.17.12" - "@babel/plugin-transform-destructuring" "^7.18.0" - "@babel/plugin-transform-dotall-regex" "^7.16.7" - "@babel/plugin-transform-duplicate-keys" "^7.17.12" - "@babel/plugin-transform-exponentiation-operator" "^7.16.7" - "@babel/plugin-transform-for-of" "^7.18.1" - "@babel/plugin-transform-function-name" "^7.16.7" - "@babel/plugin-transform-literals" "^7.17.12" - "@babel/plugin-transform-member-expression-literals" "^7.16.7" - "@babel/plugin-transform-modules-amd" "^7.18.0" - "@babel/plugin-transform-modules-commonjs" "^7.18.2" - "@babel/plugin-transform-modules-systemjs" "^7.18.0" - "@babel/plugin-transform-modules-umd" "^7.18.0" - "@babel/plugin-transform-named-capturing-groups-regex" "^7.17.12" - "@babel/plugin-transform-new-target" "^7.17.12" - "@babel/plugin-transform-object-super" "^7.16.7" - "@babel/plugin-transform-parameters" "^7.17.12" - "@babel/plugin-transform-property-literals" "^7.16.7" - "@babel/plugin-transform-regenerator" "^7.18.0" - "@babel/plugin-transform-reserved-words" "^7.17.12" - "@babel/plugin-transform-shorthand-properties" "^7.16.7" - "@babel/plugin-transform-spread" "^7.17.12" - "@babel/plugin-transform-sticky-regex" "^7.16.7" - "@babel/plugin-transform-template-literals" "^7.18.2" - "@babel/plugin-transform-typeof-symbol" "^7.17.12" - "@babel/plugin-transform-unicode-escapes" "^7.16.7" - "@babel/plugin-transform-unicode-regex" "^7.16.7" + "@babel/plugin-transform-arrow-functions" "^7.18.6" + "@babel/plugin-transform-async-to-generator" "^7.18.6" + "@babel/plugin-transform-block-scoped-functions" "^7.18.6" + "@babel/plugin-transform-block-scoping" "^7.18.9" + "@babel/plugin-transform-classes" "^7.19.0" + "@babel/plugin-transform-computed-properties" "^7.18.9" + "@babel/plugin-transform-destructuring" "^7.18.13" + "@babel/plugin-transform-dotall-regex" "^7.18.6" + "@babel/plugin-transform-duplicate-keys" "^7.18.9" + "@babel/plugin-transform-exponentiation-operator" "^7.18.6" + "@babel/plugin-transform-for-of" "^7.18.8" + "@babel/plugin-transform-function-name" "^7.18.9" + "@babel/plugin-transform-literals" "^7.18.9" + "@babel/plugin-transform-member-expression-literals" "^7.18.6" + "@babel/plugin-transform-modules-amd" "^7.18.6" + "@babel/plugin-transform-modules-commonjs" "^7.18.6" + "@babel/plugin-transform-modules-systemjs" "^7.19.0" + "@babel/plugin-transform-modules-umd" "^7.18.6" + "@babel/plugin-transform-named-capturing-groups-regex" "^7.19.1" + "@babel/plugin-transform-new-target" "^7.18.6" + "@babel/plugin-transform-object-super" "^7.18.6" + "@babel/plugin-transform-parameters" "^7.18.8" + "@babel/plugin-transform-property-literals" "^7.18.6" + "@babel/plugin-transform-regenerator" "^7.18.6" + "@babel/plugin-transform-reserved-words" "^7.18.6" + "@babel/plugin-transform-shorthand-properties" "^7.18.6" + "@babel/plugin-transform-spread" "^7.19.0" + "@babel/plugin-transform-sticky-regex" "^7.18.6" + "@babel/plugin-transform-template-literals" "^7.18.9" + "@babel/plugin-transform-typeof-symbol" "^7.18.9" + "@babel/plugin-transform-unicode-escapes" "^7.18.10" + "@babel/plugin-transform-unicode-regex" "^7.18.6" "@babel/preset-modules" "^0.1.5" - "@babel/types" "^7.18.2" - babel-plugin-polyfill-corejs2 "^0.3.0" - babel-plugin-polyfill-corejs3 "^0.5.0" - babel-plugin-polyfill-regenerator "^0.3.0" - core-js-compat "^3.22.1" + "@babel/types" "^7.19.3" + babel-plugin-polyfill-corejs2 "^0.3.3" + babel-plugin-polyfill-corejs3 "^0.6.0" + babel-plugin-polyfill-regenerator "^0.4.1" + core-js-compat "^3.25.1" semver "^6.3.0" "@babel/preset-modules@^0.1.5": @@ -1117,75 +1146,86 @@ "@babel/types" "^7.4.4" esutils "^2.0.2" -"@babel/preset-react@^7.14.5", "@babel/preset-react@^7.17.12": - version "7.17.12" - resolved "https://registry.yarnpkg.com/@babel/preset-react/-/preset-react-7.17.12.tgz#62adbd2d1870c0de3893095757ed5b00b492ab3d" - integrity sha512-h5U+rwreXtZaRBEQhW1hOJLMq8XNJBQ/9oymXiCXTuT/0uOwpbT0gUt+sXeOqoXBgNuUKI7TaObVwoEyWkpFgA== +"@babel/preset-react@^7.14.5", "@babel/preset-react@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/preset-react/-/preset-react-7.18.6.tgz#979f76d6277048dc19094c217b507f3ad517dd2d" + integrity sha512-zXr6atUmyYdiWRVLOZahakYmOBHtWc2WGCkP8PYTgZi0iJXDY2CN180TdrIW4OGOAdLc7TifzDIvtx6izaRIzg== dependencies: - "@babel/helper-plugin-utils" "^7.17.12" - "@babel/helper-validator-option" "^7.16.7" - "@babel/plugin-transform-react-display-name" "^7.16.7" - "@babel/plugin-transform-react-jsx" "^7.17.12" - "@babel/plugin-transform-react-jsx-development" "^7.16.7" - "@babel/plugin-transform-react-pure-annotations" "^7.16.7" + "@babel/helper-plugin-utils" "^7.18.6" + "@babel/helper-validator-option" "^7.18.6" + "@babel/plugin-transform-react-display-name" "^7.18.6" + "@babel/plugin-transform-react-jsx" "^7.18.6" + "@babel/plugin-transform-react-jsx-development" "^7.18.6" + "@babel/plugin-transform-react-pure-annotations" "^7.18.6" -"@babel/preset-typescript@^7.15.0", "@babel/preset-typescript@^7.17.12": - version "7.17.12" - resolved "https://registry.yarnpkg.com/@babel/preset-typescript/-/preset-typescript-7.17.12.tgz#40269e0a0084d56fc5731b6c40febe1c9a4a3e8c" - integrity sha512-S1ViF8W2QwAKUGJXxP9NAfNaqGDdEBJKpYkxHf5Yy2C4NPPzXGeR3Lhk7G8xJaaLcFTRfNjVbtbVtm8Gb0mqvg== +"@babel/preset-typescript@^7.15.0", "@babel/preset-typescript@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/preset-typescript/-/preset-typescript-7.18.6.tgz#ce64be3e63eddc44240c6358daefac17b3186399" + integrity sha512-s9ik86kXBAnD760aybBucdpnLsAt0jK1xqJn2juOn9lkOvSHV60os5hxoVJsPzMQxvnUJFAlkont2DvvaYEBtQ== dependencies: - "@babel/helper-plugin-utils" "^7.17.12" - "@babel/helper-validator-option" "^7.16.7" - "@babel/plugin-transform-typescript" "^7.17.12" + "@babel/helper-plugin-utils" "^7.18.6" + "@babel/helper-validator-option" "^7.18.6" + "@babel/plugin-transform-typescript" "^7.18.6" -"@babel/runtime-corejs3@^7.10.2", "@babel/runtime-corejs3@^7.18.3": - version "7.18.3" - resolved "https://registry.yarnpkg.com/@babel/runtime-corejs3/-/runtime-corejs3-7.18.3.tgz#52f0241a31e0ec61a6187530af6227c2846bd60c" - integrity sha512-l4ddFwrc9rnR+EJsHsh+TJ4A35YqQz/UqcjtlX2ov53hlJYG5CxtQmNZxyajwDVmCxwy++rtvGU5HazCK4W41Q== +"@babel/runtime-corejs3@^7.10.2", "@babel/runtime-corejs3@^7.18.6": + version "7.18.9" + resolved "https://registry.yarnpkg.com/@babel/runtime-corejs3/-/runtime-corejs3-7.18.9.tgz#7bacecd1cb2dd694eacd32a91fcf7021c20770ae" + integrity sha512-qZEWeccZCrHA2Au4/X05QW5CMdm4VjUDCrGq5gf1ZDcM4hRqreKrtwAn7yci9zfgAS9apvnsFXiGBHBAxZdK9A== dependencies: core-js-pure "^3.20.2" regenerator-runtime "^0.13.4" -"@babel/runtime@^7.1.2", "@babel/runtime@^7.10.2", "@babel/runtime@^7.10.3", "@babel/runtime@^7.12.1", "@babel/runtime@^7.12.13", "@babel/runtime@^7.12.5", "@babel/runtime@^7.18.3", "@babel/runtime@^7.8.4": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.18.6.tgz#6a1ef59f838debd670421f8c7f2cbb8da9751580" - integrity sha512-t9wi7/AW6XtKahAe20Yw0/mMljKq0B1r2fPdvaAdV/KPDZewFXdaaa6K7lxmZBZ8FBNpCiAT6iHPmd6QO9bKfQ== +"@babel/runtime@^7.1.2", "@babel/runtime@^7.10.2", "@babel/runtime@^7.10.3", "@babel/runtime@^7.11.2", "@babel/runtime@^7.12.1", "@babel/runtime@^7.12.13", "@babel/runtime@^7.12.5", "@babel/runtime@^7.18.3", "@babel/runtime@^7.18.6", "@babel/runtime@^7.18.9", "@babel/runtime@^7.8.4": + version "7.19.0" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.19.0.tgz#22b11c037b094d27a8a2504ea4dcff00f50e2259" + integrity sha512-eR8Lo9hnDS7tqkO7NsV+mKvCmv5boaXFSZ70DnfhcgiEne8hv9oCEd36Klw74EtizEqLsy4YnW8UWwpBVolHZA== dependencies: regenerator-runtime "^0.13.4" -"@babel/template@^7.12.7", "@babel/template@^7.16.7", "@babel/template@^7.3.3": - version "7.16.7" - resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.16.7.tgz#8d126c8701fde4d66b264b3eba3d96f07666d155" - integrity sha512-I8j/x8kHUrbYRTUxXrrMbfCa7jxkE7tZre39x3kjr9hvI82cK1FfqLygotcWN5kdPGWcLdWMHpSBavse5tWw3w== - dependencies: - "@babel/code-frame" "^7.16.7" - "@babel/parser" "^7.16.7" - "@babel/types" "^7.16.7" - -"@babel/traverse@^7.12.9", "@babel/traverse@^7.13.0", "@babel/traverse@^7.16.8", "@babel/traverse@^7.18.0", "@babel/traverse@^7.18.2", "@babel/traverse@^7.18.5", "@babel/traverse@^7.7.2": - version "7.18.5" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.18.5.tgz#94a8195ad9642801837988ab77f36e992d9a20cd" - integrity sha512-aKXj1KT66sBj0vVzk6rEeAO6Z9aiiQ68wfDgge3nHhA/my6xMM/7HGQUNumKZaoa2qUPQ5whJG9aAifsxUKfLA== - dependencies: - "@babel/code-frame" "^7.16.7" - "@babel/generator" "^7.18.2" - "@babel/helper-environment-visitor" "^7.18.2" - "@babel/helper-function-name" "^7.17.9" - "@babel/helper-hoist-variables" "^7.16.7" - "@babel/helper-split-export-declaration" "^7.16.7" - "@babel/parser" "^7.18.5" - "@babel/types" "^7.18.4" +"@babel/template@^7.12.7", "@babel/template@^7.18.10", "@babel/template@^7.18.6", "@babel/template@^7.3.3": + version "7.18.10" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.18.10.tgz#6f9134835970d1dbf0835c0d100c9f38de0c5e71" + integrity sha512-TI+rCtooWHr3QJ27kJxfjutghu44DLnasDMwpDqCXVTal9RLp3RSYNh4NdBrRP2cQAoG9A8juOQl6P6oZG4JxA== + dependencies: + "@babel/code-frame" "^7.18.6" + "@babel/parser" "^7.18.10" + "@babel/types" "^7.18.10" + +"@babel/traverse@^7.12.9", "@babel/traverse@^7.18.8", "@babel/traverse@^7.18.9", "@babel/traverse@^7.20.1", "@babel/traverse@^7.7.2": + version "7.20.1" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.20.1.tgz#9b15ccbf882f6d107eeeecf263fbcdd208777ec8" + integrity sha512-d3tN8fkVJwFLkHkBN479SOsw4DMZnz8cdbL/gvuDuzy3TS6Nfw80HuQqhw1pITbIruHyh7d1fMA47kWzmcUEGA== + dependencies: + "@babel/code-frame" "^7.18.6" + "@babel/generator" "^7.20.1" + "@babel/helper-environment-visitor" "^7.18.9" + "@babel/helper-function-name" "^7.19.0" + "@babel/helper-hoist-variables" "^7.18.6" + "@babel/helper-split-export-declaration" "^7.18.6" + "@babel/parser" "^7.20.1" + "@babel/types" "^7.20.0" debug "^4.1.0" globals "^11.1.0" -"@babel/types@^7.0.0", "@babel/types@^7.12.7", "@babel/types@^7.15.6", "@babel/types@^7.16.0", "@babel/types@^7.16.7", "@babel/types@^7.16.8", "@babel/types@^7.17.0", "@babel/types@^7.17.12", "@babel/types@^7.18.0", "@babel/types@^7.18.2", "@babel/types@^7.18.4", "@babel/types@^7.3.0", "@babel/types@^7.3.3", "@babel/types@^7.4.4": - version "7.18.8" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.18.8.tgz#c5af199951bf41ba4a6a9a6d0d8ad722b30cd42f" - integrity sha512-qwpdsmraq0aJ3osLJRApsc2ouSJCdnMeZwB0DhbtHAtRpZNZCdlbRnHIgcRKzdE1g0iOGg644fzjOBcdOz9cPw== +"@babel/types@^7.0.0", "@babel/types@^7.12.7", "@babel/types@^7.15.6", "@babel/types@^7.18.10", "@babel/types@^7.18.6", "@babel/types@^7.18.9", "@babel/types@^7.19.0", "@babel/types@^7.19.3", "@babel/types@^7.20.0", "@babel/types@^7.20.2", "@babel/types@^7.3.0", "@babel/types@^7.3.3", "@babel/types@^7.4.4": + version "7.20.2" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.20.2.tgz#67ac09266606190f496322dbaff360fdaa5e7842" + integrity sha512-FnnvsNWgZCr232sqtXggapvlkk/tuwR/qhGzcmxI0GXLCjmPYQPzio2FbdlWuY6y1sHFfQKk+rRbUZ9VStQMog== dependencies: - "@babel/helper-validator-identifier" "^7.18.6" + "@babel/helper-string-parser" "^7.19.4" + "@babel/helper-validator-identifier" "^7.19.1" to-fast-properties "^2.0.0" +"@bcherny/json-schema-ref-parser@9.0.9": + version "9.0.9" + resolved "https://registry.yarnpkg.com/@bcherny/json-schema-ref-parser/-/json-schema-ref-parser-9.0.9.tgz#09899d405bc708c0acac0066ae8db5b94d465ca4" + integrity sha512-vmEmnJCfpkLdas++9OYg6riIezTYqTHpqUTODJzHLzs5UnXujbOJW9VwcVCnyo1mVRt32FRr23iXBx/sX8YbeQ== + dependencies: + "@jsdevtools/ono" "^7.1.3" + "@types/json-schema" "^7.0.6" + call-me-maybe "^1.0.1" + js-yaml "^4.1.0" + "@bcoe/v8-coverage@^0.2.3": version "0.2.3" resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" @@ -1196,112 +1236,124 @@ resolved "https://registry.yarnpkg.com/@colors/colors/-/colors-1.5.0.tgz#bb504579c1cae923e6576a4f5da43d25f97bdbd9" integrity sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ== -"@cspell/cspell-bundled-dicts@^5.20.0": - version "5.20.0" - resolved "https://registry.yarnpkg.com/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-5.20.0.tgz#294106a2660baf825494535019a0d2230c3cc0c1" - integrity sha512-tCO32xVSuey4Tg8XuayBzcrCAfrAXL8J1PeYl26+/ZUl5zkAL4AuyL0Cf4e2PpeEomnUWP2y5noZLLbUeOIwnw== +"@cspell/cspell-bundled-dicts@^6.12.0": + version "6.12.0" + resolved "https://registry.yarnpkg.com/@cspell/cspell-bundled-dicts/-/cspell-bundled-dicts-6.12.0.tgz#a5f2d380e505ba4857cb96af6960b55a12c7f5c2" + integrity sha512-myfsDwSJcAMjKbztKBG424wIp/YV9/lvxsgHFKxBGPi+nNx1p7TbOjAAO9EWk0mZVHyGKZwCFJS2ohkoqxJWoQ== dependencies: - "@cspell/dict-ada" "^2.0.0" + "@cspell/dict-ada" "^2.0.1" "@cspell/dict-aws" "^2.0.0" - "@cspell/dict-bash" "^2.0.2" - "@cspell/dict-companies" "^2.0.4" - "@cspell/dict-cpp" "^2.0.3" + "@cspell/dict-bash" "^2.0.4" + "@cspell/dict-companies" "^2.0.14" + "@cspell/dict-cpp" "^3.2.1" "@cspell/dict-cryptocurrencies" "^2.0.0" - "@cspell/dict-csharp" "^2.0.1" - "@cspell/dict-css" "^2.0.0" - "@cspell/dict-dart" "^1.1.0" + "@cspell/dict-csharp" "^3.0.1" + "@cspell/dict-css" "^2.1.0" + "@cspell/dict-dart" "^1.1.1" "@cspell/dict-django" "^2.0.0" + "@cspell/dict-docker" "^1.1.1" "@cspell/dict-dotnet" "^2.0.1" "@cspell/dict-elixir" "^2.0.1" "@cspell/dict-en-gb" "^1.1.33" - "@cspell/dict-en_us" "^2.2.2" - "@cspell/dict-filetypes" "^2.0.1" - "@cspell/dict-fonts" "^2.0.0" - "@cspell/dict-fullstack" "^2.0.5" + "@cspell/dict-en_us" "^2.3.3" + "@cspell/dict-filetypes" "^2.1.1" + "@cspell/dict-fonts" "^2.1.0" + "@cspell/dict-fullstack" "^2.0.6" "@cspell/dict-git" "^1.0.1" - "@cspell/dict-golang" "^2.0.0" - "@cspell/dict-haskell" "^2.0.0" - "@cspell/dict-html" "^3.0.1" - "@cspell/dict-html-symbol-entities" "^2.0.0" - "@cspell/dict-java" "^2.0.0" - "@cspell/dict-latex" "^2.0.0" - "@cspell/dict-lorem-ipsum" "^2.0.0" + "@cspell/dict-golang" "^3.0.1" + "@cspell/dict-haskell" "^2.0.1" + "@cspell/dict-html" "^3.3.2" + "@cspell/dict-html-symbol-entities" "^3.0.0" + "@cspell/dict-java" "^3.0.7" + "@cspell/dict-latex" "^2.0.9" + "@cspell/dict-lorem-ipsum" "^2.0.1" "@cspell/dict-lua" "^2.0.0" - "@cspell/dict-node" "^2.0.1" - "@cspell/dict-npm" "^2.0.3" + "@cspell/dict-node" "^3.0.1" + "@cspell/dict-npm" "^3.1.2" "@cspell/dict-php" "^2.0.0" "@cspell/dict-powershell" "^2.0.0" - "@cspell/dict-public-licenses" "^1.0.4" - "@cspell/dict-python" "^3.0.3" - "@cspell/dict-r" "^1.0.2" - "@cspell/dict-ruby" "^2.0.1" - "@cspell/dict-rust" "^2.0.0" + "@cspell/dict-public-licenses" "^1.0.6" + "@cspell/dict-python" "^3.0.6" + "@cspell/dict-r" "^1.0.3" + "@cspell/dict-ruby" "^2.0.2" + "@cspell/dict-rust" "^2.0.1" "@cspell/dict-scala" "^2.0.0" - "@cspell/dict-software-terms" "^2.1.5" - "@cspell/dict-swift" "^1.0.2" - "@cspell/dict-typescript" "^2.0.0" + "@cspell/dict-software-terms" "^2.2.11" + "@cspell/dict-sql" "^1.0.4" + "@cspell/dict-swift" "^1.0.3" + "@cspell/dict-typescript" "^2.0.2" "@cspell/dict-vue" "^2.0.2" -"@cspell/cspell-pipe@^5.20.0": - version "5.20.0" - resolved "https://registry.yarnpkg.com/@cspell/cspell-pipe/-/cspell-pipe-5.20.0.tgz#964aa560c89ecdf4eea9145700ccd6ab4c235ed8" - integrity sha512-dGHf4XZgPlGqviYTD+5ZwSk3hpiywsuuDqnoPo9SeQ1xPon7uFVKsMiAAzvhGAkkBaKIBNP/nwPU0feYvLoCJg== +"@cspell/cspell-pipe@^6.12.0": + version "6.12.0" + resolved "https://registry.yarnpkg.com/@cspell/cspell-pipe/-/cspell-pipe-6.12.0.tgz#838620484f7105dc8ae96ad4cd59cb7c508a6260" + integrity sha512-Nkm+tIJ5k+jZPovZCdmZhrWrwRFwnDq+7yCxhov0C7UX3hsSNtTJIpFuaCNEQJ+Whpvxdh1YKflvHiHYygEgTg== -"@cspell/cspell-types@^5.20.0": - version "5.20.0" - resolved "https://registry.yarnpkg.com/@cspell/cspell-types/-/cspell-types-5.20.0.tgz#4c9a47249e1ad534938f2f35fbba1221e7800570" - integrity sha512-p06/HAKgalqyGHfnowJvjO3SQHxuOzKdiJTUlUi8x1CrEk7PmZEHuORlt9tVVZ46Xf2qY9+QLeTtattlWPJ39A== +"@cspell/cspell-service-bus@^6.12.0": + version "6.12.0" + resolved "https://registry.yarnpkg.com/@cspell/cspell-service-bus/-/cspell-service-bus-6.12.0.tgz#f6121c5461d5f8ed00501496a59d3957d7a36108" + integrity sha512-GgvciSeMUekl8z8vP8//cs5/qRQJSLz9IVREf6fxQW4upjw6zXZ1KonwPqOF5uLocIMAr8eCdrJzHKuKvigJIA== -"@cspell/dict-ada@^2.0.0": - version "2.0.0" - resolved "https://registry.yarnpkg.com/@cspell/dict-ada/-/dict-ada-2.0.0.tgz#5d31967cbd7a0d12f4b4de3fd5b09e59239cf78b" - integrity sha512-4gfJEYXVwz6IN2LBaT6QoUV4pqaR35i0z0u9O684vLuVczvNJIHa4vNaSEFBr9d6xxncUyqstgP9P73ajJjh9A== +"@cspell/cspell-types@^6.12.0": + version "6.12.0" + resolved "https://registry.yarnpkg.com/@cspell/cspell-types/-/cspell-types-6.12.0.tgz#ab1bbb305f40f6fe1ff1eae9a29a669beb681389" + integrity sha512-BcZTt05fNy9SGXfbPgUyxS4FfIaUpcVq8IOJ0noN+jsKsmlbssOUgJOB2ApN1h66FfWcKuFy/uNrjfcrQ7PTqg== + +"@cspell/dict-ada@^2.0.1": + version "2.0.1" + resolved "https://registry.yarnpkg.com/@cspell/dict-ada/-/dict-ada-2.0.1.tgz#662e1f459531298e7c3f1ff7e63fd36c2b311d5b" + integrity sha512-vopTJ1oHrrFYV5GU55Sr+AzItR78Uj5YbCaspYABmYKlq4NRrcUAUsr4bWgymDcspMIHO7e7IFcj48OKs1fndA== "@cspell/dict-aws@^2.0.0": version "2.0.0" resolved "https://registry.yarnpkg.com/@cspell/dict-aws/-/dict-aws-2.0.0.tgz#9af72af4e59e96029dd4335271d87784843cb7dd" integrity sha512-NKz7pDZ7pwj/b33i3f4WLpC1rOOUMmENwYgftxU+giU2YBeKM2wZbMTSEIzsrel56r0UlQYmdIVlP/B4nnVaoQ== -"@cspell/dict-bash@^2.0.2": - version "2.0.2" - resolved "https://registry.yarnpkg.com/@cspell/dict-bash/-/dict-bash-2.0.2.tgz#8bc3e0a6c1b9c0df1bd9a1b7694c58d9843fd16b" - integrity sha512-ASIgI/LmV2TYrD4mtk+gm4XmUSTRomOyRt7NDWyBpEww/AeawC2O2NH6FosyUT6dUU3GaXt2wgJRN7R78n1SGg== - -"@cspell/dict-companies@^2.0.4": +"@cspell/dict-bash@^2.0.4": version "2.0.4" - resolved "https://registry.yarnpkg.com/@cspell/dict-companies/-/dict-companies-2.0.4.tgz#2ba11418478d99d67a96004ea782a47a42c501a3" - integrity sha512-nLNVddo+iu4q/Mu03nkVTMnSPxBkoLyZ0MgpHJZWCqxVATbBkzoZNNNjsTkJhvkbrUIWydf8YW4U4wYY+kyh7Q== + resolved "https://registry.yarnpkg.com/@cspell/dict-bash/-/dict-bash-2.0.4.tgz#93f0ff159d96b8823fed9282f803e4f3447af33d" + integrity sha512-uK/ehmp5LYrmRH2Gv3nbvdPswpkybJUn34WYKLpeuYHQktmi+pOI1A9uPdBPnSbMDffSvwQlQohIyKawz+X8Ag== -"@cspell/dict-cpp@^2.0.3": - version "2.0.3" - resolved "https://registry.yarnpkg.com/@cspell/dict-cpp/-/dict-cpp-2.0.3.tgz#551bec166c4520f7ba36f8d263fb885d19f98db0" - integrity sha512-aWRvI3CQW2M3XeJpDVffItw/9n4hxsN5EPwyBa6Po6EnCxZZZLOqpieZk4JNz4pH0/xbnOX+sMMuSeKWr71r/w== +"@cspell/dict-companies@^2.0.14": + version "2.0.14" + resolved "https://registry.yarnpkg.com/@cspell/dict-companies/-/dict-companies-2.0.14.tgz#2b31941107e3aa41d3d122d40c3f3daae9eaa7f2" + integrity sha512-Sq1X29Z05OZ/UNqTwVhf3/WaqvJQy4/S6gS8qYI5AQRX45gVe8CPhNBLmZOTC6z8m716bfQCxa5rRT9YNSdTZg== + +"@cspell/dict-cpp@^3.2.1": + version "3.2.1" + resolved "https://registry.yarnpkg.com/@cspell/dict-cpp/-/dict-cpp-3.2.1.tgz#2c8c232c53c22c69b73802a26480203e1d9b6fbf" + integrity sha512-XcmzrKIghqFfrYLLaHtWKOp9rupiuGdc5ODONk+emsq0W5CIc3Abn27IQHwUzxzF+Cm5IfKAIJ5Kpe6hkzm0HQ== "@cspell/dict-cryptocurrencies@^2.0.0": version "2.0.0" resolved "https://registry.yarnpkg.com/@cspell/dict-cryptocurrencies/-/dict-cryptocurrencies-2.0.0.tgz#a74eecb42a46a96d08b6613fdb5c554529d3afff" integrity sha512-nREysmmfOp7L2YCRAUufQahwD5/Punzb5AZ6eyg4zUamdRWHgBFphb5/9h2flt1vgdUfhc6hZcML21Ci7iXjaA== -"@cspell/dict-csharp@^2.0.1": - version "2.0.1" - resolved "https://registry.yarnpkg.com/@cspell/dict-csharp/-/dict-csharp-2.0.1.tgz#86ec4fa42ba9a4cc57df28ec7a335b56bf751c5b" - integrity sha512-ZzAr+WRP2FUtXHZtfhe8f3j9vPjH+5i44Hcr5JqbWxmqciGoTbWBPQXwu9y+J4mbdC69HSWRrVGkNJ8rQk8pSw== +"@cspell/dict-csharp@^3.0.1": + version "3.0.1" + resolved "https://registry.yarnpkg.com/@cspell/dict-csharp/-/dict-csharp-3.0.1.tgz#94a673e02bb7cc03c25bc699bc1b5bd786c2c5fd" + integrity sha512-xkfQu03F388w4sdVQSSjrVMkxAxpTYB2yW7nw0XYtTjl3L/jBgvTr/j1BTjdFbQhdNf10Lg0Ak1kXOjmHodVqA== -"@cspell/dict-css@^2.0.0": - version "2.0.0" - resolved "https://registry.yarnpkg.com/@cspell/dict-css/-/dict-css-2.0.0.tgz#91dca013f16b51144eaea160e144b830f2dad027" - integrity sha512-MrFyswFHnPh4H0u6IlV4eHy+ZCUrrHzeL161LyTOqCvaKpbZavMgNYXzZqTF9xafO0iLgwKrl+Gkclu1KVBg0Q== +"@cspell/dict-css@^2.1.0": + version "2.1.0" + resolved "https://registry.yarnpkg.com/@cspell/dict-css/-/dict-css-2.1.0.tgz#799708a8e59cb58077b21b1f37aacdc75c240efb" + integrity sha512-glASAELcGhh4Ru0rTQ4G9mTQxSyPwsZOON/5BYflB6Kks8YC8nUvKrtMCoo5W7CPKPfSEa8zUNctFQ1+IUYDHA== -"@cspell/dict-dart@^1.1.0": - version "1.1.0" - resolved "https://registry.yarnpkg.com/@cspell/dict-dart/-/dict-dart-1.1.0.tgz#d79689493debdad231efe495bd1460bff1d2f577" - integrity sha512-bBqZINm+RVjMgUrAhRzv/xx3jc3dkIqO0higPbsK+63IAtMNY3EiQnEO4eapbU+qAhyvICY9hZQZXy5Ux4p+Pw== +"@cspell/dict-dart@^1.1.1": + version "1.1.1" + resolved "https://registry.yarnpkg.com/@cspell/dict-dart/-/dict-dart-1.1.1.tgz#d4da9cf72e5df369b6d9ebe588f9c1474adf3556" + integrity sha512-XBOCpezXrgFN18kGEwqMpTUGZdw4BjCoJrNOo6qBdcdZySCrEHLwELraLOkcSba2kM4stmTp0t59FkwtP8TKOA== "@cspell/dict-django@^2.0.0": version "2.0.0" resolved "https://registry.yarnpkg.com/@cspell/dict-django/-/dict-django-2.0.0.tgz#a5f5f693a686e5873f9dfb547ee3b3142ef760b1" integrity sha512-GkJdJv6cmzrKcmq2/oxTXjKF5uv71r4eTqnFmgPbNBW1t+G4VYpzOf0QrVQrhx2RC4DdW5XfcTf+iS0FxHOTmw== +"@cspell/dict-docker@^1.1.1": + version "1.1.1" + resolved "https://registry.yarnpkg.com/@cspell/dict-docker/-/dict-docker-1.1.1.tgz#f9cc1c732a9be2f31a5a4aa079d045798b97b01d" + integrity sha512-UEYoeRDm7oUN9yz1mYSozz6D4+2N14S/cd2Re9et6Xzq6yi62s4ky3knF92Of2weelADjnN41UA22VBhRAf7Sw== + "@cspell/dict-dotnet@^2.0.1": version "2.0.1" resolved "https://registry.yarnpkg.com/@cspell/dict-dotnet/-/dict-dotnet-2.0.1.tgz#8ef56df758b63f0a2ba4d8681a427a6861ed34d5" @@ -1317,80 +1369,80 @@ resolved "https://registry.yarnpkg.com/@cspell/dict-en-gb/-/dict-en-gb-1.1.33.tgz#7f1fd90fc364a5cb77111b5438fc9fcf9cc6da0e" integrity sha512-tKSSUf9BJEV+GJQAYGw5e+ouhEe2ZXE620S7BLKe3ZmpnjlNG9JqlnaBhkIMxKnNFkLY2BP/EARzw31AZnOv4g== -"@cspell/dict-en_us@^2.2.2": - version "2.2.4" - resolved "https://registry.yarnpkg.com/@cspell/dict-en_us/-/dict-en_us-2.2.4.tgz#20abce3eabe048aa5d858de7b9475c6c290cdc1e" - integrity sha512-gblsvIPLNAK+pRR/Mn2m2kRQLVFeoORQJeaZKlGHWckA3s0iuTN49hSSTbK66k3aWlzhirtSoux7IdvT2RpgnQ== +"@cspell/dict-en_us@^2.3.3": + version "2.3.3" + resolved "https://registry.yarnpkg.com/@cspell/dict-en_us/-/dict-en_us-2.3.3.tgz#4b20b5aa91151a4fb6f40425436b3b4c54ddaef4" + integrity sha512-csyKeaNktfpvMkmE2GOPTwsrQm3wWhLKVaDRaGU0qTcIjDiCvqv/iYgrVrKRkoddA3kdNTZ8YNCcix7lb6VkOg== -"@cspell/dict-filetypes@^2.0.1": - version "2.0.1" - resolved "https://registry.yarnpkg.com/@cspell/dict-filetypes/-/dict-filetypes-2.0.1.tgz#a77467dad8fee31c28d623f85a15ce6fca3e2fdc" - integrity sha512-bQ7K3U/3hKO2lpQjObf0veNP/n50qk5CVezSwApMBckf/sAVvDTR1RGAvYdr+vdQnkdQrk6wYmhbshXi0sLDVg== +"@cspell/dict-filetypes@^2.1.1": + version "2.1.1" + resolved "https://registry.yarnpkg.com/@cspell/dict-filetypes/-/dict-filetypes-2.1.1.tgz#f778ad814ff6d7050f81bbd7c856b6f555ba6bae" + integrity sha512-Oo0/mUbFHzsaATqRLdkV1RMoYns3aGzeKFIpVJg415GYtJ8EABXtEArYTXeMwlboyGTPvEk+PR2hBSTSfQTqmg== -"@cspell/dict-fonts@^2.0.0": - version "2.0.0" - resolved "https://registry.yarnpkg.com/@cspell/dict-fonts/-/dict-fonts-2.0.0.tgz#76e7781b44cdda6933144e15cba80e978c29bd15" - integrity sha512-AgkTalphfDPtKFPYmEExDcj8rRCh86xlOSXco8tehOEkYVYbksOk9XH0YVH34RFpy93YBd2nnVGLgyGVwagcPw== +"@cspell/dict-fonts@^2.1.0": + version "2.1.0" + resolved "https://registry.yarnpkg.com/@cspell/dict-fonts/-/dict-fonts-2.1.0.tgz#89b32b41bc66a38b6fbf9c970540e2f7ebd6e8b1" + integrity sha512-hk7xsbfWEUhc136Xj7I2TD7ouKAfWwzCVAQaHBxcVXAsVxu7bDOGj4FvE2jBzlkSUY8A9Ww8qS0GOFvowJshVg== -"@cspell/dict-fullstack@^2.0.5": - version "2.0.5" - resolved "https://registry.yarnpkg.com/@cspell/dict-fullstack/-/dict-fullstack-2.0.5.tgz#ffe416f90b0b30f1586e75432c0bc09b4c1faf96" - integrity sha512-jnLnHZ4HcCFNUfN+q7m0CUDtISNKat0Jahe1GgnAdEwzcozqKBhlGAjV7mQWPtKpqfJU61JakDnrxzqefAfZHw== +"@cspell/dict-fullstack@^2.0.6": + version "2.0.6" + resolved "https://registry.yarnpkg.com/@cspell/dict-fullstack/-/dict-fullstack-2.0.6.tgz#0bec93306cba070ed6aa0b619d8080c86310ab5d" + integrity sha512-R2E2xvbHvvRwwurxfpBJDRIJjXBMfEPF5WNV3LTOEMRqkZtoYCeJK9aqc8LHlmJMtAbnN1cx//BCDIyTJ0rO0A== "@cspell/dict-git@^1.0.1": version "1.0.1" resolved "https://registry.yarnpkg.com/@cspell/dict-git/-/dict-git-1.0.1.tgz#9de5ab2532abcdc8b10bd83ccb1f5e5dae0b6067" integrity sha512-Rk+eTof/9inF11lvxmkCRK+gODatA3qai8kSASv6OG/JfPvpj7fTHErx/rdgPw/LOTDUafnoTjTYmj7B2MOQXg== -"@cspell/dict-golang@^2.0.0": - version "2.0.0" - resolved "https://registry.yarnpkg.com/@cspell/dict-golang/-/dict-golang-2.0.0.tgz#a392533780c9fc3dc959f1358d09f7a6c6d82656" - integrity sha512-rUeZJR/S/ZjAsOURtxsAO6xDQhL0IzF458ScahaeOqe0zVL3tx7tCLikCgT92NWPs3BNqmsZGqYSDbn/1KsSIA== +"@cspell/dict-golang@^3.0.1": + version "3.0.1" + resolved "https://registry.yarnpkg.com/@cspell/dict-golang/-/dict-golang-3.0.1.tgz#acde95eb340c4512d132586a8326b1b3d971c0f7" + integrity sha512-0KNfXTbxHW2l8iVjxeOf+KFv9Qrw3z5cyKnkuYJWlBTSB5KcUBfeKCb4fsds26VdANqiy6U91b4gDx5kNEmBjQ== -"@cspell/dict-haskell@^2.0.0": - version "2.0.0" - resolved "https://registry.yarnpkg.com/@cspell/dict-haskell/-/dict-haskell-2.0.0.tgz#9e7e58eba2b4633221650dcdcc43f73588b48119" - integrity sha512-cjX1Br+gSWqtcmJD/IMHz1UoP3pUaKIIKy/JfhEs7ANtRt6hhfEKe9dl2kQzDkkKt4pXol+YgdYxL/sVc/nLgQ== +"@cspell/dict-haskell@^2.0.1": + version "2.0.1" + resolved "https://registry.yarnpkg.com/@cspell/dict-haskell/-/dict-haskell-2.0.1.tgz#941aa5eed0eb5e327e1a2b04dcad4f0e60f663c0" + integrity sha512-ooA23qIG7InOOxlLm67CNH5O2J85QsPHEAzEU9KEqVfYG5ovFs5tx6n9pHekDVk3MpQULpqfNUYDR0KigPLg5g== -"@cspell/dict-html-symbol-entities@^2.0.0": - version "2.0.0" - resolved "https://registry.yarnpkg.com/@cspell/dict-html-symbol-entities/-/dict-html-symbol-entities-2.0.0.tgz#a25d39e62bd2dd7191ca5612714aa0a1b90ca10f" - integrity sha512-71S5wGCe7dq6C+zGDwsEAe5msub/irrLi6SExeG11a/EkpA3RKAEheDGPk0hOY4+vOcIFHaApxOjLTtgQfYWfA== +"@cspell/dict-html-symbol-entities@^3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@cspell/dict-html-symbol-entities/-/dict-html-symbol-entities-3.0.0.tgz#55d5d96c37ecbde00492c4238e229908eea9cedb" + integrity sha512-04K7cPTcbYXmHICfiob4gZA1yaj4hpfM+Nl5WIJ1EAZsSGHdqmGEF28GuCjyQ8ZeKiJAsPt/vXuLBbjxkHqZyQ== -"@cspell/dict-html@^3.0.1": - version "3.0.1" - resolved "https://registry.yarnpkg.com/@cspell/dict-html/-/dict-html-3.0.1.tgz#d5d10ef9b62361d8250cf9fe8564606993faa9df" - integrity sha512-sbuFd+nSjgbrGf5eYwSddFhm1eLLePKWyH6Zn8Zb0OODrBK5e4vGn1/scI/MOH5a2IvNs8W9wp84uMBFJcQZtw== +"@cspell/dict-html@^3.3.2": + version "3.3.2" + resolved "https://registry.yarnpkg.com/@cspell/dict-html/-/dict-html-3.3.2.tgz#5b5fa6b2b8a1d51f8f735dc3fd5310ff287c29bf" + integrity sha512-cM5pQSEiqjrdk6cRFLrlLdWNT/J8399f/A6DjwjfYhHrGy0e/Rsjv76HZT0GlE1OqMoq9eG9jdQsfoYYgWTIpQ== -"@cspell/dict-java@^2.0.0": - version "2.0.0" - resolved "https://registry.yarnpkg.com/@cspell/dict-java/-/dict-java-2.0.0.tgz#76252cee8f04e099ac6dae0f45f22257088060a7" - integrity sha512-9f5LDATlAiXRGqxLxgqbOLlQxuMW2zcN7tBgxwtN+4u90vM03ZUOR/gKIuDV/y0ZuAiWBIjA73cjk8DJ13Q1eA== +"@cspell/dict-java@^3.0.7": + version "3.0.7" + resolved "https://registry.yarnpkg.com/@cspell/dict-java/-/dict-java-3.0.7.tgz#609a640f6e6816de0e2ac1f1e2ef2c9939970601" + integrity sha512-IL7ubsRvKX6dZSx++TplJCfhiS7kkEGpbTPG0gMEP50DTNAVM4icZS8zmer2UBCU5PTwF85abJjdX7mRADWKVg== -"@cspell/dict-latex@^2.0.0": - version "2.0.0" - resolved "https://registry.yarnpkg.com/@cspell/dict-latex/-/dict-latex-2.0.0.tgz#0b13b6522d305f5842833ec0179078d900714f65" - integrity sha512-H6RRwbHhQ9ARoO1R57SDqB+q/J5jUDdVnkdfukJkA+HNlJBhCcDuzGOIJqr+GBkJYDkF3obZ3LEOk2lUfT+Eyg== +"@cspell/dict-latex@^2.0.9": + version "2.0.9" + resolved "https://registry.yarnpkg.com/@cspell/dict-latex/-/dict-latex-2.0.9.tgz#ba376b2ae8c4b9fad14e8ed293df027a8b08348f" + integrity sha512-d1kTK6dJb5z6UcfASQWjqQlsjZvnoVOvMWxYtLpGksYf6gM4IgqoPVNMLYYK6xBS4T/uAnLIj975A6YuAeyZpg== -"@cspell/dict-lorem-ipsum@^2.0.0": - version "2.0.0" - resolved "https://registry.yarnpkg.com/@cspell/dict-lorem-ipsum/-/dict-lorem-ipsum-2.0.0.tgz#47f2a9ec24808cdf8417457ae8f5a588f33c338c" - integrity sha512-jKogAKtqvgPMleL6usyj3rZ0m8sVUR6drrD+wMnWSfdx1BmUyTsYiuh/mPEfLAebaYHELWSLQG3rDZRvV9Riqg== +"@cspell/dict-lorem-ipsum@^2.0.1": + version "2.0.1" + resolved "https://registry.yarnpkg.com/@cspell/dict-lorem-ipsum/-/dict-lorem-ipsum-2.0.1.tgz#694ffe36ea9cdb7bce35066a850f9d4e4811c5d9" + integrity sha512-s7Ft8UiloUJwgz4z8uLeFvCkeTcZ43HQl7mSAlZd76eW+keLSsdeGmLDx2zaciqo+MftPGyzygVCwaJjTGxiew== "@cspell/dict-lua@^2.0.0": version "2.0.0" resolved "https://registry.yarnpkg.com/@cspell/dict-lua/-/dict-lua-2.0.0.tgz#b96d0363a28ac7e0483ad03edb21705c4f951459" integrity sha512-7WUEBEspSKtsq104WdIys1+DLqAxpJPzw74Py1TuE3fI5GvlzeSZkRFP2ya54GB2lCO4C3mq4M8EnitpibVDfw== -"@cspell/dict-node@^2.0.1": - version "2.0.1" - resolved "https://registry.yarnpkg.com/@cspell/dict-node/-/dict-node-2.0.1.tgz#eda891ebdbce83f20829cb6c85cd209da8cf5cdd" - integrity sha512-ztBWzhvI+YaMehICSJ65cohhjQqoztxf9vrS3YckOiVGBFvUMaFVNdX9klQkvrLcS/O4+2PzoGeIEkmf99amLA== +"@cspell/dict-node@^3.0.1": + version "3.0.1" + resolved "https://registry.yarnpkg.com/@cspell/dict-node/-/dict-node-3.0.1.tgz#a6ee043f5dc044391e5ecc4f293497f9d96d48e1" + integrity sha512-sK2cpuV0EAc43Amd5xeQXkI9MeRTECMw+yjap06gKSModbgI7BqJUHeKZed+0Hii+LpaJ4TYpLGiRVsO+qSk0w== -"@cspell/dict-npm@^2.0.3": - version "2.0.3" - resolved "https://registry.yarnpkg.com/@cspell/dict-npm/-/dict-npm-2.0.3.tgz#044d71c36cf322f2816a77978bfd5dc21698667c" - integrity sha512-K/rnVhmHkR3jfdo7o8P2NDKyMcpVe9pUBiFDY1y2C0YqZXIxCz1f5hObm/hxyO+Vbn5VLU3TKU5fZ5z3LspXOg== +"@cspell/dict-npm@^3.1.2": + version "3.1.3" + resolved "https://registry.yarnpkg.com/@cspell/dict-npm/-/dict-npm-3.1.3.tgz#dfba43f30cd9e9945f1a9d9fbe0446feab2669f5" + integrity sha512-xnGp+TMpArdMLBUSG+ZrbEuhvY016rb76Yh35/OPDDEEz4ulENxLSZJxtN2/A0tZ9FJngDNSdFh7eJsOFmciZQ== "@cspell/dict-php@^2.0.0": version "2.0.0" @@ -1402,50 +1454,55 @@ resolved "https://registry.yarnpkg.com/@cspell/dict-powershell/-/dict-powershell-2.0.0.tgz#6e8ae7381b1928dfaf8f5a625f8fae6e8d93f224" integrity sha512-6uvEhLiGmG3u9TFkM1TYcky6aL9Yk7Sk3KJwoTYBaQJY2KqrprgyQtW6yxIw9oU52VRHlq3KKvSAA9Q26+SIkQ== -"@cspell/dict-public-licenses@^1.0.4": - version "1.0.4" - resolved "https://registry.yarnpkg.com/@cspell/dict-public-licenses/-/dict-public-licenses-1.0.4.tgz#13c2af357e7139bf3896eba58e0feb9f51053b3f" - integrity sha512-h4xULfVEDUeWyvp1OO19pcGDqWcBEQ7WGMp3QBHyYpjsamlzsyYYjCRSY2ZvpM7wruDmywSRFmRHJ/+uNFT7nA== +"@cspell/dict-public-licenses@^1.0.6": + version "1.0.6" + resolved "https://registry.yarnpkg.com/@cspell/dict-public-licenses/-/dict-public-licenses-1.0.6.tgz#e296be04dfa8db9596ea1874d26dfd0ec3d62e80" + integrity sha512-Z9IUFPkkOpOsEdgPUfQOJNQ+qU6+iBAZWS/CR5sUqTX+s5VkPNVwQyVC2kdmgmE2U5qwzAPewG6nVKr2MVogwg== -"@cspell/dict-python@^3.0.3": - version "3.0.3" - resolved "https://registry.yarnpkg.com/@cspell/dict-python/-/dict-python-3.0.3.tgz#6c55ee768ffe93a828e607bcab437ccf78c494c6" - integrity sha512-Mt415KczTfqmLvKTgeV8FzMzpms9baTS0P5HfULTW+UxQtZeroviYyRM9TJPJKJSoI0ISu0GiIDgmYlV7+YPog== +"@cspell/dict-python@^3.0.6": + version "3.0.6" + resolved "https://registry.yarnpkg.com/@cspell/dict-python/-/dict-python-3.0.6.tgz#884f398e053a5d500adc9de47d1f1049a7afcc9c" + integrity sha512-tzxJ4sd9ZGhAUKg/WJJpQGDNtoHvM8Wn+iS2+PnQj2/LTHBW4mnaCogsGsBtYu8C4b2+BEQs+tc5808AeEfLug== -"@cspell/dict-r@^1.0.2": - version "1.0.2" - resolved "https://registry.yarnpkg.com/@cspell/dict-r/-/dict-r-1.0.2.tgz#4f21b240427e9bbaab8f82e0e20122d6b3cf7cee" - integrity sha512-Rp3d4sgD6izW9TW5yVI3D//3HTl9oOGBuzTvXRdoHksVPRvzIu2liVhj8MnQ3XIRe5Kc6IhLBAm6izuV2BpGwQ== +"@cspell/dict-r@^1.0.3": + version "1.0.3" + resolved "https://registry.yarnpkg.com/@cspell/dict-r/-/dict-r-1.0.3.tgz#1480016695ee119cf63fa8c71b161d033bbb9029" + integrity sha512-u2qeXd4cx/TvTVcmkvA+sK6f4K1uMAMO6QPMSr1pSvqGElPRP1mIBXmuiSuBzLO3LbsJuUEHw5Cp3/bxIB6rNA== -"@cspell/dict-ruby@^2.0.1": - version "2.0.1" - resolved "https://registry.yarnpkg.com/@cspell/dict-ruby/-/dict-ruby-2.0.1.tgz#1cbd4d8803428bd421a5562b2d2bb4b3bae80bce" - integrity sha512-qGqhYfFeoBOashv/l0Kj5o4ilyvfq0s+t+r32juPOkOnbHz+hzxnJo2tMMg/L/UdjVV7Y8ovg4LDBC/seVrMYQ== +"@cspell/dict-ruby@^2.0.2": + version "2.0.2" + resolved "https://registry.yarnpkg.com/@cspell/dict-ruby/-/dict-ruby-2.0.2.tgz#a0e9737832047e146e113f72268e198defda4e71" + integrity sha512-vVnUpSmGDbPjs7MHq741DsLHhQcoA4CnUCM9wsTorQ9AQRDAkDTbK/LcY8nM19MoXCb3eF8PFku5Jq+gqH0u7w== -"@cspell/dict-rust@^2.0.0": - version "2.0.0" - resolved "https://registry.yarnpkg.com/@cspell/dict-rust/-/dict-rust-2.0.0.tgz#89acc6c251164b09c424d23abb5ee560a4484ee6" - integrity sha512-EWlQivTKXMU3TTcq/Pi6KPKTQADknasQ700UrxRPzxhwQ4sKVZ88GDu6VZJlsbFUz8Vko289KS6wjiox/7WpmQ== +"@cspell/dict-rust@^2.0.1": + version "2.0.1" + resolved "https://registry.yarnpkg.com/@cspell/dict-rust/-/dict-rust-2.0.1.tgz#2923392a41784e76ee00b9456d581f86a83097fb" + integrity sha512-ATDpIh0VWpQdUIZa8zqqJY4wQz3q00BTXlQCodeOmObYSb23+L6KWWzJ8mKLgpbc1lqTkogWrqxiCxlrCmqNmg== "@cspell/dict-scala@^2.0.0": version "2.0.0" resolved "https://registry.yarnpkg.com/@cspell/dict-scala/-/dict-scala-2.0.0.tgz#b8098103bb03a13406c1c79f1769052353aafac4" integrity sha512-MUwA2YKpqaQOSR4V1/CVGRNk8Ii5kf6I8Ch+4/BhRZRQXuwWbi21rDRYWPqdQWps7VNzAbbMA+PQDWsD5YY38g== -"@cspell/dict-software-terms@^2.1.5": - version "2.1.5" - resolved "https://registry.yarnpkg.com/@cspell/dict-software-terms/-/dict-software-terms-2.1.5.tgz#4e2aa08839f37aa933cf1ac5196dbc7005bc8d3e" - integrity sha512-ylXWCsOJlYuucaMoHaHQLVaB8HeDrsCZ42a3jrTC/i6F/SF9I+4tBg4lMivd4w31bXBgILdbIvVHtWzJf+5m0A== +"@cspell/dict-software-terms@^2.2.11": + version "2.2.12" + resolved "https://registry.yarnpkg.com/@cspell/dict-software-terms/-/dict-software-terms-2.2.12.tgz#2cdf890409311144c2b0f67d915167e851832b2d" + integrity sha512-wVVy4on8Uq5VAWm3cqrrhewTRRbpmNxtmTURGQ5rT6FqUtJvZ7W2Pj3QquzXsA9zSFZhGFQR3U7IdFesET9yAg== -"@cspell/dict-swift@^1.0.2": - version "1.0.2" - resolved "https://registry.yarnpkg.com/@cspell/dict-swift/-/dict-swift-1.0.2.tgz#8d8f7f7a5c8d7cbcdb46fcf4526938ce9cb687a4" - integrity sha512-IrMcRO7AYB2qU5cj4ttZyEbd04DRNOG6Iha106qGGmn4P096m+Y7lOnSLJx/rZbD/cAT3Z/7i465Lr1J93j7yg== +"@cspell/dict-sql@^1.0.4": + version "1.0.4" + resolved "https://registry.yarnpkg.com/@cspell/dict-sql/-/dict-sql-1.0.4.tgz#109fb8b65ab125af1b4d66654626592fd1f23330" + integrity sha512-+9nMcwsCzdYH0tyv2LeuVvQ+DdecS2C1N+hw6sl0FTHWI5GwULHAGW840RBwcKw0s+dl7sc0WpZhS1EW7b0pXg== -"@cspell/dict-typescript@^2.0.0": - version "2.0.0" - resolved "https://registry.yarnpkg.com/@cspell/dict-typescript/-/dict-typescript-2.0.0.tgz#c1ce88dcb1b480623eb537670d11844047539a53" - integrity sha512-WFBahxsnD2y4Os14tE5Zxh31Ggn4DzGOAu3UoxYl1lLLxaszx4RH7LmAeFuznySboiaBeRBbpfJOjQA796O6VQ== +"@cspell/dict-swift@^1.0.3": + version "1.0.3" + resolved "https://registry.yarnpkg.com/@cspell/dict-swift/-/dict-swift-1.0.3.tgz#b819da0ca2c5dfecdd61bec55181636a06d23677" + integrity sha512-yOBLSaRD0AnkkkndJ8PuB82Evp6lA2xItf2AWsnPfCCgxp5Ojk6uUBC/WQBSkzkCAOGbXyHsu9D97tsOx2c6cw== + +"@cspell/dict-typescript@^2.0.2": + version "2.0.2" + resolved "https://registry.yarnpkg.com/@cspell/dict-typescript/-/dict-typescript-2.0.2.tgz#2cf4aa7a4e9c0a336fe442d8734a6f6dee273611" + integrity sha512-OIoSJsCw9WHX4eDikoF5/0QbptMPZjElOcMYdYCyV03nqV5n4ot72ysTexW95yW4+fQU6uDPNQvnrUnhXXEkTA== "@cspell/dict-vue@^2.0.2": version "2.0.2" @@ -1464,75 +1521,44 @@ dependencies: "@cspotcode/source-map-consumer" "0.8.0" -"@cypress/request@^2.88.5": - version "2.88.10" - resolved "https://registry.yarnpkg.com/@cypress/request/-/request-2.88.10.tgz#b66d76b07f860d3a4b8d7a0604d020c662752cce" - integrity sha512-Zp7F+R93N0yZyG34GutyTNr+okam7s/Fzc1+i3kcqOP8vk6OuajuE9qZJ6Rs+10/1JFtXFYMdyarnU1rZuJesg== - dependencies: - aws-sign2 "~0.7.0" - aws4 "^1.8.0" - caseless "~0.12.0" - combined-stream "~1.0.6" - extend "~3.0.2" - forever-agent "~0.6.1" - form-data "~2.3.2" - http-signature "~1.3.6" - is-typedarray "~1.0.0" - isstream "~0.1.2" - json-stringify-safe "~5.0.1" - mime-types "~2.1.19" - performance-now "^2.1.0" - qs "~6.5.2" - safe-buffer "^5.1.2" - tough-cookie "~2.5.0" - tunnel-agent "^0.6.0" - uuid "^8.3.2" - -"@cypress/xvfb@^1.2.4": - version "1.2.4" - resolved "https://registry.yarnpkg.com/@cypress/xvfb/-/xvfb-1.2.4.tgz#2daf42e8275b39f4aa53c14214e557bd14e7748a" - integrity sha512-skbBzPggOVYCbnGgV+0dmBdW/s77ZkAOXIC1knS8NagwDjBrNC1LuXtQJeiN6l+m7lzmHtaoUw/ctJKdqkG57Q== - dependencies: - debug "^3.1.0" - lodash.once "^4.1.1" - -"@docsearch/css@3.1.0": - version "3.1.0" - resolved "https://registry.yarnpkg.com/@docsearch/css/-/css-3.1.0.tgz#6781cad43fc2e034d012ee44beddf8f93ba21f19" - integrity sha512-bh5IskwkkodbvC0FzSg1AxMykfDl95hebEKwxNoq4e5QaGzOXSBgW8+jnMFZ7JU4sTBiB04vZWoUSzNrPboLZA== +"@docsearch/css@3.1.1": + version "3.1.1" + resolved "https://registry.yarnpkg.com/@docsearch/css/-/css-3.1.1.tgz#e0976bf995e383f8ee8657306311b9cb95016330" + integrity sha512-utLgg7E1agqQeqCJn05DWC7XXMk4tMUUnL7MZupcknRu2OzGN13qwey2qA/0NAKkVBGugiWtON0+rlU0QIPojg== -"@docsearch/react@^3.1.0": - version "3.1.0" - resolved "https://registry.yarnpkg.com/@docsearch/react/-/react-3.1.0.tgz#da943a64c01ee82b04e53b691806469272f943f7" - integrity sha512-bjB6ExnZzf++5B7Tfoi6UXgNwoUnNOfZ1NyvnvPhWgCMy5V/biAtLL4o7owmZSYdAKeFSvZ5Lxm0is4su/dBWg== +"@docsearch/react@^3.1.1": + version "3.1.1" + resolved "https://registry.yarnpkg.com/@docsearch/react/-/react-3.1.1.tgz#3dffb5db8cf9eb95d6e732cf038264bfc10191ed" + integrity sha512-cfoql4qvtsVRqBMYxhlGNpvyy/KlCoPqjIsJSZYqYf9AplZncKjLBTcwBu6RXFMVCe30cIFljniI4OjqAU67pQ== dependencies: - "@algolia/autocomplete-core" "1.6.3" - "@docsearch/css" "3.1.0" + "@algolia/autocomplete-core" "1.7.1" + "@algolia/autocomplete-preset-algolia" "1.7.1" + "@docsearch/css" "3.1.1" algoliasearch "^4.0.0" -"@docusaurus/core@2.0.0-beta.21": - version "2.0.0-beta.21" - resolved "https://registry.yarnpkg.com/@docusaurus/core/-/core-2.0.0-beta.21.tgz#50897317b22dbd94b1bf91bb30c2a0fddd15a806" - integrity sha512-qysDMVp1M5UozK3u/qOxsEZsHF7jeBvJDS+5ItMPYmNKvMbNKeYZGA0g6S7F9hRDwjIlEbvo7BaX0UMDcmTAWA== +"@docusaurus/core@2.2.0", "@docusaurus/core@~2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@docusaurus/core/-/core-2.2.0.tgz#64c9ee31502c23b93c869f8188f73afaf5fd4867" + integrity sha512-Vd6XOluKQqzG12fEs9prJgDtyn6DPok9vmUWDR2E6/nV5Fl9SVkhEQOBxwObjk3kQh7OY7vguFaLh0jqdApWsA== dependencies: - "@babel/core" "^7.18.2" - "@babel/generator" "^7.18.2" + "@babel/core" "^7.18.6" + "@babel/generator" "^7.18.7" "@babel/plugin-syntax-dynamic-import" "^7.8.3" - "@babel/plugin-transform-runtime" "^7.18.2" - "@babel/preset-env" "^7.18.2" - "@babel/preset-react" "^7.17.12" - "@babel/preset-typescript" "^7.17.12" - "@babel/runtime" "^7.18.3" - "@babel/runtime-corejs3" "^7.18.3" - "@babel/traverse" "^7.18.2" - "@docusaurus/cssnano-preset" "2.0.0-beta.21" - "@docusaurus/logger" "2.0.0-beta.21" - "@docusaurus/mdx-loader" "2.0.0-beta.21" + "@babel/plugin-transform-runtime" "^7.18.6" + "@babel/preset-env" "^7.18.6" + "@babel/preset-react" "^7.18.6" + "@babel/preset-typescript" "^7.18.6" + "@babel/runtime" "^7.18.6" + "@babel/runtime-corejs3" "^7.18.6" + "@babel/traverse" "^7.18.8" + "@docusaurus/cssnano-preset" "2.2.0" + "@docusaurus/logger" "2.2.0" + "@docusaurus/mdx-loader" "2.2.0" "@docusaurus/react-loadable" "5.5.2" - "@docusaurus/utils" "2.0.0-beta.21" - "@docusaurus/utils-common" "2.0.0-beta.21" - "@docusaurus/utils-validation" "2.0.0-beta.21" - "@slorber/static-site-generator-webpack-plugin" "^4.0.4" + "@docusaurus/utils" "2.2.0" + "@docusaurus/utils-common" "2.2.0" + "@docusaurus/utils-validation" "2.2.0" + "@slorber/static-site-generator-webpack-plugin" "^4.0.7" "@svgr/webpack" "^6.2.1" autoprefixer "^10.4.7" babel-loader "^8.2.5" @@ -1545,10 +1571,10 @@ combine-promises "^1.1.0" commander "^5.1.0" copy-webpack-plugin "^11.0.0" - core-js "^3.22.7" + core-js "^3.23.3" css-loader "^6.7.1" css-minimizer-webpack-plugin "^4.0.0" - cssnano "^5.1.9" + cssnano "^5.1.12" del "^6.1.1" detect-port "^1.3.0" escape-html "^1.0.3" @@ -1561,7 +1587,7 @@ import-fresh "^3.3.0" leven "^3.1.0" lodash "^4.17.21" - mini-css-extract-plugin "^2.6.0" + mini-css-extract-plugin "^2.6.1" postcss "^8.4.14" postcss-loader "^7.0.0" prompts "^2.4.2" @@ -1572,49 +1598,48 @@ react-router "^5.3.3" react-router-config "^5.1.1" react-router-dom "^5.3.3" - remark-admonitions "^1.2.1" rtl-detect "^1.0.4" semver "^7.3.7" serve-handler "^6.1.3" shelljs "^0.8.5" - terser-webpack-plugin "^5.3.1" + terser-webpack-plugin "^5.3.3" tslib "^2.4.0" update-notifier "^5.1.0" url-loader "^4.1.1" wait-on "^6.0.1" - webpack "^5.72.1" + webpack "^5.73.0" webpack-bundle-analyzer "^4.5.0" - webpack-dev-server "^4.9.0" + webpack-dev-server "^4.9.3" webpack-merge "^5.8.0" webpackbar "^5.0.2" -"@docusaurus/cssnano-preset@2.0.0-beta.21": - version "2.0.0-beta.21" - resolved "https://registry.yarnpkg.com/@docusaurus/cssnano-preset/-/cssnano-preset-2.0.0-beta.21.tgz#38113877a5857c3f9d493522085d20909dcec474" - integrity sha512-fhTZrg1vc6zYYZIIMXpe1TnEVGEjqscBo0s1uomSwKjjtMgu7wkzc1KKJYY7BndsSA+fVVkZ+OmL/kAsmK7xxw== +"@docusaurus/cssnano-preset@2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@docusaurus/cssnano-preset/-/cssnano-preset-2.2.0.tgz#fc05044659051ae74ab4482afcf4a9936e81d523" + integrity sha512-mAAwCo4n66TMWBH1kXnHVZsakW9VAXJzTO4yZukuL3ro4F+JtkMwKfh42EG75K/J/YIFQG5I/Bzy0UH/hFxaTg== dependencies: - cssnano-preset-advanced "^5.3.5" + cssnano-preset-advanced "^5.3.8" postcss "^8.4.14" postcss-sort-media-queries "^4.2.1" tslib "^2.4.0" -"@docusaurus/logger@2.0.0-beta.21": - version "2.0.0-beta.21" - resolved "https://registry.yarnpkg.com/@docusaurus/logger/-/logger-2.0.0-beta.21.tgz#f6ab4133917965349ae03fd9111a940b24d4fd12" - integrity sha512-HTFp8FsSMrAj7Uxl5p72U+P7rjYU/LRRBazEoJbs9RaqoKEdtZuhv8MYPOCh46K9TekaoquRYqag2o23Qt4ggA== +"@docusaurus/logger@2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@docusaurus/logger/-/logger-2.2.0.tgz#ea2f7feda7b8675485933b87f06d9c976d17423f" + integrity sha512-DF3j1cA5y2nNsu/vk8AG7xwpZu6f5MKkPPMaaIbgXLnWGfm6+wkOeW7kNrxnM95YOhKUkJUophX69nGUnLsm0A== dependencies: chalk "^4.1.2" tslib "^2.4.0" -"@docusaurus/mdx-loader@2.0.0-beta.21": - version "2.0.0-beta.21" - resolved "https://registry.yarnpkg.com/@docusaurus/mdx-loader/-/mdx-loader-2.0.0-beta.21.tgz#52af341e21f22be882d2155a7349bea10f5d77a3" - integrity sha512-AI+4obJnpOaBOAYV6df2ux5Y1YJCBS+MhXFf0yhED12sVLJi2vffZgdamYd/d/FwvWDw6QLs/VD2jebd7P50yQ== +"@docusaurus/mdx-loader@2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@docusaurus/mdx-loader/-/mdx-loader-2.2.0.tgz#fd558f429e5d9403d284bd4214e54d9768b041a0" + integrity sha512-X2bzo3T0jW0VhUU+XdQofcEeozXOTmKQMvc8tUnWRdTnCvj4XEcBVdC3g+/jftceluiwSTNRAX4VBOJdNt18jA== dependencies: - "@babel/parser" "^7.18.3" - "@babel/traverse" "^7.18.2" - "@docusaurus/logger" "2.0.0-beta.21" - "@docusaurus/utils" "2.0.0-beta.21" + "@babel/parser" "^7.18.8" + "@babel/traverse" "^7.18.8" + "@docusaurus/logger" "2.2.0" + "@docusaurus/utils" "2.2.0" "@mdx-js/mdx" "^1.6.22" escape-html "^1.0.3" file-loader "^6.2.0" @@ -1624,136 +1649,171 @@ remark-emoji "^2.2.0" stringify-object "^3.3.0" tslib "^2.4.0" + unified "^9.2.2" unist-util-visit "^2.0.3" url-loader "^4.1.1" - webpack "^5.72.1" + webpack "^5.73.0" -"@docusaurus/module-type-aliases@2.0.0-beta.21", "@docusaurus/module-type-aliases@^2.0.0-beta.21": - version "2.0.0-beta.21" - resolved "https://registry.yarnpkg.com/@docusaurus/module-type-aliases/-/module-type-aliases-2.0.0-beta.21.tgz#345f1c1a99407775d1d3ffc1a90c2df93d50a9b8" - integrity sha512-gRkWICgQZiqSJgrwRKWjXm5gAB+9IcfYdUbCG0PRPP/G8sNs9zBIOY4uT4Z5ox2CWFEm44U3RTTxj7BiLVMBXw== +"@docusaurus/module-type-aliases@2.2.0", "@docusaurus/module-type-aliases@~2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@docusaurus/module-type-aliases/-/module-type-aliases-2.2.0.tgz#1e23e54a1bbb6fde1961e4fa395b1b69f4803ba5" + integrity sha512-wDGW4IHKoOr9YuJgy7uYuKWrDrSpsUSDHLZnWQYM9fN7D5EpSmYHjFruUpKWVyxLpD/Wh0rW8hYZwdjJIQUQCQ== dependencies: - "@docusaurus/types" "2.0.0-beta.21" + "@docusaurus/react-loadable" "5.5.2" + "@docusaurus/types" "2.2.0" + "@types/history" "^4.7.11" "@types/react" "*" "@types/react-router-config" "*" "@types/react-router-dom" "*" react-helmet-async "*" + react-loadable "npm:@docusaurus/react-loadable@5.5.2" -"@docusaurus/plugin-content-blog@2.0.0-beta.21": - version "2.0.0-beta.21" - resolved "https://registry.yarnpkg.com/@docusaurus/plugin-content-blog/-/plugin-content-blog-2.0.0-beta.21.tgz#86211deeea901ddcd77ca387778e121e93ee8d01" - integrity sha512-IP21yJViP3oBmgsWBU5LhrG1MZXV4mYCQSoCAboimESmy1Z11RCNP2tXaqizE3iTmXOwZZL+SNBk06ajKCEzWg== - dependencies: - "@docusaurus/core" "2.0.0-beta.21" - "@docusaurus/logger" "2.0.0-beta.21" - "@docusaurus/mdx-loader" "2.0.0-beta.21" - "@docusaurus/utils" "2.0.0-beta.21" - "@docusaurus/utils-common" "2.0.0-beta.21" - "@docusaurus/utils-validation" "2.0.0-beta.21" - cheerio "^1.0.0-rc.11" +"@docusaurus/plugin-content-blog@2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@docusaurus/plugin-content-blog/-/plugin-content-blog-2.2.0.tgz#dc55982e76771f4e678ac10e26d10e1da2011dc1" + integrity sha512-0mWBinEh0a5J2+8ZJXJXbrCk1tSTNf7Nm4tYAl5h2/xx+PvH/Bnu0V+7mMljYm/1QlDYALNIIaT/JcoZQFUN3w== + dependencies: + "@docusaurus/core" "2.2.0" + "@docusaurus/logger" "2.2.0" + "@docusaurus/mdx-loader" "2.2.0" + "@docusaurus/types" "2.2.0" + "@docusaurus/utils" "2.2.0" + "@docusaurus/utils-common" "2.2.0" + "@docusaurus/utils-validation" "2.2.0" + cheerio "^1.0.0-rc.12" feed "^4.2.2" fs-extra "^10.1.0" lodash "^4.17.21" reading-time "^1.5.0" - remark-admonitions "^1.2.1" tslib "^2.4.0" unist-util-visit "^2.0.3" utility-types "^3.10.0" - webpack "^5.72.1" - -"@docusaurus/plugin-content-docs@2.0.0-beta.21": - version "2.0.0-beta.21" - resolved "https://registry.yarnpkg.com/@docusaurus/plugin-content-docs/-/plugin-content-docs-2.0.0-beta.21.tgz#b3171fa9aed99e367b6eb7111187bd0e3dcf2949" - integrity sha512-aa4vrzJy4xRy81wNskyhE3wzRf3AgcESZ1nfKh8xgHUkT7fDTZ1UWlg50Jb3LBCQFFyQG2XQB9N6llskI/KUnw== - dependencies: - "@docusaurus/core" "2.0.0-beta.21" - "@docusaurus/logger" "2.0.0-beta.21" - "@docusaurus/mdx-loader" "2.0.0-beta.21" - "@docusaurus/utils" "2.0.0-beta.21" - "@docusaurus/utils-validation" "2.0.0-beta.21" + webpack "^5.73.0" + +"@docusaurus/plugin-content-docs@2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@docusaurus/plugin-content-docs/-/plugin-content-docs-2.2.0.tgz#0fcb85226fcdb80dc1e2d4a36ef442a650dcc84d" + integrity sha512-BOazBR0XjzsHE+2K1wpNxz5QZmrJgmm3+0Re0EVPYFGW8qndCWGNtXW/0lGKhecVPML8yyFeAmnUCIs7xM2wPw== + dependencies: + "@docusaurus/core" "2.2.0" + "@docusaurus/logger" "2.2.0" + "@docusaurus/mdx-loader" "2.2.0" + "@docusaurus/module-type-aliases" "2.2.0" + "@docusaurus/types" "2.2.0" + "@docusaurus/utils" "2.2.0" + "@docusaurus/utils-validation" "2.2.0" + "@types/react-router-config" "^5.0.6" combine-promises "^1.1.0" fs-extra "^10.1.0" import-fresh "^3.3.0" js-yaml "^4.1.0" lodash "^4.17.21" - remark-admonitions "^1.2.1" tslib "^2.4.0" utility-types "^3.10.0" - webpack "^5.72.1" + webpack "^5.73.0" -"@docusaurus/plugin-content-pages@2.0.0-beta.21": - version "2.0.0-beta.21" - resolved "https://registry.yarnpkg.com/@docusaurus/plugin-content-pages/-/plugin-content-pages-2.0.0-beta.21.tgz#df6b4c5c4cde8a0ea491a30002e84941ca7bf0cf" - integrity sha512-DmXOXjqNI+7X5hISzCvt54QIK6XBugu2MOxjxzuqI7q92Lk/EVdraEj5mthlH8IaEH/VlpWYJ1O9TzLqX5vH2g== - dependencies: - "@docusaurus/core" "2.0.0-beta.21" - "@docusaurus/mdx-loader" "2.0.0-beta.21" - "@docusaurus/utils" "2.0.0-beta.21" - "@docusaurus/utils-validation" "2.0.0-beta.21" +"@docusaurus/plugin-content-pages@2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@docusaurus/plugin-content-pages/-/plugin-content-pages-2.2.0.tgz#e3f40408787bbe229545dd50595f87e1393bc3ae" + integrity sha512-+OTK3FQHk5WMvdelz8v19PbEbx+CNT6VSpx7nVOvMNs5yJCKvmqBJBQ2ZSxROxhVDYn+CZOlmyrC56NSXzHf6g== + dependencies: + "@docusaurus/core" "2.2.0" + "@docusaurus/mdx-loader" "2.2.0" + "@docusaurus/types" "2.2.0" + "@docusaurus/utils" "2.2.0" + "@docusaurus/utils-validation" "2.2.0" fs-extra "^10.1.0" - remark-admonitions "^1.2.1" tslib "^2.4.0" - webpack "^5.72.1" + webpack "^5.73.0" -"@docusaurus/plugin-debug@2.0.0-beta.21": - version "2.0.0-beta.21" - resolved "https://registry.yarnpkg.com/@docusaurus/plugin-debug/-/plugin-debug-2.0.0-beta.21.tgz#dfa212fd90fe2f54439aacdc8c143e8ce96b0d27" - integrity sha512-P54J4q4ecsyWW0Jy4zbimSIHna999AfbxpXGmF1IjyHrjoA3PtuakV1Ai51XrGEAaIq9q6qMQkEhbUd3CffGAw== +"@docusaurus/plugin-debug@2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@docusaurus/plugin-debug/-/plugin-debug-2.2.0.tgz#b38741d2c492f405fee01ee0ef2e0029cedb689a" + integrity sha512-p9vOep8+7OVl6r/NREEYxf4HMAjV8JMYJ7Bos5fCFO0Wyi9AZEo0sCTliRd7R8+dlJXZEgcngSdxAUo/Q+CJow== dependencies: - "@docusaurus/core" "2.0.0-beta.21" - "@docusaurus/utils" "2.0.0-beta.21" + "@docusaurus/core" "2.2.0" + "@docusaurus/types" "2.2.0" + "@docusaurus/utils" "2.2.0" fs-extra "^10.1.0" react-json-view "^1.21.3" tslib "^2.4.0" -"@docusaurus/plugin-google-analytics@2.0.0-beta.21": - version "2.0.0-beta.21" - resolved "https://registry.yarnpkg.com/@docusaurus/plugin-google-analytics/-/plugin-google-analytics-2.0.0-beta.21.tgz#5475c58fb23603badf41d84298569f6c46b4e6b2" - integrity sha512-+5MS0PeGaJRgPuNZlbd/WMdQSpOACaxEz7A81HAxm6kE+tIASTW3l8jgj1eWFy/PGPzaLnQrEjxI1McAfnYmQw== +"@docusaurus/plugin-google-analytics@2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@docusaurus/plugin-google-analytics/-/plugin-google-analytics-2.2.0.tgz#63c7137eff5a1208d2059fea04b5207c037d7954" + integrity sha512-+eZVVxVeEnV5nVQJdey9ZsfyEVMls6VyWTIj8SmX0k5EbqGvnIfET+J2pYEuKQnDIHxy+syRMoRM6AHXdHYGIg== + dependencies: + "@docusaurus/core" "2.2.0" + "@docusaurus/types" "2.2.0" + "@docusaurus/utils-validation" "2.2.0" + tslib "^2.4.0" + +"@docusaurus/plugin-google-gtag@2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@docusaurus/plugin-google-gtag/-/plugin-google-gtag-2.2.0.tgz#7b086d169ac5fe9a88aca10ab0fd2bf00c6c6b12" + integrity sha512-6SOgczP/dYdkqUMGTRqgxAS1eTp6MnJDAQMy8VCF1QKbWZmlkx4agHDexihqmYyCujTYHqDAhm1hV26EET54NQ== dependencies: - "@docusaurus/core" "2.0.0-beta.21" - "@docusaurus/utils-validation" "2.0.0-beta.21" + "@docusaurus/core" "2.2.0" + "@docusaurus/types" "2.2.0" + "@docusaurus/utils-validation" "2.2.0" tslib "^2.4.0" -"@docusaurus/plugin-google-gtag@2.0.0-beta.21": - version "2.0.0-beta.21" - resolved "https://registry.yarnpkg.com/@docusaurus/plugin-google-gtag/-/plugin-google-gtag-2.0.0-beta.21.tgz#a4a101089994a7103c1cc7cddb15170427b185d6" - integrity sha512-4zxKZOnf0rfh6myXLG7a6YZfQcxYDMBsWqANEjCX77H5gPdK+GHZuDrxK6sjFvRBv4liYCrNjo7HJ4DpPoT0zA== - dependencies: - "@docusaurus/core" "2.0.0-beta.21" - "@docusaurus/utils-validation" "2.0.0-beta.21" +"@docusaurus/plugin-pwa@~2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@docusaurus/plugin-pwa/-/plugin-pwa-2.2.0.tgz#2aca00d268efbca8f3cf1c3e260b801e6f7f8af5" + integrity sha512-j1ldskYXkKYmWB6V1I0Lv2o9EUhSdGI6pCo0RFGaLijJKLlA9R+F5j+0kWvoyirXM7LRGknkXYYkc50i25R5Sw== + dependencies: + "@babel/core" "^7.18.6" + "@babel/preset-env" "^7.18.6" + "@docusaurus/core" "2.2.0" + "@docusaurus/theme-common" "2.2.0" + "@docusaurus/theme-translations" "2.2.0" + "@docusaurus/types" "2.2.0" + "@docusaurus/utils" "2.2.0" + "@docusaurus/utils-validation" "2.2.0" + babel-loader "^8.2.5" + clsx "^1.2.1" + core-js "^3.23.3" + terser-webpack-plugin "^5.3.3" tslib "^2.4.0" + webpack "^5.73.0" + webpack-merge "^5.8.0" + workbox-build "^6.5.3" + workbox-precaching "^6.5.3" + workbox-window "^6.5.3" -"@docusaurus/plugin-sitemap@2.0.0-beta.21": - version "2.0.0-beta.21" - resolved "https://registry.yarnpkg.com/@docusaurus/plugin-sitemap/-/plugin-sitemap-2.0.0-beta.21.tgz#8bfa695eada2ec95c9376a884641237ffca5dd3d" - integrity sha512-/ynWbcXZXcYZ6sT2X6vAJbnfqcPxwdGEybd0rcRZi4gBHq6adMofYI25AqELmnbBDxt0If+vlAeUHFRG5ueP7Q== - dependencies: - "@docusaurus/core" "2.0.0-beta.21" - "@docusaurus/logger" "2.0.0-beta.21" - "@docusaurus/utils" "2.0.0-beta.21" - "@docusaurus/utils-common" "2.0.0-beta.21" - "@docusaurus/utils-validation" "2.0.0-beta.21" +"@docusaurus/plugin-sitemap@2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@docusaurus/plugin-sitemap/-/plugin-sitemap-2.2.0.tgz#876da60937886032d63143253d420db6a4b34773" + integrity sha512-0jAmyRDN/aI265CbWZNZuQpFqiZuo+5otk2MylU9iVrz/4J7gSc+ZJ9cy4EHrEsW7PV8s1w18hIEsmcA1YgkKg== + dependencies: + "@docusaurus/core" "2.2.0" + "@docusaurus/logger" "2.2.0" + "@docusaurus/types" "2.2.0" + "@docusaurus/utils" "2.2.0" + "@docusaurus/utils-common" "2.2.0" + "@docusaurus/utils-validation" "2.2.0" fs-extra "^10.1.0" sitemap "^7.1.1" tslib "^2.4.0" -"@docusaurus/preset-classic@2.0.0-beta.21": - version "2.0.0-beta.21" - resolved "https://registry.yarnpkg.com/@docusaurus/preset-classic/-/preset-classic-2.0.0-beta.21.tgz#1362d8650ebed22633db411caaba80075f7c86ce" - integrity sha512-KvBnIUu7y69pNTJ9UhX6SdNlK6prR//J3L4rhN897tb8xx04xHHILlPXko2Il+C3Xzgh3OCgyvkoz9K6YlFTDw== - dependencies: - "@docusaurus/core" "2.0.0-beta.21" - "@docusaurus/plugin-content-blog" "2.0.0-beta.21" - "@docusaurus/plugin-content-docs" "2.0.0-beta.21" - "@docusaurus/plugin-content-pages" "2.0.0-beta.21" - "@docusaurus/plugin-debug" "2.0.0-beta.21" - "@docusaurus/plugin-google-analytics" "2.0.0-beta.21" - "@docusaurus/plugin-google-gtag" "2.0.0-beta.21" - "@docusaurus/plugin-sitemap" "2.0.0-beta.21" - "@docusaurus/theme-classic" "2.0.0-beta.21" - "@docusaurus/theme-common" "2.0.0-beta.21" - "@docusaurus/theme-search-algolia" "2.0.0-beta.21" +"@docusaurus/preset-classic@~2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@docusaurus/preset-classic/-/preset-classic-2.2.0.tgz#bece5a043eeb74430f7c6c7510000b9c43669eb7" + integrity sha512-yKIWPGNx7BT8v2wjFIWvYrS+nvN04W+UameSFf8lEiJk6pss0kL6SG2MRvyULiI3BDxH+tj6qe02ncpSPGwumg== + dependencies: + "@docusaurus/core" "2.2.0" + "@docusaurus/plugin-content-blog" "2.2.0" + "@docusaurus/plugin-content-docs" "2.2.0" + "@docusaurus/plugin-content-pages" "2.2.0" + "@docusaurus/plugin-debug" "2.2.0" + "@docusaurus/plugin-google-analytics" "2.2.0" + "@docusaurus/plugin-google-gtag" "2.2.0" + "@docusaurus/plugin-sitemap" "2.2.0" + "@docusaurus/theme-classic" "2.2.0" + "@docusaurus/theme-common" "2.2.0" + "@docusaurus/theme-search-algolia" "2.2.0" + "@docusaurus/types" "2.2.0" "@docusaurus/react-loadable@5.5.2", "react-loadable@npm:@docusaurus/react-loadable@5.5.2": version "5.5.2" @@ -1763,124 +1823,134 @@ "@types/react" "*" prop-types "^15.6.2" -"@docusaurus/remark-plugin-npm2yarn@2.0.0-beta.21": - version "2.0.0-beta.21" - resolved "https://registry.yarnpkg.com/@docusaurus/remark-plugin-npm2yarn/-/remark-plugin-npm2yarn-2.0.0-beta.21.tgz#10eb88a2dab6193568eff76b6a83b79e313ef765" - integrity sha512-CqvmoFEj05NzaQBKxnsfI90aM8KHJZWyCzED/Qg5odUD9VtR9zNQJ1Nu/X1ctqCN7FBIxBYk2tz1Xb1+zCP8gg== +"@docusaurus/remark-plugin-npm2yarn@~2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@docusaurus/remark-plugin-npm2yarn/-/remark-plugin-npm2yarn-2.2.0.tgz#12d433eda8986c475277dd7fb8624b10c8a976ea" + integrity sha512-CFiwzk+0QrlBjkcx4cNV8LQZHgo15aQ3piO0Iao0vGXLc7eupGigDLuE7q3Phc10ELweO+P2gRQTjlBqIQTC+Q== dependencies: npm-to-yarn "^1.0.1" tslib "^2.4.0" unist-util-visit "^2.0.3" -"@docusaurus/theme-classic@2.0.0-beta.21": - version "2.0.0-beta.21" - resolved "https://registry.yarnpkg.com/@docusaurus/theme-classic/-/theme-classic-2.0.0-beta.21.tgz#6df5b9ea2d389dafb6f59badeabb3eda060b5017" - integrity sha512-Ge0WNdTefD0VDQfaIMRRWa8tWMG9+8/OlBRd5MK88/TZfqdBq7b/gnCSaalQlvZwwkj6notkKhHx72+MKwWUJA== - dependencies: - "@docusaurus/core" "2.0.0-beta.21" - "@docusaurus/plugin-content-blog" "2.0.0-beta.21" - "@docusaurus/plugin-content-docs" "2.0.0-beta.21" - "@docusaurus/plugin-content-pages" "2.0.0-beta.21" - "@docusaurus/theme-common" "2.0.0-beta.21" - "@docusaurus/theme-translations" "2.0.0-beta.21" - "@docusaurus/utils" "2.0.0-beta.21" - "@docusaurus/utils-common" "2.0.0-beta.21" - "@docusaurus/utils-validation" "2.0.0-beta.21" +"@docusaurus/theme-classic@2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@docusaurus/theme-classic/-/theme-classic-2.2.0.tgz#a048bb1bc077dee74b28bec25f4b84b481863742" + integrity sha512-kjbg/qJPwZ6H1CU/i9d4l/LcFgnuzeiGgMQlt6yPqKo0SOJIBMPuz7Rnu3r/WWbZFPi//o8acclacOzmXdUUEg== + dependencies: + "@docusaurus/core" "2.2.0" + "@docusaurus/mdx-loader" "2.2.0" + "@docusaurus/module-type-aliases" "2.2.0" + "@docusaurus/plugin-content-blog" "2.2.0" + "@docusaurus/plugin-content-docs" "2.2.0" + "@docusaurus/plugin-content-pages" "2.2.0" + "@docusaurus/theme-common" "2.2.0" + "@docusaurus/theme-translations" "2.2.0" + "@docusaurus/types" "2.2.0" + "@docusaurus/utils" "2.2.0" + "@docusaurus/utils-common" "2.2.0" + "@docusaurus/utils-validation" "2.2.0" "@mdx-js/react" "^1.6.22" - clsx "^1.1.1" + clsx "^1.2.1" copy-text-to-clipboard "^3.0.1" - infima "0.2.0-alpha.39" + infima "0.2.0-alpha.42" lodash "^4.17.21" nprogress "^0.2.0" postcss "^8.4.14" - prism-react-renderer "^1.3.3" + prism-react-renderer "^1.3.5" prismjs "^1.28.0" react-router-dom "^5.3.3" rtlcss "^3.5.0" tslib "^2.4.0" + utility-types "^3.10.0" -"@docusaurus/theme-common@2.0.0-beta.21": - version "2.0.0-beta.21" - resolved "https://registry.yarnpkg.com/@docusaurus/theme-common/-/theme-common-2.0.0-beta.21.tgz#508478251982d01655ef505ccb2420db38623db8" - integrity sha512-fTKoTLRfjuFG6c3iwnVjIIOensxWMgdBKLfyE5iih3Lq7tQgkE7NyTGG9BKLrnTJ7cAD2UXdXM9xbB7tBf1qzg== - dependencies: - "@docusaurus/module-type-aliases" "2.0.0-beta.21" - "@docusaurus/plugin-content-blog" "2.0.0-beta.21" - "@docusaurus/plugin-content-docs" "2.0.0-beta.21" - "@docusaurus/plugin-content-pages" "2.0.0-beta.21" - clsx "^1.1.1" +"@docusaurus/theme-common@2.2.0", "@docusaurus/theme-common@~2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@docusaurus/theme-common/-/theme-common-2.2.0.tgz#2303498d80448aafdd588b597ce9d6f4cfa930e4" + integrity sha512-R8BnDjYoN90DCL75gP7qYQfSjyitXuP9TdzgsKDmSFPNyrdE3twtPNa2dIN+h+p/pr+PagfxwWbd6dn722A1Dw== + dependencies: + "@docusaurus/mdx-loader" "2.2.0" + "@docusaurus/module-type-aliases" "2.2.0" + "@docusaurus/plugin-content-blog" "2.2.0" + "@docusaurus/plugin-content-docs" "2.2.0" + "@docusaurus/plugin-content-pages" "2.2.0" + "@docusaurus/utils" "2.2.0" + "@types/history" "^4.7.11" + "@types/react" "*" + "@types/react-router-config" "*" + clsx "^1.2.1" parse-numeric-range "^1.3.0" - prism-react-renderer "^1.3.3" + prism-react-renderer "^1.3.5" tslib "^2.4.0" utility-types "^3.10.0" -"@docusaurus/theme-search-algolia@2.0.0-beta.21": - version "2.0.0-beta.21" - resolved "https://registry.yarnpkg.com/@docusaurus/theme-search-algolia/-/theme-search-algolia-2.0.0-beta.21.tgz#2891f11372e2542e4e1426c3100b72c2d30d4d68" - integrity sha512-T1jKT8MVSSfnztSqeebUOpWHPoHKtwDXtKYE0xC99JWoZ+mMfv8AFhVSoSddn54jLJjV36mxg841eHQIySMCpQ== - dependencies: - "@docsearch/react" "^3.1.0" - "@docusaurus/core" "2.0.0-beta.21" - "@docusaurus/logger" "2.0.0-beta.21" - "@docusaurus/plugin-content-docs" "2.0.0-beta.21" - "@docusaurus/theme-common" "2.0.0-beta.21" - "@docusaurus/theme-translations" "2.0.0-beta.21" - "@docusaurus/utils" "2.0.0-beta.21" - "@docusaurus/utils-validation" "2.0.0-beta.21" +"@docusaurus/theme-search-algolia@2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@docusaurus/theme-search-algolia/-/theme-search-algolia-2.2.0.tgz#77fd9f7a600917e6024fe3ac7fb6cfdf2ce84737" + integrity sha512-2h38B0tqlxgR2FZ9LpAkGrpDWVdXZ7vltfmTdX+4RsDs3A7khiNsmZB+x/x6sA4+G2V2CvrsPMlsYBy5X+cY1w== + dependencies: + "@docsearch/react" "^3.1.1" + "@docusaurus/core" "2.2.0" + "@docusaurus/logger" "2.2.0" + "@docusaurus/plugin-content-docs" "2.2.0" + "@docusaurus/theme-common" "2.2.0" + "@docusaurus/theme-translations" "2.2.0" + "@docusaurus/utils" "2.2.0" + "@docusaurus/utils-validation" "2.2.0" algoliasearch "^4.13.1" - algoliasearch-helper "^3.8.2" - clsx "^1.1.1" + algoliasearch-helper "^3.10.0" + clsx "^1.2.1" eta "^1.12.3" fs-extra "^10.1.0" lodash "^4.17.21" tslib "^2.4.0" utility-types "^3.10.0" -"@docusaurus/theme-translations@2.0.0-beta.21": - version "2.0.0-beta.21" - resolved "https://registry.yarnpkg.com/@docusaurus/theme-translations/-/theme-translations-2.0.0-beta.21.tgz#5da60ffc58de256b96316c5e0fe2733c1e83f22c" - integrity sha512-dLVT9OIIBs6MpzMb1bAy+C0DPJK3e3DNctG+ES0EP45gzEqQxzs4IsghpT+QDaOsuhNnAlosgJpFWX3rqxF9xA== +"@docusaurus/theme-translations@2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@docusaurus/theme-translations/-/theme-translations-2.2.0.tgz#5fbd4693679806f80c26eeae1381e1f2c23d83e7" + integrity sha512-3T140AG11OjJrtKlY4pMZ5BzbGRDjNs2co5hJ6uYJG1bVWlhcaFGqkaZ5lCgKflaNHD7UHBHU9Ec5f69jTdd6w== dependencies: fs-extra "^10.1.0" tslib "^2.4.0" -"@docusaurus/types@2.0.0-beta.21": - version "2.0.0-beta.21" - resolved "https://registry.yarnpkg.com/@docusaurus/types/-/types-2.0.0-beta.21.tgz#36659c6c012663040dcd4cbc97b5d7a555dae229" - integrity sha512-/GH6Npmq81eQfMC/ikS00QSv9jNyO1RXEpNSx5GLA3sFX8Iib26g2YI2zqNplM8nyxzZ2jVBuvUoeODTIbTchQ== +"@docusaurus/types@2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@docusaurus/types/-/types-2.2.0.tgz#02c577a4041ab7d058a3c214ccb13647e21a9857" + integrity sha512-b6xxyoexfbRNRI8gjblzVOnLr4peCJhGbYGPpJ3LFqpi5nsFfoK4mmDLvWdeah0B7gmJeXabN7nQkFoqeSdmOw== dependencies: + "@types/history" "^4.7.11" + "@types/react" "*" commander "^5.1.0" - history "^4.9.0" joi "^17.6.0" react-helmet-async "^1.3.0" utility-types "^3.10.0" - webpack "^5.72.1" + webpack "^5.73.0" webpack-merge "^5.8.0" -"@docusaurus/utils-common@2.0.0-beta.21": - version "2.0.0-beta.21" - resolved "https://registry.yarnpkg.com/@docusaurus/utils-common/-/utils-common-2.0.0-beta.21.tgz#81e86ed04ad62b75e9ba6a5e7689dc23d5f36a0a" - integrity sha512-5w+6KQuJb6pUR2M8xyVuTMvO5NFQm/p8TOTDFTx60wt3p0P1rRX00v6FYsD4PK6pgmuoKjt2+Ls8dtSXc4qFpQ== +"@docusaurus/utils-common@2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@docusaurus/utils-common/-/utils-common-2.2.0.tgz#a401c1b93a8697dd566baf6ac64f0fdff1641a78" + integrity sha512-qebnerHp+cyovdUseDQyYFvMW1n1nv61zGe5JJfoNQUnjKuApch3IVsz+/lZ9a38pId8kqehC1Ao2bW/s0ntDA== dependencies: tslib "^2.4.0" -"@docusaurus/utils-validation@2.0.0-beta.21": - version "2.0.0-beta.21" - resolved "https://registry.yarnpkg.com/@docusaurus/utils-validation/-/utils-validation-2.0.0-beta.21.tgz#10169661be5f8a233f4c12202ee5802ccb77400f" - integrity sha512-6NG1FHTRjv1MFzqW//292z7uCs77vntpWEbZBHk3n67aB1HoMn5SOwjLPtRDjbCgn6HCHFmdiJr6euCbjhYolg== +"@docusaurus/utils-validation@2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@docusaurus/utils-validation/-/utils-validation-2.2.0.tgz#04d4d103137ad0145883971d3aa497f4a1315f25" + integrity sha512-I1hcsG3yoCkasOL5qQAYAfnmVoLei7apugT6m4crQjmDGxq+UkiRrq55UqmDDyZlac/6ax/JC0p+usZ6W4nVyg== dependencies: - "@docusaurus/logger" "2.0.0-beta.21" - "@docusaurus/utils" "2.0.0-beta.21" + "@docusaurus/logger" "2.2.0" + "@docusaurus/utils" "2.2.0" joi "^17.6.0" js-yaml "^4.1.0" tslib "^2.4.0" -"@docusaurus/utils@2.0.0-beta.21": - version "2.0.0-beta.21" - resolved "https://registry.yarnpkg.com/@docusaurus/utils/-/utils-2.0.0-beta.21.tgz#8fc4499c4cfedd29805025d930f8008cad255044" - integrity sha512-M/BrVCDmmUPZLxtiStBgzpQ4I5hqkggcpnQmEN+LbvbohjbtVnnnZQ0vptIziv1w8jry/woY+ePsyOO7O/yeLQ== +"@docusaurus/utils@2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@docusaurus/utils/-/utils-2.2.0.tgz#3d6f9b7a69168d5c92d371bf21c556a4f50d1da6" + integrity sha512-oNk3cjvx7Tt1Lgh/aeZAmFpGV2pDr5nHKrBVx6hTkzGhrnMuQqLt6UPlQjdYQ3QHXwyF/ZtZMO1D5Pfi0lu7SA== dependencies: - "@docusaurus/logger" "2.0.0-beta.21" + "@docusaurus/logger" "2.2.0" "@svgr/webpack" "^6.2.1" file-loader "^6.2.0" fs-extra "^10.1.0" @@ -1894,7 +1964,41 @@ shelljs "^0.8.5" tslib "^2.4.0" url-loader "^4.1.1" - webpack "^5.72.1" + webpack "^5.73.0" + +"@esbuild-kit/cjs-loader@^2.4.0": + version "2.4.1" + resolved "https://registry.yarnpkg.com/@esbuild-kit/cjs-loader/-/cjs-loader-2.4.1.tgz#5c1183ac3906223f0da3bb4ff5b74d0f0b13c326" + integrity sha512-lhc/XLith28QdW0HpHZvZKkorWgmCNT7sVelMHDj3HFdTfdqkwEKvT+aXVQtNAmCC39VJhunDkWhONWB7335mg== + dependencies: + "@esbuild-kit/core-utils" "^3.0.0" + get-tsconfig "^4.2.0" + +"@esbuild-kit/core-utils@^3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@esbuild-kit/core-utils/-/core-utils-3.0.0.tgz#e0f8463a32b4a9c9b456a7f9c31a5e038c8d2c19" + integrity sha512-TXmwH9EFS3DC2sI2YJWJBgHGhlteK0Xyu1VabwetMULfm3oYhbrsWV5yaSr2NTWZIgDGVLHbRf0inxbjXqAcmQ== + dependencies: + esbuild "~0.15.10" + source-map-support "^0.5.21" + +"@esbuild-kit/esm-loader@^2.5.0": + version "2.5.4" + resolved "https://registry.yarnpkg.com/@esbuild-kit/esm-loader/-/esm-loader-2.5.4.tgz#cd31fe93963f3e21b1c1d07eef2bd2df1b574326" + integrity sha512-afmtLf6uqxD5IgwCzomtqCYIgz/sjHzCWZFvfS5+FzeYxOURPUo4QcHtqJxbxWOMOogKriZanN/1bJQE/ZL93A== + dependencies: + "@esbuild-kit/core-utils" "^3.0.0" + get-tsconfig "^4.2.0" + +"@esbuild/android-arm@0.15.18": + version "0.15.18" + resolved "https://registry.yarnpkg.com/@esbuild/android-arm/-/android-arm-0.15.18.tgz#266d40b8fdcf87962df8af05b76219bc786b4f80" + integrity sha512-5GT+kcs2WVGjVs7+boataCkO5Fg0y4kCjzkB5bAip7H4jfnOS3dA6KPiww9W1OEKTKeAcUVhdZGvgI65OXmUnw== + +"@esbuild/linux-loong64@0.15.18": + version "0.15.18" + resolved "https://registry.yarnpkg.com/@esbuild/linux-loong64/-/linux-loong64-0.15.18.tgz#128b76ecb9be48b60cf5cfc1c63a4f00691a3239" + integrity sha512-L4jVKS82XVhw2nvzLg/19ClLWg0y27ulRwuP7lcyL6AbUWB5aPglXY3M21mauDQMDfRLs8cQmeT03r/+X3cZYQ== "@eslint/eslintrc@^1.2.3": version "1.2.3" @@ -1911,7 +2015,7 @@ minimatch "^3.1.2" strip-json-comments "^3.1.1" -"@gar/promisify@^1.0.1", "@gar/promisify@^1.1.3": +"@gar/promisify@^1.1.3": version "1.1.3" resolved "https://registry.yarnpkg.com/@gar/promisify/-/promisify-1.1.3.tgz#555193ab2e3bb3b6adc3d551c9c030d9e860daf6" integrity sha512-k2Ty1JcVojjJFwrg/ThKi2ujJ7XNLYaFGNB/bWT9wGR+oSMJHMa5w+CUq6p/pVrKeNNgA7pCqEcjSnHVoqJQFw== @@ -1968,175 +2072,117 @@ resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.3.tgz#e45e384e4b8ec16bce2fd903af78450f6bf7ec98" integrity sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA== -"@jest/console@^28.1.1": - version "28.1.1" - resolved "https://registry.yarnpkg.com/@jest/console/-/console-28.1.1.tgz#305f8ca50b6e70413839f54c0e002b60a0f2fd7d" - integrity sha512-0RiUocPVFEm3WRMOStIHbRWllG6iW6E3/gUPnf4lkrVFyXIIDeCe+vlKeYyFOMhB2EPE6FLFCNADSOOQMaqvyA== - dependencies: - "@jest/types" "^28.1.1" - "@types/node" "*" - chalk "^4.0.0" - jest-message-util "^28.1.1" - jest-util "^28.1.1" - slash "^3.0.0" - -"@jest/console@^28.1.3": - version "28.1.3" - resolved "https://registry.yarnpkg.com/@jest/console/-/console-28.1.3.tgz#2030606ec03a18c31803b8a36382762e447655df" - integrity sha512-QPAkP5EwKdK/bxIr6C1I4Vs0rm2nHiANzj/Z5X2JQkrZo6IqvC4ldZ9K95tF0HdidhA8Bo6egxSzUFPYKcEXLw== +"@jest/console@^29.1.2": + version "29.1.2" + resolved "https://registry.yarnpkg.com/@jest/console/-/console-29.1.2.tgz#0ae975a70004696f8320490fcaa1a4152f7b62e4" + integrity sha512-ujEBCcYs82BTmRxqfHMQggSlkUZP63AE5YEaTPj7eFyJOzukkTorstOUC7L6nE3w5SYadGVAnTsQ/ZjTGL0qYQ== dependencies: - "@jest/types" "^28.1.3" + "@jest/types" "^29.1.2" "@types/node" "*" chalk "^4.0.0" - jest-message-util "^28.1.3" - jest-util "^28.1.3" + jest-message-util "^29.1.2" + jest-util "^29.1.2" slash "^3.0.0" -"@jest/core@^28.1.1": - version "28.1.1" - resolved "https://registry.yarnpkg.com/@jest/core/-/core-28.1.1.tgz#086830bec6267accf9af5ca76f794858e9f9f092" - integrity sha512-3pYsBoZZ42tXMdlcFeCc/0j9kOlK7MYuXs2B1QbvDgMoW1K9NJ4G/VYvIbMb26iqlkTfPHo7SC2JgjDOk/mxXw== +"@jest/core@^29.1.2": + version "29.1.2" + resolved "https://registry.yarnpkg.com/@jest/core/-/core-29.1.2.tgz#e5ce7a71e7da45156a96fb5eeed11d18b67bd112" + integrity sha512-sCO2Va1gikvQU2ynDN8V4+6wB7iVrD2CvT0zaRst4rglf56yLly0NQ9nuRRAWFeimRf+tCdFsb1Vk1N9LrrMPA== dependencies: - "@jest/console" "^28.1.1" - "@jest/reporters" "^28.1.1" - "@jest/test-result" "^28.1.1" - "@jest/transform" "^28.1.1" - "@jest/types" "^28.1.1" + "@jest/console" "^29.1.2" + "@jest/reporters" "^29.1.2" + "@jest/test-result" "^29.1.2" + "@jest/transform" "^29.1.2" + "@jest/types" "^29.1.2" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" ci-info "^3.2.0" exit "^0.1.2" graceful-fs "^4.2.9" - jest-changed-files "^28.0.2" - jest-config "^28.1.1" - jest-haste-map "^28.1.1" - jest-message-util "^28.1.1" - jest-regex-util "^28.0.2" - jest-resolve "^28.1.1" - jest-resolve-dependencies "^28.1.1" - jest-runner "^28.1.1" - jest-runtime "^28.1.1" - jest-snapshot "^28.1.1" - jest-util "^28.1.1" - jest-validate "^28.1.1" - jest-watcher "^28.1.1" + jest-changed-files "^29.0.0" + jest-config "^29.1.2" + jest-haste-map "^29.1.2" + jest-message-util "^29.1.2" + jest-regex-util "^29.0.0" + jest-resolve "^29.1.2" + jest-resolve-dependencies "^29.1.2" + jest-runner "^29.1.2" + jest-runtime "^29.1.2" + jest-snapshot "^29.1.2" + jest-util "^29.1.2" + jest-validate "^29.1.2" + jest-watcher "^29.1.2" micromatch "^4.0.4" - pretty-format "^28.1.1" - rimraf "^3.0.0" + pretty-format "^29.1.2" slash "^3.0.0" strip-ansi "^6.0.0" -"@jest/create-cache-key-function@^27.4.2", "@jest/create-cache-key-function@^28": - version "28.1.3" - resolved "https://registry.yarnpkg.com/@jest/create-cache-key-function/-/create-cache-key-function-28.1.3.tgz#bdf51e40379eaf88e8dbc6b60af52e662101dcb4" - integrity sha512-Q2wyDISMLjffYu6vom582MfVDwYjeD8TayLsp/DqNgdVklVgIZT7hG2NUvtdj+KheqIGbbXMXiupEAB6qDqayg== - dependencies: - "@jest/types" "^28.1.3" - -"@jest/environment@^28.1.1": - version "28.1.1" - resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-28.1.1.tgz#c4cbf85283278d768f816ebd1a258ea6f9e39d4f" - integrity sha512-9auVQ2GzQ7nrU+lAr8KyY838YahElTX9HVjbQPPS2XjlxQ+na18G113OoBhyBGBtD6ZnO/SrUy5WR8EzOj1/Uw== +"@jest/create-cache-key-function@^27.4.2", "@jest/create-cache-key-function@^29": + version "29.1.2" + resolved "https://registry.yarnpkg.com/@jest/create-cache-key-function/-/create-cache-key-function-29.1.2.tgz#ba72143479abccc5ce7705e00fcbe89e4d6e1873" + integrity sha512-s7yfOwnDZhqTzLWOwWjv/Lbg9CkJ7bItz5OVrMa0d+g2bP+rFwDs7FpsKuYpym5tpdbDaXHnF3cbl/e01ZeUcw== dependencies: - "@jest/fake-timers" "^28.1.1" - "@jest/types" "^28.1.1" - "@types/node" "*" - jest-mock "^28.1.1" + "@jest/types" "^29.1.2" -"@jest/environment@^28.1.3": - version "28.1.3" - resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-28.1.3.tgz#abed43a6b040a4c24fdcb69eab1f97589b2d663e" - integrity sha512-1bf40cMFTEkKyEf585R9Iz1WayDjHoHqvts0XFYEqyKM3cFWDpeMoqKKTAF9LSYQModPUlh8FKptoM2YcMWAXA== +"@jest/environment@^29.1.2": + version "29.1.2" + resolved "https://registry.yarnpkg.com/@jest/environment/-/environment-29.1.2.tgz#bb51a43fce9f960ba9a48f0b5b556f30618ebc0a" + integrity sha512-rG7xZ2UeOfvOVzoLIJ0ZmvPl4tBEQ2n73CZJSlzUjPw4or1oSWC0s0Rk0ZX+pIBJ04aVr6hLWFn1DFtrnf8MhQ== dependencies: - "@jest/fake-timers" "^28.1.3" - "@jest/types" "^28.1.3" + "@jest/fake-timers" "^29.1.2" + "@jest/types" "^29.1.2" "@types/node" "*" - jest-mock "^28.1.3" - -"@jest/expect-utils@^28.1.1": - version "28.1.1" - resolved "https://registry.yarnpkg.com/@jest/expect-utils/-/expect-utils-28.1.1.tgz#d84c346025b9f6f3886d02c48a6177e2b0360587" - integrity sha512-n/ghlvdhCdMI/hTcnn4qV57kQuV9OTsZzH1TTCVARANKhl6hXJqLKUkwX69ftMGpsbpt96SsDD8n8LD2d9+FRw== - dependencies: - jest-get-type "^28.0.2" - -"@jest/expect-utils@^28.1.3": - version "28.1.3" - resolved "https://registry.yarnpkg.com/@jest/expect-utils/-/expect-utils-28.1.3.tgz#58561ce5db7cd253a7edddbc051fb39dda50f525" - integrity sha512-wvbi9LUrHJLn3NlDW6wF2hvIMtd4JUl2QNVrjq+IBSHirgfrR3o9RnVtxzdEGO2n9JyIWwHnLfby5KzqBGg2YA== - dependencies: - jest-get-type "^28.0.2" - -"@jest/expect@^28.1.1": - version "28.1.1" - resolved "https://registry.yarnpkg.com/@jest/expect/-/expect-28.1.1.tgz#ea4fcc8504b45835029221c0dc357c622a761326" - integrity sha512-/+tQprrFoT6lfkMj4mW/mUIfAmmk/+iQPmg7mLDIFOf2lyf7EBHaS+x3RbeR0VZVMe55IvX7QRoT/2aK3AuUXg== - dependencies: - expect "^28.1.1" - jest-snapshot "^28.1.1" + jest-mock "^29.1.2" -"@jest/expect@^28.1.3": - version "28.1.3" - resolved "https://registry.yarnpkg.com/@jest/expect/-/expect-28.1.3.tgz#9ac57e1d4491baca550f6bdbd232487177ad6a72" - integrity sha512-lzc8CpUbSoE4dqT0U+g1qODQjBRHPpCPXissXD4mS9+sWQdmmpeJ9zSH1rS1HEkrsMN0fb7nKrJ9giAR1d3wBw== +"@jest/expect-utils@^29.1.2": + version "29.1.2" + resolved "https://registry.yarnpkg.com/@jest/expect-utils/-/expect-utils-29.1.2.tgz#66dbb514d38f7d21456bc774419c9ae5cca3f88d" + integrity sha512-4a48bhKfGj/KAH39u0ppzNTABXQ8QPccWAFUFobWBaEMSMp+sB31Z2fK/l47c4a/Mu1po2ffmfAIPxXbVTXdtg== dependencies: - expect "^28.1.3" - jest-snapshot "^28.1.3" + jest-get-type "^29.0.0" -"@jest/fake-timers@^28.1.1": - version "28.1.1" - resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-28.1.1.tgz#47ce33296ab9d680c76076d51ddbe65ceb3337f1" - integrity sha512-BY/3+TyLs5+q87rGWrGUY5f8e8uC3LsVHS9Diz8+FV3ARXL4sNnkLlIB8dvDvRrp+LUCGM+DLqlsYubizGUjIA== +"@jest/expect@^29.1.2": + version "29.1.2" + resolved "https://registry.yarnpkg.com/@jest/expect/-/expect-29.1.2.tgz#334a86395f621f1ab63ad95b06a588b9114d7b7a" + integrity sha512-FXw/UmaZsyfRyvZw3M6POgSNqwmuOXJuzdNiMWW9LCYo0GRoRDhg+R5iq5higmRTHQY7hx32+j7WHwinRmoILQ== dependencies: - "@jest/types" "^28.1.1" - "@sinonjs/fake-timers" "^9.1.1" - "@types/node" "*" - jest-message-util "^28.1.1" - jest-mock "^28.1.1" - jest-util "^28.1.1" + expect "^29.1.2" + jest-snapshot "^29.1.2" -"@jest/fake-timers@^28.1.3": - version "28.1.3" - resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-28.1.3.tgz#230255b3ad0a3d4978f1d06f70685baea91c640e" - integrity sha512-D/wOkL2POHv52h+ok5Oj/1gOG9HSywdoPtFsRCUmlCILXNn5eIWmcnd3DIiWlJnpGvQtmajqBP95Ei0EimxfLw== +"@jest/fake-timers@^29.1.2": + version "29.1.2" + resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-29.1.2.tgz#f157cdf23b4da48ce46cb00fea28ed1b57fc271a" + integrity sha512-GppaEqS+QQYegedxVMpCe2xCXxxeYwQ7RsNx55zc8f+1q1qevkZGKequfTASI7ejmg9WwI+SJCrHe9X11bLL9Q== dependencies: - "@jest/types" "^28.1.3" + "@jest/types" "^29.1.2" "@sinonjs/fake-timers" "^9.1.2" "@types/node" "*" - jest-message-util "^28.1.3" - jest-mock "^28.1.3" - jest-util "^28.1.3" + jest-message-util "^29.1.2" + jest-mock "^29.1.2" + jest-util "^29.1.2" -"@jest/globals@^28.1.1": - version "28.1.1" - resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-28.1.1.tgz#c0a7977f85e26279cc090d9adcdf82b8a34c4061" - integrity sha512-dEgl/6v7ToB4vXItdvcltJBgny0xBE6xy6IYQrPJAJggdEinGxCDMivNv7sFzPcTITGquXD6UJwYxfJ/5ZwDSg== +"@jest/globals@^29.1.2": + version "29.1.2" + resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-29.1.2.tgz#826ede84bc280ae7f789cb72d325c48cd048b9d3" + integrity sha512-uMgfERpJYoQmykAd0ffyMq8wignN4SvLUG6orJQRe9WAlTRc9cdpCaE/29qurXixYJVZWUqIBXhSk8v5xN1V9g== dependencies: - "@jest/environment" "^28.1.1" - "@jest/expect" "^28.1.1" - "@jest/types" "^28.1.1" + "@jest/environment" "^29.1.2" + "@jest/expect" "^29.1.2" + "@jest/types" "^29.1.2" + jest-mock "^29.1.2" -"@jest/globals@^28.1.3": - version "28.1.3" - resolved "https://registry.yarnpkg.com/@jest/globals/-/globals-28.1.3.tgz#a601d78ddc5fdef542728309894895b4a42dc333" - integrity sha512-XFU4P4phyryCXu1pbcqMO0GSQcYe1IsalYCDzRNyhetyeyxMcIxa11qPNDpVNLeretItNqEmYYQn1UYz/5x1NA== - dependencies: - "@jest/environment" "^28.1.3" - "@jest/expect" "^28.1.3" - "@jest/types" "^28.1.3" - -"@jest/reporters@27.5.1", "@jest/reporters@^28", "@jest/reporters@^28.1.1": - version "28.1.3" - resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-28.1.3.tgz#9adf6d265edafc5fc4a434cfb31e2df5a67a369a" - integrity sha512-JuAy7wkxQZVNU/V6g9xKzCGC5LVXx9FDcABKsSXp5MiKPEE2144a/vXTEDoyzjUpZKfVwp08Wqg5A4WfTMAzjg== +"@jest/reporters@28.1.1", "@jest/reporters@^29", "@jest/reporters@^29.1.2": + version "29.1.2" + resolved "https://registry.yarnpkg.com/@jest/reporters/-/reporters-29.1.2.tgz#5520898ed0a4ecf69d8b671e1dc8465d0acdfa6e" + integrity sha512-X4fiwwyxy9mnfpxL0g9DD0KcTmEIqP0jUdnc2cfa9riHy+I6Gwwp5vOZiwyg0vZxfSDxrOlK9S4+340W4d+DAA== dependencies: "@bcoe/v8-coverage" "^0.2.3" - "@jest/console" "^28.1.3" - "@jest/test-result" "^28.1.3" - "@jest/transform" "^28.1.3" - "@jest/types" "^28.1.3" - "@jridgewell/trace-mapping" "^0.3.13" + "@jest/console" "^29.1.2" + "@jest/test-result" "^29.1.2" + "@jest/transform" "^29.1.2" + "@jest/types" "^29.1.2" + "@jridgewell/trace-mapping" "^0.3.15" "@types/node" "*" chalk "^4.0.0" collect-v8-coverage "^1.0.0" @@ -2148,134 +2194,85 @@ istanbul-lib-report "^3.0.0" istanbul-lib-source-maps "^4.0.0" istanbul-reports "^3.1.3" - jest-message-util "^28.1.3" - jest-util "^28.1.3" - jest-worker "^28.1.3" + jest-message-util "^29.1.2" + jest-util "^29.1.2" + jest-worker "^29.1.2" slash "^3.0.0" string-length "^4.0.1" strip-ansi "^6.0.0" terminal-link "^2.0.0" v8-to-istanbul "^9.0.1" -"@jest/schemas@^28.0.2": - version "28.0.2" - resolved "https://registry.yarnpkg.com/@jest/schemas/-/schemas-28.0.2.tgz#08c30df6a8d07eafea0aef9fb222c5e26d72e613" - integrity sha512-YVDJZjd4izeTDkij00vHHAymNXQ6WWsdChFRK86qck6Jpr3DCL5W3Is3vslviRlP+bLuMYRLbdp98amMvqudhA== - dependencies: - "@sinclair/typebox" "^0.23.3" - -"@jest/schemas@^28.1.3": - version "28.1.3" - resolved "https://registry.yarnpkg.com/@jest/schemas/-/schemas-28.1.3.tgz#ad8b86a66f11f33619e3d7e1dcddd7f2d40ff905" - integrity sha512-/l/VWsdt/aBXgjshLWOFyFt3IVdYypu5y2Wn2rOO1un6nkqIn8SLXzgIMYXFyYsRWDyF5EthmKJMIdJvk08grg== +"@jest/schemas@^29.0.0": + version "29.0.0" + resolved "https://registry.yarnpkg.com/@jest/schemas/-/schemas-29.0.0.tgz#5f47f5994dd4ef067fb7b4188ceac45f77fe952a" + integrity sha512-3Ab5HgYIIAnS0HjqJHQYZS+zXc4tUmTmBH3z83ajI6afXp8X3ZtdLX+nXx+I7LNkJD7uN9LAVhgnjDgZa2z0kA== dependencies: "@sinclair/typebox" "^0.24.1" -"@jest/source-map@^28.0.2": - version "28.0.2" - resolved "https://registry.yarnpkg.com/@jest/source-map/-/source-map-28.0.2.tgz#914546f4410b67b1d42c262a1da7e0406b52dc90" - integrity sha512-Y9dxC8ZpN3kImkk0LkK5XCEneYMAXlZ8m5bflmSL5vrwyeUpJfentacCUg6fOb8NOpOO7hz2+l37MV77T6BFPw== +"@jest/source-map@^29.0.0": + version "29.0.0" + resolved "https://registry.yarnpkg.com/@jest/source-map/-/source-map-29.0.0.tgz#f8d1518298089f8ae624e442bbb6eb870ee7783c" + integrity sha512-nOr+0EM8GiHf34mq2GcJyz/gYFyLQ2INDhAylrZJ9mMWoW21mLBfZa0BUVPPMxVYrLjeiRe2Z7kWXOGnS0TFhQ== dependencies: - "@jridgewell/trace-mapping" "^0.3.7" - callsites "^3.0.0" - graceful-fs "^4.2.9" - -"@jest/source-map@^28.1.2": - version "28.1.2" - resolved "https://registry.yarnpkg.com/@jest/source-map/-/source-map-28.1.2.tgz#7fe832b172b497d6663cdff6c13b0a920e139e24" - integrity sha512-cV8Lx3BeStJb8ipPHnqVw/IM2VCMWO3crWZzYodSIkxXnRcXJipCdx1JCK0K5MsJJouZQTH73mzf4vgxRaH9ww== - dependencies: - "@jridgewell/trace-mapping" "^0.3.13" + "@jridgewell/trace-mapping" "^0.3.15" callsites "^3.0.0" graceful-fs "^4.2.9" -"@jest/test-result@27.5.1", "@jest/test-result@^28", "@jest/test-result@^28.1.1", "@jest/test-result@^28.1.3": - version "28.1.3" - resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-28.1.3.tgz#5eae945fd9f4b8fcfce74d239e6f725b6bf076c5" - integrity sha512-kZAkxnSE+FqE8YjW8gNuoVkkC9I7S1qmenl8sGcDOLropASP+BkcGKwhXoyqQuGOGeYY0y/ixjrd/iERpEXHNg== +"@jest/test-result@28.1.1", "@jest/test-result@^29", "@jest/test-result@^29.1.2": + version "29.1.2" + resolved "https://registry.yarnpkg.com/@jest/test-result/-/test-result-29.1.2.tgz#6a8d006eb2b31ce0287d1fc10d12b8ff8504f3c8" + integrity sha512-jjYYjjumCJjH9hHCoMhA8PCl1OxNeGgAoZ7yuGYILRJX9NjgzTN0pCT5qAoYR4jfOP8htIByvAlz9vfNSSBoVg== dependencies: - "@jest/console" "^28.1.3" - "@jest/types" "^28.1.3" + "@jest/console" "^29.1.2" + "@jest/types" "^29.1.2" "@types/istanbul-lib-coverage" "^2.0.0" collect-v8-coverage "^1.0.0" -"@jest/test-sequencer@^28.1.3": - version "28.1.3" - resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-28.1.3.tgz#9d0c283d906ac599c74bde464bc0d7e6a82886c3" - integrity sha512-NIMPEqqa59MWnDi1kvXXpYbqsfQmSJsIbnd85mdVGkiDfQ9WQQTXOLsvISUfonmnBT+w85WEgneCigEEdHDFxw== - dependencies: - "@jest/test-result" "^28.1.3" - graceful-fs "^4.2.9" - jest-haste-map "^28.1.3" - slash "^3.0.0" - -"@jest/transform@^28.1.1": - version "28.1.1" - resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-28.1.1.tgz#83541f2a3f612077c8501f49cc4e205d4e4a6b27" - integrity sha512-PkfaTUuvjUarl1EDr5ZQcCA++oXkFCP9QFUkG0yVKVmNObjhrqDy0kbMpMebfHWm3CCDHjYNem9eUSH8suVNHQ== +"@jest/test-sequencer@^29.1.2": + version "29.1.2" + resolved "https://registry.yarnpkg.com/@jest/test-sequencer/-/test-sequencer-29.1.2.tgz#10bfd89c08bfdba382eb05cc79c1d23a01238a93" + integrity sha512-fU6dsUqqm8sA+cd85BmeF7Gu9DsXVWFdGn9taxM6xN1cKdcP/ivSgXh5QucFRFz1oZxKv3/9DYYbq0ULly3P/Q== dependencies: - "@babel/core" "^7.11.6" - "@jest/types" "^28.1.1" - "@jridgewell/trace-mapping" "^0.3.7" - babel-plugin-istanbul "^6.1.1" - chalk "^4.0.0" - convert-source-map "^1.4.0" - fast-json-stable-stringify "^2.0.0" + "@jest/test-result" "^29.1.2" graceful-fs "^4.2.9" - jest-haste-map "^28.1.1" - jest-regex-util "^28.0.2" - jest-util "^28.1.1" - micromatch "^4.0.4" - pirates "^4.0.4" + jest-haste-map "^29.1.2" slash "^3.0.0" - write-file-atomic "^4.0.1" -"@jest/transform@^28.1.3": - version "28.1.3" - resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-28.1.3.tgz#59d8098e50ab07950e0f2fc0fc7ec462371281b0" - integrity sha512-u5dT5di+oFI6hfcLOHGTAfmUxFRrjK+vnaP0kkVow9Md/M7V/MxqQMOz/VV25UZO8pzeA9PjfTpOu6BDuwSPQA== +"@jest/transform@^29.1.2": + version "29.1.2" + resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-29.1.2.tgz#20f814696e04f090421f6d505c14bbfe0157062a" + integrity sha512-2uaUuVHTitmkx1tHF+eBjb4p7UuzBG7SXIaA/hNIkaMP6K+gXYGxP38ZcrofzqN0HeZ7A90oqsOa97WU7WZkSw== dependencies: "@babel/core" "^7.11.6" - "@jest/types" "^28.1.3" - "@jridgewell/trace-mapping" "^0.3.13" + "@jest/types" "^29.1.2" + "@jridgewell/trace-mapping" "^0.3.15" babel-plugin-istanbul "^6.1.1" chalk "^4.0.0" convert-source-map "^1.4.0" - fast-json-stable-stringify "^2.0.0" + fast-json-stable-stringify "^2.1.0" graceful-fs "^4.2.9" - jest-haste-map "^28.1.3" - jest-regex-util "^28.0.2" - jest-util "^28.1.3" + jest-haste-map "^29.1.2" + jest-regex-util "^29.0.0" + jest-util "^29.1.2" micromatch "^4.0.4" pirates "^4.0.4" slash "^3.0.0" write-file-atomic "^4.0.1" -"@jest/types@^28.1.1": - version "28.1.1" - resolved "https://registry.yarnpkg.com/@jest/types/-/types-28.1.1.tgz#d059bbc80e6da6eda9f081f293299348bd78ee0b" - integrity sha512-vRXVqSg1VhDnB8bWcmvLzmg0Bt9CRKVgHPXqYwvWMX3TvAjeO+nRuK6+VdTKCtWOvYlmkF/HqNAL/z+N3B53Kw== - dependencies: - "@jest/schemas" "^28.0.2" - "@types/istanbul-lib-coverage" "^2.0.0" - "@types/istanbul-reports" "^3.0.0" - "@types/node" "*" - "@types/yargs" "^17.0.8" - chalk "^4.0.0" - -"@jest/types@^28.1.3": - version "28.1.3" - resolved "https://registry.yarnpkg.com/@jest/types/-/types-28.1.3.tgz#b05de80996ff12512bc5ceb1d208285a7d11748b" - integrity sha512-RyjiyMUZrKz/c+zlMFO1pm70DcIlST8AeWTkoUdZevew44wcNZQHsEVOiCVtgVnlFFD82FPaXycys58cf2muVQ== +"@jest/types@^29.1.2": + version "29.1.2" + resolved "https://registry.yarnpkg.com/@jest/types/-/types-29.1.2.tgz#7442d32b16bcd7592d9614173078b8c334ec730a" + integrity sha512-DcXGtoTykQB5jiwCmVr8H4vdg2OJhQex3qPkG+ISyDO7xQXbt/4R6dowcRyPemRnkH7JoHvZuxPBdlq+9JxFCg== dependencies: - "@jest/schemas" "^28.1.3" + "@jest/schemas" "^29.0.0" "@types/istanbul-lib-coverage" "^2.0.0" "@types/istanbul-reports" "^3.0.0" "@types/node" "*" "@types/yargs" "^17.0.8" chalk "^4.0.0" -"@jridgewell/gen-mapping@^0.3.0": +"@jridgewell/gen-mapping@^0.3.0", "@jridgewell/gen-mapping@^0.3.2": version "0.3.2" resolved "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.3.2.tgz#c1aedc61e853f2bb9f5dfe6d4442d3b565b253b9" integrity sha512-mh65xKQAzI6iBcFzwv28KVWSmCkdRBWoOh+bYQGW3+6OZvbbN3TqMGo5hqYxQniRcH9F2VZIoJCm4pa3BPDK/A== @@ -2307,649 +2304,649 @@ resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz#add4c98d341472a289190b424efbdb096991bb24" integrity sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw== -"@jridgewell/trace-mapping@^0.3.0", "@jridgewell/trace-mapping@^0.3.7": - version "0.3.13" - resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.13.tgz#dcfe3e95f224c8fe97a87a5235defec999aa92ea" - integrity sha512-o1xbKhp9qnIAoHJSWd6KlCZfqslL4valSF81H8ImioOAxluWYWOpWkpyktY2vnt4tbrX9XYaxovq6cgowaJp2w== +"@jridgewell/trace-mapping@^0.3.0", "@jridgewell/trace-mapping@^0.3.12", "@jridgewell/trace-mapping@^0.3.15", "@jridgewell/trace-mapping@^0.3.7", "@jridgewell/trace-mapping@^0.3.9": + version "0.3.15" + resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.15.tgz#aba35c48a38d3fd84b37e66c9c0423f9744f9774" + integrity sha512-oWZNOULl+UbhsgB51uuZzglikfIKSUBO/M9W2OfEjn7cmqoAiCgmv9lyACTUacZwBz0ITnJ2NqjU8Tx0DHL88g== dependencies: "@jridgewell/resolve-uri" "^3.0.3" "@jridgewell/sourcemap-codec" "^1.4.10" -"@jridgewell/trace-mapping@^0.3.12", "@jridgewell/trace-mapping@^0.3.13", "@jridgewell/trace-mapping@^0.3.9": - version "0.3.14" - resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.14.tgz#b231a081d8f66796e475ad588a1ef473112701ed" - integrity sha512-bJWEfQ9lPTvm3SneWwRFVLzrh6nhjwqw7TUFFBEMzwvg7t7PCDenf2lDwqo4NQXzdpgBXyFgDWnQA+2vkruksQ== - dependencies: - "@jridgewell/resolve-uri" "^3.0.3" - "@jridgewell/sourcemap-codec" "^1.4.10" +"@jsdevtools/ono@^7.1.3": + version "7.1.3" + resolved "https://registry.yarnpkg.com/@jsdevtools/ono/-/ono-7.1.3.tgz#9df03bbd7c696a5c58885c34aa06da41c8543796" + integrity sha512-4JQNk+3mVzK3xh2rqd6RB4J46qUR19azEHBneZyTZM+c456qOrbbM/5xcR8huNCCcbVt7+UmizG6GuUvPvKUYg== "@leichtgewicht/ip-codec@^2.0.1": version "2.0.4" resolved "https://registry.yarnpkg.com/@leichtgewicht/ip-codec/-/ip-codec-2.0.4.tgz#b2ac626d6cb9c8718ab459166d4bb405b8ffa78b" integrity sha512-Hcv+nVC0kZnQ3tD9GVu5xSMR4VVYOteQIr/hwFPVEvPdlXqgGEuRjiheChHgdM+JyqdgNcmzZOX/tnl0JOiI7A== -"@lerna/add@5.1.8": - version "5.1.8" - resolved "https://registry.yarnpkg.com/@lerna/add/-/add-5.1.8.tgz#9710a838cb1616cf84c47e85aab5a7cc5a36ce21" - integrity sha512-ABplk8a5MmiT8lG1b9KHijRUwj/nOePMuezBHjJEpNeQ8Bw5w3IV/6hpdmApx/w1StBwWWf0UG42klrxXlfl/g== +"@lerna/add@6.4.1": + version "6.4.1" + resolved "https://registry.yarnpkg.com/@lerna/add/-/add-6.4.1.tgz#fa20fe9ff875dc5758141262c8cde0d9a6481ec4" + integrity sha512-YSRnMcsdYnQtQQK0NSyrS9YGXvB3jzvx183o+JTH892MKzSlBqwpBHekCknSibyxga1HeZ0SNKQXgsHAwWkrRw== dependencies: - "@lerna/bootstrap" "5.1.8" - "@lerna/command" "5.1.8" - "@lerna/filter-options" "5.1.8" - "@lerna/npm-conf" "5.1.8" - "@lerna/validation-error" "5.1.8" + "@lerna/bootstrap" "6.4.1" + "@lerna/command" "6.4.1" + "@lerna/filter-options" "6.4.1" + "@lerna/npm-conf" "6.4.1" + "@lerna/validation-error" "6.4.1" dedent "^0.7.0" - npm-package-arg "^8.1.0" + npm-package-arg "8.1.1" p-map "^4.0.0" - pacote "^13.4.1" + pacote "^13.6.1" semver "^7.3.4" -"@lerna/bootstrap@5.1.8": - version "5.1.8" - resolved "https://registry.yarnpkg.com/@lerna/bootstrap/-/bootstrap-5.1.8.tgz#b8664d7eef6bd1072fe3ea5285848cc0c590a9bc" - integrity sha512-/QZJc6aRxi6csSR59jdqRXPFh33fbn60F1k/SWtCCELGkZub23fAPLKaO7SlMcyghN3oKlfTfVymu/NWEcptJQ== - dependencies: - "@lerna/command" "5.1.8" - "@lerna/filter-options" "5.1.8" - "@lerna/has-npm-version" "5.1.8" - "@lerna/npm-install" "5.1.8" - "@lerna/package-graph" "5.1.8" - "@lerna/pulse-till-done" "5.1.8" - "@lerna/rimraf-dir" "5.1.8" - "@lerna/run-lifecycle" "5.1.8" - "@lerna/run-topologically" "5.1.8" - "@lerna/symlink-binary" "5.1.8" - "@lerna/symlink-dependencies" "5.1.8" - "@lerna/validation-error" "5.1.8" - "@npmcli/arborist" "5.2.0" +"@lerna/bootstrap@6.4.1": + version "6.4.1" + resolved "https://registry.yarnpkg.com/@lerna/bootstrap/-/bootstrap-6.4.1.tgz#a76ff22c3160d134fb60bcfddb3f8b0759b4f1ff" + integrity sha512-64cm0mnxzxhUUjH3T19ZSjPdn28vczRhhTXhNAvOhhU0sQgHrroam1xQC1395qbkV3iosSertlu8e7xbXW033w== + dependencies: + "@lerna/command" "6.4.1" + "@lerna/filter-options" "6.4.1" + "@lerna/has-npm-version" "6.4.1" + "@lerna/npm-install" "6.4.1" + "@lerna/package-graph" "6.4.1" + "@lerna/pulse-till-done" "6.4.1" + "@lerna/rimraf-dir" "6.4.1" + "@lerna/run-lifecycle" "6.4.1" + "@lerna/run-topologically" "6.4.1" + "@lerna/symlink-binary" "6.4.1" + "@lerna/symlink-dependencies" "6.4.1" + "@lerna/validation-error" "6.4.1" + "@npmcli/arborist" "5.3.0" dedent "^0.7.0" get-port "^5.1.1" multimatch "^5.0.0" - npm-package-arg "^8.1.0" + npm-package-arg "8.1.1" npmlog "^6.0.2" p-map "^4.0.0" p-map-series "^2.1.0" p-waterfall "^2.1.1" semver "^7.3.4" -"@lerna/changed@5.1.8": - version "5.1.8" - resolved "https://registry.yarnpkg.com/@lerna/changed/-/changed-5.1.8.tgz#7db0c16703440ba6bf53ad3719fd13ba748aaf27" - integrity sha512-JA9jX9VTHrwSMRJTgLEzdyyx4zi35X0yP6fUUFuli9a0zrB4HV4IowSn1XM03H8iebbDLB0eWBbosqhYwSP8Sw== +"@lerna/changed@6.4.1": + version "6.4.1" + resolved "https://registry.yarnpkg.com/@lerna/changed/-/changed-6.4.1.tgz#4da6d08df7c53bc90c0c0d9d04839f91dd6d70a9" + integrity sha512-Z/z0sTm3l/iZW0eTSsnQpcY5d6eOpNO0g4wMOK+hIboWG0QOTc8b28XCnfCUO+33UisKl8PffultgoaHMKkGgw== dependencies: - "@lerna/collect-updates" "5.1.8" - "@lerna/command" "5.1.8" - "@lerna/listable" "5.1.8" - "@lerna/output" "5.1.8" + "@lerna/collect-updates" "6.4.1" + "@lerna/command" "6.4.1" + "@lerna/listable" "6.4.1" + "@lerna/output" "6.4.1" -"@lerna/check-working-tree@5.1.8": - version "5.1.8" - resolved "https://registry.yarnpkg.com/@lerna/check-working-tree/-/check-working-tree-5.1.8.tgz#9529006f1c57cf1d783539063a381777aa983054" - integrity sha512-3QyiV75cYt9dtg9JhUt+Aiyk44mFjlyqIIJ/XZ2Cp/Xcwws/QrNKOTs5iYFX5XWzlpTgotOHcu1MH/mY55Czlw== +"@lerna/check-working-tree@6.4.1": + version "6.4.1" + resolved "https://registry.yarnpkg.com/@lerna/check-working-tree/-/check-working-tree-6.4.1.tgz#c0dcb5c474faf214865058e2fedda44962367a4e" + integrity sha512-EnlkA1wxaRLqhJdn9HX7h+JYxqiTK9aWEFOPqAE8lqjxHn3RpM9qBp1bAdL7CeUk3kN1lvxKwDEm0mfcIyMbPA== dependencies: - "@lerna/collect-uncommitted" "5.1.8" - "@lerna/describe-ref" "5.1.8" - "@lerna/validation-error" "5.1.8" + "@lerna/collect-uncommitted" "6.4.1" + "@lerna/describe-ref" "6.4.1" + "@lerna/validation-error" "6.4.1" -"@lerna/child-process@5.1.8": - version "5.1.8" - resolved "https://registry.yarnpkg.com/@lerna/child-process/-/child-process-5.1.8.tgz#4350eb58fe4c478000317a65f62985d212ee4f89" - integrity sha512-P0o4Y/sdiUJ53spZpaVv53NdAcl15UAi5//W3uT2T250xQPlVROwKy11S3Wzqglh94FYdi6XUy293x1uwBlFPw== +"@lerna/child-process@6.4.1": + version "6.4.1" + resolved "https://registry.yarnpkg.com/@lerna/child-process/-/child-process-6.4.1.tgz#d697fb769f4c5b57c59f87471eb9b3d65be904a3" + integrity sha512-dvEKK0yKmxOv8pccf3I5D/k+OGiLxQp5KYjsrDtkes2pjpCFfQAMbmpol/Tqx6w/2o2rSaRrLsnX8TENo66FsA== dependencies: chalk "^4.1.0" execa "^5.0.0" strong-log-transformer "^2.1.0" -"@lerna/clean@5.1.8": - version "5.1.8" - resolved "https://registry.yarnpkg.com/@lerna/clean/-/clean-5.1.8.tgz#dbf4634bbc3f5c526eec38c850eaa6882bb6eb2c" - integrity sha512-xMExZgjan5/8ZTjJkZoLoTKY1MQOMk7W1YXslbg9BpLevBycPk041MlLauzCyO8XdOpqpVnFCg/9W66fltqmQg== +"@lerna/clean@6.4.1": + version "6.4.1" + resolved "https://registry.yarnpkg.com/@lerna/clean/-/clean-6.4.1.tgz#e9ee365ee6879ee998b78b3269fad02b5f385771" + integrity sha512-FuVyW3mpos5ESCWSkQ1/ViXyEtsZ9k45U66cdM/HnteHQk/XskSQw0sz9R+whrZRUDu6YgYLSoj1j0YAHVK/3A== dependencies: - "@lerna/command" "5.1.8" - "@lerna/filter-options" "5.1.8" - "@lerna/prompt" "5.1.8" - "@lerna/pulse-till-done" "5.1.8" - "@lerna/rimraf-dir" "5.1.8" + "@lerna/command" "6.4.1" + "@lerna/filter-options" "6.4.1" + "@lerna/prompt" "6.4.1" + "@lerna/pulse-till-done" "6.4.1" + "@lerna/rimraf-dir" "6.4.1" p-map "^4.0.0" p-map-series "^2.1.0" p-waterfall "^2.1.1" -"@lerna/cli@5.1.8": - version "5.1.8" - resolved "https://registry.yarnpkg.com/@lerna/cli/-/cli-5.1.8.tgz#b094a2d2eb70522ced850da60c94a2e0bf8c5adc" - integrity sha512-0Ghhd9M9QvY6qZtnjTq5RHOIac2ttsW2VNFLFso8ov3YV+rJF4chLhyVaVBvLSA+5ZhwFH+xQ3/yeUx1tDO8GA== +"@lerna/cli@6.4.1": + version "6.4.1" + resolved "https://registry.yarnpkg.com/@lerna/cli/-/cli-6.4.1.tgz#2b2d093baace40e822caee8c90f698e98a437a2f" + integrity sha512-2pNa48i2wzFEd9LMPKWI3lkW/3widDqiB7oZUM1Xvm4eAOuDWc9I3RWmAUIVlPQNf3n4McxJCvsZZ9BpQN50Fg== dependencies: - "@lerna/global-options" "5.1.8" + "@lerna/global-options" "6.4.1" dedent "^0.7.0" npmlog "^6.0.2" yargs "^16.2.0" -"@lerna/collect-uncommitted@5.1.8": - version "5.1.8" - resolved "https://registry.yarnpkg.com/@lerna/collect-uncommitted/-/collect-uncommitted-5.1.8.tgz#1caf374998402883b4a345dffed8c1cddd57e76a" - integrity sha512-pRsIYu82A3DxLahQI/3azoi/kjj6QSSHHAOx4y1YVefeDCaVtAm8aesNbpnyNVfJrie/1Gt5GMEpjfm/KScjlw== +"@lerna/collect-uncommitted@6.4.1": + version "6.4.1" + resolved "https://registry.yarnpkg.com/@lerna/collect-uncommitted/-/collect-uncommitted-6.4.1.tgz#ae62bcaa5ecaa5b7fbc41eb9ae90b6711be156ec" + integrity sha512-5IVQGhlLrt7Ujc5ooYA1Xlicdba/wMcDSnbQwr8ufeqnzV2z4729pLCVk55gmi6ZienH/YeBPHxhB5u34ofE0Q== dependencies: - "@lerna/child-process" "5.1.8" + "@lerna/child-process" "6.4.1" chalk "^4.1.0" npmlog "^6.0.2" -"@lerna/collect-updates@5.1.8": - version "5.1.8" - resolved "https://registry.yarnpkg.com/@lerna/collect-updates/-/collect-updates-5.1.8.tgz#b4d2f1a333abb690b74e4c5def45763347070754" - integrity sha512-ZPQmYKzwDJ4T+t2fRUI/JjaCzC8Lv02kWIeSXrcIG+cf2xrbM0vK4iQMAKhagTsiWt9hrFwvtMgLp4a6+Ht8Qg== +"@lerna/collect-updates@6.4.1": + version "6.4.1" + resolved "https://registry.yarnpkg.com/@lerna/collect-updates/-/collect-updates-6.4.1.tgz#4f7cf1c411f3253d0104e7b64cb0aa315a5dfc81" + integrity sha512-pzw2/FC+nIqYkknUHK9SMmvP3MsLEjxI597p3WV86cEDN3eb1dyGIGuHiKShtjvT08SKSwpTX+3bCYvLVxtC5Q== dependencies: - "@lerna/child-process" "5.1.8" - "@lerna/describe-ref" "5.1.8" + "@lerna/child-process" "6.4.1" + "@lerna/describe-ref" "6.4.1" minimatch "^3.0.4" npmlog "^6.0.2" slash "^3.0.0" -"@lerna/command@5.1.8": - version "5.1.8" - resolved "https://registry.yarnpkg.com/@lerna/command/-/command-5.1.8.tgz#0dcca15a7148ce3326178c7358d5f907430dc328" - integrity sha512-j/Q++APvkyN2t8GqOpK+4OxH1bB7OZGVWIKh0JQlwbtqH1Y06wlSyNdwpPmv8h1yO9fS1pY/xHwFbs1IicxwzA== +"@lerna/command@6.4.1": + version "6.4.1" + resolved "https://registry.yarnpkg.com/@lerna/command/-/command-6.4.1.tgz#96c4f5d88792c6c638738c66fcc3a7ad0d2487e2" + integrity sha512-3Lifj8UTNYbRad8JMP7IFEEdlIyclWyyvq/zvNnTS9kCOEymfmsB3lGXr07/AFoi6qDrvN64j7YSbPZ6C6qonw== dependencies: - "@lerna/child-process" "5.1.8" - "@lerna/package-graph" "5.1.8" - "@lerna/project" "5.1.8" - "@lerna/validation-error" "5.1.8" - "@lerna/write-log-file" "5.1.8" + "@lerna/child-process" "6.4.1" + "@lerna/package-graph" "6.4.1" + "@lerna/project" "6.4.1" + "@lerna/validation-error" "6.4.1" + "@lerna/write-log-file" "6.4.1" clone-deep "^4.0.1" dedent "^0.7.0" execa "^5.0.0" is-ci "^2.0.0" npmlog "^6.0.2" -"@lerna/conventional-commits@5.1.8": - version "5.1.8" - resolved "https://registry.yarnpkg.com/@lerna/conventional-commits/-/conventional-commits-5.1.8.tgz#5d6f87ebb024d4468024b22ced0ea948246d593f" - integrity sha512-UduSVDp/+2WlEV6ZO5s7yTzkfhYyPdEsqR6aaUtIJZe9wejcCK4Lc3BJ2BAYIOdtDArNY2CJPsz1LYvFDtPRkw== +"@lerna/conventional-commits@6.4.1": + version "6.4.1" + resolved "https://registry.yarnpkg.com/@lerna/conventional-commits/-/conventional-commits-6.4.1.tgz#b8d44a8a71865b4d37b900137acef623f3a0a11b" + integrity sha512-NIvCOjStjQy5O8VojB7/fVReNNDEJOmzRG2sTpgZ/vNS4AzojBQZ/tobzhm7rVkZZ43R9srZeuhfH9WgFsVUSA== dependencies: - "@lerna/validation-error" "5.1.8" + "@lerna/validation-error" "6.4.1" conventional-changelog-angular "^5.0.12" - conventional-changelog-core "^4.2.2" + conventional-changelog-core "^4.2.4" conventional-recommended-bump "^6.1.0" fs-extra "^9.1.0" get-stream "^6.0.0" - npm-package-arg "^8.1.0" + npm-package-arg "8.1.1" npmlog "^6.0.2" pify "^5.0.0" semver "^7.3.4" -"@lerna/create-symlink@5.1.8": - version "5.1.8" - resolved "https://registry.yarnpkg.com/@lerna/create-symlink/-/create-symlink-5.1.8.tgz#36b3cb34d3e434f021a878c7353a6dd0ccacd6bd" - integrity sha512-5acQITDsJ7dqywPRrF1mpTUPm/EXFfiv/xF6zX+ySUjp4h0Zhhnsm8g2jFdRPDSjIxFD0rV/5iU4X6qmflXlAg== +"@lerna/create-symlink@6.4.1": + version "6.4.1" + resolved "https://registry.yarnpkg.com/@lerna/create-symlink/-/create-symlink-6.4.1.tgz#0efec22d78dd814a70d8345ced52c39beb05874b" + integrity sha512-rNivHFYV1GAULxnaTqeGb2AdEN2OZzAiZcx5CFgj45DWXQEGwPEfpFmCSJdXhFZbyd3K0uiDlAXjAmV56ov3FQ== dependencies: - cmd-shim "^4.1.0" + cmd-shim "^5.0.0" fs-extra "^9.1.0" npmlog "^6.0.2" -"@lerna/create@5.1.8": - version "5.1.8" - resolved "https://registry.yarnpkg.com/@lerna/create/-/create-5.1.8.tgz#ccb485e460d4d9f1b34cbe74e79b0261c710af3a" - integrity sha512-n9qLLeg1e0bQeuk8pA8ELEP05Ktl50e1EirdXGRqqvaXdCn41nYHo4PilUgb77/o/t3Z5N4/ic+0w8OvGVakNg== +"@lerna/create@6.4.1": + version "6.4.1" + resolved "https://registry.yarnpkg.com/@lerna/create/-/create-6.4.1.tgz#3fc8556adadff1265432a6cee69ee14465798e71" + integrity sha512-qfQS8PjeGDDlxEvKsI/tYixIFzV2938qLvJohEKWFn64uvdLnXCamQ0wvRJST8p1ZpHWX4AXrB+xEJM3EFABrA== dependencies: - "@lerna/child-process" "5.1.8" - "@lerna/command" "5.1.8" - "@lerna/npm-conf" "5.1.8" - "@lerna/validation-error" "5.1.8" + "@lerna/child-process" "6.4.1" + "@lerna/command" "6.4.1" + "@lerna/npm-conf" "6.4.1" + "@lerna/validation-error" "6.4.1" dedent "^0.7.0" fs-extra "^9.1.0" - globby "^11.0.2" - init-package-json "^2.0.2" - npm-package-arg "^8.1.0" + init-package-json "^3.0.2" + npm-package-arg "8.1.1" p-reduce "^2.1.0" - pacote "^13.4.1" + pacote "^13.6.1" pify "^5.0.0" semver "^7.3.4" slash "^3.0.0" validate-npm-package-license "^3.0.4" - validate-npm-package-name "^3.0.0" - whatwg-url "^8.4.0" + validate-npm-package-name "^4.0.0" yargs-parser "20.2.4" -"@lerna/describe-ref@5.1.8": - version "5.1.8" - resolved "https://registry.yarnpkg.com/@lerna/describe-ref/-/describe-ref-5.1.8.tgz#b0f5d252f97d9d96ca404f2b99c91d426f2b7577" - integrity sha512-/u5b2ho09icPcvPb1mlh/tPC07nSFc1cvvFjM9Yg5kfVs23vzVWeA8y0Bk5djlaaSzyHECyqviriX0aoaY47Wg== +"@lerna/describe-ref@6.4.1": + version "6.4.1" + resolved "https://registry.yarnpkg.com/@lerna/describe-ref/-/describe-ref-6.4.1.tgz#c0a0beca5dfeada3a39b030f69c8c98f5623bb13" + integrity sha512-MXGXU8r27wl355kb1lQtAiu6gkxJ5tAisVJvFxFM1M+X8Sq56icNoaROqYrvW6y97A9+3S8Q48pD3SzkFv31Xw== dependencies: - "@lerna/child-process" "5.1.8" + "@lerna/child-process" "6.4.1" npmlog "^6.0.2" -"@lerna/diff@5.1.8": - version "5.1.8" - resolved "https://registry.yarnpkg.com/@lerna/diff/-/diff-5.1.8.tgz#112f68a99025e5732d4ec8ec6cb6db323555846a" - integrity sha512-BLoi6l/v8p43IkAHTkpjZ4Kq27kYK7iti6y6gYoZuljSwNj38TjgqRb2ohHezQ5c0KFAj8xHEOuZM3Ou6tGyTQ== +"@lerna/diff@6.4.1": + version "6.4.1" + resolved "https://registry.yarnpkg.com/@lerna/diff/-/diff-6.4.1.tgz#ca9e62a451ce199faaa7ef5990ded3fad947e2f9" + integrity sha512-TnzJsRPN2fOjUrmo5Boi43fJmRtBJDsVgwZM51VnLoKcDtO1kcScXJ16Od2Xx5bXbp5dES5vGDLL/USVVWfeAg== dependencies: - "@lerna/child-process" "5.1.8" - "@lerna/command" "5.1.8" - "@lerna/validation-error" "5.1.8" + "@lerna/child-process" "6.4.1" + "@lerna/command" "6.4.1" + "@lerna/validation-error" "6.4.1" npmlog "^6.0.2" -"@lerna/exec@5.1.8": - version "5.1.8" - resolved "https://registry.yarnpkg.com/@lerna/exec/-/exec-5.1.8.tgz#a5a808ebb40c74c1a339e73816ea1aa1c53dc284" - integrity sha512-U+owlBKoAUfULqRz0oBtHx/I6tYQy9I7xfPP0GoaXa8lpF7esnpCxsJG8GpdzFqIS30o6a2PtyHvp4jkrQF8Zw== - dependencies: - "@lerna/child-process" "5.1.8" - "@lerna/command" "5.1.8" - "@lerna/filter-options" "5.1.8" - "@lerna/profiler" "5.1.8" - "@lerna/run-topologically" "5.1.8" - "@lerna/validation-error" "5.1.8" +"@lerna/exec@6.4.1": + version "6.4.1" + resolved "https://registry.yarnpkg.com/@lerna/exec/-/exec-6.4.1.tgz#493ce805b6959e8299ec58fab8d31fd01ed209ba" + integrity sha512-KAWfuZpoyd3FMejHUORd0GORMr45/d9OGAwHitfQPVs4brsxgQFjbbBEEGIdwsg08XhkDb4nl6IYVASVTq9+gA== + dependencies: + "@lerna/child-process" "6.4.1" + "@lerna/command" "6.4.1" + "@lerna/filter-options" "6.4.1" + "@lerna/profiler" "6.4.1" + "@lerna/run-topologically" "6.4.1" + "@lerna/validation-error" "6.4.1" p-map "^4.0.0" -"@lerna/filter-options@5.1.8": - version "5.1.8" - resolved "https://registry.yarnpkg.com/@lerna/filter-options/-/filter-options-5.1.8.tgz#cb18431a92a138e9428af0217b01bfa89adb9b13" - integrity sha512-ene6xj1BRSFgIgcVg9xABp1cCiRnqm3Uetk9InxOtECbofpSDa7cQy5lsPv6GGAgXFbT91SURQiipH9FAOP+yQ== +"@lerna/filter-options@6.4.1": + version "6.4.1" + resolved "https://registry.yarnpkg.com/@lerna/filter-options/-/filter-options-6.4.1.tgz#571d37436878fab8b2ac84ca1c3863acd3515cfb" + integrity sha512-efJh3lP2T+9oyNIP2QNd9EErf0Sm3l3Tz8CILMsNJpjSU6kO43TYWQ+L/ezu2zM99KVYz8GROLqDcHRwdr8qUA== dependencies: - "@lerna/collect-updates" "5.1.8" - "@lerna/filter-packages" "5.1.8" + "@lerna/collect-updates" "6.4.1" + "@lerna/filter-packages" "6.4.1" dedent "^0.7.0" npmlog "^6.0.2" -"@lerna/filter-packages@5.1.8": - version "5.1.8" - resolved "https://registry.yarnpkg.com/@lerna/filter-packages/-/filter-packages-5.1.8.tgz#5dd32c05c646f4d3ad55adde8e67d60661c2bead" - integrity sha512-2pdtZ+I2Sb+XKfUa/q8flVUyaY0hhwqFYMXll7Nut7Phb1w1TtkEXc2/N0Ac1yia6qSJB/5WrsbAcLF/ITp1vA== +"@lerna/filter-packages@6.4.1": + version "6.4.1" + resolved "https://registry.yarnpkg.com/@lerna/filter-packages/-/filter-packages-6.4.1.tgz#e138b182816a049c81de094069cad12aaa41a236" + integrity sha512-LCMGDGy4b+Mrb6xkcVzp4novbf5MoZEE6ZQF1gqG0wBWqJzNcKeFiOmf352rcDnfjPGZP6ct5+xXWosX/q6qwg== dependencies: - "@lerna/validation-error" "5.1.8" + "@lerna/validation-error" "6.4.1" multimatch "^5.0.0" npmlog "^6.0.2" -"@lerna/get-npm-exec-opts@5.1.8": - version "5.1.8" - resolved "https://registry.yarnpkg.com/@lerna/get-npm-exec-opts/-/get-npm-exec-opts-5.1.8.tgz#71ea0a8760231322c5a4fe103aab659e3de062a3" - integrity sha512-oujoIkEDDVK2+5ooPMEPI+xGs/iwPmGJ63AZu1h7P42YU9tHKQmF5yPybF3Jn99W8+HggM6APUGiX+5oHRvKXA== +"@lerna/get-npm-exec-opts@6.4.1": + version "6.4.1" + resolved "https://registry.yarnpkg.com/@lerna/get-npm-exec-opts/-/get-npm-exec-opts-6.4.1.tgz#42681f6db4238277889b3423f87308eda5dc01ec" + integrity sha512-IvN/jyoklrWcjssOf121tZhOc16MaFPOu5ii8a+Oy0jfTriIGv929Ya8MWodj75qec9s+JHoShB8yEcMqZce4g== dependencies: npmlog "^6.0.2" -"@lerna/get-packed@5.1.8": - version "5.1.8" - resolved "https://registry.yarnpkg.com/@lerna/get-packed/-/get-packed-5.1.8.tgz#c8020be24befbe018fc535cf513efa5863a4a1a2" - integrity sha512-3vabIFlfUFQPbFnlOaDCNY4p7mufrhIFPoXxWu15JnjJsSDf9UB2a98xX43xNlxjgZLvnLai3bhCNfrKonI4Kw== +"@lerna/get-packed@6.4.1": + version "6.4.1" + resolved "https://registry.yarnpkg.com/@lerna/get-packed/-/get-packed-6.4.1.tgz#b3b8b907002d50bf8792dd97e2729249c0b0e0cd" + integrity sha512-uaDtYwK1OEUVIXn84m45uPlXShtiUcw6V9TgB3rvHa3rrRVbR7D4r+JXcwVxLGrAS7LwxVbYWEEO/Z/bX7J/Lg== dependencies: fs-extra "^9.1.0" - ssri "^8.0.1" + ssri "^9.0.1" tar "^6.1.0" -"@lerna/github-client@5.1.8": - version "5.1.8" - resolved "https://registry.yarnpkg.com/@lerna/github-client/-/github-client-5.1.8.tgz#1b0a3d5ae9996d56e7977d319d5b95ec2c24df8f" - integrity sha512-y1oweMZ9xc/htIHy42hy2FuMUR/LS3CQlslXG9PAHzl5rE1VDDjvSv61kS50ZberGfB9xmkCxqH+2LgROG9B1A== +"@lerna/github-client@6.4.1": + version "6.4.1" + resolved "https://registry.yarnpkg.com/@lerna/github-client/-/github-client-6.4.1.tgz#25d19b440395a6039b9162ee58dadb9dce990ff0" + integrity sha512-ridDMuzmjMNlcDmrGrV9mxqwUKzt9iYqCPwVYJlRYrnE3jxyg+RdooquqskVFj11djcY6xCV2Q2V1lUYwF+PmA== dependencies: - "@lerna/child-process" "5.1.8" + "@lerna/child-process" "6.4.1" "@octokit/plugin-enterprise-rest" "^6.0.1" - "@octokit/rest" "^18.1.0" - git-url-parse "^12.0.0" + "@octokit/rest" "^19.0.3" + git-url-parse "^13.1.0" npmlog "^6.0.2" -"@lerna/gitlab-client@5.1.8": - version "5.1.8" - resolved "https://registry.yarnpkg.com/@lerna/gitlab-client/-/gitlab-client-5.1.8.tgz#84e9063c79b0543570ca02ad50f7ad54446ab78d" - integrity sha512-/EMKdkGnBU4ldyAQ4pXp2TKi1znvY3MiCULt8Hy42p4HhfFl/AxZYDovQYfop1NHVk29BQrGHfvlpyBNqZ2a8g== +"@lerna/gitlab-client@6.4.1": + version "6.4.1" + resolved "https://registry.yarnpkg.com/@lerna/gitlab-client/-/gitlab-client-6.4.1.tgz#a01d962dc52a55b8272ea52bc54d72c5fd9db6f9" + integrity sha512-AdLG4d+jbUvv0jQyygQUTNaTCNSMDxioJso6aAjQ/vkwyy3fBJ6FYzX74J4adSfOxC2MQZITFyuG+c9ggp7pyQ== dependencies: node-fetch "^2.6.1" npmlog "^6.0.2" - whatwg-url "^8.4.0" -"@lerna/global-options@5.1.8": - version "5.1.8" - resolved "https://registry.yarnpkg.com/@lerna/global-options/-/global-options-5.1.8.tgz#ba760c9a9a686bc0109d9b09017737a7365b7649" - integrity sha512-VCfTilGh0O4T6Lk4DKYA5cUl1kPjwFfRUS/GSpdJx0Lf/dyDbFihrmTHefgUe9N2/nTQySDIdPk9HBr45tozWQ== +"@lerna/global-options@6.4.1": + version "6.4.1" + resolved "https://registry.yarnpkg.com/@lerna/global-options/-/global-options-6.4.1.tgz#7df76b1d38500606a8dc3ce0804bab6894c4f4a3" + integrity sha512-UTXkt+bleBB8xPzxBPjaCN/v63yQdfssVjhgdbkQ//4kayaRA65LyEtJTi9rUrsLlIy9/rbeb+SAZUHg129fJg== -"@lerna/has-npm-version@5.1.8": - version "5.1.8" - resolved "https://registry.yarnpkg.com/@lerna/has-npm-version/-/has-npm-version-5.1.8.tgz#9ea80ee3616006df1094cc18c1bc58f3f1008299" - integrity sha512-yN5j9gje2ND8zQf4tN52QDQ/yFb24o9Kasm4PZm99FzBURRIwFWCnvo3edOMaiJg0DpA660L+Kq9G0L+ZRKRZQ== +"@lerna/has-npm-version@6.4.1": + version "6.4.1" + resolved "https://registry.yarnpkg.com/@lerna/has-npm-version/-/has-npm-version-6.4.1.tgz#04eba7df687e665294834253b659430efc1e01bb" + integrity sha512-vW191w5iCkwNWWWcy4542ZOpjKYjcP/pU3o3+w6NM1J3yBjWZcNa8lfzQQgde2QkGyNi+i70o6wIca1o0sdKwg== dependencies: - "@lerna/child-process" "5.1.8" + "@lerna/child-process" "6.4.1" semver "^7.3.4" -"@lerna/import@5.1.8": - version "5.1.8" - resolved "https://registry.yarnpkg.com/@lerna/import/-/import-5.1.8.tgz#b1eebfaab1df618ec0a92a639c45010c1fcd1098" - integrity sha512-m1+TEhlgS9i14T7o0/8o6FMZJ1O2PkQdpCjqUa5xdLITqvPozoMNujNgiX3ZVLg/XcFOjMtbCsYtspqtKyEsMQ== +"@lerna/import@6.4.1": + version "6.4.1" + resolved "https://registry.yarnpkg.com/@lerna/import/-/import-6.4.1.tgz#b5696fed68a32d32398d66f95192267f1da5110e" + integrity sha512-oDg8g1PNrCM1JESLsG3rQBtPC+/K9e4ohs0xDKt5E6p4l7dc0Ib4oo0oCCT/hGzZUlNwHxrc2q9JMRzSAn6P/Q== dependencies: - "@lerna/child-process" "5.1.8" - "@lerna/command" "5.1.8" - "@lerna/prompt" "5.1.8" - "@lerna/pulse-till-done" "5.1.8" - "@lerna/validation-error" "5.1.8" + "@lerna/child-process" "6.4.1" + "@lerna/command" "6.4.1" + "@lerna/prompt" "6.4.1" + "@lerna/pulse-till-done" "6.4.1" + "@lerna/validation-error" "6.4.1" dedent "^0.7.0" fs-extra "^9.1.0" p-map-series "^2.1.0" -"@lerna/info@5.1.8": - version "5.1.8" - resolved "https://registry.yarnpkg.com/@lerna/info/-/info-5.1.8.tgz#99aab0f599cf9d9f1f144dbc110e38f6337e0a77" - integrity sha512-VNCBNOrd5Q1iv1MOF++PzMrdAnTn6KTDbb5hcXHdWBRZUuOs3QOwVYGzAlTFMvwVmmlcER4z8BYyUsbxk3sIdQ== +"@lerna/info@6.4.1": + version "6.4.1" + resolved "https://registry.yarnpkg.com/@lerna/info/-/info-6.4.1.tgz#30354fcb82c99b1f0ed753f957fbaca5b250c3fa" + integrity sha512-Ks4R7IndIr4vQXz+702gumPVhH6JVkshje0WKA3+ew2qzYZf68lU1sBe1OZsQJU3eeY2c60ax+bItSa7aaIHGw== dependencies: - "@lerna/command" "5.1.8" - "@lerna/output" "5.1.8" + "@lerna/command" "6.4.1" + "@lerna/output" "6.4.1" envinfo "^7.7.4" -"@lerna/init@5.1.8": - version "5.1.8" - resolved "https://registry.yarnpkg.com/@lerna/init/-/init-5.1.8.tgz#7ad1433d50e283ba01cae84f9640cf99b0a8a047" - integrity sha512-vEMnq/70u/c031/vURA4pZSxlBRAwjg7vOP7mt9M4dmKz/vkVnQ/5Ig9K0TKqC31hQg957/4m20obYEiFgC3Pw== +"@lerna/init@6.4.1": + version "6.4.1" + resolved "https://registry.yarnpkg.com/@lerna/init/-/init-6.4.1.tgz#ea4905ca976189db4b0bf04d78919060146bf684" + integrity sha512-CXd/s/xgj0ZTAoOVyolOTLW2BG7uQOhWW4P/ktlwwJr9s3c4H/z+Gj36UXw3q5X1xdR29NZt7Vc6fvROBZMjUQ== dependencies: - "@lerna/child-process" "5.1.8" - "@lerna/command" "5.1.8" + "@lerna/child-process" "6.4.1" + "@lerna/command" "6.4.1" + "@lerna/project" "6.4.1" fs-extra "^9.1.0" p-map "^4.0.0" write-json-file "^4.3.0" -"@lerna/link@5.1.8": - version "5.1.8" - resolved "https://registry.yarnpkg.com/@lerna/link/-/link-5.1.8.tgz#f9d5736640f524c9f255007d3d7b3792846042ef" - integrity sha512-qOtZiMzB9JYyNPUlvpqTxh0Z1EmNVde8pFUIYybv+s3btrKEBPgsvvrOrob/mha3QJxnwcPDPjHt/wCHFxLruA== +"@lerna/link@6.4.1": + version "6.4.1" + resolved "https://registry.yarnpkg.com/@lerna/link/-/link-6.4.1.tgz#f31ed1f6aea1581e358a9ff545be78b61e923175" + integrity sha512-O8Rt7MAZT/WT2AwrB/+HY76ktnXA9cDFO9rhyKWZGTHdplbzuJgfsGzu8Xv0Ind+w+a8xLfqtWGPlwiETnDyrw== dependencies: - "@lerna/command" "5.1.8" - "@lerna/package-graph" "5.1.8" - "@lerna/symlink-dependencies" "5.1.8" + "@lerna/command" "6.4.1" + "@lerna/package-graph" "6.4.1" + "@lerna/symlink-dependencies" "6.4.1" + "@lerna/validation-error" "6.4.1" p-map "^4.0.0" slash "^3.0.0" -"@lerna/list@5.1.8": - version "5.1.8" - resolved "https://registry.yarnpkg.com/@lerna/list/-/list-5.1.8.tgz#72268a7ab4042f4d4463cc41e247c1473ad7c7cf" - integrity sha512-fVN9o/wKtgcOyuYwvYTg2HI6ORX2kOoBkCJ+PI/uZ/ImwLMTJ2Bf8i/Vsysl3bLFHhQFglzPZ7V1SQP/ku0Sdw== +"@lerna/list@6.4.1": + version "6.4.1" + resolved "https://registry.yarnpkg.com/@lerna/list/-/list-6.4.1.tgz#12ad83902e148d1e5ba007149b72b14636f9f1ba" + integrity sha512-7a6AKgXgC4X7nK6twVPNrKCiDhrCiAhL/FE4u9HYhHqw9yFwyq8Qe/r1RVOkAOASNZzZ8GuBvob042bpunupCw== dependencies: - "@lerna/command" "5.1.8" - "@lerna/filter-options" "5.1.8" - "@lerna/listable" "5.1.8" - "@lerna/output" "5.1.8" + "@lerna/command" "6.4.1" + "@lerna/filter-options" "6.4.1" + "@lerna/listable" "6.4.1" + "@lerna/output" "6.4.1" -"@lerna/listable@5.1.8": - version "5.1.8" - resolved "https://registry.yarnpkg.com/@lerna/listable/-/listable-5.1.8.tgz#d101e7a6c1bb9df670b4514422621684edab7770" - integrity sha512-nQ/40cbVZLFBv8o9Dz6ivHFZhosfDTYOPm4oHNu0xdexaTXWz5bQUlM4HtOm7K0dJ1fvLEVqiQNAuFSEhARt9g== +"@lerna/listable@6.4.1": + version "6.4.1" + resolved "https://registry.yarnpkg.com/@lerna/listable/-/listable-6.4.1.tgz#6f5c83865391c6beeb41802951c674e2de119bde" + integrity sha512-L8ANeidM10aoF8aL3L/771Bb9r/TRkbEPzAiC8Iy2IBTYftS87E3rT/4k5KBEGYzMieSKJaskSFBV0OQGYV1Cw== dependencies: - "@lerna/query-graph" "5.1.8" + "@lerna/query-graph" "6.4.1" chalk "^4.1.0" columnify "^1.6.0" -"@lerna/log-packed@5.1.8": - version "5.1.8" - resolved "https://registry.yarnpkg.com/@lerna/log-packed/-/log-packed-5.1.8.tgz#22e02f41b99e7202a45b066f8747dc8451e0b18e" - integrity sha512-alaCIzCtKV5oKyu632emda0hUQMw/BcL2U3v4ObLu90sU8P7mu6TipKRvR9OZxOLDnZGnPE7CMHSU8gsQoIasw== +"@lerna/log-packed@6.4.1": + version "6.4.1" + resolved "https://registry.yarnpkg.com/@lerna/log-packed/-/log-packed-6.4.1.tgz#43eae50d5c0cd906b1977a58b62b35541cf89ec1" + integrity sha512-Pwv7LnIgWqZH4vkM1rWTVF+pmWJu7d0ZhVwyhCaBJUsYbo+SyB2ZETGygo3Z/A+vZ/S7ImhEEKfIxU9bg5lScQ== dependencies: byte-size "^7.0.0" columnify "^1.6.0" has-unicode "^2.0.1" npmlog "^6.0.2" -"@lerna/npm-conf@5.1.8": - version "5.1.8" - resolved "https://registry.yarnpkg.com/@lerna/npm-conf/-/npm-conf-5.1.8.tgz#a36b216c1af65c0524c4278b2f53ed50295110ed" - integrity sha512-d/pIcO4RwO3fXNlUbhQ6+qwULxGSiW/xcOtiETVf4ZfjaDqjkCaIxZaeZfm5gWDtII5klpQn3f2d71FCnZG5lw== +"@lerna/npm-conf@6.4.1": + version "6.4.1" + resolved "https://registry.yarnpkg.com/@lerna/npm-conf/-/npm-conf-6.4.1.tgz#64dba237ff41472a24f96192669c1bc0dce15edb" + integrity sha512-Q+83uySGXYk3n1pYhvxtzyGwBGijYgYecgpiwRG1YNyaeGy+Mkrj19cyTWubT+rU/kM5c6If28+y9kdudvc7zQ== dependencies: config-chain "^1.1.12" pify "^5.0.0" -"@lerna/npm-dist-tag@5.1.8": - version "5.1.8" - resolved "https://registry.yarnpkg.com/@lerna/npm-dist-tag/-/npm-dist-tag-5.1.8.tgz#f5b26dfd9e97a0eb72987c8175d3b1bd2a7d82a0" - integrity sha512-vZXO0/EClOzRRHHfqB4APhZkxiJpQbsQAAFwaXQCNJE+3S+I/MD0S3iiUWrNs4QnN/8Lj1KyzUfznVDXX7AIUQ== +"@lerna/npm-dist-tag@6.4.1": + version "6.4.1" + resolved "https://registry.yarnpkg.com/@lerna/npm-dist-tag/-/npm-dist-tag-6.4.1.tgz#f14e7176f7e323284e8aa8636b44818a61738fd1" + integrity sha512-If1Hn4q9fn0JWuBm455iIZDWE6Fsn4Nv8Tpqb+dYf0CtoT5Hn+iT64xSiU5XJw9Vc23IR7dIujkEXm2MVbnvZw== dependencies: - "@lerna/otplease" "5.1.8" - npm-package-arg "^8.1.0" - npm-registry-fetch "^9.0.0" + "@lerna/otplease" "6.4.1" + npm-package-arg "8.1.1" + npm-registry-fetch "^13.3.0" npmlog "^6.0.2" -"@lerna/npm-install@5.1.8": - version "5.1.8" - resolved "https://registry.yarnpkg.com/@lerna/npm-install/-/npm-install-5.1.8.tgz#03aada74bd17e196288d417ec2f7d3399e289c01" - integrity sha512-AiYQyz4W1+NDeBw3qmdiiatfCtwtaGOi7zHtN1eAqheVTxEMuuYjNHt+8hu6nSpDFYtonz0NsKFvaqRJ5LbVmw== +"@lerna/npm-install@6.4.1": + version "6.4.1" + resolved "https://registry.yarnpkg.com/@lerna/npm-install/-/npm-install-6.4.1.tgz#99f5748cb43de9786ea2b538c94a7183d38fc476" + integrity sha512-7gI1txMA9qTaT3iiuk/8/vL78wIhtbbOLhMf8m5yQ2G+3t47RUA8MNgUMsq4Zszw9C83drayqesyTf0u8BzVRg== dependencies: - "@lerna/child-process" "5.1.8" - "@lerna/get-npm-exec-opts" "5.1.8" + "@lerna/child-process" "6.4.1" + "@lerna/get-npm-exec-opts" "6.4.1" fs-extra "^9.1.0" - npm-package-arg "^8.1.0" + npm-package-arg "8.1.1" npmlog "^6.0.2" signal-exit "^3.0.3" write-pkg "^4.0.0" -"@lerna/npm-publish@5.1.8": - version "5.1.8" - resolved "https://registry.yarnpkg.com/@lerna/npm-publish/-/npm-publish-5.1.8.tgz#259550c25d1d277c296dc3eb4e3e20f626e64510" - integrity sha512-Gup/1d8ovc21x3spKPhFK0tIYYn8HOjnpCAg5ytINIW1QM/QcLAigY58If8uiyt+aojz6lubWrSR8/OHf9CXBw== +"@lerna/npm-publish@6.4.1": + version "6.4.1" + resolved "https://registry.yarnpkg.com/@lerna/npm-publish/-/npm-publish-6.4.1.tgz#baf07b108ae8b32932612db63206bcd5b5ee0e88" + integrity sha512-lbNEg+pThPAD8lIgNArm63agtIuCBCF3umxvgTQeLzyqUX6EtGaKJFyz/6c2ANcAuf8UfU7WQxFFbOiolibXTQ== dependencies: - "@lerna/otplease" "5.1.8" - "@lerna/run-lifecycle" "5.1.8" + "@lerna/otplease" "6.4.1" + "@lerna/run-lifecycle" "6.4.1" fs-extra "^9.1.0" - libnpmpublish "^4.0.0" - npm-package-arg "^8.1.0" + libnpmpublish "^6.0.4" + npm-package-arg "8.1.1" npmlog "^6.0.2" pify "^5.0.0" - read-package-json "^3.0.0" + read-package-json "^5.0.1" -"@lerna/npm-run-script@5.1.8": - version "5.1.8" - resolved "https://registry.yarnpkg.com/@lerna/npm-run-script/-/npm-run-script-5.1.8.tgz#6472bd96cf667feb829101a5e4db587b2e009d33" - integrity sha512-HzvukNC+hDIR25EpYWOvIGJItd0onXqzS9Ivdtw98ZQG3Jexi2Mn18A9tDqHOKCEGO3pVYrI9ep8VWkah2Bj1w== +"@lerna/npm-run-script@6.4.1": + version "6.4.1" + resolved "https://registry.yarnpkg.com/@lerna/npm-run-script/-/npm-run-script-6.4.1.tgz#86db4f15d359b8a371db666aa51c9b2b87b602f3" + integrity sha512-HyvwuyhrGqDa1UbI+pPbI6v+wT6I34R0PW3WCADn6l59+AyqLOCUQQr+dMW7jdYNwjO6c/Ttbvj4W58EWsaGtQ== dependencies: - "@lerna/child-process" "5.1.8" - "@lerna/get-npm-exec-opts" "5.1.8" + "@lerna/child-process" "6.4.1" + "@lerna/get-npm-exec-opts" "6.4.1" npmlog "^6.0.2" -"@lerna/otplease@5.1.8": - version "5.1.8" - resolved "https://registry.yarnpkg.com/@lerna/otplease/-/otplease-5.1.8.tgz#b0019f71b8a86e1594f277abf0f9c95aeebd2419" - integrity sha512-/OVZ7Rbs8/ft14f4i/9HEFDsxJkBSg74rMUqyqFH3fID/RL3ja9hW5bI1bENxvYgs0bp/THy4lV5V75ZcI81zQ== +"@lerna/otplease@6.4.1": + version "6.4.1" + resolved "https://registry.yarnpkg.com/@lerna/otplease/-/otplease-6.4.1.tgz#9573e053c43e7139442da96fe655aa02749cb8a3" + integrity sha512-ePUciFfFdythHNMp8FP5K15R/CoGzSLVniJdD50qm76c4ATXZHnGCW2PGwoeAZCy4QTzhlhdBq78uN0wAs75GA== dependencies: - "@lerna/prompt" "5.1.8" + "@lerna/prompt" "6.4.1" -"@lerna/output@5.1.8": - version "5.1.8" - resolved "https://registry.yarnpkg.com/@lerna/output/-/output-5.1.8.tgz#ca4d96379bbe7556035039bf2f416f36d363082a" - integrity sha512-dXsKY8X2eAdPKRKHDZTASlWn95Eav1oQX9doUXkvV3o4UwIgqOCIsU7RqSED3EAEQz6VUH0rXNb/+d3uVeAoJQ== +"@lerna/output@6.4.1": + version "6.4.1" + resolved "https://registry.yarnpkg.com/@lerna/output/-/output-6.4.1.tgz#327baf768b8fb63db9d52f68288d387379f814f7" + integrity sha512-A1yRLF0bO+lhbIkrryRd6hGSD0wnyS1rTPOWJhScO/Zyv8vIPWhd2fZCLR1gI2d/Kt05qmK3T/zETTwloK7Fww== dependencies: npmlog "^6.0.2" -"@lerna/pack-directory@5.1.8": - version "5.1.8" - resolved "https://registry.yarnpkg.com/@lerna/pack-directory/-/pack-directory-5.1.8.tgz#09e02134acaecd6be81a17dec7b9fdc7f66a29b7" - integrity sha512-aaH28ttS+JVimLFrVeZRWZ9Cii4GG2vkJXmQNikWBNQiFL/7S1x83NjMk4SQRdmtpYJkcQpQMZ2hDUdNxLnDCg== +"@lerna/pack-directory@6.4.1": + version "6.4.1" + resolved "https://registry.yarnpkg.com/@lerna/pack-directory/-/pack-directory-6.4.1.tgz#e78aae4e7944057d8fc6cb4dd8ae50be7a95c2fd" + integrity sha512-kBtDL9bPP72/Nl7Gqa2CA3Odb8CYY1EF2jt801f+B37TqRLf57UXQom7yF3PbWPCPmhoU+8Fc4RMpUwSbFC46Q== dependencies: - "@lerna/get-packed" "5.1.8" - "@lerna/package" "5.1.8" - "@lerna/run-lifecycle" "5.1.8" - "@lerna/temp-write" "5.1.8" - npm-packlist "^2.1.4" + "@lerna/get-packed" "6.4.1" + "@lerna/package" "6.4.1" + "@lerna/run-lifecycle" "6.4.1" + "@lerna/temp-write" "6.4.1" + npm-packlist "^5.1.1" npmlog "^6.0.2" tar "^6.1.0" -"@lerna/package-graph@5.1.8": - version "5.1.8" - resolved "https://registry.yarnpkg.com/@lerna/package-graph/-/package-graph-5.1.8.tgz#38339c3ad6e1469118ea3d52cf818ce7950d41c3" - integrity sha512-aGwXTwCpPfhUPiSRhdppogZjOqJPm39EBxHFDa1E0+/Qaig5avJs4hI6OrPLyjsTywAswtCMOArvD1QZqxwvrQ== +"@lerna/package-graph@6.4.1": + version "6.4.1" + resolved "https://registry.yarnpkg.com/@lerna/package-graph/-/package-graph-6.4.1.tgz#7a18024d531f0bd88609944e572b4861f0f8868f" + integrity sha512-fQvc59stRYOqxT3Mn7g/yI9/Kw5XetJoKcW5l8XeqKqcTNDURqKnN0qaNBY6lTTLOe4cR7gfXF2l1u3HOz0qEg== dependencies: - "@lerna/prerelease-id-from-version" "5.1.8" - "@lerna/validation-error" "5.1.8" - npm-package-arg "^8.1.0" + "@lerna/prerelease-id-from-version" "6.4.1" + "@lerna/validation-error" "6.4.1" + npm-package-arg "8.1.1" npmlog "^6.0.2" semver "^7.3.4" -"@lerna/package@5.1.8": - version "5.1.8" - resolved "https://registry.yarnpkg.com/@lerna/package/-/package-5.1.8.tgz#17e119553b8c957915f92e43a5f4284ec98439c2" - integrity sha512-Ot+wu6XZ93tw8p9oSTJJA15TzGhVpo8VbgNhKPcI3JJjkxVq2D5L5jVeBkjQvFEQBonLibTr339uLLXyZ0RMzg== +"@lerna/package@6.4.1": + version "6.4.1" + resolved "https://registry.yarnpkg.com/@lerna/package/-/package-6.4.1.tgz#ebbd4c5f58f4b6cf77019271a686be9585272a3b" + integrity sha512-TrOah58RnwS9R8d3+WgFFTu5lqgZs7M+e1dvcRga7oSJeKscqpEK57G0xspvF3ycjfXQwRMmEtwPmpkeEVLMzA== dependencies: load-json-file "^6.2.0" - npm-package-arg "^8.1.0" + npm-package-arg "8.1.1" write-pkg "^4.0.0" -"@lerna/prerelease-id-from-version@5.1.8": - version "5.1.8" - resolved "https://registry.yarnpkg.com/@lerna/prerelease-id-from-version/-/prerelease-id-from-version-5.1.8.tgz#83f27db93b19ccb74187e85b8174e4bd4f46e091" - integrity sha512-wfWv/8lHSk2/pl4FjopbDelFSLCz9s6J9AY5o7Sju9HtD9QUXcQHaXnEP1Rum9/rJZ8vWdFURcp9kzz8nxQ1Ow== +"@lerna/prerelease-id-from-version@6.4.1": + version "6.4.1" + resolved "https://registry.yarnpkg.com/@lerna/prerelease-id-from-version/-/prerelease-id-from-version-6.4.1.tgz#65eb1835cdfd112783eea6b596812c64f535386b" + integrity sha512-uGicdMFrmfHXeC0FTosnUKRgUjrBJdZwrmw7ZWMb5DAJGOuTzrvJIcz5f0/eL3XqypC/7g+9DoTgKjX3hlxPZA== dependencies: semver "^7.3.4" -"@lerna/profiler@5.1.8": - version "5.1.8" - resolved "https://registry.yarnpkg.com/@lerna/profiler/-/profiler-5.1.8.tgz#1f757c2bf87cdfad592d58f7d17f60e3648d956f" - integrity sha512-vpAFN85BvMHfIGA53IcwaUnS9FHAismEnNyFCjMkzKV55mmXFZlWpZyO36ESdSQRWCo5/25f3Ln0Y6YubY3Dvw== +"@lerna/profiler@6.4.1": + version "6.4.1" + resolved "https://registry.yarnpkg.com/@lerna/profiler/-/profiler-6.4.1.tgz#0d5e017e1389e35960d671f43db7eb16337fda1b" + integrity sha512-dq2uQxcu0aq6eSoN+JwnvHoAnjtZAVngMvywz5bTAfzz/sSvIad1v8RCpJUMBQHxaPtbfiNvOIQgDZOmCBIM4g== dependencies: fs-extra "^9.1.0" npmlog "^6.0.2" upath "^2.0.1" -"@lerna/project@5.1.8": - version "5.1.8" - resolved "https://registry.yarnpkg.com/@lerna/project/-/project-5.1.8.tgz#6c379d258eed12acff0d4fe8524f8f084e3892a4" - integrity sha512-zTFp91kmyJ0VHBmNXEArVrMSZVxnBJ7pHTt8C7RY91WSZhw8XDNumqMHDM+kEM1z/AtDBAAAGqBE3sjk5ONDXQ== +"@lerna/project@6.4.1": + version "6.4.1" + resolved "https://registry.yarnpkg.com/@lerna/project/-/project-6.4.1.tgz#0519323aa8bde5b73fc0bf1c428385a556a445f0" + integrity sha512-BPFYr4A0mNZ2jZymlcwwh7PfIC+I6r52xgGtJ4KIrIOB6mVKo9u30dgYJbUQxmSuMRTOnX7PJZttQQzSda4gEg== dependencies: - "@lerna/package" "5.1.8" - "@lerna/validation-error" "5.1.8" + "@lerna/package" "6.4.1" + "@lerna/validation-error" "6.4.1" cosmiconfig "^7.0.0" dedent "^0.7.0" dot-prop "^6.0.1" glob-parent "^5.1.1" globby "^11.0.2" + js-yaml "^4.1.0" load-json-file "^6.2.0" npmlog "^6.0.2" p-map "^4.0.0" resolve-from "^5.0.0" write-json-file "^4.3.0" -"@lerna/prompt@5.1.8": - version "5.1.8" - resolved "https://registry.yarnpkg.com/@lerna/prompt/-/prompt-5.1.8.tgz#292639f0c4064f088462bc45b1825b9496a265c9" - integrity sha512-Cmq0FV/vyCHu00kySxXMfuPvutsi8qoME2/nFcICIktvDqxXr5aSFY8QqB123awNCbpb4xcHykjFnEj/RNdb2Q== +"@lerna/prompt@6.4.1": + version "6.4.1" + resolved "https://registry.yarnpkg.com/@lerna/prompt/-/prompt-6.4.1.tgz#5ede06b4c8e17ec3045180b10ec5bd313cbc8585" + integrity sha512-vMxCIgF9Vpe80PnargBGAdS/Ib58iYEcfkcXwo7mYBCxEVcaUJFKZ72FEW8rw+H5LkxBlzrBJyfKRoOe0ks9gQ== dependencies: - inquirer "^7.3.3" + inquirer "^8.2.4" npmlog "^6.0.2" -"@lerna/publish@5.1.8": - version "5.1.8" - resolved "https://registry.yarnpkg.com/@lerna/publish/-/publish-5.1.8.tgz#a503d88ea74f197bfc4b02c23e43414b75e94583" - integrity sha512-Q88WxXVNAh/ZWj7vYG83RZUfQyQlJMg7tDhsVTvZzy3VpkkCPtmJXZfX+g4RmE0PNyjsXx9QLYAOZnOB613WyA== - dependencies: - "@lerna/check-working-tree" "5.1.8" - "@lerna/child-process" "5.1.8" - "@lerna/collect-updates" "5.1.8" - "@lerna/command" "5.1.8" - "@lerna/describe-ref" "5.1.8" - "@lerna/log-packed" "5.1.8" - "@lerna/npm-conf" "5.1.8" - "@lerna/npm-dist-tag" "5.1.8" - "@lerna/npm-publish" "5.1.8" - "@lerna/otplease" "5.1.8" - "@lerna/output" "5.1.8" - "@lerna/pack-directory" "5.1.8" - "@lerna/prerelease-id-from-version" "5.1.8" - "@lerna/prompt" "5.1.8" - "@lerna/pulse-till-done" "5.1.8" - "@lerna/run-lifecycle" "5.1.8" - "@lerna/run-topologically" "5.1.8" - "@lerna/validation-error" "5.1.8" - "@lerna/version" "5.1.8" +"@lerna/publish@6.4.1": + version "6.4.1" + resolved "https://registry.yarnpkg.com/@lerna/publish/-/publish-6.4.1.tgz#e1bdfa67297ca4a3054863e7acfc8482bf613c35" + integrity sha512-/D/AECpw2VNMa1Nh4g29ddYKRIqygEV1ftV8PYXVlHpqWN7VaKrcbRU6pn0ldgpFlMyPtESfv1zS32F5CQ944w== + dependencies: + "@lerna/check-working-tree" "6.4.1" + "@lerna/child-process" "6.4.1" + "@lerna/collect-updates" "6.4.1" + "@lerna/command" "6.4.1" + "@lerna/describe-ref" "6.4.1" + "@lerna/log-packed" "6.4.1" + "@lerna/npm-conf" "6.4.1" + "@lerna/npm-dist-tag" "6.4.1" + "@lerna/npm-publish" "6.4.1" + "@lerna/otplease" "6.4.1" + "@lerna/output" "6.4.1" + "@lerna/pack-directory" "6.4.1" + "@lerna/prerelease-id-from-version" "6.4.1" + "@lerna/prompt" "6.4.1" + "@lerna/pulse-till-done" "6.4.1" + "@lerna/run-lifecycle" "6.4.1" + "@lerna/run-topologically" "6.4.1" + "@lerna/validation-error" "6.4.1" + "@lerna/version" "6.4.1" fs-extra "^9.1.0" - libnpmaccess "^4.0.1" - npm-package-arg "^8.1.0" - npm-registry-fetch "^9.0.0" + libnpmaccess "^6.0.3" + npm-package-arg "8.1.1" + npm-registry-fetch "^13.3.0" npmlog "^6.0.2" p-map "^4.0.0" p-pipe "^3.1.0" - pacote "^13.4.1" + pacote "^13.6.1" semver "^7.3.4" -"@lerna/pulse-till-done@5.1.8": - version "5.1.8" - resolved "https://registry.yarnpkg.com/@lerna/pulse-till-done/-/pulse-till-done-5.1.8.tgz#585ebc121841d9f1c587c553a3990601ac0e4168" - integrity sha512-KsyOazHG6wnjfdJhIdhTaTNwhj8Np/aPPei/ac9WzcuzgLS/uCs1IVFFIYBv5JdTmyVBKmguSZxdYjk7JzKBew== +"@lerna/pulse-till-done@6.4.1": + version "6.4.1" + resolved "https://registry.yarnpkg.com/@lerna/pulse-till-done/-/pulse-till-done-6.4.1.tgz#85c38a43939bf5e21b61091d0bcf73a1109a59db" + integrity sha512-efAkOC1UuiyqYBfrmhDBL6ufYtnpSqAG+lT4d/yk3CzJEJKkoCwh2Hb692kqHHQ5F74Uusc8tcRB7GBcfNZRWA== dependencies: npmlog "^6.0.2" -"@lerna/query-graph@5.1.8": - version "5.1.8" - resolved "https://registry.yarnpkg.com/@lerna/query-graph/-/query-graph-5.1.8.tgz#8ef6059f81e0fb64c4236f5fb664582568225af9" - integrity sha512-+p+bjPI403Hwv1djTS5aJe7DtPWIDw0a427BE68h1mmrPc9oTe3GG+0lingbfGR8woA2rOmjytgK2jeErOryPg== +"@lerna/query-graph@6.4.1": + version "6.4.1" + resolved "https://registry.yarnpkg.com/@lerna/query-graph/-/query-graph-6.4.1.tgz#3c224a49ff392d08ce8aeeaa1af4458f522a2b78" + integrity sha512-gBGZLgu2x6L4d4ZYDn4+d5rxT9RNBC+biOxi0QrbaIq83I+JpHVmFSmExXK3rcTritrQ3JT9NCqb+Yu9tL9adQ== dependencies: - "@lerna/package-graph" "5.1.8" + "@lerna/package-graph" "6.4.1" -"@lerna/resolve-symlink@5.1.8": - version "5.1.8" - resolved "https://registry.yarnpkg.com/@lerna/resolve-symlink/-/resolve-symlink-5.1.8.tgz#dbccd14caf2701a9c968f1cb869b2bab28f0144a" - integrity sha512-OJa8ct4Oo2BcD95FmJqkc5qZMepaQK5RZAWoTqEXG/13Gs0mPc0fZGIhnnpTqtm3mgNhlT7ypCHG42I7hKiSeg== +"@lerna/resolve-symlink@6.4.1": + version "6.4.1" + resolved "https://registry.yarnpkg.com/@lerna/resolve-symlink/-/resolve-symlink-6.4.1.tgz#ab42dcbd03bc4028ec77ee481c5db8884ebaf40a" + integrity sha512-gnqltcwhWVLUxCuwXWe/ch9WWTxXRI7F0ZvCtIgdfOpbosm3f1g27VO1LjXeJN2i6ks03qqMowqy4xB4uMR9IA== dependencies: fs-extra "^9.1.0" npmlog "^6.0.2" - read-cmd-shim "^2.0.0" + read-cmd-shim "^3.0.0" -"@lerna/rimraf-dir@5.1.8": - version "5.1.8" - resolved "https://registry.yarnpkg.com/@lerna/rimraf-dir/-/rimraf-dir-5.1.8.tgz#b0546a785cef0eb549b9b21a831e732ac56a7d84" - integrity sha512-3pT1X8kzW8xHUuAmRgzSKAF+/H1h1eSWq5+ACzeTWnvgqE7++0URee7TXwVCP/5FZPTZIzIclQCh4G0WD9Jfjg== +"@lerna/rimraf-dir@6.4.1": + version "6.4.1" + resolved "https://registry.yarnpkg.com/@lerna/rimraf-dir/-/rimraf-dir-6.4.1.tgz#116e379f653135b3ae955dcba703bdf212cab51a" + integrity sha512-5sDOmZmVj0iXIiEgdhCm0Prjg5q2SQQKtMd7ImimPtWKkV0IyJWxrepJFbeQoFj5xBQF7QB5jlVNEfQfKhD6pQ== dependencies: - "@lerna/child-process" "5.1.8" + "@lerna/child-process" "6.4.1" npmlog "^6.0.2" path-exists "^4.0.0" rimraf "^3.0.2" -"@lerna/run-lifecycle@5.1.8": - version "5.1.8" - resolved "https://registry.yarnpkg.com/@lerna/run-lifecycle/-/run-lifecycle-5.1.8.tgz#bac65e96f20b395a1e05db3823fa68d82a7796c8" - integrity sha512-5rRpovujhLJufKRzMp5sl2BIIqrPeoXxjniQbzkpSxZ2vnD+bE9xOoaciHQxOsmXfXhza0C+k3xYMM5+B/bVzg== +"@lerna/run-lifecycle@6.4.1": + version "6.4.1" + resolved "https://registry.yarnpkg.com/@lerna/run-lifecycle/-/run-lifecycle-6.4.1.tgz#1eac136afae97e197bdb564e67fb385f4d346685" + integrity sha512-42VopI8NC8uVCZ3YPwbTycGVBSgukJltW5Saein0m7TIqFjwSfrcP0n7QJOr+WAu9uQkk+2kBstF5WmvKiqgEA== dependencies: - "@lerna/npm-conf" "5.1.8" - "@npmcli/run-script" "^3.0.2" + "@lerna/npm-conf" "6.4.1" + "@npmcli/run-script" "^4.1.7" npmlog "^6.0.2" + p-queue "^6.6.2" -"@lerna/run-topologically@5.1.8": - version "5.1.8" - resolved "https://registry.yarnpkg.com/@lerna/run-topologically/-/run-topologically-5.1.8.tgz#5c49ab5ebf0a871c5f705db74648d0023448c387" - integrity sha512-isuulfBdNsrgV2QF/HwCKCecfR9mPEU9N4Nf8n9nQQgakwOscoDlwGp2xv27pvcQKI52q/o/ISEjz3JeoEQiOA== +"@lerna/run-topologically@6.4.1": + version "6.4.1" + resolved "https://registry.yarnpkg.com/@lerna/run-topologically/-/run-topologically-6.4.1.tgz#640b07d83f1d1e6d3bc36f81a74957839bb1672f" + integrity sha512-gXlnAsYrjs6KIUGDnHM8M8nt30Amxq3r0lSCNAt+vEu2sMMEOh9lffGGaJobJZ4bdwoXnKay3uER/TU8E9owMw== dependencies: - "@lerna/query-graph" "5.1.8" + "@lerna/query-graph" "6.4.1" p-queue "^6.6.2" -"@lerna/run@5.1.8": - version "5.1.8" - resolved "https://registry.yarnpkg.com/@lerna/run/-/run-5.1.8.tgz#ede8db4df9ae19e87e1cc372a820f29a9ef5079b" - integrity sha512-E5mI3FswVN9zQ3bCYUQxxPlLL400vnKpwLSzzRNFy//TR8Geu0LeR6NY+Jf0jklsKxwWGMJgqL6VqPqxDaNtdw== - dependencies: - "@lerna/command" "5.1.8" - "@lerna/filter-options" "5.1.8" - "@lerna/npm-run-script" "5.1.8" - "@lerna/output" "5.1.8" - "@lerna/profiler" "5.1.8" - "@lerna/run-topologically" "5.1.8" - "@lerna/timer" "5.1.8" - "@lerna/validation-error" "5.1.8" +"@lerna/run@6.4.1": + version "6.4.1" + resolved "https://registry.yarnpkg.com/@lerna/run/-/run-6.4.1.tgz#985279f071ff23ae15f92837f85f979a1352fc01" + integrity sha512-HRw7kS6KNqTxqntFiFXPEeBEct08NjnL6xKbbOV6pXXf+lXUQbJlF8S7t6UYqeWgTZ4iU9caIxtZIY+EpW93mQ== + dependencies: + "@lerna/command" "6.4.1" + "@lerna/filter-options" "6.4.1" + "@lerna/npm-run-script" "6.4.1" + "@lerna/output" "6.4.1" + "@lerna/profiler" "6.4.1" + "@lerna/run-topologically" "6.4.1" + "@lerna/timer" "6.4.1" + "@lerna/validation-error" "6.4.1" + fs-extra "^9.1.0" + nx ">=15.4.2 < 16" p-map "^4.0.0" -"@lerna/symlink-binary@5.1.8": - version "5.1.8" - resolved "https://registry.yarnpkg.com/@lerna/symlink-binary/-/symlink-binary-5.1.8.tgz#0e92997547d13d3da7efe437ecad64b919ff0383" - integrity sha512-s7VfKNJZnWvTKZ7KR8Yxh1rYhE/ARMioD5axyu3FleS3Xsdla2M5sQsLouCrdfM3doTO8lMxPVvVSFmL7q0KOA== +"@lerna/symlink-binary@6.4.1": + version "6.4.1" + resolved "https://registry.yarnpkg.com/@lerna/symlink-binary/-/symlink-binary-6.4.1.tgz#d8e1b653a7ae9fe38834851c66c92278e3bb25ae" + integrity sha512-poZX90VmXRjL/JTvxaUQPeMDxFUIQvhBkHnH+dwW0RjsHB/2Tu4QUAsE0OlFnlWQGsAtXF4FTtW8Xs57E/19Kw== dependencies: - "@lerna/create-symlink" "5.1.8" - "@lerna/package" "5.1.8" + "@lerna/create-symlink" "6.4.1" + "@lerna/package" "6.4.1" fs-extra "^9.1.0" p-map "^4.0.0" -"@lerna/symlink-dependencies@5.1.8": - version "5.1.8" - resolved "https://registry.yarnpkg.com/@lerna/symlink-dependencies/-/symlink-dependencies-5.1.8.tgz#a8738d122b4274397e65a565d444540b9a10df61" - integrity sha512-U5diiaKdWUlvoFMh3sYIEESBLa8Z3Q/EpkLl5o4YkcbPBjFHJFpmoqCGomwL9sf9HQUV2S9Lt9szJT8qgQm86Q== +"@lerna/symlink-dependencies@6.4.1": + version "6.4.1" + resolved "https://registry.yarnpkg.com/@lerna/symlink-dependencies/-/symlink-dependencies-6.4.1.tgz#988203cc260406b64d61294367821a0f26419ee6" + integrity sha512-43W2uLlpn3TTYuHVeO/2A6uiTZg6TOk/OSKi21ujD7IfVIYcRYCwCV+8LPP12R3rzyab0JWkWnhp80Z8A2Uykw== dependencies: - "@lerna/create-symlink" "5.1.8" - "@lerna/resolve-symlink" "5.1.8" - "@lerna/symlink-binary" "5.1.8" + "@lerna/create-symlink" "6.4.1" + "@lerna/resolve-symlink" "6.4.1" + "@lerna/symlink-binary" "6.4.1" fs-extra "^9.1.0" p-map "^4.0.0" p-map-series "^2.1.0" -"@lerna/temp-write@5.1.8": - version "5.1.8" - resolved "https://registry.yarnpkg.com/@lerna/temp-write/-/temp-write-5.1.8.tgz#e3e16743160fdde2fadbff6e1855c4050495b38e" - integrity sha512-4/guYB5XotugyM8P/F1z6b+hNlSCe/QuZsmiZwgXOw2lmYnkSzLWDVjqsdZtNYqojK0lioxcPjZiL5qnEkk1PQ== +"@lerna/temp-write@6.4.1": + version "6.4.1" + resolved "https://registry.yarnpkg.com/@lerna/temp-write/-/temp-write-6.4.1.tgz#1c46d05b633597c77b0c5f5ab46c1315195f7786" + integrity sha512-7uiGFVoTyos5xXbVQg4bG18qVEn9dFmboXCcHbMj5mc/+/QmU9QeNz/Cq36O5TY6gBbLnyj3lfL5PhzERWKMFg== dependencies: graceful-fs "^4.1.15" is-stream "^2.0.0" @@ -2957,37 +2954,38 @@ temp-dir "^1.0.0" uuid "^8.3.2" -"@lerna/timer@5.1.8": - version "5.1.8" - resolved "https://registry.yarnpkg.com/@lerna/timer/-/timer-5.1.8.tgz#8613aca7ed121a7c9f73f754a5b07e9891bf2e5e" - integrity sha512-Ua4bw2YOO3U+sFujE+MsUG+lllU0X7u6PCTj1QKe0QlR0zr2gCa0pcwjUQPdNfxnpJpPY+hdbfTUv2viDloaiA== +"@lerna/timer@6.4.1": + version "6.4.1" + resolved "https://registry.yarnpkg.com/@lerna/timer/-/timer-6.4.1.tgz#47fe50b56bd2fc32396a2559f7bb65de8200f07d" + integrity sha512-ogmjFTWwRvevZr76a2sAbhmu3Ut2x73nDIn0bcwZwZ3Qc3pHD8eITdjs/wIKkHse3J7l3TO5BFJPnrvDS7HLnw== -"@lerna/validation-error@5.1.8": - version "5.1.8" - resolved "https://registry.yarnpkg.com/@lerna/validation-error/-/validation-error-5.1.8.tgz#e12f6ee6bb9bd18bc1f3b2d0ae3045882d2a4f32" - integrity sha512-n+IiaxN2b08ZMYnezsmwL6rXB15/VvweusC04GMh1XtWunnMzSg9JDM7y6bw2vfpBBQx6cBFhLKSpD2Fcq5D5Q== +"@lerna/validation-error@6.4.1": + version "6.4.1" + resolved "https://registry.yarnpkg.com/@lerna/validation-error/-/validation-error-6.4.1.tgz#2cab92c2be395158c3d65fa57ddb73892617d7e8" + integrity sha512-fxfJvl3VgFd7eBfVMRX6Yal9omDLs2mcGKkNYeCEyt4Uwlz1B5tPAXyk/sNMfkKV2Aat/mlK5tnY13vUrMKkyA== dependencies: npmlog "^6.0.2" -"@lerna/version@5.1.8": - version "5.1.8" - resolved "https://registry.yarnpkg.com/@lerna/version/-/version-5.1.8.tgz#fa2034bbbbcdaf5493d6235109f6e4813f8f7a60" - integrity sha512-3f4P7KjIs6Gn2iaGkA5EASE9izZeDKtEzE8i2DE7YfVdw/P+EwFfKv2mKBXGbckYw42YO1tL6aD2QH0C8XbwlA== - dependencies: - "@lerna/check-working-tree" "5.1.8" - "@lerna/child-process" "5.1.8" - "@lerna/collect-updates" "5.1.8" - "@lerna/command" "5.1.8" - "@lerna/conventional-commits" "5.1.8" - "@lerna/github-client" "5.1.8" - "@lerna/gitlab-client" "5.1.8" - "@lerna/output" "5.1.8" - "@lerna/prerelease-id-from-version" "5.1.8" - "@lerna/prompt" "5.1.8" - "@lerna/run-lifecycle" "5.1.8" - "@lerna/run-topologically" "5.1.8" - "@lerna/temp-write" "5.1.8" - "@lerna/validation-error" "5.1.8" +"@lerna/version@6.4.1": + version "6.4.1" + resolved "https://registry.yarnpkg.com/@lerna/version/-/version-6.4.1.tgz#01011364df04240ce92dffed1d2fa76bb9f959ff" + integrity sha512-1/krPq0PtEqDXtaaZsVuKev9pXJCkNC1vOo2qCcn6PBkODw/QTAvGcUi0I+BM2c//pdxge9/gfmbDo1lC8RtAQ== + dependencies: + "@lerna/check-working-tree" "6.4.1" + "@lerna/child-process" "6.4.1" + "@lerna/collect-updates" "6.4.1" + "@lerna/command" "6.4.1" + "@lerna/conventional-commits" "6.4.1" + "@lerna/github-client" "6.4.1" + "@lerna/gitlab-client" "6.4.1" + "@lerna/output" "6.4.1" + "@lerna/prerelease-id-from-version" "6.4.1" + "@lerna/prompt" "6.4.1" + "@lerna/run-lifecycle" "6.4.1" + "@lerna/run-topologically" "6.4.1" + "@lerna/temp-write" "6.4.1" + "@lerna/validation-error" "6.4.1" + "@nrwl/devkit" ">=15.4.2 < 16" chalk "^4.1.0" dedent "^0.7.0" load-json-file "^6.2.0" @@ -3001,13 +2999,13 @@ slash "^3.0.0" write-json-file "^4.3.0" -"@lerna/write-log-file@5.1.8": - version "5.1.8" - resolved "https://registry.yarnpkg.com/@lerna/write-log-file/-/write-log-file-5.1.8.tgz#b464c7fab43c14adb96ba41d92900b8907d8d14d" - integrity sha512-B+shMH3TpzA7Q5GGbuNkOmdPQdD1LXRFj7R17LINkn82PhP9CUgubwYuiVzrLa16ADi0V5Ad76pqtHi/6kD0nA== +"@lerna/write-log-file@6.4.1": + version "6.4.1" + resolved "https://registry.yarnpkg.com/@lerna/write-log-file/-/write-log-file-6.4.1.tgz#b9b959e4b853cdabf0309bc5da1513fa025117ec" + integrity sha512-LE4fueQSDrQo76F4/gFXL0wnGhqdG7WHVH8D8TrKouF2Afl4NHltObCm4WsSMPjcfciVnZQFfx1ruxU4r/enHQ== dependencies: npmlog "^6.0.2" - write-file-atomic "^3.0.3" + write-file-atomic "^4.0.1" "@mdx-js/mdx@^1.6.22": version "1.6.22" @@ -3044,32 +3042,32 @@ resolved "https://registry.yarnpkg.com/@mdx-js/util/-/util-1.6.22.tgz#219dfd89ae5b97a8801f015323ffa4b62f45718b" integrity sha512-H1rQc1ZOHANWBvPcW+JpGwr+juXSxM8Q8YCkm3GhZd8REu1fHR3z99CErO1p9pkcfcxZnMdIZdIsXkOHY0NilA== -"@microsoft/api-extractor-model@7.21.0": - version "7.21.0" - resolved "https://registry.yarnpkg.com/@microsoft/api-extractor-model/-/api-extractor-model-7.21.0.tgz#2138682e738a14038d40165ec77362e69853f200" - integrity sha512-NN4mXzoQWTuzznIcnLWeV6tGyn6Os9frDK6M/mmTXZ73vUYOvSWoKQ5SYzyzP7HF3YtvTmr1Rs+DsBb0HRx7WQ== +"@microsoft/api-extractor-model@7.24.3": + version "7.24.3" + resolved "https://registry.yarnpkg.com/@microsoft/api-extractor-model/-/api-extractor-model-7.24.3.tgz#406b0447a47eb185e0da4df865bdb0b939d57325" + integrity sha512-JElpLULqYDXQb0YIKKQhOJaNWBXsYeYu5J51Z4O6RGbOq7Tby9ViVfpDuXVXa87AMOSR5WKuaxG/5SnQVVNxiw== dependencies: "@microsoft/tsdoc" "0.14.1" "@microsoft/tsdoc-config" "~0.16.1" - "@rushstack/node-core-library" "3.49.0" + "@rushstack/node-core-library" "3.53.0" "@microsoft/api-extractor@^7.23.2": - version "7.28.4" - resolved "https://registry.yarnpkg.com/@microsoft/api-extractor/-/api-extractor-7.28.4.tgz#8e67a69edb4937beda516d42d4f325e6e1258445" - integrity sha512-7JeROBGYTUt4/4HPnpMscsQgLzX0OfGTQR2qOQzzh3kdkMyxmiv2mzpuhoMnwbubb1GvPcyFm+NguoqOqkCVaw== + version "7.32.0" + resolved "https://registry.yarnpkg.com/@microsoft/api-extractor/-/api-extractor-7.32.0.tgz#b3c82a20873aeab21be59ce7113ef377c78baab1" + integrity sha512-BfvPpeVzWLFTdairVItzWQGsZr82fR4RH+8Q4I7t0f9xq66v4Qz9K+u25jbL5R42X01b/vvJMuRhX5KhU8J1Ug== dependencies: - "@microsoft/api-extractor-model" "7.21.0" + "@microsoft/api-extractor-model" "7.24.3" "@microsoft/tsdoc" "0.14.1" "@microsoft/tsdoc-config" "~0.16.1" - "@rushstack/node-core-library" "3.49.0" - "@rushstack/rig-package" "0.3.13" - "@rushstack/ts-command-line" "4.12.1" + "@rushstack/node-core-library" "3.53.0" + "@rushstack/rig-package" "0.3.16" + "@rushstack/ts-command-line" "4.12.4" colors "~1.2.1" lodash "~4.17.15" resolve "~1.17.0" semver "~7.3.0" source-map "~0.6.1" - typescript "~4.6.3" + typescript "~4.8.4" "@microsoft/tsdoc-config@~0.16.1": version "0.16.1" @@ -3086,6 +3084,13 @@ resolved "https://registry.yarnpkg.com/@microsoft/tsdoc/-/tsdoc-0.14.1.tgz#155ef21065427901994e765da8a0ba0eaae8b8bd" integrity sha512-6Wci+Tp3CgPt/B9B0a3J4s3yMgLNSku6w5TV6mN+61C71UqsRBv2FUibBf3tPGlNxebgPHMEUzKpb1ggE8KCKw== +"@nicolo-ribaudo/eslint-scope-5-internals@5.1.1-v1": + version "5.1.1-v1" + resolved "https://registry.yarnpkg.com/@nicolo-ribaudo/eslint-scope-5-internals/-/eslint-scope-5-internals-5.1.1-v1.tgz#dbf733a965ca47b1973177dc0bb6c889edcfb129" + integrity sha512-54/JRvkLIzzDWshCWfuhadfrfZVPiElY8Fcgmg1HroEly/EDSszzhBAsarCux+D/kOslTRquNzuyGSmUSTTHGg== + dependencies: + eslint-scope "5.1.1" + "@nodelib/fs.scandir@2.1.5": version "2.1.5" resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5" @@ -3107,10 +3112,10 @@ "@nodelib/fs.scandir" "2.1.5" fastq "^1.6.0" -"@npmcli/arborist@5.2.0": - version "5.2.0" - resolved "https://registry.yarnpkg.com/@npmcli/arborist/-/arborist-5.2.0.tgz#ee40dfe1f81ae1524819ee39c8f3e7022b0d6269" - integrity sha512-zWV7scFGL0SmpvfQyIWnMFbU/0YgtMNyvJiJwR98kyjUSntJGWFFR0O600d5W+TrDcTg0GyDbY+HdzGEg+GXLg== +"@npmcli/arborist@5.3.0": + version "5.3.0" + resolved "https://registry.yarnpkg.com/@npmcli/arborist/-/arborist-5.3.0.tgz#321d9424677bfc08569e98a5ac445ee781f32053" + integrity sha512-+rZ9zgL1lnbl8Xbb1NQdMjveOMwj4lIYfcDtyJHHi5x4X8jtR6m8SXooJMZy5vmFVZ8w7A2Bnd/oX9eTuU8w5A== dependencies: "@isaacs/string-locale-compare" "^1.1.0" "@npmcli/installed-package-contents" "^1.0.7" @@ -3120,7 +3125,7 @@ "@npmcli/name-from-folder" "^1.0.1" "@npmcli/node-gyp" "^2.0.0" "@npmcli/package-json" "^2.0.0" - "@npmcli/run-script" "^3.0.0" + "@npmcli/run-script" "^4.1.3" bin-links "^3.0.0" cacache "^16.0.6" common-ancestor-path "^1.0.1" @@ -3134,7 +3139,7 @@ npm-pick-manifest "^7.0.0" npm-registry-fetch "^13.0.0" npmlog "^6.0.2" - pacote "^13.0.5" + pacote "^13.6.1" parse-conflict-json "^2.0.1" proc-log "^2.0.0" promise-all-reject-late "^1.0.0" @@ -3147,19 +3152,6 @@ treeverse "^2.0.0" walk-up-path "^1.0.0" -"@npmcli/ci-detect@^1.0.0": - version "1.4.0" - resolved "https://registry.yarnpkg.com/@npmcli/ci-detect/-/ci-detect-1.4.0.tgz#18478bbaa900c37bfbd8a2006a6262c62e8b0fe1" - integrity sha512-3BGrt6FLjqM6br5AhWRKTr3u5GIVkjRYeAFrMp3HjnfICrg4xOrVRwFavKT6tsp++bq5dluL5t8ME/Nha/6c1Q== - -"@npmcli/fs@^1.0.0": - version "1.0.0" - resolved "https://registry.yarnpkg.com/@npmcli/fs/-/fs-1.0.0.tgz#589612cfad3a6ea0feafcb901d29c63fd52db09f" - integrity sha512-8ltnOpRR/oJbOp8vaGUnipOi3bqkcW+sLHFlyXIr08OGHmVJLB1Hn7QtGXbYcpVtH1gAYZTlmDXtE4YV0+AMMQ== - dependencies: - "@gar/promisify" "^1.0.1" - semver "^7.3.5" - "@npmcli/fs@^2.1.0": version "2.1.0" resolved "https://registry.yarnpkg.com/@npmcli/fs/-/fs-2.1.0.tgz#f2a21c28386e299d1a9fae8051d35ad180e33109" @@ -3211,14 +3203,6 @@ pacote "^13.0.3" semver "^7.3.5" -"@npmcli/move-file@^1.0.1": - version "1.1.2" - resolved "https://registry.yarnpkg.com/@npmcli/move-file/-/move-file-1.1.2.tgz#1a82c3e372f7cae9253eb66d72543d6b8685c674" - integrity sha512-1SUf/Cg2GzGDyaf15aR9St9TWlb+XvbZXWpDx8YKs7MLzMH/BCeopv+y9vzrzgkfykCGuWOlSu3mZhj2+FQcrg== - dependencies: - mkdirp "^1.0.4" - rimraf "^3.0.2" - "@npmcli/move-file@^2.0.0": version "2.0.0" resolved "https://registry.yarnpkg.com/@npmcli/move-file/-/move-file-2.0.0.tgz#417f585016081a0184cef3e38902cd917a9bbd02" @@ -3251,90 +3235,118 @@ dependencies: infer-owner "^1.0.4" -"@npmcli/run-script@^3.0.0", "@npmcli/run-script@^3.0.1", "@npmcli/run-script@^3.0.2": - version "3.0.2" - resolved "https://registry.yarnpkg.com/@npmcli/run-script/-/run-script-3.0.2.tgz#3e9116d831f4539bf292d18b015977a6118997ee" - integrity sha512-vdjD/PMBl+OX9j9C9irx5sCCIKfp2PWkpPNH9zxvlJAfSZ3Qp5aU412v+O3PFJl3R1PFNwuyChCqHg4ma6ci2Q== +"@npmcli/run-script@^4.1.0", "@npmcli/run-script@^4.1.3", "@npmcli/run-script@^4.1.7": + version "4.2.0" + resolved "https://registry.yarnpkg.com/@npmcli/run-script/-/run-script-4.2.0.tgz#2c25758f80831ba138afe25225d456e89acedac3" + integrity sha512-e/QgLg7j2wSJp1/7JRl0GC8c7PMX+uYlA/1Tb+IDOLdSM4T7K1VQ9mm9IGU3WRtY5vEIObpqCLb3aCNCug18DA== dependencies: "@npmcli/node-gyp" "^2.0.0" "@npmcli/promise-spawn" "^3.0.0" node-gyp "^9.0.0" read-package-json-fast "^2.0.3" + which "^2.0.2" + +"@nrwl/cli@15.5.3": + version "15.5.3" + resolved "https://registry.yarnpkg.com/@nrwl/cli/-/cli-15.5.3.tgz#13277e5a0e8ba713850bcf13fa76717ea747a2bb" + integrity sha512-NWf9CWswvdYM6YzXuweaZPAZ2erMtQrrHZdgFbUGeojZBZ+b4TCGzLWNodZj4yQOa/eTwlyPMYO2LEw9CoapDQ== + dependencies: + nx "15.5.3" -"@nrwl/cli@14.1.4": - version "14.1.4" - resolved "https://registry.yarnpkg.com/@nrwl/cli/-/cli-14.1.4.tgz#4d896bbfcb49f058711dd47a67c422297db03be9" - integrity sha512-XjJe/bnOKDYvvY9IxKdETWTGekRu/cN9wThwwlo8xo4Tqy1VK0MfqpDDALrFYp739NG5Zyuhtbz5+Ko48RK75g== +"@nrwl/cli@15.6.3": + version "15.6.3" + resolved "https://registry.npmjs.org/@nrwl/cli/-/cli-15.6.3.tgz#999531d6efb30afc39373bdcbd7e78254a3a3fd3" + integrity sha512-K4E0spofThZXMnhA6R8hkUTdfqmwSnUE2+DlD5Y3jqsvKTAgwF5U41IFkEouFZCf+dWjy0RA20bWoX48EVFtmQ== dependencies: - nx "14.1.4" + nx "15.6.3" -"@nrwl/devkit@14.1.4": - version "14.1.4" - resolved "https://registry.yarnpkg.com/@nrwl/devkit/-/devkit-14.1.4.tgz#7cabec88109ec8fec60b11aba7cbfddc4b9e771e" - integrity sha512-Q7/cDrULhqdbfPRp8N0x9y67r49ApzYG+CVEXI8VowwHFAI3zCr/PNlzsfuLL4l2Uj0jYOt+LPoNbFZuCLAQLA== +"@nrwl/devkit@15.6.3": + version "15.6.3" + resolved "https://registry.npmjs.org/@nrwl/devkit/-/devkit-15.6.3.tgz#e4e96c53ba3304786a49034286c8511534b2b194" + integrity sha512-/JDvdzNxUM+C1PCZPCrvmFx+OfywqZdOq1GS9QR8C0VctTLG4D/SGSFD88O1SAdcbH/f1mMiBGfEYZYd23fghQ== dependencies: + "@phenomnomnominal/tsquery" "4.1.1" ejs "^3.1.7" ignore "^5.0.4" - rxjs "^6.5.4" semver "7.3.4" tslib "^2.3.0" -"@nrwl/jest@14.1.4": - version "14.1.4" - resolved "https://registry.yarnpkg.com/@nrwl/jest/-/jest-14.1.4.tgz#c69ad97913fba78ae9eabce83c9cec324a29881b" - integrity sha512-Me8r3QY080gVtEtD3F3FkQI7NU0MJl1PjU+qEcBejk5+NJD31LtPoIW4XHYdep/dPC/Og+m+QWopKK97K7Yuaw== +"@nrwl/devkit@>=15.4.2 < 16": + version "15.5.3" + resolved "https://registry.npmjs.org/@nrwl/devkit/-/devkit-15.5.3.tgz#16fac0147c2ab6ebba7b5357b2b959ad46b6eb26" + integrity sha512-GGNLLGXDGWflrpaLimnE6hChfZfq3+XWZ0LJWL0IuCnchngPbNzuyh8S8KPgNKKgq4Nv0hglWefIwMg2UhHysA== dependencies: - "@jest/reporters" "27.5.1" - "@jest/test-result" "27.5.1" - "@nrwl/devkit" "14.1.4" - chalk "4.1.0" + "@phenomnomnominal/tsquery" "4.1.1" + ejs "^3.1.7" + ignore "^5.0.4" + semver "7.3.4" + tslib "^2.3.0" + +"@nrwl/jest@15.6.3": + version "15.6.3" + resolved "https://registry.npmjs.org/@nrwl/jest/-/jest-15.6.3.tgz#66b1c387352cbbf666959fd7fe921d4980c6084a" + integrity sha512-pG8ESEJFkgyBGOOVZ6bFohklkDXn7JrDPSjmnoKvcOzprluPS7Nx4Ce5bw7wk2Ul3fqJcpAcH5LAZvb+HtA85w== + dependencies: + "@jest/reporters" "28.1.1" + "@jest/test-result" "28.1.1" + "@nrwl/devkit" "15.6.3" + "@phenomnomnominal/tsquery" "4.1.1" + chalk "^4.1.0" + dotenv "~10.0.0" identity-obj-proxy "3.0.0" - jest-config "27.5.1" - jest-resolve "27.5.1" - jest-util "27.5.1" + jest-config "28.1.1" + jest-resolve "28.1.1" + jest-util "28.1.1" resolve.exports "1.1.0" - rxjs "^6.5.4" tslib "^2.3.0" -"@nrwl/linter@14.1.4": - version "14.1.4" - resolved "https://registry.yarnpkg.com/@nrwl/linter/-/linter-14.1.4.tgz#6e10da0b8e2ea3b38668cc1ac77b67b633c8be8f" - integrity sha512-DUChINM9aoR3nuoSjV2vMoaFrM6PwPamEnN0WFowO4x+DRpEdp4I5IPpoSCyXTnrQB9EUVWHBo0vgeYILtgKlA== +"@nrwl/linter@15.6.3": + version "15.6.3" + resolved "https://registry.npmjs.org/@nrwl/linter/-/linter-15.6.3.tgz#9cffa150109c604827c06ce0ccd5c925d4cd7c01" + integrity sha512-efGOduHbUa/L6MuJLb2SoDwi4hEKpz6lM1X/Yg36dYDjLuJdpLC23K4WwEOQeZL6jkcUerfY65W8NMPinAHWKg== dependencies: - "@nrwl/devkit" "14.1.4" - "@nrwl/jest" "14.1.4" + "@nrwl/devkit" "15.6.3" "@phenomnomnominal/tsquery" "4.1.1" tmp "~0.2.1" tslib "^2.3.0" -"@nrwl/nx-cloud@14.0.3": - version "14.0.3" - resolved "https://registry.yarnpkg.com/@nrwl/nx-cloud/-/nx-cloud-14.0.3.tgz#fda3d75274ca6e8f4a6f469b294a4b65b54bdc28" - integrity sha512-08t9vnRzA5SAkG6gp+NrAGauraepHH0v4IByO4NQ+7JJ7JMWw0nt6fp/70wofRmem7MGQ+Y/AIgIc5T0m89k+w== +"@nrwl/nx-cloud@15.0.2": + version "15.0.2" + resolved "https://registry.yarnpkg.com/@nrwl/nx-cloud/-/nx-cloud-15.0.2.tgz#1d1e9c52743f7d7a40c8217c211ebd22402f6dde" + integrity sha512-DaTASuXmGyQHMxJuK6y3f7fs+Q0qQCfYDIDVGK9muNwN/QItLeWdRNltLQxbrBeS112kQTu2FPsr0DmRD60+0A== dependencies: - axios "^0.21.1" + axios "^0.21.2" chalk "4.1.0" + dotenv "~10.0.0" + fs-extra "^10.1.0" node-machine-id "^1.1.12" strip-json-comments "^3.1.1" tar "6.1.11" + yargs-parser ">=21.0.1" -"@nrwl/tao@14.1.4": - version "14.1.4" - resolved "https://registry.yarnpkg.com/@nrwl/tao/-/tao-14.1.4.tgz#20902811c5712732d2944a8e0c4cde031e631694" - integrity sha512-Dk8/CM1/GTCYBuA5RJ59Vz1OJGK3Tf4KVE3QS7UpEkR/iWTPDmTtrcQmTLSgtX+tYgca5dMWHV9WfiJjKW2/ow== +"@nrwl/tao@15.5.3": + version "15.5.3" + resolved "https://registry.yarnpkg.com/@nrwl/tao/-/tao-15.5.3.tgz#08c05715d2ecb108ed8b2c5381b9017cf1448b4a" + integrity sha512-vgPLIW9IoBfQ4IkHRT5RC4LqNwFBK5jmHYmFIRgbIeFRudFBbnpmOaKRME0OwN7qJ6964PVVbzahAPvYVD02xw== dependencies: - nx "14.1.4" + nx "15.5.3" -"@nrwl/workspace@14.1.4": - version "14.1.4" - resolved "https://registry.yarnpkg.com/@nrwl/workspace/-/workspace-14.1.4.tgz#ec5bfb05d00e7f7bb9eb45b5821ca8f93dad8f86" - integrity sha512-J/mcdlOPu5dkGoXDrGA1pPdEGFqYepRgZSoR+fSWlJT0Z4nb5C9aaXnu6OPl/8qwYFzAmQ5xsrqaaXQqtUHpQQ== +"@nrwl/tao@15.6.3": + version "15.6.3" + resolved "https://registry.npmjs.org/@nrwl/tao/-/tao-15.6.3.tgz#b24e11345375dea96bc386c60b9b1102a7584932" + integrity sha512-bDZbPIbU5Mf2BvX0q8GjPxrm1WkYyfW+gp7mLuuJth2sEpZiCr47mSwuGko/y4CKXvIX46VQcAS0pKQMKugXsg== dependencies: - "@nrwl/devkit" "14.1.4" - "@nrwl/jest" "14.1.4" - "@nrwl/linter" "14.1.4" + nx "15.6.3" + +"@nrwl/workspace@15.6.3": + version "15.6.3" + resolved "https://registry.npmjs.org/@nrwl/workspace/-/workspace-15.6.3.tgz#a9fd3c5692dfaebb04642e4e86d930d144bc2fed" + integrity sha512-RkCmDvcMXCVanR0RS8CZ14D7OMojSyvAal+b37P521MpizDkiN+zdRKewKvyOonzDeTAmZODtYccQ/uM5DjRfQ== + dependencies: + "@nrwl/devkit" "15.6.3" + "@nrwl/linter" "15.6.3" "@parcel/watcher" "2.0.4" - chalk "4.1.0" + chalk "^4.1.0" chokidar "^3.5.1" cli-cursor "3.1.0" cli-spinners "2.6.1" @@ -3342,125 +3354,126 @@ enquirer "~2.3.6" figures "3.2.0" flat "^5.0.2" - fs-extra "^9.1.0" + fs-extra "^11.1.0" glob "7.1.4" ignore "^5.0.4" - minimatch "3.0.4" + jsonc-parser "3.2.0" + minimatch "3.0.5" npm-run-path "^4.0.1" - nx "14.1.4" + nx "15.6.3" open "^8.4.0" rxjs "^6.5.4" semver "7.3.4" tmp "~0.2.1" tslib "^2.3.0" - yargs "^17.4.0" - yargs-parser "21.0.1" + yargs "^17.6.2" + yargs-parser "21.1.1" -"@octokit/auth-token@^2.4.4": - version "2.5.0" - resolved "https://registry.yarnpkg.com/@octokit/auth-token/-/auth-token-2.5.0.tgz#27c37ea26c205f28443402477ffd261311f21e36" - integrity sha512-r5FVUJCOLl19AxiuZD2VRZ/ORjp/4IN98Of6YJoJOkY75CIBuYfmiNHGrDwXr+aLGG55igl9QrxX3hbiXlLb+g== +"@octokit/auth-token@^3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@octokit/auth-token/-/auth-token-3.0.0.tgz#6f22c5fc56445c496628488ba6810131558fa4a9" + integrity sha512-MDNFUBcJIptB9At7HiV7VCvU3NcL4GnfCQaP8C5lrxWrRPMJBnemYtehaKSOlaM7AYxeRyj9etenu8LVpSpVaQ== dependencies: "@octokit/types" "^6.0.3" -"@octokit/core@^3.5.1": - version "3.5.1" - resolved "https://registry.yarnpkg.com/@octokit/core/-/core-3.5.1.tgz#8601ceeb1ec0e1b1b8217b960a413ed8e947809b" - integrity sha512-omncwpLVxMP+GLpLPgeGJBF6IWJFjXDS5flY5VbppePYX9XehevbDykRH9PdCdvqt9TS5AOTiDide7h0qrkHjw== +"@octokit/core@^4.0.0": + version "4.0.4" + resolved "https://registry.yarnpkg.com/@octokit/core/-/core-4.0.4.tgz#335d9b377691e3264ce57a9e5a1f6cda783e5838" + integrity sha512-sUpR/hc4Gc7K34o60bWC7WUH6Q7T6ftZ2dUmepSyJr9PRF76/qqkWjE2SOEzCqLA5W83SaISymwKtxks+96hPQ== dependencies: - "@octokit/auth-token" "^2.4.4" - "@octokit/graphql" "^4.5.8" - "@octokit/request" "^5.6.0" - "@octokit/request-error" "^2.0.5" + "@octokit/auth-token" "^3.0.0" + "@octokit/graphql" "^5.0.0" + "@octokit/request" "^6.0.0" + "@octokit/request-error" "^3.0.0" "@octokit/types" "^6.0.3" before-after-hook "^2.2.0" universal-user-agent "^6.0.0" -"@octokit/endpoint@^6.0.1": - version "6.0.12" - resolved "https://registry.yarnpkg.com/@octokit/endpoint/-/endpoint-6.0.12.tgz#3b4d47a4b0e79b1027fb8d75d4221928b2d05658" - integrity sha512-lF3puPwkQWGfkMClXb4k/eUT/nZKQfxinRWJrdZaJO85Dqwo/G0yOC434Jr2ojwafWJMYqFGFa5ms4jJUgujdA== +"@octokit/endpoint@^7.0.0": + version "7.0.0" + resolved "https://registry.yarnpkg.com/@octokit/endpoint/-/endpoint-7.0.0.tgz#be758a1236d68d6bbb505e686dd50881c327a519" + integrity sha512-Kz/mIkOTjs9rV50hf/JK9pIDl4aGwAtT8pry6Rpy+hVXkAPhXanNQRxMoq6AeRgDCZR6t/A1zKniY2V1YhrzlQ== dependencies: "@octokit/types" "^6.0.3" is-plain-object "^5.0.0" universal-user-agent "^6.0.0" -"@octokit/graphql@^4.5.8": - version "4.8.0" - resolved "https://registry.yarnpkg.com/@octokit/graphql/-/graphql-4.8.0.tgz#664d9b11c0e12112cbf78e10f49a05959aa22cc3" - integrity sha512-0gv+qLSBLKF0z8TKaSKTsS39scVKF9dbMxJpj3U0vC7wjNWFuIpL/z76Qe2fiuCbDRcJSavkXsVtMS6/dtQQsg== +"@octokit/graphql@^5.0.0": + version "5.0.0" + resolved "https://registry.yarnpkg.com/@octokit/graphql/-/graphql-5.0.0.tgz#2cc6eb3bf8e0278656df1a7d0ca0d7591599e3b3" + integrity sha512-1ZZ8tX4lUEcLPvHagfIVu5S2xpHYXAmgN0+95eAOPoaVPzCfUXJtA5vASafcpWcO86ze0Pzn30TAx72aB2aguQ== dependencies: - "@octokit/request" "^5.6.0" + "@octokit/request" "^6.0.0" "@octokit/types" "^6.0.3" universal-user-agent "^6.0.0" -"@octokit/openapi-types@^11.2.0": - version "11.2.0" - resolved "https://registry.yarnpkg.com/@octokit/openapi-types/-/openapi-types-11.2.0.tgz#b38d7fc3736d52a1e96b230c1ccd4a58a2f400a6" - integrity sha512-PBsVO+15KSlGmiI8QAzaqvsNlZlrDlyAJYcrXBCvVUxCp7VnXjkwPoFHgjEJXx3WF9BAwkA6nfCUA7i9sODzKA== +"@octokit/openapi-types@^12.10.0": + version "12.10.1" + resolved "https://registry.yarnpkg.com/@octokit/openapi-types/-/openapi-types-12.10.1.tgz#57b5cc6c7b4e55d8642c93d06401fb1af4839899" + integrity sha512-P+SukKanjFY0ZhsK6wSVnQmxTP2eVPPE8OPSNuxaMYtgVzwJZgfGdwlYjf4RlRU4vLEw4ts2fsE2icG4nZ5ddQ== "@octokit/plugin-enterprise-rest@^6.0.1": version "6.0.1" resolved "https://registry.yarnpkg.com/@octokit/plugin-enterprise-rest/-/plugin-enterprise-rest-6.0.1.tgz#e07896739618dab8da7d4077c658003775f95437" integrity sha512-93uGjlhUD+iNg1iWhUENAtJata6w5nE+V4urXOAlIXdco6xNZtUSfYY8dzp3Udy74aqO/B5UZL80x/YMa5PKRw== -"@octokit/plugin-paginate-rest@^2.16.8": - version "2.17.0" - resolved "https://registry.yarnpkg.com/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-2.17.0.tgz#32e9c7cab2a374421d3d0de239102287d791bce7" - integrity sha512-tzMbrbnam2Mt4AhuyCHvpRkS0oZ5MvwwcQPYGtMv4tUa5kkzG58SVB0fcsLulOZQeRnOgdkZWkRUiyBlh0Bkyw== +"@octokit/plugin-paginate-rest@^3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-3.0.0.tgz#df779de686aeb21b5e776e4318defc33b0418566" + integrity sha512-fvw0Q5IXnn60D32sKeLIxgXCEZ7BTSAjJd8cFAE6QU5qUp0xo7LjFUjjX1J5D7HgN355CN4EXE4+Q1/96JaNUA== dependencies: - "@octokit/types" "^6.34.0" + "@octokit/types" "^6.39.0" "@octokit/plugin-request-log@^1.0.4": version "1.0.4" resolved "https://registry.yarnpkg.com/@octokit/plugin-request-log/-/plugin-request-log-1.0.4.tgz#5e50ed7083a613816b1e4a28aeec5fb7f1462e85" integrity sha512-mLUsMkgP7K/cnFEw07kWqXGF5LKrOkD+lhCrKvPHXWDywAwuDUeDwWBpc69XK3pNX0uKiVt8g5z96PJ6z9xCFA== -"@octokit/plugin-rest-endpoint-methods@^5.12.0": - version "5.13.0" - resolved "https://registry.yarnpkg.com/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-5.13.0.tgz#8c46109021a3412233f6f50d28786f8e552427ba" - integrity sha512-uJjMTkN1KaOIgNtUPMtIXDOjx6dGYysdIFhgA52x4xSadQCz3b/zJexvITDVpANnfKPW/+E0xkOvLntqMYpviA== +"@octokit/plugin-rest-endpoint-methods@^6.0.0": + version "6.1.2" + resolved "https://registry.yarnpkg.com/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-6.1.2.tgz#bbf55cfc43acf177514441ecd1d26031006f73ed" + integrity sha512-sAfSKtLHNq0UQ2iFuI41I6m5SK6bnKFRJ5kUjDRVbmQXiRVi4aQiIcgG4cM7bt+bhSiWL4HwnTxDkWFlKeKClA== dependencies: - "@octokit/types" "^6.34.0" + "@octokit/types" "^6.40.0" deprecation "^2.3.1" -"@octokit/request-error@^2.0.5", "@octokit/request-error@^2.1.0": - version "2.1.0" - resolved "https://registry.yarnpkg.com/@octokit/request-error/-/request-error-2.1.0.tgz#9e150357831bfc788d13a4fd4b1913d60c74d677" - integrity sha512-1VIvgXxs9WHSjicsRwq8PlR2LR2x6DwsJAaFgzdi0JfJoGSO8mYI/cHJQ+9FbN21aa+DrgNLnwObmyeSC8Rmpg== +"@octokit/request-error@^3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@octokit/request-error/-/request-error-3.0.0.tgz#f527d178f115a3b62d76ce4804dd5bdbc0270a81" + integrity sha512-WBtpzm9lR8z4IHIMtOqr6XwfkGvMOOILNLxsWvDwtzm/n7f5AWuqJTXQXdDtOvPfTDrH4TPhEvW2qMlR4JFA2w== dependencies: "@octokit/types" "^6.0.3" deprecation "^2.0.0" once "^1.4.0" -"@octokit/request@^5.6.0": - version "5.6.2" - resolved "https://registry.yarnpkg.com/@octokit/request/-/request-5.6.2.tgz#1aa74d5da7b9e04ac60ef232edd9a7438dcf32d8" - integrity sha512-je66CvSEVf0jCpRISxkUcCa0UkxmFs6eGDRSbfJtAVwbLH5ceqF+YEyC8lj8ystKyZTy8adWr0qmkY52EfOeLA== +"@octokit/request@^6.0.0": + version "6.2.0" + resolved "https://registry.yarnpkg.com/@octokit/request/-/request-6.2.0.tgz#9c25606df84e6f2ccbcc2c58e1d35438e20b688b" + integrity sha512-7IAmHnaezZrgUqtRShMlByJK33MT9ZDnMRgZjnRrRV9a/jzzFwKGz0vxhFU6i7VMLraYcQ1qmcAOin37Kryq+Q== dependencies: - "@octokit/endpoint" "^6.0.1" - "@octokit/request-error" "^2.1.0" + "@octokit/endpoint" "^7.0.0" + "@octokit/request-error" "^3.0.0" "@octokit/types" "^6.16.1" is-plain-object "^5.0.0" - node-fetch "^2.6.1" + node-fetch "^2.6.7" universal-user-agent "^6.0.0" -"@octokit/rest@^18.1.0": - version "18.12.0" - resolved "https://registry.yarnpkg.com/@octokit/rest/-/rest-18.12.0.tgz#f06bc4952fc87130308d810ca9d00e79f6988881" - integrity sha512-gDPiOHlyGavxr72y0guQEhLsemgVjwRePayJ+FcKc2SJqKUbxbkvf5kAZEWA/MKvsfYlQAMVzNJE3ezQcxMJ2Q== +"@octokit/rest@^19.0.3": + version "19.0.3" + resolved "https://registry.yarnpkg.com/@octokit/rest/-/rest-19.0.3.tgz#b9a4e8dc8d53e030d611c053153ee6045f080f02" + integrity sha512-5arkTsnnRT7/sbI4fqgSJ35KiFaN7zQm0uQiQtivNQLI8RQx8EHwJCajcTUwmaCMNDg7tdCvqAnc7uvHHPxrtQ== dependencies: - "@octokit/core" "^3.5.1" - "@octokit/plugin-paginate-rest" "^2.16.8" + "@octokit/core" "^4.0.0" + "@octokit/plugin-paginate-rest" "^3.0.0" "@octokit/plugin-request-log" "^1.0.4" - "@octokit/plugin-rest-endpoint-methods" "^5.12.0" + "@octokit/plugin-rest-endpoint-methods" "^6.0.0" -"@octokit/types@^6.0.3", "@octokit/types@^6.16.1", "@octokit/types@^6.34.0": - version "6.34.0" - resolved "https://registry.yarnpkg.com/@octokit/types/-/types-6.34.0.tgz#c6021333334d1ecfb5d370a8798162ddf1ae8218" - integrity sha512-s1zLBjWhdEI2zwaoSgyOFoKSl109CUcVBCc7biPJ3aAf6LGLU6szDvi31JPU7bxfla2lqfhjbbg/5DdFNxOwHw== +"@octokit/types@^6.0.3", "@octokit/types@^6.16.1", "@octokit/types@^6.39.0", "@octokit/types@^6.40.0": + version "6.40.0" + resolved "https://registry.yarnpkg.com/@octokit/types/-/types-6.40.0.tgz#f2e665196d419e19bb4265603cf904a820505d0e" + integrity sha512-MFZOU5r8SwgJWDMhrLUSvyJPtVsqA6VnbVI3TNbsmw+Jnvrktzvq2fYES/6RiJA/5Ykdwq4mJmtlYUfW7CGjmw== dependencies: - "@octokit/openapi-types" "^11.2.0" + "@octokit/openapi-types" "^12.10.0" "@parcel/watcher@2.0.4": version "2.0.4" @@ -3477,44 +3490,79 @@ dependencies: esquery "^1.0.1" +"@playwright/test@^1.27.1": + version "1.27.1" + resolved "https://registry.yarnpkg.com/@playwright/test/-/test-1.27.1.tgz#9364d1e02021261211c8ff586d903faa79ce95c4" + integrity sha512-mrL2q0an/7tVqniQQF6RBL2saskjljXzqNcCOVMUjRIgE6Y38nCNaP+Dc2FBW06bcpD3tqIws/HT9qiMHbNU0A== + dependencies: + "@types/node" "*" + playwright-core "1.27.1" + "@polka/url@^1.0.0-next.20": version "1.0.0-next.21" resolved "https://registry.yarnpkg.com/@polka/url/-/url-1.0.0-next.21.tgz#5de5a2385a35309427f6011992b544514d559aa1" integrity sha512-a5Sab1C4/icpTZVzZc5Ghpz88yQtGOyNqYXcZgOssB2uuAr+wF/MvN6bgtW32q7HHrvBki+BsZ0OuNv6EV3K9g== -"@rollup/plugin-commonjs@^22.0.0": - version "22.0.1" - resolved "https://registry.yarnpkg.com/@rollup/plugin-commonjs/-/plugin-commonjs-22.0.1.tgz#f7cb777d20de3eeeaf994f39080115c336bef810" - integrity sha512-dGfEZvdjDHObBiP5IvwTKMVeq/tBZGMBHZFMdIV1ClMM/YoWS34xrHFGfag9SN2ZtMgNZRFruqvxZQEa70O6nQ== +"@rollup/plugin-babel@^5.2.0": + version "5.3.1" + resolved "https://registry.yarnpkg.com/@rollup/plugin-babel/-/plugin-babel-5.3.1.tgz#04bc0608f4aa4b2e4b1aebf284344d0f68fda283" + integrity sha512-WFfdLWU/xVWKeRQnKmIAQULUI7Il0gZnBIH/ZFO069wYIfPu+8zrfp/KMW0atmELoRDq8FbiP3VCss9MhCut7Q== dependencies: + "@babel/helper-module-imports" "^7.10.4" "@rollup/pluginutils" "^3.1.0" + +"@rollup/plugin-commonjs@^23.0.0": + version "23.0.0" + resolved "https://registry.yarnpkg.com/@rollup/plugin-commonjs/-/plugin-commonjs-23.0.0.tgz#3f64a49409d0681cd7496a71dd6577f07d39c3b0" + integrity sha512-JbrTRyDNtLQj/rhl7RFUuYXwQ2fac+33oLDAu2k++WD95zweyo28UAomLVA0JMGx4vmCa7Nw4T6k/1F6lelExg== + dependencies: + "@rollup/pluginutils" "^4.2.1" commondir "^1.0.1" - estree-walker "^2.0.1" - glob "^7.1.6" - is-reference "^1.2.1" - magic-string "^0.25.7" - resolve "^1.17.0" + estree-walker "^2.0.2" + glob "^8.0.3" + is-reference "1.2.1" + magic-string "^0.26.4" -"@rollup/plugin-json@^4.1.0": - version "4.1.0" - resolved "https://registry.yarnpkg.com/@rollup/plugin-json/-/plugin-json-4.1.0.tgz#54e09867ae6963c593844d8bd7a9c718294496f3" - integrity sha512-yfLbTdNS6amI/2OpmbiBoW12vngr5NW2jCJVZSBEz+H5KfUJZ2M7sDjk0U6GOOdCWFVScShte29o9NezJ53TPw== +"@rollup/plugin-json@^5.0.0": + version "5.0.0" + resolved "https://registry.yarnpkg.com/@rollup/plugin-json/-/plugin-json-5.0.0.tgz#1e3e18302637760353c83a41d1f3c4e760afb20d" + integrity sha512-LsWDA5wJs/ggzakVuKQhZo7HPRcQZgBa3jWIVxQSFxaRToUGNi8ZBh3+k/gQ+1eInVYJgn4WBRCUkmoDrmmGzw== dependencies: - "@rollup/pluginutils" "^3.0.8" + "@rollup/pluginutils" "^4.2.1" -"@rollup/plugin-node-resolve@^13.3.0": - version "13.3.0" - resolved "https://registry.yarnpkg.com/@rollup/plugin-node-resolve/-/plugin-node-resolve-13.3.0.tgz#da1c5c5ce8316cef96a2f823d111c1e4e498801c" - integrity sha512-Lus8rbUo1eEcnS4yTFKLZrVumLPY+YayBdWXgFSHYhTT2iJbMhoaaBL3xl5NCdeRytErGr8tZ0L71BMRmnlwSw== +"@rollup/plugin-node-resolve@^11.2.1": + version "11.2.1" + resolved "https://registry.yarnpkg.com/@rollup/plugin-node-resolve/-/plugin-node-resolve-11.2.1.tgz#82aa59397a29cd4e13248b106e6a4a1880362a60" + integrity sha512-yc2n43jcqVyGE2sqV5/YCmocy9ArjVAP/BeXyTtADTBBX6V0e5UMqwO8CdQ0kzjb6zu5P1qMzsScCMRvE9OlVg== dependencies: "@rollup/pluginutils" "^3.1.0" "@types/resolve" "1.17.1" + builtin-modules "^3.1.0" deepmerge "^4.2.2" - is-builtin-module "^3.1.0" is-module "^1.0.0" resolve "^1.19.0" -"@rollup/pluginutils@^3.0.8", "@rollup/pluginutils@^3.1.0": +"@rollup/plugin-node-resolve@^15.0.0": + version "15.0.0" + resolved "https://registry.yarnpkg.com/@rollup/plugin-node-resolve/-/plugin-node-resolve-15.0.0.tgz#44ded58b36702de27bf36bbf19ca420bbd1d0c27" + integrity sha512-iwJbzfTzlzDDQcGmkS7EkCKwe2kSkdBrjX87Fy/KrNjr6UNnLpod0t6X66e502LRe5JJCA4FFqrEscWPnZAkig== + dependencies: + "@rollup/pluginutils" "^4.2.1" + "@types/resolve" "1.20.2" + deepmerge "^4.2.2" + is-builtin-module "^3.2.0" + is-module "^1.0.0" + resolve "^1.22.1" + +"@rollup/plugin-replace@^2.4.1": + version "2.4.2" + resolved "https://registry.yarnpkg.com/@rollup/plugin-replace/-/plugin-replace-2.4.2.tgz#a2d539314fbc77c244858faa523012825068510a" + integrity sha512-IGcu+cydlUMZ5En85jxHH4qj2hta/11BHq95iHEyb2sbgiN0eCdzvUcHw5gt9pBL5lTi4JDYJ1acCoMGpTvEZg== + dependencies: + "@rollup/pluginutils" "^3.1.0" + magic-string "^0.25.7" + +"@rollup/pluginutils@^3.1.0": version "3.1.0" resolved "https://registry.yarnpkg.com/@rollup/pluginutils/-/pluginutils-3.1.0.tgz#706b4524ee6dc8b103b3c995533e5ad680c02b9b" integrity sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg== @@ -3531,10 +3579,19 @@ estree-walker "^2.0.1" picomatch "^2.2.2" -"@rushstack/node-core-library@3.49.0": - version "3.49.0" - resolved "https://registry.yarnpkg.com/@rushstack/node-core-library/-/node-core-library-3.49.0.tgz#0324c1a5ba5e469967b70e9718d1a90750648503" - integrity sha512-yBJRzGgUNFwulVrwwBARhbGaHsxVMjsZ9JwU1uSBbqPYCdac+t2HYdzi4f4q/Zpgb0eNbwYj2yxgHYpJORNEaw== +"@rollup/pluginutils@^5.0.0": + version "5.0.1" + resolved "https://registry.yarnpkg.com/@rollup/pluginutils/-/pluginutils-5.0.1.tgz#63def51f5a76dadd984689d33c7f000164152a97" + integrity sha512-4HaCVEXXuObvcPUaUlLt4faHYHCeQOOWNj8NKFGaRSrw3ZLD0TWeAFZicV9vXjnE2nkNuaVTfTuwAnjR+6uc9A== + dependencies: + "@types/estree" "^1.0.0" + estree-walker "^2.0.2" + picomatch "^2.3.1" + +"@rushstack/node-core-library@3.53.0": + version "3.53.0" + resolved "https://registry.yarnpkg.com/@rushstack/node-core-library/-/node-core-library-3.53.0.tgz#b4b812bc2e207e4fd3939991f8675335dab50978" + integrity sha512-FXk3eDtTHKnaUq+fLyNY867ioRhMa6CJDJO5hZ3wuGlxm184nckAFiU+hx027AodjpnqjX6pYF0zZGq7k7P/vg== dependencies: "@types/node" "12.20.24" colors "~1.2.1" @@ -3543,21 +3600,20 @@ jju "~1.4.0" resolve "~1.17.0" semver "~7.3.0" - timsort "~0.3.0" z-schema "~5.0.2" -"@rushstack/rig-package@0.3.13": - version "0.3.13" - resolved "https://registry.yarnpkg.com/@rushstack/rig-package/-/rig-package-0.3.13.tgz#80d7b34bc9b7a7feeba133f317df8dbd1f65a822" - integrity sha512-4/2+yyA/uDl7LQvtYtFs1AkhSWuaIGEKhP9/KK2nNARqOVc5eCXmu1vyOqr5mPvNq7sHoIR+sG84vFbaKYGaDA== +"@rushstack/rig-package@0.3.16": + version "0.3.16" + resolved "https://registry.yarnpkg.com/@rushstack/rig-package/-/rig-package-0.3.16.tgz#522279411059e05aeec0930d4ff86b707c720cfc" + integrity sha512-FoSQng2RtapEUe+CBPKxbpZUhUht5s2+mMiztRH95qqp81dsUpfEWojtV6XrUVyWIRk2/cY1CDZUKJWxMrT26Q== dependencies: resolve "~1.17.0" strip-json-comments "~3.1.1" -"@rushstack/ts-command-line@4.12.1": - version "4.12.1" - resolved "https://registry.yarnpkg.com/@rushstack/ts-command-line/-/ts-command-line-4.12.1.tgz#4437ffae6459eb88791625ad9e89b2f0ba254476" - integrity sha512-S1Nev6h/kNnamhHeGdp30WgxZTA+B76SJ/P721ctP7DrnC+rrjAc6h/R80I4V0cA2QuEEcMdVOQCtK2BTjsOiQ== +"@rushstack/ts-command-line@4.12.4": + version "4.12.4" + resolved "https://registry.yarnpkg.com/@rushstack/ts-command-line/-/ts-command-line-4.12.4.tgz#e4bedd4890bca415f90fec8f33c51404c4039410" + integrity sha512-ckZHEfPiJCmBdWd/syve5zu2TNsPIqbFie3jWzM/izZa6ZOkDwex/K1ww+kJ12hFBnN44lMD7voJvKXajUCEDA== dependencies: "@types/argparse" "1.0.38" argparse "~1.0.9" @@ -3581,11 +3637,6 @@ resolved "https://registry.yarnpkg.com/@sideway/pinpoint/-/pinpoint-2.0.0.tgz#cff8ffadc372ad29fd3f78277aeb29e632cc70df" integrity sha512-RNiOoTPkptFtSVzQevY/yWtZwf/RxyVnPy/OcA9HBM3MlGDnBEYL5B41H0MTn0Uec8Hi+2qUtTfG2WWZBmMejQ== -"@sinclair/typebox@^0.23.3": - version "0.23.5" - resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.23.5.tgz#93f7b9f4e3285a7a9ade7557d9a8d36809cbc47d" - integrity sha512-AFBVi/iT4g20DHoujvMH1aEDn8fGJh4xsRGCP6d8RpLPMqsNPvW01Jcn0QysXTsg++/xj25NmJsGyH9xug/wKg== - "@sinclair/typebox@^0.24.1": version "0.24.20" resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.24.20.tgz#11a657875de6008622d53f56e063a6347c51a6dd" @@ -3603,22 +3654,31 @@ dependencies: type-detect "4.0.8" -"@sinonjs/fake-timers@^9.1.1", "@sinonjs/fake-timers@^9.1.2": +"@sinonjs/fake-timers@^9.1.2": version "9.1.2" resolved "https://registry.yarnpkg.com/@sinonjs/fake-timers/-/fake-timers-9.1.2.tgz#4eaab737fab77332ab132d396a3c0d364bd0ea8c" integrity sha512-BPS4ynJW/o92PUR4wgriz2Ud5gpST5vz6GQfMixEDK0Z8ZCUv2M7SkBLykH56T++Xs+8ln9zTGbOvNGIe02/jw== dependencies: "@sinonjs/commons" "^1.7.0" -"@slorber/static-site-generator-webpack-plugin@^4.0.4": - version "4.0.4" - resolved "https://registry.yarnpkg.com/@slorber/static-site-generator-webpack-plugin/-/static-site-generator-webpack-plugin-4.0.4.tgz#2bf4a2545e027830d2aa5eb950437c26a289b0f1" - integrity sha512-FvMavoWEIePps6/JwGCOLYKCRhuwIHhMtmbKpBFgzNkxwpa/569LfTkrbRk1m1I3n+ezJK4on9E1A6cjuZmD9g== +"@slorber/static-site-generator-webpack-plugin@^4.0.7": + version "4.0.7" + resolved "https://registry.yarnpkg.com/@slorber/static-site-generator-webpack-plugin/-/static-site-generator-webpack-plugin-4.0.7.tgz#fc1678bddefab014e2145cbe25b3ce4e1cfc36f3" + integrity sha512-Ug7x6z5lwrz0WqdnNFOMYrDQNTPAprvHLSh6+/fmml3qUiz6l5eq+2MzLKWtn/q5K5NpSiFsZTP/fck/3vjSxA== dependencies: - bluebird "^3.7.1" - cheerio "^0.22.0" eval "^0.1.8" - webpack-sources "^1.4.3" + p-map "^4.0.0" + webpack-sources "^3.2.2" + +"@surma/rollup-plugin-off-main-thread@^2.2.3": + version "2.2.3" + resolved "https://registry.yarnpkg.com/@surma/rollup-plugin-off-main-thread/-/rollup-plugin-off-main-thread-2.2.3.tgz#ee34985952ca21558ab0d952f00298ad2190c053" + integrity sha512-lR8q/9W7hZpMWweNiAKU7NQerBnzQQLvi8qnTDU/fxItPhtZVMbPV3lbCwjhIlNBe9Bbr5V+KHshvWmVSG9cxQ== + dependencies: + ejs "^3.1.6" + json5 "^2.2.0" + magic-string "^0.25.0" + string.prototype.matchall "^4.0.6" "@svgr/babel-plugin-add-jsx-attribute@^6.0.0": version "6.0.0" @@ -3724,123 +3784,62 @@ "@svgr/plugin-jsx" "^6.2.1" "@svgr/plugin-svgo" "^6.2.0" -"@swc-node/core@^1.8.2": - version "1.8.2" - resolved "https://registry.yarnpkg.com/@swc-node/core/-/core-1.8.2.tgz#950ad394a8e8385658e6a951ec554bbf61a1693e" - integrity sha512-IoJ7tGHQ6JOMSmFe4VhP64uLmFKMNasS0QEgUrLFQ0h/dTvpQMynnoGBEJoPL6LfsebZ/q4uKqbpWrth6/yrAA== - dependencies: - "@swc/core" "^1.2.119" - -"@swc-node/register@^1.4.2": - version "1.4.2" - resolved "https://registry.yarnpkg.com/@swc-node/register/-/register-1.4.2.tgz#98801cc5ad8792519511bd6ae31c01f40aa487a3" - integrity sha512-wLZz0J7BTO//1Eq7e4eBQjKF380Hr2eVemz849msQSKcVM1D7UJUt/dP2TinEVGx++/BXJ/0q37i6n9Iw0EM0w== - dependencies: - "@swc-node/core" "^1.8.2" - "@swc-node/sourcemap-support" "^0.1.11" - chalk "4" - debug "^4.3.3" - pirates "^4.0.4" - tslib "^2.3.1" - typescript "^4.5.3" - -"@swc-node/sourcemap-support@^0.1.11": - version "0.1.11" - resolved "https://registry.yarnpkg.com/@swc-node/sourcemap-support/-/sourcemap-support-0.1.11.tgz#50cda396baade0636e8f53596b7a66386490c06d" - integrity sha512-b+Mn3oQl+7nUSt7hPzIbY9B30YhcFo1PT4kd9P4QmD6raycmIealOAhAdZID/JevphzsOXHQB4OqJm7Yi5tMcA== - dependencies: - source-map-support "^0.5.21" - -"@swc/core-android-arm-eabi@1.2.189": - version "1.2.189" - resolved "https://registry.yarnpkg.com/@swc/core-android-arm-eabi/-/core-android-arm-eabi-1.2.189.tgz#a8060c2ec7bd93bd9907c3059c44a832eda57b6d" - integrity sha512-0kN3Le6QzFFz+Lc6a/tf/RkJXubWwWaHxF4c0bVm4AKIFf4nRlUCEqEkjdVaZvL92rpBMHaEEBuIIz3T8DqTTQ== - -"@swc/core-android-arm64@1.2.189": - version "1.2.189" - resolved "https://registry.yarnpkg.com/@swc/core-android-arm64/-/core-android-arm64-1.2.189.tgz#c9a7ebaecbef4488db3394e660dd5c2abfa5c173" - integrity sha512-smsb+YkDw2OKwg66Z63E/G4NlFApDbsiOPmZXFZbtZbNBD9v+wnk6WVA//XR1bdUI9VbzNKlMPKJxQTE685QDw== - -"@swc/core-darwin-arm64@1.2.189": - version "1.2.189" - resolved "https://registry.yarnpkg.com/@swc/core-darwin-arm64/-/core-darwin-arm64-1.2.189.tgz#883098686504692218e88877b224e06db2a93c86" - integrity sha512-OGjZRkTulKirJMLYbW9etb59lA9ueDXVwYRVD9SrNh8tRMTf0Nq+SUT/C3LVhBBGC4KSdWOzBAYbDTTdsnY++Q== - -"@swc/core-darwin-x64@1.2.189": - version "1.2.189" - resolved "https://registry.yarnpkg.com/@swc/core-darwin-x64/-/core-darwin-x64-1.2.189.tgz#38ba12dc3b07d96761dc895dd43e14ba3323129f" - integrity sha512-BEcxnBHx51514Voe2dn/y1y5H9VNyw7Zpp9+mPekZqx5o/onPD5wZ1ZfAsPrA4UlvM3v16u6ITE/cLawJ/GdAQ== - -"@swc/core-freebsd-x64@1.2.189": - version "1.2.189" - resolved "https://registry.yarnpkg.com/@swc/core-freebsd-x64/-/core-freebsd-x64-1.2.189.tgz#0cee19a1382ee97a7be2ea057cf48f5e08c66038" - integrity sha512-B6g2NWeh2iw6WPOaM19Uj3VE4se6alT265kWibLUshjcofRfnYT1lNhhkrF1D0EVnpC8I96I/xXNQo4Am9z4zQ== - -"@swc/core-linux-arm-gnueabihf@1.2.189": - version "1.2.189" - resolved "https://registry.yarnpkg.com/@swc/core-linux-arm-gnueabihf/-/core-linux-arm-gnueabihf-1.2.189.tgz#612010e31969387de6acde69d8250fd74f784be1" - integrity sha512-6WhPG9pyN5AahQTVQk8MoN1I9Z/Ytfqizuie1wV7mW8FMNmMkiJvBekKtE6ftxu80Hqa34r86WfEwmJKm5MqYw== - -"@swc/core-linux-arm64-gnu@1.2.189": - version "1.2.189" - resolved "https://registry.yarnpkg.com/@swc/core-linux-arm64-gnu/-/core-linux-arm64-gnu-1.2.189.tgz#0fe98d1ca0a3441bfe4033fbe7fc19d87019f640" - integrity sha512-frJTGnxsDe7h2d7BtnBivOdOJTtabkQIIZmHd4JHqafcoekI6teyveIax17axLyimvWl278yTo3hf7ePagD/eg== - -"@swc/core-linux-arm64-musl@1.2.189": - version "1.2.189" - resolved "https://registry.yarnpkg.com/@swc/core-linux-arm64-musl/-/core-linux-arm64-musl-1.2.189.tgz#bb28e598e028745129e0eb9458184eb5b7efe685" - integrity sha512-27K38LoZpME5lojDJIUNo7zdTDwAKLm0BMQ7HXWcYOyiDAekhSidI+SrBWxCfLzfuClhFu6/VE3E7j32VFJsiA== - -"@swc/core-linux-x64-gnu@1.2.189": - version "1.2.189" - resolved "https://registry.yarnpkg.com/@swc/core-linux-x64-gnu/-/core-linux-x64-gnu-1.2.189.tgz#365073c3183e40080be900337987fcc4d2270fff" - integrity sha512-Ha5oJKOyQm9w7+e+WdRm4ypijzEmglWZGtgBR6vV6ViqqHcTBAU4nG87ex7y7AS9p+Cbc6EOSR9X1qIB8KxtbA== - -"@swc/core-linux-x64-musl@1.2.189": - version "1.2.189" - resolved "https://registry.yarnpkg.com/@swc/core-linux-x64-musl/-/core-linux-x64-musl-1.2.189.tgz#1ce88e44952d0d4f525016c7841c1443f91de788" - integrity sha512-/p5yXa9HEzpVEuE4ivkW1IvwyYu6fT+L2OvVEs5oXIba80F0Wjy7InWqaa83gwrdMH+bXV6loG8LzZUZu/lpjA== - -"@swc/core-win32-arm64-msvc@1.2.189": - version "1.2.189" - resolved "https://registry.yarnpkg.com/@swc/core-win32-arm64-msvc/-/core-win32-arm64-msvc-1.2.189.tgz#2ad4d2aacd0032c1f8a859bba963207436a78769" - integrity sha512-o/1ueM6/sifNjYnO6NMEXB895spVfJs5oQIPxQG9vJ/4zWLw8YmAx+u1xJY+XGyK6gnroHt7yPiS87qWdbeF6w== - -"@swc/core-win32-ia32-msvc@1.2.189": - version "1.2.189" - resolved "https://registry.yarnpkg.com/@swc/core-win32-ia32-msvc/-/core-win32-ia32-msvc-1.2.189.tgz#93dee76f59760b8eb516a2e55111fdeaf1e8c6c8" - integrity sha512-YDwRkzykaf+dw5Z7u189cC/Tttkn2NVV84hrGL3LbVuh7wT5PaDhZs4Yz4unZQSlPV12olmZWgNr/i27h5wlpg== - -"@swc/core-win32-x64-msvc@1.2.189": - version "1.2.189" - resolved "https://registry.yarnpkg.com/@swc/core-win32-x64-msvc/-/core-win32-x64-msvc-1.2.189.tgz#eeb127740952e3dd5cae2866c2da60346fed457b" - integrity sha512-Nge8Z/ZkAp5p5No50yBDpBG7+ZYaVWGSuwtPj6OJe7orzvDCEm9GgcVE6J9GEjbclSWlCH8B8lUe17GaKRZHbg== - -"@swc/core@^1.2.119", "@swc/core@^1.2.173", "@swc/core@^1.2.181": - version "1.2.189" - resolved "https://registry.yarnpkg.com/@swc/core/-/core-1.2.189.tgz#8db88e809764e5b3b2be3fcac0da9d9d957e1056" - integrity sha512-S5cKX4ECMSfW78DLFgnlilJZgjrFRYwPslrrwpLl3gpwh+Qo72/Mhn71u7G/5xXW+T/xW5GwPccHfCk+k72uUg== +"@swc/core-android-arm-eabi@1.3.4", "@swc/core-android-arm-eabi@npm:dummypkg-a@1.0.0", "@swc/core-android-arm64@1.3.4", "@swc/core-android-arm64@npm:dummypkg-a@1.0.0", "@swc/core-freebsd-x64@1.3.4", "@swc/core-freebsd-x64@npm:dummypkg-a@1.0.0", "@swc/core-linux-arm-gnueabihf@1.3.4", "@swc/core-linux-arm-gnueabihf@npm:dummypkg-a@1.0.0", "@swc/core-linux-arm64-gnu@1.3.4", "@swc/core-linux-arm64-gnu@npm:dummypkg-a@1.0.0", "@swc/core-linux-arm64-musl@1.3.4", "@swc/core-linux-arm64-musl@npm:dummypkg-a@1.0.0", "@swc/core-win32-arm64-msvc@1.3.4", "@swc/core-win32-arm64-msvc@npm:dummypkg-a@1.0.0", "@swc/core-win32-ia32-msvc@1.3.4", "@swc/core-win32-ia32-msvc@npm:dummypkg-a@1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/dummypkg-a/-/dummypkg-a-1.0.0.tgz#02868251461af84d70603446ef5908b72c5c8435" + integrity sha512-V9qLfUzVlmSW/ayzlchss1XjAqWXqHmJtzGwnfg/jsnloIUyLKR5a0Djfdgj/Jv3yoNAljIUaelTVjptxtTyGA== + +"@swc/core-darwin-arm64@1.3.4": + version "1.3.4" + resolved "https://registry.yarnpkg.com/@swc/core-darwin-arm64/-/core-darwin-arm64-1.3.4.tgz#99974b7657348717ce685450ef4566af5fca5f6b" + integrity sha512-JNBFQKtaUdsq0Sv6N29++Q6xrvZDn1bQ7pbMvr8t7kBNXaYCDmupbwPGT725MrGVs72N4qKee5Z0OIvmnLCQfw== + +"@swc/core-darwin-x64@1.3.4": + version "1.3.4" + resolved "https://registry.yarnpkg.com/@swc/core-darwin-x64/-/core-darwin-x64-1.3.4.tgz#4742a7f83de9f6ba50801e9f6500b538856853ea" + integrity sha512-A6KMZsUJ3j5TVxAizbv+UEjCNvMgWBm9jw4R3biaw8kbgu3XUWHdkiheXO+c2kjjjgwr1jhkHcLgRjffwpLYFA== + +"@swc/core-linux-x64-gnu@1.3.4": + version "1.3.4" + resolved "https://registry.yarnpkg.com/@swc/core-linux-x64-gnu/-/core-linux-x64-gnu-1.3.4.tgz#1cc63f9a86074cac7454796ccbe3836ac7f6451b" + integrity sha512-rRqDtxktiVaxO8NQeEZSX0kNSFkI5Ft+4fZcFTbWhDO0vknC0+ZYbWpverfQ8yAwo7aA9jKWupwc3I7iZ1EQQQ== + +"@swc/core-linux-x64-musl@1.3.4": + version "1.3.4" + resolved "https://registry.yarnpkg.com/@swc/core-linux-x64-musl/-/core-linux-x64-musl-1.3.4.tgz#f65abb7e149ad3f20ca98c933331aa98c190cd9f" + integrity sha512-stVnU7KXQxSbh67UiIVxZsgjkRSXApPTEU3CYnwsdH7G+ynfO1WocSatzjIKpJfhcY2Nss8/33yDaOKZXVhbIA== + +"@swc/core-win32-x64-msvc@1.3.4": + version "1.3.4" + resolved "https://registry.yarnpkg.com/@swc/core-win32-x64-msvc/-/core-win32-x64-msvc-1.3.4.tgz#7bf6cd6f5c3197d7d807b273d12dd666e23b238e" + integrity sha512-9/bSvgjV31u1G2slRFPgK85ohJdo8KtWJ0f4CPp2LdVtIJHbFGd0pWjnMfiPJeodSxSGGWrgUNQtajqIIsrbqA== + +"@swc/core@^1.3.1": + version "1.3.4" + resolved "https://registry.yarnpkg.com/@swc/core/-/core-1.3.4.tgz#961183ede3a836b3aea7d755f07c4ae673c5a763" + integrity sha512-W1AvQImfF2T+7dzWdg/GqFpcMJ24lyXGQ/kPKHL/FGPZbf0Q1ExD7wp3eQ2PQMgHTLe28qWonxicm2DPfprx3g== optionalDependencies: - "@swc/core-android-arm-eabi" "1.2.189" - "@swc/core-android-arm64" "1.2.189" - "@swc/core-darwin-arm64" "1.2.189" - "@swc/core-darwin-x64" "1.2.189" - "@swc/core-freebsd-x64" "1.2.189" - "@swc/core-linux-arm-gnueabihf" "1.2.189" - "@swc/core-linux-arm64-gnu" "1.2.189" - "@swc/core-linux-arm64-musl" "1.2.189" - "@swc/core-linux-x64-gnu" "1.2.189" - "@swc/core-linux-x64-musl" "1.2.189" - "@swc/core-win32-arm64-msvc" "1.2.189" - "@swc/core-win32-ia32-msvc" "1.2.189" - "@swc/core-win32-x64-msvc" "1.2.189" + "@swc/core-android-arm-eabi" "1.3.4" + "@swc/core-android-arm64" "1.3.4" + "@swc/core-darwin-arm64" "1.3.4" + "@swc/core-darwin-x64" "1.3.4" + "@swc/core-freebsd-x64" "1.3.4" + "@swc/core-linux-arm-gnueabihf" "1.3.4" + "@swc/core-linux-arm64-gnu" "1.3.4" + "@swc/core-linux-arm64-musl" "1.3.4" + "@swc/core-linux-x64-gnu" "1.3.4" + "@swc/core-linux-x64-musl" "1.3.4" + "@swc/core-win32-arm64-msvc" "1.3.4" + "@swc/core-win32-ia32-msvc" "1.3.4" + "@swc/core-win32-x64-msvc" "1.3.4" "@swc/jest@^0.2.21": - version "0.2.22" - resolved "https://registry.yarnpkg.com/@swc/jest/-/jest-0.2.22.tgz#70d02ac648c21a442016d7a0aa485577335a4c9a" - integrity sha512-PIUIk9IdB1oAVfF9zNIfYoMBoEhahrrSvyryFANas7swC1cF0L5HR0f9X4qfet46oyCHCBtNcSpN0XJEOFIKlw== + version "0.2.23" + resolved "https://registry.yarnpkg.com/@swc/jest/-/jest-0.2.23.tgz#0b7499d5927faaa090c5b7a4a0e35122968fef30" + integrity sha512-ZLj17XjHbPtNsgqjm83qizENw05emLkKGu3WuPUttcy9hkngl0/kcc7fDbcSBpADS0GUtsO+iKPjZFWVAtJSlA== dependencies: "@jest/create-cache-key-function" "^27.4.2" + jsonc-parser "^3.2.0" "@szmarczak/http-timer@^1.1.2": version "1.1.2" @@ -3849,11 +3848,6 @@ dependencies: defer-to-connect "^1.0.1" -"@tootallnate/once@1": - version "1.1.2" - resolved "https://registry.yarnpkg.com/@tootallnate/once/-/once-1.1.2.tgz#ccb91445360179a04e7fe6aff78c00ffc1eeaf82" - integrity sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw== - "@tootallnate/once@2": version "2.0.0" resolved "https://registry.yarnpkg.com/@tootallnate/once/-/once-2.0.0.tgz#f544a148d3ab35801c1f633a7441fd87c2e484bf" @@ -3985,16 +3979,21 @@ "@types/estree" "*" "@types/json-schema" "*" -"@types/estree@*", "@types/estree@^0.0.51": - version "0.0.51" - resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.51.tgz#cfd70924a25a3fd32b218e5e420e6897e1ac4f40" - integrity sha512-CuPgU6f3eT/XgKKPqKd/gLZV1Xmvf1a2R5POBOGQa6uv82xpls89HU5zKeVoyR8XzHd1RGNOlQlvUe3CFkjWNQ== +"@types/estree@*", "@types/estree@^1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.0.tgz#5fb2e536c1ae9bf35366eed879e827fa59ca41c2" + integrity sha512-WulqXMDUTYAXCjZnk6JtIHPigp55cVtDgDrO2gHRwhyJto21+1zbVCtOYB2L1F9w4qCQ0rOGWBnBe0FNTiEJIQ== "@types/estree@0.0.39": version "0.0.39" resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.39.tgz#e177e699ee1b8c22d23174caaa7422644389509f" integrity sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw== +"@types/estree@^0.0.51": + version "0.0.51" + resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.51.tgz#cfd70924a25a3fd32b218e5e420e6897e1ac4f40" + integrity sha512-CuPgU6f3eT/XgKKPqKd/gLZV1Xmvf1a2R5POBOGQa6uv82xpls89HU5zKeVoyR8XzHd1RGNOlQlvUe3CFkjWNQ== + "@types/express-serve-static-core@*", "@types/express-serve-static-core@^4.17.18": version "4.17.28" resolved "https://registry.yarnpkg.com/@types/express-serve-static-core/-/express-serve-static-core-4.17.28.tgz#c47def9f34ec81dc6328d0b1b5303d1ec98d86b8" @@ -4014,7 +4013,15 @@ "@types/qs" "*" "@types/serve-static" "*" -"@types/glob@*", "@types/glob@^7.2.0": +"@types/glob@*", "@types/glob@^8.0.0": + version "8.0.0" + resolved "https://registry.yarnpkg.com/@types/glob/-/glob-8.0.0.tgz#321607e9cbaec54f687a0792b2d1d370739455d2" + integrity sha512-l6NQsDDyQUVeoTynNpC9uRvCUint/gSUXQA2euwmTuWGvPY5LSDUu6tkCtJB2SvGQlJQzLaKqcGZP4//7EDveA== + dependencies: + "@types/minimatch" "*" + "@types/node" "*" + +"@types/glob@^7.1.3": version "7.2.0" resolved "https://registry.yarnpkg.com/@types/glob/-/glob-7.2.0.tgz#bc1b5bf3aa92f25bd5dd39f35c57361bdce5b2eb" integrity sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA== @@ -4084,15 +4091,15 @@ dependencies: "@types/jest" "*" -"@types/jest@*", "@types/jest@^28.1.1": - version "28.1.3" - resolved "https://registry.yarnpkg.com/@types/jest/-/jest-28.1.3.tgz#52f3f3e50ce59191ff5fbb1084896cc0cf30c9ce" - integrity sha512-Tsbjk8Y2hkBaY/gJsataeb4q9Mubw9EOz7+4RjPkzD5KjTvHHs7cpws22InaoXxAVAhF5HfFbzJjo6oKWqSZLw== +"@types/jest@*", "@types/jest@^29.0.2": + version "29.1.1" + resolved "https://registry.yarnpkg.com/@types/jest/-/jest-29.1.1.tgz#cf21a0835a1ba9a30ea1966019f1261c6a114c92" + integrity sha512-U9Ey07dGWl6fUFaIaUQUKWG5NoKi/zizeVQCGV8s4nSU0jPgqphVZvS64+8BtWYvrc3ZGw6wo943NSYPxkrp/g== dependencies: - jest-matcher-utils "^28.0.0" - pretty-format "^28.0.0" + expect "^29.0.0" + pretty-format "^29.0.0" -"@types/json-schema@*", "@types/json-schema@^7.0.4", "@types/json-schema@^7.0.5", "@types/json-schema@^7.0.8", "@types/json-schema@^7.0.9": +"@types/json-schema@*", "@types/json-schema@^7.0.11", "@types/json-schema@^7.0.4", "@types/json-schema@^7.0.5", "@types/json-schema@^7.0.6", "@types/json-schema@^7.0.8", "@types/json-schema@^7.0.9": version "7.0.11" resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.11.tgz#d421b6c527a3037f7c84433fd2c4229e016863d3" integrity sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ== @@ -4103,14 +4110,14 @@ integrity sha1-7ihweulOEdK4J7y+UnC86n8+ce4= "@types/lodash@*", "@types/lodash@^4.14.182": - version "4.14.182" - resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.182.tgz#05301a4d5e62963227eaafe0ce04dd77c54ea5c2" - integrity sha512-/THyiqyQAP9AfARo4pF+aCGcyiQ94tX/Is2I7HofNRqoYLgN1PBoOWu2/zTA5zMxzP5EFutMtWtGAFRKUe961Q== + version "4.14.186" + resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.186.tgz#862e5514dd7bd66ada6c70ee5fce844b06c8ee97" + integrity sha512-eHcVlLXP0c2FlMPm56ITode2AgLMSa6aJ05JTTbYbI+7EMkCEE5qk2E41d5g2lCVTqRe0GnnRFurmlCsDODrPw== "@types/marked@*", "@types/marked@^4.0.3": - version "4.0.3" - resolved "https://registry.yarnpkg.com/@types/marked/-/marked-4.0.3.tgz#2098f4a77adaba9ce881c9e0b6baf29116e5acc4" - integrity sha512-HnMWQkLJEf/PnxZIfbm0yGJRRZYYMhb++O9M36UCTA9z53uPvVoSlAwJr3XOpDEryb7Hwl1qAx/MV6YIW1RXxg== + version "4.0.7" + resolved "https://registry.yarnpkg.com/@types/marked/-/marked-4.0.7.tgz#400a76809fd08c2bbd9e25f3be06ea38c8e0a1d3" + integrity sha512-eEAhnz21CwvKVW+YvRvcTuFKNU9CV1qH+opcgVK3pIMI6YZzDm6gc8o2vHjldFk6MGKt5pueSB7IOpvpx5Qekw== "@types/mdast@^3.0.0": version "3.0.10" @@ -4139,6 +4146,11 @@ resolved "https://registry.yarnpkg.com/@types/ms/-/ms-0.7.31.tgz#31b7ca6407128a3d2bbc27fe2d21b345397f6197" integrity sha512-iiUgKzV9AuaEkZqkOLDIvlQiL6ltuZd9tGcW3gwpnX8JbuiuhFlEGmmFXEXkN50Cvq7Os88IY2v0dkDqXYWVgA== +"@types/natural-compare-lite@^1.4.0": + version "1.4.0" + resolved "https://registry.yarnpkg.com/@types/natural-compare-lite/-/natural-compare-lite-1.4.0.tgz#90724682da3c304dd8d643b4e9ba00f53f29d454" + integrity sha512-ZDcj/yWsRPacqKPpCExWWFq9X1JQwEOfHsu8deN1Qfa6M02z6tN4DK6AMf2IkM7709gp3QW6Bo7m2NFDhA485w== + "@types/ncp@^2.0.5": version "2.0.5" resolved "https://registry.yarnpkg.com/@types/ncp/-/ncp-2.0.5.tgz#5c53b229a321946102a188b603306162137f4fb9" @@ -4146,10 +4158,10 @@ dependencies: "@types/node" "*" -"@types/node@*", "@types/node@12.20.24", "@types/node@^14.14.31", "@types/node@^17.0.31", "@types/node@^17.0.5": - version "17.0.31" - resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.31.tgz#a5bb84ecfa27eec5e1c802c6bbf8139bdb163a5d" - integrity sha512-AR0x5HbXGqkEx9CadRH3EBYx/VkiUgZIhP4wvPn/+5KIsgpNoyFaRlVe0Zlx9gRtg8fA06a9tskE2MSN7TcG4Q== +"@types/node@*", "@types/node@12.20.24", "@types/node@^17.0.5", "@types/node@^18.11.9": + version "18.11.9" + resolved "https://registry.yarnpkg.com/@types/node/-/node-18.11.9.tgz#02d013de7058cea16d36168ef2fc653464cfbad4" + integrity sha512-CRpX21/kGdzjOpFsZSkcrXMGIBWMGNIHXXBVFSH+ggkftxg+XYP20TESbh+zFvFj3EQOl5byk0HTRn1IL6hbqg== "@types/normalize-package-data@^2.4.0": version "2.4.1" @@ -4166,10 +4178,10 @@ resolved "https://registry.yarnpkg.com/@types/parse5/-/parse5-5.0.3.tgz#e7b5aebbac150f8b5fdd4a46e7f0bd8e65e19109" integrity sha512-kUNnecmtkunAoQ3CnjmMkzNU/gtxG8guhi+Fk2U/kOpIKjIMKnXGp4IJCgQJrXSgMsWYimYG4TGjz/UzbGEBTw== -"@types/prettier@*", "@types/prettier@^2.1.5", "@types/prettier@^2.6.0": - version "2.6.0" - resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.6.0.tgz#efcbd41937f9ae7434c714ab698604822d890759" - integrity sha512-G/AdOadiZhnJp0jXCaBQU449W2h716OW/EoXeYkCytxKL06X1WCXB4DZpp8TpZ8eyIJVS1cw4lrlkkSYU21cDw== +"@types/prettier@*", "@types/prettier@^2.1.5", "@types/prettier@^2.6.0", "@types/prettier@^2.6.1": + version "2.7.1" + resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.7.1.tgz#dfd20e2dc35f027cdd6c1908e80a5ddc7499670e" + integrity sha512-ri0UmynRRvZiiUJdiz38MmIblKK+oH30MztdBVR95dv/Ubw6neWSb8u1XpRb72L4qsZOhz+L+z9JD40SJmfWow== "@types/prop-types@*": version "15.7.4" @@ -4193,12 +4205,12 @@ dependencies: "@types/react" "*" -"@types/react-router-config@*": - version "5.0.3" - resolved "https://registry.yarnpkg.com/@types/react-router-config/-/react-router-config-5.0.3.tgz#72a53561bcb5e13b82c576527b818fa2579591c7" - integrity sha512-38vpjXic0+E2sIBEKUe+RrCmbc8RqcQhNV8OmU3KUcwgy/yzTeo67MhllP+0zjZWNr7Lhw+RnUkL0hzkf63nUQ== +"@types/react-router-config@*", "@types/react-router-config@^5.0.6": + version "5.0.6" + resolved "https://registry.yarnpkg.com/@types/react-router-config/-/react-router-config-5.0.6.tgz#87c5c57e72d241db900d9734512c50ccec062451" + integrity sha512-db1mx37a1EJDf1XeX8jJN7R3PZABmJQXR8r28yUjVMFSjkmnQo6X6pOEEmNl+Tp2gYQOGPdYbFIipBtdElZ3Yg== dependencies: - "@types/history" "*" + "@types/history" "^4.7.11" "@types/react" "*" "@types/react-router" "*" @@ -4220,9 +4232,9 @@ "@types/react" "*" "@types/react@*", "@types/react@^18.0.9": - version "18.0.12" - resolved "https://registry.yarnpkg.com/@types/react/-/react-18.0.12.tgz#cdaa209d0a542b3fcf69cf31a03976ec4cdd8840" - integrity sha512-duF1OTASSBQtcigUvhuiTB1Ya3OvSy+xORCiEf20H0P0lzx+/KeVsA99U5UjLXSbyo1DRJDlLKqTeM1ngosqtg== + version "18.0.21" + resolved "https://registry.yarnpkg.com/@types/react/-/react-18.0.21.tgz#b8209e9626bb00a34c76f55482697edd2b43cc67" + integrity sha512-7QUCOxvFgnD5Jk8ZKlUAhVcRj7GuJRjnjjiY/IUBWKgOlnvDvTMLD4RTF7NPyVmbRhNrbomZiOepg7M/2Kj1mA== dependencies: "@types/prop-types" "*" "@types/scheduler" "*" @@ -4235,6 +4247,11 @@ dependencies: "@types/node" "*" +"@types/resolve@1.20.2": + version "1.20.2" + resolved "https://registry.yarnpkg.com/@types/resolve/-/resolve-1.20.2.tgz#97d26e00cd4a0423b4af620abecf3e6f442b7975" + integrity sha512-60BCwRFOZCQhDncwQdxxeOEEkbc5dIMccYLwbxsS4TUNeVECQ/pBJ0j09mrHOl/JJvpRPGwO9SvE4nR2Nb/a4Q== + "@types/retry@^0.12.0": version "0.12.1" resolved "https://registry.yarnpkg.com/@types/retry/-/retry-0.12.1.tgz#d8f1c0d0dc23afad6dc16a9e993a0865774b4065" @@ -4260,10 +4277,10 @@ resolved "https://registry.yarnpkg.com/@types/scheduler/-/scheduler-0.16.2.tgz#1a62f89525723dde24ba1b01b092bf5df8ad4d39" integrity sha512-hppQEBDmlwhFAXKJX2KnWLYu5yMfi91yazPb2l+lbJiwW+wdo1gNeRA+3RgNSO39WYX2euey41KEwnqesU2Jew== -"@types/semver@*", "@types/semver@^7.3.9": - version "7.3.10" - resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.3.10.tgz#5f19ee40cbeff87d916eedc8c2bfe2305d957f73" - integrity sha512-zsv3fsC7S84NN6nPK06u79oWgrPVd0NvOyqgghV1haPaFcVxIrP4DLomRwGAXk0ui4HZA7mOcSFL98sMVW9viw== +"@types/semver@*", "@types/semver@^7.3.12", "@types/semver@^7.3.9": + version "7.3.12" + resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.3.12.tgz#920447fdd78d76b19de0438b7f60df3c4a80bf1c" + integrity sha512-WwA1MW0++RfXmCr12xeYOOC5baSC9mSb0ZqCquFzKhcoF4TvHu5MKOuXsncgZcpVFhB1pXd5hZmM0ryAoCp12A== "@types/serve-index@^1.9.1": version "1.9.1" @@ -4272,7 +4289,7 @@ dependencies: "@types/express" "*" -"@types/serve-static@*": +"@types/serve-static@*", "@types/serve-static@^1.13.10": version "1.13.10" resolved "https://registry.yarnpkg.com/@types/serve-static/-/serve-static-1.13.10.tgz#f5e0ce8797d2d7cc5ebeda48a52c96c4fa47a8d9" integrity sha512-nCkHGI4w7ZgAdNkrEu0bv+4xNV/XDqW+DydknebMOQwkpDGx8G+HTlj7R7ABI8i8nKxVw0wtKPi1D+lPOkh4YQ== @@ -4280,16 +4297,6 @@ "@types/mime" "^1" "@types/node" "*" -"@types/sinonjs__fake-timers@^6.0.2": - version "6.0.4" - resolved "https://registry.yarnpkg.com/@types/sinonjs__fake-timers/-/sinonjs__fake-timers-6.0.4.tgz#0ecc1b9259b76598ef01942f547904ce61a6a77d" - integrity sha512-IFQTJARgMUBF+xVd2b+hIgXWrZEjND3vJtRCvIelcFB5SIXfjV4bOHbHJ0eXKh+0COrBRc8MqteKAz/j88rE0A== - -"@types/sizzle@^2.3.2": - version "2.3.3" - resolved "https://registry.yarnpkg.com/@types/sizzle/-/sizzle-2.3.3.tgz#ff5e2f1902969d305225a047c8a0fd5c915cebef" - integrity sha512-JYM8x9EGF163bEyhdJBpR2QX1R5naCJHC8ucJylJ3w9/CVBaskdQ8WqBf8MmQrd1kRvp/a4TS8HJ+bxzR7ZJYQ== - "@types/sockjs@^0.3.33": version "0.3.33" resolved "https://registry.yarnpkg.com/@types/sockjs/-/sockjs-0.3.33.tgz#570d3a0b99ac995360e3136fd6045113b1bd236f" @@ -4307,6 +4314,11 @@ resolved "https://registry.yarnpkg.com/@types/tmp/-/tmp-0.2.3.tgz#908bfb113419fd6a42273674c00994d40902c165" integrity sha512-dDZH/tXzwjutnuk4UacGgFRwV+JSLaXL1ikvidfJprkb7L9Nx1njcRHHmi3Dsvt7pgqqTEeucQuOrWHPFgzVHA== +"@types/trusted-types@^2.0.2": + version "2.0.2" + resolved "https://registry.yarnpkg.com/@types/trusted-types/-/trusted-types-2.0.2.tgz#fc25ad9943bcac11cceb8168db4f275e0e72e756" + integrity sha512-F5DIZ36YVLE+PN+Zwws4kJogq47hNgX3Nx6WyDJ3kcplxyke3XIzB8uK5n/Lpm1HBsbGzd6nmGehL8cPekP+Tg== + "@types/unist@*", "@types/unist@^2.0.0", "@types/unist@^2.0.2", "@types/unist@^2.0.3": version "2.0.6" resolved "https://registry.yarnpkg.com/@types/unist/-/unist-2.0.6.tgz#250a7b16c3b91f672a24552ec64678eeb1d3a08d" @@ -4331,13 +4343,6 @@ dependencies: "@types/yargs-parser" "*" -"@types/yauzl@^2.9.1": - version "2.9.2" - resolved "https://registry.yarnpkg.com/@types/yauzl/-/yauzl-2.9.2.tgz#c48e5d56aff1444409e39fa164b0b4d4552a7b7a" - integrity sha512-8uALY5LTvSuHgloDVUvWP3pIauILm+8/0pDMokuDYIoNsOkSwd5AiHBTSEJjKTDcZr5z8UpgOWZkxBF4iJftoA== - dependencies: - "@types/node" "*" - "@webassemblyjs/ast@1.11.1": version "1.11.1" resolved "https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.11.1.tgz#2bfd767eae1a6996f432ff7e8d7fc75679c0b6a7" @@ -4469,6 +4474,26 @@ resolved "https://registry.yarnpkg.com/@xtuc/long/-/long-4.2.2.tgz#d291c6a4e97989b5c61d9acf396ae4fe133a718d" integrity sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ== +"@yarnpkg/lockfile@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@yarnpkg/lockfile/-/lockfile-1.1.0.tgz#e77a97fbd345b76d83245edcd17d393b1b41fb31" + integrity sha512-GpSwvyXOcOOlV70vbnzjj4fW5xW/FdUF6nQEt1ENy7m4ZCczi1+/buVUPAqmGfqznsORNFzUMjctTIp8a9tuCQ== + +"@yarnpkg/parsers@^3.0.0-rc.18": + version "3.0.0-rc.24" + resolved "https://registry.yarnpkg.com/@yarnpkg/parsers/-/parsers-3.0.0-rc.24.tgz#508f9dd089c7b297d9dcc297aa0e8c89fb56267f" + integrity sha512-A5wXsIUOipZUGDly1SHBht1OjKKW4y+E9EzzJxR2tby0Pj3atgCta9RSYa4+aXLkFfIMX3onnykmJnwJWqJj5g== + dependencies: + js-yaml "^3.10.0" + tslib "^2.4.0" + +"@zkochan/js-yaml@0.0.6": + version "0.0.6" + resolved "https://registry.yarnpkg.com/@zkochan/js-yaml/-/js-yaml-0.0.6.tgz#975f0b306e705e28b8068a07737fa46d3fc04826" + integrity sha512-nzvgl3VfhcELQ8LyVrYOru+UtAy1nrygk2+AGbTm8a5YcO6o8lSjAT+pfg3vJWxIoZKOUhrK6UU7xW/+00kQrg== + dependencies: + argparse "^2.0.1" + JSONStream@^1.0.4: version "1.3.5" resolved "https://registry.yarnpkg.com/JSONStream/-/JSONStream-1.3.5.tgz#3208c1f08d3a4d99261ab64f92302bc15e111ca0" @@ -4506,9 +4531,9 @@ acorn-walk@^8.0.0, acorn-walk@^8.1.1: integrity sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA== acorn@^8.0.4, acorn@^8.4.1, acorn@^8.5.0, acorn@^8.7.1: - version "8.7.1" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.7.1.tgz#0197122c843d1bf6d0a5e83220a788f278f63c30" - integrity sha512-Xx54uLJQZ19lKygFXOWsscKUbsBZW0CPykPhVQdhIeIwrbPmJzqeASDInc8nKBnp/JT6igTs82qPXz069H8I/A== + version "8.8.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.8.0.tgz#88c0187620435c7f6015803f5539dae05a9dbea8" + integrity sha512-QOxyigPVrpZ2GXT+PFyZTl6TtOFc5egxHIP9IlQ+RbupQuX4RkT/Bee4/kQuC02Xkzg84JcT7oLYtDIQxp+v7w== add-stream@^1.0.0: version "1.0.0" @@ -4527,7 +4552,7 @@ agent-base@6, agent-base@^6.0.2: dependencies: debug "4" -agentkeepalive@^4.1.3, agentkeepalive@^4.2.1: +agentkeepalive@^4.2.1: version "4.2.1" resolved "https://registry.yarnpkg.com/agentkeepalive/-/agentkeepalive-4.2.1.tgz#a7975cbb9f83b367f06c90cc51ff28fe7d499717" integrity sha512-Zn4cw2NEqd+9fiSVWMscnjyQ1a8Yfoc5oBajLeo5w+YBHgDUcEBY2hS4YpTz6iN5f/2zQiktcuM6tS8x1p9dpA== @@ -4573,20 +4598,20 @@ ajv@^6.10.0, ajv@^6.12.2, ajv@^6.12.4, ajv@^6.12.5, ajv@~6.12.6: json-schema-traverse "^0.4.1" uri-js "^4.2.2" -ajv@^8.0.0, ajv@^8.8.0: - version "8.8.2" - resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.8.2.tgz#01b4fef2007a28bf75f0b7fc009f62679de4abbb" - integrity sha512-x9VuX+R/jcFj1DHo/fCp99esgGDWiHENrKxaCENuCxpoMCmAt/COCGVDwA7kleEpEzJjDnvh3yGoOuLu0Dtllw== +ajv@^8.0.0, ajv@^8.6.0, ajv@^8.8.0: + version "8.11.0" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.11.0.tgz#977e91dd96ca669f54a11e23e378e33b884a565f" + integrity sha512-wGgprdCvMalC0BztXvitD2hC04YffAvtsUn93JbGXYLAtCUO4xd17mCCZQxUOItiBwZvJScWo8NIvQMQ71rdpg== dependencies: fast-deep-equal "^3.1.1" json-schema-traverse "^1.0.0" require-from-string "^2.0.2" uri-js "^4.2.2" -algoliasearch-helper@^3.8.2: - version "3.8.2" - resolved "https://registry.yarnpkg.com/algoliasearch-helper/-/algoliasearch-helper-3.8.2.tgz#35726dc6d211f49dbab0bf6d37b4658165539523" - integrity sha512-AXxiF0zT9oYwl8ZBgU/eRXvfYhz7cBA5YrLPlw9inZHdaYF0QEya/f1Zp1mPYMXc1v6VkHwBq4pk6/vayBLICg== +algoliasearch-helper@^3.10.0: + version "3.10.0" + resolved "https://registry.yarnpkg.com/algoliasearch-helper/-/algoliasearch-helper-3.10.0.tgz#59a0f645dd3c7e55cf01faa568d1af50c49d36f6" + integrity sha512-4E4od8qWWDMVvQ3jaRX6Oks/k35ywD011wAA4LbYMMjOtaZV6VWaTjRr4iN2bdaXP2o1BP7SLFMBf3wvnHmd8Q== dependencies: "@algolia/events" "^4.0.1" @@ -4668,6 +4693,11 @@ ansi-styles@^6.0.0, ansi-styles@^6.1.0: resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-6.1.0.tgz#87313c102b8118abd57371afab34618bf7350ed3" integrity sha512-VbqNsoz55SYGczauuup0MFUyXNQviSpFTj1RQtFzmQLk18qbVSpTFFGMT293rmDaQuKCT6InmbuEyUne4mTuxQ== +any-promise@^1.0.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/any-promise/-/any-promise-1.3.0.tgz#abc6afeedcea52e809cdc0376aed3ce39635d17f" + integrity sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A== + anymatch@^3.0.3, anymatch@~3.1.2: version "3.1.2" resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.2.tgz#c0557c096af32f106198f4f4e2a383537e378716" @@ -4681,11 +4711,6 @@ anymatch@^3.0.3, anymatch@~3.1.2: resolved "https://registry.yarnpkg.com/aproba/-/aproba-2.0.0.tgz#52520b8ae5b569215b354efc0caa3fe1e45a8adc" integrity sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ== -arch@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/arch/-/arch-2.2.0.tgz#1bc47818f305764f23ab3306b0bfc086c5a29d11" - integrity sha512-Of/R0wqp83cgHozfIYLbBMnej79U/SVGOOyuB3VVFv1NRM/PSFMK12x9KVtiYzJqmnU5WR2qp0Z5rHb7sWGnFQ== - are-we-there-yet@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/are-we-there-yet/-/are-we-there-yet-3.0.0.tgz#ba20bd6b553e31d62fc8c31bd23d22b95734390d" @@ -4799,18 +4824,6 @@ asap@^2.0.0, asap@~2.0.3: resolved "https://registry.yarnpkg.com/asap/-/asap-2.0.6.tgz#e50347611d7e690943208bbdafebcbc2fb866d46" integrity sha1-5QNHYR1+aQlDIIu9r+vLwvuGbUY= -asn1@~0.2.3: - version "0.2.4" - resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.4.tgz#8d2475dfab553bb33e77b54e59e880bb8ce23136" - integrity sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg== - dependencies: - safer-buffer "~2.1.0" - -assert-plus@1.0.0, assert-plus@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525" - integrity sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU= - ast-types-flow@^0.0.7: version "0.0.7" resolved "https://registry.yarnpkg.com/ast-types-flow/-/ast-types-flow-0.0.7.tgz#f70b735c6bca1a5c9c22d982c3e39e7feba3bdad" @@ -4821,7 +4834,7 @@ astral-regex@^2.0.0: resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-2.0.0.tgz#483143c567aeed4785759c0865786dc77d7d2e31" integrity sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ== -async@^3.2.0, async@^3.2.3: +async@^3.2.3: version "3.2.3" resolved "https://registry.yarnpkg.com/async/-/async-3.2.3.tgz#ac53dafd3f4720ee9e8a160628f18ea91df196c9" integrity sha512-spZRyzKL5l5BZQrr/6m/SqFdBN0q3OCI0f9rjfBzCMBIP4p75P620rR3gTmaksNOhmzgdxcaxdNfMy6anrbM0g== @@ -4829,7 +4842,7 @@ async@^3.2.0, async@^3.2.3: asynckit@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" - integrity sha1-x57Zf380y48robyXkLzDZkdLS3k= + integrity sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q== at-least-node@^1.0.0: version "1.0.0" @@ -4848,22 +4861,12 @@ autoprefixer@^10.3.7, autoprefixer@^10.4.7: picocolors "^1.0.0" postcss-value-parser "^4.2.0" -aws-sign2@~0.7.0: - version "0.7.0" - resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.7.0.tgz#b46e890934a9591f2d2f6f86d7e6a9f1b3fe76a8" - integrity sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg= - -aws4@^1.8.0: - version "1.11.0" - resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.11.0.tgz#d61f46d83b2519250e2784daf5b09479a8b41c59" - integrity sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA== - -axe-core@^4.4.2: - version "4.4.2" - resolved "https://registry.yarnpkg.com/axe-core/-/axe-core-4.4.2.tgz#dcf7fb6dea866166c3eab33d68208afe4d5f670c" - integrity sha512-LVAaGp/wkkgYJcjmHsoKx4juT1aQvJyPcW09MLCjVTh3V2cc6PnyempiLMNH5iMdfIX/zdbjUx2KDjMLCTdPeA== +axe-core@^4.4.3: + version "4.4.3" + resolved "https://registry.yarnpkg.com/axe-core/-/axe-core-4.4.3.tgz#11c74d23d5013c0fa5d183796729bc3482bd2f6f" + integrity sha512-32+ub6kkdhhWick/UjvEwRchgoetXqTK14INLqbGm5U2TzBkBNF3nQtLYm8ovxSkQWArjEQvftCKryjZaATu3w== -axios@^0.21.1: +axios@^0.21.2: version "0.21.4" resolved "https://registry.yarnpkg.com/axios/-/axios-0.21.4.tgz#c67b90dc0568e5c1cf2b0b858c43ba28e2eda575" integrity sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg== @@ -4877,20 +4880,29 @@ axios@^0.25.0: dependencies: follow-redirects "^1.14.7" +axios@^1.0.0: + version "1.1.2" + resolved "https://registry.yarnpkg.com/axios/-/axios-1.1.2.tgz#8b6f6c540abf44ab98d9904e8daf55351ca4a331" + integrity sha512-bznQyETwElsXl2RK7HLLwb5GPpOLlycxHCtrpDR/4RqqBzjARaOTo3jz4IgtntWUYee7Ne4S8UHd92VCuzPaWA== + dependencies: + follow-redirects "^1.15.0" + form-data "^4.0.0" + proxy-from-env "^1.1.0" + axobject-query@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/axobject-query/-/axobject-query-2.2.0.tgz#943d47e10c0b704aa42275e20edf3722648989be" integrity sha512-Td525n+iPOOyUQIeBfcASuG6uJsDOITl7Mds5gFyerkWiX7qhUTdYUBlSgNMyVqtSJqwpt1kXGLdUt6SykLMRA== -babel-jest@^28.1.3: - version "28.1.3" - resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-28.1.3.tgz#c1187258197c099072156a0a121c11ee1e3917d5" - integrity sha512-epUaPOEWMk3cWX0M/sPvCHHCe9fMFAa/9hXEgKP8nFfNl/jlGkE9ucq9NqkZGXLDduCJYS0UvSlPUwC0S+rH6Q== +babel-jest@^29.1.2: + version "29.1.2" + resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-29.1.2.tgz#540d3241925c55240fb0c742e3ffc5f33a501978" + integrity sha512-IuG+F3HTHryJb7gacC7SQ59A9kO56BctUsT67uJHp1mMCHUOMXpDwOHWGifWqdWVknN2WNkCVQELPjXx0aLJ9Q== dependencies: - "@jest/transform" "^28.1.3" + "@jest/transform" "^29.1.2" "@types/babel__core" "^7.1.14" babel-plugin-istanbul "^6.1.1" - babel-preset-jest "^28.1.3" + babel-preset-jest "^29.0.2" chalk "^4.0.0" graceful-fs "^4.2.9" slash "^3.0.0" @@ -4938,39 +4950,54 @@ babel-plugin-istanbul@^6.1.1: istanbul-lib-instrument "^5.0.4" test-exclude "^6.0.0" -babel-plugin-jest-hoist@^28.1.3: - version "28.1.3" - resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-28.1.3.tgz#1952c4d0ea50f2d6d794353762278d1d8cca3fbe" - integrity sha512-Ys3tUKAmfnkRUpPdpa98eYrAR0nV+sSFUZZEGuQ2EbFd1y4SOLtD5QDNHAq+bb9a+bbXvYQC4b+ID/THIMcU6Q== +babel-plugin-jest-hoist@^29.0.2: + version "29.0.2" + resolved "https://registry.yarnpkg.com/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-29.0.2.tgz#ae61483a829a021b146c016c6ad39b8bcc37c2c8" + integrity sha512-eBr2ynAEFjcebVvu8Ktx580BD1QKCrBG1XwEUTXJe285p9HA/4hOhfWCFRQhTKSyBV0VzjhG7H91Eifz9s29hg== dependencies: "@babel/template" "^7.3.3" "@babel/types" "^7.3.3" "@types/babel__core" "^7.1.14" "@types/babel__traverse" "^7.0.6" -babel-plugin-polyfill-corejs2@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.3.0.tgz#407082d0d355ba565af24126fb6cb8e9115251fd" - integrity sha512-wMDoBJ6uG4u4PNFh72Ty6t3EgfA91puCuAwKIazbQlci+ENb/UU9A3xG5lutjUIiXCIn1CY5L15r9LimiJyrSA== +babel-plugin-polyfill-corejs2@^0.3.1, babel-plugin-polyfill-corejs2@^0.3.3: + version "0.3.3" + resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.3.3.tgz#5d1bd3836d0a19e1b84bbf2d9640ccb6f951c122" + integrity sha512-8hOdmFYFSZhqg2C/JgLUQ+t52o5nirNwaWM2B9LWteozwIvM14VSwdsCAUET10qT+kmySAlseadmfeeSWFCy+Q== + dependencies: + "@babel/compat-data" "^7.17.7" + "@babel/helper-define-polyfill-provider" "^0.3.3" + semver "^6.1.1" + +babel-plugin-polyfill-corejs3@^0.5.2: + version "0.5.3" + resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.5.3.tgz#d7e09c9a899079d71a8b670c6181af56ec19c5c7" + integrity sha512-zKsXDh0XjnrUEW0mxIHLfjBfnXSMr5Q/goMe/fxpQnLm07mcOZiIZHBNWCMx60HmdvjxfXcalac0tfFg0wqxyw== + dependencies: + "@babel/helper-define-polyfill-provider" "^0.3.2" + core-js-compat "^3.21.0" + +babel-plugin-polyfill-corejs3@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.6.0.tgz#56ad88237137eade485a71b52f72dbed57c6230a" + integrity sha512-+eHqR6OPcBhJOGgsIar7xoAB1GcSwVUA3XjAd7HJNzOXT4wv6/H7KIdA/Nc60cvUlDbKApmqNvD1B1bzOt4nyA== dependencies: - "@babel/compat-data" "^7.13.11" - "@babel/helper-define-polyfill-provider" "^0.3.0" - semver "^6.1.1" + "@babel/helper-define-polyfill-provider" "^0.3.3" + core-js-compat "^3.25.1" -babel-plugin-polyfill-corejs3@^0.5.0: - version "0.5.2" - resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.5.2.tgz#aabe4b2fa04a6e038b688c5e55d44e78cd3a5f72" - integrity sha512-G3uJih0XWiID451fpeFaYGVuxHEjzKTHtc9uGFEjR6hHrvNzeS/PX+LLLcetJcytsB5m4j+K3o/EpXJNb/5IEQ== +babel-plugin-polyfill-regenerator@^0.3.1: + version "0.3.1" + resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.3.1.tgz#2c0678ea47c75c8cc2fbb1852278d8fb68233990" + integrity sha512-Y2B06tvgHYt1x0yz17jGkGeeMr5FeKUu+ASJ+N6nB5lQ8Dapfg42i0OVrf8PNGJ3zKL4A23snMi1IRwrqqND7A== dependencies: "@babel/helper-define-polyfill-provider" "^0.3.1" - core-js-compat "^3.21.0" -babel-plugin-polyfill-regenerator@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.3.0.tgz#9ebbcd7186e1a33e21c5e20cae4e7983949533be" - integrity sha512-dhAPTDLGoMW5/84wkgwiLRwMnio2i1fUe53EuvtKMv0pn2p3S8OCoV1xAzfJPl0KOX7IB89s2ib85vbYiea3jg== +babel-plugin-polyfill-regenerator@^0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.4.1.tgz#390f91c38d90473592ed43351e801a9d3e0fd747" + integrity sha512-NtQGmyQDXjQqQ+IzRkBVwEOz9lQ4zxAQZgoAYEtU9dJjnl1Oc98qnN7jcp+bE7O7aYzVpavXE3/VKXNzUbh7aw== dependencies: - "@babel/helper-define-polyfill-provider" "^0.3.0" + "@babel/helper-define-polyfill-provider" "^0.3.3" babel-preset-current-node-syntax@^1.0.0: version "1.0.1" @@ -4990,12 +5017,12 @@ babel-preset-current-node-syntax@^1.0.0: "@babel/plugin-syntax-optional-chaining" "^7.8.3" "@babel/plugin-syntax-top-level-await" "^7.8.3" -babel-preset-jest@^28.1.3: - version "28.1.3" - resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-28.1.3.tgz#5dfc20b99abed5db994406c2b9ab94c73aaa419d" - integrity sha512-L+fupJvlWAHbQfn74coNX3zf60LXMJsezNvvx8eIh7iOR1luJ1poxYgQk1F8PYtNq/6QODDHCqsSnTFSWC491A== +babel-preset-jest@^29.0.2: + version "29.0.2" + resolved "https://registry.yarnpkg.com/babel-preset-jest/-/babel-preset-jest-29.0.2.tgz#e14a7124e22b161551818d89e5bdcfb3b2b0eac7" + integrity sha512-BeVXp7rH5TK96ofyEnHjznjLMQ2nAeDJ+QzxKnHAAMs0RgrQsCywjAN8m4mOm5Di0pxU//3AoEeJJrerMH5UeA== dependencies: - babel-plugin-jest-hoist "^28.1.3" + babel-plugin-jest-hoist "^29.0.2" babel-preset-current-node-syntax "^1.0.0" bail@^1.0.0: @@ -5023,13 +5050,6 @@ batch@0.6.1: resolved "https://registry.yarnpkg.com/batch/-/batch-0.6.1.tgz#dc34314f4e679318093fc760272525f94bf25c16" integrity sha1-3DQxT05nkxgJP8dgJyUl+UvyXBY= -bcrypt-pbkdf@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz#a4301d389b6a43f9b67ff3ca11a3f6637e360e9e" - integrity sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4= - dependencies: - tweetnacl "^0.14.3" - before-after-hook@^2.2.0: version "2.2.2" resolved "https://registry.yarnpkg.com/before-after-hook/-/before-after-hook-2.2.2.tgz#a6e8ca41028d90ee2c24222f201c90956091613e" @@ -5057,7 +5077,7 @@ binary-extensions@^2.0.0: resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.2.0.tgz#75f502eeaf9ffde42fc98829645be4ea76bd9e2d" integrity sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA== -bl@^4.0.3: +bl@^4.0.3, bl@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/bl/-/bl-4.1.0.tgz#451535264182bec2fbbc83a62ab98cf11d9f7b3a" integrity sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w== @@ -5066,16 +5086,6 @@ bl@^4.0.3: inherits "^2.0.4" readable-stream "^3.4.0" -blob-util@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/blob-util/-/blob-util-2.0.2.tgz#3b4e3c281111bb7f11128518006cdc60b403a1eb" - integrity sha512-T7JQa+zsXXEa6/8ZhHcQEW1UFfVM49Ts65uBkFL6fz2QmrElqmbajIDJvuA0tEhRe5eIjpV9ZF+0RfZR9voJFQ== - -bluebird@^3.7.1, bluebird@^3.7.2: - version "3.7.2" - resolved "https://registry.yarnpkg.com/bluebird/-/bluebird-3.7.2.tgz#9f229c15be272454ffa973ace0dbee79a1b0c36f" - integrity sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg== - body-parser@1.20.0: version "1.20.0" resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.20.0.tgz#3de69bd89011c11573d7bfee6a64f11b6bd27cc5" @@ -5104,7 +5114,7 @@ bonjour-service@^1.0.11: fast-deep-equal "^3.1.3" multicast-dns "^7.2.4" -boolbase@^1.0.0, boolbase@~1.0.0: +boolbase@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/boolbase/-/boolbase-1.0.0.tgz#68dff5fbe60c51eb37725ea9e3ed310dcc1e776e" integrity sha1-aN/1++YMUes3cl6p4+0xDcwed24= @@ -5159,16 +5169,15 @@ braces@^3.0.2, braces@~3.0.2: dependencies: fill-range "^7.0.1" -browserslist@^4.0.0, browserslist@^4.14.5, browserslist@^4.16.6, browserslist@^4.18.1, browserslist@^4.20.2, browserslist@^4.20.3: - version "4.20.3" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.20.3.tgz#eb7572f49ec430e054f56d52ff0ebe9be915f8bf" - integrity sha512-NBhymBQl1zM0Y5dQT/O+xiLP9/rzOIQdKM/eMJBAq7yBgaB6krIYLGejrwVYnSHZdqjscB1SPuAjHwxjvN6Wdg== +browserslist@^4.0.0, browserslist@^4.14.5, browserslist@^4.16.6, browserslist@^4.18.1, browserslist@^4.20.3, browserslist@^4.21.3, browserslist@^4.21.4: + version "4.21.4" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.21.4.tgz#e7496bbc67b9e39dd0f98565feccdcb0d4ff6987" + integrity sha512-CBHJJdDmgjl3daYjN5Cp5kbTf1mUhZoS+beLklHIvkOWscs83YAhLlF3Wsh/lciQYAcbBJgTOD44VtG31ZM4Hw== dependencies: - caniuse-lite "^1.0.30001332" - electron-to-chromium "^1.4.118" - escalade "^3.1.1" - node-releases "^2.0.3" - picocolors "^1.0.0" + caniuse-lite "^1.0.30001400" + electron-to-chromium "^1.4.251" + node-releases "^2.0.6" + update-browserslist-db "^1.0.9" bser@2.1.1: version "2.1.1" @@ -5177,11 +5186,6 @@ bser@2.1.1: dependencies: node-int64 "^0.4.0" -buffer-crc32@~0.2.3: - version "0.2.13" - resolved "https://registry.yarnpkg.com/buffer-crc32/-/buffer-crc32-0.2.13.tgz#0d333e3f00eac50aa1454abd30ef8c2a5d9a7242" - integrity sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI= - buffer-from@^1.0.0: version "1.1.2" resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.2.tgz#2b146a6fd72e80b4f55d255f35ed59a3a9a41bd5" @@ -5200,10 +5204,10 @@ builtin-modules@^1.1.1: resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f" integrity sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8= -builtin-modules@^3.0.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-3.2.0.tgz#45d5db99e7ee5e6bc4f362e008bf917ab5049887" - integrity sha512-lGzLKcioL90C7wMczpkY0n/oART3MbBa8R9OFGE1rJxoVI86u4WAGfEk8Wjv10eKSyTHVGkSo3bvBylCEtk7LA== +builtin-modules@^3.1.0, builtin-modules@^3.3.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-3.3.0.tgz#cae62812b89801e9656336e46223e030386be7b6" + integrity sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw== builtins@^1.0.3: version "1.0.3" @@ -5232,30 +5236,6 @@ bytes@3.1.2: resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.2.tgz#8b0beeb98605adf1b128fa4386403c009e0221a5" integrity sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg== -cacache@^15.0.5, cacache@^15.2.0: - version "15.3.0" - resolved "https://registry.yarnpkg.com/cacache/-/cacache-15.3.0.tgz#dc85380fb2f556fe3dda4c719bfa0ec875a7f1eb" - integrity sha512-VVdYzXEn+cnbXpFgWs5hTT7OScegHVmLhJIR8Ufqk3iFD6A6j5iSX1KuBTfNEv4tdJWE2PzA6IVFtcLC7fN9wQ== - dependencies: - "@npmcli/fs" "^1.0.0" - "@npmcli/move-file" "^1.0.1" - chownr "^2.0.0" - fs-minipass "^2.0.0" - glob "^7.1.4" - infer-owner "^1.0.4" - lru-cache "^6.0.0" - minipass "^3.1.1" - minipass-collect "^1.0.2" - minipass-flush "^1.0.5" - minipass-pipeline "^1.2.2" - mkdirp "^1.0.3" - p-map "^4.0.0" - promise-inflight "^1.0.1" - rimraf "^3.0.2" - ssri "^8.0.1" - tar "^6.0.2" - unique-filename "^1.1.1" - cacache@^16.0.0, cacache@^16.0.6, cacache@^16.1.0: version "16.1.0" resolved "https://registry.yarnpkg.com/cacache/-/cacache-16.1.0.tgz#87a6bae558a511c9cb2a13768073e240ca76153a" @@ -5293,11 +5273,6 @@ cacheable-request@^6.0.0: normalize-url "^4.1.0" responselike "^1.0.2" -cachedir@^2.3.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/cachedir/-/cachedir-2.3.0.tgz#0c75892a052198f0b21c7c1804d8331edfcae0e8" - integrity sha512-A+Fezp4zxnit6FanDmv9EqXNAi3vt9DWp51/71UEhXukb7QUuvtv9344h91dyAxuTLoSYJFU299qzR3tzwPAhw== - call-bind@^1.0.0, call-bind@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.2.tgz#b1d4e89e688119c3c9a903ad30abb2f6a919be3c" @@ -5306,6 +5281,11 @@ call-bind@^1.0.0, call-bind@^1.0.2: function-bind "^1.1.1" get-intrinsic "^1.0.2" +call-me-maybe@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/call-me-maybe/-/call-me-maybe-1.0.1.tgz#26d208ea89e37b5cbde60250a15f031c16a4d66b" + integrity sha512-wCyFsDQkKPwwF8BDwOiWNx/9K45L/hvggQiDbve+viMNMQnWhrlYIuBk09offfwCRtCO9P6XwUttufzU11WCVw== + callsites@^3.0.0, callsites@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" @@ -5353,29 +5333,16 @@ caniuse-api@^3.0.0: lodash.memoize "^4.1.2" lodash.uniq "^4.5.0" -caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001332, caniuse-lite@^1.0.30001335: - version "1.0.30001339" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001339.tgz#f9aece4ea8156071613b27791547ba0b33f176cf" - integrity sha512-Es8PiVqCe+uXdms0Gu5xP5PF2bxLR7OBp3wUzUnuO7OHzhOfCyg3hdiGWVPVxhiuniOzng+hTc1u3fEQ0TlkSQ== - -caseless@~0.12.0: - version "0.12.0" - resolved "https://registry.yarnpkg.com/caseless/-/caseless-0.12.0.tgz#1b681c21ff84033c826543090689420d187151dc" - integrity sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw= +caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001335, caniuse-lite@^1.0.30001400: + version "1.0.30001414" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001414.tgz#5f1715e506e71860b4b07c50060ea6462217611e" + integrity sha512-t55jfSaWjCdocnFdKQoO+d2ct9C59UZg4dY3OnUlSZ447r8pUtIKdp0hpAzrGFultmTC+Us+KpKi4GZl/LXlFg== -ccount@^1.0.0, ccount@^1.0.3: +ccount@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/ccount/-/ccount-1.1.0.tgz#246687debb6014735131be8abab2d93898f8d043" integrity sha512-vlNK021QdI7PNeiUh/lKkC/mNHHfV0m/Ad5JoI0TYtlBnJAslM/JIkm/tGC88bkLIwO6OQ5uV6ztS6kVAtCDlg== -chalk@4, chalk@^4.0.0, chalk@^4.0.2, chalk@^4.1.0, chalk@^4.1.2: - version "4.1.2" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" - integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== - dependencies: - ansi-styles "^4.1.0" - supports-color "^7.1.0" - chalk@4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.0.tgz#4e14870a618d9e2edd97dd8345fd9d9dc315646a" @@ -5384,7 +5351,7 @@ chalk@4.1.0: ansi-styles "^4.1.0" supports-color "^7.1.0" -chalk@^2.0.0, chalk@^2.3.0: +chalk@^2.0.0, chalk@^2.3.0, chalk@^2.4.2: version "2.4.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== @@ -5393,6 +5360,14 @@ chalk@^2.0.0, chalk@^2.3.0: escape-string-regexp "^1.0.5" supports-color "^5.3.0" +chalk@^4.0.0, chalk@^4.0.2, chalk@^4.1.0, chalk@^4.1.1, chalk@^4.1.2: + version "4.1.2" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" + integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== + dependencies: + ansi-styles "^4.1.0" + supports-color "^7.1.0" + chalk@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/chalk/-/chalk-5.0.1.tgz#ca57d71e82bb534a296df63bbacc4a1c22b2a4b6" @@ -5423,11 +5398,6 @@ chardet@^0.7.0: resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e" integrity sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA== -check-more-types@^2.24.0: - version "2.24.0" - resolved "https://registry.yarnpkg.com/check-more-types/-/check-more-types-2.24.0.tgz#1420ffb10fd444dcfc79b43891bbfffd32a84600" - integrity sha1-FCD/sQ/URNz8ebQ4kbv//TKoRgA= - cheerio-select@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/cheerio-select/-/cheerio-select-2.1.0.tgz#4d8673286b8126ca2a8e42740d5e3c4884ae21b4" @@ -5440,32 +5410,10 @@ cheerio-select@^2.1.0: domhandler "^5.0.3" domutils "^3.0.1" -cheerio@^0.22.0: - version "0.22.0" - resolved "https://registry.yarnpkg.com/cheerio/-/cheerio-0.22.0.tgz#a9baa860a3f9b595a6b81b1a86873121ed3a269e" - integrity sha1-qbqoYKP5tZWmuBsahocxIe06Jp4= - dependencies: - css-select "~1.2.0" - dom-serializer "~0.1.0" - entities "~1.1.1" - htmlparser2 "^3.9.1" - lodash.assignin "^4.0.9" - lodash.bind "^4.1.4" - lodash.defaults "^4.0.1" - lodash.filter "^4.4.0" - lodash.flatten "^4.2.0" - lodash.foreach "^4.3.0" - lodash.map "^4.4.0" - lodash.merge "^4.4.0" - lodash.pick "^4.2.1" - lodash.reduce "^4.4.0" - lodash.reject "^4.4.0" - lodash.some "^4.4.0" - -cheerio@^1.0.0-rc.11: - version "1.0.0-rc.11" - resolved "https://registry.yarnpkg.com/cheerio/-/cheerio-1.0.0-rc.11.tgz#1be84be1a126958366bcc57a11648cd9b30a60c2" - integrity sha512-bQwNaDIBKID5ts/DsdhxrjqFXYfLw4ste+wMKqWA8DyKcS4qwsPP4Bk8ZNaTJjvpiX/qW3BT4sU7d6Bh5i+dag== +cheerio@^1.0.0-rc.12: + version "1.0.0-rc.12" + resolved "https://registry.yarnpkg.com/cheerio/-/cheerio-1.0.0-rc.12.tgz#788bf7466506b1c6bf5fae51d24a2c4d62e47683" + integrity sha512-VqR8m68vM46BNnuZ5NtnGBKIE/DfN0cRIzg9n40EIq9NOv90ayxLBXA8fXC5gquFRGJSTRqBq25Jt2ECLR431Q== dependencies: cheerio-select "^2.1.0" dom-serializer "^2.0.0" @@ -5474,7 +5422,6 @@ cheerio@^1.0.0-rc.11: htmlparser2 "^8.0.1" parse5 "^7.0.0" parse5-htmlparser2-tree-adapter "^7.0.0" - tslib "^2.4.0" chokidar@^3.4.2, chokidar@^3.5.1, chokidar@^3.5.3: version "3.5.3" @@ -5506,7 +5453,7 @@ ci-info@^2.0.0: resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-2.0.0.tgz#67a9e964be31a51e15e5010d58e6f12834002f46" integrity sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ== -ci-info@^3.1.1, ci-info@^3.2.0: +ci-info@^3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-3.2.0.tgz#2876cb948a498797b5236f0095bc057d0dca38b6" integrity sha512-dVqRX7fLUm8J6FgHJ418XuIgDLZDkYcDFTeL6TA2gt5WlIZUQrrH6EZrNClwT/H0FateUsZkGIOPRrLbP+PR9A== @@ -5546,6 +5493,17 @@ cli-boxes@^3.0.0: resolved "https://registry.yarnpkg.com/cli-boxes/-/cli-boxes-3.0.0.tgz#71a10c716feeba005e4504f36329ef0b17cf3145" integrity sha512-/lzGpEWL/8PfI0BmBOPRwp0c/wFNX1RdUML3jK/RcSBA9T8mZDdQpqYBKtCFTOfQbwPqWEOpjqW+Fnayc0969g== +cli-color@^2.0.2: + version "2.0.3" + resolved "https://registry.yarnpkg.com/cli-color/-/cli-color-2.0.3.tgz#73769ba969080629670f3f2ef69a4bf4e7cc1879" + integrity sha512-OkoZnxyC4ERN3zLzZaY9Emb7f/MhBOIpePv0Ycok0fJYT+Ouo00UBEIwsVsr0yoow++n5YWlSUgST9GKhNHiRQ== + dependencies: + d "^1.0.1" + es5-ext "^0.10.61" + es6-iterator "^2.0.3" + memoizee "^0.4.15" + timers-ext "^0.1.7" + cli-cursor@3.1.0, cli-cursor@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-3.1.0.tgz#264305a7ae490d1d03bf0c9ba7c925d1753af307" @@ -5558,7 +5516,12 @@ cli-spinners@2.6.1: resolved "https://registry.yarnpkg.com/cli-spinners/-/cli-spinners-2.6.1.tgz#adc954ebe281c37a6319bfa401e6dd2488ffb70d" integrity sha512-x/5fWmGMnbKQAaNwN+UZlV79qBLM9JFnJuJ03gIi5whrob0xV0ofNVHy9DhwGdsMJQc2OKv0oGmLzvaqvAVv+g== -cli-table3@^0.6.2, cli-table3@~0.6.0: +cli-spinners@^2.5.0: + version "2.7.0" + resolved "https://registry.yarnpkg.com/cli-spinners/-/cli-spinners-2.7.0.tgz#f815fd30b5f9eaac02db604c7a231ed7cb2f797a" + integrity sha512-qu3pN8Y3qHNgE2AFweciB1IfMnmZ/fsNTEE+NOFjmGB2F/7rLhnhzppvpCnN4FovtP26k8lHyy9ptEbNwWFLzw== + +cli-table3@^0.6.2: version "0.6.2" resolved "https://registry.yarnpkg.com/cli-table3/-/cli-table3-0.6.2.tgz#aaf5df9d8b5bf12634dc8b3040806a0c07120d2a" integrity sha512-QyavHCaIC80cMivimWu4aWHilIpiDpfm3hGmqAmXVL1UsnbLuBSMd21hTX6VY4ZSDSM73ESLeF8TOYId3rBTbw== @@ -5597,6 +5560,15 @@ cliui@^7.0.2: strip-ansi "^6.0.0" wrap-ansi "^7.0.0" +cliui@^8.0.1: + version "8.0.1" + resolved "https://registry.yarnpkg.com/cliui/-/cliui-8.0.1.tgz#0c04b075db02cbfe60dc8e6cf2f5486b1a3608aa" + integrity sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ== + dependencies: + string-width "^4.2.0" + strip-ansi "^6.0.1" + wrap-ansi "^7.0.0" + clone-deep@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/clone-deep/-/clone-deep-4.0.1.tgz#c19fd9bdbbf85942b4fd979c84dcf7d5f07c2387" @@ -5618,18 +5590,11 @@ clone@^1.0.2: resolved "https://registry.yarnpkg.com/clone/-/clone-1.0.4.tgz#da309cc263df15994c688ca902179ca3c7cd7c7e" integrity sha1-2jCcwmPfFZlMaIypAheco8fNfH4= -clsx@^1.1.1: +clsx@^1.1.1, clsx@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/clsx/-/clsx-1.2.1.tgz#0ddc4a20a549b59c93a4116bb26f5294ca17dc12" integrity sha512-EcR6r5a8bj6pu3ycsa/E/cKVGuTgZJZdsyUYHOksG/UHIiKfjxzRxYJpyVBwYaQeOvghal9fcc4PidlgzugAQg== -cmd-shim@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/cmd-shim/-/cmd-shim-4.1.0.tgz#b3a904a6743e9fede4148c6f3800bf2a08135bdd" - integrity sha512-lb9L7EM4I/ZRVuljLPEtUJOP+xiQVknZ4ZMpMgEp4JzNldPb27HU03hi6K1/6CoIuit/Zm/LQXySErFeXxDprw== - dependencies: - mkdirp-infer-owner "^2.0.0" - cmd-shim@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/cmd-shim/-/cmd-shim-5.0.0.tgz#8d0aaa1a6b0708630694c4dbde070ed94c707724" @@ -5709,7 +5674,7 @@ combine-promises@^1.1.0: resolved "https://registry.yarnpkg.com/combine-promises/-/combine-promises-1.1.0.tgz#72db90743c0ca7aab7d0d8d2052fd7b0f674de71" integrity sha512-ZI9jvcLDxqwaXEixOhArm3r7ReIivsXkpbyEWyeOhzz1QS0iSgBPnWvEqvIQtYyamGCYA88gFhmUrs9hrrQ0pg== -combined-stream@^1.0.6, combined-stream@~1.0.6: +combined-stream@^1.0.8: version "1.0.8" resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== @@ -5741,20 +5706,15 @@ commander@^8.3.0: resolved "https://registry.yarnpkg.com/commander/-/commander-8.3.0.tgz#4837ea1b2da67b9c616a67afbb0fafee567bca66" integrity sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww== -commander@^9.2.0, commander@^9.3.0: - version "9.3.0" - resolved "https://registry.yarnpkg.com/commander/-/commander-9.3.0.tgz#f619114a5a2d2054e0d9ff1b31d5ccf89255e26b" - integrity sha512-hv95iU5uXPbK83mjrJKuZyFM/LBAoCV/XhVGkS5Je6tl7sxr6A0ITMw5WoRV46/UaJ46Nllm3Xt7IaJhXTIkzw== - -commander@~9.0.0: - version "9.0.0" - resolved "https://registry.yarnpkg.com/commander/-/commander-9.0.0.tgz#86d58f24ee98126568936bd1d3574e0308a99a40" - integrity sha512-JJfP2saEKbQqvW+FI93OYUB4ByV5cizMpFMiiJI8xDbBvQvSkIk0VvQdn1CZ8mqAO8Loq2h0gYTYtDFUZUeERw== +commander@^9.3.0, commander@^9.4.0, commander@~9.4.1: + version "9.4.1" + resolved "https://registry.yarnpkg.com/commander/-/commander-9.4.1.tgz#d1dd8f2ce6faf93147295c0df13c7c21141cfbdd" + integrity sha512-5EEkTNyHNGFPD2H+c/dXXfQZYa/scCKasxWcXJaWnNJ99pnQN9Vnmqow+p+PlFPE63Q6mThaZws1T+HxfpgtPw== -comment-json@^4.2.2: - version "4.2.2" - resolved "https://registry.yarnpkg.com/comment-json/-/comment-json-4.2.2.tgz#5fae70a94e0c8f84a077bd31df5aa5269252f293" - integrity sha512-H8T+kl3nZesZu41zO2oNXIJWojNeK3mHxCLrsBNu6feksBXsgb+PtYz5daP5P86A0F3sz3840KVYehr04enISQ== +comment-json@^4.2.3: + version "4.2.3" + resolved "https://registry.yarnpkg.com/comment-json/-/comment-json-4.2.3.tgz#50b487ebbf43abe44431f575ebda07d30d015365" + integrity sha512-SsxdiOf064DWoZLH799Ata6u7iV658A11PlWtZATDlXPpKGJnbJZ5Z24ybixAi+LUUqJ/GKowAejtC5GFUG7Tw== dependencies: array-timsort "^1.0.3" core-util-is "^1.0.3" @@ -5840,10 +5800,10 @@ configstore@^5.0.1: write-file-atomic "^3.0.0" xdg-basedir "^4.0.0" -connect-history-api-fallback@^1.6.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/connect-history-api-fallback/-/connect-history-api-fallback-1.6.0.tgz#8b32089359308d111115d81cad3fceab888f97bc" - integrity sha512-e54B99q/OUoH64zYYRf3HBP5z24G38h5D3qXu23JGRoigpX5Ss4r9ZnDk3g0Z8uQC2x2lPaJ+UlWBc1ZWBWdLg== +connect-history-api-fallback@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/connect-history-api-fallback/-/connect-history-api-fallback-2.0.0.tgz#647264845251a0daf25b97ce87834cace0f5f1c8" + integrity sha512-U73+6lQFmfiNPrYbXqr6kZ1i1wiRqXnp2nhMsINseWXO8lDau0LGEffJ8kQi4EjLZympVgRdvqjAgiZ1tgzDDA== consola@^2.15.3: version "2.15.3" @@ -5855,6 +5815,11 @@ console-control-strings@^1.1.0: resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e" integrity sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4= +console-fail-test@^0.1.7: + version "0.1.7" + resolved "https://registry.yarnpkg.com/console-fail-test/-/console-fail-test-0.1.7.tgz#f21ee5f944fb42c0d176a56c5b4744cb2f8d86c8" + integrity sha512-WZ9unWXJSqDGMt/06wOSPNHwAIAdIJvhgSD2MepJHG5B7b3PD3b8q0NMpaqegGmGFgZUiru+0xEsyvpvg/CM+A== + content-disposition@0.5.2: version "0.5.2" resolved "https://registry.yarnpkg.com/content-disposition/-/content-disposition-0.5.2.tgz#0cf68bb9ddf5f2be7961c3a85178cb85dba78cb4" @@ -5880,7 +5845,7 @@ conventional-changelog-angular@^5.0.12: compare-func "^2.0.0" q "^1.5.1" -conventional-changelog-core@^4.2.2: +conventional-changelog-core@^4.2.4: version "4.2.4" resolved "https://registry.yarnpkg.com/conventional-changelog-core/-/conventional-changelog-core-4.2.4.tgz#e50d047e8ebacf63fac3dc67bf918177001e1e9f" integrity sha512-gDVS+zVJHE2v4SLc6B0sLsPiloR0ygU7HaDW14aNJE1v4SlqJPILPl/aJC7YdtRE4CybBf8gDwObBvKha8Xlyg== @@ -5988,28 +5953,22 @@ copy-webpack-plugin@^11.0.0: schema-utils "^4.0.0" serialize-javascript "^6.0.0" -core-js-compat@^3.21.0, core-js-compat@^3.22.1: - version "3.22.5" - resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.22.5.tgz#7fffa1d20cb18405bd22756ca1353c6f1a0e8614" - integrity sha512-rEF75n3QtInrYICvJjrAgV03HwKiYvtKHdPtaba1KucG+cNZ4NJnH9isqt979e67KZlhpbCOTwnsvnIr+CVeOg== +core-js-compat@^3.21.0, core-js-compat@^3.25.1: + version "3.25.4" + resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.25.4.tgz#730a255d4a47a937513abf1672bf278dc24dcebf" + integrity sha512-gCEcIEEqCR6230WroNunK/653CWKhqyCKJ9b+uESqOt/WFJA8B4lTnnQFdpYY5vmBcwJAA90Bo5vXs+CVsf6iA== dependencies: - browserslist "^4.20.3" - semver "7.0.0" + browserslist "^4.21.4" core-js-pure@^3.20.2: version "3.21.1" resolved "https://registry.yarnpkg.com/core-js-pure/-/core-js-pure-3.21.1.tgz#8c4d1e78839f5f46208de7230cebfb72bc3bdb51" integrity sha512-12VZfFIu+wyVbBebyHmRTuEE/tZrB4tJToWcwAMcsp3h4+sHR+fMJWbKpYiCRWlhFBq+KNyO8rIV9rTkeVmznQ== -core-js@^3.22.7: - version "3.22.7" - resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.22.7.tgz#8d6c37f630f6139b8732d10f2c114c3f1d00024f" - integrity sha512-Jt8SReuDKVNZnZEzyEQT5eK6T2RRCXkfTq7Lo09kpm+fHjgGewSbNjV+Wt4yZMhPDdzz2x1ulI5z/w4nxpBseg== - -core-util-is@1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" - integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac= +core-js@^3.23.3: + version "3.24.0" + resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.24.0.tgz#4928d4e99c593a234eb1a1f9abd3122b04d3ac57" + integrity sha512-IeOyT8A6iK37Ep4kZDD423mpi6JfPRoPUdQwEWYiGolvn4o6j2diaRzNfDfpTdu3a5qMbrGUzKUpYpRY8jXCkQ== core-util-is@^1.0.3, core-util-is@~1.0.0: version "1.0.3" @@ -6057,7 +6016,18 @@ cross-fetch@^3.0.4, cross-fetch@^3.1.5: dependencies: node-fetch "2.6.7" -cross-spawn@^7.0.0, cross-spawn@^7.0.1, cross-spawn@^7.0.2, cross-spawn@^7.0.3: +cross-spawn@^6.0.5: + version "6.0.5" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4" + integrity sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ== + dependencies: + nice-try "^1.0.4" + path-key "^2.0.1" + semver "^5.5.0" + shebang-command "^1.2.0" + which "^1.2.9" + +cross-spawn@^7.0.1, cross-spawn@^7.0.2, cross-spawn@^7.0.3: version "7.0.3" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== @@ -6071,85 +6041,110 @@ crypto-random-string@^2.0.0: resolved "https://registry.yarnpkg.com/crypto-random-string/-/crypto-random-string-2.0.0.tgz#ef2a7a966ec11083388369baa02ebead229b30d5" integrity sha512-v1plID3y9r/lPhviJ1wrXpLeyUIGAZ2SHNYTEapm7/8A9nLPoyvVp3RK/EPFqn5kEznyWgYZNsRtYYIWbuG8KA== -cspell-gitignore@^5.20.0: - version "5.20.0" - resolved "https://registry.yarnpkg.com/cspell-gitignore/-/cspell-gitignore-5.20.0.tgz#0c4f405559383663a9c24fab5cf829e7b19abed5" - integrity sha512-oWzoHcaidX6jFON6vwiH3cA1HqkGmawD1DWt+fPWKrea9/SuTcvFxm+RbqO4DjwXEAMIczyPOWo+SCM0VbcCrA== +cspell-dictionary@^6.12.0: + version "6.12.0" + resolved "https://registry.yarnpkg.com/cspell-dictionary/-/cspell-dictionary-6.12.0.tgz#5d9e5c0fa5a44403400bb7e3f36b137222aaaa84" + integrity sha512-I2cXSdXndt9H7yXmJzLTjgui/SAPGghXwxFeibTbvF68gyQYD5fUXvOygEIPrOEySKlAIb+aouV77SgoURxMHw== + dependencies: + "@cspell/cspell-pipe" "^6.12.0" + "@cspell/cspell-types" "^6.12.0" + cspell-trie-lib "^6.12.0" + fast-equals "^4.0.3" + gensequence "^4.0.2" + +cspell-gitignore@^6.12.0: + version "6.12.0" + resolved "https://registry.yarnpkg.com/cspell-gitignore/-/cspell-gitignore-6.12.0.tgz#148215fb9251bc04fca9ad5a8f2cc11eaec75b71" + integrity sha512-gtsN2AAvqdE8CHVzpxsQcd/Wn5GAMTjzHpDXX71g/k8IJn743poGU06O0O1WSVAgK0fWTRsfg+V5OegA1TAo7A== dependencies: - cspell-glob "^5.20.0" + cspell-glob "^6.12.0" find-up "^5.0.0" -cspell-glob@^5.20.0: - version "5.20.0" - resolved "https://registry.yarnpkg.com/cspell-glob/-/cspell-glob-5.20.0.tgz#2bda5cc90bc6694ce2eb1a5aaee54196fc9b37a9" - integrity sha512-eyo8NYH4GapHxfilMarwvf1HIyGWT3gWuFlYkmQjYVx3KjzmfR1Y1x9S068wmwjp9kKCu9T6Vj71EGG+9R59Lw== +cspell-glob@^6.12.0: + version "6.12.0" + resolved "https://registry.yarnpkg.com/cspell-glob/-/cspell-glob-6.12.0.tgz#7ed9d672d429d48fb272d1f5a2c5c6001da05d40" + integrity sha512-Q0rMGTxDyFFPm1LmHYM0ziuxQt2aXgr8Oi1glA2s0dBs0hg1DexlAEoLwLiMDUwSTvibEKIidPzlrmZ1AUDWEg== dependencies: micromatch "^4.0.5" -cspell-io@^5.20.0: - version "5.20.0" - resolved "https://registry.yarnpkg.com/cspell-io/-/cspell-io-5.20.0.tgz#2f7fc676a068acc641f3bd77ddca7f72985b6ee5" - integrity sha512-wgqqpVIhtMh+/+3YfHt8cDfrD7OLF+xQlStlURj8AJwEJ0xu16zyI9S5zcig+83+0QyzuMdxfZiMgbdQxWEvOg== +cspell-grammar@^6.12.0: + version "6.12.0" + resolved "https://registry.yarnpkg.com/cspell-grammar/-/cspell-grammar-6.12.0.tgz#4fda96fcf0da62fe6f72abce2f27389d95d12cd2" + integrity sha512-WXcDiWJ2pTW0jHY0Bf0DW5s8A9S0a+2tsVZsNxE/0CR5P/8yDSnznE+59uok/JN+GXOKQ6VIaqAZA3/XjDZuuA== + dependencies: + "@cspell/cspell-pipe" "^6.12.0" + "@cspell/cspell-types" "^6.12.0" + +cspell-io@^6.12.0: + version "6.12.0" + resolved "https://registry.yarnpkg.com/cspell-io/-/cspell-io-6.12.0.tgz#318052ffa30d801b40fa8af81d9865ec4a5e68ea" + integrity sha512-1faxDj2OMgq61w7GaiXZD7ytks6PksJlG484LMl2USv58jDky4i2lujJs1C/+aP97Box9EcdwzydHX9GpnqqCw== + dependencies: + "@cspell/cspell-service-bus" "^6.12.0" + node-fetch "^2.6.7" -cspell-lib@^5.20.0: - version "5.20.0" - resolved "https://registry.yarnpkg.com/cspell-lib/-/cspell-lib-5.20.0.tgz#0eb5797cb32ce03db7ad7e14649296c434e3d142" - integrity sha512-Fc7+3ExF2pNS8BsQTXSMkhR6ITbpyiMQf+y4ZH/aBml09+O6lrbj4j2tJx/oR4XvDEA8uQkV/5lMGdU+otC1KQ== +cspell-lib@^6.12.0: + version "6.12.0" + resolved "https://registry.yarnpkg.com/cspell-lib/-/cspell-lib-6.12.0.tgz#fe68a887e3e83688c4133f2fa1420e0569d5dd3f" + integrity sha512-IKd2MzH/zoiXohc26Lqb1b8i+41Y2xGreyAe9ihv/7Z2dscGGVy7F/2taZvZK9kJIhaz33Yatxfx3htT6w0hqg== dependencies: - "@cspell/cspell-bundled-dicts" "^5.20.0" - "@cspell/cspell-pipe" "^5.20.0" - "@cspell/cspell-types" "^5.20.0" + "@cspell/cspell-bundled-dicts" "^6.12.0" + "@cspell/cspell-pipe" "^6.12.0" + "@cspell/cspell-types" "^6.12.0" clear-module "^4.1.2" - comment-json "^4.2.2" + comment-json "^4.2.3" configstore "^5.0.1" cosmiconfig "^7.0.1" - cspell-glob "^5.20.0" - cspell-io "^5.20.0" - cspell-trie-lib "^5.20.0" - fast-equals "^3.0.2" + cspell-dictionary "^6.12.0" + cspell-glob "^6.12.0" + cspell-grammar "^6.12.0" + cspell-io "^6.12.0" + cspell-trie-lib "^6.12.0" + fast-equals "^4.0.3" find-up "^5.0.0" fs-extra "^10.1.0" - gensequence "^3.1.1" + gensequence "^4.0.2" import-fresh "^3.3.0" resolve-from "^5.0.0" resolve-global "^1.0.0" - vscode-languageserver-textdocument "^1.0.4" - vscode-uri "^3.0.3" + vscode-languageserver-textdocument "^1.0.7" + vscode-uri "^3.0.6" -cspell-trie-lib@^5.20.0: - version "5.20.0" - resolved "https://registry.yarnpkg.com/cspell-trie-lib/-/cspell-trie-lib-5.20.0.tgz#3a13ba0477a36ecb16311e85b270bcc2b4300f37" - integrity sha512-ET95dJh+OJ04PdLI9dKqAa+dDu47tXcUxCR6uKiZ+qZ18v1Zl986s8q89m9c+xpo7Leqh0rF6Zsw3M9Cjy6Jhw== +cspell-trie-lib@^6.12.0: + version "6.12.0" + resolved "https://registry.yarnpkg.com/cspell-trie-lib/-/cspell-trie-lib-6.12.0.tgz#f0eb2c63eb8033cc6e31d738bbb280ef7a014670" + integrity sha512-SJOdb51Wy3ewaKfttZwc9NYOIXaKlhyr+ykYKBExj3qMfV1J4d4iDLE95FriaRcqnq6X/qEM9jUvZHlvadDk3A== dependencies: - "@cspell/cspell-pipe" "^5.20.0" + "@cspell/cspell-pipe" "^6.12.0" + "@cspell/cspell-types" "^6.12.0" fs-extra "^10.1.0" - gensequence "^3.1.1" + gensequence "^4.0.2" -cspell@^5.20.0: - version "5.20.0" - resolved "https://registry.yarnpkg.com/cspell/-/cspell-5.20.0.tgz#580909fc1283aeda43f1c583188ea046417d340b" - integrity sha512-lXAS14ZlfJfOI3FgoAAfyl/AlTB8T+ayHmKrHxwuRRUvN4IBT4y8d7tdjWDj7/bsM4u5M5WrlAXg6vXH3Fg5bA== +cspell@^6.0.0: + version "6.12.0" + resolved "https://registry.yarnpkg.com/cspell/-/cspell-6.12.0.tgz#b0d0be78304dde598f79262df26e907d3af1c4fb" + integrity sha512-ny4xVEPYFP2jVf5w71Mnk4HKj6RbPH+CMSzUrOMbYVVNnQUj3GLfzy5DrSFLG0zGa353ZRC4/s9MsEvnAL8mkA== dependencies: - "@cspell/cspell-pipe" "^5.20.0" + "@cspell/cspell-pipe" "^6.12.0" chalk "^4.1.2" - commander "^9.2.0" - cspell-gitignore "^5.20.0" - cspell-glob "^5.20.0" - cspell-lib "^5.20.0" + commander "^9.4.0" + cspell-gitignore "^6.12.0" + cspell-glob "^6.12.0" + cspell-lib "^6.12.0" fast-json-stable-stringify "^2.1.0" file-entry-cache "^6.0.1" fs-extra "^10.1.0" get-stdin "^8.0.0" - glob "^8.0.1" + glob "^8.0.3" imurmurhash "^0.1.4" semver "^7.3.7" strip-ansi "^6.0.1" - vscode-uri "^3.0.3" + vscode-uri "^3.0.6" -css-declaration-sorter@^6.2.2: - version "6.2.2" - resolved "https://registry.yarnpkg.com/css-declaration-sorter/-/css-declaration-sorter-6.2.2.tgz#bfd2f6f50002d6a3ae779a87d3a0c5d5b10e0f02" - integrity sha512-Ufadglr88ZLsrvS11gjeu/40Lw74D9Am/Jpr3LlYm5Q4ZP5KdlUhG+6u2EjyXeZcxmZ2h1ebCKngDjolpeLHpg== +css-declaration-sorter@^6.3.0: + version "6.3.0" + resolved "https://registry.yarnpkg.com/css-declaration-sorter/-/css-declaration-sorter-6.3.0.tgz#72ebd995c8f4532ff0036631f7365cce9759df14" + integrity sha512-OGT677UGHJTAVMRhPO+HJ4oKln3wkBTwtDFH0ojbqm+MJm6xuDMHp2nkhh/ThaBqq20IbraBQSWKfSLNHQO9Og== css-loader@^6.7.1: version "6.7.1" @@ -6199,16 +6194,6 @@ css-select@^5.1.0: domutils "^3.0.1" nth-check "^2.0.1" -css-select@~1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/css-select/-/css-select-1.2.0.tgz#2b3a110539c5355f1cd8d314623e870b121ec858" - integrity sha1-KzoRBTnFNV8c2NMUYj6HCxIeyFg= - dependencies: - boolbase "~1.0.0" - css-what "2.1" - domutils "1.5.1" - nth-check "~1.0.1" - css-tree@^1.1.2, css-tree@^1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/css-tree/-/css-tree-1.1.3.tgz#eb4870fb6fd7707327ec95c2ff2ab09b5e8db91d" @@ -6217,11 +6202,6 @@ css-tree@^1.1.2, css-tree@^1.1.3: mdn-data "2.0.14" source-map "^0.6.1" -css-what@2.1: - version "2.1.3" - resolved "https://registry.yarnpkg.com/css-what/-/css-what-2.1.3.tgz#a6d7604573365fe74686c3f311c56513d88285f2" - integrity sha512-a+EPoD+uZiNfh+5fxw2nO9QwFa6nJe2Or35fGY6Ipw1R3R4AGz1d1TEZrCegvw2YTmZ0jXirGYlzxxpYSHwpEg== - css-what@^5.0.0: version "5.1.0" resolved "https://registry.yarnpkg.com/css-what/-/css-what-5.1.0.tgz#3f7b707aadf633baf62c2ceb8579b545bb40f7fe" @@ -6237,48 +6217,48 @@ cssesc@^3.0.0: resolved "https://registry.yarnpkg.com/cssesc/-/cssesc-3.0.0.tgz#37741919903b868565e1c09ea747445cd18983ee" integrity sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg== -cssnano-preset-advanced@^5.3.5: - version "5.3.5" - resolved "https://registry.yarnpkg.com/cssnano-preset-advanced/-/cssnano-preset-advanced-5.3.5.tgz#b01dda0f76ff762b58bccd17c59701176b9be131" - integrity sha512-KgrfLQaTBB4bov/Xsi0+y5iGM5gg5QChP1PTMJ9t7U6p9geKHYcPS9AC6gmfwurm0GKxhTRafDx55E8FKHX8eg== +cssnano-preset-advanced@^5.3.8: + version "5.3.8" + resolved "https://registry.yarnpkg.com/cssnano-preset-advanced/-/cssnano-preset-advanced-5.3.8.tgz#027b1d05ef896d908178c483f0ec4190cb50ef9a" + integrity sha512-xUlLLnEB1LjpEik+zgRNlk8Y/koBPPtONZjp7JKbXigeAmCrFvq9H0pXW5jJV45bQWAlmJ0sKy+IMr0XxLYQZg== dependencies: autoprefixer "^10.3.7" - cssnano-preset-default "^5.2.9" + cssnano-preset-default "^5.2.12" postcss-discard-unused "^5.1.0" postcss-merge-idents "^5.1.1" postcss-reduce-idents "^5.2.0" postcss-zindex "^5.1.0" -cssnano-preset-default@^5.2.9: - version "5.2.9" - resolved "https://registry.yarnpkg.com/cssnano-preset-default/-/cssnano-preset-default-5.2.9.tgz#63f6aa9a9f0b21d9a526371dd308253b656a9784" - integrity sha512-/4qcQcAfFEg+gnXE5NxKmYJ9JcT+8S5SDuJCLYMDN8sM/ymZ+lgLXq5+ohx/7V2brUCkgW2OaoCzOdAN0zvhGw== +cssnano-preset-default@^5.2.12: + version "5.2.12" + resolved "https://registry.yarnpkg.com/cssnano-preset-default/-/cssnano-preset-default-5.2.12.tgz#ebe6596ec7030e62c3eb2b3c09f533c0644a9a97" + integrity sha512-OyCBTZi+PXgylz9HAA5kHyoYhfGcYdwFmyaJzWnzxuGRtnMw/kR6ilW9XzlzlRAtB6PLT/r+prYgkef7hngFew== dependencies: - css-declaration-sorter "^6.2.2" + css-declaration-sorter "^6.3.0" cssnano-utils "^3.1.0" postcss-calc "^8.2.3" postcss-colormin "^5.3.0" - postcss-convert-values "^5.1.1" - postcss-discard-comments "^5.1.1" + postcss-convert-values "^5.1.2" + postcss-discard-comments "^5.1.2" postcss-discard-duplicates "^5.1.0" postcss-discard-empty "^5.1.1" postcss-discard-overridden "^5.1.0" - postcss-merge-longhand "^5.1.5" - postcss-merge-rules "^5.1.1" + postcss-merge-longhand "^5.1.6" + postcss-merge-rules "^5.1.2" postcss-minify-font-values "^5.1.0" postcss-minify-gradients "^5.1.1" postcss-minify-params "^5.1.3" - postcss-minify-selectors "^5.2.0" + postcss-minify-selectors "^5.2.1" postcss-normalize-charset "^5.1.0" postcss-normalize-display-values "^5.1.0" - postcss-normalize-positions "^5.1.0" - postcss-normalize-repeat-style "^5.1.0" + postcss-normalize-positions "^5.1.1" + postcss-normalize-repeat-style "^5.1.1" postcss-normalize-string "^5.1.0" postcss-normalize-timing-functions "^5.1.0" postcss-normalize-unicode "^5.1.0" postcss-normalize-url "^5.1.0" postcss-normalize-whitespace "^5.1.1" - postcss-ordered-values "^5.1.1" + postcss-ordered-values "^5.1.3" postcss-reduce-initial "^5.1.0" postcss-reduce-transforms "^5.1.0" postcss-svgo "^5.1.0" @@ -6289,12 +6269,12 @@ cssnano-utils@^3.1.0: resolved "https://registry.yarnpkg.com/cssnano-utils/-/cssnano-utils-3.1.0.tgz#95684d08c91511edfc70d2636338ca37ef3a6861" integrity sha512-JQNR19/YZhz4psLX/rQ9M83e3z2Wf/HdJbryzte4a3NSuafyp9w/I4U+hx5C2S9g41qlstH7DEWnZaaj83OuEA== -cssnano@^5.1.8, cssnano@^5.1.9: - version "5.1.9" - resolved "https://registry.yarnpkg.com/cssnano/-/cssnano-5.1.9.tgz#e6cb286c4907cbd55678eb315837a21008be21be" - integrity sha512-hctQHIIeDrfMjq0bQhoVmRVaSeNNOGxkvkKVOcKpJzLr09wlRrZWH4GaYudp0aszpW8wJeaO5/yBmID9n7DNCg== +cssnano@^5.1.12, cssnano@^5.1.8: + version "5.1.12" + resolved "https://registry.yarnpkg.com/cssnano/-/cssnano-5.1.12.tgz#bcd0b64d6be8692de79332c501daa7ece969816c" + integrity sha512-TgvArbEZu0lk/dvg2ja+B7kYoD7BBCmn3+k58xD0qjrGHsFzXY/wKTo9M5egcUCabPol05e/PVoIu79s2JN4WQ== dependencies: - cssnano-preset-default "^5.2.9" + cssnano-preset-default "^5.2.12" lilconfig "^2.0.3" yaml "^1.10.2" @@ -6310,57 +6290,13 @@ csstype@^3.0.2: resolved "https://registry.yarnpkg.com/csstype/-/csstype-3.0.9.tgz#6410af31b26bd0520933d02cbc64fce9ce3fbf0b" integrity sha512-rpw6JPxK6Rfg1zLOYCSwle2GFOOsnjmDYDaBwEcwoOg4qlsIVCN789VkBZDJAGi4T07gI4YSutR43t9Zz4Lzuw== -cypress-axe@^0.14.0: - version "0.14.0" - resolved "https://registry.yarnpkg.com/cypress-axe/-/cypress-axe-0.14.0.tgz#5f5e70fb36b8cb3ba73a8ba01e9262ff1268d5e2" - integrity sha512-7Rdjnko0MjggCmndc1wECAkvQBIhuy+DRtjF7bd5YPZRFvubfMNvrxfqD8PWQmxm7MZE0ffS4Xr43V6ZmvLopg== - -cypress@8.3.0: - version "8.3.0" - resolved "https://registry.yarnpkg.com/cypress/-/cypress-8.3.0.tgz#ba906d2170888073ad94b2be1b994a749bbb7c7d" - integrity sha512-zA5Rcq8AZIfRfPXU0CCcauofF+YpaU9HYbfqkunFTmFV0Kdlo14tNjH2E3++MkjXKFnv3/pXq+HgxWtw8CSe8Q== - dependencies: - "@cypress/request" "^2.88.5" - "@cypress/xvfb" "^1.2.4" - "@types/node" "^14.14.31" - "@types/sinonjs__fake-timers" "^6.0.2" - "@types/sizzle" "^2.3.2" - arch "^2.2.0" - blob-util "^2.0.2" - bluebird "^3.7.2" - cachedir "^2.3.0" - chalk "^4.1.0" - check-more-types "^2.24.0" - cli-cursor "^3.1.0" - cli-table3 "~0.6.0" - commander "^5.1.0" - common-tags "^1.8.0" - dayjs "^1.10.4" - debug "^4.3.2" - enquirer "^2.3.6" - eventemitter2 "^6.4.3" - execa "4.1.0" - executable "^4.1.1" - extract-zip "2.0.1" - figures "^3.2.0" - fs-extra "^9.1.0" - getos "^3.2.1" - is-ci "^3.0.0" - is-installed-globally "~0.4.0" - lazy-ass "^1.6.0" - listr2 "^3.8.3" - lodash "^4.17.21" - log-symbols "^4.0.0" - minimist "^1.2.5" - ospath "^1.2.2" - pretty-bytes "^5.6.0" - ramda "~0.27.1" - request-progress "^3.0.0" - supports-color "^8.1.1" - tmp "~0.2.1" - untildify "^4.0.0" - url "^0.11.0" - yauzl "^2.10.0" +d@1, d@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/d/-/d-1.0.1.tgz#8698095372d58dbee346ffd0c7093f99f8f9eb5a" + integrity sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA== + dependencies: + es5-ext "^0.10.50" + type "^1.0.1" damerau-levenshtein@^1.0.8: version "1.0.8" @@ -6372,23 +6308,11 @@ dargs@^7.0.0: resolved "https://registry.yarnpkg.com/dargs/-/dargs-7.0.0.tgz#04015c41de0bcb69ec84050f3d9be0caf8d6d5cc" integrity sha512-2iy1EkLdlBzQGvbweYRFxmFath8+K7+AKB0TlhHWkNuH+TmovaMH/Wp7V7R4u7f4SnX3OgLsU9t1NI9ioDnUpg== -dashdash@^1.12.0: - version "1.14.1" - resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0" - integrity sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA= - dependencies: - assert-plus "^1.0.0" - dateformat@^3.0.0: version "3.0.3" resolved "https://registry.yarnpkg.com/dateformat/-/dateformat-3.0.3.tgz#a6e37499a4d9a9cf85ef5872044d62901c9889ae" integrity sha512-jyCETtSl3VMZMWeRo7iY1FL19ges1t55hMo5yaam4Jrsm5EPL89UQkoQRyiI+Yf4k8r2ZpdngkV8hr1lIdjb3Q== -dayjs@^1.10.4: - version "1.10.7" - resolved "https://registry.yarnpkg.com/dayjs/-/dayjs-1.10.7.tgz#2cf5f91add28116748440866a0a1d26f3a6ce468" - integrity sha512-P6twpd70BcPK34K26uJ1KT3wlhpuOAPoMwJzpsIWUxHZ7wpmbdZL/hQqBDfz7hGurYSa5PhzdhDHtt319hL3ig== - debug@2.6.9, debug@^2.6.0, debug@^2.6.9: version "2.6.9" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" @@ -6403,7 +6327,7 @@ debug@4, debug@^4.1.0, debug@^4.1.1, debug@^4.3.2, debug@^4.3.3, debug@^4.3.4: dependencies: ms "2.1.2" -debug@^3.1.0, debug@^3.2.7: +debug@^3.2.7: version "3.2.7" resolved "https://registry.yarnpkg.com/debug/-/debug-3.2.7.tgz#72580b7e9145fb39b6676f9c5e5fb100b934179a" integrity sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ== @@ -6504,7 +6428,7 @@ del@^6.1.1: delayed-stream@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" - integrity sha1-3zrhmayt+31ECqrgsp4icrJOxhk= + integrity sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ== delegates@^1.0.0: version "1.0.0" @@ -6582,10 +6506,10 @@ dezalgo@^1.0.0: asap "^2.0.0" wrappy "1" -diff-sequences@^28.1.1: - version "28.1.1" - resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-28.1.1.tgz#9989dc731266dc2903457a70e996f3a041913ac6" - integrity sha512-FU0iFaH/E23a+a718l8Qa/19bF9p06kgE0KipMOMadwa3SjnaElKzPaUC0vnibs6/B/9ni97s61mcejk8W1fQw== +diff-sequences@^29.0.0: + version "29.0.0" + resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-29.0.0.tgz#bae49972ef3933556bcb0800b72e8579d19d9e4f" + integrity sha512-7Qe/zd1wxSDL4D/X/FPjOMB+ZMDt71W94KYaq05I2l0oQqgXgs7s4ftYYmV38gBSrPz2vcygxfs1xn0FT+rKNA== diff@^4.0.1: version "4.0.2" @@ -6632,14 +6556,6 @@ dom-converter@^0.2.0: dependencies: utila "~0.4" -dom-serializer@0: - version "0.2.2" - resolved "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-0.2.2.tgz#1afb81f533717175d478655debc5e332d9f9bb51" - integrity sha512-2/xPb3ORsQ42nHYiSunXkDjPLBaEj/xTwUO4B7XCZQTRk7EBtTOPaygh10YAAh2OI1Qrp6NWfpAhzswj0ydt9g== - dependencies: - domelementtype "^2.0.1" - entities "^2.0.0" - dom-serializer@^1.0.1: version "1.3.2" resolved "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-1.3.2.tgz#6206437d32ceefaec7161803230c7a20bc1b4d91" @@ -6658,31 +6574,11 @@ dom-serializer@^2.0.0: domhandler "^5.0.2" entities "^4.2.0" -dom-serializer@~0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/dom-serializer/-/dom-serializer-0.1.1.tgz#1ec4059e284babed36eec2941d4a970a189ce7c0" - integrity sha512-l0IU0pPzLWSHBcieZbpOKgkIn3ts3vAh7ZuFyXNwJxJXk/c4Gwj9xaTJwIDVQCXawWD0qb3IzMGH5rglQaO0XA== - dependencies: - domelementtype "^1.3.0" - entities "^1.1.1" - -domelementtype@1, domelementtype@^1.3.0, domelementtype@^1.3.1: - version "1.3.1" - resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-1.3.1.tgz#d048c44b37b0d10a7f2a3d5fee3f4333d790481f" - integrity sha512-BSKB+TSpMpFI/HOxCNr1O8aMOTZ8hT3pM3GQ0w/mWRmkhEDSFJkkyzz4XQsBV44BChwGkrDfMyjVD0eA2aFV3w== - domelementtype@^2.0.1, domelementtype@^2.2.0, domelementtype@^2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/domelementtype/-/domelementtype-2.3.0.tgz#5c45e8e869952626331d7aab326d01daf65d589d" integrity sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw== -domhandler@^2.3.0: - version "2.4.2" - resolved "https://registry.yarnpkg.com/domhandler/-/domhandler-2.4.2.tgz#8805097e933d65e85546f726d60f5eb88b44f803" - integrity sha512-JiK04h0Ht5u/80fdLMCEmV4zkNh2BcoMFBmZ/91WtYZ8qVXSKjiw7fXMgFPnHcSZgOo3XdinHvmnDUeMf5R4wA== - dependencies: - domelementtype "1" - domhandler@^4.0.0, domhandler@^4.2.0: version "4.2.2" resolved "https://registry.yarnpkg.com/domhandler/-/domhandler-4.2.2.tgz#e825d721d19a86b8c201a35264e226c678ee755f" @@ -6697,22 +6593,6 @@ domhandler@^5.0.1, domhandler@^5.0.2, domhandler@^5.0.3: dependencies: domelementtype "^2.3.0" -domutils@1.5.1: - version "1.5.1" - resolved "https://registry.yarnpkg.com/domutils/-/domutils-1.5.1.tgz#dcd8488a26f563d61079e48c9f7b7e32373682cf" - integrity sha1-3NhIiib1Y9YQeeSMn3t+Mjc2gs8= - dependencies: - dom-serializer "0" - domelementtype "1" - -domutils@^1.5.1: - version "1.7.0" - resolved "https://registry.yarnpkg.com/domutils/-/domutils-1.7.0.tgz#56ea341e834e06e6748af7a1cb25da67ea9f8c2a" - integrity sha512-Lgd2XcJ/NjEw+7tFvfKxOzCYKZsdct5lczQ2ZaQY8Djz7pfAD3Gbp8ySJWtreII/vDlMVmxwa6pHmdxIYgttDg== - dependencies: - dom-serializer "0" - domelementtype "1" - domutils@^2.5.2, domutils@^2.6.0: version "2.8.0" resolved "https://registry.yarnpkg.com/domutils/-/domutils-2.8.0.tgz#4437def5db6e2d1f5d6ee859bd95ca7d02048135" @@ -6758,14 +6638,14 @@ dotenv@~10.0.0: resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-10.0.0.tgz#3d4227b8fb95f81096cdd2b66653fb2c7085ba81" integrity sha512-rlBi9d8jpv9Sf1klPjNfFAuWDjKLwTIJJ/VxtoTwIR6hnZxcEOQCZg2oIL3MWBYw5GpUDKOEnND7LXTbIpQ03Q== -downlevel-dts@^0.9.0: - version "0.9.0" - resolved "https://registry.yarnpkg.com/downlevel-dts/-/downlevel-dts-0.9.0.tgz#23c71e5bdf825a073f80a7ed077553c81aabdf01" - integrity sha512-XDYaZ7yY4yPLlNx3txbYRzUF6WiElAgMJQ/ACIaZnKISwuWw2eAHD7Ecp3u60ntej6i1yaMtjsN02hhA4FakFw== +downlevel-dts@>=0.10.0: + version "0.10.0" + resolved "https://registry.yarnpkg.com/downlevel-dts/-/downlevel-dts-0.10.0.tgz#d2be7b4408a1f9eb3a39e15a361f8ea4f175facc" + integrity sha512-AZ7tnUy4XJArsjv6Bcuivvxx+weMvOGHF6seu7e7PVOqMDHMSlfgMl1kt+F4Y2+5TmDwKWHOdimM1DZKihQs8Q== dependencies: semver "^7.3.2" shelljs "^0.8.3" - typescript "^4.5.5" + typescript next duplexer3@^0.1.4: version "0.1.4" @@ -6782,30 +6662,22 @@ eastasianwidth@^0.2.0: resolved "https://registry.yarnpkg.com/eastasianwidth/-/eastasianwidth-0.2.0.tgz#696ce2ec0aa0e6ea93a397ffcf24aa7840c827cb" integrity sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA== -ecc-jsbn@~0.1.1: - version "0.1.2" - resolved "https://registry.yarnpkg.com/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz#3a83a904e54353287874c564b7549386849a98c9" - integrity sha1-OoOpBOVDUyh4dMVkt1SThoSamMk= - dependencies: - jsbn "~0.1.0" - safer-buffer "^2.1.0" - ee-first@1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0= -ejs@^3.1.7: - version "3.1.7" - resolved "https://registry.yarnpkg.com/ejs/-/ejs-3.1.7.tgz#c544d9c7f715783dd92f0bddcf73a59e6962d006" - integrity sha512-BIar7R6abbUxDA3bfXrO4DSgwo8I+fB5/1zgujl3HLLjwd6+9iOnrT+t3grn2qbk9vOgBubXOFwX2m9axoFaGw== +ejs@^3.1.6, ejs@^3.1.7: + version "3.1.8" + resolved "https://registry.yarnpkg.com/ejs/-/ejs-3.1.8.tgz#758d32910c78047585c7ef1f92f9ee041c1c190b" + integrity sha512-/sXZeMlhS0ArkfX2Aw780gJzXSMPnKjtspYZv+f3NiKLlubezAHDU5+9xz6gd3/NhG3txQCo6xlglmTS+oTGEQ== dependencies: jake "^10.8.5" -electron-to-chromium@^1.4.118: - version "1.4.137" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.137.tgz#186180a45617283f1c012284458510cd99d6787f" - integrity sha512-0Rcpald12O11BUogJagX3HsCN3FE83DSqWjgXoHo5a72KUKMSfI39XBgJpgNNxS9fuGzytaFjE06kZkiVFy2qA== +electron-to-chromium@^1.4.251: + version "1.4.270" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.270.tgz#2c6ea409b45cdb5c3e0cb2c08cf6c0ba7e0f2c26" + integrity sha512-KNhIzgLiJmDDC444dj9vEOpZEgsV96ult9Iff98Vanumn+ShJHd5se8aX6KeVxdc0YQeqdrezBZv89rleDbvSg== emittery@^0.10.2: version "0.10.2" @@ -6842,7 +6714,7 @@ encodeurl@~1.0.2: resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59" integrity sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k= -encoding@^0.1.12, encoding@^0.1.13: +encoding@^0.1.13: version "0.1.13" resolved "https://registry.yarnpkg.com/encoding/-/encoding-0.1.13.tgz#56574afdd791f54a8e9b2785c0582a2d26210fa9" integrity sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A== @@ -6856,7 +6728,7 @@ end-of-stream@^1.1.0, end-of-stream@^1.4.1: dependencies: once "^1.4.0" -enhanced-resolve@^5.9.3: +enhanced-resolve@^5.10.0, enhanced-resolve@^5.9.3: version "5.10.0" resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.10.0.tgz#0dc579c3bb2a1032e357ac45b8f3a6f3ad4fb1e6" integrity sha512-T0yTFjdpldGY8PmuXXR0PyQ1ufZpEGiHVrp7zHKB7jdR4qlmZHhONVM5AQOAWXuF/w3dnHbEQVrNptJgt7F+cQ== @@ -6864,24 +6736,19 @@ enhanced-resolve@^5.9.3: graceful-fs "^4.2.4" tapable "^2.2.0" -enquirer@^2.3.6, enquirer@~2.3.6: +enquirer@~2.3.6: version "2.3.6" resolved "https://registry.yarnpkg.com/enquirer/-/enquirer-2.3.6.tgz#2a7fe5dd634a1e4125a975ec994ff5456dc3734d" integrity sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg== dependencies: ansi-colors "^4.1.1" -entities@^1.1.1, entities@~1.1.1: - version "1.1.2" - resolved "https://registry.yarnpkg.com/entities/-/entities-1.1.2.tgz#bdfa735299664dfafd34529ed4f8522a275fea56" - integrity sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w== - entities@^2.0.0: version "2.2.0" resolved "https://registry.yarnpkg.com/entities/-/entities-2.2.0.tgz#098dc90ebb83d8dffa089d55256b351d34c4da55" integrity sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A== -entities@^3.0.1: +entities@^3.0.1, entities@~3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/entities/-/entities-3.0.1.tgz#2b887ca62585e96db3903482d336c1006c3001d4" integrity sha512-WiyBqoomrwMdFG1e0kqvASYfnlb0lp8M5o5Fw2OFq1hNZxxcNk8Ik0Xm7LxzBhuidnZB/UtBqVCgUz3kBOP51Q== @@ -6891,11 +6758,6 @@ entities@^4.2.0, entities@^4.3.0: resolved "https://registry.yarnpkg.com/entities/-/entities-4.3.0.tgz#62915f08d67353bb4eb67e3d62641a4059aec656" integrity sha512-/iP1rZrSEJ0DTlPiX+jbzlA3eVkY/e8L8SozroF395fIqE3TYF/Nz7YOMAawta+vLmyJ/hkGNNPcSbMADCCXbg== -entities@~2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/entities/-/entities-2.1.0.tgz#992d3129cf7df6870b96c57858c249a120f8b8b5" - integrity sha512-hCx1oky9PFrJ611mf0ifBLBRW8lUUVRlFolb5gWRfIELabBlbp9xZvrqZLZAs+NxFnbfQoeGd8wDkygjg7U85w== - env-paths@^2.2.0: version "2.2.1" resolved "https://registry.yarnpkg.com/env-paths/-/env-paths-2.2.1.tgz#420399d416ce1fbe9bc0a07c62fa68d67fd0f8f2" @@ -6968,6 +6830,170 @@ es-to-primitive@^1.2.1: is-date-object "^1.0.1" is-symbol "^1.0.2" +es5-ext@^0.10.35, es5-ext@^0.10.46, es5-ext@^0.10.50, es5-ext@^0.10.53, es5-ext@^0.10.61, es5-ext@~0.10.14, es5-ext@~0.10.2, es5-ext@~0.10.46: + version "0.10.61" + resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.61.tgz#311de37949ef86b6b0dcea894d1ffedb909d3269" + integrity sha512-yFhIqQAzu2Ca2I4SE2Au3rxVfmohU9Y7wqGR+s7+H7krk26NXhIRAZDgqd6xqjCEFUomDEA3/Bo/7fKmIkW1kA== + dependencies: + es6-iterator "^2.0.3" + es6-symbol "^3.1.3" + next-tick "^1.1.0" + +es6-iterator@^2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/es6-iterator/-/es6-iterator-2.0.3.tgz#a7de889141a05a94b0854403b2d0a0fbfa98f3b7" + integrity sha512-zw4SRzoUkd+cl+ZoE15A9o1oQd920Bb0iOJMQkQhl3jNc03YqVjAhG7scf9C5KWRU/R13Orf588uCC6525o02g== + dependencies: + d "1" + es5-ext "^0.10.35" + es6-symbol "^3.1.1" + +es6-symbol@^3.1.1, es6-symbol@^3.1.3: + version "3.1.3" + resolved "https://registry.yarnpkg.com/es6-symbol/-/es6-symbol-3.1.3.tgz#bad5d3c1bcdac28269f4cb331e431c78ac705d18" + integrity sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA== + dependencies: + d "^1.0.1" + ext "^1.1.2" + +es6-weak-map@^2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/es6-weak-map/-/es6-weak-map-2.0.3.tgz#b6da1f16cc2cc0d9be43e6bdbfc5e7dfcdf31d53" + integrity sha512-p5um32HOTO1kP+w7PRnB+5lQ43Z6muuMuIMffvDN8ZB4GcnjLBV6zGStpbASIMk4DCAvEaamhe2zhyCb/QXXsA== + dependencies: + d "1" + es5-ext "^0.10.46" + es6-iterator "^2.0.3" + es6-symbol "^3.1.1" + +esbuild-android-64@0.15.18: + version "0.15.18" + resolved "https://registry.yarnpkg.com/esbuild-android-64/-/esbuild-android-64-0.15.18.tgz#20a7ae1416c8eaade917fb2453c1259302c637a5" + integrity sha512-wnpt3OXRhcjfIDSZu9bnzT4/TNTDsOUvip0foZOUBG7QbSt//w3QV4FInVJxNhKc/ErhUxc5z4QjHtMi7/TbgA== + +esbuild-android-arm64@0.15.18: + version "0.15.18" + resolved "https://registry.yarnpkg.com/esbuild-android-arm64/-/esbuild-android-arm64-0.15.18.tgz#9cc0ec60581d6ad267568f29cf4895ffdd9f2f04" + integrity sha512-G4xu89B8FCzav9XU8EjsXacCKSG2FT7wW9J6hOc18soEHJdtWu03L3TQDGf0geNxfLTtxENKBzMSq9LlbjS8OQ== + +esbuild-darwin-64@0.15.18: + version "0.15.18" + resolved "https://registry.yarnpkg.com/esbuild-darwin-64/-/esbuild-darwin-64-0.15.18.tgz#428e1730ea819d500808f220fbc5207aea6d4410" + integrity sha512-2WAvs95uPnVJPuYKP0Eqx+Dl/jaYseZEUUT1sjg97TJa4oBtbAKnPnl3b5M9l51/nbx7+QAEtuummJZW0sBEmg== + +esbuild-darwin-arm64@0.15.18: + version "0.15.18" + resolved "https://registry.yarnpkg.com/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.15.18.tgz#b6dfc7799115a2917f35970bfbc93ae50256b337" + integrity sha512-tKPSxcTJ5OmNb1btVikATJ8NftlyNlc8BVNtyT/UAr62JFOhwHlnoPrhYWz09akBLHI9nElFVfWSTSRsrZiDUA== + +esbuild-freebsd-64@0.15.18: + version "0.15.18" + resolved "https://registry.yarnpkg.com/esbuild-freebsd-64/-/esbuild-freebsd-64-0.15.18.tgz#4e190d9c2d1e67164619ae30a438be87d5eedaf2" + integrity sha512-TT3uBUxkteAjR1QbsmvSsjpKjOX6UkCstr8nMr+q7zi3NuZ1oIpa8U41Y8I8dJH2fJgdC3Dj3CXO5biLQpfdZA== + +esbuild-freebsd-arm64@0.15.18: + version "0.15.18" + resolved "https://registry.yarnpkg.com/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.15.18.tgz#18a4c0344ee23bd5a6d06d18c76e2fd6d3f91635" + integrity sha512-R/oVr+X3Tkh+S0+tL41wRMbdWtpWB8hEAMsOXDumSSa6qJR89U0S/PpLXrGF7Wk/JykfpWNokERUpCeHDl47wA== + +esbuild-linux-32@0.15.18: + version "0.15.18" + resolved "https://registry.yarnpkg.com/esbuild-linux-32/-/esbuild-linux-32-0.15.18.tgz#9a329731ee079b12262b793fb84eea762e82e0ce" + integrity sha512-lphF3HiCSYtaa9p1DtXndiQEeQDKPl9eN/XNoBf2amEghugNuqXNZA/ZovthNE2aa4EN43WroO0B85xVSjYkbg== + +esbuild-linux-64@0.15.18: + version "0.15.18" + resolved "https://registry.yarnpkg.com/esbuild-linux-64/-/esbuild-linux-64-0.15.18.tgz#532738075397b994467b514e524aeb520c191b6c" + integrity sha512-hNSeP97IviD7oxLKFuii5sDPJ+QHeiFTFLoLm7NZQligur8poNOWGIgpQ7Qf8Balb69hptMZzyOBIPtY09GZYw== + +esbuild-linux-arm64@0.15.18: + version "0.15.18" + resolved "https://registry.yarnpkg.com/esbuild-linux-arm64/-/esbuild-linux-arm64-0.15.18.tgz#5372e7993ac2da8f06b2ba313710d722b7a86e5d" + integrity sha512-54qr8kg/6ilcxd+0V3h9rjT4qmjc0CccMVWrjOEM/pEcUzt8X62HfBSeZfT2ECpM7104mk4yfQXkosY8Quptug== + +esbuild-linux-arm@0.15.18: + version "0.15.18" + resolved "https://registry.yarnpkg.com/esbuild-linux-arm/-/esbuild-linux-arm-0.15.18.tgz#e734aaf259a2e3d109d4886c9e81ec0f2fd9a9cc" + integrity sha512-UH779gstRblS4aoS2qpMl3wjg7U0j+ygu3GjIeTonCcN79ZvpPee12Qun3vcdxX+37O5LFxz39XeW2I9bybMVA== + +esbuild-linux-mips64le@0.15.18: + version "0.15.18" + resolved "https://registry.yarnpkg.com/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.15.18.tgz#c0487c14a9371a84eb08fab0e1d7b045a77105eb" + integrity sha512-Mk6Ppwzzz3YbMl/ZZL2P0q1tnYqh/trYZ1VfNP47C31yT0K8t9s7Z077QrDA/guU60tGNp2GOwCQnp+DYv7bxQ== + +esbuild-linux-ppc64le@0.15.18: + version "0.15.18" + resolved "https://registry.yarnpkg.com/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.15.18.tgz#af048ad94eed0ce32f6d5a873f7abe9115012507" + integrity sha512-b0XkN4pL9WUulPTa/VKHx2wLCgvIAbgwABGnKMY19WhKZPT+8BxhZdqz6EgkqCLld7X5qiCY2F/bfpUUlnFZ9w== + +esbuild-linux-riscv64@0.15.18: + version "0.15.18" + resolved "https://registry.yarnpkg.com/esbuild-linux-riscv64/-/esbuild-linux-riscv64-0.15.18.tgz#423ed4e5927bd77f842bd566972178f424d455e6" + integrity sha512-ba2COaoF5wL6VLZWn04k+ACZjZ6NYniMSQStodFKH/Pu6RxzQqzsmjR1t9QC89VYJxBeyVPTaHuBMCejl3O/xg== + +esbuild-linux-s390x@0.15.18: + version "0.15.18" + resolved "https://registry.yarnpkg.com/esbuild-linux-s390x/-/esbuild-linux-s390x-0.15.18.tgz#21d21eaa962a183bfb76312e5a01cc5ae48ce8eb" + integrity sha512-VbpGuXEl5FCs1wDVp93O8UIzl3ZrglgnSQ+Hu79g7hZu6te6/YHgVJxCM2SqfIila0J3k0csfnf8VD2W7u2kzQ== + +esbuild-netbsd-64@0.15.18: + version "0.15.18" + resolved "https://registry.yarnpkg.com/esbuild-netbsd-64/-/esbuild-netbsd-64-0.15.18.tgz#ae75682f60d08560b1fe9482bfe0173e5110b998" + integrity sha512-98ukeCdvdX7wr1vUYQzKo4kQ0N2p27H7I11maINv73fVEXt2kyh4K4m9f35U1K43Xc2QGXlzAw0K9yoU7JUjOg== + +esbuild-openbsd-64@0.15.18: + version "0.15.18" + resolved "https://registry.yarnpkg.com/esbuild-openbsd-64/-/esbuild-openbsd-64-0.15.18.tgz#79591a90aa3b03e4863f93beec0d2bab2853d0a8" + integrity sha512-yK5NCcH31Uae076AyQAXeJzt/vxIo9+omZRKj1pauhk3ITuADzuOx5N2fdHrAKPxN+zH3w96uFKlY7yIn490xQ== + +esbuild-sunos-64@0.15.18: + version "0.15.18" + resolved "https://registry.yarnpkg.com/esbuild-sunos-64/-/esbuild-sunos-64-0.15.18.tgz#fd528aa5da5374b7e1e93d36ef9b07c3dfed2971" + integrity sha512-On22LLFlBeLNj/YF3FT+cXcyKPEI263nflYlAhz5crxtp3yRG1Ugfr7ITyxmCmjm4vbN/dGrb/B7w7U8yJR9yw== + +esbuild-windows-32@0.15.18: + version "0.15.18" + resolved "https://registry.yarnpkg.com/esbuild-windows-32/-/esbuild-windows-32-0.15.18.tgz#0e92b66ecdf5435a76813c4bc5ccda0696f4efc3" + integrity sha512-o+eyLu2MjVny/nt+E0uPnBxYuJHBvho8vWsC2lV61A7wwTWC3jkN2w36jtA+yv1UgYkHRihPuQsL23hsCYGcOQ== + +esbuild-windows-64@0.15.18: + version "0.15.18" + resolved "https://registry.yarnpkg.com/esbuild-windows-64/-/esbuild-windows-64-0.15.18.tgz#0fc761d785414284fc408e7914226d33f82420d0" + integrity sha512-qinug1iTTaIIrCorAUjR0fcBk24fjzEedFYhhispP8Oc7SFvs+XeW3YpAKiKp8dRpizl4YYAhxMjlftAMJiaUw== + +esbuild-windows-arm64@0.15.18: + version "0.15.18" + resolved "https://registry.yarnpkg.com/esbuild-windows-arm64/-/esbuild-windows-arm64-0.15.18.tgz#5b5bdc56d341d0922ee94965c89ee120a6a86eb7" + integrity sha512-q9bsYzegpZcLziq0zgUi5KqGVtfhjxGbnksaBFYmWLxeV/S1fK4OLdq2DFYnXcLMjlZw2L0jLsk1eGoB522WXQ== + +esbuild@~0.15.10: + version "0.15.18" + resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.15.18.tgz#ea894adaf3fbc036d32320a00d4d6e4978a2f36d" + integrity sha512-x/R72SmW3sSFRm5zrrIjAhCeQSAWoni3CmHEqfQrZIQTM3lVCdehdwuIqaOtfC2slvpdlLa62GYoN8SxT23m6Q== + optionalDependencies: + "@esbuild/android-arm" "0.15.18" + "@esbuild/linux-loong64" "0.15.18" + esbuild-android-64 "0.15.18" + esbuild-android-arm64 "0.15.18" + esbuild-darwin-64 "0.15.18" + esbuild-darwin-arm64 "0.15.18" + esbuild-freebsd-64 "0.15.18" + esbuild-freebsd-arm64 "0.15.18" + esbuild-linux-32 "0.15.18" + esbuild-linux-64 "0.15.18" + esbuild-linux-arm "0.15.18" + esbuild-linux-arm64 "0.15.18" + esbuild-linux-mips64le "0.15.18" + esbuild-linux-ppc64le "0.15.18" + esbuild-linux-riscv64 "0.15.18" + esbuild-linux-s390x "0.15.18" + esbuild-netbsd-64 "0.15.18" + esbuild-openbsd-64 "0.15.18" + esbuild-sunos-64 "0.15.18" + esbuild-windows-32 "0.15.18" + esbuild-windows-64 "0.15.18" + esbuild-windows-arm64 "0.15.18" + escalade@^3.1.1: version "3.1.1" resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" @@ -7014,6 +7040,15 @@ eslint-module-utils@^2.7.3: debug "^3.2.7" find-up "^2.1.0" +eslint-plugin-deprecation@^1.3.2: + version "1.3.2" + resolved "https://registry.yarnpkg.com/eslint-plugin-deprecation/-/eslint-plugin-deprecation-1.3.2.tgz#a8125d28c56158cdfa1a685197e6be8ed86f189e" + integrity sha512-z93wbx9w7H/E3ogPw6AZMkkNJ6m51fTZRNZPNQqxQLmx+KKt7aLkMU9wN67s71i+VVHN4tLOZ3zT3QLbnlC0Mg== + dependencies: + "@typescript-eslint/experimental-utils" "^5.0.0" + tslib "^2.3.1" + tsutils "^3.21.0" + eslint-plugin-eslint-comments@^3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/eslint-plugin-eslint-comments/-/eslint-plugin-eslint-comments-3.2.0.tgz#9e1cd7b4413526abb313933071d7aba05ca12ffa" @@ -7022,10 +7057,10 @@ eslint-plugin-eslint-comments@^3.2.0: escape-string-regexp "^1.0.5" ignore "^5.0.5" -eslint-plugin-eslint-plugin@^4.1.0: - version "4.4.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-eslint-plugin/-/eslint-plugin-eslint-plugin-4.4.0.tgz#52475a3f9635de9990b0c09c201eb2601467daae" - integrity sha512-Y29xyomdpWybXJBVcmS9iHZwQyqYz9TVGtsxqcRa/mxhWdFexPH9lTXjT61QbsScgvh3PBTjTIpktImJLoqN6g== +eslint-plugin-eslint-plugin@^5.0.1: + version "5.0.6" + resolved "https://registry.yarnpkg.com/eslint-plugin-eslint-plugin/-/eslint-plugin-eslint-plugin-5.0.6.tgz#76a32444b90525f5e58b1b7bdf0295110f6573a8" + integrity sha512-q1/sXPSMEAINj9jmYQDp0f7zu0PeU6Wy5Cn/l7OsjSGkq8NLCckFXZxhVIlGJcmAI+OeFSGfRSZ6Iku3eRv8QQ== dependencies: eslint-utils "^3.0.0" estraverse "^5.2.0" @@ -7049,28 +7084,28 @@ eslint-plugin-import@^2.26.0: resolve "^1.22.0" tsconfig-paths "^3.14.1" -eslint-plugin-jest@^26.1.5: - version "26.6.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-26.6.0.tgz#546804fa42da75d7d58d4d3b278d5186abd3f6c0" - integrity sha512-f8n46/97ZFdU4KqeQYqO8AEVGIhHWvkpgNBWHH3jrM28/y8llnbf3IjfIKv6p2pZIMinK1PCqbbROxs9Eud02Q== +eslint-plugin-jest@^27.0.0: + version "27.1.7" + resolved "https://registry.yarnpkg.com/eslint-plugin-jest/-/eslint-plugin-jest-27.1.7.tgz#0351e904afb8d66b7f70452929556dfdc8daba0d" + integrity sha512-0QVzf+og4YI1Qr3UoprkqqhezAZjFffdi62b0IurkCXMqPtRW84/UT4CKsYT80h/D82LA9avjO/80Ou1LdgbaQ== dependencies: "@typescript-eslint/utils" "^5.10.0" eslint-plugin-jsx-a11y@^6.5.1: - version "6.6.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-6.6.0.tgz#2c5ac12e013eb98337b9aa261c3b355275cc6415" - integrity sha512-kTeLuIzpNhXL2CwLlc8AHI0aFRwWHcg483yepO9VQiHzM9bZwJdzTkzBszbuPrbgGmq2rlX/FaT2fJQsjUSHsw== + version "6.6.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-6.6.1.tgz#93736fc91b83fdc38cc8d115deedfc3091aef1ff" + integrity sha512-sXgFVNHiWffBq23uiS/JaP6eVR622DqwB4yTzKvGZGcPq6/yZ3WmOZfuBks/vHWo9GaFOqC2ZK4i6+C35knx7Q== dependencies: - "@babel/runtime" "^7.18.3" + "@babel/runtime" "^7.18.9" aria-query "^4.2.2" array-includes "^3.1.5" ast-types-flow "^0.0.7" - axe-core "^4.4.2" + axe-core "^4.4.3" axobject-query "^2.2.0" damerau-levenshtein "^1.0.8" emoji-regex "^9.2.2" has "^1.0.3" - jsx-ast-utils "^3.3.1" + jsx-ast-utils "^3.3.2" language-tags "^1.0.5" minimatch "^3.1.2" semver "^6.3.0" @@ -7081,9 +7116,9 @@ eslint-plugin-react-hooks@^4.5.0: integrity sha512-oFc7Itz9Qxh2x4gNHStv3BqJq54ExXmfC+a1NjAta66IAN87Wu0R/QArgIS9qKzX3dXKPI9H5crl9QchNMY9+g== eslint-plugin-react@^7.29.4: - version "7.30.1" - resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.30.1.tgz#2be4ab23ce09b5949c6631413ba64b2810fd3e22" - integrity sha512-NbEvI9jtqO46yJA3wcRF9Mo0lF9T/jhdHqhCHXiXtD+Zcb98812wvokjWpU7Q4QH5edo6dmqrukxVvWWXHlsUg== + version "7.31.8" + resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.31.8.tgz#3a4f80c10be1bcbc8197be9e8b641b2a3ef219bf" + integrity sha512-5lBTZmgQmARLLSYiwI71tiGVTLUuqXantZM6vlSY39OaDSV0M7+32K5DnLkmFrwTe+Ksz0ffuLUC91RUviVZfw== dependencies: array-includes "^3.1.5" array.prototype.flatmap "^1.3.0" @@ -7100,10 +7135,10 @@ eslint-plugin-react@^7.29.4: semver "^6.3.0" string.prototype.matchall "^4.0.7" -eslint-plugin-simple-import-sort@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/eslint-plugin-simple-import-sort/-/eslint-plugin-simple-import-sort-7.0.0.tgz#a1dad262f46d2184a90095a60c66fef74727f0f8" - integrity sha512-U3vEDB5zhYPNfxT5TYR7u01dboFZp+HNpnGhkDB2g/2E4wZ/g1Q9Ton8UwCLfRV9yAKyYqDh62oHOamvkFxsvw== +eslint-plugin-simple-import-sort@^10.0.0: + version "10.0.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-simple-import-sort/-/eslint-plugin-simple-import-sort-10.0.0.tgz#cc4ceaa81ba73252427062705b64321946f61351" + integrity sha512-AeTvO9UCMSNzIHRkg8S6c3RPy5YEwKWSQPx3DYghLedo2ZQxowPFLGDN1AZ2evfg6r6mjBSZSLxLFsWSu3acsw== eslint-scope@5.1.1, eslint-scope@^5.1.1: version "5.1.1" @@ -7222,7 +7257,7 @@ estree-walker@^1.0.1: resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-1.0.1.tgz#31bc5d612c96b704106b477e6dd5d8aa138cb700" integrity sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg== -estree-walker@^2.0.1: +estree-walker@^2.0.1, estree-walker@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-2.0.2.tgz#52f010178c2a4c117a7757cfe942adb7d2da4cac" integrity sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w== @@ -7250,10 +7285,13 @@ eval@^0.1.8: "@types/node" "*" require-like ">= 0.1.1" -eventemitter2@^6.4.3: - version "6.4.5" - resolved "https://registry.yarnpkg.com/eventemitter2/-/eventemitter2-6.4.5.tgz#97380f758ae24ac15df8353e0cc27f8b95644655" - integrity sha512-bXE7Dyc1i6oQElDG0jMRZJrRAn9QR2xyyFGmBdZleNmyQX0FqGYmhZIrIrpPfm/w//LTo4tVQGOGQcGCb5q9uw== +event-emitter@^0.3.5: + version "0.3.5" + resolved "https://registry.yarnpkg.com/event-emitter/-/event-emitter-0.3.5.tgz#df8c69eef1647923c7157b9ce83840610b02cc39" + integrity sha512-D9rRn9y7kLPnJ+hMq7S/nhvoKwwvVJahBi2BPmx3bvbsEdK3W9ii8cBSGjP+72/LnM4n6fo3+dkCX5FeTQruXA== + dependencies: + d "1" + es5-ext "~0.10.14" eventemitter3@^4.0.0, eventemitter3@^4.0.4: version "4.0.7" @@ -7265,22 +7303,7 @@ events@^3.2.0: resolved "https://registry.yarnpkg.com/events/-/events-3.3.0.tgz#31a95ad0a924e2d2c419a813aeb2c4e878ea7400" integrity sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q== -execa@4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/execa/-/execa-4.1.0.tgz#4e5491ad1572f2f17a77d388c6c857135b22847a" - integrity sha512-j5W0//W7f8UxAn8hXVnwG8tLwdiUy4FJLcSupCg6maBYZDpyBvTApK7KyuI4bKj8KOh1r2YH+6ucuYtJv1bTZA== - dependencies: - cross-spawn "^7.0.0" - get-stream "^5.0.0" - human-signals "^1.1.1" - is-stream "^2.0.0" - merge-stream "^2.0.0" - npm-run-path "^4.0.0" - onetime "^5.1.0" - signal-exit "^3.0.2" - strip-final-newline "^2.0.0" - -execa@^5.0.0: +execa@5.1.1, execa@^5.0.0: version "5.1.1" resolved "https://registry.yarnpkg.com/execa/-/execa-5.1.1.tgz#f80ad9cbf4298f7bd1d4c9555c21e93741c411dd" integrity sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg== @@ -7310,39 +7333,21 @@ execa@^6.1.0: signal-exit "^3.0.7" strip-final-newline "^3.0.0" -executable@^4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/executable/-/executable-4.1.1.tgz#41532bff361d3e57af4d763b70582db18f5d133c" - integrity sha512-8iA79xD3uAch729dUG8xaaBBFGaEa0wdD2VkYLFHwlqosEj/jT66AzcreRDSgV7ehnNLBW2WR5jIXwGKjVdTLg== - dependencies: - pify "^2.2.0" - exit@^0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/exit/-/exit-0.1.2.tgz#0632638f8d877cc82107d30a0fff1a17cba1cd0c" integrity sha1-BjJjj42HfMghB9MKD/8aF8uhzQw= -expect@^28.1.1: - version "28.1.1" - resolved "https://registry.yarnpkg.com/expect/-/expect-28.1.1.tgz#ca6fff65f6517cf7220c2e805a49c19aea30b420" - integrity sha512-/AANEwGL0tWBwzLNOvO0yUdy2D52jVdNXppOqswC49sxMN2cPWsGCQdzuIf9tj6hHoBQzNvx75JUYuQAckPo3w== +expect@^29.0.0, expect@^29.1.2: + version "29.1.2" + resolved "https://registry.yarnpkg.com/expect/-/expect-29.1.2.tgz#82f8f28d7d408c7c68da3a386a490ee683e1eced" + integrity sha512-AuAGn1uxva5YBbBlXb+2JPxJRuemZsmlGcapPXWNSBNsQtAULfjioREGBWuI0EOvYUKjDnrCy8PW5Zlr1md5mw== dependencies: - "@jest/expect-utils" "^28.1.1" - jest-get-type "^28.0.2" - jest-matcher-utils "^28.1.1" - jest-message-util "^28.1.1" - jest-util "^28.1.1" - -expect@^28.1.3: - version "28.1.3" - resolved "https://registry.yarnpkg.com/expect/-/expect-28.1.3.tgz#90a7c1a124f1824133dd4533cce2d2bdcb6603ec" - integrity sha512-eEh0xn8HlsuOBxFgIss+2mX85VAS4Qy3OSkjV7rlBWljtA4oWH37glVGyOZSZvErDT/yBywZdPGwCXuTvSG85g== - dependencies: - "@jest/expect-utils" "^28.1.3" - jest-get-type "^28.0.2" - jest-matcher-utils "^28.1.3" - jest-message-util "^28.1.3" - jest-util "^28.1.3" + "@jest/expect-utils" "^29.1.2" + jest-get-type "^29.0.0" + jest-matcher-utils "^29.1.2" + jest-message-util "^29.1.2" + jest-util "^29.1.2" express@^4.17.3: version "4.18.1" @@ -7381,6 +7386,13 @@ express@^4.17.3: utils-merge "1.0.1" vary "~1.1.2" +ext@^1.1.2: + version "1.6.0" + resolved "https://registry.yarnpkg.com/ext/-/ext-1.6.0.tgz#3871d50641e874cc172e2b53f919842d19db4c52" + integrity sha512-sdBImtzkq2HpkdRLtlLWDa6w4DX22ijZLKx8BMPUuKe1c5lbN6xwQDQCxSfxBQnHZ13ls/FH0MQZx/q/gr6FQg== + dependencies: + type "^2.5.0" + extend-shallow@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-2.0.1.tgz#51af7d614ad9a9f610ea1bafbb989d6b1c56890f" @@ -7388,7 +7400,7 @@ extend-shallow@^2.0.1: dependencies: is-extendable "^0.1.0" -extend@^3.0.0, extend@~3.0.2: +extend@^3.0.0: version "3.0.2" resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g== @@ -7402,36 +7414,15 @@ external-editor@^3.0.3: iconv-lite "^0.4.24" tmp "^0.0.33" -extract-zip@2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/extract-zip/-/extract-zip-2.0.1.tgz#663dca56fe46df890d5f131ef4a06d22bb8ba13a" - integrity sha512-GDhU9ntwuKyGXdZBUgTIe+vXnWj0fppUEtMDL0+idd5Sta8TGpHssn/eusA9mrPr9qNDym6SxAYZjNvCn/9RBg== - dependencies: - debug "^4.1.1" - get-stream "^5.1.0" - yauzl "^2.10.0" - optionalDependencies: - "@types/yauzl" "^2.9.1" - -extsprintf@1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05" - integrity sha1-lpGEQOMEGnpBT4xS48V06zw+HgU= - -extsprintf@^1.2.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f" - integrity sha1-4mifjzVvrWLMplo6kcXfX5VRaS8= - fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: version "3.1.3" resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== -fast-equals@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/fast-equals/-/fast-equals-3.0.2.tgz#77f80047b381b6cb747130463ccc144e24c44097" - integrity sha512-iY0fAmW7fzxHp22VCRLpOgWbsWsF+DJWi1jhc8w+VGlJUiS+KcGZV2A8t+Q9oTQwhG3L1W8Lu/oe3ZyOPdhZjw== +fast-equals@^4.0.3: + version "4.0.3" + resolved "https://registry.yarnpkg.com/fast-equals/-/fast-equals-4.0.3.tgz#72884cc805ec3c6679b99875f6b7654f39f0e8c7" + integrity sha512-G3BSX9cfKttjr+2o1O22tYMLq0DPluZnYtq1rXumE1SpL/F/SLIfHx08WYQoWSIpeMYf8sRbJ8++71+v6Pnxfg== fast-glob@3.2.7: version "3.2.7" @@ -7518,13 +7509,6 @@ fbjs@^3.0.0: setimmediate "^1.0.5" ua-parser-js "^0.7.30" -fd-slicer@~1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/fd-slicer/-/fd-slicer-1.1.0.tgz#25c7c89cb1f9077f8891bbe61d8f390eae256f1e" - integrity sha1-JcfInLH5B3+IkbvmHY85Dq4lbx4= - dependencies: - pend "~1.2.0" - feed@^4.2.2: version "4.2.2" resolved "https://registry.yarnpkg.com/feed/-/feed-4.2.2.tgz#865783ef6ed12579e2c44bbef3c9113bc4956a7e" @@ -7532,7 +7516,7 @@ feed@^4.2.2: dependencies: xml-js "^1.6.11" -figures@3.2.0, figures@^3.0.0, figures@^3.2.0: +figures@3.2.0, figures@^3.0.0: version "3.2.0" resolved "https://registry.yarnpkg.com/figures/-/figures-3.2.0.tgz#625c18bd293c604dc4a8ddb2febf0c88341746af" integrity sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg== @@ -7625,6 +7609,13 @@ find-up@^5.0.0: locate-path "^6.0.0" path-exists "^4.0.0" +find-yarn-workspace-root@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/find-yarn-workspace-root/-/find-yarn-workspace-root-2.0.0.tgz#f47fb8d239c900eb78179aa81b66673eac88f7bd" + integrity sha512-1IMnbjt4KzsQfnhnzNd8wUEgXZ44IzZaZmnLYx7D5FZlaHt2gW20Cri8Q+E/t5tIj4+epTBub+2Zxu/vNILzqQ== + dependencies: + micromatch "^4.0.2" + flat-cache@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-3.0.4.tgz#61b0338302b2fe9f957dcc32fc2a87f1c3048b11" @@ -7651,15 +7642,10 @@ flux@^4.0.1: fbemitter "^3.0.0" fbjs "^3.0.0" -follow-redirects@^1.0.0, follow-redirects@^1.14.0, follow-redirects@^1.14.7: - version "1.14.9" - resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.14.9.tgz#dd4ea157de7bfaf9ea9b3fbd85aa16951f78d8d7" - integrity sha512-MQDfihBQYMcyy5dhRDJUHcw7lb2Pv/TuE6xP1vyraLukNDHKbDxDNaOE3NbCAdKQApno+GPRyo1YAp89yCjK4w== - -forever-agent@~0.6.1: - version "0.6.1" - resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91" - integrity sha1-+8cfDEGt6zf5bFd60e1C2P2sypE= +follow-redirects@^1.0.0, follow-redirects@^1.14.0, follow-redirects@^1.14.7, follow-redirects@^1.15.0: + version "1.15.2" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.2.tgz#b460864144ba63f2681096f274c4e57026da2c13" + integrity sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA== fork-ts-checker-webpack-plugin@^6.5.0: version "6.5.0" @@ -7680,13 +7666,13 @@ fork-ts-checker-webpack-plugin@^6.5.0: semver "^7.3.2" tapable "^1.0.0" -form-data@~2.3.2: - version "2.3.3" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-2.3.3.tgz#dcce52c05f644f298c6a7ab936bd724ceffbf3a6" - integrity sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ== +form-data@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.0.tgz#93919daeaf361ee529584b9b31664dc12c9fa452" + integrity sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww== dependencies: asynckit "^0.4.0" - combined-stream "^1.0.6" + combined-stream "^1.0.8" mime-types "^2.1.12" forwarded@0.2.0: @@ -7718,17 +7704,16 @@ fs-extra@^10.1.0: jsonfile "^6.0.1" universalify "^2.0.0" -fs-extra@^9.0.0, fs-extra@^9.1.0: - version "9.1.0" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-9.1.0.tgz#5954460c764a8da2094ba3554bf839e6b9a7c86d" - integrity sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ== +fs-extra@^11.1.0: + version "11.1.0" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-11.1.0.tgz#5784b102104433bb0e090f48bfc4a30742c357ed" + integrity sha512-0rcTq621PD5jM/e0a3EJoGC/1TC5ZBCERW82LQuwfGnCa1V8w7dpYH1yNu+SLb6E5dkeCBzKEyLGlFrnr+dUyw== dependencies: - at-least-node "^1.0.0" graceful-fs "^4.2.0" jsonfile "^6.0.1" universalify "^2.0.0" -fs-extra@~7.0.1: +fs-extra@^7.0.1, fs-extra@~7.0.1: version "7.0.1" resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-7.0.1.tgz#4f189c44aa123b895f722804f55ea23eadc348e9" integrity sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw== @@ -7737,6 +7722,16 @@ fs-extra@~7.0.1: jsonfile "^4.0.0" universalify "^0.1.0" +fs-extra@^9.0.0, fs-extra@^9.0.1, fs-extra@^9.1.0: + version "9.1.0" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-9.1.0.tgz#5954460c764a8da2094ba3554bf839e6b9a7c86d" + integrity sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ== + dependencies: + at-least-node "^1.0.0" + graceful-fs "^4.2.0" + jsonfile "^6.0.1" + universalify "^2.0.0" + fs-minipass@^2.0.0, fs-minipass@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-2.1.0.tgz#7f5036fdbf12c63c169190cbe4199c852271f9fb" @@ -7798,10 +7793,10 @@ gauge@^4.0.3: strip-ansi "^6.0.1" wide-align "^1.1.5" -gensequence@^3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/gensequence/-/gensequence-3.1.1.tgz#95c1afc7c0680f92942c17f2d6f83f3d26ea97af" - integrity sha512-ys3h0hiteRwmY6BsvSttPmkhC0vEQHPJduANBRtH/dlDPZ0UBIb/dXy80IcckXyuQ6LKg+PloRqvGER9IS7F7g== +gensequence@^4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/gensequence/-/gensequence-4.0.2.tgz#7c6147cf04451e9f6efe3872be9d46bb8d9c2603" + integrity sha512-mQiFskYFPFDSUpBJ/n3ebAV2Ufu6DZGvUPXzyWYzFfJr6/DyOOZVnjx6VTWE4y0RLvYWnc5tZq5sCjzEWhRjqQ== gensync@^1.0.0-beta.1, gensync@^1.0.0-beta.2: version "1.0.0-beta.2" @@ -7813,7 +7808,7 @@ get-caller-file@^2.0.5: resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== -get-intrinsic@^1.0.2: +get-intrinsic@^1.0.2, get-intrinsic@^1.1.0, get-intrinsic@^1.1.1: version "1.1.2" resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.1.2.tgz#336975123e05ad0b7ba41f152ee4aadbea6cf598" integrity sha512-Jfm3OyCxHh9DJyc28qGk+JmfkpO41A4XkneDSujN9MDXrm4oDKdHvndhZ2dN94+ERNfkYJWDclW6k2L/ZGHjXA== @@ -7822,15 +7817,6 @@ get-intrinsic@^1.0.2: has "^1.0.3" has-symbols "^1.0.3" -get-intrinsic@^1.1.0, get-intrinsic@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.1.1.tgz#15f59f376f855c446963948f0d24cd3637b4abc6" - integrity sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q== - dependencies: - function-bind "^1.1.1" - has "^1.0.3" - has-symbols "^1.0.1" - get-own-enumerable-property-symbols@^3.0.0: version "3.0.2" resolved "https://registry.yarnpkg.com/get-own-enumerable-property-symbols/-/get-own-enumerable-property-symbols-3.0.2.tgz#b5fde77f22cbe35f390b4e089922c50bce6ef664" @@ -7873,7 +7859,7 @@ get-stream@^4.1.0: dependencies: pump "^3.0.0" -get-stream@^5.0.0, get-stream@^5.1.0: +get-stream@^5.1.0: version "5.2.0" resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-5.2.0.tgz#4966a1795ee5ace65e706c4b7beb71257d6e22d3" integrity sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA== @@ -7893,19 +7879,10 @@ get-symbol-description@^1.0.0: call-bind "^1.0.2" get-intrinsic "^1.1.1" -getos@^3.2.1: - version "3.2.1" - resolved "https://registry.yarnpkg.com/getos/-/getos-3.2.1.tgz#0134d1f4e00eb46144c5a9c0ac4dc087cbb27dc5" - integrity sha512-U56CfOK17OKgTVqozZjUKNdkfEv6jk5WISBJ8SHoagjE6L69zOwl3Z+O8myjY9MEW3i2HPWQBt/LTbCgcC973Q== - dependencies: - async "^3.2.0" - -getpass@^0.1.1: - version "0.1.7" - resolved "https://registry.yarnpkg.com/getpass/-/getpass-0.1.7.tgz#5eff8e3e684d569ae4cb2b1282604e8ba62149fa" - integrity sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo= - dependencies: - assert-plus "^1.0.0" +get-tsconfig@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/get-tsconfig/-/get-tsconfig-4.2.0.tgz#ff368dd7104dab47bf923404eb93838245c66543" + integrity sha512-X8u8fREiYOE6S8hLbq99PeykTDoLVnxvF4DjWKJmz9xy2nNRdUcV8ZN9tniJFeKyTU3qnC9lL8n4Chd6LmVKHg== git-raw-commits@^2.0.8: version "2.0.10" @@ -7934,20 +7911,20 @@ git-semver-tags@^4.1.1: meow "^8.0.0" semver "^6.0.0" -git-up@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/git-up/-/git-up-6.0.0.tgz#dbd6e4eee270338be847a0601e6d0763c90b74db" - integrity sha512-6RUFSNd1c/D0xtGnyWN2sxza2bZtZ/EmI9448n6rCZruFwV/ezeEn2fJP7XnUQGwf0RAtd/mmUCbtH6JPYA2SA== +git-up@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/git-up/-/git-up-7.0.0.tgz#bace30786e36f56ea341b6f69adfd83286337467" + integrity sha512-ONdIrbBCFusq1Oy0sC71F5azx8bVkvtZtMJAsv+a6lz5YAmbNnLD6HAB4gptHZVLPR8S2/kVN6Gab7lryq5+lQ== dependencies: is-ssh "^1.4.0" - parse-url "^7.0.2" + parse-url "^8.1.0" -git-url-parse@^12.0.0: - version "12.0.0" - resolved "https://registry.yarnpkg.com/git-url-parse/-/git-url-parse-12.0.0.tgz#4ba70bc1e99138321c57e3765aaf7428e5abb793" - integrity sha512-I6LMWsxV87vysX1WfsoglXsXg6GjQRKq7+Dgiseo+h0skmp5Hp2rzmcEIRQot9CPA+uzU7x1x7jZdqvTFGnB+Q== +git-url-parse@^13.1.0: + version "13.1.0" + resolved "https://registry.yarnpkg.com/git-url-parse/-/git-url-parse-13.1.0.tgz#07e136b5baa08d59fabdf0e33170de425adf07b4" + integrity sha512-5FvPJP/70WkIprlUZ33bm4UAaFdjcLkJLpWft1BeZKqwR0uhhNGoKwlUaPtVb4LxCSQ++erHapRak9kWGj+FCA== dependencies: - git-up "^6.0.0" + git-up "^7.0.0" gitconfiglocal@^1.0.0: version "1.0.0" @@ -7975,12 +7952,19 @@ glob-parent@^6.0.1: dependencies: is-glob "^4.0.3" +glob-promise@^4.2.2: + version "4.2.2" + resolved "https://registry.yarnpkg.com/glob-promise/-/glob-promise-4.2.2.tgz#15f44bcba0e14219cd93af36da6bb905ff007877" + integrity sha512-xcUzJ8NWN5bktoTIX7eOclO1Npxd/dyVqUJxlLIDasT4C7KZyqlPIwkdJ0Ypiy3p2ZKahTjK4M9uC3sNSfNMzw== + dependencies: + "@types/glob" "^7.1.3" + glob-to-regexp@^0.4.1: version "0.4.1" resolved "https://registry.yarnpkg.com/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz#c75297087c851b9a578bd217dd59a92f59fe546e" integrity sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw== -glob@*, glob@^8.0.1: +glob@*, glob@^8.0.1, glob@^8.0.3, glob@~8.0.3: version "8.0.3" resolved "https://registry.yarnpkg.com/glob/-/glob-8.0.3.tgz#415c6eb2deed9e502c68fa44a272e6da6eeca42e" integrity sha512-ull455NHSHI/Y1FqGaaYFaLGkNMMJbavMrEGFXG/PGrg6y7sutWHUHrz6gy6WEBH6akM1M414dWKCNs+IhKdiQ== @@ -8003,7 +7987,7 @@ glob@7.1.4: once "^1.3.0" path-is-absolute "^1.0.0" -glob@^7.0.0, glob@^7.1.1, glob@^7.1.3, glob@^7.1.4, glob@^7.1.6, glob@~7.2.0: +glob@^7.0.0, glob@^7.1.1, glob@^7.1.3, glob@^7.1.4, glob@^7.1.6: version "7.2.3" resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b" integrity sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q== @@ -8102,6 +8086,11 @@ graceful-fs@^4.1.11, graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.6 resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.9.tgz#041b05df45755e587a24942279b9d113146e1c96" integrity sha512-NtNxqUcXgpW2iMrfqSfR73Glt39K+BLwWsPs94yR63v45T0Wbej7eRmL5cWfwEgqXnmjQp3zaJTshdRW/qC2ZQ== +grapheme-splitter@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz#9cf3a665c6247479896834af35cf1dbb4400767e" + integrity sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ== + gray-matter@^4.0.3: version "4.0.3" resolved "https://registry.yarnpkg.com/gray-matter/-/gray-matter-4.0.3.tgz#e893c064825de73ea1f5f7d88c7a9f7274288798" @@ -8215,17 +8204,6 @@ hast-to-hyperscript@^9.0.0: unist-util-is "^4.0.0" web-namespaces "^1.0.0" -hast-util-from-parse5@^5.0.0: - version "5.0.3" - resolved "https://registry.yarnpkg.com/hast-util-from-parse5/-/hast-util-from-parse5-5.0.3.tgz#3089dc0ee2ccf6ec8bc416919b51a54a589e097c" - integrity sha512-gOc8UB99F6eWVWFtM9jUikjN7QkWxB3nY0df5Z0Zq1/Nkwl5V4hAAsl0tmwlgWl/1shlTF8DnNYLO8X6wRV9pA== - dependencies: - ccount "^1.0.3" - hastscript "^5.0.0" - property-information "^5.0.0" - web-namespaces "^1.1.2" - xtend "^4.0.1" - hast-util-from-parse5@^6.0.0: version "6.0.1" resolved "https://registry.yarnpkg.com/hast-util-from-parse5/-/hast-util-from-parse5-6.0.1.tgz#554e34abdeea25ac76f5bd950a1f0180e0b3bc2a" @@ -8270,16 +8248,6 @@ hast-util-to-parse5@^6.0.0: xtend "^4.0.0" zwitch "^1.0.0" -hastscript@^5.0.0: - version "5.1.2" - resolved "https://registry.yarnpkg.com/hastscript/-/hastscript-5.1.2.tgz#bde2c2e56d04c62dd24e8c5df288d050a355fb8a" - integrity sha512-WlztFuK+Lrvi3EggsqOkQ52rKbxkXL3RwB6t5lwoa8QLMemoWfBuL43eDrwOamJyR7uKQKdmKYaBH1NZBiIRrQ== - dependencies: - comma-separated-tokens "^1.0.0" - hast-util-parse-selector "^2.0.0" - property-information "^5.0.0" - space-separated-tokens "^1.0.0" - hastscript@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/hastscript/-/hastscript-6.0.0.tgz#e8768d7eac56c3fdeac8a92830d58e811e5bf640" @@ -8320,6 +8288,13 @@ hosted-git-info@^2.1.4: resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.8.9.tgz#dffc0bf9a21c02209090f2aa69429e1414daf3f9" integrity sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw== +hosted-git-info@^3.0.6: + version "3.0.8" + resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-3.0.8.tgz#6e35d4cc87af2c5f816e4cb9ce350ba87a3f370d" + integrity sha512-aXpmwoOhRBrw6X3j0h5RloK4x1OzsxMPyxqIHyNfSe2pypkVTZFpEiRoSipPEPlMrh0HW/XsjkJ5WgnCirpNUw== + dependencies: + lru-cache "^6.0.0" + hosted-git-info@^4.0.0, hosted-git-info@^4.0.1: version "4.0.2" resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-4.0.2.tgz#5e425507eede4fea846b7262f0838456c4209961" @@ -8386,19 +8361,7 @@ html-webpack-plugin@^5.5.0: html-minifier-terser "^6.0.2" lodash "^4.17.21" pretty-error "^4.0.0" - tapable "^2.0.0" - -htmlparser2@^3.9.1: - version "3.10.1" - resolved "https://registry.yarnpkg.com/htmlparser2/-/htmlparser2-3.10.1.tgz#bd679dc3f59897b6a34bb10749c855bb53a9392f" - integrity sha512-IgieNijUMbkDovyoKObU1DUhm1iwNYE/fuifEoEHfd1oZKZDaONBSkal7Y01shxsM49R4XaMdGez3WnF9UfiCQ== - dependencies: - domelementtype "^1.3.1" - domhandler "^2.3.0" - domutils "^1.5.1" - entities "^1.1.1" - inherits "^2.0.1" - readable-stream "^3.1.1" + tapable "^2.0.0" htmlparser2@^6.1.0: version "6.1.0" @@ -8456,15 +8419,6 @@ http-parser-js@>=0.5.1: resolved "https://registry.yarnpkg.com/http-parser-js/-/http-parser-js-0.5.3.tgz#01d2709c79d41698bb01d4decc5e9da4e4a033d9" integrity sha512-t7hjvef/5HEK7RWTdUzVUhl8zkEu+LlaE0IYzdMuvbSDipxBRpOn4Uhw8ZyECEa808iVT8XCjzo6xmYt4CiLZg== -http-proxy-agent@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz#8a8c8ef7f5932ccf953c296ca8291b95aa74aa3a" - integrity sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg== - dependencies: - "@tootallnate/once" "1" - agent-base "6" - debug "4" - http-proxy-agent@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz#5129800203520d434f142bc78ff3c170800f2b43" @@ -8494,15 +8448,6 @@ http-proxy@^1.18.1: follow-redirects "^1.0.0" requires-port "^1.0.0" -http-signature@~1.3.6: - version "1.3.6" - resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.3.6.tgz#cb6fbfdf86d1c974f343be94e87f7fc128662cf9" - integrity sha512-3adrsD6zqo4GsTqtO7FyrejHNv+NgiIfAfv68+jVlFmSr9OGy7zrxONceFRLKvnnZA5jbxQBX1u9PpB6Wi32Gw== - dependencies: - assert-plus "^1.0.0" - jsprim "^2.0.2" - sshpk "^1.14.1" - https-proxy-agent@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz#e2a90542abb68a762e0a0850f6c9edadfd8506b2" @@ -8511,11 +8456,6 @@ https-proxy-agent@^5.0.0: agent-base "6" debug "4" -human-signals@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-1.1.1.tgz#c5b1cd14f50aeae09ab6c59fe63ba3395fe4dfa3" - integrity sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw== - human-signals@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-2.1.0.tgz#dc91fcba42e4d06e4abaed33b3e7a3c02f514ea0" @@ -8557,6 +8497,11 @@ icss-utils@^5.0.0, icss-utils@^5.1.0: resolved "https://registry.yarnpkg.com/icss-utils/-/icss-utils-5.1.0.tgz#c6be6858abd013d768e98366ae47e25d5887b1ae" integrity sha512-soFhflCVWLfRNOPU3iv5Z9VUdT44xFRbzjLsEzSr5AQmgqPMTHdU3PMT1Cf1ssx8fLNJDA1juftYl+PUcv3MqA== +idb@^7.0.1: + version "7.1.0" + resolved "https://registry.yarnpkg.com/idb/-/idb-7.1.0.tgz#2cc886be57738419e57f9aab58f647e5e2160270" + integrity sha512-Wsk07aAxDsntgYJY4h0knZJuTxM73eQ4reRAO+Z1liOh8eMCJ/MoDS8fCui1vGT9mnjtl1sOu3I2i/W1swPYZg== + identity-obj-proxy@3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/identity-obj-proxy/-/identity-obj-proxy-3.0.0.tgz#94d2bda96084453ef36fbc5aaec37e0f79f1fc14" @@ -8569,13 +8514,6 @@ ieee754@^1.1.13: resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352" integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA== -ignore-walk@^3.0.3: - version "3.0.4" - resolved "https://registry.yarnpkg.com/ignore-walk/-/ignore-walk-3.0.4.tgz#c9a09f69b7c7b479a5d74ac1a3c0d4236d2a6335" - integrity sha512-PY6Ii8o1jMRA1z4F2hRkH/xN59ox43DavKvD3oDpfurRlOJyAHpifIwpbdv1n4jt4ov0jSpw3kQ4GhJnpBL6WQ== - dependencies: - minimatch "^3.0.4" - ignore-walk@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/ignore-walk/-/ignore-walk-5.0.1.tgz#5f199e23e1288f518d90358d461387788a154776" @@ -8583,10 +8521,10 @@ ignore-walk@^5.0.1: dependencies: minimatch "^5.0.1" -ignore@^5.0.4, ignore@^5.0.5, ignore@^5.2.0, ignore@~5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.2.0.tgz#6d3bac8fa7fe0d45d9f9be7bac2fc279577e345a" - integrity sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ== +ignore@^5.0.4, ignore@^5.0.5, ignore@^5.2.0, ignore@~5.2.4: + version "5.2.4" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.2.4.tgz#a291c0c6178ff1b960befe47fcdec301674a6324" + integrity sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ== image-size@^1.0.1: version "1.0.1" @@ -8641,10 +8579,10 @@ infer-owner@^1.0.4: resolved "https://registry.yarnpkg.com/infer-owner/-/infer-owner-1.0.4.tgz#c4cefcaa8e51051c2a40ba2ce8a3d27295af9467" integrity sha512-IClj+Xz94+d7irH5qRyfJonOdfTzuDaifE6ZPWfx0N0+/ATZCbuTPq2prFl526urkQd90WyUKIh1DfBQ2hMz9A== -infima@0.2.0-alpha.39: - version "0.2.0-alpha.39" - resolved "https://registry.yarnpkg.com/infima/-/infima-0.2.0-alpha.39.tgz#054b13ac44f3e9a42bc083988f1a1586add2f59c" - integrity sha512-UyYiwD3nwHakGhuOUfpe3baJ8gkiPpRVx4a4sE/Ag+932+Y6swtLsdPoRR8ezhwqGnduzxmFkjumV9roz6QoLw== +infima@0.2.0-alpha.42: + version "0.2.0-alpha.42" + resolved "https://registry.yarnpkg.com/infima/-/infima-0.2.0-alpha.42.tgz#f6e86a655ad40877c6b4d11b2ede681eb5470aa5" + integrity sha512-ift8OXNbQQwtbIt6z16KnSWP7uJ/SysSMFI4F87MNRTicypfl4Pv3E2OGVv6N3nSZFJvA8imYulCBS64iyHYww== inflight@^1.0.4: version "1.0.6" @@ -8664,7 +8602,7 @@ inherits@2.0.3: resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= -ini@2.0.0, ini@~2.0.0: +ini@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/ini/-/ini-2.0.0.tgz#e5fd556ecdd5726be978fa1001862eacb0a94bc5" integrity sha512-7PnF4oN3CvZF23ADhA5wRaYEQpJ8qygSkbtTXWBeXWXmEVRXK+1ITciHWwHhsjv1TmW0MgacIv6hEi5pX5NQdA== @@ -8674,42 +8612,49 @@ ini@^1.3.2, ini@^1.3.4, ini@^1.3.5, ini@~1.3.0: resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.8.tgz#a29da425b48806f34767a4efce397269af28432c" integrity sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew== -init-package-json@^2.0.2: - version "2.0.5" - resolved "https://registry.yarnpkg.com/init-package-json/-/init-package-json-2.0.5.tgz#78b85f3c36014db42d8f32117252504f68022646" - integrity sha512-u1uGAtEFu3VA6HNl/yUWw57jmKEMx8SKOxHhxjGnOFUiIlFnohKDFg4ZrPpv9wWqk44nDxGJAtqjdQFm+9XXQA== +ini@~3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/ini/-/ini-3.0.1.tgz#c76ec81007875bc44d544ff7a11a55d12294102d" + integrity sha512-it4HyVAUTKBc6m8e1iXWvXSTdndF7HbdN713+kvLrymxTaU4AUBWrJ4vEooP+V7fexnVD3LKcBshjGGPefSMUQ== + +init-package-json@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/init-package-json/-/init-package-json-3.0.2.tgz#f5bc9bac93f2bdc005778bc2271be642fecfcd69" + integrity sha512-YhlQPEjNFqlGdzrBfDNRLhvoSgX7iQRgSxgsNknRQ9ITXFT7UMfVMWhBTOh2Y+25lRnGrv5Xz8yZwQ3ACR6T3A== dependencies: - npm-package-arg "^8.1.5" + npm-package-arg "^9.0.1" promzard "^0.3.0" - read "~1.0.1" - read-package-json "^4.1.1" + read "^1.0.7" + read-package-json "^5.0.0" semver "^7.3.5" validate-npm-package-license "^3.0.4" - validate-npm-package-name "^3.0.0" + validate-npm-package-name "^4.0.0" inline-style-parser@0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/inline-style-parser/-/inline-style-parser-0.1.1.tgz#ec8a3b429274e9c0a1f1c4ffa9453a7fef72cea1" integrity sha512-7NXolsK4CAS5+xvdj5OMMbI962hU/wvwoxk+LWR9Ek9bVtyuuYScDN6eS0rUm6TxApFpw7CX1o4uJzcd4AyD3Q== -inquirer@^7.3.3: - version "7.3.3" - resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-7.3.3.tgz#04d176b2af04afc157a83fd7c100e98ee0aad003" - integrity sha512-JG3eIAj5V9CwcGvuOmoo6LB9kbAYT8HXffUl6memuszlwDC/qvFAJw49XJ5NROSFNPxp3iQg1GqkFhaY/CR0IA== +inquirer@^8.2.4: + version "8.2.4" + resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-8.2.4.tgz#ddbfe86ca2f67649a67daa6f1051c128f684f0b4" + integrity sha512-nn4F01dxU8VeKfq192IjLsxu0/OmMZ4Lg3xKAns148rCaXP6ntAoEkVYZThWjwON8AlzdZZi6oqnhNbxUG9hVg== dependencies: ansi-escapes "^4.2.1" - chalk "^4.1.0" + chalk "^4.1.1" cli-cursor "^3.1.0" cli-width "^3.0.0" external-editor "^3.0.3" figures "^3.0.0" - lodash "^4.17.19" + lodash "^4.17.21" mute-stream "0.0.8" + ora "^5.4.1" run-async "^2.4.0" - rxjs "^6.6.0" + rxjs "^7.5.5" string-width "^4.1.0" strip-ansi "^6.0.0" through "^2.3.6" + wrap-ansi "^7.0.0" internal-slot@^1.0.3: version "1.0.3" @@ -8792,12 +8737,12 @@ is-buffer@^2.0.0: resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-2.0.5.tgz#ebc252e400d22ff8d77fa09888821a24a658c191" integrity sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ== -is-builtin-module@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/is-builtin-module/-/is-builtin-module-3.1.0.tgz#6fdb24313b1c03b75f8b9711c0feb8c30b903b00" - integrity sha512-OV7JjAgOTfAFJmHZLvpSTb4qi0nIILDV1gWPYDnDJUTNFM5aGlRAhk4QcT8i7TuAleeEV5Fdkqn3t4mS+Q11fg== +is-builtin-module@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/is-builtin-module/-/is-builtin-module-3.2.0.tgz#bb0310dfe881f144ca83f30100ceb10cf58835e0" + integrity sha512-phDA4oSGt7vl1n5tJvTWooWWAsXLY+2xCnxNqvKhGEzujg+A43wPlPOyDg3C8XQHN+6k/JTQWJ/j0dQh/qr+Hw== dependencies: - builtin-modules "^3.0.0" + builtin-modules "^3.3.0" is-callable@^1.1.4, is-callable@^1.2.4: version "1.2.4" @@ -8811,17 +8756,10 @@ is-ci@^2.0.0: dependencies: ci-info "^2.0.0" -is-ci@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-3.0.0.tgz#c7e7be3c9d8eef7d0fa144390bd1e4b88dc4c994" - integrity sha512-kDXyttuLeslKAHYL/K28F2YkM3x5jvFPEw3yXbRptXydjD9rpLEz+C5K5iutY9ZiUu6AP41JdvRQwF4Iqs4ZCQ== - dependencies: - ci-info "^3.1.1" - -is-core-module@^2.1.0, is-core-module@^2.2.0, is-core-module@^2.5.0, is-core-module@^2.8.1: - version "2.8.1" - resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.8.1.tgz#f59fdfca701d5879d0a6b100a40aa1560ce27211" - integrity sha512-SdNCUs284hr40hFTFP6l0IfZ/RSrMXF3qgoRHd3/79unUTvrFO/JoXwkGm+5J/Oe3E/b5GsnG330uUNgRpu1PA== +is-core-module@^2.1.0, is-core-module@^2.2.0, is-core-module@^2.5.0, is-core-module@^2.8.1, is-core-module@^2.9.0: + version "2.10.0" + resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.10.0.tgz#9012ede0a91c69587e647514e1d5277019e728ed" + integrity sha512-Erxj2n/LDAZ7H8WNJXd9tw38GYM3dv8rk8Zcs+jJuxYTW7sozH+SS8NtrSjVL1/vpLvWi1hxy96IzjJ3EHTJJg== dependencies: has "^1.0.3" @@ -8879,7 +8817,7 @@ is-hexadecimal@^1.0.0: resolved "https://registry.yarnpkg.com/is-hexadecimal/-/is-hexadecimal-1.0.4.tgz#cc35c97588da4bd49a8eedd6bc4082d44dcb23a7" integrity sha512-gyPJuv83bHMpocVYoqof5VDiZveEoGoFL8m3BXNb2VW8Xs+rz9kqO8LOQ5DH6EsuvilT1ApazU0pyl+ytbPtlw== -is-installed-globally@^0.4.0, is-installed-globally@~0.4.0: +is-installed-globally@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/is-installed-globally/-/is-installed-globally-0.4.0.tgz#9a0fd407949c30f86eb6959ef1b7994ed0b7b520" integrity sha512-iwGqO3J21aaSkC7jWnHP/difazwS7SFeIqxv6wEtLU8Y5KlzFTjyqcSIT0d8s4+dDhKytsk9PJZ2BkS5eZwQRQ== @@ -8887,6 +8825,11 @@ is-installed-globally@^0.4.0, is-installed-globally@~0.4.0: global-dirs "^3.0.0" is-path-inside "^3.0.2" +is-interactive@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/is-interactive/-/is-interactive-1.0.0.tgz#cea6e6ae5c870a7b0a0004070b7b587e0252912e" + integrity sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w== + is-lambda@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/is-lambda/-/is-lambda-1.0.1.tgz#3d9877899e6a53efc0160504cde15f82e6f061d5" @@ -8966,7 +8909,12 @@ is-plain-object@^5.0.0: resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-5.0.0.tgz#4427f50ab3429e9025ea7d52e9043a9ef4159344" integrity sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q== -is-reference@^1.2.1: +is-promise@^2.2.2: + version "2.2.2" + resolved "https://registry.yarnpkg.com/is-promise/-/is-promise-2.2.2.tgz#39ab959ccbf9a774cf079f7b40c7a26f763135f1" + integrity sha512-+lP4/6lKUBfQjZ2pdxThZvLUAafmZb8OAxFb8XXtiQmS35INgr85hdOGoEs124ez1FCnZJt6jau/T+alh58QFQ== + +is-reference@1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/is-reference/-/is-reference-1.2.1.tgz#8b2dac0b371f4bc994fdeaba9eb542d03002d0b7" integrity sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ== @@ -9036,7 +8984,7 @@ is-text-path@^1.0.1: dependencies: text-extensions "^1.0.0" -is-typedarray@^1.0.0, is-typedarray@~1.0.0: +is-typedarray@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" integrity sha1-5HnICFjfDBsR3dppQPlgEfzaSpo= @@ -9063,7 +9011,7 @@ is-word-character@^1.0.0: resolved "https://registry.yarnpkg.com/is-word-character/-/is-word-character-1.0.4.tgz#ce0e73216f98599060592f62ff31354ddbeb0230" integrity sha512-5SMO8RVennx3nZrqtKwCGyyetPE9VDba5ugvKLaD4KopPG5kR4mQ7tNt/r7feL5yt5h3lpuBbIUmCOG2eSzXHA== -is-wsl@^2.2.0: +is-wsl@^2.1.1, is-wsl@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/is-wsl/-/is-wsl-2.2.0.tgz#74a4c76e77ca9fd3f932f290c17ea326cd157271" integrity sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww== @@ -9095,11 +9043,6 @@ isobject@^3.0.1: resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" integrity sha1-TkMekrEalzFjaqH5yNHMvP2reN8= -isstream@~0.1.2: - version "0.1.2" - resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a" - integrity sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo= - istanbul-lib-coverage@^3.0.0, istanbul-lib-coverage@^3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz#189e7909d0a39fa5a3dfad5b03f71947770191d3" @@ -9152,493 +9095,352 @@ jake@^10.8.5: filelist "^1.0.1" minimatch "^3.0.4" -jest-changed-files@^28.0.2: - version "28.0.2" - resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-28.0.2.tgz#7d7810660a5bd043af9e9cfbe4d58adb05e91531" - integrity sha512-QX9u+5I2s54ZnGoMEjiM2WeBvJR2J7w/8ZUmH2um/WLAuGAYFQcsVXY9+1YL6k0H/AGUdH8pXUAv6erDqEsvIA== +jest-changed-files@^29.0.0: + version "29.0.0" + resolved "https://registry.yarnpkg.com/jest-changed-files/-/jest-changed-files-29.0.0.tgz#aa238eae42d9372a413dd9a8dadc91ca1806dce0" + integrity sha512-28/iDMDrUpGoCitTURuDqUzWQoWmOmOKOFST1mi2lwh62X4BFf6khgH3uSuo1e49X/UDjuApAj3w0wLOex4VPQ== dependencies: execa "^5.0.0" - throat "^6.0.1" + p-limit "^3.1.0" -jest-circus@^28.1.3: - version "28.1.3" - resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-28.1.3.tgz#d14bd11cf8ee1a03d69902dc47b6bd4634ee00e4" - integrity sha512-cZ+eS5zc79MBwt+IhQhiEp0OeBddpc1n8MBo1nMB8A7oPMKEO+Sre+wHaLJexQUj9Ya/8NOBY0RESUgYjB6fow== +jest-circus@^29.1.2: + version "29.1.2" + resolved "https://registry.yarnpkg.com/jest-circus/-/jest-circus-29.1.2.tgz#4551068e432f169a53167fe1aef420cf51c8a735" + integrity sha512-ajQOdxY6mT9GtnfJRZBRYS7toNIJayiiyjDyoZcnvPRUPwJ58JX0ci0PKAKUo2C1RyzlHw0jabjLGKksO42JGA== dependencies: - "@jest/environment" "^28.1.3" - "@jest/expect" "^28.1.3" - "@jest/test-result" "^28.1.3" - "@jest/types" "^28.1.3" + "@jest/environment" "^29.1.2" + "@jest/expect" "^29.1.2" + "@jest/test-result" "^29.1.2" + "@jest/types" "^29.1.2" "@types/node" "*" chalk "^4.0.0" co "^4.6.0" dedent "^0.7.0" is-generator-fn "^2.0.0" - jest-each "^28.1.3" - jest-matcher-utils "^28.1.3" - jest-message-util "^28.1.3" - jest-runtime "^28.1.3" - jest-snapshot "^28.1.3" - jest-util "^28.1.3" + jest-each "^29.1.2" + jest-matcher-utils "^29.1.2" + jest-message-util "^29.1.2" + jest-runtime "^29.1.2" + jest-snapshot "^29.1.2" + jest-util "^29.1.2" p-limit "^3.1.0" - pretty-format "^28.1.3" + pretty-format "^29.1.2" slash "^3.0.0" stack-utils "^2.0.3" -jest-cli@^28.1.1: - version "28.1.1" - resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-28.1.1.tgz#23ddfde8940e1818585ae4a568877b33b0e51cfe" - integrity sha512-+sUfVbJqb1OjBZ0OdBbI6OWfYM1i7bSfzYy6gze1F1w3OKWq8ZTEKkZ8a7ZQPq6G/G1qMh/uKqpdWhgl11NFQQ== +jest-cli@^29.1.2: + version "29.1.2" + resolved "https://registry.yarnpkg.com/jest-cli/-/jest-cli-29.1.2.tgz#423b9c5d3ea20a50b1354b8bf3f2a20e72110e89" + integrity sha512-vsvBfQ7oS2o4MJdAH+4u9z76Vw5Q8WBQF5MchDbkylNknZdrPTX1Ix7YRJyTlOWqRaS7ue/cEAn+E4V1MWyMzw== dependencies: - "@jest/core" "^28.1.1" - "@jest/test-result" "^28.1.1" - "@jest/types" "^28.1.1" + "@jest/core" "^29.1.2" + "@jest/test-result" "^29.1.2" + "@jest/types" "^29.1.2" chalk "^4.0.0" exit "^0.1.2" graceful-fs "^4.2.9" import-local "^3.0.2" - jest-config "^28.1.1" - jest-util "^28.1.1" - jest-validate "^28.1.1" + jest-config "^29.1.2" + jest-util "^29.1.2" + jest-validate "^29.1.2" prompts "^2.0.1" yargs "^17.3.1" -jest-config@27.5.1, jest-config@^28, jest-config@^28.1.1: - version "28.1.3" - resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-28.1.3.tgz#e315e1f73df3cac31447eed8b8740a477392ec60" - integrity sha512-MG3INjByJ0J4AsNBm7T3hsuxKQqFIiRo/AUqb1q9LRKI5UU6Aar9JHbr9Ivn1TVwfUD9KirRoM/T6u8XlcQPHQ== +jest-config@28.1.1, jest-config@^29, jest-config@^29.1.2: + version "29.1.2" + resolved "https://registry.yarnpkg.com/jest-config/-/jest-config-29.1.2.tgz#7d004345ca4c09f5d8f802355f54494e90842f4d" + integrity sha512-EC3Zi86HJUOz+2YWQcJYQXlf0zuBhJoeyxLM6vb6qJsVmpP7KcCP1JnyF0iaqTaXdBP8Rlwsvs7hnKWQWWLwwA== dependencies: "@babel/core" "^7.11.6" - "@jest/test-sequencer" "^28.1.3" - "@jest/types" "^28.1.3" - babel-jest "^28.1.3" + "@jest/test-sequencer" "^29.1.2" + "@jest/types" "^29.1.2" + babel-jest "^29.1.2" chalk "^4.0.0" ci-info "^3.2.0" deepmerge "^4.2.2" glob "^7.1.3" graceful-fs "^4.2.9" - jest-circus "^28.1.3" - jest-environment-node "^28.1.3" - jest-get-type "^28.0.2" - jest-regex-util "^28.0.2" - jest-resolve "^28.1.3" - jest-runner "^28.1.3" - jest-util "^28.1.3" - jest-validate "^28.1.3" + jest-circus "^29.1.2" + jest-environment-node "^29.1.2" + jest-get-type "^29.0.0" + jest-regex-util "^29.0.0" + jest-resolve "^29.1.2" + jest-runner "^29.1.2" + jest-util "^29.1.2" + jest-validate "^29.1.2" micromatch "^4.0.4" parse-json "^5.2.0" - pretty-format "^28.1.3" + pretty-format "^29.1.2" slash "^3.0.0" strip-json-comments "^3.1.1" -jest-diff@*, jest-diff@^28, jest-diff@^28.1.0, jest-diff@^28.1.3: - version "28.1.3" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-28.1.3.tgz#948a192d86f4e7a64c5264ad4da4877133d8792f" - integrity sha512-8RqP1B/OXzjjTWkqMX67iqgwBVJRgCyKD3L9nq+6ZqJMdvjE8RgHktqZ6jNrkdMT+dJuYNI3rhQpxaz7drJHfw== +jest-diff@*, jest-diff@^29, jest-diff@^29.0.3, jest-diff@^29.1.2: + version "29.1.2" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-29.1.2.tgz#bb7aaf5353227d6f4f96c5e7e8713ce576a607dc" + integrity sha512-4GQts0aUopVvecIT4IwD/7xsBaMhKTYoM4/njE/aVw9wpw+pIUVp8Vab/KnSzSilr84GnLBkaP3JLDnQYCKqVQ== dependencies: chalk "^4.0.0" - diff-sequences "^28.1.1" - jest-get-type "^28.0.2" - pretty-format "^28.1.3" + diff-sequences "^29.0.0" + jest-get-type "^29.0.0" + pretty-format "^29.1.2" -jest-docblock@^28.1.1: - version "28.1.1" - resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-28.1.1.tgz#6f515c3bf841516d82ecd57a62eed9204c2f42a8" - integrity sha512-3wayBVNiOYx0cwAbl9rwm5kKFP8yHH3d/fkEaL02NPTkDojPtheGB7HZSFY4wzX+DxyrvhXz0KSCVksmCknCuA== +jest-docblock@^29.0.0: + version "29.0.0" + resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-29.0.0.tgz#3151bcc45ed7f5a8af4884dcc049aee699b4ceae" + integrity sha512-s5Kpra/kLzbqu9dEjov30kj1n4tfu3e7Pl8v+f8jOkeWNqM6Ds8jRaJfZow3ducoQUrf2Z4rs2N5S3zXnb83gw== dependencies: detect-newline "^3.0.0" -jest-each@^28.1.3: - version "28.1.3" - resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-28.1.3.tgz#bdd1516edbe2b1f3569cfdad9acd543040028f81" - integrity sha512-arT1z4sg2yABU5uogObVPvSlSMQlDA48owx07BDPAiasW0yYpYHYOo4HHLz9q0BVzDVU4hILFjzJw0So9aCL/g== +jest-each@^29.1.2: + version "29.1.2" + resolved "https://registry.yarnpkg.com/jest-each/-/jest-each-29.1.2.tgz#d4c8532c07a846e79f194f7007ce7cb1987d1cd0" + integrity sha512-AmTQp9b2etNeEwMyr4jc0Ql/LIX/dhbgP21gHAizya2X6rUspHn2gysMXaj6iwWuOJ2sYRgP8c1P4cXswgvS1A== dependencies: - "@jest/types" "^28.1.3" + "@jest/types" "^29.1.2" chalk "^4.0.0" - jest-get-type "^28.0.2" - jest-util "^28.1.3" - pretty-format "^28.1.3" - -jest-environment-node@^28.1.1: - version "28.1.1" - resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-28.1.1.tgz#1c86c59003a7d319fa06ea3b1bbda6c193715c67" - integrity sha512-2aV/eeY/WNgUUJrrkDJ3cFEigjC5fqT1+fCclrY6paqJ5zVPoM//sHmfgUUp7WLYxIdbPwMiVIzejpN56MxnNA== - dependencies: - "@jest/environment" "^28.1.1" - "@jest/fake-timers" "^28.1.1" - "@jest/types" "^28.1.1" - "@types/node" "*" - jest-mock "^28.1.1" - jest-util "^28.1.1" - -jest-environment-node@^28.1.3: - version "28.1.3" - resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-28.1.3.tgz#7e74fe40eb645b9d56c0c4b70ca4357faa349be5" - integrity sha512-ugP6XOhEpjAEhGYvp5Xj989ns5cB1K6ZdjBYuS30umT4CQEETaxSiPcZ/E1kFktX4GkrcM4qu07IIlDYX1gp+A== - dependencies: - "@jest/environment" "^28.1.3" - "@jest/fake-timers" "^28.1.3" - "@jest/types" "^28.1.3" + jest-get-type "^29.0.0" + jest-util "^29.1.2" + pretty-format "^29.1.2" + +jest-environment-node@^29.1.2: + version "29.1.2" + resolved "https://registry.yarnpkg.com/jest-environment-node/-/jest-environment-node-29.1.2.tgz#005e05cc6ea4b9b5ba55906ab1ce53c82f6907a7" + integrity sha512-C59yVbdpY8682u6k/lh8SUMDJPbOyCHOTgLVVi1USWFxtNV+J8fyIwzkg+RJIVI30EKhKiAGNxYaFr3z6eyNhQ== + dependencies: + "@jest/environment" "^29.1.2" + "@jest/fake-timers" "^29.1.2" + "@jest/types" "^29.1.2" "@types/node" "*" - jest-mock "^28.1.3" - jest-util "^28.1.3" + jest-mock "^29.1.2" + jest-util "^29.1.2" -jest-get-type@^28, jest-get-type@^28.0.2: - version "28.0.2" - resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-28.0.2.tgz#34622e628e4fdcd793d46db8a242227901fcf203" - integrity sha512-ioj2w9/DxSYHfOm5lJKCdcAmPJzQXmbM/Url3rhlghrPvT3tt+7a/+oXc9azkKmLvoiXjtV83bEWqi+vs5nlPA== +jest-get-type@^29, jest-get-type@^29.0.0: + version "29.0.0" + resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-29.0.0.tgz#843f6c50a1b778f7325df1129a0fd7aa713aef80" + integrity sha512-83X19z/HuLKYXYHskZlBAShO7UfLFXu/vWajw9ZNJASN32li8yHMaVGAQqxFW1RCFOkB7cubaL6FaJVQqqJLSw== -jest-haste-map@^28.1.1: - version "28.1.1" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-28.1.1.tgz#471685f1acd365a9394745bb97c8fc16289adca3" - integrity sha512-ZrRSE2o3Ezh7sb1KmeLEZRZ4mgufbrMwolcFHNRSjKZhpLa8TdooXOOFlSwoUzlbVs1t0l7upVRW2K7RWGHzbQ== +jest-haste-map@^29.1.2: + version "29.1.2" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-29.1.2.tgz#93f3634aa921b6b654e7c94137b24e02e7ca6ac9" + integrity sha512-xSjbY8/BF11Jh3hGSPfYTa/qBFrm3TPM7WU8pU93m2gqzORVLkHFWvuZmFsTEBPRKndfewXhMOuzJNHyJIZGsw== dependencies: - "@jest/types" "^28.1.1" + "@jest/types" "^29.1.2" "@types/graceful-fs" "^4.1.3" "@types/node" "*" anymatch "^3.0.3" fb-watchman "^2.0.0" graceful-fs "^4.2.9" - jest-regex-util "^28.0.2" - jest-util "^28.1.1" - jest-worker "^28.1.1" + jest-regex-util "^29.0.0" + jest-util "^29.1.2" + jest-worker "^29.1.2" micromatch "^4.0.4" walker "^1.0.8" optionalDependencies: fsevents "^2.3.2" -jest-haste-map@^28.1.3: - version "28.1.3" - resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-28.1.3.tgz#abd5451129a38d9841049644f34b034308944e2b" - integrity sha512-3S+RQWDXccXDKSWnkHa/dPwt+2qwA8CJzR61w3FoYCvoo3Pn8tvGcysmMF0Bj0EX5RYvAI2EIvC57OmotfdtKA== +jest-leak-detector@^29.1.2: + version "29.1.2" + resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-29.1.2.tgz#4c846db14c58219430ccbc4f01a1ec52ebee4fc2" + integrity sha512-TG5gAZJpgmZtjb6oWxBLf2N6CfQ73iwCe6cofu/Uqv9iiAm6g502CAnGtxQaTfpHECBdVEMRBhomSXeLnoKjiQ== dependencies: - "@jest/types" "^28.1.3" - "@types/graceful-fs" "^4.1.3" - "@types/node" "*" - anymatch "^3.0.3" - fb-watchman "^2.0.0" - graceful-fs "^4.2.9" - jest-regex-util "^28.0.2" - jest-util "^28.1.3" - jest-worker "^28.1.3" - micromatch "^4.0.4" - walker "^1.0.8" - optionalDependencies: - fsevents "^2.3.2" - -jest-leak-detector@^28.1.1: - version "28.1.1" - resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-28.1.1.tgz#537f37afd610a4b3f4cab15e06baf60484548efb" - integrity sha512-4jvs8V8kLbAaotE+wFR7vfUGf603cwYtFf1/PYEsyX2BAjSzj8hQSVTP6OWzseTl0xL6dyHuKs2JAks7Pfubmw== - dependencies: - jest-get-type "^28.0.2" - pretty-format "^28.1.1" - -jest-leak-detector@^28.1.3: - version "28.1.3" - resolved "https://registry.yarnpkg.com/jest-leak-detector/-/jest-leak-detector-28.1.3.tgz#a6685d9b074be99e3adee816ce84fd30795e654d" - integrity sha512-WFVJhnQsiKtDEo5lG2mM0v40QWnBM+zMdHHyJs8AWZ7J0QZJS59MsyKeJHWhpBZBH32S48FOVvGyOFT1h0DlqA== - dependencies: - jest-get-type "^28.0.2" - pretty-format "^28.1.3" - -jest-matcher-utils@^28, jest-matcher-utils@^28.0.0, jest-matcher-utils@^28.1.1, jest-matcher-utils@^28.1.3: - version "28.1.3" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-28.1.3.tgz#5a77f1c129dd5ba3b4d7fc20728806c78893146e" - integrity sha512-kQeJ7qHemKfbzKoGjHHrRKH6atgxMk8Enkk2iPQ3XwO6oE/KYD8lMYOziCkeSB9G4adPM4nR1DE8Tf5JeWH6Bw== - dependencies: - chalk "^4.0.0" - jest-diff "^28.1.3" - jest-get-type "^28.0.2" - pretty-format "^28.1.3" + jest-get-type "^29.0.0" + pretty-format "^29.1.2" -jest-message-util@^28.1.1: - version "28.1.1" - resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-28.1.1.tgz#60aa0b475cfc08c8a9363ed2fb9108514dd9ab89" - integrity sha512-xoDOOT66fLfmTRiqkoLIU7v42mal/SqwDKvfmfiWAdJMSJiU+ozgluO7KbvoAgiwIrrGZsV7viETjc8GNrA/IQ== +jest-matcher-utils@^29, jest-matcher-utils@^29.1.2: + version "29.1.2" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-29.1.2.tgz#e68c4bcc0266e70aa1a5c13fb7b8cd4695e318a1" + integrity sha512-MV5XrD3qYSW2zZSHRRceFzqJ39B2z11Qv0KPyZYxnzDHFeYZGJlgGi0SW+IXSJfOewgJp/Km/7lpcFT+cgZypw== dependencies: - "@babel/code-frame" "^7.12.13" - "@jest/types" "^28.1.1" - "@types/stack-utils" "^2.0.0" chalk "^4.0.0" - graceful-fs "^4.2.9" - micromatch "^4.0.4" - pretty-format "^28.1.1" - slash "^3.0.0" - stack-utils "^2.0.3" + jest-diff "^29.1.2" + jest-get-type "^29.0.0" + pretty-format "^29.1.2" -jest-message-util@^28.1.3: - version "28.1.3" - resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-28.1.3.tgz#232def7f2e333f1eecc90649b5b94b0055e7c43d" - integrity sha512-PFdn9Iewbt575zKPf1286Ht9EPoJmYT7P0kY+RibeYZ2XtOr53pDLEFoTWXbd1h4JiGiWpTBC84fc8xMXQMb7g== +jest-message-util@^29.1.2: + version "29.1.2" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-29.1.2.tgz#c21a33c25f9dc1ebfcd0f921d89438847a09a501" + integrity sha512-9oJ2Os+Qh6IlxLpmvshVbGUiSkZVc2FK+uGOm6tghafnB2RyjKAxMZhtxThRMxfX1J1SOMhTn9oK3/MutRWQJQ== dependencies: "@babel/code-frame" "^7.12.13" - "@jest/types" "^28.1.3" + "@jest/types" "^29.1.2" "@types/stack-utils" "^2.0.0" chalk "^4.0.0" graceful-fs "^4.2.9" micromatch "^4.0.4" - pretty-format "^28.1.3" + pretty-format "^29.1.2" slash "^3.0.0" stack-utils "^2.0.3" -jest-mock@^28.1.1: - version "28.1.1" - resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-28.1.1.tgz#37903d269427fa1ef5b2447be874e1c62a39a371" - integrity sha512-bDCb0FjfsmKweAvE09dZT59IMkzgN0fYBH6t5S45NoJfd2DHkS3ySG2K+hucortryhO3fVuXdlxWcbtIuV/Skw== - dependencies: - "@jest/types" "^28.1.1" - "@types/node" "*" - -jest-mock@^28.1.3: - version "28.1.3" - resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-28.1.3.tgz#d4e9b1fc838bea595c77ab73672ebf513ab249da" - integrity sha512-o3J2jr6dMMWYVH4Lh/NKmDXdosrsJgi4AviS8oXLujcjpCMBb1FMsblDnOXKZKfSiHLxYub1eS0IHuRXsio9eA== +jest-mock@^29.1.2: + version "29.1.2" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-29.1.2.tgz#de47807edbb9d4abf8423f1d8d308d670105678c" + integrity sha512-PFDAdjjWbjPUtQPkQufvniXIS3N9Tv7tbibePEjIIprzjgo0qQlyUiVMrT4vL8FaSJo1QXifQUOuPH3HQC/aMA== dependencies: - "@jest/types" "^28.1.3" + "@jest/types" "^29.1.2" "@types/node" "*" + jest-util "^29.1.2" jest-pnp-resolver@^1.2.2: version "1.2.2" resolved "https://registry.yarnpkg.com/jest-pnp-resolver/-/jest-pnp-resolver-1.2.2.tgz#b704ac0ae028a89108a4d040b3f919dfddc8e33c" integrity sha512-olV41bKSMm8BdnuMsewT4jqlZ8+3TCARAXjZGT9jcoSnrfUnRCqnMoF9XEeoWjbzObpqF9dRhHQj0Xb9QdF6/w== -jest-regex-util@^28.0.2: - version "28.0.2" - resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-28.0.2.tgz#afdc377a3b25fb6e80825adcf76c854e5bf47ead" - integrity sha512-4s0IgyNIy0y9FK+cjoVYoxamT7Zeo7MhzqRGx7YDYmaQn1wucY9rotiGkBzzcMXTtjrCAP/f7f+E0F7+fxPNdw== +jest-regex-util@^29.0.0: + version "29.0.0" + resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-29.0.0.tgz#b442987f688289df8eb6c16fa8df488b4cd007de" + integrity sha512-BV7VW7Sy0fInHWN93MMPtlClweYv2qrSCwfeFWmpribGZtQPWNvRSq9XOVgOEjU1iBGRKXUZil0o2AH7Iy9Lug== -jest-resolve-dependencies@^28.1.1: - version "28.1.1" - resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-28.1.1.tgz#3dffaaa56f4b41bc6b61053899d1756401763a27" - integrity sha512-p8Y150xYJth4EXhOuB8FzmS9r8IGLEioiaetgdNGb9VHka4fl0zqWlVe4v7mSkYOuEUg2uB61iE+zySDgrOmgQ== +jest-resolve-dependencies@^29.1.2: + version "29.1.2" + resolved "https://registry.yarnpkg.com/jest-resolve-dependencies/-/jest-resolve-dependencies-29.1.2.tgz#a6919e58a0c7465582cb8ec2d745b4e64ae8647f" + integrity sha512-44yYi+yHqNmH3OoWZvPgmeeiwKxhKV/0CfrzaKLSkZG9gT973PX8i+m8j6pDrTYhhHoiKfF3YUFg/6AeuHw4HQ== dependencies: - jest-regex-util "^28.0.2" - jest-snapshot "^28.1.1" + jest-regex-util "^29.0.0" + jest-snapshot "^29.1.2" -jest-resolve@27.5.1, jest-resolve@^28, jest-resolve@^28.1.1, jest-resolve@^28.1.3: - version "28.1.3" - resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-28.1.3.tgz#cfb36100341ddbb061ec781426b3c31eb51aa0a8" - integrity sha512-Z1W3tTjE6QaNI90qo/BJpfnvpxtaFTFw5CDgwpyE/Kz8U/06N1Hjf4ia9quUhCh39qIGWF1ZuxFiBiJQwSEYKQ== +jest-resolve@28.1.1, jest-resolve@^29, jest-resolve@^29.1.2: + version "29.1.2" + resolved "https://registry.yarnpkg.com/jest-resolve/-/jest-resolve-29.1.2.tgz#9dd8c2fc83e59ee7d676b14bd45a5f89e877741d" + integrity sha512-7fcOr+k7UYSVRJYhSmJHIid3AnDBcLQX3VmT9OSbPWsWz1MfT7bcoerMhADKGvKCoMpOHUQaDHtQoNp/P9JMGg== dependencies: chalk "^4.0.0" graceful-fs "^4.2.9" - jest-haste-map "^28.1.3" + jest-haste-map "^29.1.2" jest-pnp-resolver "^1.2.2" - jest-util "^28.1.3" - jest-validate "^28.1.3" + jest-util "^29.1.2" + jest-validate "^29.1.2" resolve "^1.20.0" resolve.exports "^1.1.0" slash "^3.0.0" -jest-runner@^28.1.1: - version "28.1.1" - resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-28.1.1.tgz#9ecdb3f27a00059986797aa6b012ba8306aa436c" - integrity sha512-W5oFUiDBgTsCloTAj6q95wEvYDB0pxIhY6bc5F26OucnwBN+K58xGTGbliSMI4ChQal5eANDF+xvELaYkJxTmA== +jest-runner@^29.1.2: + version "29.1.2" + resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-29.1.2.tgz#f18b2b86101341e047de8c2f51a5fdc4e97d053a" + integrity sha512-yy3LEWw8KuBCmg7sCGDIqKwJlULBuNIQa2eFSVgVASWdXbMYZ9H/X0tnXt70XFoGf92W2sOQDOIFAA6f2BG04Q== dependencies: - "@jest/console" "^28.1.1" - "@jest/environment" "^28.1.1" - "@jest/test-result" "^28.1.1" - "@jest/transform" "^28.1.1" - "@jest/types" "^28.1.1" - "@types/node" "*" - chalk "^4.0.0" - emittery "^0.10.2" - graceful-fs "^4.2.9" - jest-docblock "^28.1.1" - jest-environment-node "^28.1.1" - jest-haste-map "^28.1.1" - jest-leak-detector "^28.1.1" - jest-message-util "^28.1.1" - jest-resolve "^28.1.1" - jest-runtime "^28.1.1" - jest-util "^28.1.1" - jest-watcher "^28.1.1" - jest-worker "^28.1.1" - source-map-support "0.5.13" - throat "^6.0.1" - -jest-runner@^28.1.3: - version "28.1.3" - resolved "https://registry.yarnpkg.com/jest-runner/-/jest-runner-28.1.3.tgz#5eee25febd730b4713a2cdfd76bdd5557840f9a1" - integrity sha512-GkMw4D/0USd62OVO0oEgjn23TM+YJa2U2Wu5zz9xsQB1MxWKDOlrnykPxnMsN0tnJllfLPinHTka61u0QhaxBA== - dependencies: - "@jest/console" "^28.1.3" - "@jest/environment" "^28.1.3" - "@jest/test-result" "^28.1.3" - "@jest/transform" "^28.1.3" - "@jest/types" "^28.1.3" + "@jest/console" "^29.1.2" + "@jest/environment" "^29.1.2" + "@jest/test-result" "^29.1.2" + "@jest/transform" "^29.1.2" + "@jest/types" "^29.1.2" "@types/node" "*" chalk "^4.0.0" emittery "^0.10.2" graceful-fs "^4.2.9" - jest-docblock "^28.1.1" - jest-environment-node "^28.1.3" - jest-haste-map "^28.1.3" - jest-leak-detector "^28.1.3" - jest-message-util "^28.1.3" - jest-resolve "^28.1.3" - jest-runtime "^28.1.3" - jest-util "^28.1.3" - jest-watcher "^28.1.3" - jest-worker "^28.1.3" + jest-docblock "^29.0.0" + jest-environment-node "^29.1.2" + jest-haste-map "^29.1.2" + jest-leak-detector "^29.1.2" + jest-message-util "^29.1.2" + jest-resolve "^29.1.2" + jest-runtime "^29.1.2" + jest-util "^29.1.2" + jest-watcher "^29.1.2" + jest-worker "^29.1.2" p-limit "^3.1.0" source-map-support "0.5.13" -jest-runtime@^28.1.1: - version "28.1.1" - resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-28.1.1.tgz#569e1dc3c36c6c4c0b29516c1c49b6ad580abdaf" - integrity sha512-J89qEJWW0leOsqyi0D9zHpFEYHwwafFdS9xgvhFHtIdRghbadodI0eA+DrthK/1PebBv3Px8mFSMGKrtaVnleg== - dependencies: - "@jest/environment" "^28.1.1" - "@jest/fake-timers" "^28.1.1" - "@jest/globals" "^28.1.1" - "@jest/source-map" "^28.0.2" - "@jest/test-result" "^28.1.1" - "@jest/transform" "^28.1.1" - "@jest/types" "^28.1.1" - chalk "^4.0.0" - cjs-module-lexer "^1.0.0" - collect-v8-coverage "^1.0.0" - execa "^5.0.0" - glob "^7.1.3" - graceful-fs "^4.2.9" - jest-haste-map "^28.1.1" - jest-message-util "^28.1.1" - jest-mock "^28.1.1" - jest-regex-util "^28.0.2" - jest-resolve "^28.1.1" - jest-snapshot "^28.1.1" - jest-util "^28.1.1" - slash "^3.0.0" - strip-bom "^4.0.0" - -jest-runtime@^28.1.3: - version "28.1.3" - resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-28.1.3.tgz#a57643458235aa53e8ec7821949e728960d0605f" - integrity sha512-NU+881ScBQQLc1JHG5eJGU7Ui3kLKrmwCPPtYsJtBykixrM2OhVQlpMmFWJjMyDfdkGgBMNjXCGB/ebzsgNGQw== - dependencies: - "@jest/environment" "^28.1.3" - "@jest/fake-timers" "^28.1.3" - "@jest/globals" "^28.1.3" - "@jest/source-map" "^28.1.2" - "@jest/test-result" "^28.1.3" - "@jest/transform" "^28.1.3" - "@jest/types" "^28.1.3" +jest-runtime@^29.1.2: + version "29.1.2" + resolved "https://registry.yarnpkg.com/jest-runtime/-/jest-runtime-29.1.2.tgz#dbcd57103d61115479108d5864bdcd661d9c6783" + integrity sha512-jr8VJLIf+cYc+8hbrpt412n5jX3tiXmpPSYTGnwcvNemY+EOuLNiYnHJ3Kp25rkaAcTWOEI4ZdOIQcwYcXIAZw== + dependencies: + "@jest/environment" "^29.1.2" + "@jest/fake-timers" "^29.1.2" + "@jest/globals" "^29.1.2" + "@jest/source-map" "^29.0.0" + "@jest/test-result" "^29.1.2" + "@jest/transform" "^29.1.2" + "@jest/types" "^29.1.2" + "@types/node" "*" chalk "^4.0.0" cjs-module-lexer "^1.0.0" collect-v8-coverage "^1.0.0" - execa "^5.0.0" glob "^7.1.3" graceful-fs "^4.2.9" - jest-haste-map "^28.1.3" - jest-message-util "^28.1.3" - jest-mock "^28.1.3" - jest-regex-util "^28.0.2" - jest-resolve "^28.1.3" - jest-snapshot "^28.1.3" - jest-util "^28.1.3" + jest-haste-map "^29.1.2" + jest-message-util "^29.1.2" + jest-mock "^29.1.2" + jest-regex-util "^29.0.0" + jest-resolve "^29.1.2" + jest-snapshot "^29.1.2" + jest-util "^29.1.2" slash "^3.0.0" strip-bom "^4.0.0" -jest-snapshot@*, jest-snapshot@^27.0.2, jest-snapshot@^28, jest-snapshot@^28.1.0, jest-snapshot@^28.1.1, jest-snapshot@^28.1.3: - version "28.1.3" - resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-28.1.3.tgz#17467b3ab8ddb81e2f605db05583d69388fc0668" - integrity sha512-4lzMgtiNlc3DU/8lZfmqxN3AYD6GGLbl+72rdBpXvcV+whX7mDrREzkPdp2RnmfIiWBg1YbuFSkXduF2JcafJg== +jest-snapshot@*, jest-snapshot@^29, jest-snapshot@^29.0.0, jest-snapshot@^29.0.3, jest-snapshot@^29.1.2: + version "29.1.2" + resolved "https://registry.yarnpkg.com/jest-snapshot/-/jest-snapshot-29.1.2.tgz#7dd277e88c45f2d2ff5888de1612e63c7ceb575b" + integrity sha512-rYFomGpVMdBlfwTYxkUp3sjD6usptvZcONFYNqVlaz4EpHPnDvlWjvmOQ9OCSNKqYZqLM2aS3wq01tWujLg7gg== dependencies: "@babel/core" "^7.11.6" "@babel/generator" "^7.7.2" + "@babel/plugin-syntax-jsx" "^7.7.2" "@babel/plugin-syntax-typescript" "^7.7.2" "@babel/traverse" "^7.7.2" "@babel/types" "^7.3.3" - "@jest/expect-utils" "^28.1.3" - "@jest/transform" "^28.1.3" - "@jest/types" "^28.1.3" + "@jest/expect-utils" "^29.1.2" + "@jest/transform" "^29.1.2" + "@jest/types" "^29.1.2" "@types/babel__traverse" "^7.0.6" "@types/prettier" "^2.1.5" babel-preset-current-node-syntax "^1.0.0" chalk "^4.0.0" - expect "^28.1.3" + expect "^29.1.2" graceful-fs "^4.2.9" - jest-diff "^28.1.3" - jest-get-type "^28.0.2" - jest-haste-map "^28.1.3" - jest-matcher-utils "^28.1.3" - jest-message-util "^28.1.3" - jest-util "^28.1.3" + jest-diff "^29.1.2" + jest-get-type "^29.0.0" + jest-haste-map "^29.1.2" + jest-matcher-utils "^29.1.2" + jest-message-util "^29.1.2" + jest-util "^29.1.2" natural-compare "^1.4.0" - pretty-format "^28.1.3" + pretty-format "^29.1.2" semver "^7.3.5" -jest-specific-snapshot@*, jest-specific-snapshot@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/jest-specific-snapshot/-/jest-specific-snapshot-5.0.0.tgz#48f72d5613af7f3e30df75b6b3534db6bab32ea0" - integrity sha512-V65vuPxZQExD3tGbv+Du5tbG1E3H3Dq/HFbsCEkPJP27w5vr/nATQJl61Dx5doBfu54OrJak0JaeYVSeZubDKg== +jest-specific-snapshot@*, jest-specific-snapshot@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/jest-specific-snapshot/-/jest-specific-snapshot-7.0.0.tgz#c8851bc263b780c0fa750462f61bd98fe956fc64" + integrity sha512-Ut2YItOYFC88Pir/JPN8Cgjvf60N4ZPmIqGJ2iZI+c9SLR27hwJxaEngKpW4RurPb+p45BbSuZoKe9SlVIylQA== dependencies: - jest-snapshot "^27.0.2" + jest-snapshot "^29.0.0" -jest-util@27.5.1, jest-util@^28, jest-util@^28.1.1, jest-util@^28.1.3: - version "28.1.3" - resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-28.1.3.tgz#f4f932aa0074f0679943220ff9cbba7e497028b0" - integrity sha512-XdqfpHwpcSRko/C35uLYFM2emRAltIIKZiJ9eAmhjsj0CqZMa0p1ib0R5fWIqGhn1a103DebTbpqIaP1qCQ6tQ== +jest-util@28.1.1, jest-util@^29, jest-util@^29.1.2: + version "29.1.2" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-29.1.2.tgz#ac5798e93cb6a6703084e194cfa0898d66126df1" + integrity sha512-vPCk9F353i0Ymx3WQq3+a4lZ07NXu9Ca8wya6o4Fe4/aO1e1awMMprZ3woPFpKwghEOW+UXgd15vVotuNN9ONQ== dependencies: - "@jest/types" "^28.1.3" + "@jest/types" "^29.1.2" "@types/node" "*" chalk "^4.0.0" ci-info "^3.2.0" graceful-fs "^4.2.9" picomatch "^2.2.3" -jest-validate@^28.1.1: - version "28.1.1" - resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-28.1.1.tgz#59b7b339b3c85b5144bd0c06ad3600f503a4acc8" - integrity sha512-Kpf6gcClqFCIZ4ti5++XemYJWUPCFUW+N2gknn+KgnDf549iLul3cBuKVe1YcWRlaF8tZV8eJCap0eECOEE3Ug== - dependencies: - "@jest/types" "^28.1.1" - camelcase "^6.2.0" - chalk "^4.0.0" - jest-get-type "^28.0.2" - leven "^3.1.0" - pretty-format "^28.1.1" - -jest-validate@^28.1.3: - version "28.1.3" - resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-28.1.3.tgz#e322267fd5e7c64cea4629612c357bbda96229df" - integrity sha512-SZbOGBWEsaTxBGCOpsRWlXlvNkvTkY0XxRfh7zYmvd8uL5Qzyg0CHAXiXKROflh801quA6+/DsT4ODDthOC/OA== +jest-validate@^29.1.2: + version "29.1.2" + resolved "https://registry.yarnpkg.com/jest-validate/-/jest-validate-29.1.2.tgz#83a728b8f6354da2e52346878c8bc7383516ca51" + integrity sha512-k71pOslNlV8fVyI+mEySy2pq9KdXdgZtm7NHrBX8LghJayc3wWZH0Yr0mtYNGaCU4F1OLPXRkwZR0dBm/ClshA== dependencies: - "@jest/types" "^28.1.3" + "@jest/types" "^29.1.2" camelcase "^6.2.0" chalk "^4.0.0" - jest-get-type "^28.0.2" + jest-get-type "^29.0.0" leven "^3.1.0" - pretty-format "^28.1.3" + pretty-format "^29.1.2" -jest-watcher@^28.1.1: - version "28.1.1" - resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-28.1.1.tgz#533597fb3bfefd52b5cd115cd916cffd237fb60c" - integrity sha512-RQIpeZ8EIJMxbQrXpJQYIIlubBnB9imEHsxxE41f54ZwcqWLysL/A0ZcdMirf+XsMn3xfphVQVV4EW0/p7i7Ug== +jest-watcher@^29.1.2: + version "29.1.2" + resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-29.1.2.tgz#de21439b7d889e2fcf62cc2a4779ef1a3f1f3c62" + integrity sha512-6JUIUKVdAvcxC6bM8/dMgqY2N4lbT+jZVsxh0hCJRbwkIEnbr/aPjMQ28fNDI5lB51Klh00MWZZeVf27KBUj5w== dependencies: - "@jest/test-result" "^28.1.1" - "@jest/types" "^28.1.1" + "@jest/test-result" "^29.1.2" + "@jest/types" "^29.1.2" "@types/node" "*" ansi-escapes "^4.2.1" chalk "^4.0.0" emittery "^0.10.2" - jest-util "^28.1.1" - string-length "^4.0.1" - -jest-watcher@^28.1.3: - version "28.1.3" - resolved "https://registry.yarnpkg.com/jest-watcher/-/jest-watcher-28.1.3.tgz#c6023a59ba2255e3b4c57179fc94164b3e73abd4" - integrity sha512-t4qcqj9hze+jviFPUN3YAtAEeFnr/azITXQEMARf5cMwKY2SMBRnCQTXLixTl20OR6mLh9KLMrgVJgJISym+1g== - dependencies: - "@jest/test-result" "^28.1.3" - "@jest/types" "^28.1.3" - "@types/node" "*" - ansi-escapes "^4.2.1" - chalk "^4.0.0" - emittery "^0.10.2" - jest-util "^28.1.3" + jest-util "^29.1.2" string-length "^4.0.1" jest-worker@^26.2.1: @@ -9659,33 +9461,25 @@ jest-worker@^27.4.5, jest-worker@^27.5.1: merge-stream "^2.0.0" supports-color "^8.0.0" -jest-worker@^28.1.1: - version "28.1.1" - resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-28.1.1.tgz#3480c73247171dfd01eda77200f0063ab6a3bf28" - integrity sha512-Au7slXB08C6h+xbJPp7VIb6U0XX5Kc9uel/WFc6/rcTzGiaVCBRngBExSYuXSLFPULPSYU3cJ3ybS988lNFQhQ== - dependencies: - "@types/node" "*" - merge-stream "^2.0.0" - supports-color "^8.0.0" - -jest-worker@^28.1.3: - version "28.1.3" - resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-28.1.3.tgz#7e3c4ce3fa23d1bb6accb169e7f396f98ed4bb98" - integrity sha512-CqRA220YV/6jCo8VWvAt1KKx6eek1VIHMPeLEbpcfSfkEeWyBNppynM/o6q+Wmw+sOhos2ml34wZbSX3G13//g== +jest-worker@^29.1.2: + version "29.1.2" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-29.1.2.tgz#a68302af61bce82b42a9a57285ca7499d29b2afc" + integrity sha512-AdTZJxKjTSPHbXT/AIOjQVmoFx0LHFcVabWu0sxI7PAy7rFf8c0upyvgBKgguVXdM4vY74JdwkyD4hSmpTW8jA== dependencies: "@types/node" "*" + jest-util "^29.1.2" merge-stream "^2.0.0" supports-color "^8.0.0" -jest@^28.1.0: - version "28.1.1" - resolved "https://registry.yarnpkg.com/jest/-/jest-28.1.1.tgz#3c39a3a09791e16e9ef283597d24ab19a0df701e" - integrity sha512-qw9YHBnjt6TCbIDMPMpJZqf9E12rh6869iZaN08/vpOGgHJSAaLLUn6H8W3IAEuy34Ls3rct064mZLETkxJ2XA== +jest@^29.0.3: + version "29.1.2" + resolved "https://registry.yarnpkg.com/jest/-/jest-29.1.2.tgz#f821a1695ffd6cd0efc3b59d2dfcc70a98582499" + integrity sha512-5wEIPpCezgORnqf+rCaYD1SK+mNN7NsstWzIsuvsnrhR/hSxXWd82oI7DkrbJ+XTD28/eG8SmxdGvukrGGK6Tw== dependencies: - "@jest/core" "^28.1.1" - "@jest/types" "^28.1.1" + "@jest/core" "^29.1.2" + "@jest/types" "^29.1.2" import-local "^3.0.2" - jest-cli "^28.1.1" + jest-cli "^29.1.2" jju@~1.4.0: version "1.4.0" @@ -9708,25 +9502,20 @@ joi@^17.6.0: resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== -js-yaml@^3.13.1: - version "3.14.1" - resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.14.1.tgz#dae812fdb3825fa306609a8717383c50c36a0537" - integrity sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g== - dependencies: - argparse "^1.0.7" - esprima "^4.0.0" - -js-yaml@^4.1.0: +js-yaml@4.1.0, js-yaml@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602" integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA== dependencies: argparse "^2.0.1" -jsbn@~0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513" - integrity sha1-peZUwuWi3rXyAdls77yoDA7y9RM= +js-yaml@^3.10.0, js-yaml@^3.13.1: + version "3.14.1" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.14.1.tgz#dae812fdb3825fa306609a8717383c50c36a0537" + integrity sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g== + dependencies: + argparse "^1.0.7" + esprima "^4.0.0" jsesc@^2.5.1: version "2.5.2" @@ -9753,6 +9542,26 @@ json-parse-even-better-errors@^2.3.0, json-parse-even-better-errors@^2.3.1: resolved "https://registry.yarnpkg.com/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz#7c47805a94319928e05777405dc12e1f7a4ee02d" integrity sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w== +json-schema-to-typescript@^11.0.1: + version "11.0.2" + resolved "https://registry.yarnpkg.com/json-schema-to-typescript/-/json-schema-to-typescript-11.0.2.tgz#80348391abb4ffb75daf312380c2f01c552ffba8" + integrity sha512-XRyeXBJeo/IH4eTP5D1ptX78vCvH86nMDt2k3AxO28C3uYWEDmy4mgPyMpb8bLJ/pJMElOGuQbnKR5Y6NSh3QQ== + dependencies: + "@bcherny/json-schema-ref-parser" "9.0.9" + "@types/json-schema" "^7.0.11" + "@types/lodash" "^4.14.182" + "@types/prettier" "^2.6.1" + cli-color "^2.0.2" + get-stdin "^8.0.0" + glob "^7.1.6" + glob-promise "^4.2.2" + is-glob "^4.0.3" + lodash "^4.17.21" + minimist "^1.2.6" + mkdirp "^1.0.4" + mz "^2.7.0" + prettier "^2.6.2" + json-schema-traverse@^0.4.1: version "0.4.1" resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" @@ -9763,7 +9572,7 @@ json-schema-traverse@^1.0.0: resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz#ae7bcb3656ab77a73ba5c49bf654f38e6b6860e2" integrity sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug== -json-schema@*, json-schema@0.4.0: +json-schema@*, json-schema@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.4.0.tgz#f7de4cf6efab838ebaeb3236474cbba5a1930ab5" integrity sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA== @@ -9778,7 +9587,7 @@ json-stringify-nice@^1.1.4: resolved "https://registry.yarnpkg.com/json-stringify-nice/-/json-stringify-nice-1.1.4.tgz#2c937962b80181d3f317dd39aa323e14f5a60a67" integrity sha512-5Z5RFW63yxReJ7vANgW6eZFGWaQvnPE3WNmZoOJrSkGju2etKA2L5rrOa1sm877TVTFt57A80BH1bArcmlLfPw== -json-stringify-safe@^5.0.1, json-stringify-safe@~5.0.1: +json-stringify-safe@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz#1296a2d58fd45f19a0f6ce01d65701e2c735b6eb" integrity sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus= @@ -9790,15 +9599,15 @@ json5@^1.0.1: dependencies: minimist "^1.2.0" -json5@^2.1.2, json5@^2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.1.tgz#655d50ed1e6f95ad1a3caababd2b0efda10b395c" - integrity sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA== +json5@^2.1.2, json5@^2.2.0, json5@^2.2.1, json5@^2.2.2: + version "2.2.3" + resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.3.tgz#78cd6f1a19bdc12b73db5ad0c61efd66c1e29283" + integrity sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg== -jsonc-parser@3.0.0, jsonc-parser@~3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/jsonc-parser/-/jsonc-parser-3.0.0.tgz#abdd785701c7e7eaca8a9ec8cf070ca51a745a22" - integrity sha512-fQzRfAbIBnR0IQvftw9FJveWiHp72Fg20giDrHz6TdfB12UH/uue0D3hm57UB5KgAVuniLMCaS8P1IMj9NR7cA== +jsonc-parser@3.2.0, jsonc-parser@^3.2.0, jsonc-parser@~3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/jsonc-parser/-/jsonc-parser-3.2.0.tgz#31ff3f4c2b9793f89c67212627c51c6394f88e76" + integrity sha512-gfFQZrcTc8CnKXp6Y4/CBT3fTc0OVuDofpre4aEeEpSBPV5X5v4+Vmx+8snU7RLPrNHPKSgLxGo9YuQzz20o+w== jsonfile@^4.0.0: version "4.0.0" @@ -9821,20 +9630,15 @@ jsonparse@^1.2.0, jsonparse@^1.3.1: resolved "https://registry.yarnpkg.com/jsonparse/-/jsonparse-1.3.1.tgz#3f4dae4a91fac315f71062f8521cc239f1366280" integrity sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA= -jsprim@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/jsprim/-/jsprim-2.0.2.tgz#77ca23dbcd4135cd364800d22ff82c2185803d4d" - integrity sha512-gqXddjPqQ6G40VdnI6T6yObEC+pDNvyP95wdQhkWkg7crHH3km5qP1FsOXEkzEQwnz6gz5qGTn1c2Y52wP3OyQ== - dependencies: - assert-plus "1.0.0" - extsprintf "1.3.0" - json-schema "0.4.0" - verror "1.10.0" +jsonpointer@^5.0.0: + version "5.0.1" + resolved "https://registry.yarnpkg.com/jsonpointer/-/jsonpointer-5.0.1.tgz#2110e0af0900fd37467b5907ecd13a7884a1b559" + integrity sha512-p/nXbhSEcu3pZRdkW1OfJhpsVtW1gd4Wa1fnQc9YLiTfAjn0312eMKimbdIQzuZl9aa9xUGaRlP9T/CJE/ditQ== -"jsx-ast-utils@^2.4.1 || ^3.0.0", jsx-ast-utils@^3.3.1: - version "3.3.1" - resolved "https://registry.yarnpkg.com/jsx-ast-utils/-/jsx-ast-utils-3.3.1.tgz#a3e0f1cb7e230954eab4dcbce9f6288a78f8ba44" - integrity sha512-pxrjmNpeRw5wwVeWyEAk7QJu2GnBO3uzPFmHCKJJFPKK2Cy0cWL23krGtLdnMmbIi6/FjlrQpPyfQI19ByPOhQ== +"jsx-ast-utils@^2.4.1 || ^3.0.0", jsx-ast-utils@^3.3.2: + version "3.3.2" + resolved "https://registry.yarnpkg.com/jsx-ast-utils/-/jsx-ast-utils-3.3.2.tgz#afe5efe4332cd3515c065072bd4d6b0aa22152bd" + integrity sha512-4ZCADZHRkno244xlNnn4AOG6sRQ7iBZ5BbgZ4vW4y5IZw7cVUD1PPeblm1xx/nfmMxPdt/LHsXZW8z/j58+l9Q== dependencies: array-includes "^3.1.5" object.assign "^4.1.2" @@ -9861,6 +9665,13 @@ kind-of@^6.0.0, kind-of@^6.0.2, kind-of@^6.0.3: resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.3.tgz#07c05034a6c349fa06e24fa35aa76db4580ce4dd" integrity sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw== +klaw-sync@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/klaw-sync/-/klaw-sync-6.0.0.tgz#1fd2cfd56ebb6250181114f0a581167099c2b28c" + integrity sha512-nIeuVSzdCCs6TDPTqI8w1Yre34sSq7AkZ4B3sfOBbI2CgVSB4Du4aLQijFU2+lhAFCwt9+42Hel6lQNIv6AntQ== + dependencies: + graceful-fs "^4.1.11" + kleur@^3.0.3: version "3.0.3" resolved "https://registry.yarnpkg.com/kleur/-/kleur-3.0.3.tgz#a79c9ecc86ee1ce3fa6206d1216c501f147fc07e" @@ -9877,9 +9688,9 @@ konami-code-js@^0.8.1: integrity sha512-bJ0tuWYLYiUueIVTpA0MV4h4Gz1X16uuJggh5TpIWXOQoLv0238SU7Im23z2wYKCCBsOfk5j4HKWB/pqdCgu5Q== konamimojisplosion@^0.5.1: - version "0.5.1" - resolved "https://registry.yarnpkg.com/konamimojisplosion/-/konamimojisplosion-0.5.1.tgz#610108e3d36bf83d9d26a2e0f3f180491b8023af" - integrity sha512-eT8nElztw28D/xlirsm50NxBYt1LgHQg8qaTJ3S2c363YmhesGKSptckEJS2yQpwQsAPe0QpJxUp/z1gnWXl0A== + version "0.5.2" + resolved "https://registry.yarnpkg.com/konamimojisplosion/-/konamimojisplosion-0.5.2.tgz#9ccc1ad5e727a3934e3a7a0335246c87d6a0de2e" + integrity sha512-gPZ+0a720xl9OcfJOUw549fnij0xsP78GupIhl0irnJF6wwIhHSjHEp75qrXNVJb2p9Rtui5yOeJQoUcLy1lvQ== dependencies: emojisplosion "^2.6.1" konami-code-js "^0.8.1" @@ -9903,34 +9714,36 @@ latest-version@^5.1.0: dependencies: package-json "^6.3.0" -lazy-ass@^1.6.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/lazy-ass/-/lazy-ass-1.6.0.tgz#7999655e8646c17f089fdd187d150d3324d54513" - integrity sha1-eZllXoZGwX8In90YfRUNMyTVRRM= - -lerna@5.1.8: - version "5.1.8" - resolved "https://registry.yarnpkg.com/lerna/-/lerna-5.1.8.tgz#77b2f10882c3eaec256fa9a643a21957e6ca7ec2" - integrity sha512-KrpFx2l1x1X7wb9unqRU7OZTaNs5+67VQ1vxf8fIMgdtCAjEqkLxF/F3xLs+KBMws5PV19Q9YtPHn7SiwDl7iQ== - dependencies: - "@lerna/add" "5.1.8" - "@lerna/bootstrap" "5.1.8" - "@lerna/changed" "5.1.8" - "@lerna/clean" "5.1.8" - "@lerna/cli" "5.1.8" - "@lerna/create" "5.1.8" - "@lerna/diff" "5.1.8" - "@lerna/exec" "5.1.8" - "@lerna/import" "5.1.8" - "@lerna/info" "5.1.8" - "@lerna/init" "5.1.8" - "@lerna/link" "5.1.8" - "@lerna/list" "5.1.8" - "@lerna/publish" "5.1.8" - "@lerna/run" "5.1.8" - "@lerna/version" "5.1.8" +lerna@6.4.1: + version "6.4.1" + resolved "https://registry.yarnpkg.com/lerna/-/lerna-6.4.1.tgz#a1e5abcb6c00de3367f50d75eca449e382525e0f" + integrity sha512-0t8TSG4CDAn5+vORjvTFn/ZEGyc4LOEsyBUpzcdIxODHPKM4TVOGvbW9dBs1g40PhOrQfwhHS+3fSx/42j42dQ== + dependencies: + "@lerna/add" "6.4.1" + "@lerna/bootstrap" "6.4.1" + "@lerna/changed" "6.4.1" + "@lerna/clean" "6.4.1" + "@lerna/cli" "6.4.1" + "@lerna/command" "6.4.1" + "@lerna/create" "6.4.1" + "@lerna/diff" "6.4.1" + "@lerna/exec" "6.4.1" + "@lerna/filter-options" "6.4.1" + "@lerna/import" "6.4.1" + "@lerna/info" "6.4.1" + "@lerna/init" "6.4.1" + "@lerna/link" "6.4.1" + "@lerna/list" "6.4.1" + "@lerna/publish" "6.4.1" + "@lerna/run" "6.4.1" + "@lerna/validation-error" "6.4.1" + "@lerna/version" "6.4.1" + "@nrwl/devkit" ">=15.4.2 < 16" import-local "^3.0.2" + inquirer "^8.2.4" npmlog "^6.0.2" + nx ">=15.4.2 < 16" + typescript "^3 || ^4" leven@^3.1.0: version "3.1.0" @@ -9945,26 +9758,26 @@ levn@^0.4.1: prelude-ls "^1.2.1" type-check "~0.4.0" -libnpmaccess@^4.0.1: - version "4.0.3" - resolved "https://registry.yarnpkg.com/libnpmaccess/-/libnpmaccess-4.0.3.tgz#dfb0e5b0a53c315a2610d300e46b4ddeb66e7eec" - integrity sha512-sPeTSNImksm8O2b6/pf3ikv4N567ERYEpeKRPSmqlNt1dTZbvgpJIzg5vAhXHpw2ISBsELFRelk0jEahj1c6nQ== +libnpmaccess@^6.0.3: + version "6.0.3" + resolved "https://registry.yarnpkg.com/libnpmaccess/-/libnpmaccess-6.0.3.tgz#473cc3e4aadb2bc713419d92e45d23b070d8cded" + integrity sha512-4tkfUZprwvih2VUZYMozL7EMKgQ5q9VW2NtRyxWtQWlkLTAWHRklcAvBN49CVqEkhUw7vTX2fNgB5LzgUucgYg== dependencies: aproba "^2.0.0" minipass "^3.1.1" - npm-package-arg "^8.1.2" - npm-registry-fetch "^11.0.0" + npm-package-arg "^9.0.1" + npm-registry-fetch "^13.0.0" -libnpmpublish@^4.0.0: - version "4.0.2" - resolved "https://registry.yarnpkg.com/libnpmpublish/-/libnpmpublish-4.0.2.tgz#be77e8bf5956131bcb45e3caa6b96a842dec0794" - integrity sha512-+AD7A2zbVeGRCFI2aO//oUmapCwy7GHqPXFJh3qpToSRNU+tXKJ2YFUgjt04LPPAf2dlEH95s6EhIHM1J7bmOw== +libnpmpublish@^6.0.4: + version "6.0.4" + resolved "https://registry.yarnpkg.com/libnpmpublish/-/libnpmpublish-6.0.4.tgz#adb41ec6b0c307d6f603746a4d929dcefb8f1a0b" + integrity sha512-lvAEYW8mB8QblL6Q/PI/wMzKNvIrF7Kpujf/4fGS/32a2i3jzUXi04TNyIBcK6dQJ34IgywfaKGh+Jq4HYPFmg== dependencies: - normalize-package-data "^3.0.2" - npm-package-arg "^8.1.2" - npm-registry-fetch "^11.0.0" - semver "^7.1.3" - ssri "^8.0.1" + normalize-package-data "^4.0.0" + npm-package-arg "^9.0.1" + npm-registry-fetch "^13.0.0" + semver "^7.3.7" + ssri "^9.0.0" lilconfig@2.0.5, lilconfig@^2.0.3: version "2.0.5" @@ -9976,10 +9789,15 @@ lines-and-columns@^1.1.6: resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.1.6.tgz#1c00c743b433cd0a4e80758f7b64a57440d9ff00" integrity sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA= -linkify-it@^3.0.1: - version "3.0.3" - resolved "https://registry.yarnpkg.com/linkify-it/-/linkify-it-3.0.3.tgz#a98baf44ce45a550efb4d49c769d07524cc2fa2e" - integrity sha512-ynTsyrFSdE5oZ/O9GEf00kPngmOfVwazR5GKDq6EYfhlpFug3J2zybX56a2PRRpc9P+FuSoGNAwjlbDs9jJBPQ== +lines-and-columns@~2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-2.0.3.tgz#b2f0badedb556b747020ab8ea7f0373e22efac1b" + integrity sha512-cNOjgCnLB+FnvWWtyRTzmB3POJ+cXxTA81LoW7u8JdmhfXzriropYwpjShnz1QLLWsQwY7nIxoDmcPTwphDK9w== + +linkify-it@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/linkify-it/-/linkify-it-4.0.1.tgz#01f1d5e508190d06669982ba31a7d9f56a5751ec" + integrity sha512-C7bfi1UZmoj8+PQx22XyeXCuBlokoyWQL5pWSP+EI6nzRylyThouddufc2c1NDIcP9k5agmN9fLpA7VNJfIiqw== dependencies: uc.micro "^1.0.1" @@ -10002,20 +9820,6 @@ lint-staged@^13.0.0: string-argv "^0.3.1" yaml "^2.1.1" -listr2@^3.8.3: - version "3.13.5" - resolved "https://registry.yarnpkg.com/listr2/-/listr2-3.13.5.tgz#105a813f2eb2329c4aae27373a281d610ee4985f" - integrity sha512-3n8heFQDSk+NcwBn3CgxEibZGaRzx+pC64n3YjpMD1qguV4nWus3Al+Oo3KooqFKTQEJ1v7MmnbnyyNspgx3NA== - dependencies: - cli-truncate "^2.1.0" - colorette "^2.0.16" - log-update "^4.0.0" - p-map "^4.0.0" - rfdc "^1.3.0" - rxjs "^7.4.0" - through "^2.3.8" - wrap-ansi "^7.0.0" - listr2@^4.0.5: version "4.0.5" resolved "https://registry.yarnpkg.com/listr2/-/listr2-4.0.5.tgz#9dcc50221583e8b4c71c43f9c7dfd0ef546b75d5" @@ -10099,16 +9903,6 @@ locate-path@^6.0.0: dependencies: p-locate "^5.0.0" -lodash.assignin@^4.0.9: - version "4.2.0" - resolved "https://registry.yarnpkg.com/lodash.assignin/-/lodash.assignin-4.2.0.tgz#ba8df5fb841eb0a3e8044232b0e263a8dc6a28a2" - integrity sha1-uo31+4QesKPoBEIysOJjqNxqKKI= - -lodash.bind@^4.1.4: - version "4.2.1" - resolved "https://registry.yarnpkg.com/lodash.bind/-/lodash.bind-4.2.1.tgz#7ae3017e939622ac31b7d7d7dcb1b34db1690d35" - integrity sha1-euMBfpOWIqwxt9fX3LGzTbFpDTU= - lodash.curry@^4.0.1: version "4.1.1" resolved "https://registry.yarnpkg.com/lodash.curry/-/lodash.curry-4.1.1.tgz#248e36072ede906501d75966200a86dab8b23170" @@ -10119,31 +9913,11 @@ lodash.debounce@^4.0.8: resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af" integrity sha1-gteb/zCmfEAF/9XiUVMArZyk168= -lodash.defaults@^4.0.1: - version "4.2.0" - resolved "https://registry.yarnpkg.com/lodash.defaults/-/lodash.defaults-4.2.0.tgz#d09178716ffea4dde9e5fb7b37f6f0802274580c" - integrity sha1-0JF4cW/+pN3p5ft7N/bwgCJ0WAw= - -lodash.filter@^4.4.0: - version "4.6.0" - resolved "https://registry.yarnpkg.com/lodash.filter/-/lodash.filter-4.6.0.tgz#668b1d4981603ae1cc5a6fa760143e480b4c4ace" - integrity sha1-ZosdSYFgOuHMWm+nYBQ+SAtMSs4= - -lodash.flatten@^4.2.0: - version "4.4.0" - resolved "https://registry.yarnpkg.com/lodash.flatten/-/lodash.flatten-4.4.0.tgz#f31c22225a9632d2bbf8e4addbef240aa765a61f" - integrity sha1-8xwiIlqWMtK7+OSt2+8kCqdlph8= - lodash.flow@^3.3.0: version "3.5.0" resolved "https://registry.yarnpkg.com/lodash.flow/-/lodash.flow-3.5.0.tgz#87bf40292b8cf83e4e8ce1a3ae4209e20071675a" integrity sha1-h79AKSuM+D5OjOGjrkIJ4gBxZ1o= -lodash.foreach@^4.3.0: - version "4.5.0" - resolved "https://registry.yarnpkg.com/lodash.foreach/-/lodash.foreach-4.5.0.tgz#1a6a35eace401280c7f06dddec35165ab27e3e53" - integrity sha1-Gmo16s5AEoDH8G3d7DUWWrJ+PlM= - lodash.get@^4.4.2: version "4.4.2" resolved "https://registry.yarnpkg.com/lodash.get/-/lodash.get-4.4.2.tgz#2d177f652fa31e939b4438d5341499dfa3825e99" @@ -10159,57 +9933,32 @@ lodash.ismatch@^4.4.0: resolved "https://registry.yarnpkg.com/lodash.ismatch/-/lodash.ismatch-4.4.0.tgz#756cb5150ca3ba6f11085a78849645f188f85f37" integrity sha1-dWy1FQyjum8RCFp4hJZF8Yj4Xzc= -lodash.map@^4.4.0: - version "4.6.0" - resolved "https://registry.yarnpkg.com/lodash.map/-/lodash.map-4.6.0.tgz#771ec7839e3473d9c4cde28b19394c3562f4f6d3" - integrity sha1-dx7Hg540c9nEzeKLGTlMNWL09tM= - lodash.memoize@^4.1.2: version "4.1.2" resolved "https://registry.yarnpkg.com/lodash.memoize/-/lodash.memoize-4.1.2.tgz#bcc6c49a42a2840ed997f323eada5ecd182e0bfe" integrity sha1-vMbEmkKihA7Zl/Mj6tpezRguC/4= -lodash.merge@^4.4.0, lodash.merge@^4.6.2: +lodash.merge@^4.6.2: version "4.6.2" resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a" integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ== -lodash.once@^4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/lodash.once/-/lodash.once-4.1.1.tgz#0dd3971213c7c56df880977d504c88fb471a97ac" - integrity sha1-DdOXEhPHxW34gJd9UEyI+0cal6w= - -lodash.pick@^4.2.1: - version "4.4.0" - resolved "https://registry.yarnpkg.com/lodash.pick/-/lodash.pick-4.4.0.tgz#52f05610fff9ded422611441ed1fc123a03001b3" - integrity sha1-UvBWEP/53tQiYRRB7R/BI6AwAbM= - -lodash.reduce@^4.4.0: - version "4.6.0" - resolved "https://registry.yarnpkg.com/lodash.reduce/-/lodash.reduce-4.6.0.tgz#f1ab6b839299ad48f784abbf476596f03b914d3b" - integrity sha1-8atrg5KZrUj3hKu/R2WW8DuRTTs= - -lodash.reject@^4.4.0: - version "4.6.0" - resolved "https://registry.yarnpkg.com/lodash.reject/-/lodash.reject-4.6.0.tgz#80d6492dc1470864bbf583533b651f42a9f52415" - integrity sha1-gNZJLcFHCGS79YNTO2UfQqn1JBU= - -lodash.some@^4.4.0: - version "4.6.0" - resolved "https://registry.yarnpkg.com/lodash.some/-/lodash.some-4.6.0.tgz#1bb9f314ef6b8baded13b549169b2a945eb68e4d" - integrity sha1-G7nzFO9ri63tE7VJFpsqlF62jk0= +lodash.sortby@^4.7.0: + version "4.7.0" + resolved "https://registry.yarnpkg.com/lodash.sortby/-/lodash.sortby-4.7.0.tgz#edd14c824e2cc9c1e0b0a1b42bb5210516a42438" + integrity sha512-HDWXG8isMntAyRF5vZ7xKuEvOhT4AhlRt/3czTSjvGUxjYCBVRQY48ViDHyfYz9VIoBkW4TMGQNapx+l3RUwdA== lodash.uniq@4.5.0, lodash.uniq@^4.5.0: version "4.5.0" resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773" integrity sha1-0CJTc662Uq3BvILklFM5qEJ1R3M= -lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.20, lodash@^4.17.21, lodash@^4.7.0, lodash@~4.17.15: +lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.20, lodash@^4.17.21, lodash@~4.17.15: version "4.17.21" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== -log-symbols@^4.0.0: +log-symbols@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-4.1.0.tgz#3fbdbb95b4683ac9fc785111e792e558d4abd503" integrity sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg== @@ -10263,6 +10012,13 @@ lru-cache@^7.4.4, lru-cache@^7.5.1, lru-cache@^7.7.1: resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-7.10.1.tgz#db577f42a94c168f676b638d15da8fb073448cab" integrity sha512-BQuhQxPuRl79J5zSXRP+uNzPOyZw2oFI9JLRQ80XswSvg21KMKNtQza9eF42rfI/3Z40RvzBdXgziEkudzjo8A== +lru-queue@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/lru-queue/-/lru-queue-0.1.0.tgz#2738bd9f0d3cf4f84490c5736c48699ac632cda3" + integrity sha512-BpdYkt9EvGl8OfWHDQPISVpcl5xZthb+XPsbELj5AQXxIC8IriDZIQYjBJPEm5rS420sjZ0TLEzRcq5KdBhYrQ== + dependencies: + es5-ext "~0.10.2" + lzstring.ts@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/lzstring.ts/-/lzstring.ts-2.0.2.tgz#1d269bd6ab423713f31e614f67018110ed860129" @@ -10270,12 +10026,19 @@ lzstring.ts@^2.0.2: dependencies: tslib "^1.10.0" -magic-string@^0.25.7: - version "0.25.7" - resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.25.7.tgz#3f497d6fd34c669c6798dcb821f2ef31f5445051" - integrity sha512-4CrMT5DOHTDk4HYDlzmwu4FVCcIYI8gauveasrdCu2IKIFOJ3f0v/8MDGJCDL9oD2ppz/Av1b0Nj345H9M+XIA== +magic-string@^0.25.0, magic-string@^0.25.7: + version "0.25.9" + resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.25.9.tgz#de7f9faf91ef8a1c91d02c2e5314c8277dbcdd1c" + integrity sha512-RmF0AsMzgt25qzqqLc1+MbHmhdx0ojF2Fvs4XnOqz2ZOBXzzkEwc/dJQZCYHAn7v1jbVOjAZfK8msRn4BxO4VQ== + dependencies: + sourcemap-codec "^1.4.8" + +magic-string@^0.26.4: + version "0.26.7" + resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.26.7.tgz#caf7daf61b34e9982f8228c4527474dac8981d6f" + integrity sha512-hX9XH3ziStPoPhJxLq1syWuZMxbDvGNbVchfrdCtanC7D13888bMFow61x8axrx+GfHLtVeAx2kxL7tTGRl+Ow== dependencies: - sourcemap-codec "^1.4.4" + sourcemap-codec "^1.4.8" make-dir@*, make-dir@^3.0.0, make-dir@^3.0.2, make-dir@^3.1.0: version "3.1.0" @@ -10319,49 +10082,6 @@ make-fetch-happen@^10.0.3, make-fetch-happen@^10.0.6: socks-proxy-agent "^6.1.1" ssri "^9.0.0" -make-fetch-happen@^8.0.9: - version "8.0.14" - resolved "https://registry.yarnpkg.com/make-fetch-happen/-/make-fetch-happen-8.0.14.tgz#aaba73ae0ab5586ad8eaa68bd83332669393e222" - integrity sha512-EsS89h6l4vbfJEtBZnENTOFk8mCRpY5ru36Xe5bcX1KYIli2mkSHqoFsp5O1wMDvTJJzxe/4THpCTtygjeeGWQ== - dependencies: - agentkeepalive "^4.1.3" - cacache "^15.0.5" - http-cache-semantics "^4.1.0" - http-proxy-agent "^4.0.1" - https-proxy-agent "^5.0.0" - is-lambda "^1.0.1" - lru-cache "^6.0.0" - minipass "^3.1.3" - minipass-collect "^1.0.2" - minipass-fetch "^1.3.2" - minipass-flush "^1.0.5" - minipass-pipeline "^1.2.4" - promise-retry "^2.0.1" - socks-proxy-agent "^5.0.0" - ssri "^8.0.0" - -make-fetch-happen@^9.0.1: - version "9.1.0" - resolved "https://registry.yarnpkg.com/make-fetch-happen/-/make-fetch-happen-9.1.0.tgz#53085a09e7971433e6765f7971bf63f4e05cb968" - integrity sha512-+zopwDy7DNknmwPQplem5lAZX/eCOzSvSNNcSKm5eVwTkOBzoktEfXsa9L23J/GIRhxRsaxzkPEhrJEpE2F4Gg== - dependencies: - agentkeepalive "^4.1.3" - cacache "^15.2.0" - http-cache-semantics "^4.1.0" - http-proxy-agent "^4.0.1" - https-proxy-agent "^5.0.0" - is-lambda "^1.0.1" - lru-cache "^6.0.0" - minipass "^3.1.3" - minipass-collect "^1.0.2" - minipass-fetch "^1.3.2" - minipass-flush "^1.0.5" - minipass-pipeline "^1.2.4" - negotiator "^0.6.2" - promise-retry "^2.0.1" - socks-proxy-agent "^6.0.0" - ssri "^8.0.0" - makeerror@1.0.12: version "1.0.12" resolved "https://registry.yarnpkg.com/makeerror/-/makeerror-1.0.12.tgz#3e5dd2079a82e812e983cc6610c4a2cb0eaa801a" @@ -10384,49 +10104,48 @@ markdown-escapes@^1.0.0: resolved "https://registry.yarnpkg.com/markdown-escapes/-/markdown-escapes-1.0.4.tgz#c95415ef451499d7602b91095f3c8e8975f78535" integrity sha512-8z4efJYk43E0upd0NbVXwgSTQs6cT3T06etieCMEg7dRbzCbxUCK/GHlX8mhHRDcp+OLlHkPKsvqQTCvsRl2cg== -markdown-it@12.3.2: - version "12.3.2" - resolved "https://registry.yarnpkg.com/markdown-it/-/markdown-it-12.3.2.tgz#bf92ac92283fe983fe4de8ff8abfb5ad72cd0c90" - integrity sha512-TchMembfxfNVpHkbtriWltGWc+m3xszaRD0CZup7GFFhzIgQqxIfn3eGj1yZpfuflzPvfkt611B2Q/Bsk1YnGg== +markdown-it@13.0.1: + version "13.0.1" + resolved "https://registry.yarnpkg.com/markdown-it/-/markdown-it-13.0.1.tgz#c6ecc431cacf1a5da531423fc6a42807814af430" + integrity sha512-lTlxriVoy2criHP0JKRhO2VDG9c2ypWCsT237eDiLqi09rmbKoUetyGHq2uOIRoRS//kfoJckS0eUzzkDR+k2Q== dependencies: argparse "^2.0.1" - entities "~2.1.0" - linkify-it "^3.0.1" + entities "~3.0.1" + linkify-it "^4.0.1" mdurl "^1.0.1" uc.micro "^1.0.5" -markdownlint-cli@^0.31.1: - version "0.31.1" - resolved "https://registry.yarnpkg.com/markdownlint-cli/-/markdownlint-cli-0.31.1.tgz#8db34eec453e84bed06a954c8a289333f7c2c1c7" - integrity sha512-keIOMwQn+Ch7MoBwA+TdkyVMuxAeZFEGmIIlvwgV0Z1TGS5MxPnRr29XCLhkNzCHU+uNKGjU+VEjLX+Z9kli6g== +markdown-table@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/markdown-table/-/markdown-table-3.0.2.tgz#9b59eb2c1b22fe71954a65ff512887065a7bb57c" + integrity sha512-y8j3a5/DkJCmS5x4dMCQL+OR0+2EAq3DOtio1COSHsmW2BGXnNCK3v12hJt1LrUz5iZH5g0LmuYOjDdI+czghA== + +markdownlint-cli@^0.33.0: + version "0.33.0" + resolved "https://registry.yarnpkg.com/markdownlint-cli/-/markdownlint-cli-0.33.0.tgz#703af1234c32c309ab52fcd0e8bc797a34e2b096" + integrity sha512-zMK1oHpjYkhjO+94+ngARiBBrRDEUMzooDHBAHtmEIJ9oYddd9l3chCReY2mPlecwH7gflQp1ApilTo+o0zopQ== dependencies: - commander "~9.0.0" + commander "~9.4.1" get-stdin "~9.0.0" - glob "~7.2.0" - ignore "~5.2.0" + glob "~8.0.3" + ignore "~5.2.4" js-yaml "^4.1.0" - jsonc-parser "~3.0.0" - markdownlint "~0.25.1" - markdownlint-rule-helpers "~0.16.0" - minimatch "~3.0.5" - run-con "~1.2.10" + jsonc-parser "~3.2.0" + markdownlint "~0.27.0" + minimatch "~5.1.2" + run-con "~1.2.11" -markdownlint-rule-helpers@~0.16.0: - version "0.16.0" - resolved "https://registry.yarnpkg.com/markdownlint-rule-helpers/-/markdownlint-rule-helpers-0.16.0.tgz#c327f72782bd2b9475127a240508231f0413a25e" - integrity sha512-oEacRUVeTJ5D5hW1UYd2qExYI0oELdYK72k1TKGvIeYJIbqQWAz476NAc7LNixSySUhcNl++d02DvX0ccDk9/w== - -markdownlint@~0.25.1: - version "0.25.1" - resolved "https://registry.yarnpkg.com/markdownlint/-/markdownlint-0.25.1.tgz#df04536607ebeeda5ccd5e4f38138823ed623788" - integrity sha512-AG7UkLzNa1fxiOv5B+owPsPhtM4D6DoODhsJgiaNg1xowXovrYgOnLqAgOOFQpWOlHFVQUzjMY5ypNNTeov92g== +markdownlint@~0.27.0: + version "0.27.0" + resolved "https://registry.yarnpkg.com/markdownlint/-/markdownlint-0.27.0.tgz#9dabf7710a4999e2835e3c68317f1acd0bc89049" + integrity sha512-HtfVr/hzJJmE0C198F99JLaeada+646B5SaG2pVoEakLFI6iRGsvMqrnnrflq8hm1zQgwskEgqSnhDW11JBp0w== dependencies: - markdown-it "12.3.2" + markdown-it "13.0.1" marked@^4.0.15: - version "4.0.15" - resolved "https://registry.yarnpkg.com/marked/-/marked-4.0.15.tgz#0216b7c9d5fcf6ac5042343c41d81a8b1b5e1b4a" - integrity sha512-esX5lPdTfG4p8LDkv+obbRCyOKzB+820ZZyMOXJZygZBHrH9b3xXR64X4kT3sPe9Nx8qQXbmcz6kFSMt4Nfk6Q== + version "4.1.1" + resolved "https://registry.yarnpkg.com/marked/-/marked-4.1.1.tgz#2f709a4462abf65a283f2453dc1c42ab177d302e" + integrity sha512-0cNMnTcUJPxbA6uWmCmjWz4NJRe/0Xfk2NhXCUHjew9qJzFN20krFnsUe7QynwqOwa5m1fZ4UDg0ycKFVC0ccw== mdast-squeeze-paragraphs@^4.0.0: version "4.0.0" @@ -10483,6 +10202,20 @@ memfs@^3.1.2, memfs@^3.4.1: dependencies: fs-monkey "1.0.3" +memoizee@^0.4.15: + version "0.4.15" + resolved "https://registry.yarnpkg.com/memoizee/-/memoizee-0.4.15.tgz#e6f3d2da863f318d02225391829a6c5956555b72" + integrity sha512-UBWmJpLZd5STPm7PMUlOw/TSy972M+z8gcyQ5veOnSDRREz/0bmpyTfKt3/51DhEBqCZQn1udM/5flcSPYhkdQ== + dependencies: + d "^1.0.1" + es5-ext "^0.10.53" + es6-weak-map "^2.0.3" + event-emitter "^0.3.5" + is-promise "^2.2.2" + lru-queue "^0.1.0" + next-tick "^1.1.0" + timers-ext "^0.1.7" + meow@^8.0.0: version "8.1.2" resolved "https://registry.yarnpkg.com/meow/-/meow-8.1.2.tgz#bcbe45bda0ee1729d350c03cffc8395a36c4e897" @@ -10545,7 +10278,7 @@ mime-types@2.1.18: dependencies: mime-db "~1.33.0" -mime-types@^2.1.12, mime-types@^2.1.27, mime-types@^2.1.31, mime-types@~2.1.17, mime-types@~2.1.19, mime-types@~2.1.24, mime-types@~2.1.34: +mime-types@^2.1.12, mime-types@^2.1.27, mime-types@^2.1.31, mime-types@~2.1.17, mime-types@~2.1.24, mime-types@~2.1.34: version "2.1.35" resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.35.tgz#381a871b62a734450660ae3deee44813f70d959a" integrity sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw== @@ -10590,10 +10323,10 @@ mini-create-react-context@^0.4.0: "@babel/runtime" "^7.12.1" tiny-warning "^1.0.3" -mini-css-extract-plugin@^2.6.0: - version "2.6.0" - resolved "https://registry.yarnpkg.com/mini-css-extract-plugin/-/mini-css-extract-plugin-2.6.0.tgz#578aebc7fc14d32c0ad304c2c34f08af44673f5e" - integrity sha512-ndG8nxCEnAemsg4FSgS+yNyHKgkTB4nPKqCOgh65j3/30qqC5RaSQQXMm++Y6sb6E1zRSxPkztj9fqxhS1Eo6w== +mini-css-extract-plugin@^2.6.1: + version "2.6.1" + resolved "https://registry.yarnpkg.com/mini-css-extract-plugin/-/mini-css-extract-plugin-2.6.1.tgz#9a1251d15f2035c342d99a468ab9da7a0451b71e" + integrity sha512-wd+SD57/K6DiV7jIR34P+s3uckTRuQvx0tKPcvjFlrEylk6P4mQ2KSWk1hblj1Kxaqok7LogKOieygXqBczNlg== dependencies: schema-utils "^4.0.0" @@ -10609,6 +10342,13 @@ minimatch@3.0.4: dependencies: brace-expansion "^1.1.7" +minimatch@3.0.5: + version "3.0.5" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.5.tgz#4da8f1290ee0f0f8e83d60ca69f8f134068604a3" + integrity sha512-tUpxzX0VAzJHjLu0xUfFv1gwVp9ba3IOuRAVH2EGuRW8a5emA2FlACLqiT/lDVtS1W+TGNwqz3sWaNyLgDJWuw== + dependencies: + brace-expansion "^1.1.7" + minimatch@^3.0.4, minimatch@^3.1.1, minimatch@^3.1.2: version "3.1.2" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" @@ -10616,20 +10356,13 @@ minimatch@^3.0.4, minimatch@^3.1.1, minimatch@^3.1.2: dependencies: brace-expansion "^1.1.7" -minimatch@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-5.0.1.tgz#fb9022f7528125187c92bd9e9b6366be1cf3415b" - integrity sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g== +minimatch@^5.0.1, minimatch@~5.1.2: + version "5.1.6" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-5.1.6.tgz#1cfcb8cf5522ea69952cd2af95ae09477f122a96" + integrity sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g== dependencies: brace-expansion "^2.0.1" -minimatch@~3.0.5: - version "3.0.8" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.8.tgz#5e6a59bd11e2ab0de1cfb843eb2d82e546c321c1" - integrity sha512-6FsRAQsxQ61mw+qP1ZzbL9Bc78x2p5OqNgNpnoAFLTrX8n5Kxph0CsnhmKKNXTWjXqU5L0pGPR7hYk+XWZr60Q== - dependencies: - brace-expansion "^1.1.7" - minimist-options@4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/minimist-options/-/minimist-options-4.1.0.tgz#c0655713c53a8a2ebd77ffa247d342c40f010619" @@ -10651,17 +10384,6 @@ minipass-collect@^1.0.2: dependencies: minipass "^3.0.0" -minipass-fetch@^1.3.0, minipass-fetch@^1.3.2: - version "1.4.1" - resolved "https://registry.yarnpkg.com/minipass-fetch/-/minipass-fetch-1.4.1.tgz#d75e0091daac1b0ffd7e9d41629faff7d0c1f1b6" - integrity sha512-CGH1eblLq26Y15+Azk7ey4xh0J/XfJfrCox5LDJiKqI2Q2iwOLOKrlmIaODiSQS8d18jalF6y2K2ePUm0CmShw== - dependencies: - minipass "^3.1.0" - minipass-sized "^1.0.3" - minizlib "^2.0.0" - optionalDependencies: - encoding "^0.1.12" - minipass-fetch@^2.0.3: version "2.1.0" resolved "https://registry.yarnpkg.com/minipass-fetch/-/minipass-fetch-2.1.0.tgz#ca1754a5f857a3be99a9271277246ac0b44c3ff8" @@ -10688,7 +10410,7 @@ minipass-json-stream@^1.0.1: jsonparse "^1.3.1" minipass "^3.0.0" -minipass-pipeline@^1.2.2, minipass-pipeline@^1.2.4: +minipass-pipeline@^1.2.4: version "1.2.4" resolved "https://registry.yarnpkg.com/minipass-pipeline/-/minipass-pipeline-1.2.4.tgz#68472f79711c084657c067c5c6ad93cddea8214c" integrity sha512-xuIq7cIOt09RPRJ19gdi4b+RiNvDFYe5JH+ggNvBqGqpQXcru3PcRmOZuHBKWK1Txf9+cQ+HMVN4d6z46LZP7A== @@ -10702,14 +10424,14 @@ minipass-sized@^1.0.3: dependencies: minipass "^3.0.0" -minipass@^3.0.0, minipass@^3.1.0, minipass@^3.1.1, minipass@^3.1.3, minipass@^3.1.6: +minipass@^3.0.0, minipass@^3.1.1, minipass@^3.1.6: version "3.1.6" resolved "https://registry.yarnpkg.com/minipass/-/minipass-3.1.6.tgz#3b8150aa688a711a1521af5e8779c1d3bb4f45ee" integrity sha512-rty5kpw9/z8SX9dmxblFA6edItUmwJgMeYDZRrwlIVN27i8gysGbznJwUggw2V/FVqFSDdWy040ZPS811DYAqQ== dependencies: yallist "^4.0.0" -minizlib@^2.0.0, minizlib@^2.1.1, minizlib@^2.1.2: +minizlib@^2.1.1, minizlib@^2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-2.1.2.tgz#e90d3466ba209b932451508a11ce3d3632145931" integrity sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg== @@ -10787,11 +10509,25 @@ mute-stream@0.0.8, mute-stream@~0.0.4: resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.8.tgz#1630c42b2251ff81e2a283de96a5497ea92e5e0d" integrity sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA== +mz@^2.7.0: + version "2.7.0" + resolved "https://registry.yarnpkg.com/mz/-/mz-2.7.0.tgz#95008057a56cafadc2bc63dde7f9ff6955948e32" + integrity sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q== + dependencies: + any-promise "^1.0.0" + object-assign "^4.0.1" + thenify-all "^1.0.0" + nanoid@^3.3.4: version "3.3.4" resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.4.tgz#730b67e3cd09e2deacf03c027c81c9d9dbc5e8ab" integrity sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw== +natural-compare-lite@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/natural-compare-lite/-/natural-compare-lite-1.4.0.tgz#17b09581988979fddafe0201e931ba933c96cbb4" + integrity sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g== + natural-compare@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" @@ -10802,7 +10538,7 @@ ncp@^2.0.0: resolved "https://registry.yarnpkg.com/ncp/-/ncp-2.0.0.tgz#195a21d6c46e361d2fb1281ba38b91e9df7bdbb3" integrity sha1-GVoh1sRuNh0vsSgbo4uR6d9727M= -negotiator@0.6.3, negotiator@^0.6.2, negotiator@^0.6.3: +negotiator@0.6.3, negotiator@^0.6.3: version "0.6.3" resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.3.tgz#58e323a72fedc0d6f9cd4d31fe49f51479590ccd" integrity sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg== @@ -10812,6 +10548,16 @@ neo-async@^2.6.0, neo-async@^2.6.2: resolved "https://registry.yarnpkg.com/neo-async/-/neo-async-2.6.2.tgz#b4aafb93e3aeb2d8174ca53cf163ab7d7308305f" integrity sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw== +next-tick@1, next-tick@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/next-tick/-/next-tick-1.1.0.tgz#1836ee30ad56d67ef281b22bd199f709449b35eb" + integrity sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ== + +nice-try@^1.0.4: + version "1.0.5" + resolved "https://registry.yarnpkg.com/nice-try/-/nice-try-1.0.5.tgz#a3378a7696ce7d223e88fc9b764bd7ef1089e366" + integrity sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ== + no-case@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/no-case/-/no-case-3.0.4.tgz#d361fd5c9800f558551a8369fc0dcd4662b6124d" @@ -10832,7 +10578,7 @@ node-emoji@^1.10.0: dependencies: lodash "^4.17.21" -node-fetch@2.6.7, node-fetch@^2.6.1: +node-fetch@2.6.7, node-fetch@^2.6.1, node-fetch@^2.6.7: version "2.6.7" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.7.tgz#24de9fba827e3b4ae44dc8b20256a379160052ad" integrity sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ== @@ -10875,10 +10621,10 @@ node-machine-id@^1.1.12: resolved "https://registry.yarnpkg.com/node-machine-id/-/node-machine-id-1.1.12.tgz#37904eee1e59b320bb9c5d6c0a59f3b469cb6267" integrity sha512-QNABxbrPa3qEIfrE6GOJ7BYIuignnJw7iQ2YPbc3Nla1HzRJjXzZOiikfF8m7eAMfichLt3M4VgLOetqgDmgGQ== -node-releases@^2.0.3: - version "2.0.4" - resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.4.tgz#f38252370c43854dc48aa431c766c6c398f40476" - integrity sha512-gbMzqQtTtDz/00jQzZ21PQzdI9PyLYqUSvD0p3naOhX4odFji0ZxYdnVwPTxmSwkmxhcFImpozceidSG+AgoPQ== +node-releases@^2.0.6: + version "2.0.6" + resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.6.tgz#8a7088c63a55e493845683ebf3c828d8c51c5503" + integrity sha512-PiVXnNuFm5+iYkLBNeq5211hvO38y63T0i2KKh2KnUs3RpzJ+JtODFjkD8yjLwnDkTYF1eKXheUwdssR+NRZdg== nopt@^5.0.0: version "5.0.0" @@ -10897,7 +10643,7 @@ normalize-package-data@^2.3.2, normalize-package-data@^2.5.0: semver "2 || 3 || 4 || 5" validate-npm-package-license "^3.0.1" -normalize-package-data@^3.0.0, normalize-package-data@^3.0.2: +normalize-package-data@^3.0.0: version "3.0.3" resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-3.0.3.tgz#dbcc3e2da59509a0983422884cd172eefdfa525e" integrity sha512-p2W1sgqij3zMMyRC067Dg16bfzVH+w7hyegmpIvZ4JNjqtGOVAIvLmjBx3yP7YTe9vKJgkoNOPjwQGogDoMXFA== @@ -10932,7 +10678,7 @@ normalize-url@^4.1.0: resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-4.5.1.tgz#0dd90cf1288ee1d1313b87081c9a5932ee48518a" integrity sha512-9UZCFRHQdNrfTpGg8+1INIg93B6zE0aXMVFkw1WFwvO4SlZywU6aLg5Of0Ap/PgcbSw4LNxvMWXMeugwMCX0AA== -normalize-url@^6.0.1, normalize-url@^6.1.0: +normalize-url@^6.0.1: version "6.1.0" resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-6.1.0.tgz#40d0885b535deffe3f3147bec877d05fe4c5668a" integrity sha512-DlL+XwOy3NxAQ8xuC0okPgK46iuVNAK01YN7RueYBqqFeGsBjV9XmCAzAdgt+667bCl5kPh9EqKKDwnaPG1I7A== @@ -10956,13 +10702,13 @@ npm-normalize-package-bin@^1.0.0, npm-normalize-package-bin@^1.0.1: resolved "https://registry.yarnpkg.com/npm-normalize-package-bin/-/npm-normalize-package-bin-1.0.1.tgz#6e79a41f23fd235c0623218228da7d9c23b8f6e2" integrity sha512-EPfafl6JL5/rU+ot6P3gRSCpPDW5VmIzX959Ob1+ySFUuuYHWHekXpwdUZcKP5C+DS4GEtdJluwBjnsNDl+fSA== -npm-package-arg@^8.0.0, npm-package-arg@^8.1.0, npm-package-arg@^8.1.2, npm-package-arg@^8.1.5: - version "8.1.5" - resolved "https://registry.yarnpkg.com/npm-package-arg/-/npm-package-arg-8.1.5.tgz#3369b2d5fe8fdc674baa7f1786514ddc15466e44" - integrity sha512-LhgZrg0n0VgvzVdSm1oiZworPbTxYHUJCgtsJW8mGvlDpxTM1vSJc3m5QZeUkhAHIzbz3VCHd/R4osi1L1Tg/Q== - dependencies: - hosted-git-info "^4.0.1" - semver "^7.3.4" +npm-package-arg@8.1.1: + version "8.1.1" + resolved "https://registry.yarnpkg.com/npm-package-arg/-/npm-package-arg-8.1.1.tgz#00ebf16ac395c63318e67ce66780a06db6df1b04" + integrity sha512-CsP95FhWQDwNqiYS+Q0mZ7FAEDytDZAkNxQqea6IaAFJTAY9Lhhqyl0irU/6PMc7BGfUmnsbHcqxJD7XuVM/rg== + dependencies: + hosted-git-info "^3.0.6" + semver "^7.0.0" validate-npm-package-name "^3.0.0" npm-package-arg@^9.0.0, npm-package-arg@^9.0.1: @@ -10974,20 +10720,10 @@ npm-package-arg@^9.0.0, npm-package-arg@^9.0.1: semver "^7.3.5" validate-npm-package-name "^4.0.0" -npm-packlist@^2.1.4: - version "2.2.2" - resolved "https://registry.yarnpkg.com/npm-packlist/-/npm-packlist-2.2.2.tgz#076b97293fa620f632833186a7a8f65aaa6148c8" - integrity sha512-Jt01acDvJRhJGthnUJVF/w6gumWOZxO7IkpY/lsX9//zqQgnF7OJaxgQXcerd4uQOLu7W5bkb4mChL9mdfm+Zg== - dependencies: - glob "^7.1.6" - ignore-walk "^3.0.3" - npm-bundled "^1.1.1" - npm-normalize-package-bin "^1.0.1" - -npm-packlist@^5.0.0: - version "5.0.4" - resolved "https://registry.yarnpkg.com/npm-packlist/-/npm-packlist-5.0.4.tgz#b8a0635964dbf72baeeb7e69ec32e822f1c26159" - integrity sha512-G4sCWzzHokHC5oxGD46Q9vCe+eN2tFb+3RfADD/eZbx4nKa7Y1eku1xvIWrw5R3F3hWX7IM2BgdqbQsyBUa3IA== +npm-packlist@^5.1.0, npm-packlist@^5.1.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/npm-packlist/-/npm-packlist-5.1.1.tgz#79bcaf22a26b6c30aa4dd66b976d69cc286800e0" + integrity sha512-UfpSvQ5YKwctmodvPPkK6Fwk603aoVsf8AEbmVKAEECrfvL8SSe1A2YIwrJ6xmTHAITKPwwZsWo7WwEbNk0kxw== dependencies: glob "^8.0.1" ignore-walk "^5.0.1" @@ -11004,22 +10740,10 @@ npm-pick-manifest@^7.0.0: npm-package-arg "^9.0.0" semver "^7.3.5" -npm-registry-fetch@^11.0.0: - version "11.0.0" - resolved "https://registry.yarnpkg.com/npm-registry-fetch/-/npm-registry-fetch-11.0.0.tgz#68c1bb810c46542760d62a6a965f85a702d43a76" - integrity sha512-jmlgSxoDNuhAtxUIG6pVwwtz840i994dL14FoNVZisrmZW5kWd63IUTNv1m/hyRSGSqWjCUp/YZlS1BJyNp9XA== - dependencies: - make-fetch-happen "^9.0.1" - minipass "^3.1.3" - minipass-fetch "^1.3.0" - minipass-json-stream "^1.0.1" - minizlib "^2.0.0" - npm-package-arg "^8.0.0" - -npm-registry-fetch@^13.0.0, npm-registry-fetch@^13.0.1: - version "13.1.1" - resolved "https://registry.yarnpkg.com/npm-registry-fetch/-/npm-registry-fetch-13.1.1.tgz#26dc4b26d0a545886e807748032ba2aefaaae96b" - integrity sha512-5p8rwe6wQPLJ8dMqeTnA57Dp9Ox6GH9H60xkyJup07FmVlu3Mk7pf/kIIpl9gaN5bM8NM+UUx3emUWvDNTt39w== +npm-registry-fetch@^13.0.0, npm-registry-fetch@^13.0.1, npm-registry-fetch@^13.3.0: + version "13.3.0" + resolved "https://registry.yarnpkg.com/npm-registry-fetch/-/npm-registry-fetch-13.3.0.tgz#0ce10fa4a699a1e70685ecf41bbfb4150d74231b" + integrity sha512-10LJQ/1+VhKrZjIuY9I/+gQTvumqqlgnsCufoXETHAPFTS3+M+Z5CFhZRDHGavmJ6rOye3UvNga88vl8n1r6gg== dependencies: make-fetch-happen "^10.0.6" minipass "^3.1.6" @@ -11029,21 +10753,7 @@ npm-registry-fetch@^13.0.0, npm-registry-fetch@^13.0.1: npm-package-arg "^9.0.1" proc-log "^2.0.0" -npm-registry-fetch@^9.0.0: - version "9.0.0" - resolved "https://registry.yarnpkg.com/npm-registry-fetch/-/npm-registry-fetch-9.0.0.tgz#86f3feb4ce00313bc0b8f1f8f69daae6face1661" - integrity sha512-PuFYYtnQ8IyVl6ib9d3PepeehcUeHN9IO5N/iCRhyg9tStQcqGQBRVHmfmMWPDERU3KwZoHFvbJ4FPXPspvzbA== - dependencies: - "@npmcli/ci-detect" "^1.0.0" - lru-cache "^6.0.0" - make-fetch-happen "^8.0.9" - minipass "^3.1.3" - minipass-fetch "^1.3.0" - minipass-json-stream "^1.0.1" - minizlib "^2.0.0" - npm-package-arg "^8.0.0" - -npm-run-path@^4.0.0, npm-run-path@^4.0.1: +npm-run-path@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-4.0.1.tgz#b7ecd1e5ed53da8e37a55e1c2269e0b97ed748ea" integrity sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw== @@ -11084,25 +10794,60 @@ nth-check@^2.0.0, nth-check@^2.0.1: dependencies: boolbase "^1.0.0" -nth-check@~1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/nth-check/-/nth-check-1.0.2.tgz#b2bd295c37e3dd58a3bf0700376663ba4d9cf05c" - integrity sha512-WeBOdju8SnzPN5vTUJYxYUxLeXpCaVP5i5e0LF8fg7WORF2Wd7wFX/pk0tYZk7s8T+J7VLy0Da6J1+wCT0AtHg== +nx@15.5.3, "nx@>=15.4.2 < 16": + version "15.5.3" + resolved "https://registry.npmjs.org/nx/-/nx-15.5.3.tgz#bf6252e7d9e17121dd82dec4f6fce319b9e005fa" + integrity sha512-PHB8VbiBLP108xb+yR8IGEsYWr7OcmDDOjHL+73oP4lVjyPgT8wdTMe6tI5LdBgv+KZ+0kiThK3ckvcPsfgvLQ== dependencies: - boolbase "~1.0.0" + "@nrwl/cli" "15.5.3" + "@nrwl/tao" "15.5.3" + "@parcel/watcher" "2.0.4" + "@yarnpkg/lockfile" "^1.1.0" + "@yarnpkg/parsers" "^3.0.0-rc.18" + "@zkochan/js-yaml" "0.0.6" + axios "^1.0.0" + chalk "^4.1.0" + cli-cursor "3.1.0" + cli-spinners "2.6.1" + cliui "^7.0.2" + dotenv "~10.0.0" + enquirer "~2.3.6" + fast-glob "3.2.7" + figures "3.2.0" + flat "^5.0.2" + fs-extra "^11.1.0" + glob "7.1.4" + ignore "^5.0.4" + js-yaml "4.1.0" + jsonc-parser "3.2.0" + lines-and-columns "~2.0.3" + minimatch "3.0.5" + npm-run-path "^4.0.1" + open "^8.4.0" + semver "7.3.4" + string-width "^4.2.3" + strong-log-transformer "^2.1.0" + tar-stream "~2.2.0" + tmp "~0.2.1" + tsconfig-paths "^4.1.2" + tslib "^2.3.0" + v8-compile-cache "2.3.0" + yargs "^17.6.2" + yargs-parser "21.1.1" -nx@14.1.4: - version "14.1.4" - resolved "https://registry.yarnpkg.com/nx/-/nx-14.1.4.tgz#83bfb7564604eb26a78b3f5718cb2f90faeaaf4f" - integrity sha512-cYULObHKIbDbvxUnxn0tVbBlM8Vzg2u9sZYpmL6TEVF/Xbj3PQi8oyazc2/dU5Qw319lqMJcZonG2ihv9yEGKg== +nx@15.6.3: + version "15.6.3" + resolved "https://registry.npmjs.org/nx/-/nx-15.6.3.tgz#900087bce38c6e5975660c23ebd41ead1bf54f98" + integrity sha512-3t0A0GPLNen1yPAyE+VGZ3nkAzZYb5nfXtAcx8SHBlKq4u42yBY3khBmP1y4Og3jhIwFIj7J7Npeh8ZKrthmYQ== dependencies: - "@nrwl/cli" "14.1.4" - "@nrwl/tao" "14.1.4" + "@nrwl/cli" "15.6.3" + "@nrwl/tao" "15.6.3" "@parcel/watcher" "2.0.4" - "@swc-node/register" "^1.4.2" - "@swc/core" "^1.2.173" - chalk "4.1.0" - chokidar "^3.5.1" + "@yarnpkg/lockfile" "^1.1.0" + "@yarnpkg/parsers" "^3.0.0-rc.18" + "@zkochan/js-yaml" "0.0.6" + axios "^1.0.0" + chalk "^4.1.0" cli-cursor "3.1.0" cli-spinners "2.6.1" cliui "^7.0.2" @@ -11111,26 +10856,27 @@ nx@14.1.4: fast-glob "3.2.7" figures "3.2.0" flat "^5.0.2" - fs-extra "^9.1.0" + fs-extra "^11.1.0" glob "7.1.4" ignore "^5.0.4" - jsonc-parser "3.0.0" - minimatch "3.0.4" + js-yaml "4.1.0" + jsonc-parser "3.2.0" + lines-and-columns "~2.0.3" + minimatch "3.0.5" npm-run-path "^4.0.1" open "^8.4.0" - rxjs "^6.5.4" - rxjs-for-await "0.0.2" semver "7.3.4" string-width "^4.2.3" + strong-log-transformer "^2.1.0" tar-stream "~2.2.0" tmp "~0.2.1" - tsconfig-paths "^3.9.0" + tsconfig-paths "^4.1.2" tslib "^2.3.0" v8-compile-cache "2.3.0" - yargs "^17.4.0" - yargs-parser "21.0.1" + yargs "^17.6.2" + yargs-parser "21.1.1" -object-assign@^4.1.0, object-assign@^4.1.1: +object-assign@^4.0.1, object-assign@^4.1.0, object-assign@^4.1.1: version "4.1.1" resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM= @@ -11228,6 +10974,14 @@ onetime@^6.0.0: dependencies: mimic-fn "^4.0.0" +open@^7.4.2: + version "7.4.2" + resolved "https://registry.yarnpkg.com/open/-/open-7.4.2.tgz#b8147e26dcf3e426316c730089fd71edd29c2321" + integrity sha512-MVHddDVweXZF3awtlAS+6pgKLlm/JgxZ90+/NBurBoQctVOOB/zDdVjcyPzQ+0laDGbsWgrRkflI65sQeOgT9Q== + dependencies: + is-docker "^2.0.0" + is-wsl "^2.1.1" + open@^8.0.9, open@^8.4.0: version "8.4.0" resolved "https://registry.yarnpkg.com/open/-/open-8.4.0.tgz#345321ae18f8138f82565a910fdc6b39e8c244f8" @@ -11254,16 +11008,26 @@ optionator@^0.9.1: type-check "^0.4.0" word-wrap "^1.2.3" +ora@^5.4.1: + version "5.4.1" + resolved "https://registry.yarnpkg.com/ora/-/ora-5.4.1.tgz#1b2678426af4ac4a509008e5e4ac9e9959db9e18" + integrity sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ== + dependencies: + bl "^4.1.0" + chalk "^4.1.0" + cli-cursor "^3.1.0" + cli-spinners "^2.5.0" + is-interactive "^1.0.0" + is-unicode-supported "^0.1.0" + log-symbols "^4.1.0" + strip-ansi "^6.0.0" + wcwidth "^1.0.1" + os-tmpdir@~1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" integrity sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ= -ospath@^1.2.2: - version "1.2.2" - resolved "https://registry.yarnpkg.com/ospath/-/ospath-1.2.2.tgz#1276639774a3f8ef2572f7fe4280e0ea4550c07b" - integrity sha1-EnZjl3Sj+O8lcvf+QoDg6kVQwHs= - p-cancelable@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/p-cancelable/-/p-cancelable-1.1.0.tgz#d078d15a3af409220c886f1d9a0ca2e441ab26cc" @@ -11395,15 +11159,15 @@ package-json@^6.3.0: registry-url "^5.0.0" semver "^6.2.0" -pacote@^13.0.3, pacote@^13.0.5, pacote@^13.4.1: - version "13.4.1" - resolved "https://registry.yarnpkg.com/pacote/-/pacote-13.4.1.tgz#b6610bf8903abc075bfffa02a2cedafe81a97293" - integrity sha512-FqlSWlD8n+ejCE17GF/lf0yasztMGFl4UFzYQk5njaK/qPPWfVDWnfQwqmqeXObWLSmIBew+O+CFD24vxkVDjg== +pacote@^13.0.3, pacote@^13.6.1: + version "13.6.1" + resolved "https://registry.yarnpkg.com/pacote/-/pacote-13.6.1.tgz#ac6cbd9032b4c16e5c1e0c60138dfe44e4cc589d" + integrity sha512-L+2BI1ougAPsFjXRyBhcKmfT016NscRFLv6Pz5EiNf1CCFJFU0pSKKQwsZTyAQB+sTuUL4TyFyp6J1Ork3dOqw== dependencies: "@npmcli/git" "^3.0.0" "@npmcli/installed-package-contents" "^1.0.7" "@npmcli/promise-spawn" "^3.0.0" - "@npmcli/run-script" "^3.0.1" + "@npmcli/run-script" "^4.1.0" cacache "^16.0.0" chownr "^2.0.0" fs-minipass "^2.1.0" @@ -11411,7 +11175,7 @@ pacote@^13.0.3, pacote@^13.0.5, pacote@^13.4.1: minipass "^3.1.6" mkdirp "^1.0.4" npm-package-arg "^9.0.0" - npm-packlist "^5.0.0" + npm-packlist "^5.1.0" npm-pick-manifest "^7.0.0" npm-registry-fetch "^13.0.1" proc-log "^2.0.0" @@ -11488,22 +11252,19 @@ parse-numeric-range@^1.3.0: resolved "https://registry.yarnpkg.com/parse-numeric-range/-/parse-numeric-range-1.3.0.tgz#7c63b61190d61e4d53a1197f0c83c47bb670ffa3" integrity sha512-twN+njEipszzlMJd4ONUYgSfZPDxgHhT9Ahed5uTigpQn90FggW4SA/AIPq/6a149fTbE9qBEcSwE3FAEp6wQQ== -parse-path@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/parse-path/-/parse-path-5.0.0.tgz#f933152f3c6d34f4cf36cfc3d07b138ac113649d" - integrity sha512-qOpH55/+ZJ4jUu/oLO+ifUKjFPNZGfnPJtzvGzKN/4oLMil5m9OH4VpOj6++9/ytJcfks4kzH2hhi87GL/OU9A== +parse-path@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/parse-path/-/parse-path-7.0.0.tgz#605a2d58d0a749c8594405d8cc3a2bf76d16099b" + integrity sha512-Euf9GG8WT9CdqwuWJGdf3RkUcTBArppHABkO7Lm8IzRQp0e2r/kkFnmhu4TSK30Wcu5rVAZLmfPKSBBi9tWFog== dependencies: protocols "^2.0.0" -parse-url@^7.0.2: - version "7.0.2" - resolved "https://registry.yarnpkg.com/parse-url/-/parse-url-7.0.2.tgz#d21232417199b8d371c6aec0cedf1406fd6393f0" - integrity sha512-PqO4Z0eCiQ08Wj6QQmrmp5YTTxpYfONdOEamrtvK63AmzXpcavIVQubGHxOEwiIoDZFb8uDOoQFS0NCcjqIYQg== +parse-url@^8.1.0: + version "8.1.0" + resolved "https://registry.yarnpkg.com/parse-url/-/parse-url-8.1.0.tgz#972e0827ed4b57fc85f0ea6b0d839f0d8a57a57d" + integrity sha512-xDvOoLU5XRrcOZvnI6b8zA6n9O9ejNk/GExuz1yBuWUGn9KA97GI6HTs6u02wKara1CeVmZhH+0TZFdWScR89w== dependencies: - is-ssh "^1.4.0" - normalize-url "^6.1.0" - parse-path "^5.0.0" - protocols "^2.0.1" + parse-path "^7.0.0" parse5-htmlparser2-tree-adapter@^7.0.0: version "7.0.0" @@ -11513,11 +11274,6 @@ parse5-htmlparser2-tree-adapter@^7.0.0: domhandler "^5.0.2" parse5 "^7.0.0" -parse5@^5.0.0: - version "5.1.1" - resolved "https://registry.yarnpkg.com/parse5/-/parse5-5.1.1.tgz#f68e4e5ba1852ac2cadc00f4555fff6c2abb6178" - integrity sha512-ugq4DFI0Ptb+WWjAdOK16+u/nHfiIrcE+sh8kZMaM0WllQKLI9rOUq6c2b7cwPkXdzfQESqvoqK6ug7U/Yyzug== - parse5@^6.0.0: version "6.0.1" resolved "https://registry.yarnpkg.com/parse5/-/parse5-6.0.1.tgz#e1a1c085c569b3dc08321184f19a39cc27f7c30b" @@ -11543,6 +11299,25 @@ pascal-case@^3.1.2: no-case "^3.0.4" tslib "^2.0.3" +patch-package@^6.4.7: + version "6.4.7" + resolved "https://registry.yarnpkg.com/patch-package/-/patch-package-6.4.7.tgz#2282d53c397909a0d9ef92dae3fdeb558382b148" + integrity sha512-S0vh/ZEafZ17hbhgqdnpunKDfzHQibQizx9g8yEf5dcVk3KOflOfdufRXQX8CSEkyOQwuM/bNz1GwKvFj54kaQ== + dependencies: + "@yarnpkg/lockfile" "^1.1.0" + chalk "^2.4.2" + cross-spawn "^6.0.5" + find-yarn-workspace-root "^2.0.0" + fs-extra "^7.0.1" + is-ci "^2.0.0" + klaw-sync "^6.0.0" + minimist "^1.2.0" + open "^7.4.2" + rimraf "^2.6.3" + semver "^5.6.0" + slash "^2.0.0" + tmp "^0.0.33" + path-exists@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" @@ -11563,6 +11338,11 @@ path-is-inside@1.0.2: resolved "https://registry.yarnpkg.com/path-is-inside/-/path-is-inside-1.0.2.tgz#365417dede44430d1c11af61027facf074bdfc53" integrity sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM= +path-key@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" + integrity sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw== + path-key@^3.0.0, path-key@^3.1.0: version "3.1.1" resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375" @@ -11607,16 +11387,6 @@ path-type@^4.0.0: resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b" integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== -pend@~1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/pend/-/pend-1.2.0.tgz#7a57eb550a6783f9115331fcf4663d5c8e007a50" - integrity sha1-elfrVQpng/kRUzH89GY9XI4AelA= - -performance-now@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" - integrity sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns= - picocolors@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.0.tgz#cb5bdc74ff3f51892236eaf79d68bc44564ab81c" @@ -11632,7 +11402,7 @@ pidtree@^0.6.0: resolved "https://registry.yarnpkg.com/pidtree/-/pidtree-0.6.0.tgz#90ad7b6d42d5841e69e0a2419ef38f8883aa057c" integrity sha512-eG2dWTVw5bzqGRztnHExczNxt5VGsE6OwTeCG3fdUf9KBsZzO3R5OIIIzWR+iZA0NtZ+RDVdaoE2dK1cn6jH4g== -pify@^2.2.0, pify@^2.3.0: +pify@^2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" integrity sha1-7RQaasBDqEnqWISY59yosVMw6Qw= @@ -11671,6 +11441,11 @@ pkg-up@^3.1.0: dependencies: find-up "^3.0.0" +playwright-core@1.27.1: + version "1.27.1" + resolved "https://registry.yarnpkg.com/playwright-core/-/playwright-core-1.27.1.tgz#840ef662e55a3ed759d8b5d3d00a5f885a7184f4" + integrity sha512-9EmeXDncC2Pmp/z+teoVYlvmPWUC6ejSSYZUln7YaP89Z6lpAaiaAnqroUt/BoLo8tn7WYShcfaCh+xofZa44Q== + postcss-calc@^8.2.3: version "8.2.4" resolved "https://registry.yarnpkg.com/postcss-calc/-/postcss-calc-8.2.4.tgz#77b9c29bfcbe8a07ff6693dc87050828889739a5" @@ -11689,18 +11464,18 @@ postcss-colormin@^5.3.0: colord "^2.9.1" postcss-value-parser "^4.2.0" -postcss-convert-values@^5.1.1: - version "5.1.1" - resolved "https://registry.yarnpkg.com/postcss-convert-values/-/postcss-convert-values-5.1.1.tgz#31c8ffba650e86dc750631cafcf1db022c5bb6f1" - integrity sha512-UjcYfl3wJJdcabGKk8lgetPvhi1Et7VDc3sYr9EyhNBeB00YD4vHgPBp+oMVoG/dDWCc6ASbmzPNV6jADTwh8Q== +postcss-convert-values@^5.1.2: + version "5.1.2" + resolved "https://registry.yarnpkg.com/postcss-convert-values/-/postcss-convert-values-5.1.2.tgz#31586df4e184c2e8890e8b34a0b9355313f503ab" + integrity sha512-c6Hzc4GAv95B7suy4udszX9Zy4ETyMCgFPUDtWjdFTKH1SE9eFY/jEpHSwTH1QPuwxHpWslhckUQWbNRM4ho5g== dependencies: browserslist "^4.20.3" postcss-value-parser "^4.2.0" -postcss-discard-comments@^5.1.1: - version "5.1.1" - resolved "https://registry.yarnpkg.com/postcss-discard-comments/-/postcss-discard-comments-5.1.1.tgz#e90019e1a0e5b99de05f63516ce640bd0df3d369" - integrity sha512-5JscyFmvkUxz/5/+TB3QTTT9Gi9jHkcn8dcmmuN68JQcv3aQg4y88yEHHhwFB52l/NkaJ43O0dbksGMAo49nfQ== +postcss-discard-comments@^5.1.2: + version "5.1.2" + resolved "https://registry.yarnpkg.com/postcss-discard-comments/-/postcss-discard-comments-5.1.2.tgz#8df5e81d2925af2780075840c1526f0660e53696" + integrity sha512-+L8208OVbHVF2UQf1iDmRcbdjJkuBF6IS29yBDSiWUIzpYaAhtNl6JYnYm12FnkeCwQqF5LeklOu6rAqgfBZqQ== postcss-discard-duplicates@^5.1.0: version "5.1.0" @@ -11741,18 +11516,18 @@ postcss-merge-idents@^5.1.1: cssnano-utils "^3.1.0" postcss-value-parser "^4.2.0" -postcss-merge-longhand@^5.1.5: - version "5.1.5" - resolved "https://registry.yarnpkg.com/postcss-merge-longhand/-/postcss-merge-longhand-5.1.5.tgz#b0e03bee3b964336f5f33c4fc8eacae608e91c05" - integrity sha512-NOG1grw9wIO+60arKa2YYsrbgvP6tp+jqc7+ZD5/MalIw234ooH2C6KlR6FEn4yle7GqZoBxSK1mLBE9KPur6w== +postcss-merge-longhand@^5.1.6: + version "5.1.6" + resolved "https://registry.yarnpkg.com/postcss-merge-longhand/-/postcss-merge-longhand-5.1.6.tgz#f378a8a7e55766b7b644f48e5d8c789ed7ed51ce" + integrity sha512-6C/UGF/3T5OE2CEbOuX7iNO63dnvqhGZeUnKkDeifebY0XqkkvrctYSZurpNE902LDf2yKwwPFgotnfSoPhQiw== dependencies: postcss-value-parser "^4.2.0" stylehacks "^5.1.0" -postcss-merge-rules@^5.1.1: - version "5.1.1" - resolved "https://registry.yarnpkg.com/postcss-merge-rules/-/postcss-merge-rules-5.1.1.tgz#d327b221cd07540bcc8d9ff84446d8b404d00162" - integrity sha512-8wv8q2cXjEuCcgpIB1Xx1pIy8/rhMPIQqYKNzEdyx37m6gpq83mQQdCxgIkFgliyEnKvdwJf/C61vN4tQDq4Ww== +postcss-merge-rules@^5.1.2: + version "5.1.2" + resolved "https://registry.yarnpkg.com/postcss-merge-rules/-/postcss-merge-rules-5.1.2.tgz#7049a14d4211045412116d79b751def4484473a5" + integrity sha512-zKMUlnw+zYCWoPN6yhPjtcEdlJaMUZ0WyVcxTAmw3lkkN/NDMRkOkiuctQEoWAOvH7twaxUUdvBWl0d4+hifRQ== dependencies: browserslist "^4.16.6" caniuse-api "^3.0.0" @@ -11784,10 +11559,10 @@ postcss-minify-params@^5.1.3: cssnano-utils "^3.1.0" postcss-value-parser "^4.2.0" -postcss-minify-selectors@^5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/postcss-minify-selectors/-/postcss-minify-selectors-5.2.0.tgz#17c2be233e12b28ffa8a421a02fc8b839825536c" - integrity sha512-vYxvHkW+iULstA+ctVNx0VoRAR4THQQRkG77o0oa4/mBS0OzGvvzLIvHDv/nNEM0crzN2WIyFU5X7wZhaUK3RA== +postcss-minify-selectors@^5.2.1: + version "5.2.1" + resolved "https://registry.yarnpkg.com/postcss-minify-selectors/-/postcss-minify-selectors-5.2.1.tgz#d4e7e6b46147b8117ea9325a915a801d5fe656c6" + integrity sha512-nPJu7OjZJTsVUmPdm2TcaiohIwxP+v8ha9NehQ2ye9szv4orirRU3SDdtUmKH+10nzn0bAyOXZ0UEr7OpvLehg== dependencies: postcss-selector-parser "^6.0.5" @@ -11831,17 +11606,17 @@ postcss-normalize-display-values@^5.1.0: dependencies: postcss-value-parser "^4.2.0" -postcss-normalize-positions@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/postcss-normalize-positions/-/postcss-normalize-positions-5.1.0.tgz#902a7cb97cf0b9e8b1b654d4a43d451e48966458" - integrity sha512-8gmItgA4H5xiUxgN/3TVvXRoJxkAWLW6f/KKhdsH03atg0cB8ilXnrB5PpSshwVu/dD2ZsRFQcR1OEmSBDAgcQ== +postcss-normalize-positions@^5.1.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/postcss-normalize-positions/-/postcss-normalize-positions-5.1.1.tgz#ef97279d894087b59325b45c47f1e863daefbb92" + integrity sha512-6UpCb0G4eofTCQLFVuI3EVNZzBNPiIKcA1AKVka+31fTVySphr3VUgAIULBhxZkKgwLImhzMR2Bw1ORK+37INg== dependencies: postcss-value-parser "^4.2.0" -postcss-normalize-repeat-style@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/postcss-normalize-repeat-style/-/postcss-normalize-repeat-style-5.1.0.tgz#f6d6fd5a54f51a741cc84a37f7459e60ef7a6398" - integrity sha512-IR3uBjc+7mcWGL6CtniKNQ4Rr5fTxwkaDHwMBDGGs1x9IVRkYIT/M4NelZWkAOBdV6v3Z9S46zqaKGlyzHSchw== +postcss-normalize-repeat-style@^5.1.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/postcss-normalize-repeat-style/-/postcss-normalize-repeat-style-5.1.1.tgz#e9eb96805204f4766df66fd09ed2e13545420fb2" + integrity sha512-mFpLspGWkQtBcWIRFLmewo8aC3ImN2i/J3v8YCFUwDnPu3Xz4rLohDO26lGjwNsQxB3YF0KKRwspGzE2JEuS0g== dependencies: postcss-value-parser "^4.2.0" @@ -11882,10 +11657,10 @@ postcss-normalize-whitespace@^5.1.1: dependencies: postcss-value-parser "^4.2.0" -postcss-ordered-values@^5.1.1: - version "5.1.1" - resolved "https://registry.yarnpkg.com/postcss-ordered-values/-/postcss-ordered-values-5.1.1.tgz#0b41b610ba02906a3341e92cab01ff8ebc598adb" - integrity sha512-7lxgXF0NaoMIgyihL/2boNAEZKiW0+HkMhdKMTD93CjW8TdCy2hSdj8lsAo+uwm7EDG16Da2Jdmtqpedl0cMfw== +postcss-ordered-values@^5.1.3: + version "5.1.3" + resolved "https://registry.yarnpkg.com/postcss-ordered-values/-/postcss-ordered-values-5.1.3.tgz#b6fd2bd10f937b23d86bc829c69e7732ce76ea38" + integrity sha512-9UO79VUhPwEkzbb3RNpqqghc6lcYej1aveQteWY+4POIwlqkYE21HKWaLDF6lWNuqCobEAyTovVhtI32Rbv2RQ== dependencies: cssnano-utils "^3.1.0" postcss-value-parser "^4.2.0" @@ -11971,12 +11746,12 @@ prepend-http@^2.0.0: resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-2.0.0.tgz#e92434bfa5ea8c19f41cdfd401d741a3c819d897" integrity sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc= -prettier@*, prettier@2.5.1: - version "2.5.1" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.5.1.tgz#fff75fa9d519c54cf0fce328c1017d94546bc56a" - integrity sha512-vBZcPRUR5MZJwoyi3ZoyQlc1rXeEck8KgeC9AwwOn+exuxLxq5toTRDTSaVrXHxelDMHy9zlicw8u66yxoSUFg== +prettier@*, prettier@2.8.1, prettier@^2.6.2: + version "2.8.1" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.1.tgz#4e1fd11c34e2421bc1da9aea9bd8127cd0a35efc" + integrity sha512-lqGoSJBQNJidqCHE80vqZJHWHRFoNYsSpP9AjFhlhi9ODCJA541svILes/+/1GM3VaL/abZi7cpFzOpdR9UPKg== -pretty-bytes@^5.6.0: +pretty-bytes@^5.3.0: version "5.6.0" resolved "https://registry.yarnpkg.com/pretty-bytes/-/pretty-bytes-5.6.0.tgz#356256f643804773c82f64723fe78c92c62beaeb" integrity sha512-FFw039TmrBqFK8ma/7OL3sDz/VytdtJr044/QUJtH0wK9lb9jLq9tJyIxUwtQJHwar2BqtiA4iCWSwo9JLkzFg== @@ -11989,13 +11764,12 @@ pretty-error@^4.0.0: lodash "^4.17.20" renderkid "^3.0.0" -pretty-format@*, pretty-format@^28.0.0, pretty-format@^28.1.0, pretty-format@^28.1.1, pretty-format@^28.1.3: - version "28.1.0" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-28.1.0.tgz#8f5836c6a0dfdb834730577ec18029052191af55" - integrity sha512-79Z4wWOYCdvQkEoEuSlBhHJqWeZ8D8YRPiPctJFCtvuaClGpiwiQYSCUOE6IEKUbbFukKOTFIUAXE8N4EQTo1Q== +pretty-format@*, pretty-format@^29, pretty-format@^29.0.0, pretty-format@^29.0.3, pretty-format@^29.1.2: + version "29.1.2" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-29.1.2.tgz#b1f6b75be7d699be1a051f5da36e8ae9e76a8e6a" + integrity sha512-CGJ6VVGXVRP2o2Dorl4mAwwvDWT25luIsYhkyVQW32E4nL+TgW939J7LlKT/npq5Cpq6j3s+sy+13yk7xYpBmg== dependencies: - "@jest/schemas" "^28.0.2" - ansi-regex "^5.0.1" + "@jest/schemas" "^29.0.0" ansi-styles "^5.0.0" react-is "^18.0.0" @@ -12004,7 +11778,7 @@ pretty-time@^1.1.0: resolved "https://registry.yarnpkg.com/pretty-time/-/pretty-time-1.1.0.tgz#ffb7429afabb8535c346a34e41873adf3d74dd0e" integrity sha512-28iF6xPQrP8Oa6uxE6a1biz+lWeTOAPKggvjB8HAs6nVMKZwf5bG++632Dx614hIWgUPkgivRfG+a8uAXGTIbA== -prism-react-renderer@^1.3.3: +prism-react-renderer@^1.3.3, prism-react-renderer@^1.3.5: version "1.3.5" resolved "https://registry.yarnpkg.com/prism-react-renderer/-/prism-react-renderer-1.3.5.tgz#786bb69aa6f73c32ba1ee813fbe17a0115435085" integrity sha512-IJ+MSwBWKG+SM3b2SUfdrhC+gu01QkV2KmRQgREThBfSQRoufqRfxfHUxpG1WcaFjP+kojcFyO9Qqtpgt3qLCg== @@ -12069,7 +11843,7 @@ promzard@^0.3.0: dependencies: read "1" -prop-types@^15.6.2, prop-types@^15.7.2, prop-types@^15.8.1: +prop-types@^15.5.4, prop-types@^15.6.2, prop-types@^15.7.2, prop-types@^15.8.1: version "15.8.1" resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.8.1.tgz#67d87bf1a694f48435cf332c24af10214a3140b5" integrity sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg== @@ -12103,10 +11877,10 @@ proxy-addr@~2.0.7: forwarded "0.2.0" ipaddr.js "1.9.1" -psl@^1.1.28: - version "1.8.0" - resolved "https://registry.yarnpkg.com/psl/-/psl-1.8.0.tgz#9326f8bcfb013adcc005fdff056acce020e51c24" - integrity sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ== +proxy-from-env@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz#e102f16ca355424865755d2c9e8ea4f24d58c3e2" + integrity sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg== pump@^3.0.0: version "3.0.0" @@ -12116,17 +11890,12 @@ pump@^3.0.0: end-of-stream "^1.1.0" once "^1.3.1" -punycode@1.3.2: - version "1.3.2" - resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.3.2.tgz#9653a036fb7c1ee42342f2325cceefea3926c48d" - integrity sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0= - punycode@^1.3.2: version "1.4.1" resolved "https://registry.yarnpkg.com/punycode/-/punycode-1.4.1.tgz#c0d5a63b2718800ad8e1eb0fa5269c84dd41845e" integrity sha1-wNWmOycYgArY4esPpSachN1BhF4= -punycode@^2.1.0, punycode@^2.1.1: +punycode@^2.1.0: version "2.1.1" resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== @@ -12155,16 +11924,6 @@ qs@6.10.3: dependencies: side-channel "^1.0.4" -qs@~6.5.2: - version "6.5.2" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36" - integrity sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA== - -querystring@0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/querystring/-/querystring-0.2.0.tgz#b209849203bb25df820da756e747005878521620" - integrity sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA= - queue-microtask@^1.2.2: version "1.2.3" resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243" @@ -12182,11 +11941,6 @@ quick-lru@^4.0.1: resolved "https://registry.yarnpkg.com/quick-lru/-/quick-lru-4.0.1.tgz#5b8878f113a58217848c6482026c73e1ba57727f" integrity sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g== -ramda@~0.27.1: - version "0.27.1" - resolved "https://registry.yarnpkg.com/ramda/-/ramda-0.27.1.tgz#66fc2df3ef873874ffc2da6aa8984658abacf5c9" - integrity sha512-PgIdVpn5y5Yns8vqb8FzBUEYn98V3xcPgawAkkgj0YJ0qDsnHCiNmZYfOGMgOvoB0eWFLpYbhxUR3mxfDIMvpw== - randombytes@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a" @@ -12361,6 +12115,22 @@ react-router@5.3.3, react-router@^5.3.3: tiny-invariant "^1.0.2" tiny-warning "^1.0.0" +react-split-pane@^0.1.92: + version "0.1.92" + resolved "https://registry.yarnpkg.com/react-split-pane/-/react-split-pane-0.1.92.tgz#68242f72138aed95dd5910eeb9d99822c4fc3a41" + integrity sha512-GfXP1xSzLMcLJI5BM36Vh7GgZBpy+U/X0no+VM3fxayv+p1Jly5HpMofZJraeaMl73b3hvlr+N9zJKvLB/uz9w== + dependencies: + prop-types "^15.7.2" + react-lifecycles-compat "^3.0.4" + react-style-proptype "^3.2.2" + +react-style-proptype@^3.2.2: + version "3.2.2" + resolved "https://registry.yarnpkg.com/react-style-proptype/-/react-style-proptype-3.2.2.tgz#d8e998e62ce79ec35b087252b90f19f1c33968a0" + integrity sha512-ywYLSjNkxKHiZOqNlso9PZByNEY+FTyh3C+7uuziK0xFXu9xzdyfHwg4S9iyiRRoPCR4k2LqaBBsWVmSBwCWYQ== + dependencies: + prop-types "^15.5.4" + react-textarea-autosize@^8.3.2: version "8.3.3" resolved "https://registry.yarnpkg.com/react-textarea-autosize/-/react-textarea-autosize-8.3.3.tgz#f70913945369da453fd554c168f6baacd1fa04d8" @@ -12371,17 +12141,12 @@ react-textarea-autosize@^8.3.2: use-latest "^1.0.0" react@^18.1.0: - version "18.1.0" - resolved "https://registry.yarnpkg.com/react/-/react-18.1.0.tgz#6f8620382decb17fdc5cc223a115e2adbf104890" - integrity sha512-4oL8ivCz5ZEPyclFQXaNksK3adutVS8l2xzZU0cqEFrE9Sb7fC0EFK5uEk74wIreL1DERyjvsU915j1pcT2uEQ== + version "18.2.0" + resolved "https://registry.yarnpkg.com/react/-/react-18.2.0.tgz#555bd98592883255fa00de14f1151a917b5d77d5" + integrity sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ== dependencies: loose-envify "^1.1.0" -read-cmd-shim@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/read-cmd-shim/-/read-cmd-shim-2.0.0.tgz#4a50a71d6f0965364938e9038476f7eede3928d9" - integrity sha512-HJpV9bQpkl6KwjxlJcBoqu9Ba0PQg8TqSNIOrulGt54a0uup0HtevreFHzYzkm0lpnleRdNBzXznKrgxglEHQw== - read-cmd-shim@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/read-cmd-shim/-/read-cmd-shim-3.0.0.tgz#62b8c638225c61e6cc607f8f4b779f3b8238f155" @@ -12395,27 +12160,7 @@ read-package-json-fast@^2.0.2, read-package-json-fast@^2.0.3: json-parse-even-better-errors "^2.3.0" npm-normalize-package-bin "^1.0.1" -read-package-json@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/read-package-json/-/read-package-json-3.0.1.tgz#c7108f0b9390257b08c21e3004d2404c806744b9" - integrity sha512-aLcPqxovhJTVJcsnROuuzQvv6oziQx4zd3JvG0vGCL5MjTONUc4uJ90zCBC6R7W7oUKBNoR/F8pkyfVwlbxqng== - dependencies: - glob "^7.1.1" - json-parse-even-better-errors "^2.3.0" - normalize-package-data "^3.0.0" - npm-normalize-package-bin "^1.0.0" - -read-package-json@^4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/read-package-json/-/read-package-json-4.1.1.tgz#153be72fce801578c1c86b8ef2b21188df1b9eea" - integrity sha512-P82sbZJ3ldDrWCOSKxJT0r/CXMWR0OR3KRh55SgKo3p91GSIEEC32v3lSHAvO/UcH3/IoL7uqhOFBduAnwdldw== - dependencies: - glob "^7.1.1" - json-parse-even-better-errors "^2.3.0" - normalize-package-data "^3.0.0" - npm-normalize-package-bin "^1.0.0" - -read-package-json@^5.0.0: +read-package-json@^5.0.0, read-package-json@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/read-package-json/-/read-package-json-5.0.1.tgz#1ed685d95ce258954596b13e2e0e76c7d0ab4c26" integrity sha512-MALHuNgYWdGW3gKzuNMuYtcSSZbGQm94fAp16xt8VsYTLBjUSc55bLMKe6gzpWue0Tfi6CBgwCSdDAqutGDhMg== @@ -12461,7 +12206,7 @@ read-pkg@^5.2.0: parse-json "^5.0.0" type-fest "^0.6.0" -read@1, read@~1.0.1: +read@1, read@^1.0.7: version "1.0.7" resolved "https://registry.yarnpkg.com/read/-/read-1.0.7.tgz#b3da19bd052431a97671d44a42634adf710b40c4" integrity sha1-s9oZvQUkMal2cdRKQmNK33ELQMQ= @@ -12572,10 +12317,10 @@ regexpp@^3.2.0: resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-3.2.0.tgz#0425a2768d8f23bad70ca4b90461fa2f1213e1b2" integrity sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg== -regexpu-core@^5.0.1: - version "5.0.1" - resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-5.0.1.tgz#c531122a7840de743dcf9c83e923b5560323ced3" - integrity sha512-CriEZlrKK9VJw/xQGJpQM5rY88BtuL8DM+AEwvcThHilbxiTAy8vq4iJnd2tqq8wLmjbGZzP7ZcKFjbGkmEFrw== +regexpu-core@^5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-5.1.0.tgz#2f8504c3fd0ebe11215783a41541e21c79942c6d" + integrity sha512-bb6hk+xWd2PEOkj5It46A16zFMs2mv86Iwpdu94la4S3sJ7C973h2dHpYKwIBGaWSO7cIRJ+UX0IeMaWcO4qwA== dependencies: regenerate "^1.4.2" regenerate-unicode-properties "^10.0.1" @@ -12610,29 +12355,11 @@ regjsparser@^0.8.2: dependencies: jsesc "~0.5.0" -rehype-parse@^6.0.2: - version "6.0.2" - resolved "https://registry.yarnpkg.com/rehype-parse/-/rehype-parse-6.0.2.tgz#aeb3fdd68085f9f796f1d3137ae2b85a98406964" - integrity sha512-0S3CpvpTAgGmnz8kiCyFLGuW5yA4OQhyNTm/nwPopZ7+PI11WnGl1TTWTGv/2hPEe/g2jRLlhVVSsoDH8waRug== - dependencies: - hast-util-from-parse5 "^5.0.0" - parse5 "^5.0.0" - xtend "^4.0.0" - relateurl@^0.2.7: version "0.2.7" resolved "https://registry.yarnpkg.com/relateurl/-/relateurl-0.2.7.tgz#54dbf377e51440aca90a4cd274600d3ff2d888a9" integrity sha1-VNvzd+UUQKypCkzSdGANP/LYiKk= -remark-admonitions@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/remark-admonitions/-/remark-admonitions-1.2.1.tgz#87caa1a442aa7b4c0cafa04798ed58a342307870" - integrity sha512-Ji6p68VDvD+H1oS95Fdx9Ar5WA2wcDA4kwrrhVU7fGctC6+d3uiMICu7w7/2Xld+lnU7/gi+432+rRbup5S8ow== - dependencies: - rehype-parse "^6.0.2" - unified "^8.4.2" - unist-util-visit "^2.0.1" - remark-docusaurus-tabs@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/remark-docusaurus-tabs/-/remark-docusaurus-tabs-0.2.0.tgz#39e02b2e72a68458c1c11003e95ddb7d236e8006" @@ -12714,13 +12441,6 @@ repeat-string@^1.5.4, repeat-string@^1.6.1: resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" integrity sha1-jcrkcOHIirwtYA//Sndihtp15jc= -request-progress@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/request-progress/-/request-progress-3.0.0.tgz#4ca754081c7fec63f505e4faa825aa06cd669dbe" - integrity sha1-TKdUCBx/7GP1BeT6qCWqBs1mnb4= - dependencies: - throttleit "^1.0.0" - require-directory@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" @@ -12775,12 +12495,12 @@ resolve.exports@1.1.0, resolve.exports@^1.1.0: resolved "https://registry.yarnpkg.com/resolve.exports/-/resolve.exports-1.1.0.tgz#5ce842b94b05146c0e03076985d1d0e7e48c90c9" integrity sha512-J1l+Zxxp4XK3LUDZ9m60LRJF/mAe4z6a4xyabPHk7pvK5t35dACV32iIjJDFeWZFfZlO29w6SZ67knR0tHzJtQ== -resolve@^1.1.6, resolve@^1.10.0, resolve@^1.14.2, resolve@^1.17.0, resolve@^1.19.0, resolve@^1.20.0, resolve@^1.22.0, resolve@^1.3.2: - version "1.22.0" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.0.tgz#5e0b8c67c15df57a89bdbabe603a002f21731198" - integrity sha512-Hhtrw0nLeSrFQ7phPp4OOcVjLPIeMnRlr5mcnVuMe7M/7eBn98A3hmFRLoFo3DLZkivSYwhRUJTyPyWAk56WLw== +resolve@^1.1.6, resolve@^1.10.0, resolve@^1.14.2, resolve@^1.19.0, resolve@^1.20.0, resolve@^1.22.0, resolve@^1.22.1, resolve@^1.3.2: + version "1.22.1" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.1.tgz#27cb2ebb53f91abb49470a928bba7558066ac177" + integrity sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw== dependencies: - is-core-module "^2.8.1" + is-core-module "^2.9.0" path-parse "^1.0.7" supports-preserve-symlinks-flag "^1.0.0" @@ -12842,14 +12562,26 @@ rfdc@^1.3.0: resolved "https://registry.yarnpkg.com/rfdc/-/rfdc-1.3.0.tgz#d0b7c441ab2720d05dc4cf26e01c89631d9da08b" integrity sha512-V2hovdzFbOi77/WajaSMXk2OLm+xNIeQdMMuB7icj7bk6zi2F8GGAxigcnDFpJHbNyNcgyJDiP+8nOrY5cZGrA== -rimraf@*, rimraf@^3.0.0, rimraf@^3.0.2: +rimraf@*, rimraf@^4.0.0: + version "4.1.1" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-4.1.1.tgz#ec29817863e5d82d22bca82f9dc4325be2f1e72b" + integrity sha512-Z4Y81w8atcvaJuJuBB88VpADRH66okZAuEm+Jtaufa+s7rZmIz+Hik2G53kGaNytE7lsfXyWktTmfVz0H9xuDg== + +rimraf@^2.6.3: + version "2.7.1" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.7.1.tgz#35797f13a7fdadc566142c29d4f07ccad483e3ec" + integrity sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w== + dependencies: + glob "^7.1.3" + +rimraf@^3.0.0, rimraf@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-3.0.2.tgz#f1a5402ba6220ad52cc1282bac1ae3aa49fd061a" integrity sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA== dependencies: glob "^7.1.3" -rollup-plugin-terser@^7.0.2: +rollup-plugin-terser@^7.0.0, rollup-plugin-terser@^7.0.2: version "7.0.2" resolved "https://registry.yarnpkg.com/rollup-plugin-terser/-/rollup-plugin-terser-7.0.2.tgz#e8fbba4869981b2dc35ae7e8a502d5c6c04d324d" integrity sha512-w3iIaU4OxcF52UUXiZNsNeuXIMDvFrr+ZXK6bFZ0Q60qyVfq4uLptoS4bbq3paG3x216eQllFZX7zt6TIImguQ== @@ -12859,10 +12591,10 @@ rollup-plugin-terser@^7.0.2: serialize-javascript "^4.0.0" terser "^5.0.0" -rollup@^2.75.4: - version "2.77.0" - resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.77.0.tgz#749eaa5ac09b6baa52acc076bc46613eddfd53f4" - integrity sha512-vL8xjY4yOQEw79DvyXLijhnhh+R/O9zpF/LEgkCebZFtb6ELeN9H3/2T0r8+mp+fFTBHZ5qGpOpW2ela2zRt3g== +rollup@^2.43.1, rollup@^2.75.4: + version "2.79.1" + resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.79.1.tgz#bedee8faef7c9f93a2647ac0108748f497f081c7" + integrity sha512-uKxbd0IhMZOhjAiD5oAFp7BqvkA4Dv47qpOCtaNvng4HBwdbWtdOh8f5nZNuk2rp51PMGk3bzfWu5oayNEuYnw== optionalDependencies: fsevents "~2.3.2" @@ -12886,14 +12618,14 @@ run-async@^2.4.0: resolved "https://registry.yarnpkg.com/run-async/-/run-async-2.4.1.tgz#8440eccf99ea3e70bd409d49aab88e10c189a455" integrity sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ== -run-con@~1.2.10: - version "1.2.10" - resolved "https://registry.yarnpkg.com/run-con/-/run-con-1.2.10.tgz#90de9d43d20274d00478f4c000495bd72f417d22" - integrity sha512-n7PZpYmMM26ZO21dd8y3Yw1TRtGABjRtgPSgFS/nhzfvbJMXFtJhJVyEgayMiP+w/23craJjsnfDvx4W4ue/HQ== +run-con@~1.2.11: + version "1.2.11" + resolved "https://registry.yarnpkg.com/run-con/-/run-con-1.2.11.tgz#0014ed430bad034a60568dfe7de2235f32e3f3c4" + integrity sha512-NEMGsUT+cglWkzEr4IFK21P4Jca45HqiAbIIZIBdX5+UZTB24Mb/21iNGgz9xZa8tL6vbW7CXmq7MFN42+VjNQ== dependencies: deep-extend "^0.6.0" - ini "~2.0.0" - minimist "^1.2.5" + ini "~3.0.0" + minimist "^1.2.6" strip-json-comments "~3.1.1" run-parallel@^1.1.9: @@ -12903,19 +12635,14 @@ run-parallel@^1.1.9: dependencies: queue-microtask "^1.2.2" -rxjs-for-await@0.0.2: - version "0.0.2" - resolved "https://registry.yarnpkg.com/rxjs-for-await/-/rxjs-for-await-0.0.2.tgz#26598a1d6167147cc192172970e7eed4e620384b" - integrity sha512-IJ8R/ZCFMHOcDIqoABs82jal00VrZx8Xkgfe7TOKoaRPAW5nH/VFlG23bXpeGdrmtqI9UobFPgUKgCuFc7Lncw== - -rxjs@^6.5.4, rxjs@^6.6.0: +rxjs@^6.5.4: version "6.6.7" resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.6.7.tgz#90ac018acabf491bf65044235d5863c4dab804c9" integrity sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ== dependencies: tslib "^1.9.0" -rxjs@^7.4.0, rxjs@^7.5.4, rxjs@^7.5.5: +rxjs@^7.5.4, rxjs@^7.5.5: version "7.5.5" resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-7.5.5.tgz#2ebad89af0f560f460ad5cc4213219e1f7dd4e9f" integrity sha512-sy+H0pQofO95VDmFLzyaw9xNJU4KTRSwQIGM6+iG3SypAtCiLDzpeG8sJrNCWn2Up9km+KhkvTdbkrdy+yzZdw== @@ -12927,12 +12654,12 @@ safe-buffer@5.1.2, safe-buffer@~5.1.0, safe-buffer@~5.1.1: resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== -safe-buffer@5.2.1, safe-buffer@>=5.1.0, safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.2, safe-buffer@~5.2.0: +safe-buffer@5.2.1, safe-buffer@>=5.1.0, safe-buffer@^5.1.0, safe-buffer@~5.2.0: version "5.2.1" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== -"safer-buffer@>= 2.1.2 < 3", "safer-buffer@>= 2.1.2 < 3.0.0", safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0: +"safer-buffer@>= 2.1.2 < 3", "safer-buffer@>= 2.1.2 < 3.0.0": version "2.1.2" resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== @@ -13013,16 +12740,11 @@ semver-diff@^3.1.1: dependencies: semver "^6.3.0" -"semver@2 || 3 || 4 || 5", semver@^5.3.0, semver@^5.4.1, semver@^5.6.0: +"semver@2 || 3 || 4 || 5", semver@^5.3.0, semver@^5.4.1, semver@^5.5.0, semver@^5.6.0: version "5.7.1" resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7" integrity sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ== -semver@7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-7.0.0.tgz#5f3ca35761e47e05b206c6daff2cf814f0316b8e" - integrity sha512-+GB6zVA9LWh6zovYQLALHwv5rb2PHGlJi3lfiqIHxR0uuwCgefcOJc59v9fv1w8GbStwxuuqqAjI9NMAOOgq1A== - semver@7.3.4: version "7.3.4" resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.4.tgz#27aaa7d2e4ca76452f98d3add093a72c943edc97" @@ -13035,7 +12757,7 @@ semver@^6.0.0, semver@^6.1.1, semver@^6.1.2, semver@^6.2.0, semver@^6.3.0: resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== -semver@^7.0.0, semver@^7.1.1, semver@^7.1.3, semver@^7.3.2, semver@^7.3.4, semver@^7.3.5, semver@^7.3.7, semver@~7.3.0: +semver@^7.0.0, semver@^7.1.1, semver@^7.3.2, semver@^7.3.4, semver@^7.3.5, semver@^7.3.7, semver@~7.3.0: version "7.3.7" resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.7.tgz#12c5b649afdbf9049707796e22a4028814ce523f" integrity sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g== @@ -13144,6 +12866,13 @@ shallowequal@^1.1.0: resolved "https://registry.yarnpkg.com/shallowequal/-/shallowequal-1.1.0.tgz#188d521de95b9087404fd4dcb68b13df0ae4e7f8" integrity sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ== +shebang-command@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" + integrity sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg== + dependencies: + shebang-regex "^1.0.0" + shebang-command@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea" @@ -13151,6 +12880,11 @@ shebang-command@^2.0.0: dependencies: shebang-regex "^3.0.0" +shebang-regex@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" + integrity sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ== + shebang-regex@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" @@ -13208,6 +12942,11 @@ sitemap@^7.1.1: arg "^5.0.0" sax "^1.2.4" +slash@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/slash/-/slash-2.0.0.tgz#de552851a1759df3a8f206535442f5ec4ddeab44" + integrity sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A== + slash@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634" @@ -13249,25 +12988,16 @@ smart-buffer@^4.2.0: resolved "https://registry.yarnpkg.com/smart-buffer/-/smart-buffer-4.2.0.tgz#6e1d71fa4f18c05f7d0ff216dd16a481d0e8d9ae" integrity sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg== -sockjs@^0.3.21: - version "0.3.21" - resolved "https://registry.yarnpkg.com/sockjs/-/sockjs-0.3.21.tgz#b34ffb98e796930b60a0cfa11904d6a339a7d417" - integrity sha512-DhbPFGpxjc6Z3I+uX07Id5ZO2XwYsWOrYjaSeieES78cq+JaJvVe5q/m1uvjIQhXinhIeCFRH6JgXe+mvVMyXw== +sockjs@^0.3.24: + version "0.3.24" + resolved "https://registry.yarnpkg.com/sockjs/-/sockjs-0.3.24.tgz#c9bc8995f33a111bea0395ec30aa3206bdb5ccce" + integrity sha512-GJgLTZ7vYb/JtPSSZ10hsOYIvEYsjbNU+zPdIHcUaWVNUEPivzxku31865sSSud0Da0W4lEeOPlmw93zLQchuQ== dependencies: faye-websocket "^0.11.3" - uuid "^3.4.0" + uuid "^8.3.2" websocket-driver "^0.7.4" -socks-proxy-agent@^5.0.0: - version "5.0.1" - resolved "https://registry.yarnpkg.com/socks-proxy-agent/-/socks-proxy-agent-5.0.1.tgz#032fb583048a29ebffec2e6a73fca0761f48177e" - integrity sha512-vZdmnjb9a2Tz6WEQVIurybSwElwPxMZaIc7PzqbJTrezcKNznv6giT7J7tZDZ1BojVaa1jvO/UiUdhDVB0ACoQ== - dependencies: - agent-base "^6.0.2" - debug "4" - socks "^2.3.3" - -socks-proxy-agent@^6.0.0, socks-proxy-agent@^6.1.1: +socks-proxy-agent@^6.1.1: version "6.2.0" resolved "https://registry.yarnpkg.com/socks-proxy-agent/-/socks-proxy-agent-6.2.0.tgz#f6b5229cc0cbd6f2f202d9695f09d871e951c85e" integrity sha512-wWqJhjb32Q6GsrUqzuFkukxb/zzide5quXYcMVpIjxalDBBYy2nqKCFQ/9+Ie4dvOYSQdOk3hUlZSdzZOd3zMQ== @@ -13276,7 +13006,7 @@ socks-proxy-agent@^6.0.0, socks-proxy-agent@^6.1.1: debug "^4.3.3" socks "^2.6.2" -socks@^2.3.3, socks@^2.6.2: +socks@^2.6.2: version "2.6.2" resolved "https://registry.yarnpkg.com/socks/-/socks-2.6.2.tgz#ec042d7960073d40d94268ff3bb727dc685f111a" integrity sha512-zDZhHhZRY9PxRruRMR7kMhnf3I8hDs4S3f9RecfnGxvcBHQcKcIH/oUcEWffsfl1XxdYlA7nnlGbbTvPz9D8gA== @@ -13303,11 +13033,6 @@ sort-keys@^4.0.0: dependencies: is-plain-obj "^2.0.0" -source-list-map@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/source-list-map/-/source-list-map-2.0.1.tgz#3993bd873bfc48479cca9ea3a547835c7c154b34" - integrity sha512-qnQ7gVMxGNxsiL4lEuJwe/To8UnK7fAnmbGEEH8RpLouuKbeEm0lhbQVFIrNSuB+G7tVrAlVsZgETT5nljf+Iw== - source-map-js@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.0.2.tgz#adbc361d9c62df380125e7f161f71c826f1e490c" @@ -13339,7 +13064,14 @@ source-map@^0.6.0, source-map@^0.6.1, source-map@~0.6.0, source-map@~0.6.1: resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== -sourcemap-codec@^1.4.4: +source-map@^0.8.0-beta.0: + version "0.8.0-beta.0" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.8.0-beta.0.tgz#d4c1bb42c3f7ee925f005927ba10709e0d1d1f11" + integrity sha512-2ymg6oRBpebeZi9UUNsgQ89bhx01TcTkmNTGnNO88imTmbSgy4nfujrgVEFKWpMTEGA11EDkTt7mqObTPdigIA== + dependencies: + whatwg-url "^7.0.0" + +sourcemap-codec@^1.4.8: version "1.4.8" resolved "https://registry.yarnpkg.com/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz#ea804bd94857402e6992d05a38ef1ae35a9ab4c4" integrity sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA== @@ -13417,29 +13149,7 @@ sprintf-js@~1.0.2: resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw= -sshpk@^1.14.1: - version "1.16.1" - resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.16.1.tgz#fb661c0bef29b39db40769ee39fa70093d6f6877" - integrity sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg== - dependencies: - asn1 "~0.2.3" - assert-plus "^1.0.0" - bcrypt-pbkdf "^1.0.0" - dashdash "^1.12.0" - ecc-jsbn "~0.1.1" - getpass "^0.1.1" - jsbn "~0.1.0" - safer-buffer "^2.0.2" - tweetnacl "~0.14.0" - -ssri@^8.0.0, ssri@^8.0.1: - version "8.0.1" - resolved "https://registry.yarnpkg.com/ssri/-/ssri-8.0.1.tgz#638e4e439e2ffbd2cd289776d5ca457c4f51a2af" - integrity sha512-97qShzy1AiyxvPNIkLWoGua7xoQzzPjQ0HAH4B0rWKo7SZ6USuPcrUiAFrws0UH8RrbWmgq3LMTObhPIHbbBeQ== - dependencies: - minipass "^3.1.1" - -ssri@^9.0.0: +ssri@^9.0.0, ssri@^9.0.1: version "9.0.1" resolved "https://registry.yarnpkg.com/ssri/-/ssri-9.0.1.tgz#544d4c357a8d7b71a19700074b6883fcb4eae057" integrity sha512-o57Wcn66jMQvfHG1FlYbWeZWW/dHZhJXjpIcTfXldXEk5nz5lStPo3mK0OJQfGR3RbZUlbISexbljkJzuEj/8Q== @@ -13509,7 +13219,7 @@ string-width@^5.0.0, string-width@^5.0.1: emoji-regex "^9.2.2" strip-ansi "^7.0.1" -string.prototype.matchall@^4.0.7: +string.prototype.matchall@^4.0.6, string.prototype.matchall@^4.0.7: version "4.0.7" resolved "https://registry.yarnpkg.com/string.prototype.matchall/-/string.prototype.matchall-4.0.7.tgz#8e6ecb0d8a1fb1fda470d81acecb2dba057a481d" integrity sha512-f48okCX7JiwVi1NXCVWcFnZgADDC/n2vePlQ/KUCNqCikLLilQvwjMO8+BHVKvgzH0JB0J9LEPgxOGT02RoETg== @@ -13593,6 +13303,11 @@ strip-bom@^4.0.0: resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-4.0.0.tgz#9c3505c1db45bcedca3d9cf7a16f5c5aa3901878" integrity sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w== +strip-comments@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/strip-comments/-/strip-comments-2.0.1.tgz#4ad11c3fbcac177a67a40ac224ca339ca1c1ba9b" + integrity sha512-ZprKx+bBLXv067WTCALv8SSz5l2+XhpYCsVtSqlMnkAXMWDq+/ekVbl1ghqP9rUHTzv6sm/DwCOiYutU/yp1fw== + strip-final-newline@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/strip-final-newline/-/strip-final-newline-2.0.0.tgz#89b852fb2fcbe936f6f4b3187afb0a12c1ab58ad" @@ -13658,7 +13373,7 @@ supports-color@^7.0.0, supports-color@^7.1.0: dependencies: has-flag "^4.0.0" -supports-color@^8.0.0, supports-color@^8.1.1: +supports-color@^8.0.0: version "8.1.1" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-8.1.1.tgz#cd6fc17e28500cff56c1b86c0a7fd4a54a73005c" integrity sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q== @@ -13717,7 +13432,7 @@ tar-stream@~2.2.0: inherits "^2.0.3" readable-stream "^3.1.1" -tar@6.1.11, tar@^6.0.2, tar@^6.1.0, tar@^6.1.11, tar@^6.1.2: +tar@6.1.11, tar@^6.1.0, tar@^6.1.11, tar@^6.1.2: version "6.1.11" resolved "https://registry.yarnpkg.com/tar/-/tar-6.1.11.tgz#6760a38f003afa1b2ffd0ffe9e9abbd0eab3d621" integrity sha512-an/KZQzQUkZCkuoAA64hM92X0Urb6VpRhAFllDzz44U2mcD5scmT3zBc4VgVpkugF580+DQn8eAFSyoQt0tznA== @@ -13734,6 +13449,21 @@ temp-dir@^1.0.0: resolved "https://registry.yarnpkg.com/temp-dir/-/temp-dir-1.0.0.tgz#0a7c0ea26d3a39afa7e0ebea9c1fc0bc4daa011d" integrity sha1-CnwOom06Oa+n4OvqnB/AvE2qAR0= +temp-dir@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/temp-dir/-/temp-dir-2.0.0.tgz#bde92b05bdfeb1516e804c9c00ad45177f31321e" + integrity sha512-aoBAniQmmwtcKp/7BzsH8Cxzv8OL736p7v1ihGb5e9DJ9kTwGWHrQrVB5+lfVDzfGrdRzXch+ig7LHaY1JTOrg== + +tempy@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/tempy/-/tempy-0.6.0.tgz#65e2c35abc06f1124a97f387b08303442bde59f3" + integrity sha512-G13vtMYPT/J8A4X2SjdtBTphZlrp1gKv6hZiOjw14RCWg6GbHuQBGtjlx75xLbYV/wEc0D7G5K4rxKP/cXk8Bw== + dependencies: + is-stream "^2.0.0" + temp-dir "^2.0.0" + type-fest "^0.16.0" + unique-string "^2.0.0" + terminal-link@^2.0.0: version "2.1.1" resolved "https://registry.yarnpkg.com/terminal-link/-/terminal-link-2.1.1.tgz#14a64a27ab3c0df933ea546fba55f2d078edc994" @@ -13742,15 +13472,15 @@ terminal-link@^2.0.0: ansi-escapes "^4.2.1" supports-hyperlinks "^2.0.0" -terser-webpack-plugin@^5.1.3, terser-webpack-plugin@^5.3.1: - version "5.3.1" - resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-5.3.1.tgz#0320dcc270ad5372c1e8993fabbd927929773e54" - integrity sha512-GvlZdT6wPQKbDNW/GDQzZFg/j4vKU96yl2q6mcUkzKOgW4gwf1Z8cZToUCrz31XHlPWH8MVb1r2tFtdDtTGJ7g== +terser-webpack-plugin@^5.1.3, terser-webpack-plugin@^5.3.3: + version "5.3.3" + resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-5.3.3.tgz#8033db876dd5875487213e87c627bca323e5ed90" + integrity sha512-Fx60G5HNYknNTNQnzQ1VePRuu89ZVYWfjRAeT5rITuCY/1b08s49e5kSQwHDirKZWuoKOBRFS98EUUoZ9kLEwQ== dependencies: + "@jridgewell/trace-mapping" "^0.3.7" jest-worker "^27.4.5" schema-utils "^3.1.1" serialize-javascript "^6.0.0" - source-map "^0.6.1" terser "^5.7.2" terser@^5.0.0, terser@^5.10.0, terser@^5.7.2: @@ -13782,15 +13512,19 @@ text-table@^0.2.0: resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" integrity sha1-f17oI66AUgfACvLfSoTsP8+lcLQ= -throat@^6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/throat/-/throat-6.0.1.tgz#d514fedad95740c12c2d7fc70ea863eb51ade375" - integrity sha512-8hmiGIJMDlwjg7dlJ4yKGLK8EsYqKgPWbG3b4wjJddKNwc7N7Dpn08Df4szr/sZdMVeOstrdYSsqzX6BYbcB+w== +thenify-all@^1.0.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/thenify-all/-/thenify-all-1.6.0.tgz#1a1918d402d8fc3f98fbf234db0bcc8cc10e9726" + integrity sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA== + dependencies: + thenify ">= 3.1.0 < 4" -throttleit@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/throttleit/-/throttleit-1.0.0.tgz#9e785836daf46743145a5984b6268d828528ac6c" - integrity sha1-nnhYNtr0Z0MUWlmEtiaNgoUorGw= +"thenify@>= 3.1.0 < 4": + version "3.3.1" + resolved "https://registry.yarnpkg.com/thenify/-/thenify-3.3.1.tgz#8932e686a4066038a016dd9e2ca46add9838a95f" + integrity sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw== + dependencies: + any-promise "^1.0.0" through2@^2.0.0: version "2.0.5" @@ -13817,10 +13551,13 @@ thunky@^1.0.2: resolved "https://registry.yarnpkg.com/thunky/-/thunky-1.1.0.tgz#5abaf714a9405db0504732bbccd2cedd9ef9537d" integrity sha512-eHY7nBftgThBqOyHGVN+l8gF0BucP09fMo0oO/Lb0w1OF80dJv+lDVpXG60WMQvkcxAkNybKsrEIE3ZtKGmPrA== -timsort@~0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/timsort/-/timsort-0.3.0.tgz#405411a8e7e6339fe64db9a234de11dc31e02bd4" - integrity sha1-QFQRqOfmM5/mTbmiNN4R3DHgK9Q= +timers-ext@^0.1.7: + version "0.1.7" + resolved "https://registry.yarnpkg.com/timers-ext/-/timers-ext-0.1.7.tgz#6f57ad8578e07a3fb9f91d9387d65647555e25c6" + integrity sha512-b85NUNzTSdodShTIbky6ZF02e8STtVVfD+fu4aXXShEELpozH+bCpJLYMPZbsABN2wDH7fJpqIoXxJpzbf0NqQ== + dependencies: + es5-ext "~0.10.46" + next-tick "1" tiny-invariant@^1.0.2: version "1.2.0" @@ -13885,20 +13622,12 @@ totalist@^1.0.0: resolved "https://registry.yarnpkg.com/totalist/-/totalist-1.1.0.tgz#a4d65a3e546517701e3e5c37a47a70ac97fe56df" integrity sha512-gduQwd1rOdDMGxFG1gEvhV88Oirdo2p+KjoYFU7k2g+i7n6AFFbDQ5kMPUsW0pNbfQsB/cwXvT1i4Bue0s9g5g== -tough-cookie@~2.5.0: - version "2.5.0" - resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.5.0.tgz#cd9fb2a0aa1d5a12b473bd9fb96fa3dcff65ade2" - integrity sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g== - dependencies: - psl "^1.1.28" - punycode "^2.1.1" - -tr46@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/tr46/-/tr46-2.1.0.tgz#fa87aa81ca5d5941da8cbf1f9b749dc969a4e240" - integrity sha512-15Ih7phfcdP5YxqiB+iDtLoaTz4Nd35+IiAv0kQ5FNKHzXgdWqPoTIqEDDJmXceQt4JZk6lVPT8lnDlPpGDppw== +tr46@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/tr46/-/tr46-1.0.1.tgz#a8b13fd6bfd2489519674ccde55ba3693b706d09" + integrity sha512-dTpowEjclQ7Kgx5SdBkqRzVhERQXov8/l9Ft9dVM9fmg0W0KQSVaXX9T4i6twCPNtYiZM53lpSSUAwJbFPOHxA== dependencies: - punycode "^2.1.1" + punycode "^2.1.0" tr46@~0.0.3: version "0.0.3" @@ -13935,7 +13664,7 @@ ts-essentials@^2.0.3: resolved "https://registry.yarnpkg.com/ts-essentials/-/ts-essentials-2.0.12.tgz#c9303f3d74f75fa7528c3d49b80e089ab09d8745" integrity sha512-3IVX4nI6B5cc31/GFFE+i8ey/N2eA0CZDbo6n0yrz0zDX8ZJ8djmU1p+XRz7G3is0F3bB3pu2pAroFdAWQKU3w== -ts-node@^10.7.0: +ts-node@10.7.0: version "10.7.0" resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-10.7.0.tgz#35d503d0fab3e2baa672a0e94f4b40653c2463f5" integrity sha512-TbIGS4xgJoX2i3do417KSaep1uRAW/Lu+WAL2doDHC0D6ummjirVOXU5/7aiZotbQ5p1Zp9tP7U6cYhA0O7M8A== @@ -13954,7 +13683,7 @@ ts-node@^10.7.0: v8-compile-cache-lib "^3.0.0" yn "3.1.1" -tsconfig-paths@^3.14.1, tsconfig-paths@^3.9.0: +tsconfig-paths@^3.14.1: version "3.14.1" resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-3.14.1.tgz#ba0734599e8ea36c862798e920bcf163277b137a" integrity sha512-fxDhWnFSLt3VuTwtvJt5fpwxBHg5AdKWMsgcPOOIilyjymcYVZoCQF8fvFRezCNfblEXmi+PcM1eYHeOAgXCOQ== @@ -13964,6 +13693,15 @@ tsconfig-paths@^3.14.1, tsconfig-paths@^3.9.0: minimist "^1.2.6" strip-bom "^3.0.0" +tsconfig-paths@^4.1.2: + version "4.1.2" + resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-4.1.2.tgz#4819f861eef82e6da52fb4af1e8c930a39ed979a" + integrity sha512-uhxiMgnXQp1IR622dUXI+9Ehnws7i/y6xvpZB9IbUVOPy0muvdvgXeZOn88UcGPiT98Vp3rJPTa8bFoalZ3Qhw== + dependencies: + json5 "^2.2.2" + minimist "^1.2.6" + strip-bom "^3.0.0" + tslib@^1.10.0, tslib@^1.13.0, tslib@^1.8.1, tslib@^1.9.0: version "1.14.1" resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" @@ -14007,17 +13745,16 @@ tsutils@^3.21.0: dependencies: tslib "^1.8.1" -tunnel-agent@^0.6.0: - version "0.6.0" - resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd" - integrity sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0= +tsx@^3.12.1: + version "3.12.1" + resolved "https://registry.yarnpkg.com/tsx/-/tsx-3.12.1.tgz#d07532004c573bfea50a4ac687aa7270b3e34277" + integrity sha512-Rcg1x+rNe7qwlP8j7kx4VjP/pJo/V57k+17hlrn6a7FuQLNwkaw5W4JF75tYornNVCxkXdSUnqlIT8JY/ttvIw== dependencies: - safe-buffer "^5.0.1" - -tweetnacl@^0.14.3, tweetnacl@~0.14.0: - version "0.14.5" - resolved "https://registry.yarnpkg.com/tweetnacl/-/tweetnacl-0.14.5.tgz#5ae68177f192d4456269d108afa93ff8743f4f64" - integrity sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q= + "@esbuild-kit/cjs-loader" "^2.4.0" + "@esbuild-kit/core-utils" "^3.0.0" + "@esbuild-kit/esm-loader" "^2.5.0" + optionalDependencies: + fsevents "~2.3.2" type-check@^0.4.0, type-check@~0.4.0: version "0.4.0" @@ -14031,6 +13768,11 @@ type-detect@4.0.8: resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c" integrity sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g== +type-fest@^0.16.0: + version "0.16.0" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.16.0.tgz#3240b891a78b0deae910dbeb86553e552a148860" + integrity sha512-eaBzG6MxNzEn9kiwvtre90cXaNLkmadMWa1zQMs3XORCXNbsH/OewwbxC5ia9dCxIxnTAsSxXJaa/p5y8DlvJg== + type-fest@^0.18.0: version "0.18.1" resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.18.1.tgz#db4bc151a4a2cf4eebf9add5db75508db6cc841f" @@ -14074,6 +13816,16 @@ type-is@~1.6.18: media-typer "0.3.0" mime-types "~2.1.24" +type@^1.0.1: + version "1.2.0" + resolved "https://registry.yarnpkg.com/type/-/type-1.2.0.tgz#848dd7698dafa3e54a6c479e759c4bc3f18847a0" + integrity sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg== + +type@^2.5.0: + version "2.6.0" + resolved "https://registry.yarnpkg.com/type/-/type-2.6.0.tgz#3ca6099af5981d36ca86b78442973694278a219f" + integrity sha512-eiDBDOmkih5pMbo9OqsqPRGMljLodLcwd5XD5JbtNB0o89xZAwynY9EdCDsJU7LtcVCClu9DvM7/0Ep1hYX3EQ== + typedarray-to-buffer@^3.1.5: version "3.1.5" resolved "https://registry.yarnpkg.com/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz#a97ee7a9ff42691b9f783ff1bc5112fe3fca9080" @@ -14086,10 +13838,10 @@ typedarray@^0.0.6: resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= -typescript@*, typescript@4.7.2, "typescript@>=3.3.1 <4.8.0", typescript@^4.5.3, typescript@^4.5.5, typescript@~4.6.3: - version "4.7.2" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.7.2.tgz#1f9aa2ceb9af87cca227813b4310fff0b51593c4" - integrity sha512-Mamb1iX2FDUpcTRzltPxgWMKy3fhg0TN378ylbktPGPK/99KbDtMQ4W1hwgsbPAsG3a0xKa1vmw4VKZQbkvz5A== +typescript@*, "typescript@>=3.3.1 <5.0.0", "typescript@^3 || ^4", typescript@next, typescript@~4.8.4, typescript@~4.9.3: + version "4.9.3" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.3.tgz#3aea307c1746b8c384435d8ac36b8a2e580d85db" + integrity sha512-CIfGzTelbKNEnLpLdGFgdyKhG23CKdKgQPOBc+OUNrkJ2vr+KSzsSV5kq5iWhEQbok+quxgGzrAtGWCyU7tHnA== ua-parser-js@^0.7.30: version "0.7.31" @@ -14159,13 +13911,14 @@ unified@9.2.0: trough "^1.0.0" vfile "^4.0.0" -unified@^8.4.2: - version "8.4.2" - resolved "https://registry.yarnpkg.com/unified/-/unified-8.4.2.tgz#13ad58b4a437faa2751a4a4c6a16f680c500fff1" - integrity sha512-JCrmN13jI4+h9UAyKEoGcDZV+i1E7BLFuG7OsaDvTXI5P0qhHX+vZO/kOhz9jn8HGENDKbwSeB0nVOg4gVStGA== +unified@^9.2.2: + version "9.2.2" + resolved "https://registry.yarnpkg.com/unified/-/unified-9.2.2.tgz#67649a1abfc3ab85d2969502902775eb03146975" + integrity sha512-Sg7j110mtefBD+qunSLO1lqOEKdrwBFBrR6Qd8f4uwkhWNlbkaqwHse6e7QvD3AP/MNoJdEDLaf8OxYyoWgorQ== dependencies: bail "^1.0.0" extend "^3.0.0" + is-buffer "^2.0.0" is-plain-obj "^2.0.0" trough "^1.0.0" vfile "^4.0.0" @@ -14240,7 +13993,7 @@ unist-util-visit-parents@^3.0.0: "@types/unist" "^2.0.0" unist-util-is "^4.0.0" -unist-util-visit@2.0.3, unist-util-visit@^2.0.0, unist-util-visit@^2.0.1, unist-util-visit@^2.0.3: +unist-util-visit@2.0.3, unist-util-visit@^2.0.0, unist-util-visit@^2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/unist-util-visit/-/unist-util-visit-2.0.3.tgz#c3703893146df47203bb8a9795af47d7b971208c" integrity sha512-iJ4/RczbJMkD0712mGktuGpm/U4By4FfDonL7N/9tATGIF4imikjOuagyMY53tnZq3NP6BcmlrHhEKAfGWjh7Q== @@ -14269,16 +14022,24 @@ unpipe@1.0.0, unpipe@~1.0.0: resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" integrity sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw= -untildify@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/untildify/-/untildify-4.0.0.tgz#2bc947b953652487e4600949fb091e3ae8cd919b" - integrity sha512-KK8xQ1mkzZeg9inewmFVDNkg3l5LUhoq9kN6iWYB/CC9YMG8HA+c1Q8HwDe6dEX7kErrEVNVBO3fWsVq5iDgtw== +upath@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/upath/-/upath-1.2.0.tgz#8f66dbcd55a883acdae4408af8b035a5044c1894" + integrity sha512-aZwGpamFO61g3OlfT7OQCHqhGnW43ieH9WZeP7QxN/G/jS4jfqUkZxoryvJgVPEcrl5NL/ggHsSmLMHuH64Lhg== upath@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/upath/-/upath-2.0.1.tgz#50c73dea68d6f6b990f51d279ce6081665d61a8b" integrity sha512-1uEe95xksV1O0CYKXo8vQvN1JEbtJp7lb7C5U9HMsIp6IVwntkH/oNUzyVNQSd4S1sYk2FpSSW44FqMc8qee5w== +update-browserslist-db@^1.0.9: + version "1.0.9" + resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.0.9.tgz#2924d3927367a38d5c555413a7ce138fc95fcb18" + integrity sha512-/xsqn21EGVdXI3EXSum1Yckj3ZVZugqyOZQ/CxYPBD/R+ko9NSUScf8tFF4dOKY+2pvSSJA/S+5B8s4Zr4kyvg== + dependencies: + escalade "^3.1.1" + picocolors "^1.0.0" + update-notifier@^5.1.0: version "5.1.0" resolved "https://registry.yarnpkg.com/update-notifier/-/update-notifier-5.1.0.tgz#4ab0d7c7f36a231dd7316cf7729313f0214d9ad9" @@ -14322,14 +14083,6 @@ url-parse-lax@^3.0.0: dependencies: prepend-http "^2.0.0" -url@^0.11.0: - version "0.11.0" - resolved "https://registry.yarnpkg.com/url/-/url-0.11.0.tgz#3838e97cfc60521eb73c525a8e55bfdd9e2e28f1" - integrity sha1-ODjpfPxgUh63PFJajlW/3Z4uKPE= - dependencies: - punycode "1.3.2" - querystring "0.2.0" - use-composed-ref@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/use-composed-ref/-/use-composed-ref-1.1.0.tgz#9220e4e94a97b7b02d7d27eaeab0b37034438bbc" @@ -14369,11 +14122,6 @@ utils-merge@1.0.1: resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" integrity sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM= -uuid@^3.4.0: - version "3.4.0" - resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee" - integrity sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A== - uuid@^8.3.2: version "8.3.2" resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2" @@ -14435,15 +14183,6 @@ vary@~1.1.2: resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc" integrity sha1-IpnwLG3tMNSllhsLn3RSShj2NPw= -verror@1.10.0: - version "1.10.0" - resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400" - integrity sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA= - dependencies: - assert-plus "^1.0.0" - core-util-is "1.0.2" - extsprintf "^1.2.0" - vfile-location@^3.0.0, vfile-location@^3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/vfile-location/-/vfile-location-3.2.0.tgz#d8e41fbcbd406063669ebf6c33d56ae8721d0f3c" @@ -14467,15 +14206,15 @@ vfile@^4.0.0: unist-util-stringify-position "^2.0.0" vfile-message "^2.0.0" -vscode-languageserver-textdocument@^1.0.4: - version "1.0.4" - resolved "https://registry.yarnpkg.com/vscode-languageserver-textdocument/-/vscode-languageserver-textdocument-1.0.4.tgz#3cd56dd14cec1d09e86c4bb04b09a246cb3df157" - integrity sha512-/xhqXP/2A2RSs+J8JNXpiiNVvvNM0oTosNVmQnunlKvq9o4mupHOBAnnzH0lwIPKazXKvAKsVp1kr+H/K4lgoQ== +vscode-languageserver-textdocument@^1.0.7: + version "1.0.7" + resolved "https://registry.yarnpkg.com/vscode-languageserver-textdocument/-/vscode-languageserver-textdocument-1.0.7.tgz#16df468d5c2606103c90554ae05f9f3d335b771b" + integrity sha512-bFJH7UQxlXT8kKeyiyu41r22jCZXG8kuuVVA33OEJn1diWOZK5n8zBSPZFHVBOu8kXZ6h0LIRhf5UnCo61J4Hg== -vscode-uri@^3.0.3: - version "3.0.3" - resolved "https://registry.yarnpkg.com/vscode-uri/-/vscode-uri-3.0.3.tgz#a95c1ce2e6f41b7549f86279d19f47951e4f4d84" - integrity sha512-EcswR2S8bpR7fD0YPeS7r2xXExrScVMxg4MedACaWHEtx9ftCF/qHG1xGkolzTPcEmjTavCQgbVzHUIdTMzFGA== +vscode-uri@^3.0.6: + version "3.0.6" + resolved "https://registry.yarnpkg.com/vscode-uri/-/vscode-uri-3.0.6.tgz#5e6e2e1a4170543af30151b561a41f71db1d6f91" + integrity sha512-fmL7V1eiDBFRRnu+gfRWTzyPpNIHJTc4mWnFkwBUmO9U3KPgJAmTx7oxi2bl/Rh6HLdU7+4C9wlj0k2E4AdKFQ== wait-on@^6.0.1: version "6.0.1" @@ -14500,10 +14239,10 @@ walker@^1.0.8: dependencies: makeerror "1.0.12" -watchpack@^2.3.1: - version "2.3.1" - resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-2.3.1.tgz#4200d9447b401156eeca7767ee610f8809bc9d25" - integrity sha512-x0t0JuydIo8qCNctdDrn1OzH/qDzk2+rdCOC3YzumZ42fiMqmQ7T3xQurykYMhYfHaPHTp4ZxAx2NfUo1K6QaA== +watchpack@^2.4.0: + version "2.4.0" + resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-2.4.0.tgz#fa33032374962c78113f93c7f2fb4c54c9862a5d" + integrity sha512-Lcvm7MGST/4fup+ifyKi2hjyIAwcdI4HRgtvTpIUxBRhB+RFtUh8XtDOxUfctVCnhVi+QQj49i91OyvzkJl6cg== dependencies: glob-to-regexp "^0.4.1" graceful-fs "^4.1.2" @@ -14515,14 +14254,14 @@ wbuf@^1.1.0, wbuf@^1.7.3: dependencies: minimalistic-assert "^1.0.0" -wcwidth@^1.0.0: +wcwidth@^1.0.0, wcwidth@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/wcwidth/-/wcwidth-1.0.1.tgz#f0b0dcf915bc5ff1528afadb2c0e17b532da2fe8" integrity sha1-8LDc+RW8X/FSivrbLA4XtTLaL+g= dependencies: defaults "^1.0.3" -web-namespaces@^1.0.0, web-namespaces@^1.1.2: +web-namespaces@^1.0.0: version "1.1.4" resolved "https://registry.yarnpkg.com/web-namespaces/-/web-namespaces-1.1.4.tgz#bc98a3de60dadd7faefc403d1076d529f5e030ec" integrity sha512-wYxSGajtmoP4WxfejAPIr4l0fVh+jeMXZb08wNc0tMg6xsfZXj3cECqIK0G7ZAqUq0PP8WlMDtaOGVBTAWztNw== @@ -14532,10 +14271,10 @@ webidl-conversions@^3.0.0: resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871" integrity sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE= -webidl-conversions@^6.1.0: - version "6.1.0" - resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-6.1.0.tgz#9111b4d7ea80acd40f5270d666621afa78b69514" - integrity sha512-qBIvFLGiBpLjfwmYAaHPXsn+ho5xZnGvyGvsarywGNc8VyQJUMHJ8OBKGGrPER0okBeMDaan4mNBlgBROxuI8w== +webidl-conversions@^4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-4.0.2.tgz#a855980b1f0b6b359ba1d5d9fb39ae941faa63ad" + integrity sha512-YQ+BmxuTgd6UXZW3+ICGfyqRyHXVlD5GtQr5+qjiNW7bF0cqrzX500HVXPBOvgXb5YnzDd+h0zqyv61KUD7+Sg== webpack-bundle-analyzer@^4.5.0: version "4.5.0" @@ -14563,15 +14302,16 @@ webpack-dev-middleware@^5.3.1: range-parser "^1.2.1" schema-utils "^4.0.0" -webpack-dev-server@^4.9.0: - version "4.9.0" - resolved "https://registry.yarnpkg.com/webpack-dev-server/-/webpack-dev-server-4.9.0.tgz#737dbf44335bb8bde68f8f39127fc401c97a1557" - integrity sha512-+Nlb39iQSOSsFv0lWUuUTim3jDQO8nhK3E68f//J2r5rIcp4lULHXz2oZ0UVdEeWXEh5lSzYUlzarZhDAeAVQw== +webpack-dev-server@^4.9.3: + version "4.9.3" + resolved "https://registry.yarnpkg.com/webpack-dev-server/-/webpack-dev-server-4.9.3.tgz#2360a5d6d532acb5410a668417ad549ee3b8a3c9" + integrity sha512-3qp/eoboZG5/6QgiZ3llN8TUzkSpYg1Ko9khWX1h40MIEUNS2mDoIa8aXsPfskER+GbTvs/IJZ1QTBBhhuetSw== dependencies: "@types/bonjour" "^3.5.9" "@types/connect-history-api-fallback" "^1.3.5" "@types/express" "^4.17.13" "@types/serve-index" "^1.9.1" + "@types/serve-static" "^1.13.10" "@types/sockjs" "^0.3.33" "@types/ws" "^8.5.1" ansi-html-community "^0.0.8" @@ -14579,7 +14319,7 @@ webpack-dev-server@^4.9.0: chokidar "^3.5.3" colorette "^2.0.10" compression "^1.7.4" - connect-history-api-fallback "^1.6.0" + connect-history-api-fallback "^2.0.0" default-gateway "^6.0.3" express "^4.17.3" graceful-fs "^4.2.6" @@ -14592,7 +14332,7 @@ webpack-dev-server@^4.9.0: schema-utils "^4.0.0" selfsigned "^2.0.1" serve-index "^1.9.1" - sockjs "^0.3.21" + sockjs "^0.3.24" spdy "^4.0.2" webpack-dev-middleware "^5.3.1" ws "^8.4.2" @@ -14605,34 +14345,26 @@ webpack-merge@^5.8.0: clone-deep "^4.0.1" wildcard "^2.0.0" -webpack-sources@^1.4.3: - version "1.4.3" - resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-1.4.3.tgz#eedd8ec0b928fbf1cbfe994e22d2d890f330a933" - integrity sha512-lgTS3Xhv1lCOKo7SA5TjKXMjpSM4sBjNV5+q2bqesbSPs5FjGmU6jjtBSkX9b4qW87vDIsCIlUPOEhbZrMdjeQ== - dependencies: - source-list-map "^2.0.0" - source-map "~0.6.1" - -webpack-sources@^3.2.3: +webpack-sources@^3.2.2, webpack-sources@^3.2.3: version "3.2.3" resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-3.2.3.tgz#2d4daab8451fd4b240cc27055ff6a0c2ccea0cde" integrity sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w== -webpack@^5.72.1: - version "5.73.0" - resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.73.0.tgz#bbd17738f8a53ee5760ea2f59dce7f3431d35d38" - integrity sha512-svjudQRPPa0YiOYa2lM/Gacw0r6PvxptHj4FuEKQ2kX05ZLkjbVc5MnPs6its5j7IZljnIqSVo/OsY2X0IpHGA== +webpack@^5.73.0, webpack@^5.74.0: + version "5.74.0" + resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.74.0.tgz#02a5dac19a17e0bb47093f2be67c695102a55980" + integrity sha512-A2InDwnhhGN4LYctJj6M1JEaGL7Luj6LOmyBHjcI8529cm5p6VXiTIW2sn6ffvEAKmveLzvu4jrihwXtPojlAA== dependencies: "@types/eslint-scope" "^3.7.3" "@types/estree" "^0.0.51" "@webassemblyjs/ast" "1.11.1" "@webassemblyjs/wasm-edit" "1.11.1" "@webassemblyjs/wasm-parser" "1.11.1" - acorn "^8.4.1" + acorn "^8.7.1" acorn-import-assertions "^1.7.6" browserslist "^4.14.5" chrome-trace-event "^1.0.2" - enhanced-resolve "^5.9.3" + enhanced-resolve "^5.10.0" es-module-lexer "^0.9.0" eslint-scope "5.1.1" events "^3.2.0" @@ -14645,7 +14377,7 @@ webpack@^5.72.1: schema-utils "^3.1.0" tapable "^2.1.1" terser-webpack-plugin "^5.1.3" - watchpack "^2.3.1" + watchpack "^2.4.0" webpack-sources "^3.2.3" webpackbar@^5.0.2: @@ -14680,14 +14412,14 @@ whatwg-url@^5.0.0: tr46 "~0.0.3" webidl-conversions "^3.0.0" -whatwg-url@^8.4.0: - version "8.7.0" - resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-8.7.0.tgz#656a78e510ff8f3937bc0bcbe9f5c0ac35941b77" - integrity sha512-gAojqb/m9Q8a5IV96E3fHJM70AzCkgt4uXYX2O7EmuyOnLrViCQlsEBmF9UQIu3/aeAIp2U17rtbpZWNntQqdg== +whatwg-url@^7.0.0: + version "7.1.0" + resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-7.1.0.tgz#c2c492f1eca612988efd3d2266be1b9fc6170d06" + integrity sha512-WUu7Rg1DroM7oQvGWfOiAK21n74Gg+T4elXEQYkOhtyLeWiJFoOGLXPKI/9gzIie9CtwVLm8wtw6YJdKyxSjeg== dependencies: - lodash "^4.7.0" - tr46 "^2.1.0" - webidl-conversions "^6.1.0" + lodash.sortby "^4.7.0" + tr46 "^1.0.1" + webidl-conversions "^4.0.2" which-boxed-primitive@^1.0.2: version "1.0.2" @@ -14700,7 +14432,7 @@ which-boxed-primitive@^1.0.2: is-string "^1.0.5" is-symbol "^1.0.3" -which@^1.3.1: +which@^1.2.9, which@^1.3.1: version "1.3.1" resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a" integrity sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ== @@ -14750,6 +14482,164 @@ wordwrap@^1.0.0: resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-1.0.0.tgz#27584810891456a4171c8d0226441ade90cbcaeb" integrity sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus= +workbox-background-sync@6.5.4: + version "6.5.4" + resolved "https://registry.yarnpkg.com/workbox-background-sync/-/workbox-background-sync-6.5.4.tgz#3141afba3cc8aa2ae14c24d0f6811374ba8ff6a9" + integrity sha512-0r4INQZMyPky/lj4Ou98qxcThrETucOde+7mRGJl13MPJugQNKeZQOdIJe/1AchOP23cTqHcN/YVpD6r8E6I8g== + dependencies: + idb "^7.0.1" + workbox-core "6.5.4" + +workbox-broadcast-update@6.5.4: + version "6.5.4" + resolved "https://registry.yarnpkg.com/workbox-broadcast-update/-/workbox-broadcast-update-6.5.4.tgz#8441cff5417cd41f384ba7633ca960a7ffe40f66" + integrity sha512-I/lBERoH1u3zyBosnpPEtcAVe5lwykx9Yg1k6f8/BGEPGaMMgZrwVrqL1uA9QZ1NGGFoyE6t9i7lBjOlDhFEEw== + dependencies: + workbox-core "6.5.4" + +workbox-build@^6.5.3: + version "6.5.4" + resolved "https://registry.yarnpkg.com/workbox-build/-/workbox-build-6.5.4.tgz#7d06d31eb28a878817e1c991c05c5b93409f0389" + integrity sha512-kgRevLXEYvUW9WS4XoziYqZ8Q9j/2ziJYEtTrjdz5/L/cTUa2XfyMP2i7c3p34lgqJ03+mTiz13SdFef2POwbA== + dependencies: + "@apideck/better-ajv-errors" "^0.3.1" + "@babel/core" "^7.11.1" + "@babel/preset-env" "^7.11.0" + "@babel/runtime" "^7.11.2" + "@rollup/plugin-babel" "^5.2.0" + "@rollup/plugin-node-resolve" "^11.2.1" + "@rollup/plugin-replace" "^2.4.1" + "@surma/rollup-plugin-off-main-thread" "^2.2.3" + ajv "^8.6.0" + common-tags "^1.8.0" + fast-json-stable-stringify "^2.1.0" + fs-extra "^9.0.1" + glob "^7.1.6" + lodash "^4.17.20" + pretty-bytes "^5.3.0" + rollup "^2.43.1" + rollup-plugin-terser "^7.0.0" + source-map "^0.8.0-beta.0" + stringify-object "^3.3.0" + strip-comments "^2.0.1" + tempy "^0.6.0" + upath "^1.2.0" + workbox-background-sync "6.5.4" + workbox-broadcast-update "6.5.4" + workbox-cacheable-response "6.5.4" + workbox-core "6.5.4" + workbox-expiration "6.5.4" + workbox-google-analytics "6.5.4" + workbox-navigation-preload "6.5.4" + workbox-precaching "6.5.4" + workbox-range-requests "6.5.4" + workbox-recipes "6.5.4" + workbox-routing "6.5.4" + workbox-strategies "6.5.4" + workbox-streams "6.5.4" + workbox-sw "6.5.4" + workbox-window "6.5.4" + +workbox-cacheable-response@6.5.4: + version "6.5.4" + resolved "https://registry.yarnpkg.com/workbox-cacheable-response/-/workbox-cacheable-response-6.5.4.tgz#a5c6ec0c6e2b6f037379198d4ef07d098f7cf137" + integrity sha512-DCR9uD0Fqj8oB2TSWQEm1hbFs/85hXXoayVwFKLVuIuxwJaihBsLsp4y7J9bvZbqtPJ1KlCkmYVGQKrBU4KAug== + dependencies: + workbox-core "6.5.4" + +workbox-core@6.5.4: + version "6.5.4" + resolved "https://registry.yarnpkg.com/workbox-core/-/workbox-core-6.5.4.tgz#df48bf44cd58bb1d1726c49b883fb1dffa24c9ba" + integrity sha512-OXYb+m9wZm8GrORlV2vBbE5EC1FKu71GGp0H4rjmxmF4/HLbMCoTFws87M3dFwgpmg0v00K++PImpNQ6J5NQ6Q== + +workbox-expiration@6.5.4: + version "6.5.4" + resolved "https://registry.yarnpkg.com/workbox-expiration/-/workbox-expiration-6.5.4.tgz#501056f81e87e1d296c76570bb483ce5e29b4539" + integrity sha512-jUP5qPOpH1nXtjGGh1fRBa1wJL2QlIb5mGpct3NzepjGG2uFFBn4iiEBiI9GUmfAFR2ApuRhDydjcRmYXddiEQ== + dependencies: + idb "^7.0.1" + workbox-core "6.5.4" + +workbox-google-analytics@6.5.4: + version "6.5.4" + resolved "https://registry.yarnpkg.com/workbox-google-analytics/-/workbox-google-analytics-6.5.4.tgz#c74327f80dfa4c1954cbba93cd7ea640fe7ece7d" + integrity sha512-8AU1WuaXsD49249Wq0B2zn4a/vvFfHkpcFfqAFHNHwln3jK9QUYmzdkKXGIZl9wyKNP+RRX30vcgcyWMcZ9VAg== + dependencies: + workbox-background-sync "6.5.4" + workbox-core "6.5.4" + workbox-routing "6.5.4" + workbox-strategies "6.5.4" + +workbox-navigation-preload@6.5.4: + version "6.5.4" + resolved "https://registry.yarnpkg.com/workbox-navigation-preload/-/workbox-navigation-preload-6.5.4.tgz#ede56dd5f6fc9e860a7e45b2c1a8f87c1c793212" + integrity sha512-IIwf80eO3cr8h6XSQJF+Hxj26rg2RPFVUmJLUlM0+A2GzB4HFbQyKkrgD5y2d84g2IbJzP4B4j5dPBRzamHrng== + dependencies: + workbox-core "6.5.4" + +workbox-precaching@6.5.4, workbox-precaching@^6.5.3: + version "6.5.4" + resolved "https://registry.yarnpkg.com/workbox-precaching/-/workbox-precaching-6.5.4.tgz#740e3561df92c6726ab5f7471e6aac89582cab72" + integrity sha512-hSMezMsW6btKnxHB4bFy2Qfwey/8SYdGWvVIKFaUm8vJ4E53JAY+U2JwLTRD8wbLWoP6OVUdFlXsTdKu9yoLTg== + dependencies: + workbox-core "6.5.4" + workbox-routing "6.5.4" + workbox-strategies "6.5.4" + +workbox-range-requests@6.5.4: + version "6.5.4" + resolved "https://registry.yarnpkg.com/workbox-range-requests/-/workbox-range-requests-6.5.4.tgz#86b3d482e090433dab38d36ae031b2bb0bd74399" + integrity sha512-Je2qR1NXCFC8xVJ/Lux6saH6IrQGhMpDrPXWZWWS8n/RD+WZfKa6dSZwU+/QksfEadJEr/NfY+aP/CXFFK5JFg== + dependencies: + workbox-core "6.5.4" + +workbox-recipes@6.5.4: + version "6.5.4" + resolved "https://registry.yarnpkg.com/workbox-recipes/-/workbox-recipes-6.5.4.tgz#cca809ee63b98b158b2702dcfb741b5cc3e24acb" + integrity sha512-QZNO8Ez708NNwzLNEXTG4QYSKQ1ochzEtRLGaq+mr2PyoEIC1xFW7MrWxrONUxBFOByksds9Z4//lKAX8tHyUA== + dependencies: + workbox-cacheable-response "6.5.4" + workbox-core "6.5.4" + workbox-expiration "6.5.4" + workbox-precaching "6.5.4" + workbox-routing "6.5.4" + workbox-strategies "6.5.4" + +workbox-routing@6.5.4: + version "6.5.4" + resolved "https://registry.yarnpkg.com/workbox-routing/-/workbox-routing-6.5.4.tgz#6a7fbbd23f4ac801038d9a0298bc907ee26fe3da" + integrity sha512-apQswLsbrrOsBUWtr9Lf80F+P1sHnQdYodRo32SjiByYi36IDyL2r7BH1lJtFX8fwNHDa1QOVY74WKLLS6o5Pg== + dependencies: + workbox-core "6.5.4" + +workbox-strategies@6.5.4: + version "6.5.4" + resolved "https://registry.yarnpkg.com/workbox-strategies/-/workbox-strategies-6.5.4.tgz#4edda035b3c010fc7f6152918370699334cd204d" + integrity sha512-DEtsxhx0LIYWkJBTQolRxG4EI0setTJkqR4m7r4YpBdxtWJH1Mbg01Cj8ZjNOO8etqfA3IZaOPHUxCs8cBsKLw== + dependencies: + workbox-core "6.5.4" + +workbox-streams@6.5.4: + version "6.5.4" + resolved "https://registry.yarnpkg.com/workbox-streams/-/workbox-streams-6.5.4.tgz#1cb3c168a6101df7b5269d0353c19e36668d7d69" + integrity sha512-FXKVh87d2RFXkliAIheBojBELIPnWbQdyDvsH3t74Cwhg0fDheL1T8BqSM86hZvC0ZESLsznSYWw+Va+KVbUzg== + dependencies: + workbox-core "6.5.4" + workbox-routing "6.5.4" + +workbox-sw@6.5.4: + version "6.5.4" + resolved "https://registry.yarnpkg.com/workbox-sw/-/workbox-sw-6.5.4.tgz#d93e9c67924dd153a61367a4656ff4d2ae2ed736" + integrity sha512-vo2RQo7DILVRoH5LjGqw3nphavEjK4Qk+FenXeUsknKn14eCNedHOXWbmnvP4ipKhlE35pvJ4yl4YYf6YsJArA== + +workbox-window@6.5.4, workbox-window@^6.5.3: + version "6.5.4" + resolved "https://registry.yarnpkg.com/workbox-window/-/workbox-window-6.5.4.tgz#d991bc0a94dff3c2dbb6b84558cff155ca878e91" + integrity sha512-HnLZJDwYBE+hpG25AQBO8RUWBJRaCsI9ksQJEp3aCOFCaG5kqaToAYXFRAHxzRluM2cQbGzdQF5rjKPWPA1fug== + dependencies: + "@types/trusted-types" "^2.0.2" + workbox-core "6.5.4" + wrap-ansi@^6.2.0: version "6.2.0" resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-6.2.0.tgz#e9393ba07102e6c91a3b221478f0257cd2856e53" @@ -14791,7 +14681,7 @@ write-file-atomic@^2.4.2: imurmurhash "^0.1.4" signal-exit "^3.0.2" -write-file-atomic@^3.0.0, write-file-atomic@^3.0.3: +write-file-atomic@^3.0.0: version "3.0.3" resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-3.0.3.tgz#56bd5c5a5c70481cd19c571bd39ab965a5de56e8" integrity sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q== @@ -14894,10 +14784,10 @@ yargs-parser@20.2.4: resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-20.2.4.tgz#b42890f14566796f85ae8e3a25290d205f154a54" integrity sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA== -yargs-parser@21.0.1, yargs-parser@^21.0.0: - version "21.0.1" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-21.0.1.tgz#0267f286c877a4f0f728fceb6f8a3e4cb95c6e35" - integrity sha512-9BK1jFpLzJROCI5TzwZL/TU4gqjK5xiHV/RfWLOahrjAko/e4DJkRDZQXfvqAsiZzzYhgAzbgz6lg48jcm4GLg== +yargs-parser@21.1.1, yargs-parser@>=21.0.1, yargs-parser@^21.1.1: + version "21.1.1" + resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-21.1.1.tgz#9096bceebf990d21bb31fa9516e0ede294a77d35" + integrity sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw== yargs-parser@^20.2.2, yargs-parser@^20.2.3: version "20.2.9" @@ -14917,26 +14807,18 @@ yargs@^16.2.0: y18n "^5.0.5" yargs-parser "^20.2.2" -yargs@^17.3.1, yargs@^17.4.0: - version "17.4.1" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.4.1.tgz#ebe23284207bb75cee7c408c33e722bfb27b5284" - integrity sha512-WSZD9jgobAg3ZKuCQZSa3g9QOJeCCqLoLAykiWgmXnDo9EPnn4RPf5qVTtzgOx66o6/oqhcA5tHtJXpG8pMt3g== +yargs@^17.3.1, yargs@^17.6.2: + version "17.6.2" + resolved "https://registry.yarnpkg.com/yargs/-/yargs-17.6.2.tgz#2e23f2944e976339a1ee00f18c77fedee8332541" + integrity sha512-1/9UrdHjDZc0eOU0HxOHoS78C69UD3JRMvzlJ7S79S2nTaWRA/whGCTV8o9e/N/1Va9YIV7Q4sOxD8VV4pCWOw== dependencies: - cliui "^7.0.2" + cliui "^8.0.1" escalade "^3.1.1" get-caller-file "^2.0.5" require-directory "^2.1.1" string-width "^4.2.3" y18n "^5.0.5" - yargs-parser "^21.0.0" - -yauzl@^2.10.0: - version "2.10.0" - resolved "https://registry.yarnpkg.com/yauzl/-/yauzl-2.10.0.tgz#c7eb17c93e112cb1086fa6d8e51fb0667b79a5f9" - integrity sha1-x+sXyT4RLLEIb6bY5R+wZnt5pfk= - dependencies: - buffer-crc32 "~0.2.3" - fd-slicer "~1.1.0" + yargs-parser "^21.1.1" yn@3.1.1: version "3.1.1"