From d1d2540b44c08e479ce64be984912aef418ece6c Mon Sep 17 00:00:00 2001 From: Yosuke Ota Date: Wed, 29 Jan 2025 13:21:45 +0900 Subject: [PATCH 01/10] Drop support old eslint and node (#242) * Drop support old eslint and node * fix * update * update * fix --- .eslintignore | 10 - .eslintrc.yml | 878 --------- .github/workflows/CI.yml | 52 +- .gitmodules | 3 - .vscode/settings.json | 11 +- README.md | 9 +- eslint.config.mjs | 803 +++++++++ package.json | 57 +- scripts/ci-install-eslint.js | 20 +- scripts/update-fixtures-ast.js | 3 +- scripts/update-fixtures-document-fragment.js | 4 +- src/common/ast-utils.ts | 2 +- src/common/error-utils.ts | 2 +- src/common/eslint-scope.ts | 46 +- src/common/espree.ts | 72 +- src/common/fix-locations.ts | 4 +- src/common/lines-and-columns.ts | 2 +- src/common/linter-require.ts | 26 - src/common/location-calculator.ts | 2 +- src/common/parser-object.ts | 2 +- src/common/parser-options.ts | 6 +- src/common/token-utils.ts | 2 +- src/external/node-event-generator.ts | 201 ++- .../cursors/backward-token-comment-cursor.ts | 30 +- .../cursors/backward-token-cursor.ts | 18 +- src/external/token-store/cursors/cursor.ts | 12 +- .../token-store/cursors/decorative-cursor.ts | 4 +- .../token-store/cursors/filter-cursor.ts | 8 +- .../cursors/forward-token-comment-cursor.ts | 35 +- .../cursors/forward-token-cursor.ts | 20 +- src/external/token-store/cursors/index.ts | 60 +- .../token-store/cursors/limit-cursor.ts | 6 +- .../cursors/padded-token-cursor.ts | 12 +- .../token-store/cursors/skip-cursor.ts | 6 +- src/external/token-store/index.ts | 338 +++- src/external/token-store/utils.ts | 22 +- src/html/custom-tokenizer.ts | 2 +- src/html/intermediate-tokenizer.ts | 4 +- src/html/parser.ts | 6 +- src/html/tokenizer.ts | 16 +- src/html/util/unicode.ts | 56 +- src/index.ts | 13 +- src/parser-services.ts | 15 +- src/script-setup/index.ts | 11 +- src/script-setup/parser-options.ts | 11 +- src/script-setup/scope-analyzer.ts | 4 +- src/script/generic.ts | 2 +- src/script/index.ts | 16 +- src/script/scope-analyzer.ts | 8 +- src/sfc/custom-block/index.ts | 4 +- src/style/index.ts | 8 +- src/style/tokenizer.ts | 2 +- src/template/index.ts | 8 +- test/ast.js | 138 +- test/core-rules.js | 239 --- test/define-custom-blocks-visitor.js | 622 ++++--- test/define-document-visitor.js | 71 +- test/document-fragment.js | 2 +- test/espree.js | 133 -- test/fixtures/ast/address-component/ast.json | 2 +- .../ast/attributes-linebreak/ast.json | 2 +- test/fixtures/ast/attributes/ast.json | 2 +- test/fixtures/ast/auto-closing-dt-dd/ast.json | 2 +- test/fixtures/ast/auto-closing-p/ast.json | 2 +- test/fixtures/ast/bogus-comments/ast.json | 2 +- test/fixtures/ast/cdata/ast.json | 2 +- test/fixtures/ast/comments-2/ast.json | 2 +- test/fixtures/ast/comments-3/ast.json | 2 +- test/fixtures/ast/comments/ast.json | 2 +- .../ast/custom-template-tokenizer/ast.json | 2 +- test/fixtures/ast/custom-thead/ast.json | 2 +- .../ast/define-model06-with-ts/ast.json | 312 ++-- .../ast/define-model06-with-ts/scope.json | 628 +++++-- .../ast/define-model07-with-ts/ast.json | 467 ++--- .../ast/define-model07-with-ts/scope.json | 628 +++++-- .../ast.json | 1252 ++++++------- .../scope.json | 808 ++++++--- test/fixtures/ast/define-slots01/ast.json | 644 +++---- test/fixtures/ast/define-slots01/scope.json | 628 +++++-- .../directive-argument-and-modifiers/ast.json | 2 +- .../fixtures/ast/directive-arguments/ast.json | 2 +- .../ast/directive-empty-value/ast.json | 2 +- test/fixtures/ast/directive-error-1/ast.json | 2 +- test/fixtures/ast/directive-error-2/ast.json | 2 +- test/fixtures/ast/directive-error-3/ast.json | 2 +- test/fixtures/ast/directive-error-4/ast.json | 2 +- .../fixtures/ast/directive-modifiers/ast.json | 2 +- .../ast/directive-shorthands/ast.json | 2 +- test/fixtures/ast/directives/ast.json | 2 +- .../ast/dynamic-argument-dot/ast.json | 2 +- .../ast/dynamic-argument-error-1/ast.json | 2 +- .../ast/dynamic-argument-error-2/ast.json | 2 +- .../ast/dynamic-argument-error-4/ast.json | 2 +- .../ast/dynamic-argument-error-5/ast.json | 2 +- .../ast/dynamic-argument-expr/ast.json | 2 +- .../ast/dynamic-argument-v-bind/ast.json | 2 +- .../ast/dynamic-argument-v-on/ast.json | 2 +- .../ast/dynamic-argument-v-slot/ast.json | 2 +- test/fixtures/ast/elements/ast.json | 2 +- test/fixtures/ast/empty-script-only/ast.json | 2 +- .../fixtures/ast/empty-template-only/ast.json | 2 +- test/fixtures/ast/empty/ast.json | 2 +- test/fixtures/ast/end-of-line01/ast.json | 2 +- test/fixtures/ast/end-of-line02/ast.json | 2 +- .../ast.json | 2 +- .../ast.json | 2 +- .../ast.json | 2 +- .../ast/error-duplicate-attribute/ast.json | 2 +- .../error-end-tag-with-attributes/ast.json | 2 +- .../ast.json | 2 +- .../ast/error-eof-before-tag-name-2/ast.json | 2 +- .../ast/error-eof-before-tag-name/ast.json | 2 +- test/fixtures/ast/error-eof-in-cdata/ast.json | 2 +- .../ast/error-eof-in-comment-2/ast.json | 2 +- .../ast/error-eof-in-comment-3/ast.json | 2 +- .../ast/error-eof-in-comment-4/ast.json | 2 +- .../ast/error-eof-in-comment-5/ast.json | 2 +- .../ast/error-eof-in-comment/ast.json | 2 +- test/fixtures/ast/error-eof-in-tag-2/ast.json | 2 +- test/fixtures/ast/error-eof-in-tag-3/ast.json | 2 +- test/fixtures/ast/error-eof-in-tag-4/ast.json | 2 +- test/fixtures/ast/error-eof-in-tag-5/ast.json | 2 +- test/fixtures/ast/error-eof-in-tag-6/ast.json | 2 +- test/fixtures/ast/error-eof-in-tag-7/ast.json | 2 +- test/fixtures/ast/error-eof-in-tag/ast.json | 2 +- .../ast.json | 2 +- .../fixtures/ast/error-message-empty/ast.json | 2 +- .../ast/error-message-outside/ast.json | 2 +- .../ast/error-missing-end-tag-name/ast.json | 2 +- .../ast.json | 2 +- .../ast.json | 2 +- .../ast.json | 2 +- .../error-null-character-reference/ast.json | 2 +- .../ast.json | 2 +- .../ast.json | 2 +- .../ast.json | 2 +- .../ast.json | 2 +- .../error-unexpected-solidus-in-tag/ast.json | 2 +- .../ast.json | 2 +- .../error-v-on-function-expression/ast.json | 2 +- .../ast/error-x-invalid-end-tag/ast.json | 2 +- .../ast/error-x-invalid-namespace/ast.json | 2 +- .../ast/expression-container-only/ast.json | 2 +- test/fixtures/ast/filter-empty/ast.json | 2 +- test/fixtures/ast/filters-2/ast.json | 2 +- test/fixtures/ast/filters-3/ast.json | 2 +- test/fixtures/ast/filters-4/ast.json | 2 +- test/fixtures/ast/filters-error-2/ast.json | 2 +- test/fixtures/ast/filters-error/ast.json | 2 +- .../ast/filters-opt-filter-off/ast.json | 2 +- .../ast/filters-opt-filter-on/ast.json | 2 +- test/fixtures/ast/filters/ast.json | 2 +- .../fixtures/ast/foreignobject-lower/ast.json | 2 +- test/fixtures/ast/foreignobject/ast.json | 2 +- test/fixtures/ast/hole-in-array/ast.json | 2 +- .../html-entities-in-static-places/ast.json | 2 +- .../ast/html-entities-lone-amp/ast.json | 2 +- .../ast/html-entities-mapping/ast.json | 2 +- .../ast/html-entities-numeric/ast.json | 2 +- .../ast.json | 2 +- .../ast.json | 2 +- .../ast.json | 2 +- test/fixtures/ast/html-entities/ast.json | 2 +- test/fixtures/ast/input-component/ast.json | 2 +- test/fixtures/ast/link-component/ast.json | 2 +- test/fixtures/ast/math/ast.json | 2 +- .../fixtures/ast/multiple-scripts-11/ast.json | 6 +- test/fixtures/ast/multiple-scripts-2/ast.json | 6 +- test/fixtures/ast/multiple-scripts-5/ast.json | 3 +- test/fixtures/ast/multiple-scripts-7/ast.json | 6 +- test/fixtures/ast/multiple-scripts-8/ast.json | 6 +- .../multiple-scripts-with-export02/ast.json | 9 +- .../multiple-scripts-with-export03/ast.json | 18 +- .../multiple-scripts-with-export04/ast.json | 3 +- .../ast/multiple-scripts-with-ts/ast.json | 380 ++-- .../ast.json | 2 +- test/fixtures/ast/mustache-errors/ast.json | 2 +- .../ast.json | 2 +- .../ast.json | 2 +- .../ast.json | 2 +- test/fixtures/ast/mustache-in-lt-gt/ast.json | 2 +- .../ast.json | 2 +- .../fixtures/ast/mustache-not-closed/ast.json | 8 +- .../fixtures/ast/mustache-with-space/ast.json | 2 +- test/fixtures/ast/mustache/ast.json | 2 +- test/fixtures/ast/no-filters/ast.json | 2 +- .../ast/not-closing-elements/ast.json | 2 +- .../parser-option-multiple-parsers-1/ast.json | 634 +++---- .../services.json | 4 +- .../parser-option-multiple-parsers-3/ast.json | 316 ++-- .../services.json | 4 +- .../ast.json | 338 ++-- .../services.json | 4 +- test/fixtures/ast/pug/ast.json | 2 +- test/fixtures/ast/raw-names/ast.json | 2 +- test/fixtures/ast/rawtext/ast.json | 2 +- .../ast/script-setup-example01/ast.json | 6 +- .../ast/script-setup-example05/ast.json | 6 +- .../ast/script-setup-example06/ast.json | 6 +- .../ast/script-setup-example07/ast.json | 3 +- .../ast/script-setup-example09/ast.json | 3 +- .../ast/self-closing-elements/ast.json | 2 +- test/fixtures/ast/slot-scope-default/ast.json | 2 +- .../ast/slot-scope-destructuring/ast.json | 2 +- .../ast/slot-scope-multi-parameters/ast.json | 2 +- .../ast/slot-scope-rest-parameter/ast.json | 2 +- test/fixtures/ast/slot-scope/ast.json | 2 +- .../ast/svg-attrs-camel-case/ast.json | 2 +- test/fixtures/ast/svg-attrs-colon/ast.json | 2 +- test/fixtures/ast/svg-namespace/ast.json | 2 +- test/fixtures/ast/svg-upper/ast.json | 2 +- test/fixtures/ast/table/ast.json | 2 +- .../text-and-expression-container/ast.json | 2 +- test/fixtures/ast/text/ast.json | 2 +- test/fixtures/ast/textarea/ast.json | 2 +- .../ast.json | 369 ++-- .../scope.json | 506 ++++-- .../services.json | 4 +- .../ast/v-bind-prop-shorthand/ast.json | 2 +- .../scope.json | 24 +- .../scope.json | 24 +- .../ast/v-bind-sequence-expression/ast.json | 2 +- .../ast/v-bind-spread-element/ast.json | 2 +- .../parser-options.json | 3 +- .../ast/v-for-directives-error/ast.json | 2 +- .../ast/v-for-directives-index/ast.json | 2 +- .../ast.json | 2 +- .../parser-options.json | 3 +- .../parser-options.json | 3 +- test/fixtures/ast/v-for-directives/ast.json | 2 +- .../v-on-arrow-function-expression.1/ast.json | 2 +- .../v-on-arrow-function-expression.2/ast.json | 2 +- .../ast.json | 2 +- .../v-on-async-function-expression/ast.json | 2 +- .../ast/v-on-function-expression/ast.json | 2 +- .../ast/v-on-multiple-statements/ast.json | 2 +- .../ast/v-on-object-expression/ast.json | 2 +- test/fixtures/ast/v-on-simple-path.1/ast.json | 2 +- test/fixtures/ast/v-on-simple-path.2/ast.json | 2 +- test/fixtures/ast/v-on-simple-path.3/ast.json | 2 +- test/fixtures/ast/v-on-simple-path.4/ast.json | 2 +- test/fixtures/ast/v-pre/ast.json | 2 +- .../ast/v-slot-default-shorthand/ast.json | 2 +- test/fixtures/ast/v-slot-default/ast.json | 2 +- .../ast/v-slot-named-shorthand/ast.json | 2 +- test/fixtures/ast/v-slot-named/ast.json | 2 +- test/fixtures/ast/vue3.3-generic-1/ast.json | 369 ++-- test/fixtures/ast/vue3.3-generic-1/scope.json | 554 ++++-- test/fixtures/ast/vue3.3-generic-2/ast.json | 1000 ++++++----- test/fixtures/ast/vue3.3-generic-2/scope.json | 808 ++++++--- test/fixtures/ast/vue3.3-generic-3/ast.json | 1191 +++++++------ test/fixtures/ast/vue3.3-generic-3/scope.json | 832 ++++++--- .../ast/vue3.3-generic-4-with-spaces/ast.json | 1217 +++++++------ .../ast/vue3.3-generic-5-with-spaces/ast.json | 1343 +++++++------- .../vue3.3-generic-6-with-default/ast.json | 1573 +++++++++-------- .../ast/vue3.3-generic-7-with-arrow/ast.json | 1104 ++++++------ .../document-fragment.json | 9 +- .../document-fragment.json | 6 +- .../style-variables01/document-fragment.json | 3 +- .../style-variables02/document-fragment.json | 6 +- .../style-variables05/document-fragment.json | 9 +- .../vue3.3-generic-1/document-fragment.json | 132 +- .../vue3.3-generic-2/document-fragment.json | 260 +-- .../vue3.3-generic-2/tree.json | 10 +- .../vue3.3-generic-3/document-fragment.json | 474 ++--- .../vue3.3-generic-3/tree.json | 20 +- .../document-fragment.json | 534 +++--- .../vue3.3-generic-4-with-spaces/tree.json | 20 +- .../document-fragment.json | 842 ++++----- .../vue3.3-generic-5-with-spaces/tree.json | 30 +- .../document-fragment.json | 1386 ++++++++------- .../vue3.3-generic-6-with-default/tree.json | 40 +- .../document-fragment.json | 1350 +++++++------- .../vue3.3-generic-7-with-arrow/tree.json | 20 +- test/fixtures/eslint | 1 - test/index.js | 371 ++-- test/integrations.js | 16 +- test/lib/eslint-compat.js | 3 - test/parser-options.js | 53 +- 279 files changed, 15381 insertions(+), 12756 deletions(-) delete mode 100644 .eslintignore delete mode 100644 .eslintrc.yml create mode 100644 eslint.config.mjs delete mode 100644 src/common/linter-require.ts delete mode 100644 test/core-rules.js delete mode 100644 test/espree.js delete mode 160000 test/fixtures/eslint diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index 537f1533..00000000 --- a/.eslintignore +++ /dev/null @@ -1,10 +0,0 @@ -/.nyc_output -/.temp -/coverage -node_modules -/src/external -/src/html/util -/test/fixtures -/test/temp -/index.d.ts -/index.js diff --git a/.eslintrc.yml b/.eslintrc.yml deleted file mode 100644 index 9a375797..00000000 --- a/.eslintrc.yml +++ /dev/null @@ -1,878 +0,0 @@ -plugins: - - prettier -extends: - - plugin:node-dependencies/recommended - - plugin:jsonc/recommended-with-jsonc -globals: - root: off -parserOptions: - ecmaFeatures: - globalReturn: false - sourceType: module - ecmaVersion: 2020 - loggerFn: false - project: tsconfig.json -rules: - prettier/prettier: - - error - - tabWidth: 4 - semi: false - trailingComma: all - - usePrettierrc: false -overrides: - - files: "*.json" - rules: - prettier/prettier: - - error - - tabWidth: 2 - semi: false - trailingComma: all - - usePrettierrc: false - - files: "**/*.ts" - plugins: - - "@typescript-eslint" - - eslint-comments - - node - parser: "@typescript-eslint/parser" - rules: - prettier/prettier: - - error - - tabWidth: 4 - semi: false - trailingComma: all - parser: typescript - - usePrettierrc: false - "@typescript-eslint/consistent-type-imports": error - no-duplicate-imports: off - "@typescript-eslint/no-duplicate-imports": error - "@typescript-eslint/no-var-requires": off - node/no-unsupported-features/es-syntax: - - off - - ignores: - - modules - - dynamicImport - node/no-extraneous-import: - - error - node/file-extension-in-import: - - error - - always - - .js: never - .ts: never - .tsx: never - node/no-missing-import: - - error - node/no-unpublished-import: - - error - node/exports-style: - - error - - module.exports - node/no-callback-literal: - - off - node/no-deprecated-api: - - error - node/no-exports-assign: - - error - node/no-extraneous-require: - - error - node/no-missing-require: - - error - node/no-unpublished-bin: - - error - node/no-unpublished-require: - - error - node/no-unsupported-features/es-builtins: - - error - node/no-unsupported-features/node-builtins: - - error - node/prefer-global/buffer: - - error - node/prefer-global/console: - - error - node/prefer-global/process: - - error - node/prefer-global/text-decoder: - - off - node/prefer-global/text-encoder: - - off - node/prefer-global/url-search-params: - - off - node/prefer-global/url: - - off - node/prefer-promises/dns: - - off - node/prefer-promises/fs: - - off - node/process-exit-as-throw: - - error - node/shebang: - - error - "@typescript-eslint/adjacent-overload-signatures": - - error - "@typescript-eslint/array-type": - - error - "@typescript-eslint/await-thenable": - - error - "@typescript-eslint/ban-ts-comment": - - error - "@typescript-eslint/consistent-type-assertions": - - error - "@typescript-eslint/explicit-member-accessibility": - - error - "@typescript-eslint/no-array-constructor": - - error - "@typescript-eslint/no-empty-interface": - - error - "@typescript-eslint/no-extraneous-class": - - error - "@typescript-eslint/no-floating-promises": - - error - "@typescript-eslint/no-for-in-array": - - error - "@typescript-eslint/no-inferrable-types": - - error - "@typescript-eslint/no-misused-new": - - error - "@typescript-eslint/no-misused-promises": - - error - "@typescript-eslint/no-parameter-properties": - - error - "@typescript-eslint/no-require-imports": - - error - "@typescript-eslint/no-this-alias": - - error - - allowDestructuring: true - "@typescript-eslint/no-unnecessary-qualifier": - - error - "@typescript-eslint/no-unnecessary-type-arguments": - - error - "@typescript-eslint/no-unnecessary-type-assertion": - - error - "@typescript-eslint/prefer-function-type": - - off - "@typescript-eslint/prefer-includes": - - error - "@typescript-eslint/prefer-namespace-keyword": - - error - "@typescript-eslint/prefer-readonly": - - off - "@typescript-eslint/prefer-regexp-exec": - - error - "@typescript-eslint/prefer-string-starts-ends-with": - - error - "@typescript-eslint/restrict-plus-operands": - - error - "@typescript-eslint/require-array-sort-compare": - - error - "@typescript-eslint/triple-slash-reference": - - error - "@typescript-eslint/unbound-method": - - off - - ignoreStatic: true - "@typescript-eslint/unified-signatures": - - off - camelcase: - - off - no-empty-function: - - off - "@typescript-eslint/no-empty-function": - - error - no-useless-constructor: - - off - "@typescript-eslint/no-useless-constructor": - - error - require-await: - - off - "@typescript-eslint/require-await": - - error - func-style: - - off - - declaration - init-declarations: - - off - lines-between-class-members: - - off - no-dupe-class-members: - - off - no-invalid-this: - - off - no-loop-func: - - off - no-redeclare: - - off - - builtinGlobals: true - no-undef: - - off - - typeof: true - no-unused-vars: - - off - - args: all - argsIgnorePattern: "^_(?:[^_].*)?$" - caughtErrors: all - vars: all - varsIgnorePattern: "^_(?:[^_].*)?$" - no-use-before-define: - - off - - nofunc - one-var: - - off - - initialized: never - uninitialized: always - "@typescript-eslint/ban-types": - - off - "@typescript-eslint/brace-style": - - off - "@typescript-eslint/consistent-type-definitions": - - off - "@typescript-eslint/explicit-function-return-type": - - off - "@typescript-eslint/func-call-spacing": - - off - "@typescript-eslint/generic-type-naming": - - off - "@typescript-eslint/indent": - - off - "@typescript-eslint/member-delimiter-style": - - off - "@typescript-eslint/member-ordering": - - off - "@typescript-eslint/no-explicit-any": - - off - "@typescript-eslint/no-extra-parens": - - off - "@typescript-eslint/no-magic-numbers": - - off - "@typescript-eslint/no-namespace": - - off - "@typescript-eslint/no-non-null-assertion": - - off - "@typescript-eslint/no-type-alias": - - off - "@typescript-eslint/no-unnecessary-condition": - - off - "@typescript-eslint/no-unused-vars": - - off - "@typescript-eslint/no-use-before-define": - - off - "@typescript-eslint/prefer-for-of": - - off - "@typescript-eslint/promise-function-async": - - off - "@typescript-eslint/quotes": - - off - "@typescript-eslint/semi": - - off - "@typescript-eslint/strict-boolean-expressions": - - off - "@typescript-eslint/type-annotation-spacing": - - off - "@typescript-eslint/typedef": - - off - arrow-body-style: - - error - constructor-super: - - error - default-param-last: - - error - no-class-assign: - - error - no-const-assign: - - error - no-import-assign: - - error - no-new-symbol: - - error - no-template-curly-in-string: - - error - no-this-before-super: - - error - no-useless-computed-key: - - error - no-useless-rename: - - error - no-var: - - error - object-shorthand: - - error - - always - - avoidExplicitReturnArrows: true - prefer-arrow-callback: - - error - prefer-const: - - error - prefer-numeric-literals: - - error - prefer-rest-params: - - error - prefer-spread: - - error - prefer-template: - - error - require-unicode-regexp: - - error - require-yield: - - error - symbol-description: - - error - class-methods-use-this: - - warn - arrow-parens: - - off - arrow-spacing: - - off - generator-star-spacing: - - off - no-confusing-arrow: - - off - rest-spread-spacing: - - off - template-curly-spacing: - - off - yield-star-spacing: - - off - no-inner-declarations: - - off - - functions - no-restricted-imports: - - off - prefer-destructuring: - - off - sort-imports: - - off - accessor-pairs: - - error - - enforceForClassMembers: true - getWithoutSet: false - setWithoutGet: true - array-callback-return: - - error - consistent-return: - - error - curly: - - error - default-case: - - error - dot-notation: - - error - eqeqeq: - - error - - always - - "null": ignore - for-direction: - - error - getter-return: - - error - linebreak-style: - - error - - unix - max-statements-per-line: - - error - - max: 1 - multiline-comment-style: - - error - - separate-lines - new-cap: - - error - no-alert: - - error - no-array-constructor: - - error - no-async-promise-executor: - - error - no-caller: - - error - no-case-declarations: - - error - no-compare-neg-zero: - - error - no-cond-assign: - - error - no-constant-condition: - - error - no-control-regex: - - error - no-debugger: - - error - no-delete-var: - - error - no-div-regex: - - error - no-dupe-args: - - error - no-dupe-keys: - - error - no-duplicate-case: - - error - no-else-return: - - error - no-empty: - - error - no-empty-character-class: - - error - no-empty-pattern: - - error - no-eval: - - error - no-ex-assign: - - error - no-extend-native: - - error - no-extra-bind: - - error - no-extra-boolean-cast: - - error - no-extra-label: - - error - no-fallthrough: - - error - no-func-assign: - - error - no-global-assign: - - error - no-implicit-coercion: - - error - no-implicit-globals: - - error - no-implied-eval: - - error - no-invalid-regexp: - - error - no-irregular-whitespace: - - error - - skipComments: false - skipRegExps: false - skipStrings: false - skipTemplates: false - no-iterator: - - error - no-label-var: - - error - no-lone-blocks: - - error - no-lonely-if: - - error - no-misleading-character-class: - - error - no-mixed-operators: - - error - - groups: - - - - "&" - - "|" - - ^ - - "~" - - << - - ">>" - - ">>>" - - - - "&&" - - "||" - allowSamePrecedence: true - no-new: - - error - no-new-object: - - error - no-new-require: - - error - no-new-wrappers: - - error - no-obj-calls: - - error - no-octal: - - error - no-octal-escape: - - error - no-param-reassign: - - error - - props: false - no-process-env: - - error - no-process-exit: - - error - no-prototype-builtins: - - error - no-regex-spaces: - - error - no-restricted-properties: - - error - - property: __count__ - - property: __noSuchMethod__ - - property: __parent__ - - property: __defineGetter__ - - property: __defineSetter__ - - property: __lookupGetter__ - - property: __lookupSetter__ - no-return-assign: - - error - no-return-await: - - error - no-script-url: - - error - no-self-assign: - - error - - props: true - no-self-compare: - - error - no-sequences: - - error - "@typescript-eslint/no-shadow": - - error - - builtinGlobals: true - hoist: functions - no-shadow-restricted-names: - - error - no-sparse-arrays: - - error - no-tabs: - - error - no-throw-literal: - - error - no-unexpected-multiline: - - error - no-unmodified-loop-condition: - - error - no-unneeded-ternary: - - error - no-unreachable: - - error - no-unsafe-finally: - - error - no-unsafe-negation: - - error - - enforceForOrderingRelations: true - no-unused-expressions: - - error - no-unused-labels: - - error - no-useless-call: - - error - no-useless-catch: - - error - no-useless-concat: - - error - no-useless-escape: - - error - no-useless-return: - - error - no-void: - - error - no-with: - - error - padding-line-between-statements: - - error - - blankLine: always - next: "*" - prev: directive - - blankLine: always - next: function - prev: "*" - - blankLine: always - next: "*" - prev: function - prefer-promise-reject-errors: - - error - prefer-regex-literals: - - error - quotes: - - error - - double - - avoidEscape: true - radix: - - error - require-atomic-updates: - - error - spaced-comment: - - error - - always - - block: - balanced: true - markers: - - eslint - - eslint-env - - eslint-disable - - eslint-enable - - exported - - globals - - istanbul - line: - exceptions: - - "-" - - = - markers: - - eslint-disable-line - - eslint-disable-next-line - - istanbul - - "TODO:" - - "FIXME:" - strict: - - error - - global - use-isnan: - - error - - enforceForIndexOf: true - enforceForSwitchCase: true - valid-typeof: - - error - - requireStringLiterals: true - yoda: - - error - - never - - exceptRange: true - onlyEquality: false - complexity: - - warn - - max: 16 - max-nested-callbacks: - - warn - - max: 4 - max-params: - - warn - - max: 8 - no-console: - - warn - - allow: - - assert - - error - array-bracket-newline: - - off - array-bracket-spacing: - - off - array-element-newline: - - off - block-spacing: - - off - brace-style: - - off - comma-dangle: - - off - comma-spacing: - - off - comma-style: - - off - computed-property-spacing: - - off - dot-location: - - off - eol-last: - - off - func-call-spacing: - - off - function-call-argument-newline: - - off - function-paren-newline: - - off - implicit-arrow-linebreak: - - off - indent: - - off - jsx-quotes: - - off - key-spacing: - - off - keyword-spacing: - - off - multiline-ternary: - - off - new-parens: - - off - newline-per-chained-call: - - off - no-extra-parens: - - off - no-extra-semi: - - off - no-floating-decimal: - - off - no-mixed-spaces-and-tabs: - - off - no-multi-spaces: - - off - no-multiple-empty-lines: - - off - no-trailing-spaces: - - off - no-whitespace-before-property: - - off - nonblock-statement-body-position: - - off - object-curly-newline: - - off - object-curly-spacing: - - off - object-property-newline: - - off - one-var-declaration-per-line: - - off - operator-linebreak: - - off - padded-blocks: - - off - quote-props: - - off - semi: - - off - semi-spacing: - - off - semi-style: - - off - space-before-blocks: - - off - space-before-function-paren: - - off - space-in-parens: - - off - space-infix-ops: - - off - space-unary-ops: - - off - switch-colon-spacing: - - off - template-tag-spacing: - - off - unicode-bom: - - off - wrap-iife: - - off - wrap-regex: - - off - block-scoped-var: - - off - callback-return: - - off - capitalized-comments: - - off - consistent-this: - - off - func-name-matching: - - off - func-names: - - off - global-require: - - off - guard-for-in: - - off - handle-callback-err: - - off - id-blacklist: - - off - id-length: - - off - id-match: - - off - line-comment-position: - - off - lines-around-comment: - - off - max-classes-per-file: - - off - max-depth: - - off - max-len: - - off - max-lines: - - off - max-lines-per-function: - - off - max-statements: - - off - no-await-in-loop: - - off - no-bitwise: - - off - no-buffer-constructor: - - off - no-continue: - - off - no-eq-null: - - off - no-inline-comments: - - off - no-labels: - - off - no-magic-numbers: - - off - no-mixed-requires: - - off - no-multi-assign: - - off - no-multi-str: - - off - no-negated-condition: - - off - no-nested-ternary: - - off - no-new-func: - - off - no-path-concat: - - off - no-plusplus: - - off - no-proto: - - off - no-restricted-globals: - - off - no-restricted-modules: - - off - no-restricted-syntax: - - off - no-sync: - - off - no-ternary: - - off - no-undef-init: - - off - no-undefined: - - off - no-underscore-dangle: - - off - no-warning-comments: - - off - operator-assignment: - - off - prefer-named-capture-group: - - off - prefer-object-spread: - - off - sort-keys: - - off - sort-vars: - - off - vars-on-top: - - off - eslint-comments/disable-enable-pair: - - error - eslint-comments/no-aggregating-enable: - - error - eslint-comments/no-duplicate-disable: - - error - eslint-comments/no-restricted-disable: - - off - eslint-comments/no-unlimited-disable: - - error - eslint-comments/no-unused-disable: - - error - eslint-comments/no-unused-enable: - - error - eslint-comments/no-use: - - error - - allow: - - eslint-disable - - eslint-disable-line - - eslint-disable-next-line - - eslint-enable - - eslint-env - - globals - - files: "typings/**" - rules: - node/no-missing-import: - - error - - allowModules: - - estree - - files: package.json - rules: - "@mysticatea/prettier": off -settings: - node: - tryExtensions: - - .ts - - .js - - .json diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index ffe41eed..2e31fdae 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -13,15 +13,15 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Checkout submodules run: git submodule update --init - name: Install Node.js - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: - node-version: 16 + node-version: 'lts/*' - name: Install Packages - run: npm install && cd test/fixtures/eslint && npm install + run: npm install - name: Lint run: npm run -s lint @@ -29,42 +29,34 @@ jobs: name: Test strategy: matrix: - eslint: [7, 8] - node: [16, 17] + eslint: [9] + node: [18, 20, 21, 'lts/*'] os: [ubuntu-latest] include: # On other platforms - - eslint: 7 - node: 16 + - eslint: 9 + node: 'lts/*' os: windows-latest - - eslint: 7 - node: 16 - os: macos-12 - # On old Node.js versions - - eslint: 7 - node: 14 - os: ubuntu-latest + - eslint: 9 + node: 'lts/*' + os: macos-latest # On old ESLint versions - - eslint: 6 - node: 16 - os: ubuntu-latest - # On the minimum supported ESLint/Node.js version - - eslint: 6 - node: 14 + - eslint: 8 + node: 'lts/*' os: ubuntu-latest runs-on: ${{ matrix.os }} steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Checkout submodules run: git submodule update --init - name: Install Node.js v${{ matrix.node }} - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: ${{ matrix.node }} - name: Install Packages - run: npm install --legacy-peer-deps + run: npm install -f - name: Install ESLint v${{ matrix.eslint }} run: node scripts/ci-install-eslint ${{ matrix.eslint }} - name: Build @@ -77,17 +69,17 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Checkout submodules run: git submodule update --init - - name: Install Node.js v16 - uses: actions/setup-node@v3 + - name: Install Node.js + uses: actions/setup-node@v4 with: - node-version: 16 + node-version: 'lts/*' - name: Install Packages run: npm install - - name: Install ESLint v8 - run: node scripts/ci-install-eslint 8.12.0 + - name: Install ESLint v9 + run: node scripts/ci-install-eslint 9 - name: Build run: npm run -s build - name: Test diff --git a/.gitmodules b/.gitmodules index 45ed6b45..e69de29b 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +0,0 @@ -[submodule "test/fixtures/eslint"] - path = test/fixtures/eslint - url = https://github.com/eslint/eslint.git diff --git a/.vscode/settings.json b/.vscode/settings.json index 72446f43..7ff99747 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,3 +1,12 @@ { - "typescript.tsdk": "node_modules/typescript/lib" + "typescript.tsdk": "node_modules/typescript/lib", + "eslint.validate": [ + "javascript", + "javascriptreact", + "typescript", + "typescriptreact", + "vue", + "json", + "jsonc" + ] } diff --git a/README.md b/README.md index c0f76f2f..3a2146e1 100644 --- a/README.md +++ b/README.md @@ -17,9 +17,6 @@ This parser allows us to lint the `